efficient-storefront-blocks 0.70.0 → 0.75.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.
Files changed (136) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-3GKJZDL5.js → SiteEditorProvider-N4T55FAV.js} +1 -1
  4. package/dist/chunks/chunk-3TBLX25X.js +1 -0
  5. package/dist/chunks/chunk-4V6BLJSG.js +1 -0
  6. package/dist/chunks/{chunk-QWHNN7GF.js → chunk-K26JUDGZ.js} +1 -1
  7. package/dist/chunks/chunk-SJODSVWU.js +1 -0
  8. package/dist/chunks/chunk-WPHE7RI4.js +246 -0
  9. package/dist/chunks/{fitment-data-6GK7QQQI.js → fitment-data-5ZSHENM3.js} +1 -1
  10. package/dist/contract.js +2 -2
  11. package/dist/editor/components/CategorySource.js +1 -1
  12. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  13. package/dist/editor/components/PreviewHeader.d.ts +0 -1
  14. package/dist/editor/components/PreviewHeader.js +1 -11
  15. package/dist/editor/lib/document/blocks/service/ContactCards/fields.d.ts +2 -0
  16. package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -0
  17. package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
  18. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.d.ts +2 -0
  19. package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -0
  20. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.d.ts +2 -0
  21. package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -0
  22. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.d.ts +2 -0
  23. package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -0
  24. package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
  25. package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
  26. package/dist/editor/lib/document/blocks/service/index.js +1 -1
  27. package/dist/editor/lib/document/config.d.ts +2 -0
  28. package/dist/editor/lib/document/config.js +1 -1
  29. package/dist/editor/lib/efficient-backend.js +1 -1
  30. package/dist/editor/lib/efficient-block-sources.js +1 -1
  31. package/dist/editor/lib/header-settings-source.d.ts +2 -1
  32. package/dist/editor/lib/header-settings-source.js +1 -1
  33. package/dist/editor/lib/storefront-editor-words.d.ts +19 -5
  34. package/dist/editor/lib/storefront-editor-words.js +1 -1
  35. package/dist/editor.css +1 -1
  36. package/dist/index.d.ts +0 -2
  37. package/dist/index.js +296 -200
  38. package/dist/links.d.ts +0 -2
  39. package/dist/links.js +1 -1
  40. package/dist/render/built-with.json +1 -1
  41. package/dist/render/components/CartContext.d.ts +3 -0
  42. package/dist/render/components/CartContext.js +1 -1
  43. package/dist/render/components/ChatLauncher.js +1 -1
  44. package/dist/render/components/ContactCards.d.ts +13 -0
  45. package/dist/render/components/ContactCards.js +1 -0
  46. package/dist/render/components/CopyText.d.ts +4 -0
  47. package/dist/render/components/CopyText.js +1 -0
  48. package/dist/render/components/Events.d.ts +3 -0
  49. package/dist/render/components/Events.js +1 -1
  50. package/dist/render/components/FooterMessaging.d.ts +5 -0
  51. package/dist/render/components/FooterMessaging.js +1 -0
  52. package/dist/render/components/FooterPayment.d.ts +11 -0
  53. package/dist/render/components/FooterPayment.js +1 -0
  54. package/dist/render/components/GalleryItem.js +1 -1
  55. package/dist/render/components/GalleryShowcase.js +1 -1
  56. package/dist/render/components/Header.d.ts +2 -1
  57. package/dist/render/components/Header.js +1 -1
  58. package/dist/render/components/HeaderCallButton.d.ts +9 -0
  59. package/dist/render/components/HeaderCallButton.js +1 -0
  60. package/dist/render/components/HeaderToolBlocks.d.ts +1 -2
  61. package/dist/render/components/HeaderToolBlocks.js +1 -1
  62. package/dist/render/components/MessagingCards.d.ts +9 -0
  63. package/dist/render/components/MessagingCards.js +1 -0
  64. package/dist/render/components/QrCode.d.ts +5 -0
  65. package/dist/render/components/QrCode.js +1 -0
  66. package/dist/render/components/Reviews.d.ts +14 -4
  67. package/dist/render/components/Reviews.js +1 -1
  68. package/dist/render/components/SectionGroupBody.js +1 -1
  69. package/dist/render/components/checkout/CheckoutPageClient.d.ts +2 -25
  70. package/dist/render/components/checkout/CheckoutPageClient.js +1 -3
  71. package/dist/render/components/checkout/checkout-parts.d.ts +5 -0
  72. package/dist/render/components/checkout/checkout-parts.js +1 -0
  73. package/dist/render/components/checkout/checkout-state.d.ts +174 -0
  74. package/dist/render/components/checkout/checkout-state.js +3 -0
  75. package/dist/render/lib/api/index.d.ts +1 -8
  76. package/dist/render/lib/api/index.js +1 -1
  77. package/dist/render/lib/api/types.d.ts +10 -3
  78. package/dist/render/lib/content/site.d.ts +1 -1
  79. package/dist/render/lib/document/blocks/commerce/CountrySwitchBlock/render.js +1 -1
  80. package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +7 -0
  81. package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -0
  82. package/dist/render/lib/document/blocks/service/ContactCards/render.d.ts +4 -0
  83. package/dist/render/lib/document/blocks/service/ContactCards/render.js +1 -0
  84. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  85. package/dist/render/lib/document/blocks/service/Footer/meta.js +1 -1
  86. package/dist/render/lib/document/blocks/service/FooterGroup/meta.js +1 -1
  87. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.d.ts +2 -0
  88. package/dist/render/lib/document/blocks/service/FooterMessaging/meta.js +1 -0
  89. package/dist/render/lib/document/blocks/service/FooterMessaging/render.d.ts +2 -0
  90. package/dist/render/lib/document/blocks/service/FooterMessaging/render.js +1 -0
  91. package/dist/render/lib/document/blocks/service/FooterPayment/meta.d.ts +3 -0
  92. package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -0
  93. package/dist/render/lib/document/blocks/service/FooterPayment/render.d.ts +2 -0
  94. package/dist/render/lib/document/blocks/service/FooterPayment/render.js +1 -0
  95. package/dist/render/lib/document/blocks/service/MessagingCards/meta.d.ts +2 -0
  96. package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -0
  97. package/dist/render/lib/document/blocks/service/MessagingCards/render.d.ts +4 -0
  98. package/dist/render/lib/document/blocks/service/MessagingCards/render.js +1 -0
  99. package/dist/render/lib/document/blocks/service/Reviews/meta.d.ts +6 -0
  100. package/dist/render/lib/document/blocks/service/Reviews/meta.js +1 -1
  101. package/dist/render/lib/document/blocks/service/Reviews/render.js +1 -1
  102. package/dist/render/lib/document/blocks/service/metas.d.ts +4 -0
  103. package/dist/render/lib/document/blocks/service/metas.js +1 -1
  104. package/dist/render/lib/document/blocks/service/renders.d.ts +4 -0
  105. package/dist/render/lib/document/blocks/service/renders.js +1 -1
  106. package/dist/render/lib/document/blocks/text-part-shapes.json +137 -6
  107. package/dist/render/lib/document/card-templates.d.ts +2 -0
  108. package/dist/render/lib/document/card-templates.js +1 -0
  109. package/dist/render/lib/document/footer-page-blocks.d.ts +1 -0
  110. package/dist/render/lib/document/footer-page-blocks.js +1 -1
  111. package/dist/render/lib/document/lazy-draws.js +1 -1
  112. package/dist/render/lib/document/render-config.d.ts +2 -0
  113. package/dist/render/lib/document/render-config.js +1 -1
  114. package/dist/render/lib/document/section-to-box-rows-reviews.d.ts +1 -0
  115. package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -0
  116. package/dist/render/lib/links/link-rules.d.ts +1 -1
  117. package/dist/render/lib/links/link-rules.js +1 -1
  118. package/dist/render/lib/qr.d.ts +5 -0
  119. package/dist/render/lib/qr.js +1 -0
  120. package/dist/render/lib/sections/messaging.d.ts +45 -0
  121. package/dist/render/lib/sections/messaging.js +1 -0
  122. package/dist/render/lib/sections/reviews.d.ts +1 -0
  123. package/dist/render/lib/sections/reviews.js +1 -0
  124. package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
  125. package/dist/render/lib/wheels/collections.js +1 -1
  126. package/dist/words.d.ts +42 -10
  127. package/dist/words.js +4 -4
  128. package/package.json +7 -4
  129. package/dist/chunks/EditorPreviewCheckout-XI4VULPL.js +0 -4
  130. package/dist/chunks/chunk-RPLNV3WM.js +0 -1
  131. package/dist/chunks/chunk-SQH6XBRG.js +0 -1
  132. package/dist/chunks/chunk-TXTTPEQA.js +0 -1
  133. package/dist/chunks/chunk-XF2ZAVNU.js +0 -262
  134. package/dist/render/components/useStorefrontReviews.d.ts +0 -2
  135. package/dist/render/components/useStorefrontReviews.js +0 -1
  136. /package/dist/chunks/{chunk-XF2ZAVNU.js.LEGAL.txt → chunk-WPHE7RI4.js.LEGAL.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.75.0 - 2026-10-29
4
+
5
+ **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.
6
+
7
+ - **BREAKING: the editor canvas draws no site header caption and no empty region label** (#270). "Site header — above every page" and "Site footer — below every page" (`SectionGroupBody`) and the "No regions yet" box in a Country Switch block of a site with no regions (`CountrySwitchTool`, with its dashed placeholder) are gone. The live site never drew them; with no regions the canvas now draws nothing for that block, as the live site does. `CountrySwitchTool` loses its `editing` prop. The three phrases leave `efficient-storefront-blocks/words` (`WebsiteEditorCatalogue`, `STOREFRONT_BLOCKS_WORDS`): a host that lists them must delete them (found in foyerboard-venue-portal `src/locales/*/editor.ts`).
8
+ - **BREAKING: the editor no longer reads or saves the site record's Maps key** (#271). The EFFICIENT backend site record is `{ name, slug }`: `maps_api_key` / `maps_map_id` are no longer mapped (backend 98.32.0 does not send them), and `site.update` is removed, so `canEditSiteRecord` is now false. `render/lib/api`: `AdminStorefrontSite` loses `maps_api_key` / `maps_map_id`; `AdminStorefrontSitePatch` and `storefrontAdmin.updateSite` are removed. `render/lib/api/types` is regenerated: `Site` loses `mapsApiKey` / `mapsMapId`, and the quote's `courier` is the named `CartQuoteCourier` (same fields). Not changed: `package/src/public.d.ts` keeps `SiteRecord.mapsApiKey` / `mapsMapId`, `SiteRecordPatch` and `WebsiteSite.update`, as efficient-easel's contract, until easel's next major.
9
+ - **The checkout offers bank transfer only when the merchant switched it on** (#209; owner ruling 2026-10-23). `buildPayOptions` pushed "Bank transfer · Invoiced" for every tenant. Now it reads `bank` from `site.paymentMethods` like every other method, last in the list; efficient-backend #3774 adds the switch (`bank_transfer_enabled`, default off). `PaymentMethod` and the `/site` contract type gain `"bank"`.
10
+ - A tenant with no method switched on: the Payment card says `NO_PAYMENT_METHOD_NOTE` ("This shop does not take payment online yet. Please contact the shop to order."), the button reads "No online payment" and is off, and `placeOrder` places nothing.
11
+ - **For hosts: deploy efficient-backend #3774 first.** A backend without it never lists `bank`, so its tenants would lose bank transfer.
12
+ - **The checkout sends the postcode with its quote, once the address is complete** (#253). `QuoteDestination` gains `postcode` (`useCart().setQuoteDestination`); `products.quoteCart` sends it as `postcode` (efficient-backend #3918: with it, the tenant's connected courier is one more delivery option). The checkout sets it only when line 1, city, postcode, country and, where the country has a list, the state are filled; away from checkout none is sent. Without the backend change the field is ignored and nothing changes. `render/lib/api/types` gains `postcode` on `CartQuoteRequest`.
13
+ - **When the connected courier cannot be priced, the checkout asks the shopper to try again** (Lewis 2026-10-27). The quote's `courier` answer (`{status, reason}` or null) is on `useCart().courier`, and `useCart().requote()` asks again for the same cart and address. On `status: "unavailable"` the courier is not offered and the Shipping card says `SHIPPING_RETRY_NOTE` ("Shipping cannot be calculated right now. Please try again.") with a Try again control. No second message, no retry counter.
14
+ - **The checkout's Phone field has no example number** (#273). It showed "+44 7700 900000", a UK number, on every site. The field keeps its visible "Phone" label; no other example is put in.
15
+ - **A website map draws on the editor's canvas** (#269, C24). The Locations Map and every Contact / Locations card drew an empty grey box in the editor, because the map's sheets landed in the host head, which the canvas frame does not mirror. `package/build.mjs` adds `maplibre-gl.css` and `efficient-shell/map-site.css` to the canvas sheet (`MAP_SHEETS`). Published pages are unchanged.
16
+ - **The Products source select uses the full row again** (#272). In the Product Grid and Product Hero panels the select was squeezed to one letter; `CategorySource` now draws the link status, "Refresh now" and the help line under the field, as the other source rows do.
17
+ - **The package declares `qrcode`** (#268). `dist/render/lib/qr.js` imports `qrcode`, and the published manifest did not declare it, so a host that imported `ContactCards`, `FooterMessaging` or `MessagingCards` from `render/*` without its own `qrcode` failed to build. `package/package.json` now has `"dependencies": { "qrcode": "^1.5.4" }` (a dependency, not a peer).
18
+ - **Checked against web-builder 44.0.1** (#267). The dev builder moves to `^44.0.1` (its media manifest names the Hero slide's `videoFrame` again); the peer stays `^44.0.0`.
19
+ - New editor words to translate: "Shipping cannot be calculated right now. Please try again.", "This shop does not take payment online yet. Please contact the shop to order.". Gone: "No regions yet", "Site header — above every page", "Site footer — below every page".
20
+ - Guards: new `scripts/test-group-no-caption-on-canvas.tsx` (#270), `scripts/test-site-record-has-no-maps-key.ts` (#271), `scripts/test-checkout-offers-only-switched-on-methods.tsx` (#209), `scripts/test-checkout-phone-has-no-country-example.tsx` (#273), `scripts/test-products-source-row.tsx` (#272); `scripts/test-checkout-quote-destination.tsx` gains §7 and §8 (#253); `scripts/test-editor-canvas-live-head.tsx` gains section 4 (#269); `scripts/test-web-package.mjs` checks that every import in `package/dist` is declared in `package/package.json` (#268); `scripts/test-shell-peer-range.ts` pins the dev builder `^44.0.1` (#267).
21
+
22
+ ## 0.74.0 - 2026-10-28
23
+
24
+ **A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^44.0.0` (was `^42.0.0`), `efficient-easel` `^23.1.0` (was `^22.0.0`) and `efficient-shell` `^10.13.0` (was `^10.0.0`), three published names and one published row key go, and the Reviews props narrow. **0.71.0, 0.72.0 and 0.73.0 were written but never published:** npm goes from 0.70.0 to this release, which carries their sections below.
25
+
26
+ - **BREAKING: builder 43, easel 23, shell 10.13** (#263, Victor Mau). Peer and dev, here and in `package/`: builder 43 asks easel `^23.0.0` and shell `^10.13.0`. The `links` and `words` entries may read efficient-shell's pure `format` entry (the slug is the shell's `slugify`) and the builder's `lib/non-empty-string`; the light-entry check now refuses only a cycle, not a shell chunk reached by two allowed paths. Byte changes, each traced to its builder PR: a section that stores no width follows the site (#322); a Box draws its stored padding plus the frame's 24px on its root (#344); a button with no padding of its own is 24px each side (was 22; #351); new settings declared (Text/Button `consentWords`, Button fill opacity, border, padding; Box shadow and tab shape; Logos; a Hero slide's `loadingShows` and `videoFrame`). **Visible on screens wider than the site:** Product Hero follows the site's Content width, and EU Tyre Label's band the site's Background width. The dev builder is 43.0.1 (#264: its media manifest names the Hero slide's `videoFrame`); the peer stays `^43.0.0`.
27
+ - **BREAKING: web-builder 44** (#266; peer and dev `^44.0.0`, was `^43.0.0` from #263 above; easel and shell do not move). 44 removed names these blocks used, so they do not run on a 43 builder. `components/ChatLauncher` hides on phones under the builder's one phone query, `PHONE_MEDIA` (`render/lib/content/view-values`), in place of the removed `PART_PHONE_MAX_CSS`. Guards read `section-padding` from the render side and pass `sectionPadAttrs` one `PadValues`, and follow 44's behaviour: the Hero picture is an engine part (the first press picks the Hero, the next the Image), Clear formatting is the shell toolbar's (shown only when a mark can be taken off), a `PartNeedle` has a `label`, and `LABEL_GROUP`'s `Schedule` and `Placement` are filed ahead for the popup panel.
28
+ - **BREAKING: Reviews takes every feature of Testimonials** (#242; merge group 6, plan 2026-10-23 §4.1). One "Review content" row: Manual (typed reviews `items[]`: quote, title, name, role, rating; the list is "Typed reviews", shown for Manual only) or Product reviews (the backend's `product-reviews` block source, rows served with the page; the key is `PRODUCT_REVIEWS_SOURCE`, `lib/sections/reviews`). A fresh drop reads the store's reviews, as before. Reviews has a card template (the builder's `template` slot); an empty template draws the built-in card, and the row fields every storefront data block offers are declared once, in `lib/document/card-templates`. An empty Reviews draws its head in the editor and nothing on a published page. **Removed:** `render/components/useStorefrontReviews` (the browser fetch; a host reads the `product-reviews` source); `ReviewsProps` loses `limit`, `designCode` and its `= {}` default; the product filter is `dataSourceOptions.designCode` only, and a top-level `designCode` is no longer read. **efficient-storefront:** `lib/tyres/reviews-hydrate.ts` must write `dataSource: "product-reviews"` and `dataSourceOptions.designCode` in the bump that takes this release.
29
+ - **The Testimonials Box row** (`lib/document/section-to-box-rows-reviews`, both registries, `on: false`): a Testimonials node becomes a Box with a Heading Box of Text and a Reviews block holding its quotes as Manual reviews, its card template seeded with the old quote card. Dry run over the read-only export of 2026-10-26: 5 nodes, 0 keys dropped. Look gaps are listed in the module.
30
+ - **BREAKING: the `links` entry no longer exports `slugifyAnchor`** (#247; the builder's deprecated alias of the shell's `slugify`; no host calls it). Call `slugify` from `efficient-shell/format`.
31
+ - **A slug is the shell's** (#247; `slugify` from `efficient-shell/format`, shell #603; duplicate re-check 2026-10-26, row R04). The Gallery's placeholder label (`GalleryShowcase`) and `GalleryItem` drop their own copies of the rule, the wheel collections (`lib/wheels/collections`) import the shell's `slugify` instead of the builder's forwarder, and the Contact routing fields call `slugify` in place of the builder's deprecated `slugifyGroupId`. Same slug for every name (old against new, 30,006 names). **`slugifyProcess` is deprecated**: it only hands its argument to `slugify`; the blocks' five calls call `slugify`, and the name stays for efficient-storefront's route `app/wheels/collections/[process]/page.tsx` until that route moves.
32
+ - **BREAKING: `SiteThemeRow` loses `card_theme_index`** (`package/src/public.d.ts`), as builder 43 removed it (#350).
33
+ - **BREAKING: easel `^23.1.0`, and `PREVIEW_HEADER_PICK_CSS` is no longer exported** (`editor/components/PreviewHeader`; #251). **The editor's header draws no selection box of its own** (GG 2026-10-26, issue list C8: the editor draws every selection box once). `PreviewHeader` drew a 2px outline on hover and when selected and caught the click itself, so efficient-easel never saw it. The outline, the marker and the click are gone: the Header is a document node, so the canvas selects it, draws its box with the label "Header", and opens the Header panel. Needs efficient-easel 23.1.0 (its nested-wrapper `drawnBox` and the #380 host tokens). No host imports the removed name (search 2026-10-28; efficient-storefront's only copy is its vendored copy of this package).
34
+ - **Payment Logos, the ways to pay as their marks** (`FooterPayment`, #262, Victor Mau, look B). "We accept", then the ways to pay as small marks on one line that wraps between marks, in the footer's own ink, drawn with efficient-shell's `paymentMarks` and `PaymentMark`. Typed methods, or read as the page is served from a source the host declares (`location-payment-methods`, `shop-payment-methods`; efficient-backend#3940); a picked source hides the typed list; served none, nothing on a published page. Its page twin `PaymentLogosBlock` lets a Box footer carry it. Registered in the `Footer` and `FooterGroup` slots.
35
+ - **The checkout is drawn from one state and five named parts. No look change** (#248). `components/checkout/checkout-state` holds the state in one provider (`CheckoutStateProvider`, `useCheckout`; `buildPayOptions` moved with it); `components/checkout/checkout-parts` holds `CheckoutContact`, `CheckoutShippingAddress`, `CheckoutShippingMethod`, `CheckoutPayment` and `CheckoutOrderSummary` (moved, not copied). The static markup is byte for byte the same.
36
+ - New editor words to translate: "We accept", "Payment Logos", "Add the ways you take payment", "Bank transfer", "Shadow", "Tab shape", "Large tabs", "Two, then threes", "Logo style", "Icon at the far end", "Video frame", "This video has no frame yet. The slide shows its background colour until one is made.", "Page width", "This page", "This page has no look of its own to set.", "Page settings for “{name}”", "Select a section or block to edit it.", "Set by country", "Choose an image", "Words", "direction", "tabs", "Review content", "Typed reviews". Gone: "Edit “{name}” in {place}", "Page settings", "Payment method", "the admin", "Clear formatting" (web-builder 44 draws the shell's).
37
+ - Guards: new `scripts/test-header-draws-no-box.tsx` (#251), `scripts/test-footer-payment.tsx` (#262), `scripts/test-checkout-parts.tsx` (#248), `scripts/test-reviews-section-to-box.tsx` (#242), `scripts/test-slug-is-the-shells.ts` (#247: no copy of the slug rule, no alias, no builder slug alias); `scripts/test-reviews-takes-testimonials.tsx` follows #242; `scripts/test-shell-peer-range.ts` pins the new ranges (builder `^44.0.0`, #266).
38
+
39
+ ## 0.73.0 - 2026-10-27
40
+
41
+ **A minor for hosts:** a new row key on "Latest Posts" (`tags`), no peer range change. No editor words.
42
+
43
+ - **A card can carry chips** (`tags` on a served row of "Latest Posts"; Victor Mau approved the look 2026-10-27). A list of words drawn as small outlined chips on one line that clips rather than wraps, at most four: on a portrait or spread card under her hours, and under the card of the even grid. The venue roster's and Everyone's cards say her background, her age and her first languages there, served by efficient-backend (`workshop.public_sources`, efficient-backend#3942). Read off the raw rows as `facets` is (the builder's row reader keeps words only). A card with no chips draws exactly what it drew before; a section stored before is unchanged.
44
+ - Guard: new `scripts/test-events-card-tags.tsx`.
45
+
46
+ ## 0.72.0 - 2026-10-27
47
+
48
+ **A minor for hosts:** three new blocks and a new runtime dependency, `qrcode` (MIT, 1.5.4; a host that compiles `src/` adds it too). No peer range change. New editor words to translate: the blocks' labels ("Messaging cards", "Messaging Strip", "Contact cards"), their rows ("Apps from", "Contacts", "Reach by", "Number or ID") and their placeholders ("Message us", "Who to ask").
49
+
50
+ - **A venue's messaging apps and contacts, each with a QR code drawn as the page is drawn** (Victor Mau approved the look 2026-10-27; the old Foyerboard site's Contact and Employment pages). `MessagingCards` (service set): one card per app the venue offers (WeChat, Telegram, WhatsApp, LINE), its QR code, its handle and "Open <app>"; WeChat, which no link opens, offers "Copy ID". `FooterMessaging` (footer): the same apps' codes small, with their names; a look's footer carries it (efficient-backend touch-up), and it joins the Footer and Footer group slots' Add lists once the builder's catalogue rules it. Both read the source `site-messaging` (efficient-backend: the website's social settings, a separate pull request); rows `app`, `name`, `handle`, `href`, `qr`, and only an http(s) link is ever drawn. `ContactCards` (service set): the Employment page's people to ask, typed in the editor as page content (at most eight; phone, email, WhatsApp, LINE, Telegram, WeChat, KakaoTalk), read the way the old site read them, a contact that does not read left off. QR codes are one SVG path, black on white in every look (`lib/qr`, `components/QrCode`); nothing is fetched. A published page with nothing to show draws nothing; the editor draws a sample. Not yet in the builder's catalogue (`scripts/registered-not-catalogued.ts`).
51
+ - Guard: new `scripts/test-messaging-blocks.tsx`.
52
+
53
+ ## 0.71.0 - 2026-10-27
54
+
55
+ **A minor for hosts:** a new header setting, no peer range change. New editor words to translate: `Call`, `Call button` and its hint.
56
+
57
+ - **The header can call the venue** (Victor Mau approved the mockup 2026-10-27, from the old Foyerboard venue site's header). With the Header's new **Call button** switch on (`call_button`, efficient-backend, a separate pull request), the bar draws a button in the site's button colours: "Call" on a phone (beside the menu button), the number on a wider screen (after the tools). The number and its `tel:` link are the backend's (`GET /header-settings` `callPhone` / `callHref`), read from the location the website shows as the header is served; without a number there is no button. The editor has no number, so its preview draws "Call" on the switch alone. New `components/HeaderCallButton`; `HeaderSettings` gains the three optional keys (an older backend sends none, which is no button).
58
+ - Guard: new `scripts/test-header-call-button.tsx`; `test-header-panel-tabs.tsx` and `test-every-button-follows-the-button-colour.ts` count the new row and the new button.
59
+
3
60
  ## 0.70.0 - 2026-10-27
4
61
 
5
62
  **A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^42.0.0` and `efficient-easel` `^22.0.0` (`efficient-shell` stays `^10.0.0`). Builder 42 and easel 22 removed every name of the retired editor library, so a host moves to those with this release.
@@ -0,0 +1,4 @@
1
+ "use client";import{$ as Jt,K as Ut,L as Wt,M as $t,N as Kt,O as Yt,P as ae,R as Te,S as zt,T as Bt,U as $e,V as Ht,X as ot,Z as Gt,_ as Vt,a as jt,b as Dt,c as Ft,d as Mt,ea as Xt,ja as Zt,ka as Qt,na as it,pa as H,w as We}from"./chunk-4V6BLJSG.js";import{i as Le,o as Pe,v as D}from"./chunk-K26JUDGZ.js";import{Aa as qt,a as Tt,c as re}from"./chunk-3TBLX25X.js";import{k as _t,l as Oe,m as X}from"./chunk-SJODSVWU.js";import{a as at,b as jr}from"./chunk-Y6SLVHK3.js";var tn=at((Fa,en)=>{"use strict";var Dr="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";en.exports=Dr});var on=at((Ma,an)=>{"use strict";var Fr=tn();function nn(){}function rn(){}rn.resetWarningCache=nn;an.exports=function(){function e(r,a,i,s,p,u){if(u!==Fr){var l=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 l.name="Invariant Violation",l}}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:rn,resetWarningCache:nn};return n.PropTypes=n,n}});var cn=at(($a,sn)=>{"use strict";sn.exports=on()();var Ua,Wa});import{useEffect as ir,useMemo as rr,useRef as je,useState as ye}from"react";var O=jr(cn(),1);import N from"react";function ln(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 Mr(e){if(Array.isArray(e))return e}function fn(e,t,n){return(t=zr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ur(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,s,p=[],u=!0,l=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(u=(r=i.call(n)).done)&&(p.push(r.value),p.length!==t);u=!0);}catch(f){l=!0,a=f}finally{try{if(!u&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw a}}return p}}function Wr(){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 un(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 pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?un(Object(n),!0).forEach(function(r){fn(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):un(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $r(e,t){if(e==null)return{};var n,r,a=Kr(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 Kr(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 gn(e,t){return Mr(e)||Ur(e,t)||Br(e,t)||Wr()}function Yr(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 zr(e){var t=Yr(e,"string");return typeof t=="symbol"?t:t+""}function st(e){"@babel/helpers - typeof";return st=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},st(e)}function Br(e,t){if(e){if(typeof e=="string")return ln(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)?ln(e,t):void 0}}var M=function(t,n,r){var a=!!r,i=N.useRef(r);N.useEffect(function(){i.current=r},[r]),N.useEffect(function(){if(!a||!t)return function(){};var s=function(){if(i.current)return i.current.apply(i,arguments)};return t.on(n,s),function(){t.off(n,s)}},[a,n,t,i])},ct=function(t){var n=N.useRef(t);return N.useEffect(function(){n.current=t},[t]),n.current},Ne=function(t){return t!==null&&st(t)==="object"},Hr=function(t){return Ne(t)&&typeof t.then=="function"},Gr=function(t){return Ne(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},dn="[object Object]",Vr=function e(t,n){if(t===n)return!0;if(!Ne(t)||!Ne(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)===dn,s=Object.prototype.toString.call(n)===dn;if(i!==s)return!1;if(!i&&!r)return t===n;var p=Object.keys(t),u=Object.keys(n);if(p.length!==u.length)return!1;for(var l={},f=0;f<p.length;f+=1)l[p[f]]=!0;for(var g=0;g<u.length;g+=1)l[u[g]]=!0;var m=Object.keys(l);if(m.length!==p.length)return!1;var d=t,w=n,k=function(U){return e(d[U],w[U])};return m.every(k)},yn=function(t,n,r){return Ne(t)?Object.keys(t).reduce(function(a,i){var s=!Ne(n)||!Vr(t[i],n[i]);return r.includes(i)?(s&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),a):s?pn(pn({},a||{}),{},fn({},i,t[i])):a},null):null},hn="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.",mn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hn;if(t===null||Gr(t))return t;throw new Error(n)},Jr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:hn;if(Hr(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return mn(a,n)})};var r=mn(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},Xr=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"}))},Ke=N.createContext(null);Ke.displayName="ElementsContext";var vn=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},ut=function(t){var n=t.stripe,r=t.options,a=t.children,i=N.useMemo(function(){return Jr(n)},[n]),s=N.useState(function(){return{stripe:i.tag==="sync"?i.stripe:null,elements:i.tag==="sync"?i.stripe.elements(r):null}}),p=gn(s,2),u=p[0],l=p[1];N.useEffect(function(){var m=!0,d=function(k){l(function(E){return E.stripe?E:{stripe:k,elements:k.elements(r)}})};return i.tag==="async"&&!u.stripe?i.stripePromise.then(function(w){w&&m&&d(w)}):i.tag==="sync"&&!u.stripe&&d(i.stripe),function(){m=!1}},[i,u,r]);var f=ct(n);N.useEffect(function(){f!==null&&f!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[f,n]);var g=ct(r);return N.useEffect(function(){if(u.elements){var m=yn(r,g,["clientSecret","fonts"]);m&&u.elements.update(m)}},[r,g,u.elements]),N.useEffect(function(){Xr(u.stripe)},[u.stripe]),N.createElement(Ke.Provider,{value:u},a)};ut.propTypes={stripe:O.default.any,options:O.default.object};var bn=function(t){var n=N.useContext(Ke);return vn(n,t)},xn=function(){var t=bn("calls useElements()"),n=t.elements;return n},Zr=function(t){var n=t.children,r=bn("mounts <ElementsConsumer>");return n(r)};Zr.propTypes={children:O.default.func.isRequired};var Qr=N.createContext(null);Qr.displayName="CheckoutContext";var Cn=N.createContext(null);Cn.displayName="CheckoutSdkContext";var lt=function(t){var n=N.useContext(Cn),r=N.useContext(Ke);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 vn(r,t)},ea=["mode"],ta=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},L=function(t,n,r){var a="".concat(ta(t),"Element"),i=function(l){var f=l.id,g=l.className,m=l.options,d=m===void 0?{}:m,w=l.onBlur,k=l.onFocus,E=l.onReady,U=l.onChange,F=l.onEscape,q=l.onClick,R=l.onLoadError,W=l.onLoaderStart,V=l.onNetworksChange,$=l.onConfirm,ue=l.onCancel,he=l.onShippingAddressChange,ie=l.onShippingRateChange,ve=l.onSavedPaymentMethodRemove,Q=l.onSavedPaymentMethodUpdate,y=l.onAvailablePaymentMethodsChange,se=lt("mounts <".concat(a,">")),pe="elements"in se?se.elements:null,K="checkoutSdk"in se?se.checkoutSdk:null,we=N.useState(null),be=gn(we,2),_=be[0],xe=be[1],Y=N.useRef(null),ee=N.useRef(null);M(_,"blur",w),M(_,"focus",k),M(_,"escape",F),M(_,"click",q),M(_,"loaderror",R),M(_,"loaderstart",W),M(_,"networkschange",V),M(_,"confirm",$),M(_,"cancel",ue),M(_,"shippingaddresschange",he),M(_,"shippingratechange",ie),M(_,"savedpaymentmethodremove",ve),M(_,"savedpaymentmethodupdate",Q),M(_,"availablepaymentmethodschange",y),M(_,"change",U);var de;E&&(t==="expressCheckout"?de=E:de=function(){E(_)}),M(_,"ready",de),N.useLayoutEffect(function(){if(Y.current===null&&ee.current!==null&&(pe||K)){var I=null;if(K){var P=K,Ee=K;switch(t){case"paymentForm":I=Ee.createForm(d);break;case"payment":I=P.createPaymentElement(d);break;case"address":if("mode"in d){var te=d.mode,ke=$r(d,ea);if(te==="shipping")I=P.createShippingAddressElement(ke);else if(te==="billing")I=P.createBillingAddressElement(ke);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":I=P.createExpressCheckoutElement(d);break;case"currencySelector":I=K.createCurrencySelectorElement();break;case"taxId":I=P.createTaxIdElement(d);break;case"contactDetails":I=P.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in K)I=K.createLinkSignupElement(d);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":I=P.createTermsElement(d);break;default:throw new Error("<".concat(a,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else pe&&(I=pe.create(t,d));Y.current=I,xe(I),I&&I.mount(ee.current)}},[pe,K,d]);var Ce=ct(d);return N.useEffect(function(){if(Y.current){var I=yn(d,Ce,["paymentRequest"]);I&&"update"in Y.current&&Y.current.update(I)}},[d,Ce]),N.useLayoutEffect(function(){return function(){if(Y.current&&typeof Y.current.destroy=="function")try{Y.current.destroy(),Y.current=null}catch{}}},[]),N.createElement("div",{id:f,className:g,ref:ee})},s=function(l){lt("mounts <".concat(a,">"));var f=l.id,g=l.className;return N.createElement("div",{id:f,className:g})},p=n?s:i;return p.propTypes={id:O.default.string,className:O.default.string,onChange:O.default.func,onBlur:O.default.func,onFocus:O.default.func,onReady:O.default.func,onEscape:O.default.func,onClick:O.default.func,onLoadError:O.default.func,onLoaderStart:O.default.func,onNetworksChange:O.default.func,onConfirm:O.default.func,onCancel:O.default.func,onShippingAddressChange:O.default.func,onShippingRateChange:O.default.func,onSavedPaymentMethodRemove:O.default.func,onSavedPaymentMethodUpdate:O.default.func,onAvailablePaymentMethodsChange:O.default.func,options:O.default.object},p.displayName=a,p.__elementType=t,p},T=typeof window>"u",na=N.createContext(null);na.displayName="EmbeddedCheckoutProviderContext";var kn=function(){var t=lt("calls useStripe()"),n=t.stripe;return n},Ya=L("auBankAccount",T),za=L("card",T),Ba=L("cardNumber",T),Ha=L("cardExpiry",T),Ga=L("cardCvc",T),Va=L("currencySelector",T),Ja=L("iban",T),Sn=L("payment",T),Xa=L("expressCheckout",T),Za=L("paymentRequestButton",T),Qa=L("linkAuthentication",T),eo=L("linkSignup",T),to=L("contactDetails",T),no=L("address",T),ro=L("shippingAddress",T),ao=L("paymentMethodMessaging",T),oo=L("taxId",T),io=L("issuingCardNumberDisplay",T),so=L("issuingCardCvcDisplay",T),co=L("issuingCardExpiryDisplay",T),lo=L("issuingCardPinDisplay",T),uo=L("issuingCardCopyButton",T),po=L("terms",T);function Be(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Be=function(t){return typeof t}:Be=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(e)}var wn="dahlia",ra=function(t){return t===3?"v3":t},En="https://js.stripe.com",aa="".concat(En,"/").concat(wn,"/stripe.js"),oa=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,ia=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Pn="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",sa=function(t){return oa.test(t)||ia.test(t)},ca=function(){for(var t=document.querySelectorAll('script[src^="'.concat(En,'"]')),n=0;n<t.length;n++){var r=t[n];if(sa(r.src))return r}return null},Nn=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(aa).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},la=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},qe=null,Ye=null,ze=null,ua=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},pa=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},da=function(t){return qe!==null?qe:(qe=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(Pn),window.Stripe){n(window.Stripe);return}try{var a=ca();if(a&&t)console.warn(Pn);else if(!a)a=Nn(t);else if(a&&ze!==null&&Ye!==null){var i;a.removeEventListener("load",ze),a.removeEventListener("error",Ye),(i=a.parentNode)===null||i===void 0||i.removeChild(a),a=Nn(t)}ze=pa(n,r),Ye=ua(r),a.addEventListener("load",ze),a.addEventListener("error",Ye)}catch(s){r(s);return}}),qe.catch(function(n){return qe=null,Promise.reject(n)}))},ma=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(Be(a)," instead."));var i=a.match(/^pk_test/),s=ra(t.version),p=wn;i&&s!==p&&console.warn("Stripe.js@".concat(s," 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 u=t.apply(void 0,n);return la(u,r),u},_e,Rn=!1,In=function(){return _e||(_e=da(null).catch(function(t){return _e=null,Promise.reject(t)}),_e)};Promise.resolve().then(function(){return In()}).catch(function(e){Rn||console.warn(e)});var An=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];Rn=!0;var a=Date.now();return In().then(function(i){return ma(i,n,a)})};import{createContext as Sa,useContext as Pa,useEffect as B,useMemo as $n,useRef as Kn,useState as v}from"react";var fa="sf:gclid",ga="sf:fbclid",ya=2160*60*60*1e3;function Tn(){return typeof window<"u"}function On(e){let t=Oe.getItem(e);if(!t)return"";try{let{v:n,t:r}=JSON.parse(t);return!n||typeof r!="number"||Date.now()-r>ya?"":n}catch{return""}}function Ln(e){if(!Tn())return"";let t=e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${t}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function qn(){if(!Tn())return{};let e=On(fa),t=On(ga),n=Ln("_fbp"),r=Ln("_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 _n="sf:meta-purchases",ha=20;function Dn(){return typeof window>"u"||window.parent!==window}function va(...e){try{if(Dn()||typeof window.fbq!="function")return;window.fbq(...e)}catch{}}var jn=new Set;function ba(e){if(jn.has(e))return!1;jn.add(e);try{let t=JSON.parse(Oe.getItem(_n)??"[]");if(t.includes(e))return!1;Oe.setItem(_n,JSON.stringify([...t,e].slice(-ha)))}catch{}return!0}function xa(e){return[...new Set(e.filter(Te).flatMap(t=>t.components.map(n=>n.partNumber)))]}function Fn(e){let t=e.confirmation;Dn()||!ba(t.orderNumber)||va("track","Purchase",{value:Number(t.grandTotal),currency:t.currency,content_type:"product",content_ids:xa(e.lines)},{eventID:t.orderNumber})}var pt="checkout-afterpay-context",He="checkout-gocardless-context",dt="checkout-zip-context",Ge="checkout-klarna-context";function Ca({evidence:e,parked:t}){return e?{action:"capture",evidence:e,parked:t}:t?{action:"settle",parked:t}:{action:"ignore"}}function ka(e,t){let n=e.getItem(t);if(e.removeItem(t),!n)return null;try{return JSON.parse(n)}catch{return null}}var Mn={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:pt,evidenceFrom(e,t){return t==="cancel"||(e.get("status")??"").toUpperCase()==="CANCELLED"?null:e.get("orderToken")},requestFrom:e=>({token:e})},Un={name:"Zip",legParam:"zip",legValues:["return"],storageKey:dt,evidenceFrom(e){let t=(e.get("result")??"").toLowerCase();return t==="cancelled"||t==="declined"?null:e.get("checkoutId")},requestFrom:e=>({checkoutId:e})};async function mt(e,t){let n=new URLSearchParams(t.search),r=n.get(e.legParam);if(!r||!e.legValues.includes(r))return;let a=ka(t.storage,e.storageKey),i=e.evidenceFrom(n,r);t.scrubQuery();let s=Ca({evidence:i,parked:a});if(s.action!=="ignore"){if(t.page.clearCart(),s.action==="settle"){t.page.note(`The ${e.name} payment was not completed \u2014 our team will follow up on payment.`),t.page.land(s.parked.confirmation);return}t.page.setConfirming(!0);try{let p=await t.capture(e.requestFrom(s.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(s.parked?.confirmation??p)}catch{s.parked?(t.page.note(`We could not confirm the ${e.name} payment \u2014 our team will follow up on payment.`),t.page.land(s.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 Wn(e,t,n){let r=(t??"").trim();if(!r)return"";if(n.length===0)return r;let a=r.toUpperCase(),i=`${e.toUpperCase()}-${a}`,s=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 s?s.code||s.name:""}import{jsx as oe}from"react/jsx-runtime";function Yn(e){let t=e.indexOf(`
3
+ `);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function zn(e,{canParkContext:t}={canParkContext:!0}){let n=e.paymentMethods,r=[];return n.includes("card")&&r.push({key:"card",title:"Card",body:null,price:oe("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:oe("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:oe("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:oe("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:oe("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:oe("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:oe("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:oe("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),r}var Bn="This shop does not take payment online yet. Please contact the shop to order.",Hn="Shipping cannot be calculated right now. Please try again.";function Na({site:e,logo:t,preview:n=!1}){let{items:r,totals:a,coupon:i,refuseCoupon:s,deliveryOptions:p,shippingMethodId:u,setShippingMethodId:l,setQuoteDestination:f,courier:g,requote:m,identify:d,clearCapturedCart:w}=$e(),k=p.find(C=>C.id===u)?.pickupLocation??null,{country:E,countries:U,activeCountry:F,formatMoney:q}=ae(),[R,W]=v(()=>zn(e)[0]?.key??null),[V,$]=v(!0);B(()=>{$(_t(X))},[]);let[ue,he]=v(!1),[ie,ve]=v(""),[Q,y]=v(""),[se,pe]=v(""),[K,we]=v(""),[be,_]=v(""),[xe,Y]=v(""),[ee,de]=v(""),[Ce,I]=v(""),[P,Ee]=v(()=>E||U[0]?.code||""),[te,ke]=v(""),[Re,ht]=v([]),[Ze,Qe]=v(null),[De,Fe]=v(null),vt=$n(()=>U.find(C=>C.code===P)??F,[U,P,F]),sr=vt?.postalLabel||"Postal Code",cr=Re[0]?.divisionType||"State / Province";B(()=>{if(!P){ht([]),Qe(P);return}Qe(null);let C=!1;return D.listCountrySubdivisions(P).then(b=>{C||(ht(b),Qe(P),ke(""))}),()=>{C=!0}},[P]);let bt=K.trim()!==""&&xe.trim()!==""&&ee.trim()!==""&&Ze===P&&(Re.length===0||te!=="")?ee.trim():"";B(()=>{f(P?{country:P,subdivision:te,postcode:bt}:null)},[P,te,bt,f]),B(()=>()=>f(null),[f]);let lr=g?.status==="unavailable",ur=m,[et,xt]=v(null),[pr,Ct]=v([]),[kt,tt]=v("new"),[St,Pt]=v(!1),[Nt,dr]=v("Home"),[mr,wt]=v(null),[J]=v(()=>Qt()),[fr,me]=v(null),[gr,Ie]=v(null),[yr,hr]=v(null),[vr,br]=v(!1),[xr,Cr]=v(!1),[kr,nt]=v(null),[Sr,Me]=v(!1),[Pr,ne]=v(null),[Nr,wr]=v(!1),[Er,Et]=v(!1),[Rr,Ir]=v(!1),[Ar,Rt]=v(!1),It=Kn(!1);B(()=>{n||It.current||!r.some(Te)||(It.current=!0,Ut({lines:r,currency:a.currency,value:a.subtotal-a.discount,coupon:i?.valid?i.code:void 0}))},[r,a,i,n]),B(()=>{d(ie,Q.trim()||void 0)},[ie,Q,d]);let At=Kn(null),[Ue,Or]=v(null);B(()=>{let C=At.current;if(!Ue||!C)return;let b=()=>C.style.setProperty("--sf-checkout-header-h",`${Ue.offsetHeight}px`);b();let S=new ResizeObserver(b);return S.observe(Ue),()=>S.disconnect()},[Ue]),B(()=>{let C=S=>({setConfirming:S,land:me,markPaid:()=>Me(!0),note:ne,fail:Ie,clearCart:w}),b={search:window.location.search,storage:X,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};mt(Mn,{...b,capture:D.captureAfterpayPayment,page:C(wr)}),mt(Un,{...b,capture:D.captureZipPayment,page:C(Ir)})},[]),B(()=>{let b=new URLSearchParams(window.location.search).get("gocardless");if(b!=="confirm"&&b!=="cancel")return;let S=X.getItem(He);if(X.removeItem(He),window.history.replaceState(null,"",window.location.pathname),!S)return;let j;try{j=JSON.parse(S)}catch{return}if(w(),b==="cancel"){ne("The direct debit was not set up \u2014 our team will follow up on payment."),me(j.confirmation);return}Et(!0),D.completeGocardlessPayment({idempotencyKey:j.idempotencyKey}).then(A=>{A.status==="paid"?Me(!0):A.status==="declined"?ne("The direct debit was declined \u2014 our team will follow up on payment."):ne("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{ne("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{me(j.confirmation),Et(!1)})},[]),B(()=>{let C=new URLSearchParams(window.location.search),b=C.get("klarna");if(b!=="confirm"&&b!=="cancel")return;let S=X.getItem(Ge);X.removeItem(Ge);let j=C.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!S)return;let A;try{A=JSON.parse(S)}catch{return}if(w(),b==="cancel"||!j){ne("The Klarna payment was not completed \u2014 our team will follow up on payment."),me(A.confirmation);return}Rt(!0),D.captureKlarnaPayment({idempotencyKey:A.idempotencyKey,authorizationToken:j}).then(z=>{z.status==="paid"?Me(!0):z.status==="declined"?ne("Klarna declined the payment \u2014 our team will follow up on payment."):ne("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{ne("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{me(A.confirmation),Rt(!1)})},[]);function Ot(C){let[b,S]=Yn(C.address);we(b),_(S),Y(C.city),de(C.zip_code),C.country&&Ee(C.country),C.phone&&I(C.phone),Fe({country:C.country||null,state:C.state??""})}B(()=>{if(De){if((De.country||P)!==P){Fe(null);return}Ze===P&&(ke(Wn(P,De.state,Re)),Fe(null))}},[De,P,Ze,Re]),B(()=>{let C=!1;return(async()=>{try{let[b,S,j]=await Promise.all([Pe.me(),Pe.myProfile().catch(()=>null),Pe.myAddresses().catch(()=>[])]);if(C)return;xt(b);let A=j.filter(Ae=>Ae.is_active);Ct(A),ve(b.email);let z=(S?.contact_name??"").split(/\s+/);y(b.first_name||z[0]||""),pe(b.last_name||z.slice(1).join(" "));let Z=b.phone||S?.phone;Z&&I(Z);let rt=A.find(Ae=>Ae.id===b.default_delivery_location)??A[0];if(rt)tt(rt.id),Ot(rt);else if(S){let[Ae,_r]=Yn(S.address??"");we(Ae),_(_r),Y(S.city??""),de(S.zip_code??""),S.country&&Ee(S.country),Fe({country:S.country||null,state:S.state??""})}}catch{}})(),()=>{C=!0}},[]);function Lr(){Pe.logout(),xt(null),Ct([]),tt("new"),Pt(!1)}let Se=$n(()=>zn(e,{canParkContext:V}),[e,V]);B(()=>{Se.some(C=>C.key===R)||W(Se[0]?.key??null)},[Se,R]);let Tr=Se.length===0,Lt=be.trim()?`${K}
4
+ ${be.trim()}`:K;async function qr(){if(n||ue||r.length===0||a.repricing||!R||!Se.some(b=>b.key===R))return;let C=r.filter(Te).flatMap(b=>Mt(b.components,b.qty));if(C.length===0){Ie("Pick a size on each wheel's product page before checking out.");return}he(!0),Ie(null);try{let b=et?D.createOrderAuthed:D.createOrder,S=Zt(),j=await b({customer:{email:ie,name:`${Q} ${se}`.trim(),phone:Ce.trim()||void 0,address:Lt,city:xe,state:te||void 0,zipCode:ee,country:P},items:C,currency:a.currency,idempotencyKey:J,shippingMethodId:u??void 0,couponCode:Dt(i),...S==="denied"?{}:qn(),...S?{adConsent:S}:{}});if(Wt({confirmation:j,lines:r,adsSendTo:e.googleAdsId&&e.googleAdsConversionLabel?`${e.googleAdsId}/${e.googleAdsConversionLabel}`:null}),Fn({confirmation:j,lines:r}),w(),et&&St&&kt==="new")try{await Pe.createAddress({label:Nt.trim()||"Home",contact_name:`${Q} ${se}`.trim(),phone:Ce.trim(),address:Lt,city:xe,zip_code:ee,state:te,country:P}),wt("Address saved to your account.")}catch{wt("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(R==="card"&&e.paymentMethods.includes("card")){let A=await D.createPaymentIntent({idempotencyKey:J});nt(j),hr(A)}else if(R==="paypal"&&e.paymentMethods.includes("paypal"))nt(j),br(!0);else if(R==="afterpay"&&e.paymentMethods.includes("afterpay")){let A=window.location.origin,z=await D.createAfterpayCheckout({idempotencyKey:J,confirmUrl:`${A}/checkout?afterpay=confirm`,cancelUrl:`${A}/checkout?afterpay=cancel`}),Z={idempotencyKey:J,confirmation:j};X.setItem(pt,JSON.stringify(Z)),window.location.assign(z.redirectCheckoutUrl);return}else if(R==="square"&&e.paymentMethods.includes("square"))nt(j),Cr(!0);else if(R==="gocardless"&&e.paymentMethods.includes("gocardless")){let A=window.location.origin,z=await D.createGocardlessBillingRequest({idempotencyKey:J,confirmUrl:`${A}/checkout?gocardless=confirm`,cancelUrl:`${A}/checkout?gocardless=cancel`}),Z={idempotencyKey:J,confirmation:j};X.setItem(He,JSON.stringify(Z)),window.location.assign(z.authorisationUrl);return}else if(R==="zip"&&e.paymentMethods.includes("zip")){let A=window.location.origin,z=await D.createZipCheckout({idempotencyKey:J,redirectUrl:`${A}/checkout?zip=return`}),Z={idempotencyKey:J,confirmation:j};X.setItem(dt,JSON.stringify(Z)),window.location.assign(z.redirectUrl);return}else if(R==="klarna"&&e.paymentMethods.includes("klarna")){let A=window.location.origin,z=await D.createKlarnaCheckout({idempotencyKey:J,confirmUrl:`${A}/checkout?klarna=confirm`,cancelUrl:`${A}/checkout?klarna=cancel`}),Z={idempotencyKey:J,confirmation:j};X.setItem(Ge,JSON.stringify(Z)),window.location.assign(z.redirectUrl);return}else me(j)}catch(b){let S=Ft(b);S?(s(S),Ie(`${S} Your order has not been placed. Place it again to continue without the code.`)):Ie(b instanceof Le?b.message:"Could not place the order. Please try again."),he(!1)}}return{site:e,logo:t,items:r,totals:a,coupon:i,deliveryOptions:p,courierUnavailable:lr,retryCourier:ur,shippingMethodId:u,setShippingMethodId:l,pickupLocation:k,servedCountries:U,formatMoney:q,payChoice:R,setPayChoice:W,placing:ue,email:ie,setEmail:ve,firstName:Q,setFirstName:y,lastName:se,setLastName:pe,address1:K,setAddress1:we,address2:be,setAddress2:_,city:xe,setCity:Y,postcode:ee,setPostcode:de,phone:Ce,setPhone:I,country:P,setCountry:Ee,subdivision:te,setSubdivision:ke,subdivisions:Re,destination:vt,postcodeLabel:sr,subdivisionLabel:cr,me:et,savedAddresses:pr,selectedAddressId:kt,setSelectedAddressId:tt,saveAddress:St,setSaveAddress:Pt,saveLabel:Nt,setSaveLabel:dr,addressSaveNote:mr,idemKey:J,confirmation:fr,setConfirmation:me,orderError:gr,payment:yr,paypalStep:vr,squareStep:xr,pendingConf:kr,paid:Sr,setPaid:Me,payNote:Pr,afterpayConfirming:Nr,gocardlessConfirming:Er,zipConfirming:Rr,klarnaConfirming:Ar,checkoutRootRef:At,setCheckoutHeaderEl:Or,fillFromAddress:Ot,checkoutSignOut:Lr,payOptions:Se,noPaymentMethod:Tr,placeOrder:qr}}var Gn=Sa(null);function Vn({children:e,...t}){let n=Na(t);return oe(Gn.Provider,{value:n,children:e})}function ce(){let e=Pa(Gn);if(!e)throw new Error("useCheckout must be used inside CheckoutStateProvider");return e}import{Fragment as ge,jsx as o,jsxs as h}from"react/jsx-runtime";function Xn(){let{email:e,setEmail:t,firstName:n,setFirstName:r,lastName:a,setLastName:i,me:s,checkoutSignOut:p}=ce();return h(Je,{num:"N\xB0 01",title:"Contact",children:[o(H,{label:"Email",hint:s?h(ge,{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",{type:"email",value:e,onChange:u=>t(u.target.value),placeholder:"you@example.com",readOnly:s!==null,className:G+(s?" opacity-70":"")})}),h(nr,{children:[o(H,{label:"First name",children:o("input",{type:"text",value:n,onChange:u=>r(u.target.value),className:G})}),o(H,{label:"Last name",children:o("input",{type:"text",value:a,onChange:u=>i(u.target.value),className:G})})]})]})}function Zn(){let{pickupLocation:e,servedCountries:t,address1:n,setAddress1:r,address2:a,setAddress2:i,city:s,setCity:p,postcode:u,setPostcode:l,phone:f,setPhone:g,country:m,setCountry:d,subdivision:w,setSubdivision:k,subdivisions:E,destination:U,postcodeLabel:F,subdivisionLabel:q,me:R,savedAddresses:W,selectedAddressId:V,setSelectedAddressId:$,saveAddress:ue,setSaveAddress:he,saveLabel:ie,setSaveLabel:ve,fillFromAddress:Q}=ce();return h(Je,{num:"N\xB0 02",title:e?"Collection":"Shipping address",children:[e?h("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"})]}):h(ge,{children:[R!==null&&W.length>0&&h("div",{className:"grid gap-3",children:[W.map(y=>o(Ve,{active:V===y.id,onClick:()=>{$(y.id),Q(y)},title:y.label,body:y.formatted_address,price:null},y.id)),o(Ve,{active:V==="new",onClick:()=>$("new"),title:"New address",body:null,price:null})]}),o(H,{label:"Address line 1",children:o("input",{type:"text",value:n,onChange:y=>r(y.target.value),className:G})}),o(H,{label:"Address line 2",children:o("input",{type:"text",value:a,onChange:y=>i(y.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:G})}),h(nr,{cols:"three",children:[o(H,{label:"City",children:o("input",{type:"text",value:s,onChange:y=>p(y.target.value),className:G})}),o(H,{label:F,children:o("input",{type:"text",value:u,onChange:y=>l(y.target.value),className:G})}),o(H,{label:"Country",separate:!0,children:o(it,{value:m,onChange:y=>d(y.target.value),className:G+" pr-10",style:Jn,children:t.map(y=>o("option",{value:y.code,children:y.name},y.code))})})]}),o(H,{label:q,separate:!0,children:E.length>0?h(it,{value:w,onChange:y=>k(y.target.value),className:G+" pr-10",style:Jn,children:[o("option",{value:"",children:"Select\u2026"}),E.map(y=>o("option",{value:y.code||y.name,children:y.name},y.code||y.name))]}):o("input",{type:"text",value:w,onChange:y=>k(y.target.value),className:G})})]}),o(H,{label:"Phone",children:o("input",{type:"tel",value:f,onChange:y=>g(y.target.value),className:G})}),!e&&R!==null&&V==="new"&&h(ge,{children:[o(wa,{checked:ue,onChange:he,label:"Save this address to my account"}),ue&&o(H,{label:"Address label",children:o("input",{type:"text",value:ie,onChange:y=>ve(y.target.value),placeholder:"Home",className:G})})]})]})}function Qn(){let{totals:e,coupon:t,deliveryOptions:n,shippingMethodId:r,setShippingMethodId:a,pickupLocation:i,formatMoney:s,city:p,destination:u,courierUnavailable:l,retryCourier:f}=ce();return o(Je,{num:"N\xB0 03",title:"Shipping",children:h("div",{className:"grid gap-3",children:[n.map(g=>{let m=g.pickupLocation,d=m?[m.address,m.city,m.state,m.zipCode].filter(Boolean).join(", "):null;return o(Ve,{active:r===g.id,onClick:()=>a(g.id),title:m?`${g.name} \u2014 ${m.name}`:g.name,body:m?[d,m.openingHours,m.instructions,g.description].filter(Boolean).join(" \xB7 "):g.description||null,price:e.freeShipping||g.amount===0?We:s(g.amount,e.currency),tag:g.tag||void 0},g.id)}),l?h("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[Hn," ",o("button",{type:"button",onClick:f,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 er(){let{payChoice:e,setPayChoice:t,placing:n,payment:r,payOptions:a,noPaymentMethod:i}=ce();return h(Je,{num:"N\xB0 04",title:"Payment",children:[i&&o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:Bn}),o("div",{className:"grid gap-3",children:a.map(s=>o(Ve,{active:e===s.key,onClick:()=>t(s.key),title:s.title,body:s.body,price:s.price,tag:s.tag},s.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 tr(){let{site:e,items:t,totals:n,coupon:r,formatMoney:a,payChoice:i,placing:s,email:p,orderError:u,payment:l,noPaymentMethod:f,placeOrder:g}=ce();return h("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:[h("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(re,{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?h("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",o(re,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):t.map(m=>o(Ea,{slug:m.slug,name:m.name,qty:m.qty,config:m.config,configSummary:Ra(m.config),price:zt(m,n.currency)??0,currency:n.currency},m.id))}),o("div",{className:"border-t border-line px-6 pt-5",children:o(Xt,{customerEmail:p})}),h("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[o(fe,{label:"Subtotal",value:a(n.subtotal,n.currency)}),n.discount>0&&r?.valid&&o(fe,{label:`Coupon \xB7 ${r.code}`,value:h("span",{className:"font-semibold text-green",children:["\u2212 ",a(n.discount,n.currency)]})}),r?.deferred&&o(fe,{label:`Coupon \xB7 ${r.code}`,value:jt}),r?.valid&&r.effects?.gift&&o(fe,{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:We})}),o(fe,{label:"Shipping",value:n.shippingStatus==="free"?o("span",{className:"font-semibold text-green",children:We}):Kt(n.shippingStatus)??a(n.shipping,n.currency)}),n.tax&&(n.tax.charged?o(fe,{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(fe,{label:n.tax.name,value:$t}):null)]}),h("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)})]}),h("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[u&&o("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),n.hasUnpricedLine&&h("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),o("button",{type:"button",onClick:g,disabled:s||f||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",t.length===0||s||f||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:s?h(ge,{children:["Building order\u2026 ",o("span",{children:"\xB7"})]}):f?h(ge,{children:["No online payment ",o("span",{children:"\xB7"})]}):n.repricing?h(ge,{children:["Updating total\u2026 ",o("span",{children:"\xB7"})]}):h(ge,{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 G="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",Jn={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 Je({num:e,title:t,children:n}){return h("section",{className:"mb-6 border border-line bg-bg",children:[h("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 nr({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 Ve({active:e,onClick:t,title:n,body:r,price:a,tag:i}){return h("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"})}),h("span",{className:"flex min-w-0 flex-col gap-1",children:[h("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 wa({checked:e,onChange:t,label:n,sub:r}){return h("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"})}),h("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 Ea({slug:e,name:t,qty:n,config:r,configSummary:a,price:i,currency:s}){let{catalog:p}=$e(),{formatMoney:u}=ae(),l=p.find(k=>k.slug===e),f=l?.spokes??5,g=l?.mesh??!1,m=r.find(k=>k.gold)?.label,d=l?.finishes.find(k=>k.name===m&&k.src)??l?.finishes.find(k=>k.src),w=l?.finishes[0]?.color??Jt;return h("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[h("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[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}),d?.src?o(Tt,{src:d.src,alt:`${t.lead}${t.accent} \u2014 ${d.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):o("div",{className:"block w-[78%]",style:{color:w},children:o(Vt,{spokes:f,mesh:g,className:"block w-full"})})]}),h("div",{className:"flex min-w-0 flex-col gap-0.5",children:[h("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:u(i,s)})]})}function fe({label:e,value:t}){return h("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 Ra(e){return e.map(t=>t.label).join(" \xB7 ")}import{Fragment as le,jsx as c,jsxs as x}from"react/jsx-runtime";function yt(e){return c(Vn,{...e,children:c(Ia,{})})}function Ia(){let{site:e,logo:t,items:n,placing:r,email:a,me:i,addressSaveNote:s,idemKey:p,confirmation:u,setConfirmation:l,payment:f,paypalStep:g,squareStep:m,pendingConf:d,paid:w,setPaid:k,payNote:E,afterpayConfirming:U,gocardlessConfirming:F,zipConfirming:q,klarnaConfirming:R,checkoutRootRef:W,setCheckoutHeaderEl:V}=ce();return u?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:w?"Payment received":"Order received"}),x("p",{className:"text-fg-dim",children:[w?x(le,{children:["Thank you \u2014 your payment for order"," ",c("span",{className:"font-mono text-fg",children:u.orderNumber})," has gone through."," "]}):x(le,{children:["Thank you \u2014 your order ",c("span",{className:"font-mono text-fg",children:u.orderNumber})," is being reviewed by our team."," "]}),i?x(le,{children:["Track it under"," ",c(re,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):c(le,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),E&&c("p",{className:"text-sm text-fg-dim",children:E}),s&&c("p",{className:"text-sm text-fg-dim",children:s}),!i&&x("p",{className:"text-sm text-fg-dim",children:["You can also"," ",c(re,{href:`/track?order=${encodeURIComponent(u.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),c(re,{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"})]}):U?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):F?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):q?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):R?x("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[c("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):f?c(Aa,{payment:f,onPaid:()=>{k(!0),l(d)},onSkip:()=>l(d)}):g&&d?c(Ta,{confirmation:d,clientId:e.paypalClientId??"",idemKey:p,onPaid:()=>{k(!0),l(d)},onSkip:()=>l(d)}):m&&d?c(_a,{confirmation:d,applicationId:e.squareApplicationId??"",locationId:e.squareLocationId??"",environment:e.squareEnvironment??"production",idemKey:p,onPaid:()=>{k(!0),l(d)},onSkip:()=>l(d)}):x("div",{ref:W,className:"bg-bg text-fg",children:[x("header",{ref:V,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:[x(re,{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",c("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),c(re,{href:"/","aria-label":`${e.name} home`,className:"inline-flex items-center justify-center",children:c(Gt,{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?x("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[c("span",{className:"text-green",children:"\u25CF"}),c("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):c("span",{})]}),x("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:[c("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),c("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($=>x("span",{className:["relative flex items-center gap-2 transition-colors",$.state==="pending"?"text-fg-dim":"text-fg",$.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[c("span",{className:$.state==="done"?"text-accent font-bold":"",children:$.n}),c("span",{children:$.label})]},$.n))})]}),x("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:[x("div",{children:[c(Xn,{}),c(Zn,{}),c(Qn,{}),c(er,{})]}),c(tr,{})]}),c("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:c("span",{children:Ht({legalName:e.legalName,foundedYear:e.foundedYear,siteName:e.name})})})]})}function Aa({payment:e,onPaid:t,onSkip:n}){let{formatMoney:r}=ae(),a=rr(()=>An(e.publishableKey),[e.publishableKey]),i=rr(()=>{if(typeof document>"u")return;let s=getComputedStyle(document.documentElement),p=(l,f)=>s.getPropertyValue(l).trim()||f,u=document.documentElement.getAttribute("data-theme")!=="light";return{theme:u?"night":"stripe",variables:{colorPrimary:p("--accent",u?"#c9a461":"#8a6a2a"),colorBackground:p("--site-surface",u?"#131313":"#ffffff"),colorText:p("--fg",u?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("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}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[x("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",c("span",{className:"text-fg",children:r(Number(e.amount),e.currency)})," ","by card to confirm it now."]}),c(ut,{stripe:a,options:{clientSecret:e.clientSecret,appearance:i},children:c(Oa,{payment:e,onPaid:t,onSkip:n})})]})]})})}function Oa({payment:e,onPaid:t,onSkip:n}){let{formatMoney:r}=ae(),a=kn(),i=xn(),[s,p]=ye(!1),[u,l]=ye(null);async function f(){if(!a||!i||s)return;p(!0),l(null);let g=await a.confirmPayment({elements:i,redirect:"if_required"});if(g.error){l(g.error.message??"Payment failed. Please try again."),p(!1);return}let m=g.paymentIntent?.status;if(m==="succeeded"||m==="processing"){t();return}l("Payment did not complete. Please try again."),p(!1)}return x("div",{className:"flex flex-col gap-4",children:[c(Sn,{}),u&&c("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),c("button",{type:"button",onClick:f,disabled:!a||!i||s,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!a||!i||s?"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:s?x(le,{children:["Processing\u2026 ",c("span",{children:"\xB7"})]}):x(le,{children:["Pay ",r(Number(e.amount),e.currency),c("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),c("button",{type:"button",onClick:n,disabled:s,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 ar="paypal-sdk-js",ft=null;function La(e,t){let n=`${e}|${t}`;if(ft?.key===n)return ft.promise;let r=new Promise((a,i)=>{document.getElementById(ar)?.remove();let s=document.createElement("script");s.id=ar;let p=new URLSearchParams({"client-id":e,currency:t,intent:"capture"});s.src=`https://www.paypal.com/sdk/js?${p}`,s.onload=()=>{let u=window.paypal;u?a(u):i(new Error("PayPal SDK loaded without its namespace"))},s.onerror=()=>i(new Error("PayPal SDK failed to load")),document.head.appendChild(s)});return ft={key:n,promise:r},r}function Ta({confirmation:e,clientId:t,idemKey:n,onPaid:r,onSkip:a}){let{formatMoney:i}=ae(),s=je(null),[p,u]=ye(!1),[l,f]=ye(null),g=je(r);return g.current=r,ir(()=>{let m=!1,d=null;return La(t,e.currency).then(w=>{if(!(m||!s.current))return d=w.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await D.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async k=>{try{if((await D.capturePaypalOrder({idempotencyKey:n,paypalOrderId:k.orderID})).status==="paid"){g.current();return}f("PayPal did not complete the payment. Please try again.")}catch(E){f(E instanceof Le?E.message:"PayPal payment failed. Please try again.")}},onError:()=>{f("PayPal could not process the payment. Please try again.")}}),d.render(s.current).then(()=>{m||u(!0)})}).catch(()=>{m||f("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{m=!0,d?.close?.()}},[t,e.currency,n]),c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("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}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[x("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",c("span",{className:"text-fg",children:i(Number(e.grandTotal),e.currency)})," ","with PayPal to confirm it now."]}),!p&&!l&&c("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),c("div",{ref:s}),l&&c("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:l}),c("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 or="square-web-sdk",gt=null;function qa(e){let t=e==="sandbox"?"sandbox":"production";if(gt?.key===t)return gt.promise;let n=new Promise((r,a)=>{document.getElementById(or)?.remove();let i=document.createElement("script");i.id=or,i.src=t==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",i.onload=()=>{let s=window.Square;s?r(s):a(new Error("Square SDK loaded without its namespace"))},i.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(i)});return gt={key:t,promise:n},n}function _a({confirmation:e,applicationId:t,locationId:n,environment:r,idemKey:a,onPaid:i,onSkip:s}){let{formatMoney:p}=ae(),u=je(null),l=je(null),f=je(null),[g,m]=ye(!1),[d,w]=ye(!1),[k,E]=ye(null);ir(()=>{let F=!1,q=null;return qa(r).then(async R=>{if(F||!u.current)return;let W=R.payments(t,n);f.current=W,q=await W.card(),await q.attach(u.current),l.current=q,F||m(!0)}).catch(()=>{F||E("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{F=!0,q?.destroy?.()}},[t,n,r]);async function U(){let F=l.current;if(!(!F||d)){w(!0),E(null);try{let q=await F.tokenize();if(q.status!=="OK"||!q.token){E(q.errors?.[0]?.message??"Please check the card details and try again."),w(!1);return}let R;try{R=(await f.current?.verifyBuyer?.(q.token,{amount:String(e.grandTotal),currencyCode:e.currency,intent:"CHARGE"}))?.token}catch{}if((await D.chargeSquare({idempotencyKey:a,sourceId:q.token,...R?{verificationToken:R}:{}})).status==="paid"){i();return}E("Square did not complete the payment. Please try again.")}catch(q){E(q instanceof Le?q.message:"Square payment failed. Please try again.")}w(!1)}}return c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:x("div",{className:"w-full max-w-xl border border-line bg-bg",children:[x("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[c("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}),c("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),x("div",{className:"flex flex-col gap-4 px-6 py-6",children:[x("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",c("span",{className:"text-fg",children:p(Number(e.grandTotal),e.currency)})," ","by card to confirm it now."]}),!g&&!k&&c("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),c("div",{ref:u}),k&&c("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),c("button",{type:"button",onClick:U,disabled:!g||d,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!g||d?"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:d?x(le,{children:["Processing\u2026 ",c("span",{children:"\xB7"})]}):x(le,{children:["Pay ",p(Number(e.grandTotal),e.currency),c("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),c("button",{type:"button",onClick:s,disabled:d,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 Xe}from"react/jsx-runtime";function ja(){let{settings:e,websiteName:t}=qt(),n=t?{...ot,name:t}:ot,r=e?{url:e.logoUrl,reversed:e.logoReversed??null,inkIsDark:e.logoInkIsDark??null,reverse:e.reverseLogo,size:e.logoSize,sizePx:e.logoSizePx}:null;return Xe("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:Xe(Yt,{children:Xe(Bt,{preview:!0,children:Xe(yt,{site:n,logo:r,preview:!0})})})})}export{ja as default};
@@ -1 +1 @@
1
- "use client";import{hi as r}from"./chunk-XF2ZAVNU.js";import"./chunk-RPLNV3WM.js";import"./chunk-SQH6XBRG.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};
1
+ "use client";import{fj as r}from"./chunk-WPHE7RI4.js";import"./chunk-3TBLX25X.js";import"./chunk-SJODSVWU.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};
@@ -0,0 +1 @@
1
+ import{jsx as we}from"react/jsx-runtime";import{createContext as gn,useCallback as r,useContext as fn,useMemo as mn,useState as Le}from"react";import{createContext as de,useContext as R}from"react";import{createContext as Tt}from"react";var ce=Tt(null);var At=de(null),M=de({logo:null,placeholder:!1,wordmark:null});function Mn(){let e=R(ce),t=R(At),n=R(M),a=!e&&n.placeholder,o=e?e.logoUrl:n.logo?.logoUrl??t?.logoUrl??null;return{src:a?null:o,reversedSrc:e?e.logoReversed:n.logo?.logoReversed??t?.logoReversed??null,inkIsDark:e?e.logoInkIsDark:n.logo?.logoInkIsDark??t?.logoInkIsDark??null,wordmark:e?null:n.wordmark,siteName:e?.siteName??t?.siteName}}import{useSelectHandler as Sn}from"efficient-easel/draw/client";import{contrastRatio as Fn,hexToRgb as N,readableInk as Ct,relativeLuminance as wt}from"efficient-shell/format";var Nn="storefront-theme",vn="sf:theme-mode",Gn="sf:theme-switch",Bn="hide",v="light",G=!1,Lt=7,kt=18;function It(e){return e>=Lt&&e<kt}function Un(e){let{mode:t,override:n,switchShown:a,hour:o}=e;return a&&(n==="light"||n==="dark")?n:t==="auto"?It(o)?"light":"dark":t==="light"?"light":"dark"}var h={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},Ot=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],k={selected:0,themes:Ot};function ue(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...k}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function D(e,t,n){let a=N(e),o=N(t);if(a===null||o===null)return e;let i=(l,d)=>Math.max(0,Math.min(255,Math.round(l+(d-l)*n))).toString(16).padStart(2,"0");return`#${i(a.r,o.r)}${i(a.g,o.g)}${i(a.b,o.b)}`}var Ht={light:"#ffffff",dark:"#0a0a0a"},Wn=["light","dark"];function $n(e,t){let n=Ht[t],a=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:D(e,a,.1),line:D(e,a,.22),muted:D(n,e,.35),brandInk:t}}function E(e){let t=ue(e);return t.themes[t.selected]}function he(e){return{text:e.text,accent:e.accent,background:e.background||h.background,surface:e.surface||h.surface,line:e.line||h.line,muted:e.muted||h.muted}}var xt=.4,Rt=4.5,Mt=3,zn={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Vn(e){return e>=Rt?"good":e>=Mt?"large-only":"hard"}var Dt=["#000000","#ffffff"];function I(e){return Ct(e,Dt)}var Pt=[.25,.4,.55];function Yn(e){let t=N(e);return t===null?[]:Pt.map(n=>"#"+[t.r,t.g,t.b].map(a=>Math.round(a*(1-n)).toString(16).padStart(2,"0")).join(""))}function Xn(e){let t=E(e),n={"--theme-fg":t.text},a=wt(t.text);return(a===null||a>=xt)&&(n["--overlay-fg"]=t.text),n}var Ft=82;function B(e){return`color-mix(in srgb, ${e} ${Ft}%, #000)`}function jn(e){let t=E(e);return{"--theme-accent":t.accent,"--theme-accent-2":B(t.accent),"--theme-accent-ink":I(t.accent)}}function U(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function qn(e){let t=E(e),n=U(t),a=ge(t);if(n===null&&a===null)return{};let o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=B(n)),o["--theme-btn-ink"]=a??I(n),o}function ge(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Nt(e,t){return ge(e)??I(U(e)??t)}function Kn(e){let t=E(e);return{fill:U(t)??t.accent.toLowerCase(),ink:Nt(t,t.accent)}}function Zn(e){let t={};return ue(e).themes.forEach((n,a)=>{let o=he(n);t[`--theme-preset-${a}-accent`]=o.accent,t[`--theme-preset-${a}-accent-2`]=B(o.accent),t[`--theme-preset-${a}-accent-ink`]=I(o.accent),t[`--theme-preset-${a}-bg`]=o.background,t[`--theme-preset-${a}-fg`]=o.text,t[`--theme-preset-${a}-surface`]=o.surface,t[`--theme-preset-${a}-surface-2`]=`color-mix(in srgb, ${o.surface} 60%, ${o.line})`,t[`--theme-preset-${a}-line`]=o.line,t[`--theme-preset-${a}-muted`]=o.muted}),t}var Jn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Qn(e){let t=he(E(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,a={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==h.surface||t.line!==h.line)&&(a["--theme-surface-2"]=n),a}var vt=["heading","body","label"];function ea(e){if(!e)return null;for(let t of vt)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var fe=["headingLarge","headingMedium","headingSmall","accent","body","label"];var W={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},Gt=8,Bt=200;function Ut(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=Gt&&t<=Bt?t:null}function Wt(e){let t={};for(let n of fe)t[n]=Ut(e?.[n]);return t}function ta(e){let t=Wt(e),n={};for(let a of fe){let o=t[a];o!==null&&(n[`--size-${a}`]=`${o}px`)}return n}var $t=["square","small","large"],zt="small";function na(e){return $t.includes(e??"")?e:zt}var me=0,Vt=40,aa={square:0,small:null,large:16},Yt={"--sf-card-radius":1,"--sf-button-radius":.5,"--site-radius":.5,"--site-radius-xs":.25,"--site-radius-sm":.5,"--site-radius-md":.75,"--site-radius-lg":1,"--site-radius-xl":1.25,"--site-radius-2xl":1.5,"--site-radius-3xl":2,"--site-radius-4xl":2.5};function Se(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(Vt,Math.max(me,Math.round(t))):null}function Xt(e){let t=Se(e);return t===null?{}:Object.fromEntries(Object.entries(Yt).map(([n,a])=>{let o=t*a/16;return[n,o===0?"0":`${o}rem`]}))}function oa(e){return Xt(Se(e)??me)}var jt=["none","soft","lifted"],qt="soft",pe="none",Kt=["tight","normal","roomy"],Zt="normal",O="normal",Jt=["none","lift","highlight"],Qt="lift",en="highlight",_e="#141416";function ye(e){return jt.includes(e??"")?e:qt}function tn(e){return Kt.includes(e??"")?e:Zt}function Ee(e){return Jt.includes(e??"")?e:Qt}function nn(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():_e}function sa(e){let t=ye(e);return t===pe?void 0:t}function ra(e){let t=tn(e);return t===O?void 0:t}function ia(e){let t=Ee(e);return t===en?void 0:t}function la(e,t,n){let a=nn(t);return a===_e?{}:ye(e)!==pe||Ee(n)==="lift"?{"--sf-shadow-color":a}:{}}var an=["normal","tight","compressed"],b="normal";function be(e){return an.includes(e??"")?e:b}function ca(e){let t=be(e);return t===b?void 0:t}function da(e){switch(be(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var $={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},P=100,F=900,on=24,sn=200;function L(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function Te(e){let t=L(e?.weight,P,F),n=e?.case==="sentence"?"sentence":"authored",a=i=>i==null?t:L(i,P,F),o=i=>i==="sentence"?"sentence":i==="authored"?"authored":n;return{case:n,weight:t,weightStrong:L(e?.weightStrong,P,F),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:L(e?.maxPx,on,sn),weight2:a(e?.weight2),weight3:a(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function ua(e){let t=Te(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function ha(e){return Te({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,italicStrong:e?.accent_italic,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}var Ae=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"assistant",label:"Assistant",cssVar:"--font-assistant",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],f=new Map(Ae.map(e=>[e.key,e]));function fa(e){return f.get(e)}var Ce=["heading","heading2","heading3","body","accent","label"],ma={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},rn=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],ln=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,Sa={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},cn={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function pa(e){let t=e?ln.exec(e):null;return t?cn[t[1]]??null:dn(e)}function dn(e){if(!e)return null;let t=e.split(/\s+/).filter(n=>!n.slice(0,n.lastIndexOf(":")+1).includes("&")).map(n=>n.slice(n.lastIndexOf(":")+1));for(let[n,a]of rn)if(t.includes(n))return a;return null}var u={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function un(e){let t=n=>{let a=e?.[n];if(a&&f.has(a))return a;if(n==="heading2"||n==="heading3"){let o=e?.heading;return o&&f.has(o)?o:u.heading}return u[n]};return Object.fromEntries(Ce.map(n=>[n,t(n)]))}function hn(e,t){return f.get(e[t])??f.get(u[t])}function g(e,t){return`var(${hn(e,t).cssVar})`}var _a=[...new Set(Ce.map(e=>f.get(u[e]).cssVar))],ya=[...new Set(Ae.map(e=>e.cssVar))];function Ea(e){let t=un(e);return{"--font-role-heading":g(t,"heading"),"--font-role-heading2":g(t,"heading2"),"--font-role-heading3":g(t,"heading3"),"--font-role-body":g(t,"body"),"--font-role-accent":g(t,"accent"),"--font-role-label":g(t,"label"),fontFamily:"var(--font-role-body)"}}var ke=gn({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:v,setThemeMode:()=>{},themeSwitchShown:G,setThemeSwitchShown:()=>{},theme:k,setTheme:()=>{},fonts:u,setFonts:()=>{},sizes:W,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:O,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:b,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:$,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},sectionBackgroundWidth:null,setSectionBackgroundWidth:()=>{},sectionContentWidth:null,setSectionContentWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function Ia({children:e,websiteName:t=null,templateChrome:n=!1,templateName:a=null,chromePlaceholder:o=!1,themeMode:i=v,onThemeModeChange:l,themeSwitchShown:d=G,onThemeSwitchShownChange:T,theme:A=k,onThemeChange:m,fonts:S=u,onFontsChange:p,sizes:_=W,onSizesChange:c,cornerRadiusPx:H=null,onCornerRadiusPxChange:C,cardShadow:x=null,onCardShadowChange:w,shadowColor:Re=null,onShadowColorChange:z,cardGap:Me=O,onCardGapChange:V,hoverEffect:De=null,onHoverEffectChange:Y,headingCompression:Pe=b,onHeadingCompressionChange:X,siteWidth:Fe=null,onSiteWidthChange:j,siteGutter:Ne=null,blockGap:ve=null,onSiteGutterChange:q,onBlockGapChange:K,headingTypography:Ge=$,onHeadingTypographyChange:Z,textStyles:Be=null,onTextStylesChange:J,wordStyles:Ue=null,heroBackgroundFollowsWidth:We=null,onHeroBackgroundFollowsWidthChange:Q,sectionBackgroundWidth:$e=null,onSectionBackgroundWidthChange:ee,sectionContentWidth:ze=null,onSectionContentWidthChange:te,photographyGrayscale:Ve=null,onPhotographyGrayscaleChange:ne,shareButtonOnPosts:Ye=null,onShareButtonOnPostsChange:ae,themeFromDocument:Xe=!1}){let[y,oe]=Le(null),je=r(s=>oe(bt=>bt??s),[]),[qe,Ke]=Le(!1),Ze=r(s=>l?.(s),[l]),Je=r(s=>T?.(s),[T]),Qe=r(s=>m?.(s),[m]),et=r(s=>p?.(s),[p]),tt=r(s=>c?.(s),[c]),nt=r(s=>j?.(s),[j]),at=r(s=>q?.(s),[q]),ot=r(s=>K?.(s),[K]),st=r(s=>Q?.(s),[Q]),rt=r(s=>ee?.(s),[ee]),it=r(s=>te?.(s),[te]),lt=r(s=>ne?.(s),[ne]),ct=r(s=>ae?.(s),[ae]),dt=r(s=>C?.(s),[C]),ut=r(s=>w?.(s),[w]),ht=r(s=>z?.(s),[z]),gt=r(s=>V?.(s),[V]),ft=r(s=>Y?.(s),[Y]),mt=r(s=>X?.(s),[X]),St=r(s=>Z?.(s),[Z]),pt=r(s=>J?.(s),[J]),{select:_t,setSelectHandler:yt}=Sn(),se=y?.logoUrl,re=y?.logoReversed,ie=y?.logoInkIsDark,le=y!==null,Et=mn(()=>({logo:le?{logoUrl:se,logoReversed:re,logoInkIsDark:ie}:null,placeholder:n||o,wordmark:n?a:t}),[le,se,re,ie,n,o,a,t]);return we(M.Provider,{value:Et,children:we(ke.Provider,{value:{settings:y,setSettings:oe,primeSettings:je,websiteName:t,templateChrome:n,templateName:a,chromePlaceholder:o,themeMode:i,setThemeMode:Ze,themeSwitchShown:d,setThemeSwitchShown:Je,theme:A,setTheme:Qe,fonts:S,setFonts:et,sizes:_,setSizes:tt,cornerRadiusPx:H,setCornerRadiusPx:dt,cardShadow:x,setCardShadow:ut,shadowColor:Re,setShadowColor:ht,cardGap:Me,setCardGap:gt,hoverEffect:De,setHoverEffect:ft,headingCompression:Pe,setHeadingCompression:mt,siteWidth:Fe,setSiteWidth:nt,siteGutter:Ne,blockGap:ve,setSiteGutter:at,setBlockGap:ot,headingTypography:Ge,setHeadingTypography:St,textStyles:Be,setTextStyles:pt,wordStyles:Ue,heroBackgroundFollowsWidth:We,setHeroBackgroundFollowsWidth:st,sectionBackgroundWidth:$e,setSectionBackgroundWidth:rt,sectionContentWidth:ze,setSectionContentWidth:it,photographyGrayscale:Ve,setPhotographyGrayscale:lt,shareButtonOnPosts:Ye,setShareButtonOnPosts:ct,themeFromDocument:Xe,selected:qe,setSelected:Ke,select:_t,setSelectHandler:yt},children:e})})}var Oa=()=>fn(ke);import{forwardRef as pn}from"react";import{jsx as En}from"react/jsx-runtime";function _n(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",n=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${n}`}var yn=pn(function({href:t,prefetch:n,replace:a,scroll:o,shallow:i,legacyBehavior:l,passHref:d,locale:T,onClick:A,children:m,...S},p){let _=c=>{A?.(c),!(c.defaultPrevented||S.target==="_blank")&&c.preventDefault()};return En("a",{ref:p,href:_n(t),onClick:_,...S,children:m})}),Ra=yn;var bn="Website";function Pa(e){return e?.trim()||bn}var Ie=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],Tn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},An={};function Na(e){if(!e||typeof e!="object")return An;let t={};for(let n of Ie){let a=e[n];if(typeof a!="string")continue;let o=a.trim();!o||!/^https?:\/\//i.test(o)||(t[n]=o)}return t}function va(e){return Ie.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:Tn[t]}]:[]})}var Ga=e=>`${e}_url`;import{forwardRef as Cn}from"react";import{imageCopyUrl as Oe,imageSrcSet as He}from"efficient-shell/image-copies";import{jsx as kn}from"react/jsx-runtime";var wn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"};function xe(e,t,n){if(n){let a=He(e);return a?{src:Oe(e,1280),srcSet:a,sizes:n}:{src:e,sizes:n}}if(t&&t>0){let a=He(e,{maxWidth:t*3});return a?{src:Oe(e,t*2),srcSet:a,sizes:`${t}px`}:{src:e}}return{src:e}}var Ln=Cn(function({src:t,width:n,height:a,fill:o,priority:i,loading:l,style:d,quality:T,placeholder:A,blurDataURL:m,unoptimized:S,loader:p,overrideSrc:_,sizes:c,...H},C){let x=_??(typeof t=="string"?t:t.src),w=xe(x,o?void 0:Number(n)||void 0,c??(o?"100vw":void 0));return kn("img",{ref:C,...w,width:o?void 0:n,height:o?void 0:a,loading:i?"eager":l??"lazy",fetchPriority:i?"high":void 0,decoding:"async",style:o?{...wn,...d}:{color:"transparent",...d},...H})}),$a=Ln;function za(e){let t=e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),n=e.fill?void 0:Number(e.width)||void 0;return{props:xe(t,n,e.sizes??(e.fill?"100vw":void 0))}}var Xa={small:54,medium:66,large:84},In=44,ja=16,qa=140,Ka=In*4;export{$a as a,za as b,Ra as c,Ae as d,fa as e,Ce as f,ma as g,Sa as h,pa as i,dn as j,u as k,un as l,Ea as m,Fn as n,Nn as o,vn as p,Gn as q,Bn as r,v as s,G as t,Un as u,h as v,Ot as w,ue as x,Wn as y,$n as z,E as A,he as B,zn as C,Vn as D,I as E,Yn as F,Xn as G,jn as H,U as I,qn as J,ge as K,Nt as L,Kn as M,Zn as N,Jn as O,Qn as P,ea as Q,W as R,Wt as S,ta as T,na as U,me as V,Vt as W,aa as X,Se as Y,Xt as Z,oa as _,jt as $,qt as aa,pe as ba,O as ca,Jt as da,Qt as ea,en as fa,_e as ga,ye as ha,tn as ia,Ee as ja,nn as ka,sa as la,ra as ma,ia as na,la as oa,b as pa,be as qa,ca as ra,da as sa,$ as ta,Te as ua,ua as va,ha as wa,ce as xa,Mn as ya,Ia as za,Oa as Aa,bn as Ba,Pa as Ca,Ie as Da,Tn as Ea,An as Fa,Na as Ga,va as Ha,Ga as Ia,Xa as Ja,In as Ka,ja as La,qa as Ma,Ka as Na};
@@ -0,0 +1 @@
1
+ import{f as gt,i as me,q as ht,s as yt,t as bt,v as q}from"./chunk-K26JUDGZ.js";import{Ba as pe,Ca as pt,Fa as Be,Ga as mt,Ja as We,Ka as qe}from"./chunk-3TBLX25X.js";import{j as ft,l as oe}from"./chunk-SJODSVWU.js";import{createContext as mn,useContext as Et,useEffect as gn,useMemo as he,useState as St}from"react";function Ct(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function ie(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Ge=4,Ir=1,kr={unit:"set",spares:0,spareSide:"left"};function xt(e){return e.unit==="single"?1:Ge+e.spares}function Ar(e,t){return[{partNumber:e.partNumber,wheels:xt(t),prices:e.prices}]}function Tr(e,t){let n=xt(t)-Ge;if(n<=0||e.length===0)return e;let r=fn(e),o=r?r[t.spareSide]:0;return e.map((i,a)=>a===o?{...i,wheels:i.wheels+n}:i)}function fn(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function pn(e,t){return t.spares>0?`${e} + spare`:e}function Or(e){return e.unit==="single"?"Single":pn(`Set of ${Ge}`,e)}var Mr="data-add-to-basket",Ke=9,Re="en";function ge(e,t,n=0){return new Intl.NumberFormat(Re,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}function Dr(e,t){return new Intl.NumberFormat(Re,{style:"currency",currency:t}).format(e)}import{jsx as Cn}from"react/jsx-runtime";var hn="storefront-country",vt=hn,ze=mn(null);function yn(e){return Pt(e,"catalogue")}function bn(e){return Pt(e,"money")}function Pt(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let a=r.get(i);if(!a){let l=n.get(i)??0;a=new Intl.NumberFormat(Re,{style:"currency",currency:i,minimumFractionDigits:t==="money"?l:0,maximumFractionDigits:l}),r.set(i,a)}return a.format(o)}}function Br({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=he(()=>t??[],[t]),a=he(()=>n??[],[n]),l=he(()=>r||i.find(h=>h.isDefault)?.code||i[0]?.code||"",[r,i]),c=he(()=>o||a.find(h=>h.isDefault)?.code||a[0]?.code||"",[o,a]),[u,p]=St(c),[d,S]=St(!1);gn(()=>{let h=oe.getItem(vt);h&&a.some(w=>w.code===h)&&p(h),S(!0)},[a]);function L(h){p(h),oe.setItem(vt,h)}let y=he(()=>{let h=a.find(v=>v.code===u)??null,w=h?.currency,T=w&&i.some(v=>v.code===w)?w:l,O=yn(i),k=bn(i);return{country:u,currency:T,setCountry:L,currencies:i,countries:a,activeCountry:h,formatPrice:(v,b)=>O(v,b??T),formatMoney:(v,b)=>k(v,b??T),ready:d}},[u,i,a,l,d]);return Cn(ze.Provider,{value:y,children:e})}function wt(){let e=Et(ze);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}function Wr(){return Et(ze)?.country??""}import{createContext as On,useCallback as N,useContext as Mn,useEffect as ee,useMemo as Ut,useRef as ke,useState as R}from"react";function Nt(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var Rt="We'll confirm this discount when you place your order.",zr="Confirmed at checkout";function Xr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var _t="coupon_code: ";function Vr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(_t)?null:e.message.slice(_t.length)}function Lt(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Le="Price on request",Sn="Request a quote",vn="from ",Zr="From ",Jr="each",It="Free";function Xe(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ve(e,t){let n=e?.[t];return Xe(n)?n:null}function eo(e,t,n,r){let o=Ve(e,n),i=Ve(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function to(e,t,n,r){if(n==null&&r==null)return!0;let o=Ve(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var En={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Pn(e,t,n){if(!Xe(e))return En;let r=Xe(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function no(e,t,n=""){return!e.priced||e.unit==null?Le:`${n}${ge(e.unit,t)}`}function ro(e,t){return e.was==null?null:ge(e.was,t)}function wn(e,t,n=1){let r=ie(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((a,l)=>a+l.wheels,0),i=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var _n={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function oo(e,t,n,r=1){let o=Pn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let a=wn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:i}:{..._n,fromSetTotal:i}}function Nn(e,t){return!e.priced||e.unit==null?Le:`${e.isFrom?vn:""}${ge(e.unit,t)}`}function io(e,t){return e.was==null?null:ge(e.was,t)}function ao(e,t){return!e.priced||e.unit==null?Sn:Nn(e,t)}var Rn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function kt(e){return Rn.test(e.trim())}var At="sf:ga-purchases",Ln=20;function Ot(){return typeof window>"u"||window.parent!==window}function ye(...e){try{if(Ot()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function In(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:ie(e.components,t)??0,quantity:e.qty}}function Ye(e,t){return e.filter(Ie).map(n=>In(n,t))}function po(e){ye("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function Mt(e,t){let n=Ye([e],t);n.length!==0&&ye("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function mo(e){let t=Ye(e.lines,e.currency);t.length!==0&&ye("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Tt=new Set;function kn(e){if(Tt.has(e))return!1;Tt.add(e);try{let t=JSON.parse(oe.getItem(At)??"[]");if(t.includes(e))return!1;oe.setItem(At,JSON.stringify([...t,e].slice(-Ln)))}catch{}return!0}function go(e){let t=e.confirmation;if(Ot()||!kn(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ye("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Ye(e.lines,n)}),e.adsSendTo&&ye("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var An="Arranged after review",Dt="Calculated at checkout",Tn=Dt,bo=Dt;function Ft({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function Co(e){switch(e){case"arranged":return An;case"pending":return Tn;case"free":return It;case"charged":return null}}import{jsx as Hn}from"react/jsx-runtime";var Dn=400,Fn=400,Un=1500;function Ie(e){return(e.components?.length??0)>0}function Ht(e,t){return{code:e,valid:t.valid,deferred:Nt(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Bt(e,t){return ie(e.components,t)}function Qe(e,t){let n=Bt(e,t);return n===null?null:n*e.qty}function $t(e){return e!=="tyre"}var Wt=On(null);function ko({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=wt(),[i,a]=R(t),[l,c]=R([]),[u,p]=R([]),[d,S]=R([]),[L,y]=R(!1),[h,w]=R(!1),[T,O]=R(!1),[k,v]=R(!1),[b,G]=R(null),[M,K]=R(0),C=N(()=>K(s=>s+1),[]),[_,E]=R(void 0),[z,se]=R(null),[x,H]=R(null),[ve,X]=R(!1),[D,le]=R(null),V=ke(void 0),Y=N(()=>a(!0),[]),$=N(()=>a(!1),[]),Ee=N(()=>a(s=>!s),[]);ee(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&Y()},[Y,t]);let F=N(s=>{se(f=>f?.country===s?.country&&f?.subdivision===s?.subdivision&&f?.postcode===s?.postcode?f:s)},[]),Pe=N(s=>{v(!0),$t(s)&&O(!0)},[]),te=T||l.some(s=>$t(s.kind)),ue=k||l.length>0;ee(()=>{if(t||!te||L)return;let s=!0;return q.listWheels().then(f=>{s&&(p(f),y(!0))}),()=>{s=!1}},[t,te,L]),ee(()=>{if(t||!ue||h)return;let s=!0;return q.listBundles().then(f=>{s&&(S(f),w(!0))}),()=>{s=!1}},[t,ue,h]);let B=b?.deliveryOptions??[],ce=b?.courier??null;ee(()=>{b&&le(s=>s&&B.some(f=>f.id===s)?s:B[0]?.id??null)},[b]);let Z=N(()=>l.filter(Ie).flatMap(s=>Ct(s.components,s.qty)),[l]),ne=N(async(s,f)=>{let g=s.trim().toUpperCase();if(!g)return;let m=Z();if(m.length===0){H({code:g,valid:!1,message:"Add a wheel to the cart first."});return}X(!0),V.current=f;try{let I=await q.validateCoupon({code:g,items:m,currency:n,shippingMethodId:D??void 0,customerEmail:f});H(Ht(g,I))}catch{H({code:g,valid:!1,message:"Could not check that code. Please try again."})}finally{X(!1)}},[Z,n,D]),we=N(()=>{H(null),V.current=void 0},[]),_e=N(s=>{if(!x)return;let{code:f}=x;H(g=>g&&g.code===f?{code:f,valid:!1,refused:!0,message:s}:g)},[x]);ee(()=>{if(!x||x.refused)return;let s=x.code,f=m=>m!==null&&m.code===s&&!m.refused,g=setTimeout(async()=>{let m=Z();if(m.length===0){H(I=>f(I)?{code:s,valid:!1,message:"Add a wheel to the cart first."}:I);return}X(!0);try{let I=await q.validateCoupon({code:s,items:m,currency:n,shippingMethodId:D??void 0,customerEmail:V.current});H(fe=>f(fe)?Ht(s,I):fe)}catch{}finally{X(!1)}},Dn);return()=>clearTimeout(g)},[l,n,D]);let P=x&&!x.refused?x.code:void 0;ee(()=>{if(t)return;let s=!0,f=setTimeout(async()=>{let g=Z();if(g.length===0){G(null),E(void 0);return}try{let m=await q.quoteCart({items:g,currency:n,shippingMethodId:D??void 0,couponCode:P,customerEmail:V.current||void 0,country:z?.country||r||void 0,subdivision:z?.country&&z.subdivision||void 0,postcode:z?.country&&z.postcode||void 0});if(!s)return;G(m)}catch{if(!s)return}E(P)},Fn);return()=>{s=!1,clearTimeout(f)}},[l,n,D,P,r,z,M]);let U=N(s=>{c(f=>{let g=f.findIndex(m=>m.id===s.id);return g===-1?[...f,s]:f.map((m,I)=>I===g?{...m,qty:Math.min(Ke,m.qty+s.qty)}:m)}),Mt(s,n)},[n]),J=N(s=>{c(f=>f.filter(g=>g.id!==s))},[]),rt=N((s,f)=>{let g=Math.max(1,Math.min(Ke,f));c(m=>m.map(I=>I.id===s?{...I,qty:g}:I))},[]),ot=N(s=>{c(s)},[]),[de,on]=R(null),it=ke(null);it.current=de;let W=ke(null),Ue=ke(""),at=N((s,f)=>{let g=s.trim().toLowerCase();kt(g)&&on(m=>m&&m.email===g&&m.firstName===(f??"")?m:{email:g,firstName:f??""})},[]);ee(()=>{if(t||!de)return;let s=Lt(l.filter(Ie),m=>Qe(m,n)===null?Le:o(Qe(m,n),n)),f={email:de.email,firstName:de.firstName,currency:n,items:s},g=JSON.stringify(f);if(g!==Ue.current)return W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{W.current=null,Ue.current=g,q.captureCart(f).catch(m=>{})},Un),()=>{W.current&&(clearTimeout(W.current),W.current=null)}},[l,de,n,t]);let st=N(()=>{W.current&&(clearTimeout(W.current),W.current=null);let s=it.current;s&&(Ue.current="",q.captureCart({email:s.email,firstName:s.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),lt=Ut(()=>{let s=l.reduce((A,re)=>{let Ne=Qe(re,n);return Ne===null?A:A+Ne},0),f=l.some(A=>Bt(A,n)===null),g=l.reduce((A,re)=>A+re.qty,0),m=x?.valid?x.effects:void 0,I=m?Math.min(s,Number(m.discountAmount)):0,fe=b?.bundleDiscount??0,sn=b?.appliedBundles??[],He=!!m?.freeShipping,ct=B.find(A=>A.id===D),dt=He?0:b?.shipping??ct?.amount??0,ln=Ft({quoted:b!==null,optionCount:B.length,chosenAmount:ct?.amount,couponWaivesFreight:He}),$e={};for(let A of m?.freeUnits??[])$e[A.partNumber]=($e[A.partNumber]??0)+A.quantity;let un=b?.tax??null,cn=b?b.grandTotal:s-I-fe+dt;return{sets:g,units:l.reduce((A,re)=>A+(re.components??[]).reduce((Ne,dn)=>Ne+dn.wheels*re.qty,0),0),subtotal:s,hasUnpricedLine:f,discount:I,bundleDiscount:fe,appliedBundles:sn,shipping:dt,freeShipping:He,shippingStatus:ln,freeUnitsByPartNumber:$e,tax:un,grand:cn,repricing:!!x?.refused&&b!==null&&_===x?.code,currency:n}},[l,n,x,B,D,b,_]),ut=N(s=>{U(s),Y()},[U,Y]),an=Ut(()=>({isOpen:i,preview:t,open:Y,close:$,toggle:Ee,items:l,catalog:u,bundles:d,warmCatalog:Pe,add:U,addAndOpen:ut,remove:J,setQty:rt,replaceItems:ot,identify:at,clearCapturedCart:st,coupon:x,applyCoupon:ne,removeCoupon:we,refuseCoupon:_e,couponBusy:ve,deliveryOptions:B,setQuoteDestination:F,courier:ce,requote:C,shippingMethodId:D,setShippingMethodId:le,totals:lt}),[i,t,Y,$,Ee,l,u,d,Pe,U,ut,J,rt,ot,at,st,x,ne,we,_e,ve,B,F,ce,C,D,lt]);return Hn(Wt.Provider,{value:an,children:e})}function qt(){let e=Mn(Wt);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Qn}from"react";function Gt(e,t,n,r){for(;e.size>=t;){let o,i;for(let[l,c]of e){if(c.expiresAt<=r){o=l;break}i===void 0&&n(l)&&(i=l)}let a=o??i??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var $n=6e4,Bn=5e3,Wn=500,Ae=new Map;async function qn(e){let{host:t,matchesRequestHost:n}=await ht();if(!t)return"";let r=await yt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Gn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Kt(e,t){if(await bt()!==null)return t();let n=await qn(e);if(!n)return t();let r=Date.now(),o=Ae.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),a=i.outcome.state==="failed",l=a?Bn:$n,c=Ae.get(n)?.lastGood,u=i.outcome.state==="ok"?i:a?c:void 0,p=a&&u?u:i;return Gt(Ae,Wn,Gn,r),Ae.set(n,{load:p,expiresAt:r+l,lastGood:u}),p}var Kn=404;function zn(e){if(e instanceof me&&e.status===Kn)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Xn="[storefront:chrome-load-failed]";function Vn(e,t){console.error(`${Xn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function zt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=zn(o);return i.state==="failed"&&Vn(e,i),{value:n,outcome:i}}}function Yn(e){return e==="production"?"silent":"banner"}var Ho=Yn("production");function jn(e,t){return e?.trim()||t}function Xo({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=jn(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var Zn={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:Be},Vo=Qn(async()=>Kt("site",()=>zt("site",async()=>{let e=await q.getSite();return{name:pt(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,socialLinks:mt(e.socialLinks)}},Zn)));var Yo={name:pe,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:Be};import{jsx as Ce,jsxs as je}from"react/jsx-runtime";import{useEffect as Te,useId as nr,useRef as Vt,useState as Oe}from"react";import{efficientClientOpen as Jn}from"efficient-easel/screen/lib/session";var be=new Map,er=64;async function tr(e){if(!Jn())return null;try{let t=await fetch(`${ft()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function Xt(e){let t=be.get(e);if(t)return t;let n=tr(e);if(be.set(e,n),be.size>er){let r=be.keys().next();r.done||be.delete(r.value)}return n}var rr=202/22,or=.88,ci=16,ir="invert(1)";function di({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:a,inkIsDark:l,size:c="medium",sizePx:u,wordmark:p,siteName:d=pe,fitToContainer:S=!1,fitWordmarkToContainer:L=!1,fitFloorPx:y}){let h=p&&p.trim()?p.trim():d,[w,T]=Oe(!1),O=Vt(null),k=P=>{O.current=P};Te(()=>{let P=O.current?.ownerDocument??document,U=()=>{T(P.documentElement.getAttribute("data-theme")==="light")};U();let J=new MutationObserver(U);return J.observe(P.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>J.disconnect()},[]);let v=n&&n.trim()?n.trim():null,b=!!v&&gt(v),G=i??(w&&t),M=o&&o.trim()?o.trim():null,K=r&&!M,C=`logo-color-${nr().replace(/[^A-Za-z0-9_-]/g,"")}`,_=K&&b&&v&&a!=null?{reversed:a,inkIsDark:l??null}:null,E=_!==null,[z,se]=Oe(null);Te(()=>{if(!K||!v||!b||E){se(null);return}let P=!1;return se(null),Xt(v).then(U=>{P||se(U)}),()=>{P=!0}},[K,v,b,E]);let x=_??z,H=!!x&&x.inkIsDark!==null&&(G?!x.inkIsDark:x.inkIsDark),ve=K&&!!v&&!b&&!G,X=H&&x?x.reversed:v,D=X?[X]:[],[le,V]=Oe(0);Te(()=>{V(0)},[v,H]);let Y=e==="footer"?qe:We[c],$=u&&u>0?u:Y,Ee=Math.round($*rr),F=le<D.length?D[le]:null,[Pe,te]=Oe(X),ue=F!==null&&F===Pe,B=Vt(null);Te(()=>{let P=B.current;if(!P||!P.complete)return;if(P.naturalWidth>0||P.naturalHeight>0){te(F);return}let U=!1;return P.decode().then(()=>!U&&te(F),()=>!U&&V(J=>J+1)),()=>{U=!0}},[F]);let ce=S||L,Z=`calc(100cqi / ${((h.length+1)*or).toFixed(2)})`,ne=ce&&y&&y>0?Math.min(y,$):null,we=ce?ne===null?`min(${$}px, ${Z})`:`clamp(${ne}px, ${Z}, ${$}px)`:`${$}px`,_e=je("span",{className:`font-display font-bold tracking-[0.18em] ${ne===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:we,lineHeight:1,...M?{color:M}:{}},"aria-label":h,children:[h,Ce("span",{className:"text-accent",style:M?{color:M}:void 0,children:"."})]});return je("span",{ref:k,className:"inline-flex items-center",children:[!ue&&_e,M&&F&&Ce("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:je("filter",{id:C,colorInterpolationFilters:"sRGB",children:[Ce("feFlood",{style:{floodColor:M}}),Ce("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),F&&Ce("img",{ref:B,src:F,alt:h,width:Ee,height:$,className:"shrink-0 object-contain",style:{...ue?{height:`${$}px`,width:"auto",...S?{maxWidth:"100cqi"}:{}}:{display:"none"},...ve?{filter:ir}:{},...M?{filter:`url(#${C})`}:{}},onLoad:()=>te(F),onError:()=>V(P=>P+1)},F)]})}import{jsx as xe,jsxs as sr}from"react/jsx-runtime";function ar({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,l=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(l.push({x1:a(100+Math.cos(u)*22),y1:a(100+Math.sin(u)*22),x2:a(100+Math.cos(u)*86),y2:a(100+Math.sin(u)*86),main:!0}),t){let p=u+Math.PI/e;l.push({x1:a(100+Math.cos(p)*22*1.4),y1:a(100+Math.sin(p)*22*1.4),x2:a(100+Math.cos(p)*78),y2:a(100+Math.sin(p)*78),main:!1})}}return sr("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[xe("circle",{cx:100,cy:100,r:92,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),xe("circle",{cx:100,cy:100,r:22,strokeWidth:2}),xe("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),l.map((c,u)=>xe("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}var gi="#c9a461",Yt=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],hi={name:"",color:"var(--fg)",family:"silver",src:""};function lr(e,t){let n=r=>{let o=Yt.findIndex(i=>i.f===r);return o===-1?Yt.length:o};return n(e)-n(t)||e.localeCompare(t)}function yi(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(lr)}import{useState as ur}from"react";import{jsx as ae,jsxs as Ze}from"react/jsx-runtime";function cr({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=qt(),[i,a]=ur("");async function l(){o||!i.trim()||(await n(i,e),a(""))}return Ze("div",{className:"flex flex-col gap-2",children:[t===null?Ze("div",{className:"flex border border-line",children:[ae("input",{type:"text",value:i,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),ae("button",{type:"button",onClick:()=>{l()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Ze("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[ae("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),ae("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?ae("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:Rt}):t&&!t.valid&&t.message&&ae("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}var Je="Ads on. Shopper can opt out.",Me="Ads and analytics off until Accept",dr={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:Je,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:Me,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:Je,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:Je,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function fr(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Pi(e,t,n){let r=fr(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var wi={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};var pr={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var mr=pr;function Li(e=mr){if(e.asked)return e.ads?"granted":"denied"}function ki(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}import{Children as hr,isValidElement as yr,useEffect as jt,useId as br,useLayoutEffect as en,useRef as Q,useState as Zt}from"react";var De=(e,t)=>!!e[t]&&!e[t].disabled;function et(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(De(e,i))return i}return t}function tt(e,t){return et(e,t===1?-1:e.length,t)}function nt(e,t){return De(e,t)?t:Math.max(tt(e,1),0)}function Qt(e,t,n){let{open:r,focus:o}=e,i=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),l=n.findIndex((c,u)=>De(n,u)&&c.label.toLowerCase().startsWith(a));return{state:i({open:!0,typed:a,focus:l>=0?l:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:et(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:et(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:tt(n,1)}),handled:!0};case"End":return{state:i({focus:tt(n,-1)}),handled:!0};case"Enter":case" ":return De(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as Cr}from"efficient-shell/ui";import{Fragment as wr,jsx as j,jsxs as tn}from"react/jsx-runtime";var Jt={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function xr({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[a,l]=Zt(!1),c=r!==void 0,u=c?r:a,[p,d]=Zt(0),S=Q({text:"",timer:0}),L=Q(null),y=Q(null),h=Q(null),w=br(),T=Q(null),O=e.findIndex(C=>C.value===t),k=C=>{C!==u&&(c||l(C),C?o?.():i?.())},v=C=>{let _=e[C];!_||_.disabled||(n(_.value),k(!1),y.current?.focus())},b=C=>{let _={open:u,focus:u?p:nt(e,O),typed:S.current.text},E=Qt(_,C,e);return!E.handled&&E.state.open===u?!1:(E.state.typed!==_.typed&&(S.current.text=E.state.typed,window.clearTimeout(S.current.timer),S.current.timer=window.setTimeout(()=>{S.current.text=""},500)),d(E.state.focus),E.commit!==void 0?v(E.commit):k(E.state.open),E.refocus&&y.current?.focus(),E.handled)},G=Q(b);G.current=b;let M=Q(()=>k(!1));M.current=()=>k(!1);let K=C=>{u||(T.current=C.nativeEvent,G.current(C.key)&&C.preventDefault())};return jt(()=>{if(!u)return;let C=E=>{L.current?.contains(E.target)||M.current()},_=E=>{E!==T.current&&G.current(E.key)&&E.preventDefault()};return document.addEventListener("mousedown",C),document.addEventListener("keydown",_),()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",_)}},[u]),jt(()=>{u&&(S.current.text||d(nt(e,O)))},[u]),en(()=>{if(!u||!h.current)return;h.current.children.item(p)?.scrollIntoView({block:"nearest"})},[p,u]),{open:u,toggle:()=>k(!u),close:()=>k(!1),focusIdx:p,setFocusIdx:d,pick:C=>v(e.findIndex(_=>_.value===C)),wrapRef:L,triggerRef:y,listRef:h,listId:w,onTriggerKeyDown:K,activeId:u?`${w}-${p}`:void 0}}var Sr={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-3 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>[`cursor-pointer whitespace-nowrap px-6 py-3 font-mono ${Jt.label} font-semibold uppercase tracking-[0.1em] transition-colors`,e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>[`flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left ${Jt.body} transition-colors last:border-b-0`,t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-4 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function vr(e,t){en(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let l=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-l.right)<Math.abs(c.left-l.left)?"end":"start",p=Cr({trigger:{left:l.left,right:l.right,top:l.top,bottom:l.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(p.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let S=p.top+Math.min(c.height,p.maxHeight);i.marginBottom=`${Math.max(0,l.top-S)}px`}p.maxHeight<c.height&&(i.maxHeight=`${p.maxHeight}px`,i.overflowY="auto");let d=p.left-c.left;d&&(i.translate=`${d}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function Er({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:a,listRef:l,ariaLabel:c}){let u=Sr[t],p=Q(null);return vr(p,n.length),j("ul",{ref:d=>{p.current=d,l&&(l.current=d)},id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((d,S)=>{let L=d.value===r;return j("li",{id:`${e}-${S}`,role:"option","aria-selected":L,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(S),onMouseDown:y=>{y.preventDefault(),d.disabled||a(d.value)},className:u.item(S===o,L&&d.value!=="",!!d.disabled,S===n.length-1),style:u.itemStyle?.(L),children:d.meta===void 0?d.label:tn(wr,{children:[d.lead,j("span",{className:"flex-1 whitespace-nowrap",children:d.label}),j("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${S}`)})})}function Pr({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:a,id:l,"aria-label":c}){let u=hr.toArray(r).flatMap(y=>{if(!yr(y))return[];if(y.type!=="option")return[];let w=y.props,T=w.value!==void 0?String(w.value):"",O=w.children,k=typeof O=="string"||typeof O=="number"?String(O):T;return[{value:T,label:k,disabled:!!w.disabled}]}),p=e??"",d=xr({items:u,value:p,onPick:y=>t?.({target:{value:y}})}),L=u.find(y=>y.value===p)?.label??u[0]?.label??"";return tn("div",{ref:d.wrapRef,className:"relative",children:[a&&j("input",{type:"hidden",name:a,value:p}),j("button",{ref:y=>{d.triggerRef.current=y},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":d.open,"aria-controls":d.open?d.listId:void 0,"aria-activedescendant":d.activeId,"aria-label":c,id:l,onClick:()=>!n&&d.toggle(),onKeyDown:y=>!n&&d.onTriggerKeyDown(y),className:`block w-full ${o??""}`,style:i,children:j("span",{className:"block w-full truncate text-left",children:L})}),d.open&&j(Er,{id:d.listId,tone:"select",items:u,value:p,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef})]})}import{jsx as Se,jsxs as Fe}from"react/jsx-runtime";var _r="font-mono text-[length:var(--size-label,12px)]",Nr="font-semibold uppercase tracking-[0.22em] text-fg";function nn(e){return`${e??_r} ${Nr}`}function rn(){return Se("span",{className:"text-accent",children:" *"})}function Rr({children:e,required:t,labelFace:n}){return Fe("span",{className:nn(n),children:[e,t?Se(rn,{}):null]})}function Lr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:a,children:l}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?Se("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Fe("div",{className:c,children:[Fe("label",{htmlFor:o,className:nn(i),children:[e,t?Se(rn,{}):null]}),l,u]}):Fe("label",{htmlFor:o,className:c,children:[Se(Rr,{required:t,labelFace:i,children:e}),l]})}export{zr as a,Xr as b,Vr as c,Ct as d,Ge as e,Ir as f,kr as g,Ar as h,Tr as i,fn as j,pn as k,Or as l,Mr as m,Ke as n,Re as o,ge as p,Dr as q,Le as r,Sn as s,vn as t,Zr as u,Jr as v,It as w,Ve as x,eo as y,to as z,Pn as A,no as B,ro as C,wn as D,oo as E,Nn as F,io as G,ao as H,kt as I,po as J,mo as K,go as L,bo as M,Co as N,Br as O,wt as P,Wr as Q,Ie as R,Qe as S,ko as T,qt as U,Xo as V,Zn as W,Yo as X,ci as Y,di as Z,ar as _,gi as $,Yt as aa,hi as ba,lr as ca,yi as da,cr as ea,dr as fa,Pi as ga,wi as ha,pr as ia,Li as ja,ki as ka,xr as la,Er as ma,Pr as na,Rr as oa,Lr as pa};