@vtex/faststore 0.0.8 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/README.md +0 -1
- package/dist/actions.json +48 -1
- package/dist/catalog.json +1397 -1594
- package/dist/cli/index.d.ts +66 -28
- package/dist/cli/index.js +7371 -512
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/server-runtime.js +41 -60
- package/dist/cli/server-runtime.js.map +1 -1
- package/dist/client.d.ts +3 -3
- package/dist/client.js +2 -2
- package/dist/components.d.ts +67 -56
- package/dist/components.js +64 -53
- package/dist/content-types.json +5886 -555
- package/dist/core/dist/define-component.d.ts +7 -2
- package/dist/core/dist/define-content-type.d.ts +50 -2
- package/dist/core/dist/define-content-type.js +107 -3
- package/dist/core/dist/define-content-type.js.map +1 -1
- package/dist/core/dist/index.d.ts +2 -2
- package/dist/docs/access-code-field.md +1 -1
- package/dist/docs/access-code-sign-in.md +126 -77
- package/dist/docs/account-address-book.md +210 -95
- package/dist/docs/account-entry-point.md +4 -4
- package/dist/docs/account-menu.md +16 -17
- package/dist/docs/account-saved-cards.md +306 -0
- package/dist/docs/alert-dialog.md +3 -1
- package/dist/docs/avatar.md +4 -2
- package/dist/docs/billing-address.md +99 -30
- package/dist/docs/binding-switcher.md +157 -0
- package/dist/docs/buy-button.md +7 -8
- package/dist/docs/card-entry.md +42 -29
- package/dist/docs/card-summary.md +185 -0
- package/dist/docs/cardholder-document.md +5 -3
- package/dist/docs/carousel.md +5 -4
- package/dist/docs/cart-destination.md +251 -0
- package/dist/docs/cart-item.md +48 -15
- package/dist/docs/cart-totalizer.md +8 -6
- package/dist/docs/cart.md +240 -39
- package/dist/docs/challenge-return.md +135 -0
- package/dist/docs/client-preferences-fieldset.md +10 -5
- package/dist/docs/client-preferences.md +31 -8
- package/dist/docs/client-profile-fieldset.md +20 -6
- package/dist/docs/client-profile.md +12 -3
- package/dist/docs/copy-text.md +9 -7
- package/dist/docs/document-field.md +1 -1
- package/dist/docs/email-field.md +2 -1
- package/dist/docs/email-identification.md +12 -2
- package/dist/docs/footer-copyright.md +4 -2
- package/dist/docs/footer-social.md +1 -1
- package/dist/docs/form.md +54 -18
- package/dist/docs/free-shipping-progress.md +18 -13
- package/dist/docs/identity-edit.md +8 -2
- package/dist/docs/identity-summary.md +18 -5
- package/dist/docs/incentives.md +2 -2
- package/dist/docs/installments.md +46 -32
- package/dist/docs/logo.md +1 -1
- package/dist/docs/my-account-profile.md +16 -11
- package/dist/docs/navigation-link.md +5 -3
- package/dist/docs/order-cancel.md +3 -1
- package/dist/docs/order-delivery-address.md +7 -5
- package/dist/docs/order-delivery-group.md +1 -3
- package/dist/docs/order-details-back.md +1 -1
- package/dist/docs/order-details-header.md +1 -4
- package/dist/docs/order-invoice-download.md +60 -0
- package/dist/docs/order-list-row.md +1 -1
- package/dist/docs/order-list-search.md +13 -20
- package/dist/docs/order-list-views.md +11 -17
- package/dist/docs/order-list.md +12 -5
- package/dist/docs/order-payment.md +9 -7
- package/dist/docs/order-placed-date.md +1 -1
- package/dist/docs/order-placed-payment-summary.md +28 -15
- package/dist/docs/order-placed.md +49 -14
- package/dist/docs/order-progress.md +1 -1
- package/dist/docs/order-status-badge.md +20 -9
- package/dist/docs/order-summary.md +2 -2
- package/dist/docs/order-tracking-link.md +58 -0
- package/dist/docs/payment-method-badges.md +32 -6
- package/dist/docs/payment-methods.md +2 -2
- package/dist/docs/payment.md +36 -17
- package/dist/docs/phone-field.md +4 -4
- package/dist/docs/place-order.md +84 -36
- package/dist/docs/postal-code-field.md +3 -1
- package/dist/docs/pricing.md +21 -23
- package/dist/docs/product-gallery.md +19 -20
- package/dist/docs/product-information.md +14 -10
- package/dist/docs/product-list.md +7 -6
- package/dist/docs/product-shelf.md +7 -1
- package/dist/docs/promotion.md +4 -2
- package/dist/docs/region.md +23 -15
- package/dist/docs/save-card.md +7 -6
- package/dist/docs/saved-cards.md +65 -36
- package/dist/docs/select.md +3 -4
- package/dist/docs/shipping-address.md +57 -21
- package/dist/docs/shipping-simulator.md +53 -15
- package/dist/docs/sign-in-disclosure.md +176 -0
- package/dist/docs/sign-in-form.md +78 -47
- package/dist/docs/sign-in-redirect.md +5 -3
- package/dist/docs/sign-in.md +173 -0
- package/dist/docs/toast.md +45 -16
- package/dist/docs/variant-selector.md +15 -11
- package/dist/graphql/types.d.ts +4 -14
- package/dist/index.d.ts +3 -2
- package/dist/internal/client.d.ts +4 -3
- package/dist/internal/client.js +5 -2
- package/dist/internal/server.d.ts +10 -5
- package/dist/internal/server.js +9 -4
- package/dist/matter/access-code-sign-in/access-code-sign-in.d.ts +250 -66
- package/dist/matter/access-code-sign-in/access-code-sign-in.js +459 -188
- package/dist/matter/access-code-sign-in/access-code-sign-in.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-delete.d.ts +78 -40
- package/dist/matter/account-address-book/account-address-book-delete.js +86 -50
- package/dist/matter/account-address-book/account-address-book-delete.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-deliverability.d.ts +21 -4
- package/dist/matter/account-address-book/account-address-book-deliverability.js +45 -17
- package/dist/matter/account-address-book/account-address-book-deliverability.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-form-parts.d.ts +74 -19
- package/dist/matter/account-address-book/account-address-book-form-parts.js +77 -26
- package/dist/matter/account-address-book/account-address-book-form-parts.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book-profile-notice.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-book-profile-notice.js +55 -28
- package/dist/matter/account-address-book/account-address-book-profile-notice.js.map +1 -1
- package/dist/matter/account-address-book/account-address-book.d.ts +67 -14
- package/dist/matter/account-address-book/account-address-book.js +74 -33
- package/dist/matter/account-address-book/account-address-book.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country-switch.js +3 -3
- package/dist/matter/account-address-book/account-address-country-switch.js.map +1 -1
- package/dist/matter/account-address-book/account-address-country.d.ts +66 -20
- package/dist/matter/account-address-book/account-address-country.js +83 -49
- package/dist/matter/account-address-book/account-address-country.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form-context.d.ts +8 -4
- package/dist/matter/account-address-book/account-address-form-context.js.map +1 -1
- package/dist/matter/account-address-book/account-address-form.d.ts +468 -45
- package/dist/matter/account-address-book/account-address-form.js +518 -155
- package/dist/matter/account-address-book/account-address-form.js.map +1 -1
- package/dist/matter/account-address-book/account-address-record.d.ts +27 -6
- package/dist/matter/account-address-book/account-address-record.js +32 -17
- package/dist/matter/account-address-book/account-address-record.js.map +1 -1
- package/dist/matter/account-menu/account-menu.d.ts +34 -17
- package/dist/matter/account-menu/account-menu.js +46 -54
- package/dist/matter/account-menu/account-menu.js.map +1 -1
- package/dist/matter/account-menu-identity/account-menu-identity.js +1 -1
- package/dist/matter/account-saved-cards/account-saved-cards.d.ts +463 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js +1011 -0
- package/dist/matter/account-saved-cards/account-saved-cards.js.map +1 -0
- package/dist/matter/billing-address/billing-address.d.ts +156 -74
- package/dist/matter/billing-address/billing-address.js +227 -156
- package/dist/matter/billing-address/billing-address.js.map +1 -1
- package/dist/matter/breadcrumb/breadcrumb.d.ts +21 -3
- package/dist/matter/breadcrumb/breadcrumb.js +24 -9
- package/dist/matter/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/matter/buy-button/buy-button.d.ts +8 -11
- package/dist/matter/buy-button/buy-button.js +10 -19
- package/dist/matter/buy-button/buy-button.js.map +1 -1
- package/dist/matter/card-entry/card-capture.js +12 -4
- package/dist/matter/card-entry/card-capture.js.map +1 -1
- package/dist/matter/card-entry/card-entry.d.ts +123 -32
- package/dist/matter/card-entry/card-entry.js +348 -221
- package/dist/matter/card-entry/card-entry.js.map +1 -1
- package/dist/matter/cart/cart-namespace.d.ts +11 -1
- package/dist/matter/cart/cart-namespace.js +11 -1
- package/dist/matter/cart/cart-namespace.js.map +1 -1
- package/dist/matter/cart/cart.d.ts +416 -45
- package/dist/matter/cart/cart.js +782 -101
- package/dist/matter/cart/cart.js.map +1 -1
- package/dist/matter/cart-destination/cart-destination.d.ts +233 -0
- package/dist/matter/cart-destination/cart-destination.js +703 -0
- package/dist/matter/cart-destination/cart-destination.js.map +1 -0
- package/dist/matter/cart-item/cart-item.d.ts +145 -16
- package/dist/matter/cart-item/cart-item.js +230 -54
- package/dist/matter/cart-item/cart-item.js.map +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js +1 -1
- package/dist/matter/cart-item-compositions/cart-item-compositions.js.map +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js +1 -1
- package/dist/matter/cart-item-customizations/cart-item-customizations.js.map +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js +1 -1
- package/dist/matter/cart-item-discounts/cart-item-discounts.js.map +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js +1 -1
- package/dist/matter/cart-item-seller-info/cart-item-seller-info.js.map +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js +1 -1
- package/dist/matter/cart-item-variations/cart-item-variations.js.map +1 -1
- package/dist/matter/cart-totalizer/cart-totalizer.d.ts +43 -9
- package/dist/matter/cart-totalizer/cart-totalizer.js +49 -19
- package/dist/matter/cart-totalizer/cart-totalizer.js.map +1 -1
- package/dist/matter/challenge-return/challenge-return.d.ts +62 -0
- package/dist/matter/challenge-return/challenge-return.js +241 -0
- package/dist/matter/challenge-return/challenge-return.js.map +1 -0
- package/dist/matter/client-preferences/client-preferences-fieldset.d.ts +86 -17
- package/dist/matter/client-preferences/client-preferences-fieldset.js +126 -54
- package/dist/matter/client-preferences/client-preferences-fieldset.js.map +1 -1
- package/dist/matter/client-preferences/client-preferences.d.ts +50 -7
- package/dist/matter/client-preferences/client-preferences.js +84 -15
- package/dist/matter/client-preferences/client-preferences.js.map +1 -1
- package/dist/matter/client-profile/client-profile.d.ts +44 -9
- package/dist/matter/client-profile/client-profile.js +64 -24
- package/dist/matter/client-profile/client-profile.js.map +1 -1
- package/dist/matter/client-profile-form/client-profile-fieldset.d.ts +119 -22
- package/dist/matter/client-profile-form/client-profile-fieldset.js +161 -73
- package/dist/matter/client-profile-form/client-profile-fieldset.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-accordion.d.ts +49 -4
- package/dist/matter/delivery-options/delivery-options-accordion.js +67 -14
- package/dist/matter/delivery-options/delivery-options-accordion.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options-controller.d.ts +69 -9
- package/dist/matter/delivery-options/delivery-options-controller.js +80 -14
- package/dist/matter/delivery-options/delivery-options-controller.js.map +1 -1
- package/dist/matter/delivery-options/delivery-options.d.ts +37 -2
- package/dist/matter/delivery-options/delivery-options.js +75 -12
- package/dist/matter/delivery-options/delivery-options.js.map +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.d.ts +1 -0
- package/dist/matter/delivery-options/use-delivery-option-selection.js +1 -1
- package/dist/matter/delivery-options/use-delivery-option-selection.js.map +1 -1
- package/dist/matter/email-identification/email-identification.d.ts +25 -3
- package/dist/matter/email-identification/email-identification.js +49 -12
- package/dist/matter/email-identification/email-identification.js.map +1 -1
- package/dist/matter/free-shipping-progress/free-shipping-progress.d.ts +85 -10
- package/dist/matter/free-shipping-progress/free-shipping-progress.js +153 -53
- package/dist/matter/free-shipping-progress/free-shipping-progress.js.map +1 -1
- package/dist/matter/identity-edit/identity-edit.d.ts +52 -10
- package/dist/matter/identity-edit/identity-edit.js +47 -19
- package/dist/matter/identity-edit/identity-edit.js.map +1 -1
- package/dist/matter/identity-summary/identity-summary.d.ts +76 -22
- package/dist/matter/identity-summary/identity-summary.js +95 -45
- package/dist/matter/identity-summary/identity-summary.js.map +1 -1
- package/dist/matter/installments/installments-select.d.ts +98 -16
- package/dist/matter/installments/installments-select.js +156 -48
- package/dist/matter/installments/installments-select.js.map +1 -1
- package/dist/matter/installments/installments.d.ts +96 -16
- package/dist/matter/installments/installments.js +115 -40
- package/dist/matter/installments/installments.js.map +1 -1
- package/dist/matter/installments/use-installments-selection.d.ts +1 -0
- package/dist/matter/installments/use-installments-selection.js +8 -3
- package/dist/matter/installments/use-installments-selection.js.map +1 -1
- package/dist/matter/my-account-profile/my-account-profile.d.ts +358 -103
- package/dist/matter/my-account-profile/my-account-profile.js +370 -174
- package/dist/matter/my-account-profile/my-account-profile.js.map +1 -1
- package/dist/matter/order-cancel/order-cancel.d.ts +65 -19
- package/dist/matter/order-cancel/order-cancel.js +118 -51
- package/dist/matter/order-cancel/order-cancel.js.map +1 -1
- package/dist/matter/order-delivery-address/order-delivery-address.d.ts +8 -18
- package/dist/matter/order-delivery-address/order-delivery-address.js +14 -23
- package/dist/matter/order-delivery-address/order-delivery-address.js.map +1 -1
- package/dist/matter/order-delivery-group/order-delivery-group.d.ts +40 -24
- package/dist/matter/order-delivery-group/order-delivery-group.js +64 -74
- package/dist/matter/order-delivery-group/order-delivery-group.js.map +1 -1
- package/dist/matter/order-details-header/order-details-header.d.ts +32 -15
- package/dist/matter/order-details-header/order-details-header.js +66 -58
- package/dist/matter/order-details-header/order-details-header.js.map +1 -1
- package/dist/matter/order-invoice-download/order-invoice-download.d.ts +78 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js +173 -0
- package/dist/matter/order-invoice-download/order-invoice-download.js.map +1 -0
- package/dist/matter/order-list/order-list.d.ts +164 -19
- package/dist/matter/order-list/order-list.js +229 -87
- package/dist/matter/order-list/order-list.js.map +1 -1
- package/dist/matter/order-list-row/order-list-row.d.ts +6 -1
- package/dist/matter/order-list-row/order-list-row.js +3 -2
- package/dist/matter/order-list-row/order-list-row.js.map +1 -1
- package/dist/matter/order-list-search/order-list-search.d.ts +18 -26
- package/dist/matter/order-list-search/order-list-search.js +30 -69
- package/dist/matter/order-list-search/order-list-search.js.map +1 -1
- package/dist/matter/order-list-views/order-list-views.d.ts +15 -22
- package/dist/matter/order-list-views/order-list-views.js +22 -68
- package/dist/matter/order-list-views/order-list-views.js.map +1 -1
- package/dist/matter/order-payment/order-payment.d.ts +33 -10
- package/dist/matter/order-payment/order-payment.js +44 -39
- package/dist/matter/order-payment/order-payment.js.map +1 -1
- package/dist/matter/order-placed/order-placed-deliveries.d.ts +144 -12
- package/dist/matter/order-placed/order-placed-deliveries.js +115 -40
- package/dist/matter/order-placed/order-placed-deliveries.js.map +1 -1
- package/dist/matter/order-placed/order-placed.d.ts +198 -31
- package/dist/matter/order-placed/order-placed.js +230 -139
- package/dist/matter/order-placed/order-placed.js.map +1 -1
- package/dist/matter/order-placed-date/order-placed-date.d.ts +5 -8
- package/dist/matter/order-placed-date/order-placed-date.js +7 -8
- package/dist/matter/order-placed-date/order-placed-date.js.map +1 -1
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.d.ts +90 -17
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js +93 -117
- package/dist/matter/order-placed-payment-summary/order-placed-payment-summary.js.map +1 -1
- package/dist/matter/order-progress/order-progress.d.ts +19 -8
- package/dist/matter/order-progress/order-progress.js +37 -45
- package/dist/matter/order-progress/order-progress.js.map +1 -1
- package/dist/matter/order-summary/order-summary.d.ts +19 -9
- package/dist/matter/order-summary/order-summary.js +38 -44
- package/dist/matter/order-summary/order-summary.js.map +1 -1
- package/dist/matter/order-tracking-link/order-tracking-link.d.ts +43 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js +107 -0
- package/dist/matter/order-tracking-link/order-tracking-link.js.map +1 -0
- package/dist/matter/payment/payment-card-capture.js +17 -10
- package/dist/matter/payment/payment-card-capture.js.map +1 -1
- package/dist/matter/payment/payment-controller.d.ts +4 -2
- package/dist/matter/payment/payment-controller.js +30 -9
- package/dist/matter/payment/payment-controller.js.map +1 -1
- package/dist/matter/payment/payment-method-badges.js +1 -1
- package/dist/matter/payment/payment.d.ts +69 -19
- package/dist/matter/payment/payment.js +101 -35
- package/dist/matter/payment/payment.js.map +1 -1
- package/dist/matter/payment/use-payment-method-selection.d.ts +25 -4
- package/dist/matter/payment/use-payment-method-selection.js +94 -32
- package/dist/matter/payment/use-payment-method-selection.js.map +1 -1
- package/dist/matter/payment/use-payment-submit-gate.d.ts +14 -3
- package/dist/matter/payment/use-payment-submit-gate.js +47 -8
- package/dist/matter/payment/use-payment-submit-gate.js.map +1 -1
- package/dist/matter/place-order/place-order.d.ts +171 -57
- package/dist/matter/place-order/place-order.js +376 -185
- package/dist/matter/place-order/place-order.js.map +1 -1
- package/dist/matter/pricing/pricing.d.ts +152 -13
- package/dist/matter/pricing/pricing.js +153 -52
- package/dist/matter/pricing/pricing.js.map +1 -1
- package/dist/matter/product-information/product-information.d.ts +27 -4
- package/dist/matter/product-information/product-information.js +32 -15
- package/dist/matter/product-information/product-information.js.map +1 -1
- package/dist/matter/product-list/product-list.d.ts +24 -6
- package/dist/matter/product-list/product-list.js +32 -26
- package/dist/matter/product-list/product-list.js.map +1 -1
- package/dist/matter/product-shelf/product-shelf.d.ts +8 -3
- package/dist/matter/product-shelf/product-shelf.js +111 -10
- package/dist/matter/product-shelf/product-shelf.js.map +1 -1
- package/dist/matter/region/region.d.ts +33 -16
- package/dist/matter/region/region.js +59 -52
- package/dist/matter/region/region.js.map +1 -1
- package/dist/matter/save-card/save-card.d.ts +43 -8
- package/dist/matter/save-card/save-card.js +61 -23
- package/dist/matter/save-card/save-card.js.map +1 -1
- package/dist/matter/saved-cards/saved-cards.d.ts +113 -21
- package/dist/matter/saved-cards/saved-cards.js +349 -77
- package/dist/matter/saved-cards/saved-cards.js.map +1 -1
- package/dist/matter/shipping-address/address-payload.js +25 -0
- package/dist/matter/shipping-address/address-payload.js.map +1 -0
- package/dist/matter/shipping-address/country-descriptors.js +71 -71
- package/dist/matter/shipping-address/country-descriptors.js.map +1 -1
- package/dist/matter/shipping-address/library-country-descriptors.js +136 -0
- package/dist/matter/shipping-address/library-country-descriptors.js.map +1 -0
- package/dist/matter/shipping-address/shipping-address.d.ts +312 -45
- package/dist/matter/shipping-address/shipping-address.js +443 -188
- package/dist/matter/shipping-address/shipping-address.js.map +1 -1
- package/dist/matter/shipping-simulator/shipping-simulator.d.ts +251 -25
- package/dist/matter/shipping-simulator/shipping-simulator.js +261 -51
- package/dist/matter/shipping-simulator/shipping-simulator.js.map +1 -1
- package/dist/matter/sign-in/sign-in.d.ts +108 -0
- package/dist/matter/sign-in/sign-in.js +285 -0
- package/dist/matter/sign-in/sign-in.js.map +1 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.d.ts +81 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js +232 -0
- package/dist/matter/sign-in-disclosure/sign-in-disclosure.js.map +1 -0
- package/dist/matter/sign-in-form/sign-in-form.d.ts +93 -62
- package/dist/matter/sign-in-form/sign-in-form.js +134 -144
- package/dist/matter/sign-in-form/sign-in-form.js.map +1 -1
- package/dist/particles/binding-switcher/binding-switcher.d.ts +59 -0
- package/dist/particles/binding-switcher/binding-switcher.js +194 -0
- package/dist/particles/binding-switcher/binding-switcher.js.map +1 -0
- package/dist/particles/card-summary/card-network.d.ts +17 -0
- package/dist/particles/card-summary/card-network.js +25 -0
- package/dist/particles/card-summary/card-network.js.map +1 -0
- package/dist/particles/card-summary/card-summary.d.ts +113 -0
- package/dist/particles/card-summary/card-summary.js +221 -0
- package/dist/particles/card-summary/card-summary.js.map +1 -0
- package/dist/particles/carousel/carousel.d.ts +99 -11
- package/dist/particles/carousel/carousel.js +103 -35
- package/dist/particles/carousel/carousel.js.map +1 -1
- package/dist/particles/copy-text/copy-text.js +5 -15
- package/dist/particles/copy-text/copy-text.js.map +1 -1
- package/dist/particles/dialog/dialog.d.ts +14 -6
- package/dist/particles/dialog/dialog.js +6 -3
- package/dist/particles/dialog/dialog.js.map +1 -1
- package/dist/particles/drawer/drawer.js +1 -1
- package/dist/particles/drawer/drawer.js.map +1 -1
- package/dist/particles/email-field/email-field.d.ts +2 -1
- package/dist/particles/email-field/email-field.js +2 -1
- package/dist/particles/email-field/email-field.js.map +1 -1
- package/dist/particles/footer-link-group/footer-link-group.js +1 -0
- package/dist/particles/footer-link-group/footer-link-group.js.map +1 -1
- package/dist/particles/footer-social/footer-social.d.ts +1 -1
- package/dist/particles/footer-social/footer-social.js +1 -1
- package/dist/particles/footer-social/footer-social.js.map +1 -1
- package/dist/particles/form/form.d.ts +85 -13
- package/dist/particles/form/form.js +91 -42
- package/dist/particles/form/form.js.map +1 -1
- package/dist/particles/gallery/gallery.d.ts +129 -12
- package/dist/particles/gallery/gallery.js +121 -34
- package/dist/particles/gallery/gallery.js.map +1 -1
- package/dist/particles/incentives/incentives.d.ts +1 -1
- package/dist/particles/incentives/incentives.js +1 -1
- package/dist/particles/incentives/incentives.js.map +1 -1
- package/dist/particles/order-details-back/order-details-back.d.ts +5 -3
- package/dist/particles/order-details-back/order-details-back.js +8 -10
- package/dist/particles/order-details-back/order-details-back.js.map +1 -1
- package/dist/particles/order-status-badge/order-status-badge.d.ts +3 -3
- package/dist/particles/order-status-badge/order-status-badge.js +4 -20
- package/dist/particles/order-status-badge/order-status-badge.js.map +1 -1
- package/dist/particles/password-field/password-field.d.ts +1 -1
- package/dist/particles/password-field/password-field.js +2 -4
- package/dist/particles/password-field/password-field.js.map +1 -1
- package/dist/particles/payment-methods/payment-methods.d.ts +1 -1
- package/dist/particles/payment-methods/payment-methods.js +1 -1
- package/dist/particles/payment-methods/payment-methods.js.map +1 -1
- package/dist/particles/phone-field/phone-field.d.ts +4 -4
- package/dist/particles/phone-field/phone-field.js +8 -11
- package/dist/particles/phone-field/phone-field.js.map +1 -1
- package/dist/particles/spinner/spinner.d.ts +24 -4
- package/dist/particles/spinner/spinner.js +25 -9
- package/dist/particles/spinner/spinner.js.map +1 -1
- package/dist/particles/switch/switch.d.ts +4 -1
- package/dist/particles/switch/switch.js +3 -1
- package/dist/particles/switch/switch.js.map +1 -1
- package/dist/particles/toast/toast.d.ts +49 -9
- package/dist/particles/toast/toast.js +81 -15
- package/dist/particles/toast/toast.js.map +1 -1
- package/dist/schema.graphql +461 -89
- package/dist/sdk/actions/index.d.ts +3 -1
- package/dist/sdk/actions/index.js +3 -1
- package/dist/sdk/actions/locale-action-provider.d.ts +16 -0
- package/dist/sdk/actions/locale-action-provider.js +20 -0
- package/dist/sdk/actions/locale-action-provider.js.map +1 -0
- package/dist/sdk/actions/saved-card-action-provider.d.ts +12 -0
- package/dist/sdk/actions/saved-card-action-provider.js +16 -0
- package/dist/sdk/actions/saved-card-action-provider.js.map +1 -0
- package/dist/sdk/actions/types.d.ts +6 -2
- package/dist/sdk/address/address-fields.js +4 -4
- package/dist/sdk/address/address-fields.js.map +1 -1
- package/dist/sdk/address/constants.js +1 -6
- package/dist/sdk/address/constants.js.map +1 -1
- package/dist/sdk/address/messages.js +44 -44
- package/dist/sdk/address/messages.js.map +1 -1
- package/dist/sdk/address/postal-code.js +15 -2
- package/dist/sdk/address/postal-code.js.map +1 -1
- package/dist/sdk/address/types.d.ts +5 -3
- package/dist/sdk/address/validate-address.js +3 -3
- package/dist/sdk/address/validate-address.js.map +1 -1
- package/dist/sdk/analytics/use-analytics-actions.d.ts +1 -1
- package/dist/sdk/analytics/use-analytics-actions.js.map +1 -1
- package/dist/sdk/cache/storefront-cache.js +2 -1
- package/dist/sdk/cache/storefront-cache.js.map +1 -1
- package/dist/sdk/cart/operations.d.ts +2 -1
- package/dist/sdk/cart/operations.js +55 -1
- package/dist/sdk/cart/operations.js.map +1 -1
- package/dist/sdk/cart/optimistic.d.ts +30 -7
- package/dist/sdk/cart/optimistic.js +78 -41
- package/dist/sdk/cart/optimistic.js.map +1 -1
- package/dist/sdk/cart/use-cart-actions.d.ts +7 -0
- package/dist/sdk/cart/use-cart-actions.js +61 -15
- package/dist/sdk/cart/use-cart-actions.js.map +1 -1
- package/dist/sdk/cart/use-cart-sync-sales-channel.js +70 -0
- package/dist/sdk/cart/use-cart-sync-sales-channel.js.map +1 -0
- package/dist/sdk/data/index.js +2 -2
- package/dist/sdk/data/reactive-list-item-data-provider.js +2 -2
- package/dist/sdk/generated/gql.js +16 -12
- package/dist/sdk/generated/gql.js.map +1 -1
- package/dist/sdk/generated/graphql.d.ts +197 -51
- package/dist/sdk/generated/graphql.js +2318 -91
- package/dist/sdk/generated/graphql.js.map +1 -1
- package/dist/sdk/i18n/format-error-code.js +23 -0
- package/dist/sdk/i18n/format-error-code.js.map +1 -0
- package/dist/sdk/i18n/message-formatter.d.ts +22 -0
- package/dist/sdk/i18n/message-formatter.js +140 -0
- package/dist/sdk/i18n/message-formatter.js.map +1 -0
- package/dist/sdk/i18n/use-message-formatter.d.ts +8 -0
- package/dist/sdk/i18n/use-message-formatter.js +18 -0
- package/dist/sdk/i18n/use-message-formatter.js.map +1 -0
- package/dist/sdk/identity/use-identity-actions.js.map +1 -1
- package/dist/sdk/locale/binding-switch-provider.d.ts +13 -0
- package/dist/sdk/locale/binding-switch-provider.js +20 -0
- package/dist/sdk/locale/binding-switch-provider.js.map +1 -0
- package/dist/sdk/locale/use-locale-actions.d.ts +16 -0
- package/dist/sdk/locale/use-locale-actions.js +70 -0
- package/dist/sdk/locale/use-locale-actions.js.map +1 -0
- package/dist/sdk/navigation/binding-switch.d.ts +39 -0
- package/dist/sdk/navigation/binding-switch.js +129 -0
- package/dist/sdk/navigation/binding-switch.js.map +1 -0
- package/dist/sdk/navigation/decode-route-params.d.ts +11 -0
- package/dist/sdk/navigation/decode-route-params.js +32 -0
- package/dist/sdk/navigation/decode-route-params.js.map +1 -0
- package/dist/sdk/navigation/redirect.d.ts +2 -0
- package/dist/sdk/navigation/redirect.js +19 -1
- package/dist/sdk/navigation/redirect.js.map +1 -1
- package/dist/sdk/navigation/types.d.ts +13 -0
- package/dist/sdk/payment/bin-format.js +20 -0
- package/dist/sdk/payment/bin-format.js.map +1 -0
- package/dist/sdk/payment/challenge-return.js +37 -0
- package/dist/sdk/payment/challenge-return.js.map +1 -0
- package/dist/sdk/payment/confirmation-last-four.js +39 -0
- package/dist/sdk/payment/confirmation-last-four.js.map +1 -0
- package/dist/sdk/payment/gateway.d.ts +1 -1
- package/dist/sdk/payment/gateway.js +8 -2
- package/dist/sdk/payment/gateway.js.map +1 -1
- package/dist/sdk/payment/operations.d.ts +1 -0
- package/dist/sdk/payment/operations.js +28 -6
- package/dist/sdk/payment/operations.js.map +1 -1
- package/dist/sdk/payment/resumed-purchase.d.ts +1 -0
- package/dist/sdk/payment/resumed-purchase.js +119 -0
- package/dist/sdk/payment/resumed-purchase.js.map +1 -0
- package/dist/sdk/payment/security-code-mask.js +16 -23
- package/dist/sdk/payment/security-code-mask.js.map +1 -1
- package/dist/sdk/payment/submission-registry.js +6 -2
- package/dist/sdk/payment/submission-registry.js.map +1 -1
- package/dist/sdk/payment/use-payment-actions.d.ts +18 -3
- package/dist/sdk/payment/use-payment-actions.js +23 -3
- package/dist/sdk/payment/use-payment-actions.js.map +1 -1
- package/dist/sdk/payment/use-place-order.d.ts +10 -2
- package/dist/sdk/payment/use-place-order.js +138 -76
- package/dist/sdk/payment/use-place-order.js.map +1 -1
- package/dist/sdk/provider/storefront-provider.d.ts +1 -7
- package/dist/sdk/provider/storefront-provider.js +4 -11
- package/dist/sdk/provider/storefront-provider.js.map +1 -1
- package/dist/sdk/saved-cards/operations.d.ts +16 -0
- package/dist/sdk/saved-cards/operations.js +41 -0
- package/dist/sdk/saved-cards/operations.js.map +1 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.d.ts +26 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js +86 -0
- package/dist/sdk/saved-cards/use-saved-card-actions.js.map +1 -0
- package/dist/sdk/seo/entity-landing.d.ts +24 -0
- package/dist/sdk/seo/entity-landing.js +30 -0
- package/dist/sdk/seo/entity-landing.js.map +1 -0
- package/dist/sdk/seo/page-alternates.d.ts +8 -5
- package/dist/sdk/seo/page-alternates.js +11 -14
- package/dist/sdk/seo/page-alternates.js.map +1 -1
- package/dist/sdk/seo/search-landing.d.ts +42 -0
- package/dist/sdk/seo/search-landing.js +85 -0
- package/dist/sdk/seo/search-landing.js.map +1 -0
- package/dist/sdk/session/mock-session.d.ts +9 -0
- package/dist/sdk/session/mock-session.js +31 -0
- package/dist/sdk/session/mock-session.js.map +1 -0
- package/dist/sdk/session/read-server-session.d.ts +3 -0
- package/dist/sdk/session/read-server-session.js +5 -0
- package/dist/sdk/session/read-server-session.js.map +1 -1
- package/dist/sdk/session/return-path-segment.d.ts +10 -0
- package/dist/sdk/session/return-path-segment.js +15 -0
- package/dist/sdk/session/return-path-segment.js.map +1 -0
- package/dist/sdk/session/use-session-actions.js.map +1 -1
- package/dist/sdk/shipping/shipping-operations.d.ts +1 -1
- package/dist/sdk/shipping/shipping-operations.js +13 -0
- package/dist/sdk/shipping/shipping-operations.js.map +1 -1
- package/dist/sdk/shipping/use-cart-shipping-simulation.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-actions.js.map +1 -1
- package/dist/sdk/shipping/use-shipping-simulation.js.map +1 -1
- package/dist/sdk/state/cart.d.ts +9 -2
- package/dist/sdk/state/cart.js +9 -2
- package/dist/sdk/state/cart.js.map +1 -1
- package/dist/utils/safe-href.d.ts +2 -0
- package/package.json +4 -3
- package/skills/storefront-asset/SKILL.md +2 -2
- package/skills/storefront-asset/references/api-side.md +27 -14
- package/skills/storefront-asset/references/findings.md +5 -2
- package/src/styles/tailwind.css +9 -2
- package/dist/matter/shipping-address/country-descriptors.d.ts +0 -1
- package/dist/message-locales.json +0 -7
- package/dist/sdk/i18n/client.d.ts +0 -4
- package/dist/sdk/i18n/client.js +0 -4
- package/dist/sdk/i18n/locales.d.ts +0 -8
- package/dist/sdk/i18n/locales.js +0 -57
- package/dist/sdk/i18n/locales.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.js +0 -164
- package/dist/sdk/i18n/messages/en-US.js.map +0 -1
- package/dist/sdk/i18n/messages/en-US.json +0 -159
- package/dist/sdk/i18n/messages/en-US.json.d.ts +0 -163
- package/dist/sdk/i18n/messages/es-ES.js +0 -164
- package/dist/sdk/i18n/messages/es-ES.js.map +0 -1
- package/dist/sdk/i18n/messages/es-ES.json +0 -159
- package/dist/sdk/i18n/messages/pt-BR.js +0 -164
- package/dist/sdk/i18n/messages/pt-BR.js.map +0 -1
- package/dist/sdk/i18n/messages/pt-BR.json +0 -159
- package/dist/sdk/i18n/provider.d.ts +0 -1
- package/dist/sdk/i18n/provider.js +0 -30
- package/dist/sdk/i18n/provider.js.map +0 -1
- package/dist/sdk/i18n/server.d.ts +0 -28
- package/dist/sdk/i18n/server.js +0 -59
- package/dist/sdk/i18n/server.js.map +0 -1
- package/dist/utils/resolve-authored-copy.js +0 -18
- package/dist/utils/resolve-authored-copy.js.map +0 -1
- package/dist/utils/substitute-template.js +0 -33
- package/dist/utils/substitute-template.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.js","names":[],"sources":["../../../src/matter/cart/cart.tsx"],"sourcesContent":["'use client';\n\nimport type { ErrorLike } from '@apollo/client';\nimport { useApolloClient, useReactiveVar } from '@apollo/client/react';\nimport { type ContentValue, defineComponent, defineContentType } from '@vtex/fs-core';\nimport { useLinkStatus } from 'next/link';\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n createContext,\n isValidElement,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { DrawerClose, type DrawerRootProps } from '../../particles/drawer/drawer.js';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { Image } from '../../particles/image/image.js';\nimport { NavigationLink, type NavigationLinkProps } from '../../particles/navigation-link/navigation-link.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport type { AppliedCoupon, CartEntity, Money } from '../../sdk/cart/operations.js';\nimport { readCartFromCache } from '../../sdk/cart/use-cart-actions.js';\nimport { useCartValidateOnOpen } from '../../sdk/cart/use-cart-validate-on-open.js';\nimport { awaitCartWrites } from '../../sdk/cart/write-gate.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ListItemRefContext } from '../../sdk/data/list-item-ref-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport {\n cartCouponErrorsVar,\n cartLastAddVar,\n cartUserErrorsVar,\n miniCartOpenVar,\n orderFormIdVar,\n} from '../../sdk/state/cart.js';\n\n// ---------------------------------------------------------------------------\n// Content models — merchant-editable copy. `$content` wins when a content entry is present; the\n// schema prop of the same name is the fallback in a non-CMS store, which issues no content read at\n// all (rfc-content-only-cms-integration). The disclaimer deliberately ships no default copy: legal\n// or conditional wording the package invented would assert conditions no merchant agreed to.\n// ---------------------------------------------------------------------------\n\nexport const CartDisclaimerContent = defineContentType({\n id: 'cart-disclaimer',\n title: 'Cart Disclaimer',\n description: 'Conditions, limits, or legal wording shown in the cart before checkout.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: { type: 'string', minLength: 1, title: 'Disclaimer text' },\n },\n },\n});\n\n// The checkout CTA's wording is a merchant decision, so it comes from a content entry with the\n// schema prop as the non-CMS fallback. Label only: re-pointing checkout is not a copy decision, so\n// the destination stays an authored prop and never joins this channel. No `default` here — an\n// untouched slot has to stay unfilled, or a prefilled entry would outrank the label a store already\n// authored.\nexport const CartCheckoutLabelContent = defineContentType({\n id: 'cart-checkout-label',\n title: 'Cart Checkout Label',\n description: 'Editorial label for the checkout call to action.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['label'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Checkout label' },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type CartDataContextValue = Readonly<{\n cart: CartEntity | null;\n /**\n * Cart query error surfaced by the reactive root. `cart` is non-null on the server (`Cart!`),\n * so `cart: null` + `error` means the fetch failed — not an empty cart.\n */\n error: ErrorLike | null;\n}>;\n\nexport type CartRootProps = ComponentPropsWithRef<'div'> & {\n /**\n * Cart entity slice forwarded by the reactive runtime (`ReactiveDataProvider`) — it is the value\n * of the `cart` top-level field on `CartData on Query`, not the wrapping `{ cart: … }` shape.\n * Receives `null` when the cart is not yet seeded (e.g. server returned no cart for the current\n * session, or `orderFormIdVar` is still null).\n */\n $data?: CartEntity | null;\n};\n\nexport type CartListProps = ComponentPropsWithRef<'div'> & {\n /** Number of CartItemSkeleton rows to render while the cart is still loading (FR-7). */\n skeletonCount?: number;\n};\n\nexport type CartTotalProps = ComponentPropsWithRef<'span'> & {\n label?: string;\n};\n\nexport type CartCountProps = ComponentPropsWithRef<'span'> & {\n template?: string;\n};\n\nexport type CartErrorProps = ComponentPropsWithRef<'div'>;\n\n// `$content` is omitted from the inherited props on purpose: NavigationLink's model also carries the\n// destination and target, and this CTA's content channel is the label alone.\nexport type CartGoCheckoutProps = Omit<NavigationLinkProps, 'href' | '$content'> & {\n href?: PageRef | string;\n /** Authored fallback for the button label; `children` still works for stores that label it there. */\n label?: string;\n /** Merchant-authored label, sliced from the page/layout content entry; wins over the label prop and\n * over children. Absent in a non-CMS store — the props are the fallback. */\n $content?: ContentValue<typeof CartCheckoutLabelContent>;\n /** Injected by the compiler from `actions: { cart: ['validate'] }`; the stock-validation write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartCouponFormProps = ComponentPropsWithRef<'form'> & {\n placeholder?: string;\n applyLabel?: string;\n /** Injected by the compiler from `actions: { cart: ['applyCoupon'] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartAppliedCouponsProps = ComponentPropsWithRef<'div'> & {\n /** Injected by the compiler from `actions: { cart: ['removeCoupon'] }`; forwarded to the built-in chip's remove control. */\n $actions?: ComponentActions;\n};\n\nexport type CartCouponRemoveProps = ComponentPropsWithRef<'button'> & {\n /**\n * The coupon code this control removes. Normally supplied by the enclosing CartAppliedCoupons\n * chip via context; pass it explicitly to override or to use the control standalone.\n */\n code?: string;\n /** Injected by the compiler from `actions: { cart: ['removeCoupon'] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartCouponErrorProps = ComponentPropsWithRef<'div'>;\n\nexport type CartDisclaimerProps = ComponentPropsWithRef<'p'> & {\n /**\n * Authored fallback, rendered when no CMS entry supplies the notice. Ranks below `children`:\n * `children ?? $content?.text ?? text`.\n */\n text?: string;\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: ContentValue<typeof CartDisclaimerContent>;\n};\n\nexport type CartCheckoutGuardProps = ComponentPropsWithRef<'div'>;\nexport type CartLoadingProps = ComponentPropsWithRef<'div'>;\nexport type CartEmptyProps = ComponentPropsWithRef<'div'>;\nexport type CartFilledProps = ComponentPropsWithRef<'div'>;\n\nexport type CartEmptyMessageProps = ComponentPropsWithRef<'p'> & {\n /** Authored fallback, rendered when no CMS entry supplies the message. */\n text?: string;\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: ContentValue<typeof CartEmptyMessageContent>;\n};\n\nexport type CartContinueShoppingProps = ComponentPropsWithRef<'button'> & {\n /** Authored fallback, rendered when no CMS entry supplies the label. Children win over both. */\n label?: string;\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: ContentValue<typeof CartContinueShoppingContent>;\n};\n\nexport type CartUnavailableCountProps = ComponentPropsWithRef<'span'> & {\n /** Output format; `{count}` is replaced by the integer count. */\n template?: string;\n};\n\nexport type CartRemoveUnavailableProps = ComponentPropsWithRef<'button'> & {\n /** Injected by the compiler from `actions: { cart: ['removeItems'] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartOpenOnAddProps = {\n children?: ReactNode;\n /** Injected by the compiler from `actions: { cart: ['validate'] }`; drives the validate-on-open call. */\n $actions?: ComponentActions;\n};\n\nexport type CartRedirectOnAddProps = {\n href?: PageRef | string;\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset (T7)\n// ---------------------------------------------------------------------------\n\n// CartRoot is the reactive read root. It fetches item refs plus the per-item scalars the cart-level\n// aggregate reads cross-cuttingly — `quantity` and `gift` (CartCount, which counts only the lines the\n// shopper added) and `variant.availability` (CartCheckoutGuard) — plus the cart totals, messages, and\n// coupons. The display-only per-item scalars (prices, name, sku, image, product) are owned by\n// CartItemRoot's own `reactive-list-item` fragment and merge un-aliased onto the shared\n// `cart { items }` path (ADR-0012 Option B). The MUTATION fragment (`CartFragment` →\n// `CartItemFragment` in operations.ts) stays whole so writes normalize a complete `CartItem` into the\n// cache for the per-item `useFragment` to read — which is why `gift` joins it too.\nconst fragment = graphql(`\n fragment CartData on Query {\n cart {\n __typename\n id\n items {\n __typename\n id\n quantity\n gift\n variant {\n __typename\n availability\n }\n }\n totalizers {\n __typename\n id\n name\n value {\n ...MoneyFragment\n }\n }\n total {\n ...MoneyFragment\n }\n messages {\n __typename\n code\n text\n status\n }\n appliedCoupons {\n code\n isUnmatchedCondition\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Money formatting — shared by the cart aggregate and the cart-item leaves\n// ---------------------------------------------------------------------------\n\nexport function formatPrice(value: number, locale: string, currency: string): string {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value);\n}\n\n// ---------------------------------------------------------------------------\n// Cart total value context — provided by CartRoot and CartTotalizerRoot so that\n// CartTotal works inside either root without a circular import.\n// ---------------------------------------------------------------------------\n\nexport const CartTotalValueContext = createContext<Money | null>(null);\n\n// ---------------------------------------------------------------------------\n// Cart data context (read-only cart entity + query error)\n// ---------------------------------------------------------------------------\n\nconst CART_DATA_UNSET = Symbol('CartDataContextUnset');\n\nconst CartDataContextInternal = createContext<CartDataContextValue | typeof CART_DATA_UNSET>(CART_DATA_UNSET);\n\nexport const CartDataContext = CartDataContextInternal as React.Context<CartDataContextValue>;\n\n/**\n * Read the current cart entity and query error from the nearest `CartRoot`. Throws when called\n * outside a `CartRoot` subtree.\n *\n * Cart *writes* no longer flow through this context — they are dispatched via the compiler-injected\n * `$actions.cart.*` prop (the `cart` action namespace), which reads/writes the cache directly and\n * needs no `CartRoot` ancestor (docs/storefront-core/reference-free-particle-model.md § Write side — actions, ADR-0010). This hook is reads only.\n */\nexport function useCart(): CartDataContextValue {\n const ctx = useContext(CartDataContextInternal);\n if (ctx === CART_DATA_UNSET) {\n throw new Error('useCart() must be used inside a <CartRoot> subtree.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Cart coupon context (provided by CartAppliedCoupons per applied coupon)\n// ---------------------------------------------------------------------------\n\nconst CartCouponContext = createContext<AppliedCoupon | null>(null);\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const CartRootDefinition = defineComponent<CartRootProps>({\n name: 'CartRoot',\n importPath: '@vtex/faststore/components',\n component: CartRoot,\n fragment,\n fetchStrategy: 'reactive',\n editor: { label: 'Cart Root', category: 'commerce' },\n schema: {},\n guideline:\n 'Cart data provider hosted by the layout (shared shell), wrapping the slot so every page consumes its context; exactly one per tree — do not place it as a page root. To build a mini-cart, wrap this CartRoot subtree in a modal DrawerRoot: the header carries a DrawerTrigger with a CartCount badge, the DrawerPopup body is a CartList line-item template, and its footer is CartTotal plus CartGoCheckout. The mini-cart is this layout composition, not a dedicated component. See cart.md.',\n});\n\nexport const CartListDefinition = defineComponent<CartListProps>({\n name: 'CartList',\n importPath: '@vtex/faststore/components',\n component: CartList,\n editor: { label: 'Cart List', category: 'commerce' },\n schema: {\n skeletonCount: { type: 'number', default: 3, label: 'Skeleton Count' },\n },\n // Declares the per-line iteration context (ADR-0009): a `reactive-list-item` sub-matter placed\n // inside CartList `requiresContext: 'cart-item'`, and the build-time `validateContextConstraints`\n // walk reports a misplaced one. Runtime: CartList publishes each line's ref via ListItemRefContext.\n providesContext: 'cart-item',\n guideline:\n 'Renders its children once per cart item; wrap the line-item template in a CartItemRoot and place CartItem* components inside it to define the template (e.g. CartItemImage, CartItemName, CartItemPrice, a CartItemQuantity stepper, CartItemRemove). While the cart is loading it renders skeletonCount CartItemSkeleton placeholders instead. In a mini-cart it is the scrollable body of the DrawerPopup. Must be inside CartRoot.',\n});\n\nexport const CartTotalDefinition = defineComponent<CartTotalProps>({\n name: 'CartTotal',\n importPath: '@vtex/faststore/components',\n component: CartTotal,\n editor: { label: 'Cart Total', category: 'commerce' },\n schema: {\n label: { type: 'string', label: 'Label' },\n },\n guideline:\n 'The single root-agnostic grand-total component: renders the cart grand total, formatted from the active storefront context, reading the value from the nearest CartRoot or CartTotalizerRoot. Set the optional label prop to render a label alongside the value (e.g. \"Total\"); omit it to render the value alone. In a mini-cart it sits in the DrawerPopup footer alongside CartGoCheckout, inside a CartCheckoutGuard, so the total is visible at the checkout button.',\n});\n\nexport const CartCountDefinition = defineComponent<CartCountProps>({\n name: 'CartCount',\n importPath: '@vtex/faststore/components',\n component: CartCount,\n editor: { label: 'Cart Count', category: 'commerce' },\n schema: {\n template: { type: 'string', default: '{count}', label: 'Template' },\n },\n guideline:\n \"Renders the total item count in the cart; use the template prop to customize the format (e.g. '{count} produtos'). Gift lines are excluded from the count — a promotional gift is not something the shopper added — so a cart holding only gifts shows 0. In a mini-cart, place it as the badge on the header DrawerTrigger and again in the DrawerPopup header. Must be inside CartRoot.\",\n});\n\nexport const CartErrorDefinition = defineComponent<CartErrorProps>({\n name: 'CartError',\n importPath: '@vtex/faststore/components',\n component: CartError,\n editor: { label: 'Cart Error', category: 'commerce' },\n schema: {},\n guideline: 'Inline error banner that surfaces cart mutation errors. Must be inside CartRoot.',\n});\n\nexport const CartGoCheckoutDefinition = defineComponent<CartGoCheckoutProps>({\n name: 'CartGoCheckout',\n importPath: '@vtex/faststore/components',\n component: CartGoCheckout,\n content: CartCheckoutLabelContent,\n editor: { label: 'Cart Go Checkout', category: 'commerce' },\n schema: {\n href: { type: 'link', default: { standard: 'checkout' }, label: 'Checkout URL' },\n label: { type: 'string', default: 'Checkout', label: 'Checkout label' },\n },\n actions: { cart: ['validate'] },\n guideline:\n 'Navigation link to the checkout page (default href the checkout page); use as the checkout CTA inside the cart summary. In a mini-cart it is the DrawerPopup footer CTA, next to CartTotal. The button wording is merchant-editable content: a CMS entry wins, then the label prop (default \"Checkout\"), then children — so a store that labels the button through children keeps working and a CMS save overrides it without a deploy. The destination is not content-editable: href stays an authored prop, because re-pointing checkout is not a copy decision. Before routing it runs a stock validation and only navigates when the re-checked cart has no unavailable line; a validation that cannot run falls open and navigates anyway. During a client-side route transition to checkout it surfaces a loading state on its content wrapper as aria-busy plus data-fs-cart-go-checkout-pending, and while the pre-checkout validation runs it exposes data-fs-cart-go-checkout-validating — there is no built-in spinner, so opt into one by styling those attributes (e.g. composing a Spinner). For an external or hard checkout navigation there is no client-side transition, so the loading state simply does not show (a graceful no-op). The enriched footer checkout CTA is CartCheckoutGuard wrapping CartTotal and this CartGoCheckout: the guard makes the CTA inert (data-fs-cart-checkout-blocked) while any item is unavailable, and CartTotal shows the grand total at the button. Must be inside CartRoot.',\n});\n\nexport const CartCouponFormDefinition = defineComponent<CartCouponFormProps>({\n name: 'CartCouponForm',\n importPath: '@vtex/faststore/components',\n component: CartCouponForm,\n editor: { label: 'Cart Coupon Form', category: 'commerce' },\n schema: {\n placeholder: { type: 'string', label: 'Placeholder' },\n applyLabel: { type: 'string', label: 'Apply Label' },\n },\n actions: { cart: ['applyCoupon'] },\n guideline:\n 'Coupon code input plus an apply button; root-agnostic (dispatches $actions.cart.applyCoupon). While an apply is in flight it disables the input and button and exposes data-fs-cart-coupon-pending. In a mini-cart it sits in the DrawerPopup footer above the totals; pair it with CartAppliedCoupons (the applied list) and CartCouponError (the error banner). Must be inside CartRoot.',\n});\n\nexport const CartAppliedCouponsDefinition = defineComponent<CartAppliedCouponsProps>({\n name: 'CartAppliedCoupons',\n importPath: '@vtex/faststore/components',\n component: CartAppliedCoupons,\n editor: { label: 'Cart Applied Coupons', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeCoupon'] },\n guideline:\n 'Renders one chip per applied coupon (cart.appliedCoupons), each showing its code and a CartCouponRemove control; renders nothing when no coupons are applied. A coupon whose conditions did not match is marked with data-fs-cart-coupon-unmatched. Place it next to CartCouponForm in the mini-cart footer. Must be inside CartRoot.',\n});\n\nexport const CartCouponRemoveDefinition = defineComponent<CartCouponRemoveProps>({\n name: 'CartCouponRemove',\n importPath: '@vtex/faststore/components',\n component: CartCouponRemove,\n editor: { label: 'Cart Coupon Remove', category: 'commerce' },\n schema: {\n code: { type: 'string', label: 'Coupon Code' },\n },\n actions: { cart: ['removeCoupon'] },\n guideline:\n \"The per-chip remove control (the X); dispatches $actions.cart.removeCoupon for that chip's code. Use inside a CartAppliedCoupons chip, which supplies the code via context. If used standalone (no CartAppliedCoupons ancestor), pass the code prop explicitly — without a code the remove action has no target and the button is a no-op.\",\n});\n\nexport const CartCouponErrorDefinition = defineComponent<CartCouponErrorProps>({\n name: 'CartCouponError',\n importPath: '@vtex/faststore/components',\n component: CartCouponError,\n editor: { label: 'Cart Coupon Error', category: 'commerce' },\n schema: {},\n guideline:\n 'Inline error banner that surfaces coupon apply/remove errors next to the CartCouponForm; renders nothing when there are none. Reads a dedicated coupon error channel, separate from CartError. Must be inside CartRoot.',\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\nexport function CartRoot({ $data: $dataProp, className, children, ...props }: CartRootProps) {\n const $data = useDataOverride($dataProp);\n const cart = $data ?? null;\n const { error: rootError } = useContext(ReactiveRootContext);\n\n // Hydrate the cart action's ready gate from the cart query response: once the entity arrives, the\n // existing-line writes (remove / quantity) can read it from the cache without a prior addItem.\n const cartEntityId = cart?.id ?? null;\n useEffect(() => {\n if (cartEntityId) orderFormIdVar(cartEntityId);\n }, [cartEntityId]);\n\n // Read-only context: the cart entity + query error. Cart writes are dispatched through\n // `$actions.cart.*`, not this context (ADR-0010).\n const dataValue: CartDataContextValue = useMemo(() => ({ cart, error: rootError ?? null }), [cart, rootError]);\n\n return (\n <CartTotalValueContext value={cart?.total ?? null}>\n <CartDataContextInternal value={dataValue}>\n <div {...props} className={className} data-fs-cart-root=\"\">\n {children}\n </div>\n </CartDataContextInternal>\n </CartTotalValueContext>\n );\n}\n\nexport function CartList({ className, children, skeletonCount = 3, ...props }: CartListProps) {\n const { cart } = useCart();\n const { loading } = useContext(ReactiveRootContext);\n const items = cart?.items ?? [];\n\n // FR-7: while the reactive cart query is in flight and no cart has resolved yet, render\n // skeleton placeholders instead of an empty list. Once data arrives (cart non-null) the real\n // lines render; a refetch over an existing cart keeps showing the items, not skeletons.\n if (loading && cart == null) {\n return (\n <div {...props} className={className} data-fs-cart-list=\"\">\n {Array.from({ length: skeletonCount }, (_, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static placeholders have no stable id\n <CartItemSkeleton key={i} />\n ))}\n </div>\n );\n }\n\n return (\n <div {...props} className={className} data-fs-cart-list=\"\">\n {items.map((item) => (\n // Publish the line's entity ref so each per-item provider (CartItemRoot,\n // CartItemSellerInfo, …) wrapped by <ReactiveListItemDataProvider> subscribes to\n // CartItem:<id> and falls back to this server-rendered slice until the cache is complete.\n // The per-line React context (CartItemContext) is provided by CartItemRoot, sliced — CartList\n // no longer fans the whole entity out (ADR-0012 Option B).\n <ListItemRefContext key={item.id} value={{ __typename: 'CartItem', id: item.id, fallbackData: item }}>\n {children}\n </ListItemRefContext>\n ))}\n </div>\n );\n}\n\nexport function CartTotal({ label, className, children, ...props }: CartTotalProps) {\n const total = useContext(CartTotalValueContext);\n const { locale, currency } = useStorefrontContext();\n const value = children ?? formatPrice(total?.amount ?? 0, locale, currency);\n\n return (\n <span {...props} className={className} data-fs-cart-total=\"\" data-fs-text=\"\">\n {label == null ? (\n value\n ) : (\n <>\n <span>{label}</span>\n <span>{value}</span>\n </>\n )}\n </span>\n );\n}\n\nexport function CartCount({ className, children, template = '{count}', ...props }: CartCountProps) {\n const { cart } = useCart();\n // Gift lines are left out — a promotion added them, not the shopper. A gift-only cart therefore\n // counts 0 while still rendering filled: the three-state branch gates on items.length, not on this.\n const count = cart?.items.reduce((sum, item) => (item.gift ? sum : sum + item.quantity), 0) ?? 0;\n\n return (\n <span {...props} className={className} data-fs-cart-count=\"\" data-fs-text=\"\">\n {children ?? template.replace('{count}', String(count))}\n </span>\n );\n}\n\nexport function CartError({ className, children, ...props }: CartErrorProps) {\n const userErrors = useReactiveVar(cartUserErrorsVar);\n const [firstError] = userErrors;\n if (!firstError) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-error=\"\" data-fs-text=\"\">\n {children ?? firstError.message}\n </div>\n );\n}\n\n// `useLinkStatus()` only reports a pending window from a component rendered inside the <Link>, so\n// the loading state lives in this module-private child rather than in CartGoCheckout's body. No\n// built-in spinner: stores opt in by styling data-fs-cart-go-checkout-pending (mirrors buy-button).\nfunction CartGoCheckoutPending({ children }: { children?: ReactNode }) {\n const { pending } = useLinkStatus();\n\n return (\n <span\n data-fs-cart-go-checkout-content=\"\"\n aria-busy={pending || undefined}\n {...(pending ? { 'data-fs-cart-go-checkout-pending': '' } : {})}\n >\n {children}\n </span>\n );\n}\n\n// A blank value counts as unconfigured: the model's minLength is enforced by neither the runtime\n// slice nor the preflight, and an authored empty string is the same mistake. Trim to decide, never to\n// render.\nfunction configuredLabel(value: string | undefined) {\n return value?.trim() ? value : undefined;\n}\n\n/** The default destination of both checkout navigations. Module-level, so an effect keyed on it is stable. */\nconst CHECKOUT_PAGE: PageRef = { standard: 'checkout' };\n\nexport function CartGoCheckout({\n href = CHECKOUT_PAGE,\n label,\n className,\n children,\n onClick,\n $content,\n $actions: $actionsProp,\n ...props\n}: CartGoCheckoutProps) {\n const $actions = useActionsOverride($actionsProp);\n const client = useApolloClient();\n // `push` sends a site-relative checkout through the router, which keeps the pending state working, and\n // an off-site checkout URL to a document load.\n const { push } = useStorefrontNavigation();\n const [validating, setValidating] = useState(false);\n // Re-entrancy latch. A ref, not `validating`, because two clicks in one tick both read the same\n // pre-render state value; a ref is set synchronously so the second click sees the reservation.\n const inFlight = useRef(false);\n\n // `label` gets no destructuring default on purpose: it has to stay undefined when a store did not\n // author it, or it would shadow the `children` label every store still writes today. The literal\n // terminates the chain instead, which is what keeps the link from ever losing its accessible name.\n // $content stays here and is never spread into NavigationLink, so no entry can reach the href.\n // String children go through the same blank check as the props, so an empty or whitespace-only\n // authored label can never leave the link without an accessible name; element children (an icon\n // composition) pass through untouched.\n const resolvedChildren = typeof children === 'string' ? configuredLabel(children) : children;\n const resolvedLabel = configuredLabel($content?.label) ?? configuredLabel(label) ?? resolvedChildren ?? 'Checkout';\n\n // Pre-checkout stock validation (docs/storefront-core/reference-cart.md § Validation). Intercept\n // the CTA, await any in-flight write, validate, then branch on the outcome: a validation that could\n // not run navigates anyway (fail-open, unconditional — holds with or without a CartCheckoutGuard); a\n // validation that succeeded navigates only when the corrected cart has no unavailable line. Reading\n // the cache after the await is deterministic because Apollo commits the mutation's cache write before\n // the promise resolves.\n async function handleClick(e: React.MouseEvent<HTMLAnchorElement>) {\n onClick?.(e);\n const validate = $actions?.cart?.validate;\n // No gate wired → the link behaves natively. Modified clicks (new tab, middle-click) and clicks\n // another handler already owns are left to the browser.\n if (!validate) return;\n if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;\n e.preventDefault();\n // Re-entrant clicks while a validation is running are swallowed, never a second dispatch.\n if (inFlight.current) return;\n inFlight.current = true;\n\n setValidating(true);\n try {\n await awaitCartWrites();\n const errors = await validate();\n if (errors.length > 0) {\n push(href);\n return;\n }\n const cart = readCartFromCache(client);\n const blocked = (cart?.items ?? []).some((item) => item.variant.availability !== 'AVAILABLE');\n if (!blocked) push(href);\n } finally {\n inFlight.current = false;\n setValidating(false);\n }\n }\n\n return (\n <NavigationLink\n {...props}\n href={href}\n onClick={handleClick}\n className={className}\n data-fs-cart-go-checkout=\"\"\n {...(validating ? { 'data-fs-cart-go-checkout-validating': '' } : {})}\n >\n <CartGoCheckoutPending>{resolvedLabel}</CartGoCheckoutPending>\n </NavigationLink>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Coupon — apply / applied list + remove / error (FSPG-830)\n// ---------------------------------------------------------------------------\n\nexport function CartCouponForm({\n placeholder = 'Coupon code',\n applyLabel = 'Apply',\n className,\n children,\n onSubmit,\n $actions: $actionsProp,\n ...props\n}: CartCouponFormProps) {\n const $actions = useActionsOverride($actionsProp);\n const [code, setCode] = useState('');\n const [pending, setPending] = useState(false);\n\n async function handleSubmit(e: Parameters<NonNullable<CartCouponFormProps['onSubmit']>>[0]) {\n e.preventDefault();\n onSubmit?.(e);\n const trimmed = code.trim();\n if (!trimmed || pending) return;\n\n setPending(true);\n try {\n const errors = await $actions?.cart?.applyCoupon?.({ code: trimmed });\n // Clear the input only when the apply succeeded (no userErrors).\n if (!errors || errors.length === 0) setCode('');\n } finally {\n setPending(false);\n }\n }\n\n return (\n <form\n {...props}\n className={className}\n onSubmit={handleSubmit}\n data-fs-cart-coupon-form=\"\"\n {...(pending ? { 'data-fs-cart-coupon-pending': '' } : {})}\n >\n {children ?? (\n <>\n <input\n type=\"text\"\n value={code}\n placeholder={placeholder}\n aria-label={placeholder}\n disabled={pending}\n onChange={(e) => setCode(e.target.value)}\n data-fs-cart-coupon-input=\"\"\n />\n <button type=\"submit\" disabled={pending} data-fs-cart-coupon-apply=\"\" data-fs-button=\"\">\n {applyLabel}\n </button>\n </>\n )}\n </form>\n );\n}\n\nexport function CartAppliedCoupons({ className, children, $actions: $actionsProp, ...props }: CartAppliedCouponsProps) {\n const $actions = useActionsOverride($actionsProp);\n const { cart } = useCart();\n const coupons = cart?.appliedCoupons ?? [];\n if (coupons.length === 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-applied-coupons=\"\">\n {coupons.map((coupon) => (\n <CartCouponContext key={coupon.code} value={coupon}>\n <CartCouponChip $actions={$actions}>{children}</CartCouponChip>\n </CartCouponContext>\n ))}\n </div>\n );\n}\n\n// Per-coupon chip rendered by CartAppliedCoupons. Unregistered presentational helper (mirrors\n// CartItemSkeleton): the chip exposes data-fs-cart-coupon (+ data-fs-cart-coupon-unmatched) and\n// renders the coupon code inline, then renders the remove control — either the author-supplied\n// `children` (so the compiler can inject $actions into a CartCouponRemove placed in the layout) or a\n// built-in CartCouponRemove. The active coupon flows to descendants via CartCouponContext.\nfunction CartCouponChip({ children, $actions }: { children?: ReactNode; $actions?: ComponentActions }) {\n const coupon = useContext(CartCouponContext);\n if (!coupon) return null;\n\n return (\n <span data-fs-cart-coupon=\"\" {...(coupon.isUnmatchedCondition ? { 'data-fs-cart-coupon-unmatched': '' } : {})}>\n <span data-fs-cart-coupon-code=\"\" data-fs-text=\"\">\n {coupon.code}\n </span>\n {children ?? (\n <CartCouponRemove $actions={$actions} aria-label={`Remove coupon ${coupon.code}`}>\n ×\n </CartCouponRemove>\n )}\n </span>\n );\n}\n\nexport function CartCouponRemove({\n code,\n className,\n children,\n onClick,\n $actions: $actionsProp,\n ...props\n}: CartCouponRemoveProps) {\n const $actions = useActionsOverride($actionsProp);\n const coupon = useContext(CartCouponContext);\n const targetCode = code ?? coupon?.code;\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n if (targetCode) void $actions?.cart?.removeCoupon?.({ code: targetCode });\n onClick?.(e);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n data-fs-cart-coupon-remove=\"\"\n data-fs-button=\"\"\n >\n {children}\n </button>\n );\n}\n\nexport function CartCouponError({ className, children, ...props }: CartCouponErrorProps) {\n const couponErrors = useReactiveVar(cartCouponErrorsVar);\n const [firstError] = couponErrors;\n if (!firstError) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-coupon-error=\"\" data-fs-text=\"\">\n {children ?? firstError.message}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// F4 — Out-of-stock / unavailable item handling\n// ---------------------------------------------------------------------------\n\nexport const CartCheckoutGuardDefinition = defineComponent<CartCheckoutGuardProps>({\n name: 'CartCheckoutGuard',\n importPath: '@vtex/faststore/components',\n component: CartCheckoutGuard,\n editor: { label: 'Cart Checkout Guard', category: 'commerce' },\n schema: {},\n guideline:\n 'Wraps the checkout CTA and blocks progression while any cart item is unavailable: the subtree is made non-interactive (inert) and data-fs-cart-checkout-blocked is exposed for styling the disabled state. In the mini-cart DrawerPopup footer it is the enriched checkout CTA wrapper: place CartTotal and CartGoCheckout inside it so the grand total sits at the button and the whole CTA goes inert when an item cannot be delivered. Must be inside CartRoot.',\n});\n\nexport const CartLoadingDefinition = defineComponent<CartLoadingProps>({\n name: 'CartLoading',\n importPath: '@vtex/faststore/components',\n component: CartLoading,\n editor: { label: 'Cart Loading', category: 'commerce' },\n schema: {},\n guideline:\n 'The loading branch of the three-state mini-cart (loading / empty / filled): renders its children only while the cart is still loading. Supply a skeleton placeholder as its child. Pair with CartEmpty and CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartEmptyDefinition = defineComponent<CartEmptyProps>({\n name: 'CartEmpty',\n importPath: '@vtex/faststore/components',\n component: CartEmpty,\n editor: { label: 'Cart Empty', category: 'commerce' },\n schema: {},\n guideline:\n 'The empty branch of the three-state mini-cart (loading / empty / filled): renders its children only when the cart has resolved with zero items. It carries no copy of its own — compose CartEmptyMessage for the message and CartContinueShopping for the continue-shopping control, in whatever order and grouping the panel needs. Pair with CartLoading and CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartFilledDefinition = defineComponent<CartFilledProps>({\n name: 'CartFilled',\n importPath: '@vtex/faststore/components',\n component: CartFilled,\n editor: { label: 'Cart Filled', category: 'commerce' },\n schema: {},\n guideline:\n 'The filled branch of the three-state mini-cart (loading / empty / filled): renders its children only when the cart has one or more items. Wrap the CartList, the order summary, and the checkout CTA in it so they hide when the cart is empty. Pair with CartLoading and CartEmpty. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartUnavailableCountDefinition = defineComponent<CartUnavailableCountProps>({\n name: 'CartUnavailableCount',\n importPath: '@vtex/faststore/components',\n component: CartUnavailableCount,\n editor: { label: 'Cart Unavailable Count', category: 'commerce' },\n schema: {\n template: { type: 'string', default: '{count} items unavailable', label: 'Template' },\n },\n guideline: 'Cart-level summary of how many lines are unavailable; self-hides when none. See cart.md.',\n});\n\nexport const CartRemoveUnavailableDefinition = defineComponent<CartRemoveUnavailableProps>({\n name: 'CartRemoveUnavailable',\n importPath: '@vtex/faststore/components',\n component: CartRemoveUnavailable,\n editor: { label: 'Cart Remove Unavailable', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeItems'] },\n guideline: 'Button that removes every unavailable line in one batch call; self-hides when none. See cart.md.',\n});\n\nfunction isUnavailable(item: CartEntity['items'][number]): boolean {\n return item.variant.availability !== 'AVAILABLE';\n}\n\nexport function CartCheckoutGuard({ className, children, ...props }: CartCheckoutGuardProps) {\n const { cart } = useCart();\n // Fail-safe: block on any non-AVAILABLE state — OUT_OF_STOCK, UNAVAILABLE, and the\n // catch-all UNKNOWN — so an unclassified item never lets the shopper proceed.\n const blocked = (cart?.items ?? []).some(isUnavailable);\n\n return (\n <div\n {...props}\n className={className}\n inert={blocked}\n aria-disabled={blocked || undefined}\n data-fs-cart-checkout-guard=\"\"\n data-fs-cart-checkout-blocked={blocked ? '' : undefined}\n >\n {children}\n </div>\n );\n}\n\nexport function CartUnavailableCount({\n className,\n children,\n template = '{count} items unavailable',\n ...props\n}: CartUnavailableCountProps) {\n const { cart } = useCart();\n const count = (cart?.items ?? []).filter(isUnavailable).length;\n if (count === 0) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-unavailable-count=\"\" data-fs-text=\"\">\n {children ?? template.replace('{count}', String(count))}\n </span>\n );\n}\n\nexport function CartRemoveUnavailable({\n className,\n children,\n onClick,\n $actions: $actionsProp,\n ...props\n}: CartRemoveUnavailableProps) {\n const $actions = useActionsOverride($actionsProp);\n const { cart } = useCart();\n const unavailableIds = (cart?.items ?? []).filter(isUnavailable).map((item) => item.id);\n if (unavailableIds.length === 0) return null;\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n void $actions?.cart?.removeItems?.({ ids: unavailableIds });\n onClick?.(e);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n data-fs-cart-remove-unavailable=\"\"\n data-fs-button=\"\"\n >\n {children ?? 'Remove unavailable items'}\n </button>\n );\n}\n\n// ---------------------------------------------------------------------------\n// FSPG-822 — post-add behavior (mutually exclusive, selected by composition)\n//\n// Both subscribe to the add-success pulse (cartLastAddVar), which `addItem`\n// increments on each clean add. CartOpenOnAdd maps the pulse to the mini-cart's\n// open state; CartRedirectOnAdd sends a no-mini-cart store straight to checkout.\n// A store composes exactly one — there is no global.json flag.\n// ---------------------------------------------------------------------------\n\nexport const CartOpenOnAddDefinition = defineComponent<CartOpenOnAddProps>({\n name: 'CartOpenOnAdd',\n importPath: '@vtex/faststore/components',\n component: CartOpenOnAdd,\n editor: { label: 'Cart Open On Add', category: 'commerce' },\n schema: {},\n actions: { cart: ['validate'] },\n guideline:\n 'Mini-cart post-add behavior: wraps the mini-cart DrawerRoot subtree and opens the drawer automatically on each successful add to cart. Compose it as the parent of the DrawerRoot (its single child) — the header DrawerTrigger, the popup, and the cart leaves stay inside that DrawerRoot. It makes the drawer controlled internally, so do not set raw open/onOpenChange on DrawerRoot; the header trigger and manual close (Escape / backdrop / close button) keep working. It also runs a stock validation when the overlay opens, behind a short staleness window and skipped while a cart write is in flight, so opening a cart that went stale corrects it before the shopper acts. Use only in a store that has a mini-cart drawer. Mutually exclusive with CartRedirectOnAdd — compose exactly one. See cart.md.',\n});\n\nexport const CartRedirectOnAddDefinition = defineComponent<CartRedirectOnAddProps>({\n name: 'CartRedirectOnAdd',\n importPath: '@vtex/faststore/components',\n component: CartRedirectOnAdd,\n editor: { label: 'Cart Redirect On Add', category: 'commerce' },\n schema: {\n href: { type: 'link', default: { standard: 'checkout' }, label: 'Checkout URL' },\n },\n guideline:\n 'No-mini-cart post-add behavior: navigates the shopper to checkout (href, default the checkout page) after each successful add to cart. Compose it once in the layout for a store that has no mini-cart drawer; it renders no UI of its own. Use this instead of a mini-cart when adding a product should go straight to checkout. Mutually exclusive with CartOpenOnAdd — compose exactly one, and omit the drawer when using this. See cart.md.',\n});\n\n/**\n * Makes the wrapped mini-cart `DrawerRoot` controlled by `miniCartOpenVar` and opens it on each\n * add-success pulse. `miniCartOpenVar` is the single source of truth: the pulse-driven open, the\n * header trigger (`onOpenChange(true)`), and manual close (`onOpenChange(false)`) all route through\n * it, so the trigger and manual dismissal keep working under controlled mode. Context-free — it\n * reads reactive vars and needs no `CartRoot` ancestor (ADR-0010). Expects a single `DrawerRoot`\n * child; the wiring is encapsulated here, never exposed as authorable drawer props.\n */\nexport function CartOpenOnAdd({ children, $actions: $actionsProp }: CartOpenOnAddProps) {\n const $actions = useActionsOverride($actionsProp);\n const open = useReactiveVar(miniCartOpenVar);\n const pulse = useReactiveVar(cartLastAddVar);\n\n useEffect(() => {\n if (pulse > 0) miniCartOpenVar(true);\n }, [pulse]);\n\n // Validate the cart's stock on the overlay's closed→open edge (T13). This is the sole observer of\n // that transition, so validate-on-open lives here rather than in a separate leaf whose only open\n // signal would be this same var.\n useCartValidateOnOpen($actions?.cart?.validate);\n\n if (!isValidElement<Pick<DrawerRootProps, 'open' | 'onOpenChange'>>(children)) return children;\n\n return cloneElement(children, {\n open,\n onOpenChange: (next: boolean) => miniCartOpenVar(next),\n });\n}\n\n/**\n * Navigates a no-mini-cart store to checkout after a successful add. Keys a `useEffect` on the\n * add-success pulse, which `addItem` increments only on the clean branch after the `await`, so the\n * redirect is post-resolve and success-gated. The initial `0` is ignored, so a fresh mount never\n * navigates. Context-free — no `CartRoot` ancestor (ADR-0010). Renders its passthrough children (or\n * nothing); it carries no drawer.\n *\n * The effect keys on the serialized `href`, not on its identity: a reference authored in a schema\n * arrives as a new object on every server render, and keying on it would push to checkout again on a\n * `router.refresh()` long after the add.\n */\nexport function CartRedirectOnAdd({ href = CHECKOUT_PAGE, children }: CartRedirectOnAddProps) {\n const { push } = useStorefrontNavigation();\n const pulse = useReactiveVar(cartLastAddVar);\n const hrefKey = JSON.stringify(href);\n\n useEffect(() => {\n if (pulse > 0) push(JSON.parse(hrefKey));\n }, [pulse, hrefKey, push]);\n\n return children;\n}\n\n// ---------------------------------------------------------------------------\n// Loading / empty / filled — three mutually-exclusive self-hide branches gating\n// on the reactive cart (FSPG-820). `CartLoading` renders while the cart has not\n// resolved (`cart == null`); `CartEmpty` requires a resolved, item-free cart so\n// the empty state never flashes during load; `CartFilled` requires items.\n// Exactly one renders at any time: loading → empty → filled.\n// ---------------------------------------------------------------------------\n\nexport function CartLoading({ className, children, ...props }: CartLoadingProps) {\n const { cart } = useCart();\n if (cart != null) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-loading=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartEmpty({ className, children, ...props }: CartEmptyProps) {\n const { cart } = useCart();\n if (cart == null || cart.items.length > 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-empty=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartFilled({ className, children, ...props }: CartFilledProps) {\n const { cart } = useCart();\n if ((cart?.items ?? []).length === 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-filled=\"\">\n {children}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merchant messaging — disclaimer (F13). A plain-text notice the merchant authors, shown before the\n// shopper commits. It carries no fragment: the items gate reads what CartRoot already selects, so\n// placing or removing it leaves the composed page query unchanged.\n// ---------------------------------------------------------------------------\n\nexport const CartDisclaimerDefinition = defineComponent({\n name: 'CartDisclaimer',\n importPath: '@vtex/faststore/components',\n component: CartDisclaimer,\n content: CartDisclaimerContent,\n editor: { label: 'Cart Disclaimer', category: 'commerce' },\n schema: {\n text: { type: 'string', label: 'Disclaimer text' },\n },\n guideline:\n 'Plain-text merchant notice — conditions, purchase limits, or legal wording — shown in the cart before the shopper commits. CMS content wins over the text prop, and nothing renders when neither supplies a notice. It renders only when the cart has items, so it stays out of the empty state and out of the window before the cart resolves on its own. Place it inside CartFilled, below the order summary or immediately above the checkout CTA (CartCheckoutGuard): placement is composition order, and there is no position prop. Plain text only — no rich text and no inline links. Must be inside CartRoot. See cart.md.',\n});\n\nexport function CartDisclaimer({ text, $content, className, children, ...props }: CartDisclaimerProps) {\n const { cart } = useCart();\n // The empty-state rule is the leaf's own, not its placement's: a disclaimer composed outside\n // CartFilled still stays out of an empty overlay, and requiring a resolved cart keeps it from\n // flashing ahead of the lines it applies to.\n if (cart == null || cart.items.length === 0) return null;\n\n const notice = $content?.text ?? text;\n // Authored children are the highest-precedence override, matching the cart siblings (CartTotal,\n // CartCount, CartError…). A blank or whitespace-only string child counts as unconfigured — the same\n // rule CartGoCheckout's configuredLabel applies — so it never renders an empty <p>; non-string\n // composed children pass through untouched. Absent children, the copy resolves as\n // `$content?.text ?? text` and must be non-blank: `minLength` is enforced by neither the runtime\n // slice nor the preflight, so a blank entry value reaches the component and counts as unconfigured.\n const resolvedChildren = typeof children === 'string' ? configuredLabel(children) : children;\n if (resolvedChildren == null && !notice?.trim()) return null;\n\n return (\n <p {...props} className={className} data-fs-cart-disclaimer=\"\" data-fs-text=\"\">\n {resolvedChildren ?? notice}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — loading placeholder rendered by CartList while the reactive cart\n// query is in flight (FR-7). Plain, unregistered presentational helper (mirrors\n// PricingSkeleton's shape; CartRoot is reactive, so the lazy `skeleton` field\n// does not apply — CartList drives it instead).\n// ---------------------------------------------------------------------------\n\nexport function CartItemSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n // Minimal built-in look (plain, always-generated utilities) so the placeholder is visible out of\n // the box; a store can still restyle the bars via the data-fs-cart-item-skeleton-line swatch.\n return (\n <div {...props} className={className} data-fs-cart-item-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-cart-item-skeleton-line=\"\" className=\"block h-4 w-full animate-pulse rounded bg-gray-200\" />\n <span data-fs-cart-item-skeleton-line=\"\" className=\"mt-2 block h-4 w-2/3 animate-pulse rounded bg-gray-200\" />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merchant alert banner — a family rather than a single leaf, so the schema\n// decides the order and the subset instead of a layout prop. The Root owns\n// every resolution for two reasons: it is the only part that can tell whether\n// there is anything to say before the others mount, and one content model\n// keyed by its element id keeps the merchant's authoring surface a single\n// group in the Admin instead of one per part.\n// ---------------------------------------------------------------------------\n\nexport const CartAlertContent = defineContentType({\n id: 'cart-alert',\n title: 'Cart Alert',\n description: 'Merchant notice shown at the top of the mini-cart overlay.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // Nothing is required. This model shares one composite entry with the other mini-cart content\n // leaves, and a read-time `required` violation invalidates the whole entry — one blank message\n // would take the disclaimer, the empty-state copy and the checkout label down with it.\n // `minLength` is author-time guidance only, so a blank still arrives here and self-hides.\n properties: {\n text: { type: 'string', minLength: 1, title: 'Message' },\n // Inline literals: the catalog scanner reads this file statically and rejects an identifier\n // it cannot evaluate. Every name is a base-dialect one, so each resolves in any store\n // regardless of its configured collection — but a store still has to register them.\n icon: {\n type: 'string',\n enum: ['bell', 'bell-ringing', 'tag', 'shopping-cart', 'map-pin', 'star'],\n title: 'Icon',\n },\n iconUrl: { type: 'string', format: 'uri', title: 'Custom icon', widget: { 'ui:widget': 'media-gallery' } },\n iconAlt: { type: 'string', title: 'Custom icon alt text' },\n },\n },\n});\n\n/**\n * The sprite names the CMS channel admits. Exported because a store whose merchants pick the icon\n * has to list them under `icons.include` for the glyph to reach the route sprite — one import there\n * instead of six retyped strings. Read off the model so the two cannot drift apart.\n */\nexport const CART_ALERT_ICON_NAMES = CartAlertContent.schema.properties.icon.enum;\n\nexport type CartAlertRootProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback message. No default: an invented one would ship copy no merchant wrote. */\n text?: string;\n /** Authored fallback sprite name. Unbounded — the compiler resolves it or fails the build. */\n icon?: string;\n /** Authored fallback uploaded glyph; wins over `icon` when both resolve. */\n iconUrl?: string;\n /** Alt text for the uploaded glyph; empty (decorative) when unset. */\n iconAlt?: string;\n /** Merchant-authored copy, sliced from the layout's composite entry; wins field by field. */\n $content?: ContentValue<typeof CartAlertContent>;\n};\n\n/** The glyph renders as an `img` or an `svg` depending on the channel, so it takes only what both accept. */\nexport type CartAlertIconProps = { className?: string };\n\nexport type CartAlertTextProps = ComponentPropsWithRef<'span'>;\n\n/** One resolved glyph: an uploaded image or a sprite name, never both. */\ntype ResolvedGlyph = { src: string; alt: string } | { name: string };\n\ntype CartAlertContextValue = {\n /** Non-blank by construction: the root self-hides when nothing resolves. */\n message: string;\n /** Resolved on the root so the parts hold no precedence logic; `null` when no glyph is configured. */\n glyph: ResolvedGlyph | null;\n};\n\nconst CART_ALERT_CONTEXT_UNSET = Symbol('CartAlertContextUnset');\n\nconst CartAlertContext = createContext<CartAlertContextValue | typeof CART_ALERT_CONTEXT_UNSET>(\n CART_ALERT_CONTEXT_UNSET,\n);\n\nfunction useCartAlert(): CartAlertContextValue {\n const ctx = useContext(CartAlertContext);\n if (ctx === CART_ALERT_CONTEXT_UNSET) {\n throw new Error('CartAlert parts must be used inside CartAlertRoot.');\n }\n return ctx;\n}\n\n/**\n * A content-channel icon name is admitted only when the model's `enum` still lists it. An entry is\n * external data whose `icon` is typed as the enum but not guaranteed to be one at runtime (a stale\n * value, or a read-time gate that does not enforce `enum`), and an unadmitted name would reach the\n * sprite lookup and render an empty `<svg>` with no build error and nothing in the console.\n */\nfunction admitContentIcon(name: string | undefined): string | undefined {\n return name && (CART_ALERT_ICON_NAMES as readonly string[]).includes(name) ? name : undefined;\n}\n\n/**\n * Resolves one glyph from a single source channel, the upload before the sprite name. Kept per-source\n * rather than per-field so the two channels never mix across sources: a merchant who configures a\n * sprite name in the CMS is not silently overridden by an uploaded-glyph *prop* the developer left as\n * a default. The prop `name` is unfiltered — the compiler resolves it or fails the build; only a\n * content name passes through `admitContentIcon`.\n */\nfunction resolveGlyph(\n url: string | undefined,\n alt: string | undefined,\n name: string | undefined,\n): ResolvedGlyph | null {\n if (url?.trim()) return { src: url, alt: alt ?? '' };\n if (name) return { name };\n return null;\n}\n\n// Type parameters are left to inference so `CorrelateContent` can check `$content` against the\n// declared model (an explicit TProps would bypass it), mirroring BuyButtonButton and Promotion.\nexport const CartAlertRootDefinition = defineComponent({\n name: 'CartAlertRoot',\n importPath: '@vtex/faststore/components',\n component: CartAlertRoot,\n content: CartAlertContent,\n editor: { label: 'Cart Alert', category: 'commerce' },\n schema: {\n text: { type: 'string', label: 'Message' },\n icon: { type: 'icon', label: 'Icon' },\n iconUrl: { type: 'string', label: 'Custom icon URL' },\n iconAlt: { type: 'string', label: 'Custom icon alt text' },\n },\n providesContext: 'cart-alert',\n guideline:\n 'Merchant-authored notice near the top of the mini-cart overlay (a minimum order, a running promotion): wraps CartAlertIcon and CartAlertText in any subset, any order — the arrangement is the composition, not a prop — and renders the glyph then the copy when composed with no children. Its copy and glyph are CMS-editable through the cart-alert content model, with the text, icon, iconUrl and iconAlt props as the non-CMS fallback; it renders nothing when no message is configured, so an unconfigured banner leaves no empty box. Reads no cart data, so it needs no CartRoot ancestor and no cart-state gate — place it inside CartFilled to hide it on an empty cart. A store whose merchants choose the icon must list CART_ALERT_ICON_NAMES under icons.include in global.json, or a chosen glyph renders empty. Distinct from CartError (cart mutation errors) and CartUnavailableCount (data-driven). See cart.md.',\n});\n\nexport const CartAlertIconDefinition = defineComponent<CartAlertIconProps>({\n name: 'CartAlertIcon',\n importPath: '@vtex/faststore/components',\n component: CartAlertIcon,\n editor: { label: 'Cart Alert Icon', category: 'commerce' },\n schema: {},\n requiresContext: 'cart-alert',\n guideline:\n 'The alert glyph, inside a CartAlertRoot (or any ancestor providing `cart-alert` context). Prefers the merchant-uploaded icon and falls back to the predefined sprite name, and renders nothing when neither is configured. Decorative — the message carries the meaning. Place it before or after CartAlertText to set the order.',\n});\n\nexport const CartAlertTextDefinition = defineComponent<CartAlertTextProps>({\n name: 'CartAlertText',\n importPath: '@vtex/faststore/components',\n component: CartAlertText,\n editor: { label: 'Cart Alert Message', category: 'commerce' },\n schema: {},\n requiresContext: 'cart-alert',\n guideline:\n 'The alert message, inside a CartAlertRoot (or any ancestor providing `cart-alert` context). The copy comes from the root (its CMS entry or its text prop), so children are a display override rather than an authoring channel. Place it before or after CartAlertIcon to set the order.',\n});\n\nexport function CartAlertRoot({\n text,\n icon,\n iconUrl,\n iconAlt,\n className,\n children,\n $content,\n ...props\n}: CartAlertRootProps) {\n const message = $content?.text ?? text;\n\n // The glyph resolves as a whole channel, CMS before props, so a merchant-configured glyph — sprite\n // name or upload — wins over whatever the developer set as a fallback. Resolving each field on its\n // own would let a prop `iconUrl` mask a CMS `icon`, a CMS edit that does nothing. Memoized so the\n // context value keeps a stable identity across renders — the parts re-render only on a real change.\n const value = useMemo<CartAlertContextValue>(\n () => ({\n message: message ?? '',\n glyph:\n resolveGlyph($content?.iconUrl, $content?.iconAlt, admitContentIcon($content?.icon)) ??\n resolveGlyph(iconUrl, iconAlt, icon),\n }),\n [message, $content?.iconUrl, $content?.iconAlt, $content?.icon, iconUrl, iconAlt, icon],\n );\n if (!message?.trim()) return null;\n\n return (\n <CartAlertContext value={value}>\n <div {...props} className={className} data-fs-cart-alert=\"\">\n {children ?? (\n <>\n <CartAlertIcon />\n <CartAlertText />\n </>\n )}\n </div>\n </CartAlertContext>\n );\n}\n\nexport function CartAlertIcon({ className }: Readonly<CartAlertIconProps>) {\n const { glyph } = useCartAlert();\n if (!glyph) return null;\n\n if ('src' in glyph) {\n return <Image src={glyph.src} alt={glyph.alt} className={className} data-fs-cart-alert-icon=\"\" />;\n }\n return <Icon name={glyph.name} className={className} data-fs-cart-alert-icon=\"\" />;\n}\n\nexport function CartAlertText({ className, children, ...props }: CartAlertTextProps) {\n const { message } = useCartAlert();\n\n return (\n <span {...props} className={className} data-fs-cart-alert-text=\"\" data-fs-text=\"\">\n {children ?? message}\n </span>\n );\n}\n\n// ---------------------------------------------------------------------------\n// F1 — Empty-state copy: the message and the way back to browsing.\n//\n// Two leaves rather than one, because the message and the control are placed\n// independently: the message sits in the panel body while the control is\n// commonly pinned to the drawer footer. Neither renders a wrapper, so grouping,\n// order, and any illustration stay the store's, composed inside CartEmpty.\n//\n// The copy is merchant-editable, so each leaf declares its own content model\n// with a schema prop as the non-CMS fallback ($content -> prop -> default),\n// following footer-copyright. `CartEmpty` gates when the branch renders; these\n// leaves only carry copy, so they read no cart data and select no field.\n// ---------------------------------------------------------------------------\n\nexport const CartEmptyMessageContent = defineContentType({\n id: 'cart-empty-message',\n title: 'Cart Empty Message',\n description: 'Message shown in the cart overlay when the cart has no items.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: { type: 'string', minLength: 1, title: 'Empty cart message', default: 'Your cart is empty' },\n },\n },\n});\n\nexport const CartContinueShoppingContent = defineContentType({\n id: 'cart-continue-shopping',\n title: 'Cart Continue Shopping',\n description: 'Label for the control that dismisses the cart overlay and returns the shopper to browsing.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['label'],\n properties: {\n label: { type: 'string', minLength: 1, title: 'Continue shopping label', default: 'Continue shopping' },\n },\n },\n});\n\nexport const CartEmptyMessageDefinition = defineComponent<CartEmptyMessageProps>({\n name: 'CartEmptyMessage',\n importPath: '@vtex/faststore/components',\n component: CartEmptyMessage,\n content: CartEmptyMessageContent,\n editor: { label: 'Cart Empty Message', category: 'commerce' },\n schema: {\n text: { type: 'string', default: 'Your cart is empty', label: 'Empty cart message' },\n },\n guideline:\n 'The empty-cart message, rendered as plain text inside CartEmpty. CMS content wins over the text prop, which defaults to \"Your cart is empty\"; blank resolved copy renders nothing. It carries no layout — group and space it with Container, and pair it with CartContinueShopping for the way back to browsing. See cart.md.',\n});\n\nexport const CartContinueShoppingDefinition = defineComponent<CartContinueShoppingProps>({\n name: 'CartContinueShopping',\n importPath: '@vtex/faststore/components',\n component: CartContinueShopping,\n content: CartContinueShoppingContent,\n editor: { label: 'Cart Continue Shopping', category: 'action' },\n schema: {\n label: { type: 'string', default: 'Continue shopping', label: 'Continue shopping label' },\n },\n guideline:\n 'Dismisses the cart overlay so the shopper can keep browsing; dispatches no cart write. Place it in the empty panel inside CartEmpty, commonly in a footer Container. It closes the drawer, so it requires a DrawerRoot ancestor — on a cart page with no drawer, compose a NavigationLink back to browsing instead of this control. CMS content wins over the label prop, and composed children win over both (compose an icon that way). See cart.md.',\n});\n\nexport function CartEmptyMessage({\n text = 'Your cart is empty',\n $content,\n className,\n ...props\n}: CartEmptyMessageProps) {\n const message = $content?.text ?? text;\n // `minLength` is enforced by neither the runtime slice nor the preflight, so a blank entry value\n // reaches the component and counts as unconfigured. Trim to decide, never to render.\n if (!message.trim()) return null;\n\n return (\n <p {...props} className={className} data-fs-cart-empty-message=\"\" data-fs-text=\"\">\n {message}\n </p>\n );\n}\n\nexport function CartContinueShopping({\n label = 'Continue shopping',\n $content,\n className,\n children,\n ...props\n}: CartContinueShoppingProps) {\n const content = $content?.label ?? label;\n // Composed children are the button's content, so they carry it on their own when copy is blank.\n if (children == null && !content.trim()) return null;\n\n return (\n <DrawerClose {...props} className={className} data-fs-cart-continue-shopping=\"\" data-fs-button=\"\">\n {children ?? content}\n </DrawerClose>\n );\n}\n\n// The `Cart.*` namespace object is assembled in the package barrel (src/index.ts) so it can combine\n// the aggregate components here with the line-item components in matter/cart-item without a cyclic\n// import between the two files.\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,MAAM;EACjB,YAAY,EACV,MAAM;GAAE,MAAM;GAAU,WAAW;GAAG,OAAO;EAAkB,EACjE;CACF;AACF,CAAC;AAOD,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,OAAO;EAClB,YAAY,EACV,OAAO;GAAE,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CACA,CAAA;AAEP;AAEA,SAAgB,qBAAqB,EACnC,QAAQ,qBACR,UACA,WACA,UACA,GAAG,SACyB;CAC5B,MAAM,UAAU,UAAU,SAAS;CAEnC,IAAI,YAAY,QAAQ,CAAC,QAAQ,KAAK,GAAG,OAAO;CAEhD,OACE,oBAAC,aAAD;EAAa,GAAI;EAAkB;EAAW,kCAA+B;EAAG,kBAAe;EAC5F,UAAA,YAAY;CACF,CAAA;AAEjB"}
|
|
1
|
+
{"version":3,"file":"cart.js","names":[],"sources":["../../../src/matter/cart/cart.tsx"],"sourcesContent":["'use client';\n\nimport type { ErrorLike } from '@apollo/client';\nimport { getApolloContext, useApolloClient, useReactiveVar } from '@apollo/client/react';\nimport {\n type ContentValue,\n defineComponent,\n defineContentType,\n type MessageFieldName,\n type MessageLocaleProp,\n} from '@vtex/fs-core';\nimport { useLinkStatus } from 'next/link';\nimport {\n type ComponentPropsWithRef,\n cloneElement,\n createContext,\n isValidElement,\n type ReactNode,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { DrawerClose, type DrawerRootProps } from '../../particles/drawer/drawer.js';\nimport { Icon } from '../../particles/icon/icon.js';\nimport { Image } from '../../particles/image/image.js';\nimport { NavigationLink, type NavigationLinkProps } from '../../particles/navigation-link/navigation-link.js';\nimport { useOptionalToast } from '../../particles/toast/toast.js';\nimport { useActionsOverride } from '../../sdk/actions/actions-override-context.js';\nimport type { ComponentActions } from '../../sdk/actions/types.js';\nimport type { AppliedCoupon, CartEntity, Money } from '../../sdk/cart/operations.js';\nimport { readCartFromCache } from '../../sdk/cart/use-cart-actions.js';\nimport { useCartSyncSalesChannel } from '../../sdk/cart/use-cart-sync-sales-channel.js';\nimport { useCartValidateOnOpen } from '../../sdk/cart/use-cart-validate-on-open.js';\nimport { awaitCartWrites } from '../../sdk/cart/write-gate.js';\nimport { useStorefrontContext } from '../../sdk/context/storefront-context.js';\nimport { useDataOverride } from '../../sdk/data/data-override-context.js';\nimport { ListItemRefContext } from '../../sdk/data/list-item-ref-context.js';\nimport { ReactiveRootContext } from '../../sdk/data/page-reactive-data-root.js';\nimport { graphql } from '../../sdk/generated/gql.js';\nimport type {\n CartCouponApplyErrorCode,\n CartCouponRemoveErrorCode,\n CartItemAddErrorCode,\n CartItemQuantityDecreaseErrorCode,\n CartItemQuantityIncreaseErrorCode,\n CartItemRemoveErrorCode,\n CartItemsRemoveErrorCode,\n} from '../../sdk/generated/graphql.js';\nimport { formatErrorCode } from '../../sdk/i18n/format-error-code.js';\nimport { useMessageFormatter } from '../../sdk/i18n/use-message-formatter.js';\nimport type { PageRef } from '../../sdk/navigation/types.js';\nimport { useStorefrontNavigation } from '../../sdk/navigation/use-storefront-navigation.js';\nimport {\n cartCouponErrorsVar,\n cartLastAddVar,\n cartUserErrorsVar,\n miniCartOpenVar,\n orderFormIdVar,\n} from '../../sdk/state/cart.js';\nimport { loggableErrorName } from '../../utils/loggable-error-name.js';\nimport { resolveSafeHref } from '../../utils/safe-href.js';\n\n// ---------------------------------------------------------------------------\n// Content models. A message field is read only from `$content`. The disclaimer deliberately ships no\n// default copy: legal or conditional wording the package invented would assert conditions no merchant\n// agreed to.\n// ---------------------------------------------------------------------------\n\nexport const CartDisclaimerContent = defineContentType({\n id: 'cart-disclaimer',\n title: 'Cart Disclaimer',\n description: 'Conditions, limits, or legal wording shown in the cart before checkout.',\n schema: {\n type: 'object',\n additionalProperties: false,\n required: ['text'],\n properties: {\n text: { type: 'string', minLength: 1, title: 'Disclaimer text' },\n },\n },\n});\n\n// Label only: re-pointing checkout is not a copy decision, so the destination stays an authored prop\n// and never joins this channel.\nexport const CartCheckoutLabelContent = defineContentType({\n id: 'cart-checkout-label',\n title: 'Cart Checkout Label',\n description: 'Label for the checkout call to action.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n minLength: 1,\n title: 'Checkout label',\n format: 'icu-message',\n messageSource: 'Checkout',\n },\n },\n },\n});\n\nexport const CartCountContent = defineContentType({\n id: 'cart-count',\n title: 'Cart Count',\n description: 'Text of the cart item count.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n template: {\n type: 'string',\n title: 'Item count',\n format: 'icu-message',\n messageSource: '{count}',\n messageArguments: { type: 'object', properties: { count: { type: 'integer' } } },\n messageExample: { count: 3 },\n },\n },\n },\n});\n\nexport const CartCouponFormContent = defineContentType({\n id: 'cart-coupon-form',\n title: 'Cart Coupon Form',\n description: 'Copy for the coupon code input, its apply button and the applied toast.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n placeholder: {\n type: 'string',\n title: 'Input placeholder',\n description: 'Also the accessible name of the input.',\n format: 'icu-message',\n messageSource: 'Coupon code',\n },\n applyLabel: { type: 'string', title: 'Apply button label', format: 'icu-message', messageSource: 'Apply' },\n appliedMessage: {\n type: 'string',\n title: 'Applied toast title',\n description: 'Raised after an apply whose code comes back matched; blank raises no toast.',\n format: 'icu-message',\n messageSource: 'Coupon applied',\n },\n },\n },\n});\n\nexport const CartAppliedCouponsContent = defineContentType({\n id: 'cart-applied-coupons',\n title: 'Cart Applied Coupons',\n description: 'Copy for the built-in remove control of each applied coupon chip.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n removeLabel: {\n type: 'string',\n title: 'Remove control accessible label',\n format: 'icu-message',\n messageSource: 'Remove coupon {code}',\n messageArguments: { type: 'object', properties: { code: { type: 'string' } } },\n messageExample: { code: 'SAVE10' },\n },\n },\n },\n});\n\nexport const CartCouponUnmatchedContent = defineContentType({\n id: 'cart-coupon-unmatched',\n title: 'Cart Coupon Unmatched',\n description: 'Notice shown on an applied coupon whose conditions do not match the cart.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n message: {\n type: 'string',\n title: 'Notice',\n format: 'icu-message',\n messageSource: 'This coupon is not being applied to your cart',\n },\n },\n },\n});\n\nexport const CartCouponSavingsContent = defineContentType({\n id: 'cart-coupon-savings',\n title: 'Cart Coupon Savings',\n description: 'Text of the amount an applied coupon saves.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n template: {\n type: 'string',\n title: 'Savings text',\n description: '`amount` is the formatted saving.',\n format: 'icu-message',\n messageSource: '{amount}',\n messageArguments: { type: 'object', properties: { amount: { type: 'string' } } },\n messageExample: { amount: '-$10.00' },\n },\n },\n },\n});\n\nexport const CartUnavailableCountContent = defineContentType({\n id: 'cart-unavailable-count',\n title: 'Cart Unavailable Count',\n description: 'Summary of how many cart lines are unavailable.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n template: {\n type: 'string',\n title: 'Unavailable count',\n format: 'icu-message',\n messageSource: '{count, plural, one {# item unavailable} other {# items unavailable}}',\n messageArguments: { type: 'object', properties: { count: { type: 'integer' } } },\n messageExample: { count: 2 },\n },\n },\n },\n});\n\nexport const CartRemoveUnavailableContent = defineContentType({\n id: 'cart-remove-unavailable',\n title: 'Cart Remove Unavailable',\n description: 'Label for the button that removes every unavailable cart line.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n title: 'Button label',\n format: 'icu-message',\n messageSource: 'Remove unavailable items',\n },\n },\n },\n});\n\nexport const ClearCartButtonContent = defineContentType({\n id: 'clear-cart-button',\n title: 'Clear Cart Button',\n description: 'Label for the button that removes every cart line.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n title: 'Button label',\n format: 'icu-message',\n messageSource: 'Clear cart',\n },\n },\n },\n});\n\nexport const CartErrorContent = defineContentType({\n id: 'cart-error',\n title: 'Cart Error',\n description: 'Messages shown when a cart item write is refused, one per error code the shopper can act on.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n invalidQuantityMessage: {\n type: 'string',\n title: 'Invalid quantity message',\n description: 'Shown when the requested quantity is not accepted.',\n format: 'icu-message',\n messageSource: 'Choose a valid quantity.',\n },\n itemNotFoundMessage: {\n type: 'string',\n title: 'Item not found message',\n description: 'Shown when the item is no longer in the cart.',\n format: 'icu-message',\n messageSource: 'This item is no longer in your cart.',\n },\n genericErrorMessage: {\n type: 'string',\n title: 'Generic failure message',\n description: 'Shown for a network failure and for every refusal the shopper cannot act on.',\n format: 'icu-message',\n messageSource: 'Unable to update cart. Please try again.',\n },\n },\n },\n});\n\nexport const CartCouponErrorContent = defineContentType({\n id: 'cart-coupon-error',\n title: 'Cart Coupon Error',\n description: 'Messages shown when a coupon apply or remove is refused, one per error code the shopper can act on.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n couponNotFoundMessage: {\n type: 'string',\n title: 'Coupon not found message',\n description: 'Shown when the code is unknown or not accepted by this cart.',\n format: 'icu-message',\n messageSource: 'This coupon is not valid for your cart.',\n },\n couponExpiredMessage: {\n type: 'string',\n title: 'Coupon expired message',\n format: 'icu-message',\n messageSource: 'This coupon has expired.',\n },\n couponNotCombinedMessage: {\n type: 'string',\n title: 'Coupon not combined message',\n description:\n 'Shown when the code is refused while another coupon is applied. The platform does not say whether the code is unknown or cannot be combined.',\n format: 'icu-message',\n messageSource: 'This coupon cannot be used with the coupons already applied.',\n },\n genericErrorMessage: {\n type: 'string',\n title: 'Generic failure message',\n description: 'Shown for a network failure and for every refusal the shopper cannot act on.',\n format: 'icu-message',\n messageSource: 'Unable to update your coupons. Please try again.',\n },\n },\n },\n});\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type CartDataContextValue = Readonly<{\n cart: CartEntity | null;\n /**\n * Cart query error surfaced by the reactive root. `cart` is non-null on the server (`Cart!`),\n * so `cart: null` + `error` means the fetch failed — not an empty cart.\n */\n error: ErrorLike | null;\n}>;\n\nexport type CartRootProps = ComponentPropsWithRef<'div'> & {\n /**\n * Cart entity slice forwarded by the reactive runtime (`ReactiveDataProvider`) — it is the value\n * of the `cart` top-level field on `CartData on Query`, not the wrapping `{ cart: … }` shape.\n * Receives `null` when the cart is not yet seeded (e.g. server returned no cart for the current\n * session, or `orderFormIdVar` is still null).\n */\n $data?: CartEntity | null;\n /** Injected by the compiler from `actions: { cart: ['syncSalesChannel'] }`. */\n $actions?: ComponentActions;\n};\n\nexport type CartListProps = ComponentPropsWithRef<'div'> & {\n /** Number of CartItemSkeleton rows to render while the cart is still loading (FR-7). */\n skeletonCount?: number;\n};\n\nexport type CartAvailableItemsProps = ComponentPropsWithRef<'div'> & {\n /** Number of CartItemSkeleton rows to render while the cart is still loading. */\n skeletonCount?: number;\n};\n\nexport type CartUnavailableItemsProps = ComponentPropsWithRef<'div'>;\n\nexport type CartTotalProps = ComponentPropsWithRef<'span'> & {\n label?: string;\n};\n\nexport type CartCountProps = ComponentPropsWithRef<'span'> &\n MessageLocaleProp & {\n /** `template` words the count; it receives `count`. */\n $content?: ContentValue<typeof CartCountContent>;\n };\n\nexport type CartErrorProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /** Words each refusal code; authored `children` replace it. */\n $content?: ContentValue<typeof CartErrorContent>;\n };\n\n// `$content` is omitted from the inherited props on purpose: NavigationLink's model also carries the\n// destination and target, and this CTA's content channel is the label alone.\nexport type CartGoCheckoutProps = Omit<NavigationLinkProps, 'href' | '$content'> &\n MessageLocaleProp & {\n href?: PageRef | string;\n /** `label` is the button text when no `children` are composed. */\n $content?: ContentValue<typeof CartCheckoutLabelContent>;\n /** Injected by the compiler from `actions: { cart: ['validate'] }`; the stock-validation write surface. */\n $actions?: ComponentActions;\n };\n\nexport type CartCouponFormProps = ComponentPropsWithRef<'form'> &\n MessageLocaleProp & {\n $content?: ContentValue<typeof CartCouponFormContent>;\n /** Injected by the compiler from `actions: { cart: ['applyCoupon'] }`; the cart write surface. */\n $actions?: ComponentActions;\n };\n\nexport type CartAppliedCouponsProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /** `removeLabel` names the built-in remove control of each chip; it receives `code`. */\n $content?: ContentValue<typeof CartAppliedCouponsContent>;\n /** Injected by the compiler from `actions: { cart: ['removeCoupon'] }`; forwarded to the built-in chip's remove control. */\n $actions?: ComponentActions;\n };\n\nexport type CartCouponRemoveProps = ComponentPropsWithRef<'button'> & {\n /**\n * The coupon code this control removes. Normally supplied by the enclosing CartAppliedCoupons\n * chip via context; pass it explicitly to override or to use the control standalone.\n */\n code?: string;\n /** Injected by the compiler from `actions: { cart: ['removeCoupon'] }`; the cart write surface. */\n $actions?: ComponentActions;\n};\n\nexport type CartCouponErrorProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /** Words each refusal code; authored `children` replace it. */\n $content?: ContentValue<typeof CartCouponErrorContent>;\n };\nexport type CartCouponEmptyProps = ComponentPropsWithRef<'div'>;\n\nexport type CartCouponUnmatchedProps = ComponentPropsWithRef<'output'> &\n MessageLocaleProp & {\n /** `message` is the notice shown while the enclosing chip's coupon is unmatched; blank renders nothing. */\n $content?: ContentValue<typeof CartCouponUnmatchedContent>;\n };\n\nexport type CartCouponSavingsProps = Omit<ComponentPropsWithRef<'span'>, 'children'> &\n MessageLocaleProp & {\n /** `template` is the chip text; it receives `amount`, the formatted saving. */\n $content?: ContentValue<typeof CartCouponSavingsContent>;\n };\n\nexport type CartDisclaimerProps = ComponentPropsWithRef<'p'> & {\n /**\n * Authored fallback, rendered when no CMS entry supplies the notice. Ranks below `children`:\n * `children ?? $content?.text ?? text`.\n */\n text?: string;\n /** Injected by the compiler, sliced from the page's or layout's composite content entry. */\n $content?: ContentValue<typeof CartDisclaimerContent>;\n};\n\nexport type CartCheckoutGuardProps = ComponentPropsWithRef<'div'>;\nexport type CartLoadingProps = ComponentPropsWithRef<'div'>;\nexport type CartEmptyProps = ComponentPropsWithRef<'div'>;\nexport type CartFilledProps = ComponentPropsWithRef<'div'>;\n\nexport type CartEmptyMessageProps = ComponentPropsWithRef<'p'> &\n MessageLocaleProp & {\n /** `text` is the message; blank renders nothing. */\n $content?: ContentValue<typeof CartEmptyMessageContent>;\n };\n\nexport type CartContinueShoppingProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n /** `label` is the button text when no `children` are composed. */\n $content?: ContentValue<typeof CartContinueShoppingContent>;\n };\n\nexport type CartUnavailableCountProps = ComponentPropsWithRef<'span'> &\n MessageLocaleProp & {\n /** `template` words the count; it receives `count`. */\n $content?: ContentValue<typeof CartUnavailableCountContent>;\n };\n\nexport type ClearCartButtonProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n /** `label` is the button text when no `children` are composed. */\n $content?: ContentValue<typeof ClearCartButtonContent>;\n /** Injected by the compiler from `actions: { cart: ['removeItems'] }`; the cart write surface. */\n $actions?: ComponentActions;\n };\n\nexport type CartRemoveUnavailableProps = ComponentPropsWithRef<'button'> &\n MessageLocaleProp & {\n /** `label` is the button text when no `children` are composed. */\n $content?: ContentValue<typeof CartRemoveUnavailableContent>;\n /** Injected by the compiler from `actions: { cart: ['removeItems'] }`; the cart write surface. */\n $actions?: ComponentActions;\n };\n\nexport type CartUnavailableSectionProps = ComponentPropsWithRef<'div'>;\n\nexport type CartUnavailableLabelProps = ComponentPropsWithRef<'p'> &\n MessageLocaleProp & {\n /** `text` is the label. */\n $content?: ContentValue<typeof CartUnavailableLabelContent>;\n };\n\nexport type CartAllUnavailableProps = ComponentPropsWithRef<'div'>;\n\nexport type CartAllUnavailableMessageProps = ComponentPropsWithRef<'div'> &\n MessageLocaleProp & {\n /** Link label. The link renders only when this and `linkHref` both resolve. No default. */\n linkText?: string;\n /** Link destination: a page reference, or a URL string checked by `resolveSafeHref`. No default. */\n linkHref?: PageRef | string;\n /** `text` is the message; `linkText` and `linkHref` win over their props when non-blank. */\n $content?: ContentValue<typeof CartAllUnavailableMessageContent>;\n };\n\nexport type CartOpenOnAddProps = {\n children?: ReactNode;\n /** Injected by the compiler from `actions: { cart: ['validate'] }`; drives the validate-on-open call. */\n $actions?: ComponentActions;\n};\n\nexport type CartRedirectOnAddProps = {\n href?: PageRef | string;\n children?: ReactNode;\n};\n\n// ---------------------------------------------------------------------------\n// GraphQL Fragment — typed via @graphql-codegen client-preset (T7)\n// ---------------------------------------------------------------------------\n\n// CartRoot is the reactive read root. It fetches item refs plus the per-item scalars the cart-level\n// aggregate reads cross-cuttingly — `quantity` and `gift` (CartCount, which counts only the lines the\n// shopper added) and `variant.availability` (CartCheckoutGuard) — plus the cart totals, messages, and\n// coupons. The display-only per-item scalars (prices, name, sku, image, product) are owned by\n// CartItemRoot's own `reactive-list-item` fragment and merge un-aliased onto the shared\n// `cart { items }` path (ADR-0012 Option B). The MUTATION fragment (`CartFragment` →\n// `CartItemFragment` in operations.ts) stays whole so writes normalize a complete `CartItem` into the\n// cache for the per-item `useFragment` to read — which is why `gift` joins it too.\nconst fragment = graphql(`\n fragment CartData on Query {\n cart {\n __typename\n id\n items {\n __typename\n id\n quantity\n gift\n variant {\n __typename\n availability\n }\n }\n totalizers {\n __typename\n id\n name\n value {\n ...MoneyFragment\n }\n }\n total {\n ...MoneyFragment\n }\n messages {\n __typename\n code\n text\n status\n }\n appliedCoupons {\n code\n isUnmatchedCondition\n }\n discounts {\n name\n value {\n ...MoneyFragment\n }\n kind\n }\n salesChannelMismatch {\n cartSalesChannel\n activeSalesChannel\n }\n }\n }\n`);\n\n// ---------------------------------------------------------------------------\n// Money formatting — shared by the cart aggregate and the cart-item leaves\n// ---------------------------------------------------------------------------\n\nexport function formatPrice(value: number, locale: string, currency: string): string {\n return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(value);\n}\n\n/**\n * True when a money amount can be read as a number: a finite `number` (the optimistic-cache shape) or\n * a non-blank string `Number` parses to a finite value (the wire shape, a decimal string). Blank and\n * nullish amounts are rejected before `Number()` runs, because `Number('')` and `Number(null)` are `0`\n * and would turn a missing amount into a real zero.\n */\nexport function isFiniteAmount(value: unknown): boolean {\n if (typeof value === 'number') return Number.isFinite(value);\n if (typeof value === 'string') return value.trim() !== '' && Number.isFinite(Number(value));\n return false;\n}\n\n// ---------------------------------------------------------------------------\n// Cart total value context — provided by CartRoot and CartTotalizerRoot so that\n// CartTotal works inside either root without a circular import.\n// ---------------------------------------------------------------------------\n\nexport const CartTotalValueContext = createContext<Money | null>(null);\n\n// ---------------------------------------------------------------------------\n// Cart data context (read-only cart entity + query error)\n// ---------------------------------------------------------------------------\n\nconst CART_DATA_UNSET = Symbol('CartDataContextUnset');\n\nconst CartDataContextInternal = createContext<CartDataContextValue | typeof CART_DATA_UNSET>(CART_DATA_UNSET);\n\nexport const CartDataContext = CartDataContextInternal as React.Context<CartDataContextValue>;\n\n/**\n * Read the current cart entity and query error from the nearest `CartRoot`. Throws when called\n * outside a `CartRoot` subtree.\n *\n * Cart *writes* no longer flow through this context — they are dispatched via the compiler-injected\n * `$actions.cart.*` prop (the `cart` action namespace), which reads/writes the cache directly and\n * needs no `CartRoot` ancestor (docs/storefront-core/reference-free-particle-model.md § Write side — actions, ADR-0010). This hook is reads only.\n */\nexport function useCart(): CartDataContextValue {\n const ctx = useContext(CartDataContextInternal);\n if (ctx === CART_DATA_UNSET) {\n throw new Error('useCart() must be used inside a <CartRoot> subtree.');\n }\n return ctx;\n}\n\n// ---------------------------------------------------------------------------\n// Cart coupon context (provided by CartAppliedCoupons per applied coupon)\n// ---------------------------------------------------------------------------\n\nconst CartCouponContext = createContext<AppliedCoupon | null>(null);\n\n// ---------------------------------------------------------------------------\n// Definitions\n// ---------------------------------------------------------------------------\n\nexport const CartRootDefinition = defineComponent<CartRootProps>({\n name: 'CartRoot',\n importPath: '@vtex/faststore/components',\n component: CartRoot,\n fragment,\n fetchStrategy: 'reactive',\n editor: { label: 'Cart Root', category: 'commerce' },\n schema: {},\n actions: { cart: ['syncSalesChannel'] },\n guideline:\n 'Cart data provider hosted by the layout (shared shell), wrapping the slot so every page consumes its context; exactly one per tree — do not place it as a page root. To build a mini-cart, wrap this CartRoot subtree in a modal DrawerRoot: the header carries a DrawerTrigger with a CartCount badge, the DrawerPopup body is a CartList line-item template, and its footer is CartTotal plus CartGoCheckout. The mini-cart is this layout composition, not a dedicated component. See cart.md. On load, a cart whose sales channel differs from the request is moved onto the active channel.',\n});\n\nexport const CartListDefinition = defineComponent<CartListProps>({\n name: 'CartList',\n importPath: '@vtex/faststore/components',\n component: CartList,\n editor: { label: 'Cart List', category: 'commerce' },\n schema: {\n skeletonCount: { type: 'number', default: 3, label: 'Skeleton Count' },\n },\n // Declares the per-line iteration context (ADR-0009): a `reactive-list-item` sub-matter placed\n // inside CartList `requiresContext: 'cart-item'`, and the build-time `validateContextConstraints`\n // walk reports a misplaced one. Runtime: CartList (and its split siblings CartAvailableItems and\n // CartUnavailableItems) publishes each line's ref via ListItemRefContext.\n providesContext: 'cart-item',\n guideline:\n 'Renders its children once per cart item; wrap the line-item template in a CartItemRoot and place CartItem* components inside it to define the template (e.g. CartItemImage, CartItemName, CartItemPrice, a CartItemQuantity stepper, CartItemRemove). While the cart is loading it renders skeletonCount CartItemSkeleton placeholders instead. In a mini-cart it is the scrollable body of the DrawerPopup. Must be inside CartRoot.',\n});\n\nexport const CartAvailableItemsDefinition = defineComponent<CartAvailableItemsProps>({\n name: 'CartAvailableItems',\n importPath: '@vtex/faststore/components',\n component: CartAvailableItems,\n editor: { label: 'Cart Available Items', category: 'commerce' },\n schema: {\n skeletonCount: { type: 'number', default: 3, label: 'Skeleton Count' },\n },\n providesContext: 'cart-item',\n guideline:\n 'Renders its children once per purchasable cart line (availability AVAILABLE); wrap the line-item template in a CartItemRoot. Place it under CartFilled in the place of CartList, together with CartUnavailableSection for the lines the shopper cannot buy; do not compose CartList beside it. Gift lines follow their availability. Renders skeletonCount skeletons while the cart is loading and nothing when no line is purchasable. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartUnavailableItemsDefinition = defineComponent<CartUnavailableItemsProps>({\n name: 'CartUnavailableItems',\n importPath: '@vtex/faststore/components',\n component: CartUnavailableItems,\n editor: { label: 'Cart Unavailable Items', category: 'commerce' },\n schema: {},\n providesContext: 'cart-item',\n guideline:\n 'Renders its children once per unavailable cart line (any availability other than AVAILABLE); wrap the line-item template in a CartItemRoot and compose the line leaves (for example CartItemImage, CartItemName, CartItemVariations, CartItemRemove), adding CartItemUnavailable only when the line itself must state its reason. Renders nothing when no line is unavailable or while the cart is loading. Place it inside CartUnavailableSection after its header. Gift lines follow their availability and show no per-line remove. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartTotalDefinition = defineComponent<CartTotalProps>({\n name: 'CartTotal',\n importPath: '@vtex/faststore/components',\n component: CartTotal,\n editor: { label: 'Cart Total', category: 'commerce' },\n schema: {\n label: { type: 'string', label: 'Label' },\n },\n guideline:\n 'The single root-agnostic grand-total component: renders the cart grand total, formatted from the active storefront context, reading the value from the nearest CartRoot or CartTotalizerRoot. Set the optional label prop to render a label alongside the value (e.g. \"Total\"); omit it to render the value alone. In a mini-cart it sits in the DrawerPopup footer alongside CartGoCheckout, inside a CartCheckoutGuard, so the total is visible at the checkout button.',\n});\n\nexport const CartCountDefinition = defineComponent<CartCountProps>({\n name: 'CartCount',\n importPath: '@vtex/faststore/components',\n component: CartCount,\n content: CartCountContent,\n editor: { label: 'Cart Count', category: 'commerce' },\n schema: {},\n guideline:\n \"Renders the total item count in the cart; the text comes from the $content field template, an ICU message with a count argument (e.g. '{count, plural, =1 {# produto} other {# produtos}}'). A count that is not a finite number renders nothing. Gift lines are excluded from the count — a promotional gift is not something the shopper added — so a cart holding only gifts shows 0. In a mini-cart, place it as the badge on the header DrawerTrigger and again in the DrawerPopup header. Must be inside CartRoot.\",\n});\n\nexport const CartErrorDefinition = defineComponent<CartErrorProps>({\n name: 'CartError',\n importPath: '@vtex/faststore/components',\n component: CartError,\n content: CartErrorContent,\n editor: { label: 'Cart Error', category: 'commerce' },\n schema: {},\n guideline:\n 'Inline error banner that surfaces cart item write errors; renders nothing when there are none. Words each error code from its $content (genericErrorMessage for a network failure, every refusal the shopper cannot act on, and an unknown code). Authored children replace the message. Must be inside CartRoot.',\n});\n\nexport const CartGoCheckoutDefinition = defineComponent<CartGoCheckoutProps>({\n name: 'CartGoCheckout',\n importPath: '@vtex/faststore/components',\n component: CartGoCheckout,\n content: CartCheckoutLabelContent,\n editor: { label: 'Cart Go Checkout', category: 'commerce' },\n schema: {\n href: { type: 'link', default: { standard: 'checkout' }, label: 'Checkout URL' },\n },\n actions: { cart: ['validate'] },\n guideline:\n 'Navigation link to the checkout page (default href the checkout page); use as the checkout CTA inside the cart summary. In a mini-cart it is the DrawerPopup footer CTA, next to CartTotal. Composed children are the button content; without them the text comes from the $content field label. The destination is not content-editable: href stays an authored prop, because re-pointing checkout is not a copy decision. Before routing it runs a stock validation and only navigates when the re-checked cart has no unavailable line; a validation that cannot run falls open and navigates anyway. When it leaves for the checkout it closes the mini-cart drawer it sits in, so do not wrap it in DrawerClose. During a client-side route transition to checkout it surfaces a loading state on its content wrapper as aria-busy plus data-fs-cart-go-checkout-pending, and while the pre-checkout validation runs it exposes data-fs-cart-go-checkout-validating — there is no built-in spinner, so opt into one by styling those attributes (e.g. composing a Spinner). For an external or hard checkout navigation there is no client-side transition, so the loading state simply does not show (a graceful no-op). The enriched footer checkout CTA is CartCheckoutGuard wrapping CartTotal and this CartGoCheckout: the guard makes the CTA inert (data-fs-cart-checkout-blocked) while any item is unavailable, and CartTotal shows the grand total at the button. Must be inside CartRoot.',\n});\n\nexport const CartCouponFormDefinition = defineComponent<CartCouponFormProps>({\n name: 'CartCouponForm',\n importPath: '@vtex/faststore/components',\n component: CartCouponForm,\n content: CartCouponFormContent,\n editor: { label: 'Cart Coupon Form', category: 'commerce' },\n schema: {},\n actions: { cart: ['applyCoupon'] },\n guideline:\n 'Coupon code input plus an apply button; root-agnostic (dispatches $actions.cart.applyCoupon). While an apply is in flight it disables the input and button and exposes data-fs-cart-coupon-pending. In a mini-cart it sits in the DrawerPopup footer above the totals; pair it with CartAppliedCoupons (the applied list) and CartCouponError (the error banner). For a single-coupon store, wrap the entry (the accordion holding this form) in CartCouponEmpty so it hides once a code is applied. When an apply returns no errors and the submitted code comes back matched, it raises a toast titled by the $content field appliedMessage (needs a ToastProvider with a ToastList in the layout; with none, no toast shows and the apply still works). An unmatched code raises no toast; compose CartCouponUnmatched in the chip for that case. The toast still shows when CartCouponEmpty removes the form. Must be inside CartRoot.',\n});\n\nexport const CartAppliedCouponsDefinition = defineComponent<CartAppliedCouponsProps>({\n name: 'CartAppliedCoupons',\n importPath: '@vtex/faststore/components',\n component: CartAppliedCoupons,\n content: CartAppliedCouponsContent,\n editor: { label: 'Cart Applied Coupons', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeCoupon'] },\n guideline:\n 'Renders one chip per applied coupon (cart.appliedCoupons), each showing its code and a CartCouponRemove control (named by the $content field removeLabel); renders nothing when no coupons are applied. A coupon whose conditions did not match is marked with data-fs-cart-coupon-unmatched. Place it next to CartCouponForm in the mini-cart footer. Composed children replace the built-in remove control, so a chip template that adds CartCouponUnmatched (the unmatched-coupon notice) or CartCouponSavings (the amount the coupon saves) must also compose CartCouponRemove. Must be inside CartRoot.',\n});\n\nexport const CartCouponRemoveDefinition = defineComponent<CartCouponRemoveProps>({\n name: 'CartCouponRemove',\n importPath: '@vtex/faststore/components',\n component: CartCouponRemove,\n editor: { label: 'Cart Coupon Remove', category: 'commerce' },\n schema: {\n code: { type: 'string', label: 'Coupon Code' },\n },\n actions: { cart: ['removeCoupon'] },\n guideline:\n \"The per-chip remove control (the X); dispatches $actions.cart.removeCoupon for that chip's code. Use inside a CartAppliedCoupons chip, which supplies the code via context. If used standalone (no CartAppliedCoupons ancestor), pass the code prop explicitly — without a code the remove action has no target and the button is a no-op.\",\n});\n\nexport const CartCouponErrorDefinition = defineComponent<CartCouponErrorProps>({\n name: 'CartCouponError',\n importPath: '@vtex/faststore/components',\n component: CartCouponError,\n content: CartCouponErrorContent,\n editor: { label: 'Cart Coupon Error', category: 'commerce' },\n schema: {},\n guideline:\n 'Inline error banner that surfaces coupon apply/remove errors next to the CartCouponForm; renders nothing when there are none. Reads a dedicated coupon error channel, separate from CartError. Words each error code from its $content (genericErrorMessage for a network failure, every refusal the shopper cannot act on, and an unknown code). Authored children replace the message. Must be inside CartRoot.',\n});\n\nexport const CartCouponEmptyDefinition = defineComponent<CartCouponEmptyProps>({\n name: 'CartCouponEmpty',\n importPath: '@vtex/faststore/components',\n component: CartCouponEmpty,\n editor: { label: 'Cart Coupon Empty', category: 'commerce' },\n schema: {},\n guideline:\n 'Coupon entry gate: renders its children only while the resolved cart has no applied coupon (cart.appliedCoupons is empty), and nothing while the cart loads. The merchant coupon policy is composition: for a single-coupon store, wrap the coupon entry (the AccordionRoot holding CartCouponForm) in it so the entry hides once a code is applied and returns when the chip is removed; for a multi-coupon store, omit it so the entry stays open for more codes. Keep CartAppliedCoupons and CartCouponError outside it, so the applied chips and coupon errors stay visible. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartCouponUnmatchedDefinition = defineComponent<CartCouponUnmatchedProps>({\n name: 'CartCouponUnmatched',\n importPath: '@vtex/faststore/components',\n component: CartCouponUnmatched,\n content: CartCouponUnmatchedContent,\n editor: { label: 'Cart Coupon Unmatched', category: 'commerce' },\n schema: {},\n guideline:\n \"Per-chip notice for an applied coupon that grants nothing: renders the $content field message in an <output> live region only while the enclosing chip's coupon has isUnmatchedCondition (its conditions stopped matching, were never met, or the code was accepted without validation), and nothing once it matches again, outside a chip, or when the copy is blank. Place it inside CartAppliedCoupons next to CartCouponRemove: composed children replace the built-in remove control, so a chip template without CartCouponRemove loses the X. It does not remove the coupon; the shopper removes it with the X. See cart.md.\",\n});\n\nexport const CartCouponSavingsDefinition = defineComponent<CartCouponSavingsProps>({\n name: 'CartCouponSavings',\n importPath: '@vtex/faststore/components',\n component: CartCouponSavings,\n content: CartCouponSavingsContent,\n editor: { label: 'Cart Coupon Savings', category: 'commerce' },\n schema: {},\n guideline:\n \"Per-chip amount a fixed-amount coupon took off, summed from cart.discounts for the enclosing chip's code. Renders nothing for an unmatched, free-shipping or percentage coupon (the API attributes no amount to them), outside a chip, or when the sum is not above zero. The chip text is the $content field template, an ICU message whose {amount} argument is the formatted saving, e.g. '{amount}' or 'Economia de {amount}'. The chip already shows the code before its children. Place it inside a CartAppliedCoupons chip template next to CartCouponRemove: composed children replace the built-in remove control, so a chip template without CartCouponRemove loses the X. Must be inside CartRoot. See cart.md.\",\n});\n\n// ---------------------------------------------------------------------------\n// Implementations\n// ---------------------------------------------------------------------------\n\n// `useLayoutEffect` warns on the server in React 19; the server renders no effects, so fall back to `useEffect`.\nconst useIsomorphicLayoutEffect = globalThis.window === undefined ? useEffect : useLayoutEffect;\n\nexport function CartRoot({ $data: $dataProp, $actions: $actionsProp, className, children, ...props }: CartRootProps) {\n const $data = useDataOverride($dataProp);\n const $actions = useActionsOverride($actionsProp);\n const cart = $data ?? null;\n useCartSyncSalesChannel($actions?.cart?.syncSalesChannel, cart?.id ?? null, cart?.salesChannelMismatch);\n const { error: rootError } = useContext(ReactiveRootContext);\n\n // Hydrate the cart action's ready gate from the cart query response: once the entity arrives, the\n // existing-line writes (remove / quantity) can read it from the cache without a prior addItem.\n const cartEntityId = cart?.id ?? null;\n useEffect(() => {\n if (cartEntityId) orderFormIdVar(cartEntityId);\n }, [cartEntityId]);\n\n // The cart error vars are cleared when a CartRoot mounts; a write clears only its own channel as it starts\n // (item writes `cartUserErrorsVar`, coupon writes `cartCouponErrorsVar`, `validate` neither). The vars are\n // module-level, so an error from a write on another page would otherwise show here. Once per mount, before paint, and\n // never on re-render, so a failure published after the mount shows.\n useIsomorphicLayoutEffect(() => {\n cartUserErrorsVar([]);\n cartCouponErrorsVar([]);\n }, []);\n\n // Read-only context: the cart entity + query error. Cart writes are dispatched through\n // `$actions.cart.*`, not this context (ADR-0010).\n const dataValue: CartDataContextValue = useMemo(() => ({ cart, error: rootError ?? null }), [cart, rootError]);\n\n return (\n <CartTotalValueContext value={cart?.total ?? null}>\n <CartDataContextInternal value={dataValue}>\n <div {...props} className={className} data-fs-cart-root=\"\">\n {children}\n </div>\n </CartDataContextInternal>\n </CartTotalValueContext>\n );\n}\n\nexport function CartList({ className, children, skeletonCount = 3, ...props }: CartListProps) {\n const { cart } = useCart();\n const { loading } = useContext(ReactiveRootContext);\n const items = cart?.items ?? [];\n\n // FR-7: while the reactive cart query is in flight and no cart has resolved yet, render\n // skeleton placeholders instead of an empty list. Once data arrives (cart non-null) the real\n // lines render; a refetch over an existing cart keeps showing the items, not skeletons.\n if (loading && cart == null) {\n return (\n <div {...props} className={className} data-fs-cart-list=\"\">\n {Array.from({ length: skeletonCount }, (_, i) => (\n // biome-ignore lint/suspicious/noArrayIndexKey: static placeholders have no stable id\n <CartItemSkeleton key={i} />\n ))}\n </div>\n );\n }\n\n return (\n <div {...props} className={className} data-fs-cart-list=\"\">\n {items.map((item) => (\n // Publish the line's entity ref so each per-item provider (CartItemRoot,\n // CartItemSellerInfo, …) wrapped by <ReactiveListItemDataProvider> subscribes to\n // CartItem:<id> and falls back to this server-rendered slice until the cache is complete.\n // The per-line React context (CartItemContext) is provided by CartItemRoot, sliced — CartList\n // no longer fans the whole entity out (ADR-0012 Option B).\n <ListItemRefContext key={item.id} value={{ __typename: 'CartItem', id: item.id, fallbackData: item }}>\n {children}\n </ListItemRefContext>\n ))}\n </div>\n );\n}\n\ntype CartLinesProps = {\n items: CartEntity['items'];\n className?: string;\n children?: ReactNode;\n attribute: Record<string, string>;\n rest: ComponentPropsWithRef<'div'>;\n};\n\nfunction CartLines({ items, className, children, attribute, rest }: Readonly<CartLinesProps>) {\n return (\n <div {...rest} className={className} {...attribute}>\n {items.map((item) => (\n <ListItemRefContext key={item.id} value={{ __typename: 'CartItem', id: item.id, fallbackData: item }}>\n {children}\n </ListItemRefContext>\n ))}\n </div>\n );\n}\n\nexport function CartAvailableItems({ className, children, skeletonCount = 3, ...props }: CartAvailableItemsProps) {\n const { cart } = useCart();\n const { loading } = useContext(ReactiveRootContext);\n\n if (loading && cart == null) {\n return (\n <div {...props} className={className} data-fs-cart-available-items=\"\">\n {Array.from({ length: skeletonCount }, (_, i) => (\n <CartItemSkeleton key={i} />\n ))}\n </div>\n );\n }\n\n const items = (cart?.items ?? []).filter((item) => !isUnavailable(item));\n if (items.length === 0) return null;\n\n return (\n <CartLines items={items} className={className} attribute={{ 'data-fs-cart-available-items': '' }} rest={props}>\n {children}\n </CartLines>\n );\n}\n\nexport function CartUnavailableItems({ className, children, ...props }: CartUnavailableItemsProps) {\n const { cart } = useCart();\n const items = (cart?.items ?? []).filter(isUnavailable);\n if (items.length === 0) return null;\n\n return (\n <CartLines items={items} className={className} attribute={{ 'data-fs-cart-unavailable-items': '' }} rest={props}>\n {children}\n </CartLines>\n );\n}\n\nexport function CartTotal({ label, className, children, ...props }: CartTotalProps) {\n const total = useContext(CartTotalValueContext);\n const { locale, currency } = useStorefrontContext();\n const value = children ?? formatPrice(Number(total?.amount ?? 0), locale, currency);\n\n return (\n <span {...props} className={className} data-fs-cart-total=\"\" data-fs-text=\"\">\n {label == null ? (\n value\n ) : (\n <>\n <span>{label}</span>\n <span>{value}</span>\n </>\n )}\n </span>\n );\n}\n\nfunction addToCount(sum: number, item: CartEntity['items'][number]): number {\n if (item.gift) return sum;\n return Number.isFinite(item.quantity) ? sum + item.quantity : Number.NaN;\n}\n\nexport function CartCount({ className, children, $content, $locale, ...props }: CartCountProps) {\n const { cart } = useCart();\n const { format } = useMessageFormatter(CartCountContent, $content);\n // Gift lines are left out — a promotion added them, not the shopper. A gift-only cart therefore\n // counts 0 while still rendering filled: the three-state branch gates on items.length, not on this.\n // A non-gift line whose quantity is not a finite number makes the whole count NaN rather than a\n // partial sum, so the leaf renders nothing instead of a wrong number.\n const count = cart?.items.reduce(addToCount, 0) ?? 0;\n if (!Number.isFinite(count)) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-count=\"\" data-fs-text=\"\">\n {children ?? format('template', { count })}\n </span>\n );\n}\n\n/**\n * The message for each code an item write can publish: the five item mutations' codes plus the\n * client-minted transport failure. A code this map does not know (a newer server) shows genericErrorMessage.\n */\nexport const CART_ERROR_FIELDS = {\n INVALID_QUANTITY: 'invalidQuantityMessage',\n ITEM_NOT_FOUND: 'itemNotFoundMessage',\n MISSING_CART_CONTEXT: 'genericErrorMessage',\n CART_NOT_FOUND: 'genericErrorMessage',\n INVALID_VARIANT_ID: 'genericErrorMessage',\n INVALID_SELLER_ID: 'genericErrorMessage',\n NO_LINE_IDS_PROVIDED: 'genericErrorMessage',\n UPSTREAM_ERROR: 'genericErrorMessage',\n NETWORK_ERROR: 'genericErrorMessage',\n} as const satisfies Record<\n | CartItemAddErrorCode\n | CartItemRemoveErrorCode\n | CartItemsRemoveErrorCode\n | CartItemQuantityIncreaseErrorCode\n | CartItemQuantityDecreaseErrorCode\n | 'NETWORK_ERROR',\n MessageFieldName<typeof CartErrorContent>\n>;\n\n/** The message for each code a coupon write can publish, plus the client-minted transport failure. */\nexport const CART_COUPON_ERROR_FIELDS = {\n COUPON_NOT_FOUND: 'couponNotFoundMessage',\n COUPON_EXPIRED: 'couponExpiredMessage',\n COUPON_NOT_COMBINED: 'couponNotCombinedMessage',\n MISSING_CART_CONTEXT: 'genericErrorMessage',\n CART_NOT_FOUND: 'genericErrorMessage',\n NETWORK_ERROR: 'genericErrorMessage',\n} as const satisfies Record<\n CartCouponApplyErrorCode | CartCouponRemoveErrorCode | 'NETWORK_ERROR',\n MessageFieldName<typeof CartCouponErrorContent>\n>;\n\nexport function CartError({ $content, $locale, className, children, ...props }: CartErrorProps) {\n const userErrors = useReactiveVar(cartUserErrorsVar);\n const { format } = useMessageFormatter(CartErrorContent, $content);\n const [firstError] = userErrors;\n if (!firstError) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-error=\"\" data-fs-text=\"\">\n {children ?? formatErrorCode(CartErrorContent, CART_ERROR_FIELDS, firstError, format, 'genericErrorMessage')}\n </div>\n );\n}\n\n// `useLinkStatus()` only reports a pending window from a component rendered inside the <Link>, so\n// the loading state lives in this module-private child rather than in CartGoCheckout's body. No\n// built-in spinner: stores opt in by styling data-fs-cart-go-checkout-pending (mirrors buy-button).\nfunction CartGoCheckoutPending({ children }: { children?: ReactNode }) {\n const { pending } = useLinkStatus();\n\n return (\n <span\n data-fs-cart-go-checkout-content=\"\"\n aria-busy={pending || undefined}\n {...(pending ? { 'data-fs-cart-go-checkout-pending': '' } : {})}\n >\n {children}\n </span>\n );\n}\n\n// A blank value counts as unconfigured: a content model's minLength is enforced by neither the runtime\n// slice nor the preflight, and an authored empty string child is the same mistake. Trim to decide,\n// never to render.\nfunction configuredLabel(value: string | undefined) {\n return value?.trim() ? value : undefined;\n}\n\n/** The default destination of both checkout navigations. Module-level, so an effect keyed on it is stable. */\nconst CHECKOUT_PAGE: PageRef = { standard: 'checkout' };\n\n// A click that stays in this tab: not cancelled by another handler, the main button, no modifier. Anything\n// else (new tab, new window, middle-click) belongs to the browser.\nfunction isPlainLeftClick(e: React.MouseEvent): boolean {\n return !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey;\n}\n\nexport function CartGoCheckout({\n href = CHECKOUT_PAGE,\n className,\n children,\n onClick,\n $content,\n $locale,\n $actions: $actionsProp,\n ...props\n}: CartGoCheckoutProps) {\n const $actions = useActionsOverride($actionsProp);\n const { format } = useMessageFormatter(CartCheckoutLabelContent, $content);\n const client = useApolloClient();\n // `push` sends a site-relative checkout through the router, which keeps the pending state working, and\n // an off-site checkout URL to a document load.\n const { push } = useStorefrontNavigation();\n const [validating, setValidating] = useState(false);\n // Re-entrancy latch. A ref, not `validating`, because two clicks in one tick both read the same\n // pre-render state value; a ref is set synchronously so the second click sees the reservation.\n const inFlight = useRef(false);\n\n // $content stays here and is never spread into NavigationLink, so no entry can reach the href. A\n // blank string child counts as unset, so the message fills the slot; element children (an icon\n // composition) pass through untouched.\n const resolvedChildren = typeof children === 'string' ? configuredLabel(children) : children;\n const resolvedLabel = resolvedChildren ?? format('label');\n\n // The mini-cart drawer closes before the router takes over; the var is module-level, so this also resets a\n // drawer the destination layout does not mount. Writing `false` over `false` broadcasts nothing.\n function leave() {\n miniCartOpenVar(false);\n push(href);\n }\n\n // Pre-checkout stock validation (docs/storefront-core/reference-cart.md § Validation). Intercept\n // the CTA, await any in-flight write, validate, then branch on the outcome: a validation that could\n // not run navigates anyway (fail-open, unconditional — holds with or without a CartCheckoutGuard); a\n // validation that succeeded navigates only when the corrected cart has no unavailable line. Reading\n // the cache after the await is deterministic because Apollo commits the mutation's cache write before\n // the promise resolves.\n async function handleClick(e: React.MouseEvent<HTMLAnchorElement>) {\n onClick?.(e);\n // Modified clicks (new tab, middle-click) and clicks another handler already owns are left to the\n // browser, drawer untouched.\n if (!isPlainLeftClick(e)) return;\n const validate = $actions?.cart?.validate;\n // No gate wired → the link behaves natively, and the drawer it sits in goes away with the click.\n if (!validate) {\n miniCartOpenVar(false);\n return;\n }\n e.preventDefault();\n // Re-entrant clicks while a validation is running are swallowed, never a second dispatch.\n if (inFlight.current) return;\n inFlight.current = true;\n\n setValidating(true);\n try {\n await awaitCartWrites();\n const errors = await validate();\n if (errors.length > 0) {\n leave();\n return;\n }\n const cart = readCartFromCache(client);\n const blocked = (cart?.items ?? []).some((item) => item.variant.availability !== 'AVAILABLE');\n if (!blocked) leave();\n } finally {\n inFlight.current = false;\n setValidating(false);\n }\n }\n\n return (\n <NavigationLink\n {...props}\n href={href}\n onClick={handleClick}\n className={className}\n data-fs-cart-go-checkout=\"\"\n {...(validating ? { 'data-fs-cart-go-checkout-validating': '' } : {})}\n >\n <CartGoCheckoutPending>{resolvedLabel}</CartGoCheckoutPending>\n </NavigationLink>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Coupon — apply / applied list + remove / error (FSPG-830)\n// ---------------------------------------------------------------------------\n\nexport function CartCouponForm({\n className,\n children,\n onSubmit,\n $content,\n $locale,\n $actions: $actionsProp,\n ...props\n}: CartCouponFormProps) {\n const $actions = useActionsOverride($actionsProp);\n const { format } = useMessageFormatter(CartCouponFormContent, $content);\n const toast = useOptionalToast();\n // Non-throwing read: the form also renders without an ApolloProvider.\n const { client } = useContext(getApolloContext());\n const [code, setCode] = useState('');\n const [pending, setPending] = useState(false);\n\n async function handleSubmit(e: Parameters<NonNullable<CartCouponFormProps['onSubmit']>>[0]) {\n e.preventDefault();\n onSubmit?.(e);\n const trimmed = code.trim();\n if (!trimmed || pending) return;\n\n setPending(true);\n try {\n const errors = await $actions?.cart?.applyCoupon?.({ code: trimmed });\n // Clear the input only when the apply succeeded (no userErrors).\n if (!errors || errors.length === 0) setCode('');\n // The cache already holds the apply's cart; a code accepted without a matched condition grants nothing.\n if (errors?.length === 0 && client && toast) {\n const submitted = trimmed.toLowerCase();\n const coupons = readCartFromCache(client)?.appliedCoupons ?? [];\n const matched = coupons.some(\n (coupon) => coupon.code.trim().toLowerCase() === submitted && coupon.isUnmatchedCondition === false,\n );\n const title = matched ? format('appliedMessage') : '';\n if (title) toast.add({ title, type: 'success' });\n }\n } finally {\n setPending(false);\n }\n }\n\n // Formatted once: it is both the placeholder and the accessible name. Composed children replace the fields.\n const placeholder = children == null ? format('placeholder') : undefined;\n\n return (\n <form\n {...props}\n className={className}\n onSubmit={handleSubmit}\n data-fs-cart-coupon-form=\"\"\n {...(pending ? { 'data-fs-cart-coupon-pending': '' } : {})}\n >\n {children ?? (\n <>\n <input\n type=\"text\"\n value={code}\n placeholder={placeholder}\n aria-label={placeholder}\n disabled={pending}\n onChange={(e) => setCode(e.target.value)}\n data-fs-cart-coupon-input=\"\"\n />\n <button type=\"submit\" disabled={pending} data-fs-cart-coupon-apply=\"\" data-fs-button=\"\">\n {format('applyLabel')}\n </button>\n </>\n )}\n </form>\n );\n}\n\nexport function CartAppliedCoupons({\n className,\n children,\n $content,\n $locale,\n $actions: $actionsProp,\n ...props\n}: CartAppliedCouponsProps) {\n const $actions = useActionsOverride($actionsProp);\n const { format } = useMessageFormatter(CartAppliedCouponsContent, $content);\n const { cart } = useCart();\n const coupons = cart?.appliedCoupons ?? [];\n if (coupons.length === 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-applied-coupons=\"\">\n {coupons.map((coupon) => (\n <CartCouponContext key={coupon.code} value={coupon}>\n <CartCouponChip\n $actions={$actions}\n removeLabel={children == null ? format('removeLabel', { code: coupon.code }) : undefined}\n >\n {children}\n </CartCouponChip>\n </CartCouponContext>\n ))}\n </div>\n );\n}\n\n// Per-coupon chip rendered by CartAppliedCoupons. Unregistered presentational helper (mirrors\n// CartItemSkeleton): the chip exposes data-fs-cart-coupon (+ data-fs-cart-coupon-unmatched) and\n// renders the coupon code inline, then renders the remove control — either the author-supplied\n// `children` (so the compiler can inject $actions into a CartCouponRemove placed in the layout) or a\n// built-in CartCouponRemove named by `removeLabel`, which the owner formats. The active coupon flows\n// to descendants via CartCouponContext.\nfunction CartCouponChip({\n children,\n removeLabel,\n $actions,\n}: Readonly<{\n children?: ReactNode;\n removeLabel?: string;\n $actions?: ComponentActions;\n}>) {\n const coupon = useContext(CartCouponContext);\n if (!coupon) return null;\n\n return (\n <span data-fs-cart-coupon=\"\" {...(coupon.isUnmatchedCondition ? { 'data-fs-cart-coupon-unmatched': '' } : {})}>\n <span data-fs-cart-coupon-code=\"\" data-fs-text=\"\">\n {coupon.code}\n </span>\n {children ?? (\n <CartCouponRemove $actions={$actions} aria-label={removeLabel}>\n ×\n </CartCouponRemove>\n )}\n </span>\n );\n}\n\nexport function CartCouponRemove({\n code,\n className,\n children,\n onClick,\n $actions: $actionsProp,\n ...props\n}: CartCouponRemoveProps) {\n const $actions = useActionsOverride($actionsProp);\n const coupon = useContext(CartCouponContext);\n const targetCode = code ?? coupon?.code;\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n if (targetCode) void $actions?.cart?.removeCoupon?.({ code: targetCode });\n onClick?.(e);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n data-fs-cart-coupon-remove=\"\"\n data-fs-button=\"\"\n >\n {children}\n </button>\n );\n}\n\nexport function CartCouponError({ $content, $locale, className, children, ...props }: CartCouponErrorProps) {\n const couponErrors = useReactiveVar(cartCouponErrorsVar);\n const { format } = useMessageFormatter(CartCouponErrorContent, $content);\n const [firstError] = couponErrors;\n if (!firstError) return null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-coupon-error=\"\" data-fs-text=\"\">\n {children ??\n formatErrorCode(CartCouponErrorContent, CART_COUPON_ERROR_FIELDS, firstError, format, 'genericErrorMessage')}\n </div>\n );\n}\n\nexport function CartCouponEmpty({ className, children, ...props }: CartCouponEmptyProps) {\n const { cart } = useCart();\n if (cart == null || (cart.appliedCoupons ?? []).length > 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-coupon-empty=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartCouponUnmatched({ className, children, $content, $locale, ...props }: CartCouponUnmatchedProps) {\n const coupon = useContext(CartCouponContext);\n const { format } = useMessageFormatter(CartCouponUnmatchedContent, $content);\n if (coupon?.isUnmatchedCondition !== true) return null;\n const notice = children ?? format('message');\n if (notice === '') return null;\n\n return (\n <output {...props} className={className} data-fs-cart-coupon-unmatched-notice=\"\" data-fs-text=\"\">\n {notice}\n </output>\n );\n}\n\nexport function CartCouponSavings({ className, $content, $locale, ...props }: CartCouponSavingsProps) {\n const coupon = useContext(CartCouponContext);\n const { cart } = useCart();\n const { locale, currency } = useStorefrontContext();\n const { format } = useMessageFormatter(CartCouponSavingsContent, $content);\n if (!cart || !coupon || coupon.isUnmatchedCondition || coupon.code === '') return null;\n\n const saved = cart.discounts.reduce(\n (sum, discount) =>\n discount.kind === 'COUPON' && discount.name === coupon.code && isFiniteAmount(discount.value.amount)\n ? sum + Number(discount.value.amount)\n : sum,\n 0,\n );\n if (saved <= 0) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-coupon-savings=\"\" data-fs-text=\"\">\n {format('template', { amount: formatPrice(-saved, locale, currency) })}\n </span>\n );\n}\n\n// ---------------------------------------------------------------------------\n// F4 — Out-of-stock / unavailable item handling\n// ---------------------------------------------------------------------------\n\nexport const CartCheckoutGuardDefinition = defineComponent<CartCheckoutGuardProps>({\n name: 'CartCheckoutGuard',\n importPath: '@vtex/faststore/components',\n component: CartCheckoutGuard,\n editor: { label: 'Cart Checkout Guard', category: 'commerce' },\n schema: {},\n guideline:\n 'Wraps the checkout CTA and blocks progression while any cart item is unavailable: the subtree is made non-interactive (inert) and data-fs-cart-checkout-blocked is exposed for styling the disabled state. In the mini-cart DrawerPopup footer it is the enriched checkout CTA wrapper: place CartTotal and CartGoCheckout inside it so the grand total sits at the button and the whole CTA goes inert when an item cannot be delivered. Must be inside CartRoot.',\n});\n\nexport const CartLoadingDefinition = defineComponent<CartLoadingProps>({\n name: 'CartLoading',\n importPath: '@vtex/faststore/components',\n component: CartLoading,\n editor: { label: 'Cart Loading', category: 'commerce' },\n schema: {},\n guideline:\n 'The loading branch of the three-state mini-cart (loading / empty / filled): renders its children only while the cart is still loading. Supply a skeleton placeholder as its child. Pair with CartEmpty and CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartEmptyDefinition = defineComponent<CartEmptyProps>({\n name: 'CartEmpty',\n importPath: '@vtex/faststore/components',\n component: CartEmpty,\n editor: { label: 'Cart Empty', category: 'commerce' },\n schema: {},\n guideline:\n 'The empty branch of the three-state mini-cart (loading / empty / filled): renders its children only when the cart has resolved with zero items. It carries no copy of its own — compose CartEmptyMessage for the message and CartContinueShopping for the continue-shopping control, in whatever order and grouping the panel needs. Pair with CartLoading and CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartFilledDefinition = defineComponent<CartFilledProps>({\n name: 'CartFilled',\n importPath: '@vtex/faststore/components',\n component: CartFilled,\n editor: { label: 'Cart Filled', category: 'commerce' },\n schema: {},\n guideline:\n 'The filled branch of the three-state mini-cart (loading / empty / filled): renders its children only when the cart has one or more items. Wrap the CartList (or the CartAvailableItems and CartUnavailableItems pair that replaces it, the latter inside a CartUnavailableSection with a CartUnavailableLabel), the order summary, and the checkout CTA in it so they hide when the cart is empty. Pair with CartLoading and CartEmpty. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartUnavailableCountDefinition = defineComponent<CartUnavailableCountProps>({\n name: 'CartUnavailableCount',\n importPath: '@vtex/faststore/components',\n component: CartUnavailableCount,\n content: CartUnavailableCountContent,\n editor: { label: 'Cart Unavailable Count', category: 'commerce' },\n schema: {},\n guideline:\n 'Cart-level summary of how many lines are unavailable; self-hides when none. The text is the $content field template, an ICU message with a count argument. See cart.md.',\n});\n\nexport const CartRemoveUnavailableDefinition = defineComponent<CartRemoveUnavailableProps>({\n name: 'CartRemoveUnavailable',\n importPath: '@vtex/faststore/components',\n component: CartRemoveUnavailable,\n content: CartRemoveUnavailableContent,\n editor: { label: 'Cart Remove Unavailable', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeItems'] },\n guideline:\n 'Button that removes every unavailable line in one batch call; self-hides when none. Composed children are the label; without them it is the $content field label. See cart.md.',\n});\n\nexport const ClearCartButtonDefinition = defineComponent<ClearCartButtonProps>({\n name: 'ClearCartButton',\n importPath: '@vtex/faststore/components',\n component: ClearCartButton,\n content: ClearCartButtonContent,\n editor: { label: 'Clear Cart Button', category: 'commerce' },\n schema: {},\n actions: { cart: ['removeItems'] },\n guideline:\n 'Button that removes every line in the cart (gift and unavailable lines included) in one batch call; self-hides when the cart has no lines. Disabled, with data-fs-clear-cart-button-pending, while the call is in flight. No confirmation and no toast. The write is optimistic: CartEmpty replaces CartFilled as soon as it is clicked; on failure the lines come back and the error shows in CartError, so compose a CartError outside the CartFilled/CartEmpty branches. Composed children are the label; without them it is the $content field label. Must be inside CartRoot. See cart.md.',\n});\n\nfunction isUnavailable(item: CartEntity['items'][number]): boolean {\n return item.variant.availability !== 'AVAILABLE';\n}\n\nexport function CartCheckoutGuard({ className, children, ...props }: CartCheckoutGuardProps) {\n const { cart } = useCart();\n // Fail-safe: block on any non-AVAILABLE state — OUT_OF_STOCK, UNAVAILABLE, and the\n // catch-all UNKNOWN — so an unclassified item never lets the shopper proceed.\n const blocked = (cart?.items ?? []).some(isUnavailable);\n\n return (\n <div\n {...props}\n className={className}\n inert={blocked}\n aria-disabled={blocked || undefined}\n data-fs-cart-checkout-guard=\"\"\n data-fs-cart-checkout-blocked={blocked ? '' : undefined}\n >\n {children}\n </div>\n );\n}\n\nexport function CartUnavailableCount({ className, children, $content, $locale, ...props }: CartUnavailableCountProps) {\n const { cart } = useCart();\n const { format } = useMessageFormatter(CartUnavailableCountContent, $content);\n const count = (cart?.items ?? []).filter(isUnavailable).length;\n if (count === 0) return null;\n\n return (\n <span {...props} className={className} data-fs-cart-unavailable-count=\"\" data-fs-text=\"\">\n {children ?? format('template', { count })}\n </span>\n );\n}\n\nexport function CartRemoveUnavailable({\n className,\n children,\n onClick,\n $content,\n $locale,\n $actions: $actionsProp,\n ...props\n}: CartRemoveUnavailableProps) {\n const $actions = useActionsOverride($actionsProp);\n const { format } = useMessageFormatter(CartRemoveUnavailableContent, $content);\n const { cart } = useCart();\n const unavailableIds = (cart?.items ?? []).filter(isUnavailable).map((item) => item.id);\n if (unavailableIds.length === 0) return null;\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n void $actions?.cart?.removeItems?.({ ids: unavailableIds });\n onClick?.(e);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n data-fs-cart-remove-unavailable=\"\"\n data-fs-button=\"\"\n >\n {children ?? format('label')}\n </button>\n );\n}\n\nexport const CartUnavailableLabelContent = defineContentType({\n id: 'cart-unavailable-label',\n title: 'Cart Unavailable Label',\n description: 'Heading copy of the cart section that holds the lines the shopper cannot buy.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: { type: 'string', title: 'Unavailable section label', format: 'icu-message', messageSource: 'Unavailable' },\n },\n },\n});\n\nexport const CartUnavailableSectionDefinition = defineComponent<CartUnavailableSectionProps>({\n name: 'CartUnavailableSection',\n importPath: '@vtex/faststore/components',\n component: CartUnavailableSection,\n editor: { label: 'Cart Unavailable Section', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders its children only when at least one cart line is unavailable, so the section card, header and list disappear together; it carries no copy (compose CartUnavailableLabel and CartUnavailableItems inside it). Pair with CartAvailableItems under CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartUnavailableLabelDefinition = defineComponent<CartUnavailableLabelProps>({\n name: 'CartUnavailableLabel',\n importPath: '@vtex/faststore/components',\n component: CartUnavailableLabel,\n content: CartUnavailableLabelContent,\n editor: { label: 'Cart Unavailable Label', category: 'commerce' },\n schema: {},\n guideline:\n 'Heading copy of the unavailable section, rendered as plain text from the $content field text; blank copy renders nothing. It renders only while at least one line is unavailable. Compose one inside CartUnavailableSection as its header, grouped with an Icon in a Container when the header carries one. Must be inside CartRoot. See cart.md.',\n});\n\nexport function CartUnavailableSection({ className, children, ...props }: CartUnavailableSectionProps) {\n const { cart } = useCart();\n if (!cart?.items.some(isUnavailable)) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-unavailable-section=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartUnavailableLabel({ $content, $locale, className, ...props }: CartUnavailableLabelProps) {\n const { cart } = useCart();\n const { format } = useMessageFormatter(CartUnavailableLabelContent, $content);\n // The hide rule is the leaf's own, not its placement's: a label composed outside the section\n // still never shows over nothing.\n if (!cart?.items.some(isUnavailable)) return null;\n\n const copy = format('text');\n if (!copy.trim()) return null;\n\n return (\n <p {...props} className={className} data-fs-cart-unavailable-label=\"\" data-fs-text=\"\">\n {copy}\n </p>\n );\n}\n\nexport const CartAllUnavailableMessageContent = defineContentType({\n id: 'cart-all-unavailable-message',\n title: 'Cart All Unavailable Message',\n description:\n 'Warning shown in the cart when none of the lines the shopper added can be bought, with an optional link.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n title: 'Nothing purchasable message',\n format: 'icu-message',\n messageSource: 'No items are available for purchase right now',\n },\n // Optional, no default: the link renders only when both fields are set.\n linkText: { type: 'string', minLength: 1, title: 'Link text' },\n linkHref: {\n type: 'string',\n minLength: 1,\n title: 'Link destination',\n format: 'uri-reference',\n pattern: '^(?:https?://.*|mailto:.+|tel:.+|/(?:[^/].*)?)$',\n },\n },\n },\n});\n\nexport const CartAllUnavailableDefinition = defineComponent<CartAllUnavailableProps>({\n name: 'CartAllUnavailable',\n importPath: '@vtex/faststore/components',\n component: CartAllUnavailable,\n editor: { label: 'Cart All Unavailable', category: 'commerce' },\n schema: {},\n guideline:\n 'Renders its children only when the cart has at least one line the shopper added and every such line is unavailable; gift lines are ignored, so a gift-only cart never shows it and a cart whose only available line is a gift does. Distinct from CartEmpty (zero lines). Carries no copy: compose CartAllUnavailableMessage inside it, which carries the optional link. While it holds no rendered CartAllUnavailableMessage (blank copy, or no message composed), the store stylesheet hides it with display: none, so put the box on the gate: blank copy leaves no empty box, and a display class cannot show it. Place under CartFilled. Must be inside CartRoot. See cart.md.',\n});\n\nexport const CartAllUnavailableMessageDefinition = defineComponent<CartAllUnavailableMessageProps>({\n name: 'CartAllUnavailableMessage',\n importPath: '@vtex/faststore/components',\n component: CartAllUnavailableMessage,\n content: CartAllUnavailableMessageContent,\n editor: { label: 'Cart All Unavailable Message', category: 'commerce' },\n schema: {\n linkText: { type: 'string', label: 'Link text' },\n linkHref: { type: 'link', label: 'Link destination' },\n },\n guideline:\n 'The warning that nothing in the cart can be bought, inside CartAllUnavailable, announced to screen readers as an alert. The message is the $content field text; blank copy renders nothing. It renders only while the cart has nothing purchasable. An optional link follows the text: set linkText and linkHref (a page reference such as { \"page\": \"<page name>\" }), or the same CMS fields; it renders only when both are set, there is no default, and a destination that is not a page reference or an http, https, mailto, tel or site-relative URL is dropped. A non-blank CMS field wins over its prop, so a CMS store authors no link props. Must be inside CartRoot. See cart.md.',\n});\n\n/** True when the cart has a shopper-added line and every shopper-added line is unavailable. */\nfunction hasNothingPurchasable(items: CartEntity['items']): boolean {\n const shopperLines = items.filter((item) => !item.gift);\n return shopperLines.length > 0 && shopperLines.every(isUnavailable);\n}\n\n// The shipped stylesheet hides this div while it holds no rendered CartAllUnavailableMessage (`@layer base` in\n// styles/tailwind.css and the sukima template's globals.css), so the markup stays the same.\nexport function CartAllUnavailable({ className, children, ...props }: CartAllUnavailableProps) {\n const { cart } = useCart();\n if (cart == null || !hasNothingPurchasable(cart.items)) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-all-unavailable=\"\">\n {children}\n </div>\n );\n}\n\n/**\n * A page reference skips the string allowlist. A string is checked, and a refusal drops the link.\n * The runtime content slice does not enforce the model's `pattern`, so this is the only gate on a CMS string.\n */\nfunction resolveMessageLinkHref(href: PageRef | string | undefined): PageRef | string | null {\n if (href == null) return null;\n if (typeof href !== 'string') return href;\n if (!href.trim()) return null;\n\n const destination = resolveSafeHref(href);\n if (!destination.safe) {\n console.warn('[CartAllUnavailableMessage] link destination rejected', { reason: destination.reason });\n return null;\n }\n\n return destination.href;\n}\n\nexport function CartAllUnavailableMessage({\n linkText,\n linkHref,\n $content,\n $locale,\n className,\n ...props\n}: CartAllUnavailableMessageProps) {\n const { cart } = useCart();\n const { format } = useMessageFormatter(CartAllUnavailableMessageContent, $content);\n // The hide rule is the leaf's own, not its placement's: a message composed outside the gate\n // never tells a shopper with purchasable lines that nothing can be bought.\n if (cart == null || !hasNothingPurchasable(cart.items)) return null;\n\n const copy = format('text');\n if (!copy.trim()) return null;\n\n const resolvedLinkText = configuredLabel($content?.linkText) ?? configuredLabel(linkText);\n // A non-blank CMS string wins, and a refusal drops the link rather than falling back to the prop.\n const rawHref = $content?.linkHref?.trim() ? $content.linkHref : linkHref;\n const destination = resolvedLinkText ? resolveMessageLinkHref(rawHref) : null;\n\n return (\n <div {...props} role=\"alert\" className={className} data-fs-cart-all-unavailable-message=\"\">\n <p data-fs-cart-all-unavailable-message-text=\"\" data-fs-text=\"\">\n {copy}\n </p>\n {resolvedLinkText && destination != null ? (\n <NavigationLink href={destination} data-fs-cart-all-unavailable-message-link=\"\">\n {resolvedLinkText}\n </NavigationLink>\n ) : null}\n </div>\n );\n}\n\nexport function ClearCartButton({\n className,\n children,\n disabled,\n onClick,\n $content,\n $locale,\n $actions: $actionsProp,\n ...props\n}: ClearCartButtonProps) {\n const $actions = useActionsOverride($actionsProp);\n const { format } = useMessageFormatter(ClearCartButtonContent, $content);\n const { cart } = useCart();\n const [pending, setPending] = useState(false);\n // Re-entrancy latch. A ref, not `pending`, because two clicks in one tick both read the same\n // pre-render state value; `removeItems` reads the non-optimistic cache, so without the ref a second\n // click in that tick would send a second mutation.\n const inFlight = useRef(false);\n const ids = (cart?.items ?? []).map((item) => item.id);\n if (ids.length === 0) return null;\n\n async function clear(removeItems: (payload: { ids: string[] }) => Promise<unknown>) {\n try {\n await removeItems({ ids });\n } catch (error) {\n console.error('[ClearCartButton] removeItems failed', loggableErrorName(error));\n } finally {\n inFlight.current = false;\n setPending(false);\n }\n }\n\n function handleClick(e: React.MouseEvent<HTMLButtonElement>) {\n if (inFlight.current) return;\n // Before the latch, and outside the async body: a throwing caller handler must neither lock the\n // button nor turn into an unhandled rejection.\n onClick?.(e);\n const removeItems = $actions?.cart?.removeItems;\n if (typeof removeItems !== 'function') return;\n inFlight.current = true;\n setPending(true);\n void clear(removeItems);\n }\n\n return (\n <button\n {...props}\n type=\"button\"\n className={className}\n onClick={handleClick}\n disabled={pending || disabled}\n data-fs-clear-cart-button=\"\"\n data-fs-button=\"\"\n {...(pending ? { 'data-fs-clear-cart-button-pending': '' } : {})}\n >\n {children ?? format('label')}\n </button>\n );\n}\n\n// ---------------------------------------------------------------------------\n// FSPG-822 — post-add behavior (mutually exclusive, selected by composition)\n//\n// Both subscribe to the add-success pulse (cartLastAddVar), which `addItem`\n// increments on each clean add. CartOpenOnAdd maps the pulse to the mini-cart's\n// open state; CartRedirectOnAdd sends a no-mini-cart store straight to checkout.\n// A store composes exactly one — there is no foundation flag.\n// ---------------------------------------------------------------------------\n\nexport const CartOpenOnAddDefinition = defineComponent<CartOpenOnAddProps>({\n name: 'CartOpenOnAdd',\n importPath: '@vtex/faststore/components',\n component: CartOpenOnAdd,\n editor: { label: 'Cart Open On Add', category: 'commerce' },\n schema: {},\n actions: { cart: ['validate'] },\n guideline:\n 'Mini-cart post-add behavior: wraps the mini-cart DrawerRoot subtree and opens the drawer automatically on each successful add to cart. Compose it as the parent of the DrawerRoot (its single child) — the header DrawerTrigger, the popup, and the cart leaves stay inside that DrawerRoot. It makes the drawer controlled internally, so do not set raw open/onOpenChange on DrawerRoot; the header trigger and manual close (Escape / backdrop / close button) keep working. It also runs a stock validation when the overlay opens, behind a short staleness window and skipped while a cart write is in flight, so opening a cart that went stale corrects it before the shopper acts. Use only in a store that has a mini-cart drawer. Mutually exclusive with CartRedirectOnAdd — compose exactly one. See cart.md.',\n});\n\nexport const CartRedirectOnAddDefinition = defineComponent<CartRedirectOnAddProps>({\n name: 'CartRedirectOnAdd',\n importPath: '@vtex/faststore/components',\n component: CartRedirectOnAdd,\n editor: { label: 'Cart Redirect On Add', category: 'commerce' },\n schema: {\n href: { type: 'link', default: { standard: 'checkout' }, label: 'Checkout URL' },\n },\n guideline:\n 'No-mini-cart post-add behavior: navigates the shopper to checkout (href, default the checkout page) after each successful add to cart. Compose it once in the layout for a store that has no mini-cart drawer; it renders no UI of its own. Use this instead of a mini-cart when adding a product should go straight to checkout. Mutually exclusive with CartOpenOnAdd — compose exactly one, and omit the drawer when using this. See cart.md.',\n});\n\n/**\n * Makes the wrapped mini-cart `DrawerRoot` controlled by `miniCartOpenVar` and opens it on each\n * add-success pulse. `miniCartOpenVar` is the single source of truth: the pulse-driven open, the\n * header trigger (`onOpenChange(true)`), and manual close (`onOpenChange(false)`) all route through\n * it, so the trigger and manual dismissal keep working under controlled mode. Context-free — it\n * reads reactive vars and needs no `CartRoot` ancestor (ADR-0010). Expects a single `DrawerRoot`\n * child; the wiring is encapsulated here, never exposed as authorable drawer props.\n */\nexport function CartOpenOnAdd({ children, $actions: $actionsProp }: CartOpenOnAddProps) {\n const $actions = useActionsOverride($actionsProp);\n const open = useReactiveVar(miniCartOpenVar);\n const pulse = useReactiveVar(cartLastAddVar);\n\n useEffect(() => {\n if (pulse > 0) miniCartOpenVar(true);\n }, [pulse]);\n\n // Validate the cart's stock on the overlay's closed→open edge (T13). This is the sole observer of\n // that transition, so validate-on-open lives here rather than in a separate leaf whose only open\n // signal would be this same var.\n useCartValidateOnOpen($actions?.cart?.validate);\n\n if (!isValidElement<Pick<DrawerRootProps, 'open' | 'onOpenChange'>>(children)) return children;\n\n return cloneElement(children, {\n open,\n onOpenChange: (next: boolean) => miniCartOpenVar(next),\n });\n}\n\n/**\n * Navigates a no-mini-cart store to checkout after a successful add. Keys a `useEffect` on the\n * add-success pulse, which `addItem` increments only on the clean branch after the `await`, so the\n * redirect is post-resolve and success-gated. The initial `0` is ignored, so a fresh mount never\n * navigates. Context-free — no `CartRoot` ancestor (ADR-0010). Renders its passthrough children (or\n * nothing); it carries no drawer.\n *\n * The effect keys on the serialized `href`, not on its identity: a reference authored in a schema\n * arrives as a new object on every server render, and keying on it would push to checkout again on a\n * `router.refresh()` long after the add.\n */\nexport function CartRedirectOnAdd({ href = CHECKOUT_PAGE, children }: CartRedirectOnAddProps) {\n const { push } = useStorefrontNavigation();\n const pulse = useReactiveVar(cartLastAddVar);\n const hrefKey = JSON.stringify(href);\n\n useEffect(() => {\n if (pulse > 0) push(JSON.parse(hrefKey));\n }, [pulse, hrefKey, push]);\n\n return children;\n}\n\n// ---------------------------------------------------------------------------\n// Loading / empty / filled — three mutually-exclusive self-hide branches gating\n// on the reactive cart (FSPG-820). `CartLoading` renders while the cart has not\n// resolved (`cart == null`); `CartEmpty` requires a resolved, item-free cart so\n// the empty state never flashes during load; `CartFilled` requires items.\n// Exactly one renders at any time: loading → empty → filled.\n// ---------------------------------------------------------------------------\n\nexport function CartLoading({ className, children, ...props }: CartLoadingProps) {\n const { cart } = useCart();\n if (cart != null) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-loading=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartEmpty({ className, children, ...props }: CartEmptyProps) {\n const { cart } = useCart();\n if (cart == null || cart.items.length > 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-empty=\"\">\n {children}\n </div>\n );\n}\n\nexport function CartFilled({ className, children, ...props }: CartFilledProps) {\n const { cart } = useCart();\n if ((cart?.items ?? []).length === 0) return null;\n\n return (\n <div {...props} className={className} data-fs-cart-filled=\"\">\n {children}\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merchant messaging — disclaimer (F13). A plain-text notice the merchant authors, shown before the\n// shopper commits. It carries no fragment: the items gate reads what CartRoot already selects, so\n// placing or removing it leaves the composed page query unchanged.\n// ---------------------------------------------------------------------------\n\nexport const CartDisclaimerDefinition = defineComponent({\n name: 'CartDisclaimer',\n importPath: '@vtex/faststore/components',\n component: CartDisclaimer,\n content: CartDisclaimerContent,\n editor: { label: 'Cart Disclaimer', category: 'commerce' },\n schema: {\n text: { type: 'string', label: 'Disclaimer text' },\n },\n guideline:\n 'Plain-text merchant notice — conditions, purchase limits, or legal wording — shown in the cart before the shopper commits. CMS content wins over the text prop, and nothing renders when neither supplies a notice. It renders only when the cart has items, so it stays out of the empty state and out of the window before the cart resolves on its own. Place it inside CartFilled, below the order summary or immediately above the checkout CTA (CartCheckoutGuard): placement is composition order, and there is no position prop. Plain text only — no rich text and no inline links. Must be inside CartRoot. See cart.md.',\n});\n\nexport function CartDisclaimer({ text, $content, className, children, ...props }: CartDisclaimerProps) {\n const { cart } = useCart();\n // The empty-state rule is the leaf's own, not its placement's: a disclaimer composed outside\n // CartFilled still stays out of an empty overlay, and requiring a resolved cart keeps it from\n // flashing ahead of the lines it applies to.\n if (cart == null || cart.items.length === 0) return null;\n\n const notice = $content?.text ?? text;\n // Authored children are the highest-precedence override, matching the cart siblings (CartTotal,\n // CartCount, CartError…). A blank or whitespace-only string child counts as unconfigured — the same\n // rule CartGoCheckout's configuredLabel applies — so it never renders an empty <p>; non-string\n // composed children pass through untouched. Absent children, the copy resolves as\n // `$content?.text ?? text` and must be non-blank: `minLength` is enforced by neither the runtime\n // slice nor the preflight, so a blank entry value reaches the component and counts as unconfigured.\n const resolvedChildren = typeof children === 'string' ? configuredLabel(children) : children;\n if (resolvedChildren == null && !notice?.trim()) return null;\n\n return (\n <p {...props} className={className} data-fs-cart-disclaimer=\"\" data-fs-text=\"\">\n {resolvedChildren ?? notice}\n </p>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Skeleton — loading placeholder rendered by CartList while the reactive cart\n// query is in flight (FR-7). Plain, unregistered presentational helper (mirrors\n// PricingSkeleton's shape; CartRoot is reactive, so the lazy `skeleton` field\n// does not apply — CartList drives it instead).\n// ---------------------------------------------------------------------------\n\nexport function CartItemSkeleton({ className, ...props }: ComponentPropsWithRef<'div'>) {\n // Minimal built-in look (plain, always-generated utilities) so the placeholder is visible out of\n // the box; a store can still restyle the bars via the data-fs-cart-item-skeleton-line swatch.\n return (\n <div {...props} className={className} data-fs-cart-item-skeleton=\"\" aria-hidden=\"true\">\n <span data-fs-cart-item-skeleton-line=\"\" className=\"block h-4 w-full animate-pulse rounded bg-gray-200\" />\n <span data-fs-cart-item-skeleton-line=\"\" className=\"mt-2 block h-4 w-2/3 animate-pulse rounded bg-gray-200\" />\n </div>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Merchant alert banner — a family rather than a single leaf, so the schema\n// decides the order and the subset instead of a layout prop. The Root owns\n// every resolution for two reasons: it is the only part that can tell whether\n// there is anything to say before the others mount, and one content model\n// keyed by its element id keeps the merchant's authoring surface a single\n// group in the Admin instead of one per part.\n// ---------------------------------------------------------------------------\n\nexport const CartAlertContent = defineContentType({\n id: 'cart-alert',\n title: 'Cart Alert',\n description: 'Merchant notice shown at the top of the mini-cart overlay.',\n schema: {\n type: 'object',\n additionalProperties: false,\n // Nothing is required. This model shares one composite entry with the other mini-cart content\n // leaves, and a read-time `required` violation invalidates the whole entry — one blank message\n // would take the disclaimer, the empty-state copy and the checkout label down with it.\n // `minLength` is author-time guidance only, so a blank still arrives here and self-hides.\n properties: {\n text: { type: 'string', minLength: 1, title: 'Message' },\n // Inline literals: the catalog scanner reads this file statically and rejects an identifier\n // it cannot evaluate. Every name is a base-dialect one, so each resolves in any store\n // regardless of its configured collection — but a store still has to register them.\n icon: {\n type: 'string',\n enum: ['bell', 'bell-ringing', 'tag', 'shopping-cart', 'map-pin', 'star'],\n title: 'Icon',\n },\n iconUrl: { type: 'string', format: 'uri', title: 'Custom icon', widget: { 'ui:widget': 'media-gallery' } },\n iconAlt: { type: 'string', title: 'Custom icon alt text' },\n },\n },\n});\n\n/**\n * The sprite names the CMS channel admits. Exported because a store whose merchants pick the icon\n * has to list them under `icons.include` for the glyph to reach the route sprite — one import there\n * instead of six retyped strings. Read off the model so the two cannot drift apart.\n */\nexport const CART_ALERT_ICON_NAMES = CartAlertContent.schema.properties.icon.enum;\n\nexport type CartAlertRootProps = ComponentPropsWithRef<'div'> & {\n /** Authored fallback message. No default: an invented one would ship copy no merchant wrote. */\n text?: string;\n /** Authored fallback sprite name. Unbounded — the compiler resolves it or fails the build. */\n icon?: string;\n /** Authored fallback uploaded glyph; wins over `icon` when both resolve. */\n iconUrl?: string;\n /** Alt text for the uploaded glyph; empty (decorative) when unset. */\n iconAlt?: string;\n /** Merchant-authored copy, sliced from the layout's composite entry; wins field by field. */\n $content?: ContentValue<typeof CartAlertContent>;\n};\n\n/** The glyph renders as an `img` or an `svg` depending on the channel, so it takes only what both accept. */\nexport type CartAlertIconProps = { className?: string };\n\nexport type CartAlertTextProps = ComponentPropsWithRef<'span'>;\n\n/** One resolved glyph: an uploaded image or a sprite name, never both. */\ntype ResolvedGlyph = { src: string; alt: string } | { name: string };\n\ntype CartAlertContextValue = {\n /** Non-blank by construction: the root self-hides when nothing resolves. */\n message: string;\n /** Resolved on the root so the parts hold no precedence logic; `null` when no glyph is configured. */\n glyph: ResolvedGlyph | null;\n};\n\nconst CART_ALERT_CONTEXT_UNSET = Symbol('CartAlertContextUnset');\n\nconst CartAlertContext = createContext<CartAlertContextValue | typeof CART_ALERT_CONTEXT_UNSET>(\n CART_ALERT_CONTEXT_UNSET,\n);\n\nfunction useCartAlert(): CartAlertContextValue {\n const ctx = useContext(CartAlertContext);\n if (ctx === CART_ALERT_CONTEXT_UNSET) {\n throw new Error('CartAlert parts must be used inside CartAlertRoot.');\n }\n return ctx;\n}\n\n/**\n * A content-channel icon name is admitted only when the model's `enum` still lists it. An entry is\n * external data whose `icon` is typed as the enum but not guaranteed to be one at runtime (a stale\n * value, or a read-time gate that does not enforce `enum`), and an unadmitted name would reach the\n * sprite lookup and render an empty `<svg>` with no build error and nothing in the console.\n */\nfunction admitContentIcon(name: string | undefined): string | undefined {\n return name && (CART_ALERT_ICON_NAMES as readonly string[]).includes(name) ? name : undefined;\n}\n\n/**\n * Resolves one glyph from a single source channel, the upload before the sprite name. Kept per-source\n * rather than per-field so the two channels never mix across sources: a merchant who configures a\n * sprite name in the CMS is not silently overridden by an uploaded-glyph *prop* the developer left as\n * a default. The prop `name` is unfiltered — the compiler resolves it or fails the build; only a\n * content name passes through `admitContentIcon`.\n */\nfunction resolveGlyph(\n url: string | undefined,\n alt: string | undefined,\n name: string | undefined,\n): ResolvedGlyph | null {\n if (url?.trim()) return { src: url, alt: alt ?? '' };\n if (name) return { name };\n return null;\n}\n\n// Type parameters are left to inference so `CorrelateContent` can check `$content` against the\n// declared model (an explicit TProps would bypass it), mirroring BuyButtonButton and Promotion.\nexport const CartAlertRootDefinition = defineComponent({\n name: 'CartAlertRoot',\n importPath: '@vtex/faststore/components',\n component: CartAlertRoot,\n content: CartAlertContent,\n editor: { label: 'Cart Alert', category: 'commerce' },\n schema: {\n text: { type: 'string', label: 'Message' },\n icon: { type: 'icon', label: 'Icon' },\n iconUrl: { type: 'string', label: 'Custom icon URL' },\n iconAlt: { type: 'string', label: 'Custom icon alt text' },\n },\n providesContext: 'cart-alert',\n guideline:\n 'Merchant-authored notice near the top of the mini-cart overlay (a minimum order, a running promotion): wraps CartAlertIcon and CartAlertText in any subset, any order — the arrangement is the composition, not a prop — and renders the glyph then the copy when composed with no children. Its copy and glyph are CMS-editable through the cart-alert content model, with the text, icon, iconUrl and iconAlt props as the non-CMS fallback; it renders nothing when no message is configured, so an unconfigured banner leaves no empty box. Reads no cart data, so it needs no CartRoot ancestor and no cart-state gate — place it inside CartFilled to hide it on an empty cart. A store whose merchants choose the icon must list CART_ALERT_ICON_NAMES under icons.include in its foundation, or a chosen glyph renders empty. Distinct from CartError (cart mutation errors) and CartUnavailableCount (data-driven). See cart.md.',\n});\n\nexport const CartAlertIconDefinition = defineComponent<CartAlertIconProps>({\n name: 'CartAlertIcon',\n importPath: '@vtex/faststore/components',\n component: CartAlertIcon,\n editor: { label: 'Cart Alert Icon', category: 'commerce' },\n schema: {},\n requiresContext: 'cart-alert',\n guideline:\n 'The alert glyph, inside a CartAlertRoot (or any ancestor providing `cart-alert` context). Prefers the merchant-uploaded icon and falls back to the predefined sprite name, and renders nothing when neither is configured. Decorative — the message carries the meaning. Place it before or after CartAlertText to set the order.',\n});\n\nexport const CartAlertTextDefinition = defineComponent<CartAlertTextProps>({\n name: 'CartAlertText',\n importPath: '@vtex/faststore/components',\n component: CartAlertText,\n editor: { label: 'Cart Alert Message', category: 'commerce' },\n schema: {},\n requiresContext: 'cart-alert',\n guideline:\n 'The alert message, inside a CartAlertRoot (or any ancestor providing `cart-alert` context). The copy comes from the root (its CMS entry or its text prop), so children are a display override rather than an authoring channel. Place it before or after CartAlertIcon to set the order.',\n});\n\nexport function CartAlertRoot({\n text,\n icon,\n iconUrl,\n iconAlt,\n className,\n children,\n $content,\n ...props\n}: CartAlertRootProps) {\n const message = $content?.text ?? text;\n\n // The glyph resolves as a whole channel, CMS before props, so a merchant-configured glyph — sprite\n // name or upload — wins over whatever the developer set as a fallback. Resolving each field on its\n // own would let a prop `iconUrl` mask a CMS `icon`, a CMS edit that does nothing. Memoized so the\n // context value keeps a stable identity across renders — the parts re-render only on a real change.\n const value = useMemo<CartAlertContextValue>(\n () => ({\n message: message ?? '',\n glyph:\n resolveGlyph($content?.iconUrl, $content?.iconAlt, admitContentIcon($content?.icon)) ??\n resolveGlyph(iconUrl, iconAlt, icon),\n }),\n [message, $content?.iconUrl, $content?.iconAlt, $content?.icon, iconUrl, iconAlt, icon],\n );\n if (!message?.trim()) return null;\n\n return (\n <CartAlertContext value={value}>\n <div {...props} className={className} data-fs-cart-alert=\"\">\n {children ?? (\n <>\n <CartAlertIcon />\n <CartAlertText />\n </>\n )}\n </div>\n </CartAlertContext>\n );\n}\n\nexport function CartAlertIcon({ className }: Readonly<CartAlertIconProps>) {\n const { glyph } = useCartAlert();\n if (!glyph) return null;\n\n if ('src' in glyph) {\n return <Image src={glyph.src} alt={glyph.alt} className={className} data-fs-cart-alert-icon=\"\" />;\n }\n return <Icon name={glyph.name} className={className} data-fs-cart-alert-icon=\"\" />;\n}\n\nexport function CartAlertText({ className, children, ...props }: CartAlertTextProps) {\n const { message } = useCartAlert();\n\n return (\n <span {...props} className={className} data-fs-cart-alert-text=\"\" data-fs-text=\"\">\n {children ?? message}\n </span>\n );\n}\n\n// ---------------------------------------------------------------------------\n// F1 — Empty-state copy: the message and the way back to browsing.\n//\n// Two leaves rather than one, because the message and the control are placed\n// independently: the message sits in the panel body while the control is\n// commonly pinned to the drawer footer. Neither renders a wrapper, so grouping,\n// order, and any illustration stay the store's, composed inside CartEmpty.\n//\n// Each leaf declares its own content model with a message field read only from\n// `$content`. `CartEmpty` gates when the branch renders; these leaves only carry\n// copy, so they read no cart data and select no field.\n// ---------------------------------------------------------------------------\n\nexport const CartEmptyMessageContent = defineContentType({\n id: 'cart-empty-message',\n title: 'Cart Empty Message',\n description: 'Message shown in the cart overlay when the cart has no items.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n text: {\n type: 'string',\n minLength: 1,\n title: 'Empty cart message',\n format: 'icu-message',\n messageSource: 'Your cart is empty',\n },\n },\n },\n});\n\nexport const CartContinueShoppingContent = defineContentType({\n id: 'cart-continue-shopping',\n title: 'Cart Continue Shopping',\n description: 'Label for the control that dismisses the cart overlay and returns the shopper to browsing.',\n schema: {\n type: 'object',\n additionalProperties: false,\n properties: {\n label: {\n type: 'string',\n minLength: 1,\n title: 'Continue shopping label',\n format: 'icu-message',\n messageSource: 'Continue shopping',\n },\n },\n },\n});\n\nexport const CartEmptyMessageDefinition = defineComponent<CartEmptyMessageProps>({\n name: 'CartEmptyMessage',\n importPath: '@vtex/faststore/components',\n component: CartEmptyMessage,\n content: CartEmptyMessageContent,\n editor: { label: 'Cart Empty Message', category: 'commerce' },\n schema: {},\n guideline:\n 'The empty-cart message, rendered as plain text inside CartEmpty. The text is the $content field text; a blank message renders nothing. It carries no layout — group and space it with Container, and pair it with CartContinueShopping for the way back to browsing. See cart.md.',\n});\n\nexport const CartContinueShoppingDefinition = defineComponent<CartContinueShoppingProps>({\n name: 'CartContinueShopping',\n importPath: '@vtex/faststore/components',\n component: CartContinueShopping,\n content: CartContinueShoppingContent,\n editor: { label: 'Cart Continue Shopping', category: 'action' },\n schema: {},\n guideline:\n 'Dismisses the cart overlay so the shopper can keep browsing; dispatches no cart write. Place it in the empty panel inside CartEmpty, commonly in a footer Container. It closes the drawer, so it requires a DrawerRoot ancestor — on a cart page with no drawer, compose a NavigationLink back to browsing instead of this control. Composed children are the button content (compose an icon that way); without them the text is the $content field label. See cart.md.',\n});\n\nexport function CartEmptyMessage({ $content, $locale, className, ...props }: CartEmptyMessageProps) {\n const { format } = useMessageFormatter(CartEmptyMessageContent, $content);\n // A blank or absent message formats to '' (and logs), so nothing renders.\n const message = format('text');\n if (message === '') return null;\n\n return (\n <p {...props} className={className} data-fs-cart-empty-message=\"\" data-fs-text=\"\">\n {message}\n </p>\n );\n}\n\nexport function CartContinueShopping({ $content, $locale, className, children, ...props }: CartContinueShoppingProps) {\n const { format } = useMessageFormatter(CartContinueShoppingContent, $content);\n // Composed children are the button's content; the message is formatted only without them.\n const content = children ?? format('label');\n if (content === '') return null;\n\n return (\n <DrawerClose {...props} className={className} data-fs-cart-continue-shopping=\"\" data-fs-button=\"\">\n {content}\n </DrawerClose>\n );\n}\n\n// The `Cart.*` namespace object is assembled in cart-namespace.ts (re-exported by src/components.ts)\n// so it can combine the aggregate components here with the line-item components in matter/cart-item\n// without a cyclic import between the two files.\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,MAAM;EACjB,YAAY,EACV,MAAM;GAAE,MAAM;GAAU,WAAW;GAAG,OAAO;EAAkB,EACjE;CACF;AACF,CAAC;AAID,MAAa,2BAA2B,kBAAkB;CACxD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,OAAO;GACL,MAAM;GACN,WAAW;GACX,OAAO;GACP,QAAQ;GACR,eAAe;EACjB,EACF;CACF;AACF,CAAC;AAED,MAAa,mBAAmB,kBAAkB;CAChD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY,EACV,UAAU;GACR,MAAM;GACN,OAAO;GACP,QAAQ;GACR,eAAe;GACf,kBAAkB;IAAE,MAAM;IAAU,YAAY,EAAE,OAAO,EAAE,MAAM,UAAU,EAAE;GAAE;GAC/E,gBAAgB,EAAE,OAAO,EAAE;EAC7B,EACF;CACF;AACF,CAAC;AAED,MAAa,wBAAwB,kBAAkB;CACrD,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;EACN,MAAM;EACN,sBAAsB;EACtB,YAAY;GACV,aAAa;IACX,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,eAAe;GACjB;GACA,YAAY;IAAE,MAAM;IAAU,OAAO;IAAsB,QAAQ;IAAe,eAAe;GAAQ;GACzG,gBAAgB;IACd,MAAM;IACN,OAAO;IACP,aAAa;IACb,QAAQ;IACR,eAAe;GACjB;EACF;CACF;AACF,CAAC;AAED,MAAa,4BAA4B,kBAAkB;CACzD,IAAI;CACJ,OAAO;CACP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