efficient-storefront-blocks 0.75.0 → 0.77.0
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 +46 -0
- package/dist/chunks/EditorPreviewCheckout-GNQP4MQ4.js +4 -0
- package/dist/chunks/{SiteEditorProvider-N4T55FAV.js → SiteEditorProvider-R3HXJAPW.js} +1 -1
- package/dist/chunks/chunk-BOJGJXIU.js +311 -0
- package/dist/chunks/chunk-CAULWKXR.js +1 -0
- package/dist/chunks/chunk-GDR5GGVW.js +1 -0
- package/dist/chunks/chunk-OWYNZAAY.js +1 -0
- package/dist/chunks/chunk-ZIZWJZ5T.js +1 -0
- package/dist/chunks/{fitment-data-5ZSHENM3.js → fitment-data-JNQKYQIB.js} +1 -1
- package/dist/contract.js +2 -2
- package/dist/editor/components/BlogSource.js +1 -1
- package/dist/editor/components/CategoryProductFields.d.ts +22 -0
- package/dist/editor/components/CategoryProductFields.js +1 -0
- package/dist/editor/components/CategorySource.d.ts +12 -0
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/CountryShowAsTiles.js +1 -1
- package/dist/editor/components/EditorPreviewChat.js +1 -11
- package/dist/editor/components/EditorPreviewSurface.js +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.d.ts +8 -4
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuPicker.js +1 -1
- package/dist/editor/components/PreviewProductPicker.js +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/components/ProductPicker.js +1 -1
- package/dist/editor/components/SocialLinksDoor.js +1 -1
- package/dist/editor/components/SpecTableSource.js +1 -1
- package/dist/editor/lib/document/block-align-row.d.ts +2 -0
- package/dist/editor/lib/document/block-align-row.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CatalogFilterBar/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CheckoutCTA/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CollectionCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CompatibleTyres/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/DeliveryOptions/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/EuTyreLabel/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FitmentFinder/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/Gallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.d.ts +2 -2
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/TyreFitment/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/TyreSizes/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/shared-fields.d.ts +1 -0
- package/dist/editor/lib/document/blocks/commerce/shared-fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Footer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterEmailSignup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterLogo/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterSocial/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterText/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Form/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/RateTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/RatingBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubmitBuild/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Subscribe/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubscribeBlogs/fields.js +1 -1
- package/dist/editor/lib/document/box-header.js +1 -1
- package/dist/editor/lib/document/config.d.ts +16 -16
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/editor-currency-source.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +10 -13
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +214 -724
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +45 -79
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/CartContext.d.ts +1 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/CartDrawer.js +2 -2
- package/dist/render/components/CatalogFilterBarSection.d.ts +1 -1
- package/dist/render/components/CatalogFilterBarSection.js +1 -1
- package/dist/render/components/ChatWidget.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/CompatibleTyres.js +1 -1
- package/dist/render/components/ConsentPanel.js +1 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/CouponField.js +1 -1
- package/dist/render/components/CurrencyContext.js +1 -1
- package/dist/render/components/Events.d.ts +2 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterGroup.d.ts +3 -2
- package/dist/render/components/FooterGroup.js +1 -1
- package/dist/render/components/FooterLogo.d.ts +2 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterPayment.d.ts +1 -2
- package/dist/render/components/FooterPayment.js +1 -1
- package/dist/render/components/FooterSocial.d.ts +1 -2
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +2 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/Lightbox.d.ts +2 -2
- package/dist/render/components/Lightbox.js +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +2 -0
- package/dist/render/components/Notice.d.ts +6 -0
- package/dist/render/components/Notice.js +1 -0
- package/dist/render/components/PopupFrame.d.ts +17 -4
- package/dist/render/components/PopupFrame.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +2 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +3 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ProductLightbox.js +1 -1
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/SpecTable.d.ts +2 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/SubscribePopup.js +2 -2
- package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
- package/dist/render/components/TyreFitVerdicts.js +1 -1
- package/dist/render/components/TyreRenderSvg.js +1 -1
- package/dist/render/components/TyreVehicleFitment.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +3 -0
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/booking/BookingRegions.js +1 -1
- package/dist/render/components/catalog/CatalogFilterBar.d.ts +4 -4
- package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
- package/dist/render/components/catalog/CatalogFilterContext.d.ts +5 -3
- package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
- package/dist/render/components/catalog/FilterPill.d.ts +3 -1
- package/dist/render/components/catalog/FilterPill.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.d.ts +4 -0
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +25 -1
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/components/fitment/StockFitmentCard.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/components/product-hero/TyreHeroFitment.d.ts +2 -1
- package/dist/render/components/product-hero/TyreHeroFitment.js +1 -1
- package/dist/render/components/product-hero/VehicleQuestion.d.ts +1 -6
- package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
- package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
- package/dist/render/components/product-hero/trust-bullets.d.ts +5 -0
- package/dist/render/components/product-hero/trust-bullets.js +1 -0
- package/dist/render/components/useModalDismiss.d.ts +2 -1
- package/dist/render/components/useModalDismiss.js +1 -1
- package/dist/render/components/useTyreFitAnswer.d.ts +1 -0
- package/dist/render/components/useTyreFitAnswer.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
- package/dist/render/lib/api/index.d.ts +6 -3
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +3 -0
- package/dist/render/lib/booking/appointment-time.d.ts +2 -0
- package/dist/render/lib/booking/appointment-time.js +1 -0
- package/dist/render/lib/catalog/from-wheel.js +1 -1
- package/dist/render/lib/catalog/plp-item.js +1 -1
- package/dist/render/lib/checkout/pay-first.d.ts +34 -0
- package/dist/render/lib/checkout/pay-first.js +1 -0
- package/dist/render/lib/checkout/stripe-appearance.d.ts +10 -0
- package/dist/render/lib/checkout/stripe-appearance.js +1 -0
- package/dist/render/lib/checkout/wallet-return.d.ts +1 -1
- package/dist/render/lib/commerce.d.ts +1 -0
- package/dist/render/lib/commerce.js +1 -1
- package/dist/render/lib/content/legacy-block-align.d.ts +2 -0
- package/dist/render/lib/content/legacy-block-align.js +1 -0
- package/dist/render/lib/content/menu-row.d.ts +0 -3
- package/dist/render/lib/content/menu-row.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CheckoutCTA/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DeliveryOptions/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/EuTyreLabel/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentFinder/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SpecTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/TyreFitment/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/TyreSizes/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterSocial/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/RateTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/SubmitBuild/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Subscribe/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/SubscribeBlogs/meta.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-client.d.ts +8 -3
- package/dist/render/lib/document/render-client.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/storefront-root.d.ts +0 -2
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/field-input.d.ts +1 -0
- package/dist/render/lib/field-input.js +1 -0
- package/dist/render/lib/sections/content-cap-gutter.d.ts +1 -0
- package/dist/render/lib/sections/content-cap-gutter.js +1 -0
- package/dist/render/lib/sections/hero-trust-bullets.d.ts +2 -0
- package/dist/render/lib/sections/hero-trust-bullets.js +1 -0
- package/dist/render/lib/tyres/spec-sheet.d.ts +17 -0
- package/dist/render/lib/tyres/spec-sheet.js +1 -1
- package/dist/render/lib/tyres/tyre-fit-copy.js +1 -1
- package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +3 -1
- package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
- package/dist/render/lib/use-scope-class.d.ts +1 -0
- package/dist/render/lib/use-scope-class.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.d.ts +3 -3
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +2 -2
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/render/lib/wheels/grid-source.d.ts +7 -1
- package/dist/render/lib/wheels/grid-source.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/words.d.ts +46 -50
- package/dist/words.js +6 -6
- package/package.json +4 -4
- package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +0 -4
- package/dist/chunks/chunk-3TBLX25X.js +0 -1
- package/dist/chunks/chunk-4V6BLJSG.js +0 -1
- package/dist/chunks/chunk-K26JUDGZ.js +0 -1
- package/dist/chunks/chunk-SJODSVWU.js +0 -1
- package/dist/chunks/chunk-WPHE7RI4.js +0 -246
- package/dist/render/components/product-hero/hero-content.d.ts +0 -7
- package/dist/render/components/product-hero/hero-content.js +0 -1
- package/dist/render/components/useIsLightTheme.d.ts +0 -1
- package/dist/render/components/useIsLightTheme.js +0 -1
- package/dist/render/lib/content/product-hero.d.ts +0 -14
- package/dist/render/lib/content/product-hero.js +0 -1
- package/dist/render/lib/wheels/collections.d.ts +0 -22
- package/dist/render/lib/wheels/collections.js +0 -1
- /package/dist/chunks/{chunk-WPHE7RI4.js.LEGAL.txt → chunk-BOJGJXIU.js.LEGAL.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.77.0 - 2026-11-02
|
|
4
|
+
|
|
5
|
+
**A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^47.0.0` (was `^46.0.0`) and `efficient-easel` `^26.7.0` (was `^26.1.0`), five editor phrases leave `words`, and the `Box` export of `render/components/product-hero/VehicleQuestion` goes. A host must: install web-builder 47 and easel `>=26.7.0` together with this release; delete the five removed phrases below from its editor catalogue; and use `Notice` where it imported `Box`. No stored page needs a data move. The shop's card checkout pays first (#315): serve it from efficient-backend v101.4.1 or later. An older backend ignores `checkoutFlow` and keeps the old flow, without the `checkout_unavailable` refusal code.
|
|
6
|
+
|
|
7
|
+
- **BREAKING: one themed Notice box for every shop notice** (#314). New `render/components/Notice` (tones: `bad`, the default, `good`, `quiet`; a `role` passes through). The `Box` export of `render/components/product-hero/VehicleQuestion` is removed: use `Notice`. Seen by a shopper: the checkout, payment and subscribe errors, the no-price notice, the 9 fitment verdicts and the consent panel's Global Privacy Control note take the site's panel colour, a 1px border in the tone's token and body text at 14px; before, the checkout and subscribe boxes were fixed red and amber. The checkout, payment and subscribe errors carry `role="alert"`; the no-price notice carries `role="status"`. The chat error line uses `text-alert`. The order summary's quantity bubble shows as a full circle.
|
|
8
|
+
- **The Product content status is one line** (#317). The Product Grid's Product content row reads `9 wheels · Refresh now`; the long sentence moves into the tooltip.
|
|
9
|
+
- **The shop's card checkout pays first** (#315). A card order sends `checkoutFlow: 2`: the order request opens a checkout that holds the items under its own number (`CK#…`), and the sales order is made after the card clears. PayPal, Afterpay, Square, GoCardless, Zip, Klarna and bank transfer still place the order at submit. New screens: the held-until line on the payment step, "Confirming your payment…", "Payment processing", "Payment received" and "Order not placed" (released or expired, with the refund line). "← Back to checkout" returns to the form with the basket. A change after Back drops the held checkout only when its card intent can no longer be paid. "Pay later" leaves the card step only. The basket and the abandoned-cart snapshot stay until the card clears. New render module `lib/checkout/pay-first`; `OrderRequest.checkoutFlow`, `OrderConfirmation.checkoutNumber` and `expiresAt` in the API types.
|
|
10
|
+
|
|
11
|
+
- **BREAKING: web-builder 47, easel 26.7** (#307). Peer and dev, here and in `package/`: `efficient-web-builder` `^47.0.0`, `efficient-easel` `^26.7.0`. The words catalogue drops 5 builder phrases that builder 47 no longer says (Duplicate page): "Another page uses this URL handle.", "Couldn’t duplicate the page — please retry.", "Duplicate page", "The copy is a draft and stays hidden until you publish it. It opens in the editor.", "URL handle".
|
|
12
|
+
- **Four sections have their own phone Gap** (#307, C38). GalleryB, FooterGroup, ProductGrid and Events draw the Box's phone Gap row through web-builder's `containerGapRows`. Unset, the phone row shows half the desktop Gap in grey and stores nothing; `--sf-gap-len-phone` is written only when a phone value is stored. 0 data moves.
|
|
13
|
+
- The Product Grid's shared card rows follow the phone Gap: `cardRowsGap(zone)` reads the `containerGapProps` answer (`var(--sf-card-row-gap-auto)` only when the zone draws a phone length). No phone value keeps the bytes it was.
|
|
14
|
+
- Social Logos keeps its own 0-32 Gap row, now a Desktop-view row (hidden on a phone; no page changes).
|
|
15
|
+
- **List reads can report a failure** (#312). `products.listWheels`, `products.listBundles` and `products.listBlogPosts` take an optional `{ throwOnFailure: true }` (new exported type `ListReadOpts`): a failed read, or a wheel sweep that fails part-way, is thrown instead of returned as an empty list, so a page can show an error with a retry. Without the option each read degrades to an empty list as before; no current caller changes.
|
|
16
|
+
- **A failed tyre fit check says so** (#311). When the backend cannot be reached or answers 5xx, the tyre page's fit section and the buy-hero verdict say the check could not be done now and show a Try again button for the same car. The answer stays 'unknown', so it never reads as a fit. A real no-data reply keeps the no-factory-data wording.
|
|
17
|
+
- **The catalog price boxes have names** (#310). The Price panel's two boxes carry `aria-label` "Minimum price" and "Maximum price"; the placeholders read "Min" and "Max", with no "$" in any currency.
|
|
18
|
+
- Guards: new `scripts/test-catalog-price-box-names.tsx` (#310), `scripts/test-list-reads-report-failure.ts` (#312); changed `scripts/test-tyre-vehicle-fitment.tsx` (#311); new `scripts/test-section-gap-phone.tsx` (#307, a census of every Gap row in the registry); new `scripts/test-shop-notice.tsx` (#314), `scripts/test-checkout-pay-first.tsx` (#315); changed `scripts/test-checkout-payment-start-failure.tsx`, `scripts/test-wallet-return.ts`, `scripts/test-idempotency-key.ts` (#315); changed `scripts/test-product-content.tsx` (#317); new `scripts/browser-city-card-heights.tsx` (#319, a browser measure of the city cards' heights).
|
|
19
|
+
|
|
20
|
+
## 0.76.0 - 2026-10-31
|
|
21
|
+
|
|
22
|
+
**A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^46.0.0` (was `^44.0.0`), `efficient-easel` `^26.1.0` (was `^23.1.0`) and `efficient-shell` `^11.8.0` (was `^10.13.0`), published names and paths go, and stored pages need data moves. A host must: install the three new peers (its Tailwind must resolve `efficient-shell/motion.css`); follow the page theme with `!useRootIsDark({ whenUnset: true })` from `efficient-shell/theme` in place of `render/components/useIsLightTheme`; stop importing `lib/wheels/collections` and call `scopeCatalogSections(data)` with the page only; pass the theme row's `theme` to `RenderClient`; stop using the removed names listed below; and delete the removed words from its editor catalogue. For efficient-storefront: do not take this release until the US-site width data move M1 (114 rows / 22 pages, by CLI) and the #392 data move (maxWidth on 3 Text blocks, inovit_us) have run; in the sync PR that takes it, change `app/wheels/[slug]/PDPClient.tsx`, `app/wheels/CatalogPageClient.tsx`, `components/CollectionHeader.tsx`, `lib/wheels/range-collections.ts` and `app/wheels/page.tsx`, delete `scripts/harness/panel-row-wrap.tsx` and `probe-panel-row-wrap.mjs`, and update the old `data-menu-align` start / end CSS in `scripts/harness/box-panels-converge.html`. After the storefront sync: the admin-portal bump, then the CLI moves of the Product Hero trust bullets (1 page), the hartesmetal.com `/wheels` Product Grid source (4 cells) and the footer Menu's `linkAlign` (4 copies).
|
|
23
|
+
|
|
24
|
+
- **BREAKING: web-builder 46, easel 26, shell 11** (#284). Peer and dev, here and in `package/`: `efficient-web-builder` `^46.0.0`, `efficient-easel` `^26.1.0`, `efficient-shell` `^11.8.0` (in `package/package.json` the peers were `^44.0.0`, `^23.1.0`, `^10.13.0`; #275 below moved shell to `^10.23.0` on the way). The Box rows come from easel's box-fields through the builder's one binding (`editor/lib/document/box-fields`); the container gap row is `containerGapField`. The Reviews section-to-box row drops `on: false` (the builder's one list, `SECTION_TO_BOX_ON`). 15 `fields.tsx` files drop `widthFieldsForParent`: sections follow the site's Background and Content width, and the old width keys (`widthMode`, `fullWidth`, `pageWidth`) are not read; `StorefrontRootProps` loses `fullWidth` and `pageWidth`. The chat bubble in the editor uses the canvas frame. The content-cap side padding is one constant, `CONTENT_CAP_GUTTER` (`render/lib/sections/content-cap-gutter`), same markup. **efficient-storefront must not take this release until the width data move M1 is done**, or live sections change look.
|
|
25
|
+
- **Entrance is efficient-shell's** (#298, merged into #284). The site sheet loads `efficient-shell/motion.css`; the `data-sf-anim` rules and the sheet's own section keyframes are gone. Old Fade / Rise / Scale values still play, with the same distances, time and curve. A Gap only Box zeroes its blocks' frame padding through their Entrance wrapper too. 15 blocks have the Entrance rows and no Design / Animation tab strip yet (a web-builder follow-up).
|
|
26
|
+
- **BREAKING: which products a Product Grid shows is one setting, "Product content"** (#249). Manual, All products, or one storefront Category; only the chosen answer's rows are drawn, on every page. "Product types" is one row (`productKindsField`) for the Product Grid and the Alloy Wheels Listing; unset reads as what the section draws. The Catalog Filter Bar follows Category grids. An empty `/wheels` page is seeded with one Category grid per category the site's catalog holds, its links `/wheels?collection=<name>`. **Removed:** `lib/wheels/collections` (`COLLECTIONS`, `COLLECTION_ANCHORS`, `PROCESS_ORDER`, `siteProcesses`, `siteCollections`, `slugifyProcess`, `collectionsForCatalog`, `CollectionMeta`, `SiteCollectionMeta`); `scopeCatalogSections` takes the page only; `GridSource.process` is no longer read; `CatalogFilterBar`'s `processOptions` is a list of category names with no default. A stored `collection:` value reads as the category of that name; nothing is written until the merchant picks.
|
|
27
|
+
- **BREAKING: the page theme is read with efficient-shell's hook** (#275). `render/components/useIsLightTheme` is deleted; the blocks call `useRootIsDark`, `rootIsDark` and `watchRootTheme` from efficient-shell and keep no reader or watcher of their own. A page with the `dark` class is now dark here too, as the stylesheet reads it.
|
|
28
|
+
- **BREAKING for stored pages: the Product Hero's trust bullets are a Box of Text blocks in the hero** (#279, C10). The Product Hero has a `trustBullets` slot that holds a Box (`allow: ["Flex"]`, `lib/sections/hero-trust-bullets`), one plain Text block per bullet, each with its own Layers row and panel. **The shop no longer reads `root.props.heroBullets`**: a page that set bullets shows none until a CLI move puts them in the slot (inovit_us: 1 page). The right panel of a dynamic page keeps Product type and Record type only. An empty slot draws no row on the published page. A migrated bullet keeps the old row's size, weight and spacing; two or more bullets stack one per line. **Removed:** `lib/content/product-hero` (`PRODUCT_HERO_BULLETS_PROP`, `resolveProductHeroContent`, `parseHeroBullet`, `heroBulletLine`, `HERO_BULLET_EXAMPLE`, `HERO_BULLET_SEPARATOR`, `PRODUCT_HERO_DEFAULTS`) and `components/product-hero/hero-content` (`ProductHeroContentProvider`, `useProductHeroContent`).
|
|
29
|
+
- **BREAKING: `editor/components/HeaderSettingsPanel` no longer exports `Field`** (#287). The header panel's rows are easel's `SettingsField` and `SettingsDefaultReset`, its groups the builder's `PanelBand`; `BlogSource` and `SocialLinksDoor` use `PanelBand` too, and no blocks file imports `GroupLabel`. Amber, radius and border literals read shell tokens (`--warning-text`, `--radius-control`, `--radius-card`, `--line`). Not pixel identical: the groups are grey bands, every row has a glyph, the "Open live" link is a control-radius button.
|
|
30
|
+
- **BREAKING: every photo view takes the site scrim** (#299, #297). The `Lightbox` frame draws the scrim (`SITE_TINT`, `SITE_BLUR[8]` from `PopupFrame`) for every photo view, and its `style` prop is removed; new export `LIGHTBOX_CLOSE_TINT`. Seen by a shopper: the /gallery photo view goes from black 92% to the site background 78%, the wheel-page hero image view from black 90% to 78%, the photos-only record gallery from 86% to 78%; the blur stays 8px.
|
|
31
|
+
- **BREAKING: the alignment strips are efficient-easel's rows** (#306). `render/*` drops `MenuLinkAlign`, `MENU_LINK_ALIGNS`, `resolveMenuLinkAlign` (`render/lib/content/menu-row`), `FooterPaymentAlign` (`render/components/FooterPayment`) and `SocialAlign` (`render/components/FooterSocial`): use web-builder's `BlockAlign` / `BLOCK_ALIGN_JUSTIFY` (`efficient-web-builder/format/lib/content/block-align`); the start / end reader is `legacyBlockAlignOf` (`render/lib/content/legacy-block-align`). Footer Logo, Payment logos, Social logos and the Menu's Link alignment draw easel's Block alignment row and store left / center / right (start / end still read, on the page and in the panel); the Product Hero's words draw Text alignment; the Footer box draws Item alignment with Stretch (an unset value lights Start). The storefront takes this release before the `linkAlign` data move: its current blocks code does not read left / right.
|
|
32
|
+
- **The published page converts with the site theme** (#304). `RenderClient` takes the theme row's `theme`; `renderMetadata(...)` builds the metadata (the site widths plus the builder's `siteThemeMetadata`). A host that passes nothing hands no theme. No page changes today: no conversion row is on in builder 46.
|
|
33
|
+
- **Checkout: a placed order is handled once and shown** (#290, #291, #292, #300, #280, #303).
|
|
34
|
+
- Once an order is placed, the basket and the coupon are emptied (#290). They are kept when the order is refused or a card payment step fails to start.
|
|
35
|
+
- When the payment step fails to start after the order is saved, the shopper reads "Your order N is saved, but the payment did not start", and the button becomes "Try payment again · N", which starts the payment for the same order (#292). A new address ticked "Save this address to my account" is saved once per order, and a failed save is tried again (#291).
|
|
36
|
+
- When a coupon check fails on a network or server error, the code is not struck through and a "Try again" button checks it again (#300). A refused code looks as before.
|
|
37
|
+
- "Not you? Sign out" also empties the email, name, address, phone and state, and resets the country to the header region (#280). The cart is kept.
|
|
38
|
+
- The order confirmation shows a short receipt under the order number: delivery method and charge, discount and coupon code, and "Total paid" or "Order total" (#303). Every amount is the order's own; a missing row is left out, and a wallet return with nothing parked shows the order number only.
|
|
39
|
+
- **Screen readers and keyboards on the shop** (#285, #302, #281, #296, #308). The checkout Email, Country and State captions name their controls (#285). The catalog sort control is named "Sort results" (#302). A filter pill carries `aria-haspopup`, `aria-expanded` and `aria-controls`, and closes on Escape (focus back on the pill) or a press outside (#281). The chosen finish, size and gallery photo on a product page set `aria-pressed` (#296). The cart drawer and the "Notify me when available" dialog keep Tab inside while open and give focus back on close (`useModalDismiss` takes an optional `trapRef`; `PopupFrame`'s site scrim gains `trapRef`) (#308).
|
|
40
|
+
- **Catalog and cart** (#286, #289). In the pill filter bar on a phone, the results link, Clear All and sort wrap onto a second row under the pills; before, they were hidden below 720px (#286). The cart drawer closes when the route changes, so every link in it closes it (#289).
|
|
41
|
+
- **The fitment car card shows the factory tyre sizes** (#301): "OEM front tyres" and "OEM rear tyres", or "—". The desktop grid goes from 6 to 4 columns.
|
|
42
|
+
- **Spec rows and fitment headers follow the site English** (#276). `SpecTable` gets `builtInLabels`; built rows and the `FitmentTable` headers go through `useEnglish()` ("Center Bore" on a US site). Merchant-typed rows stay as typed.
|
|
43
|
+
- **Shopper text removed** (#277, #278). The Contact channel rail drops "→ Message routes here" and "Other inboxes filter as spam"; the routed row keeps its accent left line (#277). The wheel page drops "Asked once. Every wheel after this one is already filled in.", "Wheels · Not handed" and "Only one of each is left, so there is nothing to choose here."; the tyre page drops its "Asked once" line; `VehicleQuestion` loses `askNote` (#278).
|
|
44
|
+
- **A Box's own phone Gap draws below 800px** (#283). `.sf-gap-zone` reads `--sf-gap-len-phone`, which web-builder writes only for a Box with a stored phone Gap (efficient-web-builder #390); without it the gap is half, as before.
|
|
45
|
+
- **One home for duplicated parts, no look change** (#288, #293, #295). New render entries: `lib/booking/appointment-time` (`formatAppointment`, `formatAppointmentTime`), `lib/commerce` `currencyFormat`, `lib/use-scope-class` (`useScopeClass`), `lib/checkout/stripe-appearance` (`stripeAppearance`, `StripeAppearance`), `lib/tyres/spec-sheet` (`TYRE_SPEC_KEYS`, `TYRE_SPEC_FIELD_KEYS`), `lib/field-input` (`FIELD_INPUT_CLASS`). The header cart badge asks the builder's `prefersReducedMotion` (#288). The Spec Table, Product, Gallery A and Product Hero panels draw one "category, then product" part (`CategoryProductFields`) (#293). The lightbox dismisses through `useModalDismiss`, so the chat bubble hides while it is open (#293). The consent panel, Notify me and the subscribe popup sit in `PopupFrame`'s new `site` scrim (`SITE_TINT`) (#295).
|
|
46
|
+
- New editor words to translate: "Product content", "Pick the products yourself below, or choose “All products” or a category from {place}.", "Shows this source’s products as they are now, here and on the live page. Set how many appear with “Items to display”.", "Disabled because this grid’s {source} is set to “{name}”. The grid fills itself from that source automatically. To pick wheels here, set {source} back to “Manual”.", "{n} {one}", "{n} {many}", "OEM front tyres", "OEM rear tyres", and from web-builder 46: "Effect", "Duration", "Delay", "Loop", "Reveal", "Glide", "Bounce", "Flip", "Spin", "Desktop", "Box shape", "Square (1:1)", "Gutter", "Layouts", "Link to", "Shrink to fit", "When the text does not fit", "Highlight when a link jumps here", "When a link lands on this Box's anchor, the Box gets an accent outline and its first block turns accent.", "Follows Styles ▸ Basics ▸ Corners until you set a number here.", "The width of every section's background.", "The width of every section's content.", "Enter by hand", "Find from the address", "Find from the address (OpenStreetMap)", "Latitude, longitude", "City maps", "City pictures", "A card per city, grouped by region: address, phone, hours and a map.", "A wall of city photos, grouped by region. Each photo links to its city's card.", "A line across the blocks, with a dot on each.", "Still to come: a hollow dot, and the gold line stops before it.", "none", "upper". Gone: "Products source", "Categories", "Linked to “{name}” · {n} product", "Linked to “{name}” · {n} products", the old "None" versions of the three Product content hints, "Product hero", "Trust bullets", "The promises under Add to Cart. Text before the · is bold. Leave the list empty to show no promises at all.", "Start" (#306), and from web-builder 46: "Motion", "Scroll duration", "Clear change", "Clear change: {label}", "Clear override", "Clear override: {label}", "Clear {what}", "Clear {what}: {label}", "Contained", "Content cannot be wider than the background.", "On phones, content always fills the screen.", "The width of every section's background, until the section sets its own.", "The width of every section's content, until the section sets its own.", "The section is full width, so this card follows Styles ▸ Basics ▸ Corners.", "This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.", "Coordinates from OpenStreetMap", "Enter coordinates manually", "Find coordinates", "Hide manual coordinates", "Image width", "Item alignment", "Justify", "Stretch", "Left and right", "Top and bottom", "No wrap", "Space between", "e.g. {example}", "from Styles".
|
|
47
|
+
- Guards: new `scripts/test-product-content.tsx` (#249), `scripts/test-page-theme-hook.tsx` (#275), `scripts/test-contact-routing-no-marker.tsx` (#277), `scripts/test-wheel-page-has-no-scaffold-text.tsx` (#278), `scripts/test-checkout-sign-out-clears-details.tsx` (#280), `scripts/test-filter-pill-dismiss.tsx` (#281), `scripts/test-one-page-theme-reader.ts` and `scripts/test-content-cap-gutter-one-home.ts` (#284), `scripts/test-checkout-field-names.tsx` (#285), `scripts/test-catalog-filter-bar-phone.tsx` (#286), `scripts/test-editor-duplicates-b1.ts` (#287), `scripts/test-render-helpers-b2.ts` and the shared `scripts/happy-dom-globals.ts` (#288; #294 moves the cart-close guard onto it), `scripts/test-cart-close-on-navigate.tsx` (#289), `scripts/test-checkout-empties-the-cart.tsx` (#290), `scripts/test-checkout-retry-saves-address-once.tsx` (#291), `scripts/test-checkout-payment-start-failure.tsx` (#292), `scripts/test-one-category-product-picker.ts` and `scripts/test-one-field-input-class.ts` (#293), `scripts/test-site-dialogs-one-frame.tsx` (#295; §5 from #297, widened by #299), `scripts/test-product-hero-choice-pressed.ts` (#296), `scripts/test-stock-fitment-card-tyres.tsx` (#301), `scripts/test-catalog-sort-name.tsx` (#302), `scripts/test-checkout-confirmation-receipt.tsx` (#303), `scripts/test-render-client-site-theme.tsx` (#304), `scripts/test-block-align-one-alphabet.tsx` (#306). Changed: `scripts/test-shell-peer-range.ts` reads the builder's own peer range (#284); `scripts/test-section-animation.tsx` is rewritten for the Entrance module and `scripts/test-gap-only-one-rule.tsx` gains §4 (#298); `scripts/test-product-hero-bullets.tsx` is rewritten for the slot (#279); `scripts/test-english-variant.tsx` gains test 5 (#276); `scripts/test-container-gap.tsx` expects the phone Gap rule (#283); `scripts/test-coupon-preview-shopper-token.tsx` gains a retry section (#300); `scripts/test-overlays-dismiss-in-one-place.tsx` checks the lightbox (#293) and the Tab trap (#308); `scripts/test-content-cap-gutter-one-home.ts` pins the wheels listing's own 2.5rem gutter (#305). Removed: `scripts/test-catalog-site-processes.ts` (#249), `scripts/test-panel-row-wraps.tsx` (#287).
|
|
48
|
+
|
|
3
49
|
## 0.75.0 - 2026-10-29
|
|
4
50
|
|
|
5
51
|
**A major for hosts (major version zero, so a minor number):** three editor phrases leave `words`, and the `render/lib/api` entry loses `AdminStorefrontSitePatch`, `storefrontAdmin.updateSite` and the site's Maps fields. The peer ranges do not move. A host must: delete "No regions yet", "Site header — above every page" and "Site footer — below every page" from its editor catalogue; stop calling `storefrontAdmin.updateSite`; deploy efficient-backend #3774 before this release reaches a shop that takes bank transfer; and, for efficient-storefront, carry the `openapi.yml` change (`bank` in `paymentMethods`, the quote's `postcode` and `courier`, the Maps fields removed) in the sync PR that takes this release.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";import{$ as Un,L as An,M as Tn,N as Ln,O as _n,P as Fn,Q as pe,S as Ge,T as qn,U as jn,V as ct,W as Dn,Y as Tt,_ as Mn,aa as $n,b as Rn,c as At,d as On,e as In,fa as Kn,ga as Ee,la as Wn,ma as lt,pa as Lt,ra as Q,sa as X,x as st}from"./chunk-GDR5GGVW.js";import{i as de,o as De,v as U}from"./chunk-CAULWKXR.js";import{Da as wn,xa as Nn,za as ue}from"./chunk-ZIZWJZ5T.js";import{k as En,l as He,m as re}from"./chunk-OWYNZAAY.js";import{a as It,b as Ra}from"./chunk-Y6SLVHK3.js";var zn=It(($o,Bn)=>{"use strict";var Ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Bn.exports=Ia});var Jn=It((Ko,Vn)=>{"use strict";var Aa=zn();function Hn(){}function Gn(){}Gn.resetWarningCache=Hn;Vn.exports=function(){function e(r,a,i,c,p,d){if(d!==Aa){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Gn,resetWarningCache:Hn};return n.PropTypes=n,n}});var Zn=It((Bo,Xn)=>{"use strict";Xn.exports=Jn()();var Wo,Yo});import{useEffect as ea,useMemo as Jr,useRef as $e,useState as Oe}from"react";import{rootIsDark as Oa}from"efficient-shell/format";function Yn(){if(typeof document>"u")return;let e=getComputedStyle(document.documentElement),t=(r,a)=>e.getPropertyValue(r).trim()||a,n=Oa({whenUnset:!0});return{theme:n?"night":"stripe",variables:{colorPrimary:t("--accent",n?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",n?"#131313":"#ffffff"),colorText:t("--fg",n?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}var _=Ra(Zn(),1);import I from"react";function Qn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ta(e){if(Array.isArray(e))return e}function ar(e,t,n){return(t=Da(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function La(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,c,p=[],d=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(p.push(r.value),p.length!==t);d=!0);}catch(y){u=!0,a=y}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw a}}return p}}function _a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?er(Object(n),!0).forEach(function(r){ar(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fa(e,t){if(e==null)return{};var n,r,a=qa(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function qa(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function or(e,t){return Ta(e)||La(e,t)||Ma(e,t)||_a()}function ja(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Da(e){var t=ja(e,"string");return typeof t=="symbol"?t:t+""}function _t(e){"@babel/helpers - typeof";return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}function Ma(e,t){if(e){if(typeof e=="string")return Qn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qn(e,t):void 0}}var W=function(t,n,r){var a=!!r,i=I.useRef(r);I.useEffect(function(){i.current=r},[r]),I.useEffect(function(){if(!a||!t)return function(){};var c=function(){if(i.current)return i.current.apply(i,arguments)};return t.on(n,c),function(){t.off(n,c)}},[a,n,t,i])},Ft=function(t){var n=I.useRef(t);return I.useEffect(function(){n.current=t},[t]),n.current},Me=function(t){return t!==null&&_t(t)==="object"},Ua=function(t){return Me(t)&&typeof t.then=="function"},$a=function(t){return Me(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},nr="[object Object]",Ka=function e(t,n){if(t===n)return!0;if(!Me(t)||!Me(n))return t===n;var r=Array.isArray(t),a=Array.isArray(n);if(r!==a)return!1;var i=Object.prototype.toString.call(t)===nr,c=Object.prototype.toString.call(n)===nr;if(i!==c)return!1;if(!i&&!r)return t===n;var p=Object.keys(t),d=Object.keys(n);if(p.length!==d.length)return!1;for(var u={},y=0;y<p.length;y+=1)u[p[y]]=!0;for(var v=0;v<d.length;v+=1)u[d[v]]=!0;var b=Object.keys(u);if(b.length!==p.length)return!1;var m=t,w=n,N=function(V){return e(m[V],w[V])};return b.every(N)},ir=function(t,n,r){return Me(t)?Object.keys(t).reduce(function(a,i){var c=!Me(n)||!Ka(t[i],n[i]);return r.includes(i)?(c&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),a):c?tr(tr({},a||{}),{},ar({},i,t[i])):a},null):null},sr="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",rr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sr;if(t===null||$a(t))return t;throw new Error(n)},Wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sr;if(Ua(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return rr(a,n)})};var r=rr(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},Ya=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),t.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},ut=I.createContext(null);ut.displayName="ElementsContext";var cr=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t},jt=function(t){var n=t.stripe,r=t.options,a=t.children,i=I.useMemo(function(){return Wa(n)},[n]),c=I.useState(function(){return{stripe:i.tag==="sync"?i.stripe:null,elements:i.tag==="sync"?i.stripe.elements(r):null}}),p=or(c,2),d=p[0],u=p[1];I.useEffect(function(){var b=!0,m=function(N){u(function(R){return R.stripe?R:{stripe:N,elements:N.elements(r)}})};return i.tag==="async"&&!d.stripe?i.stripePromise.then(function(w){w&&b&&m(w)}):i.tag==="sync"&&!d.stripe&&m(i.stripe),function(){b=!1}},[i,d,r]);var y=Ft(n);I.useEffect(function(){y!==null&&y!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[y,n]);var v=Ft(r);return I.useEffect(function(){if(d.elements){var b=ir(r,v,["clientSecret","fonts"]);b&&d.elements.update(b)}},[r,v,d.elements]),I.useEffect(function(){Ya(d.stripe)},[d.stripe]),I.createElement(ut.Provider,{value:d},a)};jt.propTypes={stripe:_.default.any,options:_.default.object};var lr=function(t){var n=I.useContext(ut);return cr(n,t)},ur=function(){var t=lr("calls useElements()"),n=t.elements;return n},Ba=function(t){var n=t.children,r=lr("mounts <ElementsConsumer>");return n(r)};Ba.propTypes={children:_.default.func.isRequired};var za=I.createContext(null);za.displayName="CheckoutContext";var dr=I.createContext(null);dr.displayName="CheckoutSdkContext";var qt=function(t){var n=I.useContext(dr),r=I.useContext(ut);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both a checkout provider and <Elements> provider."));return n}else return cr(r,t)},Ha=["mode"],Ga=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},F=function(t,n,r){var a="".concat(Ga(t),"Element"),i=function(u){var y=u.id,v=u.className,b=u.options,m=b===void 0?{}:b,w=u.onBlur,N=u.onFocus,R=u.onReady,V=u.onChange,E=u.onEscape,C=u.onClick,M=u.onLoadError,B=u.onLoaderStart,D=u.onNetworksChange,ae=u.onConfirm,me=u.onCancel,Se=u.onShippingAddressChange,oe=u.onShippingRateChange,z=u.onSavedPaymentMethodRemove,te=u.onSavedPaymentMethodUpdate,ie=u.onAvailablePaymentMethodsChange,L=qt("mounts <".concat(a,">")),x="elements"in L?L.elements:null,H="checkoutSdk"in L?L.checkoutSdk:null,Ke=I.useState(null),Ne=or(Ke,2),j=Ne[0],We=Ne[1],G=I.useRef(null),se=I.useRef(null);W(j,"blur",w),W(j,"focus",N),W(j,"escape",E),W(j,"click",C),W(j,"loaderror",M),W(j,"loaderstart",B),W(j,"networkschange",D),W(j,"confirm",ae),W(j,"cancel",me),W(j,"shippingaddresschange",Se),W(j,"shippingratechange",oe),W(j,"savedpaymentmethodremove",z),W(j,"savedpaymentmethodupdate",te),W(j,"availablepaymentmethodschange",ie),W(j,"change",V);var he;R&&(t==="expressCheckout"?he=R:he=function(){R(j)}),W(j,"ready",he),I.useLayoutEffect(function(){if(G.current===null&&se.current!==null&&(x||H)){var A=null;if(H){var J=H,Ie=H;switch(t){case"paymentForm":A=Ie.createForm(m);break;case"payment":A=J.createPaymentElement(m);break;case"address":if("mode"in m){var T=m.mode,we=Fa(m,Ha);if(T==="shipping")A=J.createShippingAddressElement(we);else if(T==="billing")A=J.createBillingAddressElement(we);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":A=J.createExpressCheckoutElement(m);break;case"currencySelector":A=H.createCurrencySelectorElement();break;case"taxId":A=J.createTaxIdElement(m);break;case"contactDetails":A=J.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in H)A=H.createLinkSignupElement(m);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":A=J.createTermsElement(m);break;default:throw new Error("<".concat(a,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else x&&(A=x.create(t,m));G.current=A,We(A),A&&A.mount(se.current)}},[x,H,m]);var ce=Ft(m);return I.useEffect(function(){if(G.current){var A=ir(m,ce,["paymentRequest"]);A&&"update"in G.current&&G.current.update(A)}},[m,ce]),I.useLayoutEffect(function(){return function(){if(G.current&&typeof G.current.destroy=="function")try{G.current.destroy(),G.current=null}catch{}}},[]),I.createElement("div",{id:y,className:v,ref:se})},c=function(u){qt("mounts <".concat(a,">"));var y=u.id,v=u.className;return I.createElement("div",{id:y,className:v})},p=n?c:i;return p.propTypes={id:_.default.string,className:_.default.string,onChange:_.default.func,onBlur:_.default.func,onFocus:_.default.func,onReady:_.default.func,onEscape:_.default.func,onClick:_.default.func,onLoadError:_.default.func,onLoaderStart:_.default.func,onNetworksChange:_.default.func,onConfirm:_.default.func,onCancel:_.default.func,onShippingAddressChange:_.default.func,onShippingRateChange:_.default.func,onSavedPaymentMethodRemove:_.default.func,onSavedPaymentMethodUpdate:_.default.func,onAvailablePaymentMethodsChange:_.default.func,options:_.default.object},p.displayName=a,p.__elementType=t,p},q=typeof window>"u",Va=I.createContext(null);Va.displayName="EmbeddedCheckoutProviderContext";var pr=function(){var t=qt("calls useStripe()"),n=t.stripe;return n},Ho=F("auBankAccount",q),Go=F("card",q),Vo=F("cardNumber",q),Jo=F("cardExpiry",q),Xo=F("cardCvc",q),Zo=F("currencySelector",q),Qo=F("iban",q),mr=F("payment",q),ei=F("expressCheckout",q),ti=F("paymentRequestButton",q),ni=F("linkAuthentication",q),ri=F("linkSignup",q),ai=F("contactDetails",q),oi=F("address",q),ii=F("shippingAddress",q),si=F("paymentMethodMessaging",q),ci=F("taxId",q),li=F("issuingCardNumberDisplay",q),ui=F("issuingCardCvcDisplay",q),di=F("issuingCardExpiryDisplay",q),pi=F("issuingCardPinDisplay",q),mi=F("issuingCardCopyButton",q),fi=F("terms",q);function mt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mt=function(t){return typeof t}:mt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(e)}var yr="dahlia",Ja=function(t){return t===3?"v3":t},hr="https://js.stripe.com",Xa="".concat(hr,"/").concat(yr,"/stripe.js"),Za=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Qa=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,fr="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",eo=function(t){return Za.test(t)||Qa.test(t)},to=function(){for(var t=document.querySelectorAll('script[src^="'.concat(hr,'"]')),n=0;n<t.length;n++){var r=t[n];if(eo(r.src))return r}return null},gr=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Xa).concat(n);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(r),r},no=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},Ve=null,dt=null,pt=null,ro=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},ao=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},oo=function(t){return Ve!==null?Ve:(Ve=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(fr),window.Stripe){n(window.Stripe);return}try{var a=to();if(a&&t)console.warn(fr);else if(!a)a=gr(t);else if(a&&pt!==null&&dt!==null){var i;a.removeEventListener("load",pt),a.removeEventListener("error",dt),(i=a.parentNode)===null||i===void 0||i.removeChild(a),a=gr(t)}pt=ao(n,r),dt=ro(r),a.addEventListener("load",pt),a.addEventListener("error",dt)}catch(c){r(c);return}}),Ve.catch(function(n){return Ve=null,Promise.reject(n)}))},io=function(t,n,r){if(t===null)return null;var a=n[0];if(typeof a!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(mt(a)," instead."));var i=a.match(/^pk_test/),c=Ja(t.version),p=yr;i&&c!==p&&console.warn("Stripe.js@".concat(c," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(p,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var d=t.apply(void 0,n);return no(d,r),d},Je,br=!1,vr=function(){return Je||(Je=oo(null).catch(function(t){return Je=null,Promise.reject(t)}),Je)};Promise.resolve().then(function(){return vr()}).catch(function(e){br||console.warn(e)});var ft=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];br=!0;var a=Date.now();return vr().then(function(i){return io(i,n,a)})};var xr=2;function Cr(e){return e==="card"}var so="checkout_unavailable",Ue="We could not check your payment. Please try again.",co=1e4;async function kr(e,t=co){let n,r=new Promise(i=>{n=setTimeout(()=>i(void 0),t)}),a=(async()=>{try{return(await(await ft(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([a,r])}finally{clearTimeout(n)}}var Pr=new Set(["none","requires_payment_method","canceled"]);function Dt(e){return e instanceof de&&typeof e.data=="object"&&e.data!==null&&e.data.code===so}function gt(e){return e.orderNumber||e.checkoutNumber}function lo(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function Sr({checkoutNumber:e,resend:t,page:n}){n.setConfirming(!0);let r;try{r=lo(await t())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(n.markPaid(),n.track(r.order),n.land(r.order)):n.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),n.setConfirming(!1)}import{createContext as xo,useContext as Co,useEffect as Y,useMemo as qr,useRef as ee,useState as k}from"react";var uo="sf:gclid",po="sf:fbclid",mo=2160*60*60*1e3;function Er(){return typeof window<"u"}function Nr(e){let t=He.getItem(e);if(!t)return"";try{let{v:n,t:r}=JSON.parse(t);return!n||typeof r!="number"||Date.now()-r>mo?"":n}catch{return""}}function wr(e){if(!Er())return"";let t=e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${t}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Rr(){if(!Er())return{};let e=Nr(uo),t=Nr(po),n=wr("_fbp"),r=wr("_fbc");!r&&t&&(r=`fb.1.${Date.now()}.${t}`);let a={};return e&&(a.gclid=e),t&&(a.fbclid=t),n&&(a.fbp=n),r&&(a.fbc=r),a}var Or="sf:meta-purchases",fo=20;function Ar(){return typeof window>"u"||window.parent!==window}function go(...e){try{if(Ar()||typeof window.fbq!="function")return;window.fbq(...e)}catch{}}var Ir=new Set;function yo(e){if(Ir.has(e))return!1;Ir.add(e);try{let t=JSON.parse(He.getItem(Or)??"[]");if(t.includes(e))return!1;He.setItem(Or,JSON.stringify([...t,e].slice(-fo)))}catch{}return!0}function ho(e){return[...new Set(e.filter(Ge).flatMap(t=>t.components.map(n=>n.partNumber)))]}function Tr(e){let t=e.confirmation;Ar()||!yo(t.orderNumber)||go("track","Purchase",{value:Number(t.grandTotal),currency:t.currency,content_type:"product",content_ids:ho(e.lines)},{eventID:t.orderNumber})}var Mt="checkout-afterpay-context",yt="checkout-gocardless-context",Ut="checkout-zip-context",ht="checkout-klarna-context";function bo({evidence:e,parked:t}){return e?{action:"capture",evidence:e,parked:t}:t?{action:"settle",parked:t}:{action:"ignore"}}function vo(e,t){let n=e.getItem(t);if(e.removeItem(t),!n)return null;try{return JSON.parse(n)}catch{return null}}var Lr={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:Mt,evidenceFrom(e,t){return t==="cancel"||(e.get("status")??"").toUpperCase()==="CANCELLED"?null:e.get("orderToken")},requestFrom:e=>({token:e})},_r={name:"Zip",legParam:"zip",legValues:["return"],storageKey:Ut,evidenceFrom(e){let t=(e.get("result")??"").toLowerCase();return t==="cancelled"||t==="declined"?null:e.get("checkoutId")},requestFrom:e=>({checkoutId:e})};async function $t(e,t){let n=new URLSearchParams(t.search),r=n.get(e.legParam);if(!r||!e.legValues.includes(r))return;let a=vo(t.storage,e.storageKey),i=e.evidenceFrom(n,r);t.scrubQuery();let c=bo({evidence:i,parked:a});if(c.action!=="ignore"){if(t.page.clearCart(),c.action==="settle"){t.page.note(`The ${e.name} payment was not completed \u2014 our team will follow up on payment.`),t.page.land(c.parked.confirmation);return}t.page.setConfirming(!0);try{let p=await t.capture(e.requestFrom(c.evidence));p.status==="paid"?t.page.markPaid():t.page.note(`${e.name} declined the payment \u2014 our team will follow up on payment.`),t.page.land(c.parked?.confirmation??p)}catch{c.parked?(t.page.note(`We could not confirm the ${e.name} payment \u2014 our team will follow up on payment.`),t.page.land(c.parked.confirmation)):t.page.fail(`We could not confirm your ${e.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{t.page.setConfirming(!1)}}}function Fr(e,t,n){let r=(t??"").trim();if(!r)return"";if(n.length===0)return r;let a=r.toUpperCase(),i=`${e.toUpperCase()}-${a}`,c=n.find(p=>p.code&&p.code.toUpperCase()===a)??n.find(p=>p.code&&p.code.toUpperCase()===i)??n.find(p=>p.name.toUpperCase()===a);return c?c.code||c.name:""}import{jsx as ye}from"react/jsx-runtime";function jr(e){let t=e.indexOf(`
|
|
3
|
+
`);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function Dr(e,{canParkContext:t}={canParkContext:!0}){let n=e.paymentMethods,r=[];return n.includes("card")&&r.push({key:"card",title:"Card",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&e.paypalClientId&&r.push({key:"paypal",title:"PayPal",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&r.push({key:"afterpay",title:"Afterpay",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&e.squareApplicationId&&e.squareLocationId&&r.push({key:"square",title:"Card (Square)",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&t&&r.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&r.push({key:"zip",title:"Zip",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&t&&r.push({key:"klarna",title:"Klarna",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),n.includes("bank")&&r.push({key:"bank",title:"Bank transfer",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),r}var Mr="This shop does not take payment online yet. Please contact the shop to order.";function ko(e,t){if(!e.orderNumber&&Dt(t))return t.message;let n=t instanceof de?` (${t.message})`:"";return e.orderNumber?`Your order ${e.orderNumber} is saved, but the payment did not start${n}. Try the payment again \u2014 your order will not be placed twice.`:`Your items are held under ${e.checkoutNumber}, but the payment did not start${n}. Try the payment again \u2014 you will not be charged twice.`}var Ur="Shipping cannot be calculated right now. Please try again.";function Po({site:e,logo:t,preview:n=!1}){let{items:r,totals:a,coupon:i,refuseCoupon:c,deliveryOptions:p,shippingMethodId:d,setShippingMethodId:u,setQuoteDestination:y,courier:v,requote:b,identify:m,clearCapturedCart:w,replaceItems:N,removeCoupon:R}=ct(),V=p.find(l=>l.id===d)?.pickupLocation??null,{country:E,countries:C,activeCountry:M,formatMoney:B}=pe(),[D,ae]=k(()=>Dr(e)[0]?.key??null),[me,Se]=k(!0);Y(()=>{Se(En(re))},[]);let[oe,z]=k(!1),[te,ie]=k(""),[L,x]=k(""),[H,Ke]=k(""),[Ne,j]=k(""),[We,G]=k(""),[se,he]=k(""),[ce,A]=k(""),[J,Ie]=k(""),[T,we]=k(()=>E||C[0]?.code||""),[be,Xe]=k(""),[Ye,zt]=k([]),[Ct,kt]=k(null),[Ze,Be]=k(null),Ht=qr(()=>C.find(l=>l.code===T)??M,[C,T,M]),ta=Ht?.postalLabel||"Postal Code",na=Ye[0]?.divisionType||"State / Province";Y(()=>{if(!T){zt([]),kt(T);return}kt(null);let l=!1;return U.listCountrySubdivisions(T).then(f=>{l||(zt(f),kt(T),Xe(""))}),()=>{l=!0}},[T]);let Gt=Ne.trim()!==""&&se.trim()!==""&&ce.trim()!==""&&Ct===T&&(Ye.length===0||be!=="")?ce.trim():"";Y(()=>{y(T?{country:T,subdivision:be,postcode:Gt}:null)},[T,be,Gt,y]),Y(()=>()=>y(null),[y]);let ra=v?.status==="unavailable",aa=b,[Qe,Vt]=k(null),[oa,Jt]=k([]),[Xt,Pt]=k("new"),[Zt,Qt]=k(!1),[St,ia]=k("Home"),[sa,en]=k(null),[Z,tn]=k(()=>lt()),nn=ee(null),[rn,le]=k(null),[ca,fe]=k(null),[an,et]=k(null),[on,la]=k(!1),[sn,ua]=k(!1),[ve,Ae]=k(null),[da,Te]=k(!1),[ne,Le]=k(null),[pa,ge]=k(null),[ma,fa]=k(!1),[ga,cn]=k(!1),[ya,ha]=k(!1),[ba,ln]=k(!1),[un,va]=k(!1),[xa,Nt]=k(!1),[wt,dn]=k(null),tt=ee(null),Et=ee(r),pn=!!(rn||wt&&wt.kind!=="processing"||un||on||sn||an&&ve?.orderNumber);Y(()=>{pn&&(N([]),R())},[pn,N,R]);let mn=ee(!1);Y(()=>{n||mn.current||!r.some(Ge)||(mn.current=!0,An({lines:r,currency:a.currency,value:a.subtotal-a.discount,coupon:i?.valid?i.code:void 0}))},[r,a,i,n]),Y(()=>{m(te,L.trim()||void 0)},[te,L,m]);let fn=ee(null),[nt,Ca]=k(null);Y(()=>{let l=fn.current;if(!nt||!l)return;let f=()=>l.style.setProperty("--sf-checkout-header-h",`${nt.offsetHeight}px`);f();let g=new ResizeObserver(f);return g.observe(nt),()=>g.disconnect()},[nt]),Y(()=>{let l=g=>({setConfirming:g,land:le,markPaid:()=>Te(!0),note:ge,fail:fe,clearCart:w}),f={search:window.location.search,storage:re,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};$t(Lr,{...f,capture:U.captureAfterpayPayment,page:l(fa)}),$t(_r,{...f,capture:U.captureZipPayment,page:l(ha)})},[]),Y(()=>{let f=new URLSearchParams(window.location.search).get("gocardless");if(f!=="confirm"&&f!=="cancel")return;let g=re.getItem(yt);if(re.removeItem(yt),window.history.replaceState(null,"",window.location.pathname),!g)return;let P;try{P=JSON.parse(g)}catch{return}if(w(),f==="cancel"){ge("The direct debit was not set up \u2014 our team will follow up on payment."),le(P.confirmation);return}cn(!0),U.completeGocardlessPayment({idempotencyKey:P.idempotencyKey}).then(O=>{O.status==="paid"?Te(!0):O.status==="declined"?ge("The direct debit was declined \u2014 our team will follow up on payment."):ge("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{ge("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{le(P.confirmation),cn(!1)})},[]),Y(()=>{let l=new URLSearchParams(window.location.search),f=l.get("klarna");if(f!=="confirm"&&f!=="cancel")return;let g=re.getItem(ht);re.removeItem(ht);let P=l.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!g)return;let O;try{O=JSON.parse(g)}catch{return}if(w(),f==="cancel"||!P){ge("The Klarna payment was not completed \u2014 our team will follow up on payment."),le(O.confirmation);return}ln(!0),U.captureKlarnaPayment({idempotencyKey:O.idempotencyKey,authorizationToken:P}).then($=>{$.status==="paid"?Te(!0):$.status==="declined"?ge("Klarna declined the payment \u2014 our team will follow up on payment."):ge("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{ge("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{le(O.confirmation),ln(!1)})},[]);function gn(l){let[f,g]=jr(l.address);j(f),G(g),he(l.city),A(l.zip_code),l.country&&we(l.country),l.phone&&Ie(l.phone),Be({country:l.country||null,state:l.state??""})}Y(()=>{if(Ze){if((Ze.country||T)!==T){Be(null);return}Ct===T&&(Xe(Fr(T,Ze.state,Ye)),Be(null))}},[Ze,T,Ct,Ye]),Y(()=>{let l=!1;return(async()=>{try{let[f,g,P]=await Promise.all([De.me(),De.myProfile().catch(()=>null),De.myAddresses().catch(()=>[])]);if(l)return;Vt(f);let O=P.filter(ze=>ze.is_active);Jt(O),ie(f.email);let $=(g?.contact_name??"").split(/\s+/);x(f.first_name||$[0]||""),Ke(f.last_name||$.slice(1).join(" "));let Sn=f.phone||g?.phone;Sn&&Ie(Sn);let Ot=O.find(ze=>ze.id===f.default_delivery_location)??O[0];if(Ot)Pt(Ot.id),gn(Ot);else if(g){let[ze,Ea]=jr(g.address??"");j(ze),G(Ea),he(g.city??""),A(g.zip_code??""),g.country&&we(g.country),Be({country:g.country||null,state:g.state??""})}}catch{}})(),()=>{l=!0}},[]);function ka(){De.logout(),Vt(null),Jt([]),Pt("new"),Qt(!1),ie(""),x(""),Ke(""),j(""),G(""),he(""),A(""),Ie(""),we(E||C[0]?.code||""),Xe(""),Be(null)}let _e=qr(()=>Dr(e,{canParkContext:me}),[e,me]);Y(()=>{_e.some(l=>l.key===D)||ae(_e[0]?.key??null)},[_e,D]);let Pa=_e.length===0,rt=We.trim()?`${Ne}
|
|
4
|
+
${We.trim()}`:Ne,xe=JSON.stringify([te,L,H,J,rt,se,be,ce,T,r.map(l=>[l.id,l.qty]),d,At(i),D,a.currency,Qe?.id??null]),at=ee(null),Ce=ee(!1),Fe=ee(null),ot=ee(!1),Rt=ee(xe);Rt.current=xe;let yn=ee(oe);yn.current=oe;let hn=()=>Ce.current&&Rt.current!==at.current,qe=ee(null);Y(()=>{yn.current||(xe!==qe.current&&(qe.current=null),!(!Ce.current||!ne||ne.orderNumber)&&(xe===at.current||xe===qe.current||it(ne)))},[xe,ne]);async function it(l){if(!ot.current){ot.current=!0,z(!0);try{let f=Fe.current?await kr(Fe.current):"none";if(f==="succeeded"||f==="processing"){Ce.current=!1,Le(null),f==="succeeded"?await je(void 0,l):vn(l);return}if(f===void 0||!Pr.has(f)){qe.current=Rt.current,Le(l),fe(Ue);return}Ce.current=!1,Fe.current=null,qe.current=null,fe(null),Le(null),tn(lt())}finally{ot.current=!1,z(!1)}}}async function Sa(){if(n||oe||ot.current)return;if(ne){if(Ce.current&&!ne.orderNumber&&xe!==at.current){await it(ne);return}z(!0),fe(null),await xn();let g=ne.orderNumber?D:"card";g!==D&&ae(g),await Cn(ne,g,!ne.orderNumber);return}if(r.length===0||a.repricing||!D||!_e.some(g=>g.key===D))return;let l=r.filter(Ge).flatMap(g=>In(g.components,g.qty));if(l.length===0){fe("Pick a size on each wheel's product page before checking out.");return}z(!0),fe(null);let f;try{let g=Qe?U.createOrderAuthed:U.createOrder,P=Wn(),O={customer:{email:te,name:`${L} ${H}`.trim(),phone:J.trim()||void 0,address:rt,city:se,state:be||void 0,zipCode:ce,country:T},items:l,currency:a.currency,idempotencyKey:Z,shippingMethodId:d??void 0,couponCode:At(i),...P==="denied"?{}:Rr(),...P?{adConsent:P}:{},...Cr(D)?{checkoutFlow:xr}:{}};tt.current=()=>g(O),Fe.current=null,Ce.current=!1,qe.current=null,at.current=xe,Et.current=r,f=await g(O),f.orderNumber&&(bn(f),w()),await xn()}catch(g){let P=On(g);P?(c(P),fe(`${P} Your order has not been placed. Place it again to continue without the code.`)):fe(g instanceof de?g.message:"Could not place the order. Please try again."),z(!1);return}await Cn(f)}function bn(l){Tn({confirmation:l,lines:Et.current,adsSendTo:e.googleAdsId&&e.googleAdsConversionLabel?`${e.googleAdsId}/${e.googleAdsConversionLabel}`:null}),Tr({confirmation:l,lines:Et.current})}async function je(l,f=ve){if(!f)return;let g=l?async()=>l:tt.current;if(f.orderNumber||!g){Te(!0),le(f);return}w(),await Sr({checkoutNumber:f.checkoutNumber,resend:g,page:{setConfirming:va,land:le,markPaid:()=>Te(!0),track:bn,unplaced:dn}})}function vn(l=ve){if(l){if(l.orderNumber){le(l);return}w(),dn({kind:"processing",checkoutNumber:l.checkoutNumber})}}async function xn(){let l=JSON.stringify([St.trim(),L,H,J.trim(),rt,se,be,ce,T]);if(!(!Qe||!Zt||Xt!=="new"||nn.current===l))try{await De.createAddress({label:St.trim()||"Home",contact_name:`${L} ${H}`.trim(),phone:J.trim(),address:rt,city:se,zip_code:ce,state:be,country:T}),nn.current=l,en("Address saved to your account.")}catch{en("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}}async function Cn(l,f=D,g=!1){Le(null);try{if(f==="card"&&e.paymentMethods.includes("card")){let P=await U.createPaymentIntent({idempotencyKey:Z});if(Fe.current=P,g&&hn()){await it(l);return}let O=l;if(g){let $=await tt.current?.().catch(()=>null);if($?.orderNumber){await je($,l);return}if(O=kn(l,$)??{...l,expiresAt:null},hn()){await it(l);return}}Ae(O),Nt(!1),et(P)}else if(f==="paypal"&&e.paymentMethods.includes("paypal"))Ae(l),la(!0);else if(f==="afterpay"&&e.paymentMethods.includes("afterpay")){let P=window.location.origin,O=await U.createAfterpayCheckout({idempotencyKey:Z,confirmUrl:`${P}/checkout?afterpay=confirm`,cancelUrl:`${P}/checkout?afterpay=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(Mt,JSON.stringify($)),window.location.assign(O.redirectCheckoutUrl);return}else if(f==="square"&&e.paymentMethods.includes("square"))Ae(l),ua(!0);else if(f==="gocardless"&&e.paymentMethods.includes("gocardless")){let P=window.location.origin,O=await U.createGocardlessBillingRequest({idempotencyKey:Z,confirmUrl:`${P}/checkout?gocardless=confirm`,cancelUrl:`${P}/checkout?gocardless=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(yt,JSON.stringify($)),window.location.assign(O.authorisationUrl);return}else if(f==="zip"&&e.paymentMethods.includes("zip")){let P=window.location.origin,O=await U.createZipCheckout({idempotencyKey:Z,redirectUrl:`${P}/checkout?zip=return`}),$={idempotencyKey:Z,confirmation:l};re.setItem(Ut,JSON.stringify($)),window.location.assign(O.redirectUrl);return}else if(f==="klarna"&&e.paymentMethods.includes("klarna")){let P=window.location.origin,O=await U.createKlarnaCheckout({idempotencyKey:Z,confirmUrl:`${P}/checkout?klarna=confirm`,cancelUrl:`${P}/checkout?klarna=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(ht,JSON.stringify($)),window.location.assign(O.redirectUrl);return}else le(l)}catch(P){if(g&&P instanceof de&&P.status===409){await je(void 0,l);return}Pn(l,P),z(!1)}}function kn(l,f){return f&&!f.orderNumber&&f.status==="open"&&f.checkoutNumber===l.checkoutNumber?f:null}function Pn(l,f){fe(ko(l,f)),!l.orderNumber&&Dt(f)?(Ce.current=!1,tn(lt())):Le(l)}async function Na(l){if(!ve)return;let f=ve;try{let g=await U.createPaymentIntent({idempotencyKey:Z}),P=await tt.current?.().catch(()=>null);if(P?.orderNumber){await je(P);return}let O=kn(f,P);Ae(O??{...f,expiresAt:null}),Nt(l&&O!==null),Fe.current=g,et(g)}catch(g){if(g instanceof de&&g.status===409){await je();return}et(null),Ae(null),Pn(f,g),z(!1)}}function wa(){ve&&(Ce.current=!0,Le(ve),et(null),Ae(null),Nt(!1),z(!1))}return{site:e,logo:t,items:r,totals:a,coupon:i,deliveryOptions:p,courierUnavailable:ra,retryCourier:aa,shippingMethodId:d,setShippingMethodId:u,pickupLocation:V,servedCountries:C,formatMoney:B,payChoice:D,setPayChoice:ae,placing:oe,email:te,setEmail:ie,firstName:L,setFirstName:x,lastName:H,setLastName:Ke,address1:Ne,setAddress1:j,address2:We,setAddress2:G,city:se,setCity:he,postcode:ce,setPostcode:A,phone:J,setPhone:Ie,country:T,setCountry:we,subdivision:be,setSubdivision:Xe,subdivisions:Ye,destination:Ht,postcodeLabel:ta,subdivisionLabel:na,me:Qe,savedAddresses:oa,selectedAddressId:Xt,setSelectedAddressId:Pt,saveAddress:Zt,setSaveAddress:Qt,saveLabel:St,setSaveLabel:ia,addressSaveNote:sa,idemKey:Z,confirmation:rn,setConfirmation:le,orderError:ca,payment:an,paypalStep:on,squareStep:sn,pendingConf:ve,paid:da,setPaid:Te,unpaidOrder:ne,payNote:pa,afterpayConfirming:ma,gocardlessConfirming:ga,zipConfirming:ya,klarnaConfirming:ba,cardConfirming:un,checkoutResult:wt,confirmCardPayment:je,cardStillProcessing:vn,renewCardPayment:Na,holdRenewed:xa,leaveCardPayment:wa,checkoutRootRef:fn,setCheckoutHeaderEl:Ca,fillFromAddress:gn,checkoutSignOut:ka,payOptions:_e,noPaymentMethod:Pa,placeOrder:Sa}}var $r=xo(null);function Kr({children:e,...t}){let n=Po(t);return ye($r.Provider,{value:n,children:e})}function ke(){let e=Co($r);if(!e)throw new Error("useCheckout must be used inside CheckoutStateProvider");return e}import{useId as Kt}from"react";import{Fragment as Pe,jsx as o,jsxs as S}from"react/jsx-runtime";function Yr(){let{email:e,setEmail:t,firstName:n,setFirstName:r,lastName:a,setLastName:i,me:c,checkoutSignOut:p}=ke(),d=Kt();return S(vt,{num:"N\xB0 01",title:"Contact",children:[o(Q,{label:"Email",htmlFor:d,hint:c?S(Pe,{children:["Signed in \xB7"," ",o("button",{type:"button",onClick:p,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:o("input",{id:d,type:"email",value:e,onChange:u=>t(u.target.value),placeholder:"you@example.com",readOnly:c!==null,className:X+(c?" opacity-70":"")})}),S(Vr,{children:[o(Q,{label:"First name",children:o("input",{type:"text",value:n,onChange:u=>r(u.target.value),className:X})}),o(Q,{label:"Last name",children:o("input",{type:"text",value:a,onChange:u=>i(u.target.value),className:X})})]})]})}function Br(){let{pickupLocation:e,servedCountries:t,address1:n,setAddress1:r,address2:a,setAddress2:i,city:c,setCity:p,postcode:d,setPostcode:u,phone:y,setPhone:v,country:b,setCountry:m,subdivision:w,setSubdivision:N,subdivisions:R,destination:V,postcodeLabel:E,subdivisionLabel:C,me:M,savedAddresses:B,selectedAddressId:D,setSelectedAddressId:ae,saveAddress:me,setSaveAddress:Se,saveLabel:oe,setSaveLabel:z,fillFromAddress:te}=ke(),ie=Kt(),L=Kt();return S(vt,{num:"N\xB0 02",title:e?"Collection":"Shipping address",children:[e?S("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[o("span",{className:"font-medium",children:e.name}),[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).length>0&&o("span",{className:"opacity-80",children:[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).join(", ")}),e.openingHours&&o("span",{className:"opacity-80",children:e.openingHours}),e.instructions&&o("span",{className:"opacity-80",children:e.instructions}),o("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):S(Pe,{children:[M!==null&&B.length>0&&S("div",{className:"grid gap-3",children:[B.map(x=>o(bt,{active:D===x.id,onClick:()=>{ae(x.id),te(x)},title:x.label,body:x.formatted_address,price:null},x.id)),o(bt,{active:D==="new",onClick:()=>ae("new"),title:"New address",body:null,price:null})]}),o(Q,{label:"Address line 1",children:o("input",{type:"text",value:n,onChange:x=>r(x.target.value),className:X})}),o(Q,{label:"Address line 2",children:o("input",{type:"text",value:a,onChange:x=>i(x.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:X})}),S(Vr,{cols:"three",children:[o(Q,{label:"City",children:o("input",{type:"text",value:c,onChange:x=>p(x.target.value),className:X})}),o(Q,{label:E,children:o("input",{type:"text",value:d,onChange:x=>u(x.target.value),className:X})}),o(Q,{label:"Country",separate:!0,htmlFor:ie,children:o(Lt,{id:ie,value:b,onChange:x=>m(x.target.value),className:X+" pr-10",style:Wr,children:t.map(x=>o("option",{value:x.code,children:x.name},x.code))})})]}),o(Q,{label:C,separate:!0,htmlFor:L,children:R.length>0?S(Lt,{id:L,value:w,onChange:x=>N(x.target.value),className:X+" pr-10",style:Wr,children:[o("option",{value:"",children:"Select\u2026"}),R.map(x=>o("option",{value:x.code||x.name,children:x.name},x.code||x.name))]}):o("input",{id:L,type:"text",value:w,onChange:x=>N(x.target.value),className:X})})]}),o(Q,{label:"Phone",children:o("input",{type:"tel",value:y,onChange:x=>v(x.target.value),className:X})}),!e&&M!==null&&D==="new"&&S(Pe,{children:[o(So,{checked:me,onChange:Se,label:"Save this address to my account"}),me&&o(Q,{label:"Address label",children:o("input",{type:"text",value:oe,onChange:x=>z(x.target.value),placeholder:"Home",className:X})})]})]})}function zr(){let{totals:e,coupon:t,deliveryOptions:n,shippingMethodId:r,setShippingMethodId:a,pickupLocation:i,formatMoney:c,city:p,destination:d,courierUnavailable:u,retryCourier:y}=ke();return o(vt,{num:"N\xB0 03",title:"Shipping",children:S("div",{className:"grid gap-3",children:[n.map(v=>{let b=v.pickupLocation,m=b?[b.address,b.city,b.state,b.zipCode].filter(Boolean).join(", "):null;return o(bt,{active:r===v.id,onClick:()=>a(v.id),title:b?`${v.name} \u2014 ${b.name}`:v.name,body:b?[m,b.openingHours,b.instructions,v.description].filter(Boolean).join(" \xB7 "):v.description||null,price:e.freeShipping||v.amount===0?st:c(v.amount,e.currency),tag:v.tag||void 0},v.id)}),u?S("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[Ur," ",o("button",{type:"button",onClick:y,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Hr(){let{payChoice:e,setPayChoice:t,placing:n,payment:r,payOptions:a,noPaymentMethod:i}=ke();return S(vt,{num:"N\xB0 04",title:"Payment",children:[i&&o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:Mr}),o("div",{className:"grid gap-3",children:a.map(c=>o(bt,{active:e===c.key,onClick:()=>t(c.key),title:c.title,body:c.body,price:c.price,tag:c.tag},c.key))}),e==="card"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="paypal"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):e==="afterpay"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):e==="square"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="gocardless"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):e==="zip"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):e==="klarna"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):e==="bank"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."}):null]})}function Gr(){let{site:e,items:t,totals:n,coupon:r,formatMoney:a,payChoice:i,placing:c,email:p,orderError:d,payment:u,noPaymentMethod:y,unpaidOrder:v,placeOrder:b}=ke();return S("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[S("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[o("span",{children:"Your order"}),o(ue,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),o("div",{className:"flex flex-col px-6 py-2",children:t.length===0?S("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",o(ue,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):t.map(m=>o(No,{slug:m.slug,name:m.name,qty:m.qty,config:m.config,configSummary:wo(m.config),price:qn(m,n.currency)??0,currency:n.currency},m.id))}),o("div",{className:"border-t border-line px-6 pt-5",children:o(Kn,{customerEmail:p})}),S("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[o(Re,{label:"Subtotal",value:a(n.subtotal,n.currency)}),n.discount>0&&r?.valid&&o(Re,{label:`Coupon \xB7 ${r.code}`,value:S("span",{className:"font-semibold text-green",children:["\u2212 ",a(n.discount,n.currency)]})}),r?.deferred&&o(Re,{label:`Coupon \xB7 ${r.code}`,value:Rn}),r?.valid&&r.effects?.gift&&o(Re,{label:`Free gift \xB7 ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` \xD7${r.effects.gift.quantity}`:""}`,value:o("span",{className:"font-semibold text-green",children:st})}),o(Re,{label:"Shipping",value:n.shippingStatus==="free"?o("span",{className:"font-semibold text-green",children:st}):_n(n.shippingStatus)??a(n.shipping,n.currency)}),n.tax&&(n.tax.charged?o(Re,{label:n.tax.inclusive?`${n.tax.name} included \xB7 ${n.tax.rate}%`:n.tax.name,value:a(n.tax.amount,n.currency)}):n.tax.name?o(Re,{label:n.tax.name,value:Ln}):null)]}),S("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[o("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),o("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"\u2026":a(n.grand,n.currency)})]}),S("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[d&&o(Ee,{role:"alert",children:d}),n.hasUnpricedLine&&S(Ee,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),o("button",{type:"button",onClick:b,disabled:c||!v&&(y||t.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",c||!v&&(t.length===0||y||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:c?S(Pe,{children:["Building order\u2026 ",o("span",{children:"\xB7"})]}):y?S(Pe,{children:["No online payment ",o("span",{children:"\xB7"})]}):v?S(Pe,{children:["Try payment again \xB7 ",gt(v),o("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]}):n.repricing?S(Pe,{children:["Updating total\u2026 ",o("span",{children:"\xB7"})]}):S(Pe,{children:[i==="bank"?"Place order":"Continue to payment"," \xB7"," ",a(n.grand,n.currency),o("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})}var Wr={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function vt({num:e,title:t,children:n}){return S("section",{className:"mb-6 border border-line bg-bg",children:[S("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[o("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e}),o("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:t})]}),o("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Vr({cols:e="two",children:t}){return o("div",{className:["grid gap-3 max-[640px]:grid-cols-1",e==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:t})}function bt({active:e,onClick:t,title:n,body:r,price:a,tag:i}){return S("button",{type:"button",onClick:t,"aria-pressed":e,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",e?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[e&&o("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),o("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",e?"border-accent":"border-fg-dim"].join(" "),children:e&&o("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),S("span",{className:"flex min-w-0 flex-col gap-1",children:[S("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,i&&o("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:i})]}),r&&o("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),o("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function So({checked:e,onChange:t,label:n,sub:r}){return S("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[o("button",{type:"button",onClick:()=>t(!e),"aria-pressed":e,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",e?"border-accent":"border-line"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:e&&o("span",{className:"text-[13px] text-accent",children:"\u2713"})}),S("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,r&&o("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:r})]})]})}function No({slug:e,name:t,qty:n,config:r,configSummary:a,price:i,currency:c}){let{catalog:p}=ct(),{formatMoney:d}=pe(),u=p.find(N=>N.slug===e),y=u?.spokes??5,v=u?.mesh??!1,b=r.find(N=>N.gold)?.label,m=u?.finishes.find(N=>N.name===b&&N.src)??u?.finishes.find(N=>N.src),w=u?.finishes[0]?.color??$n;return S("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[S("div",{className:"relative aspect-square",children:[o("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:m?.src?o(Nn,{src:m.src,alt:`${t.lead}${t.accent} \u2014 ${m.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):o("div",{className:"block w-[78%]",style:{color:w},children:o(Un,{spokes:y,mesh:v,className:"block w-full"})})}),o("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n})]}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[S("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[t.lead,o("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:t.accent})]}),o("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),o("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:d(i,c)})]})}function Re({label:e,value:t}){return S("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[o("span",{children:e}),o("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:t})]})}function wo(e){return e.map(t=>t.label).join(" \xB7 ")}import{Fragment as K,jsx as s,jsxs as h}from"react/jsx-runtime";function Bt(e){return s(Kr,{...e,children:s(Oo,{})})}function Eo({order:e,paid:t}){let{formatMoney:n}=pe();if(!e.grandTotal||!e.currency)return null;let r=c=>n(Number(c),e.currency),a=Number(e.freightCharge??0),i=Number(e.discountAmount??0);return h("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(e.shippingMethod||a>0)&&h(K,{children:[h("dt",{className:"text-fg-dim",children:["Delivery",e.shippingMethod?` \xB7 ${e.shippingMethod}`:""]}),s("dd",{className:"text-right font-mono",children:r(e.freightCharge??"0")})]}),i>0&&h(K,{children:[h("dt",{className:"text-fg-dim",children:["Discount",e.couponCode?` \xB7 ${e.couponCode}`:""]}),h("dd",{className:"text-right font-mono",children:["\u2212",r(e.discountAmount??"0")]})]}),s("dt",{className:"text-fg",children:t?"Total paid":"Order total"}),s("dd",{className:"text-right font-mono text-fg",children:r(e.grandTotal)})]})}function Ro({result:e}){let t=s("span",{className:"font-mono text-fg",children:e.checkoutNumber});return h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:e.kind==="refunded"||e.kind==="expired"?"Order not placed":e.kind==="processing"?"Payment processing":"Payment received"}),s("p",{className:"text-fg-dim",children:e.kind==="refunded"?h(K,{children:["An item sold out or an offer ended while you paid for checkout ",t,". Your payment is refunded to your card."]}):e.kind==="expired"?h(K,{children:["The hold on checkout ",t," ran out before your payment arrived. Your payment is refunded to your card."]}):e.kind==="processing"?h(K,{children:["Your payment for checkout ",t," is being processed. When it goes through, we will email your order confirmation."]}):h(K,{children:["Thank you \u2014 your payment for checkout ",t," has gone through. We will email you the order number shortly."]})}),s(ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]})}function Oo(){let{site:e,logo:t,items:n,placing:r,email:a,me:i,addressSaveNote:c,idemKey:p,confirmation:d,setConfirmation:u,payment:y,paypalStep:v,squareStep:b,pendingConf:m,paid:w,setPaid:N,payNote:R,afterpayConfirming:V,gocardlessConfirming:E,zipConfirming:C,klarnaConfirming:M,cardConfirming:B,checkoutResult:D,confirmCardPayment:ae,cardStillProcessing:me,renewCardPayment:Se,holdRenewed:oe,leaveCardPayment:z,checkoutRootRef:te,setCheckoutHeaderEl:ie}=ke();return d?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:w?"Payment received":"Order received"}),h("p",{className:"text-fg-dim",children:[w?h(K,{children:["Thank you \u2014 your payment for order"," ",s("span",{className:"font-mono text-fg",children:d.orderNumber})," has gone through."," "]}):h(K,{children:["Thank you \u2014 your order ",s("span",{className:"font-mono text-fg",children:d.orderNumber})," is being reviewed by our team."," "]}),i?h(K,{children:["Track it under"," ",s(ue,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):s(K,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),s(Eo,{order:d,paid:w}),R&&s("p",{className:"text-sm text-fg-dim",children:R}),c&&s("p",{className:"text-sm text-fg-dim",children:c}),!i&&h("p",{className:"text-sm text-fg-dim",children:["You can also"," ",s(ue,{href:`/track?order=${encodeURIComponent(d.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),s(ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):D?s(Ro,{result:D}):B?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order \u2014 one moment."})]}):V?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):E?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):C?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):M?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):y&&m?s(Io,{payment:y,checkout:m,holdRenewed:oe,onPaid:ae,onProcessing:me,onRenew:Se,onBack:z}):v&&m?s(_o,{confirmation:m,clientId:e.paypalClientId??"",idemKey:p,onPaid:()=>{N(!0),u(m)},onSkip:()=>u(m)}):b&&m?s(qo,{confirmation:m,applicationId:e.squareApplicationId??"",locationId:e.squareLocationId??"",environment:e.squareEnvironment??"production",idemKey:p,onPaid:()=>{N(!0),u(m)},onSkip:()=>u(m)}):h("div",{ref:te,className:"bg-bg text-fg",children:[h("header",{ref:ie,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[h(ue,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",s("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),s(ue,{href:"/","aria-label":`${e.name} home`,className:"inline-flex items-center justify-center",children:s(Mn,{variant:"header",scrolled:!0,src:t?.url??null,reverse:t?.reverse??!1,reversedSrc:t?.reversed??null,inkIsDark:t?.inkIsDark??null,size:t?.size??"medium",sizePx:t?.sizePx??null,siteName:e.name})}),e.cardPayments?h("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[s("span",{className:"text-green",children:"\u25CF"}),s("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):s("span",{})]}),h("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[s("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),s("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(L=>h("span",{className:["relative flex items-center gap-2 transition-colors",L.state==="pending"?"text-fg-dim":"text-fg",L.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[s("span",{className:L.state==="done"?"text-accent font-bold":"",children:L.n}),s("span",{children:L.label})]},L.n))})]}),h("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[h("div",{children:[s(Yr,{}),s(Br,{}),s(zr,{}),s(Hr,{})]}),s(Gr,{})]}),s("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:s("span",{children:Dn({legalName:e.legalName,foundedYear:e.foundedYear,siteName:e.name})})})]})}function Io({payment:e,checkout:t,holdRenewed:n,onPaid:r,onProcessing:a,onRenew:i,onBack:c}){let{formatMoney:p}=pe(),d=s("span",{className:"text-fg",children:p(Number(e.amount),e.currency)}),u=Jr(()=>ft(e.publishableKey),[e.publishableKey]),y=Jr(()=>Yn(),[]);return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:gt(t)}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:t.orderNumber?h(K,{children:["Your order is placed. Pay ",d," by card to confirm it now."]}):n?h(K,{children:["Your hold ran out, so your items are held again",t.expiresAt?` until ${Xr(t.expiresAt)}`:"",". Enter your card again, then pay ",d,"."]}):h(K,{children:["Your items are held",t.expiresAt?` until ${Xr(t.expiresAt)}`:"",". Pay ",d," by card to place your order."]})}),s(jt,{stripe:u,options:{clientSecret:e.clientSecret,appearance:y},children:s(To,{payment:e,checkout:t,onPaid:r,onProcessing:a,onRenew:i,onBack:c})},e.clientSecret)]})]})})}function Xr(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}var Ao=5;function To({payment:e,checkout:t,onPaid:n,onProcessing:r,onRenew:a,onBack:i}){let{formatMoney:c}=pe(),p=pr(),d=ur(),[u,y]=Oe(!1),[v,b]=Oe(null),m=$e(!1);async function w(){try{return(await p.retrievePaymentIntent(e.clientSecret)).paymentIntent?.status}catch{return}}async function N(E){let C=E;for(let M=0;C==="processing"&&M<Ao;M+=1)await new Promise(B=>setTimeout(B,1e3)),C=await w()??C;if(C==="succeeded"){n();return}if(C==="processing"){r();return}b("Payment did not complete. Please try again."),y(!1)}async function R(){if(!p||!d||u)return;y(!0),b(null),m.current=!0;let E=await p.confirmPayment({elements:d,redirect:"if_required"}).catch(()=>null);if(!E){let C=await w();if(C==="succeeded"||C==="processing"){await N(C);return}b(C===void 0?Ue:"Payment failed. Please try again."),y(!1);return}if(E.error){if(!t.orderNumber&&E.error.code==="payment_intent_unexpected_state"){let C=await w();if(C==="succeeded"||C==="processing"){await N(C);return}if(C===void 0){b(Ue),y(!1);return}await a(C==="canceled"),y(!1);return}b(E.error.message??"Payment failed. Please try again."),y(!1);return}await N(E.paymentIntent?.status)}async function V(){if(u)return;if(!m.current){i();return}y(!0),b(null);let E=await w();if(E==="succeeded"||E==="processing"){await N(E);return}if(y(!1),E===void 0){b(Ue);return}i()}return h("div",{className:"flex flex-col gap-4",children:[s(mr,{}),v&&s(Ee,{role:"alert",children:v}),s("button",{type:"button",onClick:R,disabled:!p||!d||u,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!p||!d||u?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?h(K,{children:["Processing\u2026 ",s("span",{children:"\xB7"})]}):h(K,{children:["Pay ",c(Number(e.amount),e.currency),s("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),!t.orderNumber&&!u&&h("button",{type:"button",onClick:V,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",s("span",{children:"Back to checkout"})]})]})}var Zr="paypal-sdk-js",Wt=null;function Lo(e,t){let n=`${e}|${t}`;if(Wt?.key===n)return Wt.promise;let r=new Promise((a,i)=>{document.getElementById(Zr)?.remove();let c=document.createElement("script");c.id=Zr;let p=new URLSearchParams({"client-id":e,currency:t,intent:"capture"});c.src=`https://www.paypal.com/sdk/js?${p}`,c.onload=()=>{let d=window.paypal;d?a(d):i(new Error("PayPal SDK loaded without its namespace"))},c.onerror=()=>i(new Error("PayPal SDK failed to load")),document.head.appendChild(c)});return Wt={key:n,promise:r},r}function _o({confirmation:e,clientId:t,idemKey:n,onPaid:r,onSkip:a}){let{formatMoney:i}=pe(),c=$e(null),[p,d]=Oe(!1),[u,y]=Oe(null),v=$e(r);return v.current=r,ea(()=>{let b=!1,m=null;return Lo(t,e.currency).then(w=>{if(!(b||!c.current))return m=w.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await U.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async N=>{try{if((await U.capturePaypalOrder({idempotencyKey:n,paypalOrderId:N.orderID})).status==="paid"){v.current();return}y("PayPal did not complete the payment. Please try again.")}catch(R){y(R instanceof de?R.message:"PayPal payment failed. Please try again.")}},onError:()=>{y("PayPal could not process the payment. Please try again.")}}),m.render(c.current).then(()=>{b||d(!0)})}).catch(()=>{b||y("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{b=!0,m?.close?.()}},[t,e.currency,n]),s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[h("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",s("span",{className:"text-fg",children:i(Number(e.grandTotal),e.currency)})," ","with PayPal to confirm it now."]}),!p&&!u&&s("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),s("div",{ref:c}),u&&s(Ee,{role:"alert",children:u}),s("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}var Qr="square-web-sdk",Yt=null;function Fo(e){let t=e==="sandbox"?"sandbox":"production";if(Yt?.key===t)return Yt.promise;let n=new Promise((r,a)=>{document.getElementById(Qr)?.remove();let i=document.createElement("script");i.id=Qr,i.src=t==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",i.onload=()=>{let c=window.Square;c?r(c):a(new Error("Square SDK loaded without its namespace"))},i.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(i)});return Yt={key:t,promise:n},n}function qo({confirmation:e,applicationId:t,locationId:n,environment:r,idemKey:a,onPaid:i,onSkip:c}){let{formatMoney:p}=pe(),d=$e(null),u=$e(null),y=$e(null),[v,b]=Oe(!1),[m,w]=Oe(!1),[N,R]=Oe(null);ea(()=>{let E=!1,C=null;return Fo(r).then(async M=>{if(E||!d.current)return;let B=M.payments(t,n);y.current=B,C=await B.card(),await C.attach(d.current),u.current=C,E||b(!0)}).catch(()=>{E||R("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{E=!0,C?.destroy?.()}},[t,n,r]);async function V(){let E=u.current;if(!(!E||m)){w(!0),R(null);try{let C=await E.tokenize();if(C.status!=="OK"||!C.token){R(C.errors?.[0]?.message??"Please check the card details and try again."),w(!1);return}let M;try{M=(await y.current?.verifyBuyer?.(C.token,{amount:String(e.grandTotal),currencyCode:e.currency,intent:"CHARGE"}))?.token}catch{}if((await U.chargeSquare({idempotencyKey:a,sourceId:C.token,...M?{verificationToken:M}:{}})).status==="paid"){i();return}R("Square did not complete the payment. Please try again.")}catch(C){R(C instanceof de?C.message:"Square payment failed. Please try again.")}w(!1)}}return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[h("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",s("span",{className:"text-fg",children:p(Number(e.grandTotal),e.currency)})," ","by card to confirm it now."]}),!v&&!N&&s("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),s("div",{ref:d}),N&&s(Ee,{role:"alert",children:N}),s("button",{type:"button",onClick:V,disabled:!v||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!v||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?h(K,{children:["Processing\u2026 ",s("span",{children:"\xB7"})]}):h(K,{children:["Pay ",p(Number(e.grandTotal),e.currency),s("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),s("button",{type:"button",onClick:c,disabled:m,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}import{jsx as xt}from"react/jsx-runtime";function jo(){let{settings:e,websiteName:t}=wn(),n=t?{...Tt,name:t}:Tt,r=e?{url:e.logoUrl,reversed:e.logoReversed??null,inkIsDark:e.logoInkIsDark??null,reverse:e.reverseLogo,size:e.logoSize,sizePx:e.logoSizePx}:null;return xt("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:xt(Fn,{children:xt(jn,{preview:!0,children:xt(Bt,{site:n,logo:r,preview:!0})})})})}export{jo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{Mk as r}from"./chunk-BOJGJXIU.js";import"./chunk-ZIZWJZ5T.js";import"./chunk-OWYNZAAY.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
|