efficient-storefront-blocks 0.42.1 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +286 -0
- package/dist/chunks/EditorPreviewCheckout-OOIMRWPC.js +4 -0
- package/dist/chunks/{SiteEditorProvider-EYQFRVAE.js → SiteEditorProvider-7HBDTOHL.js} +1 -1
- package/dist/chunks/chunk-HKHIOXRJ.js +1 -0
- package/dist/chunks/chunk-MRRGYKU2.js +1 -0
- package/dist/chunks/chunk-PF2VDYSO.js +1 -0
- package/dist/chunks/chunk-X6N32X46.js +255 -0
- package/dist/chunks/fitment-data-XHANJXIJ.js +1 -0
- package/dist/editor.css +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +221 -619
- package/dist/links.js +1 -1
- package/dist/words.d.ts +37 -8
- package/dist/words.js +4 -4
- package/package.json +3 -3
- package/dist/chunks/EditorPreviewCheckout-LG3YPI4W.js +0 -4
- package/dist/chunks/chunk-H6SZXW6U.js +0 -255
- package/dist/chunks/chunk-M72Y46OD.js +0 -1
- package/dist/chunks/chunk-RSO2WB5X.js +0 -1
- package/dist/chunks/chunk-TTHDA2MW.js +0 -1
- package/dist/chunks/fitment-data-RIEEQFFZ.js +0 -1
- /package/dist/chunks/{SectionEditorShell-QM5CEYFT.js → SectionEditorShell-L7JFXNDG.js} +0 -0
- /package/dist/chunks/{chunk-ZC4KGN3D.js → chunk-UBIWN5OB.js} +0 -0
- /package/dist/chunks/{chunk-H6SZXW6U.js.LEGAL.txt → chunk-X6N32X46.js.LEGAL.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,291 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.43.0 — 2026-10-19
|
|
6
|
+
|
|
7
|
+
- **On efficient-web-builder 23: one show-when rule for every settings row** (SSOT batch 1, Lewis 2026-10-17). The peer and dev ranges move to efficient-web-builder `^23.0.0`, efficient-easel `^13.1.0` and efficient-shell `^7.73.0` (`package/` peers easel and shell the same). A MAJOR for hosts: a host moves its shell to 7.73.0 and its easel to 13.1.0 in the same pull request that takes this release.
|
|
8
|
+
- 23.0.0 reads each row's `showWhen` in one pass, and its head-placement, width-in-a-Box and block-source helpers now attach rules instead of deleting rows. So the blocks' 31 calls to them move onto the rule with no edit here. Nothing a merchant sees moves: the blocks' own sections resolve the same rows as on 22.1.1 in all 71,806 prop and parent cases measured; the builder's sections differ only as #180 lists.
|
|
9
|
+
- Tests moved with it: `test-block-sources` reads through the builder's show-when reader (`rowsShownForNode`), as the registry does; `test-mockup-variant-fields` no longer imports the removed `cullMockupFields`; FeaturedCover's and LongRead's linked-post note is now a declared row (`_nBound`), named in `section-style-baseline`'s ADDED and `test-animation-tab`'s gains.
|
|
10
|
+
- New guard `scripts/test-one-show-when.ts`: the builder's `one-show-when` rule over the blocks' own files, with every file that still hides a row by hand named, and why. The list only shrinks (SSOT batch 1, B2 to B6).
|
|
11
|
+
|
|
12
|
+
- **A site whose header cart is off takes no orders; every buy place asks for a quote** (Lewis, 2026-10-19: one rule, no new setting). `siteTakesOrders` (`components/SiteRecordContext`) is the one rule: a site takes orders when it sells (`commerceEnabled`) and its header cart is on (`cartEnabled`, new on the page record). Where it says no, the product hero's quantity, spare and Add to Cart, the tyre card's Add to basket and a one-wheel card's Add to basket each become the "Request a quote" link to `/contact` (`QuoteLink`, the link the hero already drew for an unpriced set). Prices stay. With the cart on, or with no page record (the editor, an older host), the markup is unchanged byte for byte. The host passes `cartEnabled` from its header settings into `SiteRecordContext`. Guard: `scripts/test-site-takes-orders.tsx`.
|
|
13
|
+
|
|
14
|
+
- **The narrowest wheel card is 248px, not 240px** (Lewis: change the layout, never cut the words; GG 2026-10-19, choice A). The spacing scale put the card's padding at 32px a side (#87), which left the narrowest card a 176px text column, and the widest spec fact (`PCD 10×114.3 +4 more ·`, ~181px) could be cut in half there. `PLP_AUTO_MIN_CARD_PX` rose by the 8px the 184px column needs. At the default site column the Auto grid still shows 5 columns at a 1440px window, 3 at 1000px and 1 at 390px; only the widths where it changes count move (five columns from 1384px, was 1344; four from 1120px, was 1088). Guard: `scripts/test-plp-grid.tsx` (Auto's track list written out), and the storefront's `test-card-price-line.tsx` §6c computes the column from this number.
|
|
15
|
+
|
|
16
|
+
- **On efficient-web-builder 22: every picture row is the shell's media field,
|
|
17
|
+
a picture has a phone focus, and a site text style has a phone size.** The
|
|
18
|
+
blocks' peer and dev ranges move to efficient-web-builder `^22.0.0`,
|
|
19
|
+
efficient-easel `^12.0.0` and efficient-shell `^7.69.1`; the published
|
|
20
|
+
package's peers move to easel `^12.0.0` and shell `^7.69.1`. A host on easel
|
|
21
|
+
11 or on a shell below 7.69.1 must move first. The host must also compile
|
|
22
|
+
the shell's classes: the media field's Change image bar uses them. Guard:
|
|
23
|
+
`scripts/test-shell-peer-range.ts`.
|
|
24
|
+
- **The published types say what easel 12 says** (`public.d.ts`, paired by
|
|
25
|
+
`types.check.ts`): `MediaPickRequest.options` (the field's own terms for the
|
|
26
|
+
host's panel, absent when it gave none), and the editor message
|
|
27
|
+
`storefront-editor:open-site-section` (`section: "settings" | "shipping"`),
|
|
28
|
+
which asks the host to open the website's Settings or Shipping. A host that
|
|
29
|
+
does not handle it ignores it. The word catalogues are written again from
|
|
30
|
+
web-builder 22's phrases.
|
|
31
|
+
|
|
32
|
+
- **The Header panel's row labels and gaps are on the scales.** Every row label
|
|
33
|
+
in the Header panel (`Field`, stacked and on one line, `ValueField`, and the
|
|
34
|
+
Size, Space from the logo and Height slider captions) is 12px (`text-xs`,
|
|
35
|
+
the type scale's step and `.sf-field-label`'s size), not 13px; the stacked
|
|
36
|
+
row's gap under its label is 8px, not 7px (spacing scale 2/4/8/12…; GG
|
|
37
|
+
2026-10-19). The labels are 1px smaller; nothing else moves.
|
|
38
|
+
The "Show as" tile pictures use UI tokens too: a 24px box (`h-6`), 8px side
|
|
39
|
+
space (`px-2`), the shell's 9px type step (`--text-3xs`) and
|
|
40
|
+
`tracking-wider`, not `h-[22px]`, `px-1.5`, `text-[9px]` and
|
|
41
|
+
`tracking-[0.06em]`. The ▾ is that 9px step, not 7px. The storefront's
|
|
42
|
+
`test-panel-colour-tokens` allow line for `HeaderSettingsPanel.tsx` goes
|
|
43
|
+
down from 17 to 11 with this sync.
|
|
44
|
+
|
|
45
|
+
**The header's country picker has "Show as"** (Lewis 2026-10-17, design A,
|
|
46
|
+
approved through GG). What the closed picker shows is a setting: the
|
|
47
|
+
country name (the default, and the exact markup every picker drew before),
|
|
48
|
+
code and currency (`US · USD`), a globe and the code, the currency, a flag
|
|
49
|
+
and the code, or the flag alone. The Header panel draws it under Country
|
|
50
|
+
selector as efficient-shell's `PictureTiles` (six pictures, two in a row),
|
|
51
|
+
only while Show selector is on (the shell's `ShowWhen`). The Box header's
|
|
52
|
+
Country Switch block owns the same setting: the value is copied from the
|
|
53
|
+
header row ONCE, when the Box header is built, and after that the block's
|
|
54
|
+
own value is the only one that header reads. Flags are the shell's
|
|
55
|
+
simplified real flags, on the button and before each row of the list. Needs
|
|
56
|
+
efficient-shell `^7.53.0` (7.54.0 here), efficient-web-builder **^21.0.0**
|
|
57
|
+
(the first release with `CountrySwitchBlock` in `GROUPED_BLOCKS` and
|
|
58
|
+
`PreviewHeaderSettings.countrySelectorShowAs`), and the backend's
|
|
59
|
+
`country_selector_show_as`.
|
|
60
|
+
|
|
61
|
+
- **A picture's phone focus is drawn** (Lewis 2026-10-19: one picture, one dot; the
|
|
62
|
+
view you drag the dot in sets that view's point). `app/globals.css` reads
|
|
63
|
+
`--sf-focus-phone` on `.sf-focus-phone` inside the phone padding's boundary
|
|
64
|
+
(`not all and (min-width: 720px)`), `!important` over the picture's inline
|
|
65
|
+
desktop point. The builder adds the class only when a phone point is set
|
|
66
|
+
(efficient-web-builder `lib/content/phone-focus`), so every picture without
|
|
67
|
+
one draws the bytes it drew. Guard: `scripts/test-phone-focus-css.ts`.
|
|
68
|
+
|
|
69
|
+
- **Fitment and build submissions: each own text size is written once.** The sizes a part keeps
|
|
70
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
71
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
72
|
+
table: 25 uses are 21 entries (`FitmentTable.tsx`, `TyreFitVerdicts.tsx`, `fitment/FitmentFinder.tsx`, `fitment/PickerField.tsx`, `fitment/StockFitmentCard.tsx`). Nothing on screen changes: every
|
|
73
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
74
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
75
|
+
|
|
76
|
+
- **Reviews: each own text size is written once.** The sizes a part keeps
|
|
77
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
78
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
79
|
+
table: 7 uses are 6 entries (`Reviews.tsx`). Nothing on screen changes: every
|
|
80
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
81
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
82
|
+
|
|
83
|
+
- **Subscribe and the site popup: each own text size is written once.** The
|
|
84
|
+
sizes a part keeps while the site has not set its text style (unset = the
|
|
85
|
+
section keeps its own size) now live in one `TEXT_SIZE` table per file, and
|
|
86
|
+
the parts read the table: Subscribe's ten uses are six entries, the popup's
|
|
87
|
+
two are two. Nothing on screen changes: every section render and the
|
|
88
|
+
compiled CSS are byte-identical before and after. New guard
|
|
89
|
+
`scripts/test-text-size-tables.ts`: a file with a table writes no size
|
|
90
|
+
fallback outside it, and no entry twice (GG ruling B, 2026-10-17).
|
|
91
|
+
|
|
92
|
+
- **Gallery showcase: each own text size is written once.** The sizes a part keeps
|
|
93
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
94
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
95
|
+
table: 19 uses are 7 entries (`GalleryShowcase.tsx`). Nothing on screen changes: every
|
|
96
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
97
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
98
|
+
|
|
99
|
+
- **Contact routing: each own text size is written once.** The sizes a part keeps
|
|
100
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
101
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
102
|
+
table: 28 uses are 11 entries (`ContactRouting.tsx`, `ThemedSelect.tsx`). Nothing on screen changes: every
|
|
103
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
104
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
105
|
+
|
|
106
|
+
**The shopper's pop-up list is placed by the shell's rule.** `ThemedSelect`
|
|
107
|
+
asks efficient-shell's `placeMenu` (efficient-shell/ui), the rule the shell's
|
|
108
|
+
own DropdownMenu and Popover use, and the blocks' copy
|
|
109
|
+
(`lib/select-placement.ts`, #76) is deleted. One look change, approved by
|
|
110
|
+
Lewis on 2026-10-18 from before/after phone shots: a list that turns UP (the
|
|
111
|
+
phone menu's Region list) sits 4px above its button instead of 8px. A list
|
|
112
|
+
that opens down keeps its tone's gap. **efficient-shell ^7.54.0** (peer and
|
|
113
|
+
dev; the lockfile installs 7.54.0), the first release that exports
|
|
114
|
+
`placeMenu`. Its assistant bubble also reads the launcher tokens
|
|
115
|
+
`ChatLauncher` sets.
|
|
116
|
+
|
|
117
|
+
**One chat launcher.** The classic live chat (56px, 20px from the corner,
|
|
118
|
+
its own icon) and the assistant's pre-load launcher (48px, a hard-coded
|
|
119
|
+
#2563eb, its own shadow and icon) both draw `ChatLauncher` (new): the shell
|
|
120
|
+
bubble's shape (48px, 16px from the corner, `shadow-lg`), the shell's
|
|
121
|
+
`chat-bubble-left-right` icon, inline styles only. Its colour comes from the
|
|
122
|
+
shell's launcher tokens (`--assistant-launcher-bg`, `-ink`, `-bg-hover`),
|
|
123
|
+
set by `CHAT_LAUNCHER_TOKENS` to the site's button colour (Lewis's choice A,
|
|
124
|
+
2026-10-17). The colour tokens and the icon (`CHAT_LAUNCHER_ICON`) are the
|
|
125
|
+
launcher's one look, where per-site chat settings can feed it later. **A look change** for both chats: see the
|
|
126
|
+
mockup in the PR. The assistant's bubble takes the same colour once the
|
|
127
|
+
shell release that reads the tokens is installed.
|
|
128
|
+
|
|
129
|
+
**The Booking Form's service price is formatted in the shop's one money
|
|
130
|
+
locale.** It had its own `formatMoney` with `Intl.NumberFormat(undefined, …)`:
|
|
131
|
+
the server's locale on the server, the shopper's in the browser, so a German
|
|
132
|
+
browser re-drew "A$80.00" as "80,00 A$" after hydration. It uses
|
|
133
|
+
`formatMoneyInCurrency` (new in `lib/commerce`, fixed `PRICE_LOCALE`); an
|
|
134
|
+
English server prints the same string as before.
|
|
135
|
+
|
|
136
|
+
**One header-height fallback.** The phone menu's sheet fell back to 60px where
|
|
137
|
+
every other reader of `--sf-header-h` says 88px (`:root` sets 88px, so no page
|
|
138
|
+
changes). The phone menu and the listing's car gate share
|
|
139
|
+
`UNDER_HEADER_SHEET_CLASS` (`lib/content/header-bar`). Guard:
|
|
140
|
+
`scripts/test-helpers-one-place.ts`.
|
|
141
|
+
|
|
142
|
+
**The shop's stock and price words are written once.** "In stock" / "Out of
|
|
143
|
+
stock" (`lib/content/stock-words.ts`, new: `STOCK_WORDS`, `stockWord`, and the
|
|
144
|
+
shop's count and pickup words the Product Hero's stock line will read:
|
|
145
|
+
`unitsInStock`, `setsInStock`, `pickupAt`, `pickupAtCount`,
|
|
146
|
+
`STOCK_WORDS.notInStockHere`), "from",
|
|
147
|
+
"each" and "Free" (`lib/wheels/price-display.ts`: `FROM_PREFIX`,
|
|
148
|
+
`FROM_PREFIX_START`, `EACH_UNIT`, `FREE_PRICE`) and "Calculated at checkout"
|
|
149
|
+
(`lib/cart/shipping-status.ts`: `CALCULATED_AT_CHECKOUT`, `TAX_PENDING`) were
|
|
150
|
+
typed by hand on the tyre card, the listing cards, the cart drawer, the
|
|
151
|
+
checkout, the delivery options and the booking form. Every one imports them
|
|
152
|
+
now. No page changes: the words are the same. Guard:
|
|
153
|
+
`scripts/test-shop-words-one-place.ts` (strings, template pieces and JSX text;
|
|
154
|
+
editor `say()` words and panel labels are another family). One copy is left
|
|
155
|
+
for a file an open pull request holds: the Product Hero's "Out of stock"
|
|
156
|
+
button (#39).
|
|
157
|
+
|
|
158
|
+
- **Product page parts: each own text size is written once.** The sizes a part keeps
|
|
159
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
160
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
161
|
+
table: 13 uses are 10 entries (`DetailRows.tsx`, `QuantityStepper.tsx`, `SpecTable.tsx`, `pdp-dynamic/DynamicRelatedProducts.tsx`). Nothing on screen changes: every
|
|
162
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
163
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
164
|
+
|
|
165
|
+
- **Product page parts: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
166
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
167
|
+
text sizes stay the merchant's). 6 paddings, margins and gaps snapped UP
|
|
168
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x1), 14 -> 16 (x4), 18 -> 20 (x1). Files: `PreOrderPanel.tsx`, `SpecTable.tsx`, `buy-row.ts`.
|
|
169
|
+
Sections that change in the renders: Spec table.
|
|
170
|
+
|
|
171
|
+
**The wheel card is redesigned: it helps the shopper compare, then goes to the
|
|
172
|
+
product page** (Lewis, 2026-10-17, choice A on the redesign page). Both wheel
|
|
173
|
+
cards — the Wheels listing's (`PlpCard`) and the Product Grid's
|
|
174
|
+
(`ProductCard`) — draw it through `WheelCardFrame` and `useWheelCardBottom`.
|
|
175
|
+
|
|
176
|
+
- **No button for the product page.** The whole card is the link
|
|
177
|
+
(`WheelCardFrame` `wholeCardLink`: the picture-and-name link is stretched
|
|
178
|
+
over the card; swatches and a buy button sit above it). A quiet
|
|
179
|
+
"View sizes & fitment →" line at the bottom says where it goes ("Page
|
|
180
|
+
button"). It replaces "Select a size", "Open product page" under it, and the
|
|
181
|
+
bordered size chips.
|
|
182
|
+
- **"Buy button" is quick add only.** On, a design one tap can buy
|
|
183
|
+
(`buyActionFor`: one size, one PCD, one ET) shows "Add to basket", or
|
|
184
|
+
"Notify me when back" when out of stock, in that place. Every other card
|
|
185
|
+
shows no buy button.
|
|
186
|
+
- **"Sizes" is plain text** at the head of ONE spec line both cards print
|
|
187
|
+
(`wheelCardSpecFacts`): `20" · 22" · PCD 5×114.3-127 +3 more · ET −44 to −18
|
|
188
|
+
· C/B 78.1 mm +3 more`. Units sit next to their value and the count says
|
|
189
|
+
"more" ("+3 mm" read as three millimetres). Negative numbers use a real minus
|
|
190
|
+
sign, and every range is written "A to B" (`RANGE_SEPARATOR`), so the
|
|
191
|
+
product page's spec sheet and the tyre card's rim range read "to" too. The
|
|
192
|
+
Product Grid's and related grid's "Sizes" now rest ON, so an untouched grid
|
|
193
|
+
keeps printing its sizes.
|
|
194
|
+
- **One price line:** `from $360 per wheel` (`wheelCardPriceLine`); "each" and
|
|
195
|
+
the set's "per wheel" line are gone.
|
|
196
|
+
- **SET is a corner badge**, top-left, mirroring the top-right flags with the
|
|
197
|
+
same `WheelCardBadge` (`WheelCardCorners`). With the card number on, SET
|
|
198
|
+
joins the top-right stack instead. "L/R" left the spec line.
|
|
199
|
+
- **A row lines up.** In the Wheels listing, the Product Grid and the related
|
|
200
|
+
grid (`CARD_ROWS_GRID_CLASS`), each card is a CSS subgrid of nine shared
|
|
201
|
+
rows, so name, spec, price, swatches and the bottom line sit level across a
|
|
202
|
+
row, and the name is only as tall as the row's longest name. The grid's row
|
|
203
|
+
gap moves onto the cards (`cardRowsGridStyle`). Elsewhere cards keep their
|
|
204
|
+
fixed blocks.
|
|
205
|
+
|
|
206
|
+
On a rendered page only the cards change, plus the range wording above (ET and
|
|
207
|
+
size ranges, wherever they print).
|
|
208
|
+
|
|
209
|
+
- **Catalog, listing and product cards: each own text size is written once.** The sizes a part keeps
|
|
210
|
+
while the site has not set its text style (unset = the section keeps its own
|
|
211
|
+
size) now live in one `TEXT_SIZE` table per file, and the parts read the
|
|
212
|
+
table: 65 uses are 35 entries (`EuTyreLabelCard.tsx`, `ProductGridSection.tsx`, `TyreCard.tsx`, `TyrePlpCard.tsx`, `WheelCardFrame.tsx`, `catalog/CatalogFilterBar.tsx`, `catalog/CatalogVehiclePicker.tsx`, `catalog/FilterPill.tsx`). Nothing on screen changes: every
|
|
213
|
+
section render and the compiled CSS are byte-identical before and after.
|
|
214
|
+
Guard `scripts/test-text-size-tables.ts` (GG ruling B, 2026-10-17).
|
|
215
|
+
|
|
216
|
+
**`products.listRecordKeys(type)`: the sitemap's record keys, read where every
|
|
217
|
+
public read is scoped.** `GET /api/v1/records/{type}` (efficient-backend#3218)
|
|
218
|
+
was read by the storefront's own `lib/seo/record-keys`, which wrote its own
|
|
219
|
+
`?site=`/`?host=` and its own backend base beside this client. It is a
|
|
220
|
+
`products` read now, scoped by `withSite` and sent with `backendOpts`, never
|
|
221
|
+
cached; the backend's one 404 is `[]`. The route and its `RecordKeys` answer
|
|
222
|
+
are in the contract types (`lib/api/types.ts`, generated from the
|
|
223
|
+
storefront's `openapi.yml`; the storefront adds the same lines with its pin
|
|
224
|
+
move).
|
|
225
|
+
|
|
226
|
+
**The product API's two origins are read once**, in `lib/api/origins.ts`
|
|
227
|
+
(new, no imports): `PRODUCT_API_BASE` and `PRODUCT_BACKEND_URL`. `lib/api`
|
|
228
|
+
and `lib/api/fitment-data` import them; the storefront's `proxy.ts` and
|
|
229
|
+
`/api/v1` forwarder will too. Guard: `scripts/test-record-keys-read.ts`.
|
|
230
|
+
|
|
231
|
+
**efficient-web-builder ^18.4.0, and the Assistant font ships with it** (Panthera
|
|
232
|
+
rebuild; Lewis approved 2026-10-17). 18.4.0 adds Site styles > Basics > Share
|
|
233
|
+
button and Assistant to the font list. Assistant is self-hosted like every other
|
|
234
|
+
face: `src/app/fonts/assistant/` (latin, latin-ext, hebrew, OFL.txt), fetched by
|
|
235
|
+
`scripts/self-host-google-font.mjs` at weights 300–700, no italic (Google has
|
|
236
|
+
none). Its loaders and `--font-assistant` join `src/lib/next-fonts.ts`, and its
|
|
237
|
+
metric-matched fallback joins `fallbacks.css`. A site downloads it only when its
|
|
238
|
+
own theme names it, so no other site changes. Guards: `test-self-hosted-fonts`
|
|
239
|
+
(one loader per FONT_OPTIONS row) and `test-shell-peer-range` (builder ^18.4.0).
|
|
240
|
+
|
|
241
|
+
- **Fitment and build submissions: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
242
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
243
|
+
text sizes stay the merchant's). 38 paddings, margins and gaps snapped UP
|
|
244
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x10), 10 -> 12 (x3), 14 -> 16 (x7), 18 -> 20 (x4), 28 -> 32 (x2), 30 -> 32 (x3), 36 -> 40 (x9). Files: `FitmentTable.tsx`, `SubmitBuild.tsx`, `TyreFitVerdicts.tsx`, `fitment/FitmentFinder.tsx`, `fitment/PickerField.tsx`, `fitment/StockFitmentCard.tsx`, `product-hero/TyreHeroFitment.tsx`, `product-hero/VehicleQuestion.tsx`, `product-hero/WheelHeroFitment.tsx`, `submit/SubmitRegions.tsx`.
|
|
245
|
+
Sections that change in the renders: Fitment finder, Submit build, the wheels listing's fitment line.
|
|
246
|
+
|
|
247
|
+
- **Reviews, booking and chat: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
248
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
249
|
+
text sizes stay the merchant's). 16 paddings, margins and gaps snapped UP
|
|
250
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x3), 10 -> 12 (x2), 14 -> 16 (x2), 18 -> 20 (x1), 28 -> 32 (x3), 36 -> 40 (x3), 44 -> 48 (x2). Files: `ChatWidget.tsx`, `ReviewForm.tsx`, `Reviews.tsx`, `booking/BookingRegions.tsx`.
|
|
251
|
+
Sections that change in the renders: Review form.
|
|
252
|
+
|
|
253
|
+
- **Cart drawer and checkout: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
254
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
255
|
+
text sizes stay the merchant's). 68 paddings, margins and gaps snapped UP
|
|
256
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 3 -> 4 (x2), 6 -> 8 (x7), 10 -> 12 (x15), 14 -> 16 (x19), 18 -> 20 (x6), 22 -> 24 (x16), 26 -> 32 (x1), 28 -> 32 (x1), 36 -> 40 (x1). Files: `CartDrawer.tsx`, `CouponField.tsx`, `checkout/CheckoutPageClient.tsx`.
|
|
257
|
+
Sections that change in the renders: Cart drawer.
|
|
258
|
+
|
|
259
|
+
- **Gallery showcase: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
260
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
261
|
+
text sizes stay the merchant's). 16 paddings, margins and gaps snapped UP
|
|
262
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x4), 10 -> 12 (x3), 11 -> 12 (x1), 14 -> 16 (x4), 22 -> 24 (x1), 28 -> 32 (x3). Files: `GalleryShowcase.tsx`.
|
|
263
|
+
Sections that change in the renders: Gallery.
|
|
264
|
+
|
|
265
|
+
- **Header and footer: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
266
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
267
|
+
text sizes stay the merchant's). 31 paddings, margins and gaps snapped UP
|
|
268
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x9), 7 -> 8 (x1), 10 -> 12 (x3), 14 -> 16 (x4), 28 -> 32 (x13), 30 -> 32 (x1). Files: `FooterLogo.tsx`, `FooterMenu.tsx`, `Header.tsx`, `HeaderSettingsPanel.tsx`, `HeaderTools.tsx`, `MenuPicker.tsx`.
|
|
269
|
+
Sections that change in the renders: Footer logo, the header (live home page).
|
|
270
|
+
|
|
271
|
+
- **Subscribe and the site popup: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
272
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
273
|
+
text sizes stay the merchant's). 41 paddings, margins and gaps snapped UP
|
|
274
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 3 -> 4 (x1), 6 -> 8 (x3), 10 -> 12 (x5), 14 -> 16 (x7), 18 -> 20 (x11), 26 -> 32 (x3), 28 -> 32 (x6), 36 -> 40 (x1), 44 -> 48 (x4). Files: `EmailCaptureForm.tsx`, `Subscribe.tsx`, `SubscribePopup.tsx`.
|
|
275
|
+
Sections that change in the renders: Subscribe, Subscribe with blogs, the site popup.
|
|
276
|
+
|
|
277
|
+
- **Contact routing and forms: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
278
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
279
|
+
text sizes stay the merchant's). 20 paddings, margins and gaps snapped UP
|
|
280
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 6 -> 8 (x1), 10 -> 12 (x6), 14 -> 16 (x7), 18 -> 20 (x1), 28 -> 32 (x3), 36 -> 40 (x1), 44 -> 48 (x1). Files: `ContactRouting.tsx`, `CountrySelect.tsx`, `FormBlock.tsx`, `ThemedSelect.tsx`.
|
|
281
|
+
Sections that change in the renders: Contact routing.
|
|
282
|
+
|
|
283
|
+
- **Catalog, listing and product cards: the small gaps sit on the spacing scale** (SSOT cleanup batch 4,
|
|
284
|
+
Lewis approved 2026-10-17; GG: snap only gaps under 48, section padding and
|
|
285
|
+
text sizes stay the merchant's). 68 paddings, margins and gaps snapped UP
|
|
286
|
+
to the shell scale 2/4/8/12/16/20/24/32/40/48: 5 -> 8 (x2), 6 -> 8 (x26), 7 -> 8 (x1), 10 -> 12 (x25), 14 -> 16 (x4), 18 -> 20 (x3), 21 -> 24 (x1), 22 -> 24 (x1), 28 -> 32 (x3), 30 -> 32 (x1), 36 -> 40 (x1). Files: `BrandStripTile.tsx`, `BundleCard.tsx`, `CollectionCard.tsx`, `EuTyreLabelCard.tsx`, `ProductCardEyebrow.tsx`, `ProductGridSection.tsx`, `TyreCard.tsx`, `TyrePlpCard.tsx`, `WheelCardFrame.tsx`, `catalog/CatalogFilterBar.tsx`, `catalog/CatalogVehiclePicker.tsx`, `catalog/FilterPill.tsx`, `wheels-plp/AlloyWheelsListing.tsx`, `wheels-plp/PlpActiveChips.tsx`, `wheels-plp/PlpInStockToggle.tsx`, `wheels-plp/PlpNotifyMeDialog.tsx`, `wheels-plp/PlpPagination.tsx`, `wheels-plp/PlpTypePicker.tsx`, `wheels-plp/PlpTyreSizeBoxes.tsx`, `wheels-plp/PlpVehicleBar.tsx`.
|
|
287
|
+
Sections that change in the renders: Wheels listing, catalog filter bar, collection card, collections, product grid.
|
|
288
|
+
|
|
3
289
|
## 0.42.1 — 2026-10-17
|
|
4
290
|
|
|
5
291
|
- **efficient-web-builder ^18.3.1** (peer and dev). 18.3.1 gives the section
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use client";import{K as qt,L as _t,M as Dt,N as Ft,O as Mt,P as oe,Q as Se,R as Ut,S as Wt,T as Xe,U as $t,W as Ze,a as Lt,aa as Kt,b as Ot,c as Tt,d as jt,da as Qe,ea as Yt,ka as K,la as zt,ma as Bt,na as Ht,w as qe}from"./chunk-HKHIOXRJ.js";import{j as je,p as pe,w as T}from"./chunk-PF2VDYSO.js";import{a as Rt,c as te,ya as It}from"./chunk-MRRGYKU2.js";import{r as At,s as Ce,t as H}from"./chunk-UBIWN5OB.js";import{a as Je,b as or}from"./chunk-Y6SLVHK3.js";var Vt=Je((na,Gt)=>{"use strict";var ir="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Gt.exports=ir});var Qt=Je((ra,Zt)=>{"use strict";var sr=Vt();function Jt(){}function Xt(){}Xt.resetWarningCache=Jt;Zt.exports=function(){function t(a,o,s,l,d,p){if(p!==sr){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:Xt,resetWarningCache:Jt};return n.PropTypes=n,n}});var tn=Je((ia,en)=>{"use strict";en.exports=Qt()();var aa,oa});import{useEffect as z,useMemo as Ye,useRef as se,useState as g}from"react";var P=or(tn(),1);import x from"react";function nn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,a=Array(e);n<e;n++)a[n]=t[n];return a}function cr(t){if(Array.isArray(t))return t}function cn(t,e,n){return(e=fr(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function lr(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var a,o,s,l,d=[],p=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(p=(a=s.call(n)).done)&&(d.push(a.value),d.length!==e);p=!0);}catch(v){u=!0,o=v}finally{try{if(!p&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(u)throw o}}return d}}function ur(){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 rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function an(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?rn(Object(n),!0).forEach(function(a){cn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rn(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function pr(t,e){if(t==null)return{};var n,a,o=dr(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)n=s[a],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function dr(t,e){if(t==null)return{};var n={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(e.indexOf(a)!==-1)continue;n[a]=t[a]}return n}function ln(t,e){return cr(t)||lr(t,e)||gr(t,e)||ur()}function mr(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function fr(t){var e=mr(t,"string");return typeof e=="symbol"?e:e+""}function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}function gr(t,e){if(t){if(typeof t=="string")return nn(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nn(t,e):void 0}}var j=function(e,n,a){var o=!!a,s=x.useRef(a);x.useEffect(function(){s.current=a},[a]),x.useEffect(function(){if(!o||!e)return function(){};var l=function(){if(s.current)return s.current.apply(s,arguments)};return e.on(n,l),function(){e.off(n,l)}},[o,n,e,s])},tt=function(e){var n=x.useRef(e);return x.useEffect(function(){n.current=e},[e]),n.current},de=function(e){return e!==null&&et(e)==="object"},yr=function(e){return de(e)&&typeof e.then=="function"},hr=function(e){return de(e)&&typeof e.elements=="function"&&typeof e.createToken=="function"&&typeof e.createPaymentMethod=="function"&&typeof e.confirmCardPayment=="function"},on="[object Object]",vr=function t(e,n){if(e===n)return!0;if(!de(e)||!de(n))return e===n;var a=Array.isArray(e),o=Array.isArray(n);if(a!==o)return!1;var s=Object.prototype.toString.call(e)===on,l=Object.prototype.toString.call(n)===on;if(s!==l)return!1;if(!s&&!a)return e===n;var d=Object.keys(e),p=Object.keys(n);if(d.length!==p.length)return!1;for(var u={},v=0;v<d.length;v+=1)u[d[v]]=!0;for(var b=0;b<p.length;b+=1)u[p[b]]=!0;var f=Object.keys(u);if(f.length!==d.length)return!1;var h=e,A=n,k=function(S){return t(h[S],A[S])};return f.every(k)},un=function(e,n,a){return de(e)?Object.keys(e).reduce(function(o,s){var l=!de(n)||!vr(e[s],n[s]);return a.includes(s)?(l&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),o):l?an(an({},o||{}),{},cn({},s,e[s])):o},null):null},pn="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.",sn=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pn;if(e===null||hr(e))return e;throw new Error(n)},br=function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:pn;if(yr(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(o){return sn(o,n)})};var a=sn(e,n);return a===null?{tag:"empty"}:{tag:"sync",stripe:a}},xr=function(e){!e||!e._registerWrapper||!e.registerAppInfo||(e._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},_e=x.createContext(null);_e.displayName="ElementsContext";var dn=function(e,n){if(!e)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 e},rt=function(e){var n=e.stripe,a=e.options,o=e.children,s=x.useMemo(function(){return br(n)},[n]),l=x.useState(function(){return{stripe:s.tag==="sync"?s.stripe:null,elements:s.tag==="sync"?s.stripe.elements(a):null}}),d=ln(l,2),p=d[0],u=d[1];x.useEffect(function(){var f=!0,h=function(k){u(function(C){return C.stripe?C:{stripe:k,elements:k.elements(a)}})};return s.tag==="async"&&!p.stripe?s.stripePromise.then(function(A){A&&f&&h(A)}):s.tag==="sync"&&!p.stripe&&h(s.stripe),function(){f=!1}},[s,p,a]);var v=tt(n);x.useEffect(function(){v!==null&&v!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[v,n]);var b=tt(a);return x.useEffect(function(){if(p.elements){var f=un(a,b,["clientSecret","fonts"]);f&&p.elements.update(f)}},[a,b,p.elements]),x.useEffect(function(){xr(p.stripe)},[p.stripe]),x.createElement(_e.Provider,{value:p},o)};rt.propTypes={stripe:P.default.any,options:P.default.object};var mn=function(e){var n=x.useContext(_e);return dn(n,e)},fn=function(){var e=mn("calls useElements()"),n=e.elements;return n},kr=function(e){var n=e.children,a=mn("mounts <ElementsConsumer>");return n(a)};kr.propTypes={children:P.default.func.isRequired};var Cr=x.createContext(null);Cr.displayName="CheckoutContext";var gn=x.createContext(null);gn.displayName="CheckoutSdkContext";var nt=function(e){var n=x.useContext(gn),a=x.useContext(_e);if(n){if(a)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return n}else return dn(a,e)},Sr=["mode"],wr=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},N=function(e,n,a){var o="".concat(wr(e),"Element"),s=function(u){var v=u.id,b=u.className,f=u.options,h=f===void 0?{}:f,A=u.onBlur,k=u.onFocus,C=u.onReady,S=u.onChange,F=u.onEscape,O=u.onClick,J=u.onLoadError,G=u.onLoaderStart,me=u.onNetworksChange,ne=u.onConfirm,Ne=u.onCancel,re=u.onShippingAddressChange,Ee=u.onShippingRateChange,fe=u.onSavedPaymentMethodRemove,Re=u.onSavedPaymentMethodUpdate,ge=u.onAvailablePaymentMethodsChange,Q=nt("mounts <".concat(o,">")),ee="elements"in Q?Q.elements:null,M="checkoutSdk"in Q?Q.checkoutSdk:null,ye=x.useState(null),ce=ln(ye,2),I=ce[0],he=ce[1],_=x.useRef(null),ae=x.useRef(null);j(I,"blur",A),j(I,"focus",k),j(I,"escape",F),j(I,"click",O),j(I,"loaderror",J),j(I,"loaderstart",G),j(I,"networkschange",me),j(I,"confirm",ne),j(I,"cancel",Ne),j(I,"shippingaddresschange",re),j(I,"shippingratechange",Ee),j(I,"savedpaymentmethodremove",fe),j(I,"savedpaymentmethodupdate",Re),j(I,"availablepaymentmethodschange",ge),j(I,"change",S);var U;C&&(e==="expressCheckout"?U=C:U=function(){C(I)}),j(I,"ready",U),x.useLayoutEffect(function(){if(_.current===null&&ae.current!==null&&(ee||M)){var w=null;if(M){var B=M,ve=M;switch(e){case"paymentForm":w=ve.createForm(h);break;case"payment":w=B.createPaymentElement(h);break;case"address":if("mode"in h){var be=h.mode,Be=pr(h,Sr);if(be==="shipping")w=B.createShippingAddressElement(Be);else if(be==="billing")w=B.createBillingAddressElement(Be);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":w=B.createExpressCheckoutElement(h);break;case"currencySelector":w=M.createCurrencySelectorElement();break;case"taxId":w=B.createTaxIdElement(h);break;case"contactDetails":w=B.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in M)w=M.createLinkSignupElement(h);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":w=B.createTermsElement(h);break;default:throw new Error("<".concat(o,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else ee&&(w=ee.create(e,h));_.current=w,he(w),w&&w.mount(ae.current)}},[ee,M,h]);var le=tt(h);return x.useEffect(function(){if(_.current){var w=un(h,le,["paymentRequest"]);w&&"update"in _.current&&_.current.update(w)}},[h,le]),x.useLayoutEffect(function(){return function(){if(_.current&&typeof _.current.destroy=="function")try{_.current.destroy(),_.current=null}catch{}}},[]),x.createElement("div",{id:v,className:b,ref:ae})},l=function(u){nt("mounts <".concat(o,">"));var v=u.id,b=u.className;return x.createElement("div",{id:v,className:b})},d=n?l:s;return d.propTypes={id:P.default.string,className:P.default.string,onChange:P.default.func,onBlur:P.default.func,onFocus:P.default.func,onReady:P.default.func,onEscape:P.default.func,onClick:P.default.func,onLoadError:P.default.func,onLoaderStart:P.default.func,onNetworksChange:P.default.func,onConfirm:P.default.func,onCancel:P.default.func,onShippingAddressChange:P.default.func,onShippingRateChange:P.default.func,onSavedPaymentMethodRemove:P.default.func,onSavedPaymentMethodUpdate:P.default.func,onAvailablePaymentMethodsChange:P.default.func,options:P.default.object},d.displayName=o,d.__elementType=e,d},E=typeof window>"u",Pr=x.createContext(null);Pr.displayName="EmbeddedCheckoutProviderContext";var yn=function(){var e=nt("calls useStripe()"),n=e.stripe;return n},ca=N("auBankAccount",E),la=N("card",E),ua=N("cardNumber",E),pa=N("cardExpiry",E),da=N("cardCvc",E),ma=N("currencySelector",E),fa=N("iban",E),hn=N("payment",E),ga=N("expressCheckout",E),ya=N("paymentRequestButton",E),ha=N("linkAuthentication",E),va=N("linkSignup",E),ba=N("contactDetails",E),xa=N("address",E),ka=N("shippingAddress",E),Ca=N("paymentMethodMessaging",E),Sa=N("taxId",E),wa=N("issuingCardNumberDisplay",E),Pa=N("issuingCardCvcDisplay",E),Na=N("issuingCardExpiryDisplay",E),Ea=N("issuingCardPinDisplay",E),Ra=N("issuingCardCopyButton",E),Ia=N("terms",E);function Me(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Me=function(e){return typeof e}:Me=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(t)}var xn="dahlia",Nr=function(e){return e===3?"v3":e},kn="https://js.stripe.com",Er="".concat(kn,"/").concat(xn,"/stripe.js"),Rr=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Ir=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,vn="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Ar=function(e){return Rr.test(e)||Ir.test(e)},Lr=function(){for(var e=document.querySelectorAll('script[src^="'.concat(kn,'"]')),n=0;n<e.length;n++){var a=e[n];if(Ar(a.src))return a}return null},bn=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",a=document.createElement("script");a.src="".concat(Er).concat(n);var o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return o.appendChild(a),a},Or=function(e,n){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},we=null,De=null,Fe=null,Tr=function(e){return function(n){e(new Error("Failed to load Stripe.js",{cause:n}))}},jr=function(e,n){return function(){window.Stripe?e(window.Stripe):n(new Error("Stripe.js not available"))}},qr=function(e){return we!==null?we:(we=new Promise(function(n,a){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&e&&console.warn(vn),window.Stripe){n(window.Stripe);return}try{var o=Lr();if(o&&e)console.warn(vn);else if(!o)o=bn(e);else if(o&&Fe!==null&&De!==null){var s;o.removeEventListener("load",Fe),o.removeEventListener("error",De),(s=o.parentNode)===null||s===void 0||s.removeChild(o),o=bn(e)}Fe=jr(n,a),De=Tr(a),o.addEventListener("load",Fe),o.addEventListener("error",De)}catch(l){a(l);return}}),we.catch(function(n){return we=null,Promise.reject(n)}))},_r=function(e,n,a){if(e===null)return null;var o=n[0];if(typeof o!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(Me(o)," instead."));var s=o.match(/^pk_test/),l=Nr(e.version),d=xn;s&&l!==d&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(d,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var p=e.apply(void 0,n);return Or(p,a),p},Pe,Cn=!1,Sn=function(){return Pe||(Pe=qr(null).catch(function(e){return Pe=null,Promise.reject(e)}),Pe)};Promise.resolve().then(function(){return Sn()}).catch(function(t){Cn||console.warn(t)});var wn=function(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];Cn=!0;var o=Date.now();return Sn().then(function(s){return _r(s,n,o)})};var Dr="sf:gclid",Fr="sf:fbclid",Mr=2160*60*60*1e3;function En(){return typeof window<"u"}function Pn(t){let e=Ce.getItem(t);if(!e)return"";try{let{v:n,t:a}=JSON.parse(e);return!n||typeof a!="number"||Date.now()-a>Mr?"":n}catch{return""}}function Nn(t){if(!En())return"";let e=t.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Rn(){if(!En())return{};let t=Pn(Dr),e=Pn(Fr),n=Nn("_fbp"),a=Nn("_fbc");!a&&e&&(a=`fb.1.${Date.now()}.${e}`);let o={};return t&&(o.gclid=t),e&&(o.fbclid=e),n&&(o.fbp=n),a&&(o.fbc=a),o}var In="sf:meta-purchases",Ur=20;function Ln(){return typeof window>"u"||window.parent!==window}function Wr(...t){try{if(Ln()||typeof window.fbq!="function")return;window.fbq(...t)}catch{}}var An=new Set;function $r(t){if(An.has(t))return!1;An.add(t);try{let e=JSON.parse(Ce.getItem(In)??"[]");if(e.includes(t))return!1;Ce.setItem(In,JSON.stringify([...e,t].slice(-Ur)))}catch{}return!0}function Kr(t){return[...new Set(t.filter(Se).flatMap(e=>e.components.map(n=>n.partNumber)))]}function On(t){let e=t.confirmation;Ln()||!$r(e.orderNumber)||Wr("track","Purchase",{value:Number(e.grandTotal),currency:e.currency,content_type:"product",content_ids:Kr(t.lines)},{eventID:e.orderNumber})}var at="checkout-afterpay-context",Ue="checkout-gocardless-context",ot="checkout-zip-context",We="checkout-klarna-context";function Yr({evidence:t,parked:e}){return t?{action:"capture",evidence:t,parked:e}:e?{action:"settle",parked:e}:{action:"ignore"}}function zr(t,e){let n=t.getItem(e);if(t.removeItem(e),!n)return null;try{return JSON.parse(n)}catch{return null}}var Tn={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:at,evidenceFrom(t,e){return e==="cancel"||(t.get("status")??"").toUpperCase()==="CANCELLED"?null:t.get("orderToken")},requestFrom:t=>({token:t})},jn={name:"Zip",legParam:"zip",legValues:["return"],storageKey:ot,evidenceFrom(t){let e=(t.get("result")??"").toLowerCase();return e==="cancelled"||e==="declined"?null:t.get("checkoutId")},requestFrom:t=>({checkoutId:t})};async function it(t,e){let n=new URLSearchParams(e.search),a=n.get(t.legParam);if(!a||!t.legValues.includes(a))return;let o=zr(e.storage,t.storageKey),s=t.evidenceFrom(n,a);e.scrubQuery();let l=Yr({evidence:s,parked:o});if(l.action!=="ignore"){if(e.page.clearCart(),l.action==="settle"){e.page.note(`The ${t.name} payment was not completed \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation);return}e.page.setConfirming(!0);try{let d=await e.capture(t.requestFrom(l.evidence));d.status==="paid"?e.page.markPaid():e.page.note(`${t.name} declined the payment \u2014 our team will follow up on payment.`),e.page.land(l.parked?.confirmation??d)}catch{l.parked?(e.page.note(`We could not confirm the ${t.name} payment \u2014 our team will follow up on payment.`),e.page.land(l.parked.confirmation)):e.page.fail(`We could not confirm your ${t.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{e.page.setConfirming(!1)}}}import{Fragment as q,jsx as r,jsxs as c}from"react/jsx-runtime";function qn(t){let e=t.indexOf(`
|
|
3
|
+
`);return e===-1?[t,""]:[t.slice(0,e),t.slice(e+1)]}function _n(t,{canParkContext:e}={canParkContext:!0}){let n=t.paymentMethods,a=[];return n.includes("card")&&a.push({key:"card",title:"Card",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&t.paypalClientId&&a.push({key:"paypal",title:"PayPal",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&a.push({key:"afterpay",title:"Afterpay",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&t.squareApplicationId&&t.squareLocationId&&a.push({key:"square",title:"Card (Square)",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&e&&a.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&a.push({key:"zip",title:"Zip",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&e&&a.push({key:"klarna",title:"Klarna",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),a.push({key:"bank",title:"Bank transfer",body:null,price:r("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),a}function lt({site:t,logo:e,preview:n=!1}){let{items:a,totals:o,coupon:s,refuseCoupon:l,deliveryOptions:d,shippingMethodId:p,setShippingMethodId:u,identify:v,clearCapturedCart:b}=Xe(),f=d.find(i=>i.id===p)?.pickupLocation??null,{country:h,countries:A,activeCountry:k,formatMoney:C}=oe(),[S,F]=g(()=>_n(t)[0].key),[O,J]=g(!0);z(()=>{J(At(H))},[]);let[G,me]=g(!1),[ne,Ne]=g(""),[re,Ee]=g(""),[fe,Re]=g(""),[ge,Q]=g(""),[ee,M]=g(""),[ye,ce]=g(""),[I,he]=g(""),[_,ae]=g(""),[U,le]=g(()=>h||A[0]?.code||""),[w,B]=g(""),[ve,be]=g([]),Wn=Ye(()=>A.find(i=>i.code===U)??k,[A,U,k])?.postalLabel||"Postal Code",$n=ve[0]?.divisionType||"State / Province";z(()=>{if(!U){be([]);return}let i=!1;return T.listCountrySubdivisions(U).then(m=>{i||(be(m),B(""))}),()=>{i=!0}},[U]);let[X,ut]=g(null),[pt,dt]=g([]),[Ie,Ae]=g("new"),[He,mt]=g(!1),[ft,Kn]=g("Home"),[gt,yt]=g(null),[W]=g(()=>Ht()),[Le,$]=g(null),[ht,xe]=g(null),[vt,Yn]=g(null),[zn,Bn]=g(!1),[Hn,Gn]=g(!1),[V,Ge]=g(null),[bt,ue]=g(!1),[xt,Z]=g(null),[Vn,Jn]=g(!1),[Xn,kt]=g(!1),[Zn,Qn]=g(!1),[er,Ct]=g(!1),St=se(!1);z(()=>{n||St.current||!a.some(Se)||(St.current=!0,qt({lines:a,currency:o.currency,value:o.subtotal-o.discount,coupon:s?.valid?s.code:void 0}))},[a,o,s,n]),z(()=>{v(ne,re.trim()||void 0)},[ne,re,v]);let wt=se(null),[Oe,tr]=g(null);z(()=>{let i=wt.current;if(!Oe||!i)return;let m=()=>i.style.setProperty("--sf-checkout-header-h",`${Oe.offsetHeight}px`);m();let y=new ResizeObserver(m);return y.observe(Oe),()=>y.disconnect()},[Oe]),z(()=>{let i=y=>({setConfirming:y,land:$,markPaid:()=>ue(!0),note:Z,fail:xe,clearCart:b}),m={search:window.location.search,storage:H,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};it(Tn,{...m,capture:T.captureAfterpayPayment,page:i(Jn)}),it(jn,{...m,capture:T.captureZipPayment,page:i(Qn)})},[]),z(()=>{let m=new URLSearchParams(window.location.search).get("gocardless");if(m!=="confirm"&&m!=="cancel")return;let y=H.getItem(Ue);if(H.removeItem(Ue),window.history.replaceState(null,"",window.location.pathname),!y)return;let R;try{R=JSON.parse(y)}catch{return}if(b(),m==="cancel"){Z("The direct debit was not set up \u2014 our team will follow up on payment."),$(R.confirmation);return}kt(!0),T.completeGocardlessPayment({idempotencyKey:R.idempotencyKey}).then(L=>{L.status==="paid"?ue(!0):L.status==="declined"?Z("The direct debit was declined \u2014 our team will follow up on payment."):Z("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{Z("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{$(R.confirmation),kt(!1)})},[]),z(()=>{let i=new URLSearchParams(window.location.search),m=i.get("klarna");if(m!=="confirm"&&m!=="cancel")return;let y=H.getItem(We);H.removeItem(We);let R=i.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!y)return;let L;try{L=JSON.parse(y)}catch{return}if(b(),m==="cancel"||!R){Z("The Klarna payment was not completed \u2014 our team will follow up on payment."),$(L.confirmation);return}Ct(!0),T.captureKlarnaPayment({idempotencyKey:L.idempotencyKey,authorizationToken:R}).then(D=>{D.status==="paid"?ue(!0):D.status==="declined"?Z("Klarna declined the payment \u2014 our team will follow up on payment."):Z("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{Z("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{$(L.confirmation),Ct(!1)})},[]);function Pt(i){let[m,y]=qn(i.address);Q(m),M(y),ce(i.city),he(i.zip_code),i.country&&le(i.country),i.phone&&ae(i.phone)}z(()=>{let i=!1;return(async()=>{try{let[m,y,R]=await Promise.all([pe.me(),pe.myProfile().catch(()=>null),pe.myAddresses().catch(()=>[])]);if(i)return;ut(m);let L=R.filter(ke=>ke.is_active);dt(L),Ne(m.email);let D=(y?.contact_name??"").split(/\s+/);Ee(m.first_name||D[0]||""),Re(m.last_name||D.slice(1).join(" "));let Et=m.phone||y?.phone;Et&&ae(Et);let Ve=L.find(ke=>ke.id===m.default_delivery_location)??L[0];if(Ve)Ae(Ve.id),Pt(Ve);else if(y){let[ke,ar]=qn(y.address??"");Q(ke),M(ar),ce(y.city??""),he(y.zip_code??""),y.country&&le(y.country)}}catch{}})(),()=>{i=!0}},[]);function nr(){pe.logout(),ut(null),dt([]),Ae("new"),mt(!1)}let Te=Ye(()=>_n(t,{canParkContext:O}),[t,O]);z(()=>{Te.some(i=>i.key===S)||F(Te[0].key)},[Te,S]);let Nt=ee.trim()?`${ge}
|
|
4
|
+
${ee.trim()}`:ge;async function rr(){if(n||G||a.length===0||o.repricing)return;let i=a.filter(Se).flatMap(m=>jt(m.components,m.qty));if(i.length===0){xe("Pick a size on each wheel's product page before checking out.");return}me(!0),xe(null);try{let y=await(X?T.createOrderAuthed:T.createOrder)({customer:{email:ne,name:`${re} ${fe}`.trim(),phone:_.trim()||void 0,address:Nt,city:ye,state:w||void 0,zipCode:I,country:U},items:i,currency:o.currency,idempotencyKey:W,shippingMethodId:p??void 0,couponCode:Ot(s),...Rn()});if(_t({confirmation:y,lines:a,adsSendTo:t.googleAdsId&&t.googleAdsConversionLabel?`${t.googleAdsId}/${t.googleAdsConversionLabel}`:null}),On({confirmation:y,lines:a}),b(),X&&He&&Ie==="new")try{await pe.createAddress({label:ft.trim()||"Home",contact_name:`${re} ${fe}`.trim(),phone:_.trim(),address:Nt,city:ye,zip_code:I,country:U}),yt("Address saved to your account.")}catch{yt("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}if(S==="card"&&t.paymentMethods.includes("card")){let R=await T.createPaymentIntent({idempotencyKey:W});Ge(y),Yn(R)}else if(S==="paypal"&&t.paymentMethods.includes("paypal"))Ge(y),Bn(!0);else if(S==="afterpay"&&t.paymentMethods.includes("afterpay")){let R=window.location.origin,L=await T.createAfterpayCheckout({idempotencyKey:W,confirmUrl:`${R}/checkout?afterpay=confirm`,cancelUrl:`${R}/checkout?afterpay=cancel`}),D={idempotencyKey:W,confirmation:y};H.setItem(at,JSON.stringify(D)),window.location.assign(L.redirectCheckoutUrl);return}else if(S==="square"&&t.paymentMethods.includes("square"))Ge(y),Gn(!0);else if(S==="gocardless"&&t.paymentMethods.includes("gocardless")){let R=window.location.origin,L=await T.createGocardlessBillingRequest({idempotencyKey:W,confirmUrl:`${R}/checkout?gocardless=confirm`,cancelUrl:`${R}/checkout?gocardless=cancel`}),D={idempotencyKey:W,confirmation:y};H.setItem(Ue,JSON.stringify(D)),window.location.assign(L.authorisationUrl);return}else if(S==="zip"&&t.paymentMethods.includes("zip")){let R=window.location.origin,L=await T.createZipCheckout({idempotencyKey:W,redirectUrl:`${R}/checkout?zip=return`}),D={idempotencyKey:W,confirmation:y};H.setItem(ot,JSON.stringify(D)),window.location.assign(L.redirectUrl);return}else if(S==="klarna"&&t.paymentMethods.includes("klarna")){let R=window.location.origin,L=await T.createKlarnaCheckout({idempotencyKey:W,confirmUrl:`${R}/checkout?klarna=confirm`,cancelUrl:`${R}/checkout?klarna=cancel`}),D={idempotencyKey:W,confirmation:y};H.setItem(We,JSON.stringify(D)),window.location.assign(L.redirectUrl);return}else $(y)}catch(m){let y=Tt(m);y?(l(y),xe(`${y} Your order has not been placed. Place it again to continue without the code.`)):xe(m instanceof je?m.message:"Could not place the order. Please try again."),me(!1)}}return Le?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:bt?"Payment received":"Order received"}),c("p",{className:"text-fg-dim",children:[bt?c(q,{children:["Thank you \u2014 your payment for order"," ",r("span",{className:"font-mono text-fg",children:Le.orderNumber})," has gone through."," "]}):c(q,{children:["Thank you \u2014 your order ",r("span",{className:"font-mono text-fg",children:Le.orderNumber})," is being reviewed by our team."," "]}),X?c(q,{children:["Track it under"," ",r(te,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):r(q,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),xt&&r("p",{className:"text-sm text-fg-dim",children:xt}),gt&&r("p",{className:"text-sm text-fg-dim",children:gt}),!X&&c("p",{className:"text-sm text-fg-dim",children:["You can also"," ",r(te,{href:`/track?order=${encodeURIComponent(Le.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),r(te,{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"})]}):Vn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):Xn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):Zn?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):er?c("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[r("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):vt?r(Br,{payment:vt,onPaid:()=>{ue(!0),$(V)},onSkip:()=>$(V)}):zn&&V?r(Vr,{confirmation:V,clientId:t.paypalClientId??"",idemKey:W,onPaid:()=>{ue(!0),$(V)},onSkip:()=>$(V)}):Hn&&V?r(Xr,{confirmation:V,applicationId:t.squareApplicationId??"",locationId:t.squareLocationId??"",environment:t.squareEnvironment??"production",idemKey:W,onPaid:()=>{ue(!0),$(V)},onSkip:()=>$(V)}):c("div",{ref:wt,className:"bg-bg text-fg",children:[c("header",{ref:tr,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:[c(te,{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",r("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),r(te,{href:"/","aria-label":`${t.name} home`,className:"inline-flex items-center justify-center",children:r(Kt,{variant:"header",scrolled:!0,src:e?.url??null,reverse:e?.reverse??!1,reversedSrc:e?.reversed??null,inkIsDark:e?.inkIsDark??null,size:e?.size??"medium",sizePx:e?.sizePx??null,siteName:t.name})}),t.cardPayments?c("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[r("span",{className:"text-green",children:"\u25CF"}),r("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):r("span",{})]}),c("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:[r("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),r("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(i=>c("span",{className:["relative flex items-center gap-2 transition-colors",i.state==="pending"?"text-fg-dim":"text-fg",i.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[r("span",{className:i.state==="done"?"text-accent font-bold":"",children:i.n}),r("span",{children:i.label})]},i.n))})]}),c("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:[c("div",{children:[c($e,{num:"N\xB0 01",title:"Contact",children:[r(K,{label:"Email",hint:X?c(q,{children:["Signed in \xB7"," ",r("button",{type:"button",onClick:nr,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:r("input",{type:"email",value:ne,onChange:i=>Ne(i.target.value),placeholder:"you@example.com",readOnly:X!==null,className:Y+(X?" opacity-70":"")})}),c(Fn,{children:[r(K,{label:"First name",children:r("input",{type:"text",value:re,onChange:i=>Ee(i.target.value),className:Y})}),r(K,{label:"Last name",children:r("input",{type:"text",value:fe,onChange:i=>Re(i.target.value),className:Y})})]})]}),c($e,{num:"N\xB0 02",title:f?"Collection":"Shipping address",children:[f?c("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[r("span",{className:"font-medium",children:f.name}),[f.address,f.city,f.state,f.zipCode,f.country].filter(Boolean).length>0&&r("span",{className:"opacity-80",children:[f.address,f.city,f.state,f.zipCode,f.country].filter(Boolean).join(", ")}),f.openingHours&&r("span",{className:"opacity-80",children:f.openingHours}),f.instructions&&r("span",{className:"opacity-80",children:f.instructions}),r("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):c(q,{children:[X!==null&&pt.length>0&&c("div",{className:"grid gap-3",children:[pt.map(i=>r(Ke,{active:Ie===i.id,onClick:()=>{Ae(i.id),Pt(i)},title:i.label,body:i.formatted_address,price:null},i.id)),r(Ke,{active:Ie==="new",onClick:()=>Ae("new"),title:"New address",body:null,price:null})]}),r(K,{label:"Address line 1",children:r("input",{type:"text",value:ge,onChange:i=>Q(i.target.value),className:Y})}),r(K,{label:"Address line 2",children:r("input",{type:"text",value:ee,onChange:i=>M(i.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:Y})}),c(Fn,{cols:"three",children:[r(K,{label:"City",children:r("input",{type:"text",value:ye,onChange:i=>ce(i.target.value),className:Y})}),r(K,{label:Wn,children:r("input",{type:"text",value:I,onChange:i=>he(i.target.value),className:Y})}),r(K,{label:"Country",separate:!0,children:r(Qe,{value:U,onChange:i=>le(i.target.value),className:Y+" pr-10",style:Dn,children:A.map(i=>r("option",{value:i.code,children:i.name},i.code))})})]}),r(K,{label:$n,separate:!0,children:ve.length>0?c(Qe,{value:w,onChange:i=>B(i.target.value),className:Y+" pr-10",style:Dn,children:[r("option",{value:"",children:"Select\u2026"}),ve.map(i=>r("option",{value:i.code||i.name,children:i.name},i.code||i.name))]}):r("input",{type:"text",value:w,onChange:i=>B(i.target.value),className:Y})})]}),r(K,{label:"Phone",children:r("input",{type:"tel",value:_,onChange:i=>ae(i.target.value),placeholder:"+44 7700 900000",className:Y})}),!f&&X!==null&&Ie==="new"&&c(q,{children:[r(Zr,{checked:He,onChange:mt,label:"Save this address to my account"}),He&&r(K,{label:"Address label",children:r("input",{type:"text",value:ft,onChange:i=>Kn(i.target.value),placeholder:"Home",className:Y})})]})]}),r($e,{num:"N\xB0 03",title:"Shipping",children:c("div",{className:"grid gap-3",children:[d.map(i=>{let m=i.pickupLocation,y=m?[m.address,m.city,m.state,m.zipCode].filter(Boolean).join(", "):null;return r(Ke,{active:p===i.id,onClick:()=>u(i.id),title:m?`${i.name} \u2014 ${m.name}`:i.name,body:m?[y,m.openingHours,m.instructions,i.description].filter(Boolean).join(" \xB7 "):i.description||null,price:o.freeShipping||i.amount===0?qe:C(i.amount,o.currency),tag:i.tag||void 0},i.id)}),d.length===0&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),c($e,{num:"N\xB0 04",title:"Payment",children:[r("div",{className:"grid gap-3",children:Te.map(i=>r(Ke,{active:S===i.key,onClick:()=>F(i.key),title:i.title,body:i.body,price:i.price,tag:i.tag},i.key))}),S==="card"?r("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."}):S==="paypal"?r("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."}):S==="afterpay"?r("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."}):S==="square"?r("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."}):S==="gocardless"?r("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."}):S==="zip"?r("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."}):S==="klarna"?r("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."}):r("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."})]})]}),c("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:[c("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:[r("span",{children:"Your order"}),r(te,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),r("div",{className:"flex flex-col px-6 py-2",children:a.length===0?c("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",r(te,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):a.map(i=>r(Qr,{slug:i.slug,name:i.name,qty:i.qty,config:i.config,configSummary:ea(i.config),price:Ut(i,o.currency)??0,currency:o.currency},i.id))}),r("div",{className:"border-t border-line px-6 pt-5",children:r(Bt,{customerEmail:ne})}),c("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[r(ie,{label:"Subtotal",value:C(o.subtotal,o.currency)}),o.discount>0&&s?.valid&&r(ie,{label:`Coupon \xB7 ${s.code}`,value:c("span",{className:"font-semibold text-green",children:["\u2212 ",C(o.discount,o.currency)]})}),s?.deferred&&r(ie,{label:`Coupon \xB7 ${s.code}`,value:Lt}),s?.valid&&s.effects?.gift&&r(ie,{label:`Free gift \xB7 ${s.effects.gift.partNumber}${s.effects.gift.quantity>1?` \xD7${s.effects.gift.quantity}`:""}`,value:r("span",{className:"font-semibold text-green",children:qe})}),r(ie,{label:"Shipping",value:o.shippingStatus==="free"?r("span",{className:"font-semibold text-green",children:qe}):Ft(o.shippingStatus)??C(o.shipping,o.currency)}),o.tax&&(o.tax.charged?r(ie,{label:o.tax.inclusive?`${o.tax.name} included \xB7 ${o.tax.rate}%`:o.tax.name,value:C(o.tax.amount,o.currency)}):o.tax.name?r(ie,{label:o.tax.name,value:Dt}):null)]}),c("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:[r("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),r("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:o.repricing?"\u2026":C(o.grand,o.currency)})]}),c("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[ht&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:ht}),o.hasUnpricedLine&&c("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 ",o.currency,". Remove them, or switch region, to continue."]}),r("button",{type:"button",onClick:rr,disabled:G||a.length===0||o.hasUnpricedLine||o.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",a.length===0||G||o.hasUnpricedLine||o.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:G?c(q,{children:["Building order\u2026 ",r("span",{children:"\xB7"})]}):o.repricing?c(q,{children:["Updating total\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:[S==="bank"?"Place order":"Continue to payment"," \xB7"," ",C(o.grand,o.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})]}),r("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:r("span",{children:$t({legalName:t.legalName,foundedYear:t.foundedYear,siteName:t.name})})})]})}var Y="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",Dn={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 $e({num:t,title:e,children:n}){return c("section",{className:"mb-6 border border-line bg-bg",children:[c("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[r("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:t}),r("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:e})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Fn({cols:t="two",children:e}){return r("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:e})}function Ke({active:t,onClick:e,title:n,body:a,price:o,tag:s}){return c("button",{type:"button",onClick:e,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"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:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&r("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),r("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&r("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),c("span",{className:"flex min-w-0 flex-col gap-1",children:[c("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,s&&r("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:s})]}),a&&r("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:a})]}),r("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:o})]})}function Br({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=oe(),o=Ye(()=>wn(t.publishableKey),[t.publishableKey]),s=Ye(()=>{if(typeof document>"u")return;let l=getComputedStyle(document.documentElement),d=(u,v)=>l.getPropertyValue(u).trim()||v,p=document.documentElement.getAttribute("data-theme")!=="light";return{theme:p?"night":"stripe",variables:{colorPrimary:d("--accent",p?"#c9a461":"#8a6a2a"),colorBackground:d("--site-surface",p?"#131313":"#ffffff"),colorText:d("--fg",p?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("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:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:a(Number(t.amount),t.currency)})," ","by card to confirm it now."]}),r(rt,{stripe:o,options:{clientSecret:t.clientSecret,appearance:s},children:r(Hr,{payment:t,onPaid:e,onSkip:n})})]})]})})}function Hr({payment:t,onPaid:e,onSkip:n}){let{formatMoney:a}=oe(),o=yn(),s=fn(),[l,d]=g(!1),[p,u]=g(null);async function v(){if(!o||!s||l)return;d(!0),u(null);let b=await o.confirmPayment({elements:s,redirect:"if_required"});if(b.error){u(b.error.message??"Payment failed. Please try again."),d(!1);return}let f=b.paymentIntent?.status;if(f==="succeeded"||f==="processing"){e();return}u("Payment did not complete. Please try again."),d(!1)}return c("div",{className:"flex flex-col gap-4",children:[r(hn,{}),p&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:p}),r("button",{type:"button",onClick:v,disabled:!o||!s||l,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!o||!s||l?"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:l?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",a(Number(t.amount),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:n,disabled:l,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 Mn="paypal-sdk-js",st=null;function Gr(t,e){let n=`${t}|${e}`;if(st?.key===n)return st.promise;let a=new Promise((o,s)=>{document.getElementById(Mn)?.remove();let l=document.createElement("script");l.id=Mn;let d=new URLSearchParams({"client-id":t,currency:e,intent:"capture"});l.src=`https://www.paypal.com/sdk/js?${d}`,l.onload=()=>{let p=window.paypal;p?o(p):s(new Error("PayPal SDK loaded without its namespace"))},l.onerror=()=>s(new Error("PayPal SDK failed to load")),document.head.appendChild(l)});return st={key:n,promise:a},a}function Vr({confirmation:t,clientId:e,idemKey:n,onPaid:a,onSkip:o}){let{formatMoney:s}=oe(),l=se(null),[d,p]=g(!1),[u,v]=g(null),b=se(a);return b.current=a,z(()=>{let f=!1,h=null;return Gr(e,t.currency).then(A=>{if(!(f||!l.current))return h=A.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await T.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async k=>{try{if((await T.capturePaypalOrder({idempotencyKey:n,paypalOrderId:k.orderID})).status==="paid"){b.current();return}v("PayPal did not complete the payment. Please try again.")}catch(C){v(C instanceof je?C.message:"PayPal payment failed. Please try again.")}},onError:()=>{v("PayPal could not process the payment. Please try again.")}}),h.render(l.current).then(()=>{f||p(!0)})}).catch(()=>{f||v("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{f=!0,h?.close?.()}},[e,t.currency,n]),r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("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:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:s(Number(t.grandTotal),t.currency)})," ","with PayPal to confirm it now."]}),!d&&!u&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),r("div",{ref:l}),u&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:u}),r("button",{type:"button",onClick:o,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 Un="square-web-sdk",ct=null;function Jr(t){let e=t==="sandbox"?"sandbox":"production";if(ct?.key===e)return ct.promise;let n=new Promise((a,o)=>{document.getElementById(Un)?.remove();let s=document.createElement("script");s.id=Un,s.src=e==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",s.onload=()=>{let l=window.Square;l?a(l):o(new Error("Square SDK loaded without its namespace"))},s.onerror=()=>o(new Error("Square SDK failed to load")),document.head.appendChild(s)});return ct={key:e,promise:n},n}function Xr({confirmation:t,applicationId:e,locationId:n,environment:a,idemKey:o,onPaid:s,onSkip:l}){let{formatMoney:d}=oe(),p=se(null),u=se(null),v=se(null),[b,f]=g(!1),[h,A]=g(!1),[k,C]=g(null);z(()=>{let F=!1,O=null;return Jr(a).then(async J=>{if(F||!p.current)return;let G=J.payments(e,n);v.current=G,O=await G.card(),await O.attach(p.current),u.current=O,F||f(!0)}).catch(()=>{F||C("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{F=!0,O?.destroy?.()}},[e,n,a]);async function S(){let F=u.current;if(!(!F||h)){A(!0),C(null);try{let O=await F.tokenize();if(O.status!=="OK"||!O.token){C(O.errors?.[0]?.message??"Please check the card details and try again."),A(!1);return}let J;try{J=(await v.current?.verifyBuyer?.(O.token,{amount:String(t.grandTotal),currencyCode:t.currency,intent:"CHARGE"}))?.token}catch{}if((await T.chargeSquare({idempotencyKey:o,sourceId:O.token,...J?{verificationToken:J}:{}})).status==="paid"){s();return}C("Square did not complete the payment. Please try again.")}catch(O){C(O instanceof je?O.message:"Square payment failed. Please try again.")}A(!1)}}return r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:c("div",{className:"w-full max-w-xl border border-line bg-bg",children:[c("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[r("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:t.orderNumber}),r("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),c("div",{className:"flex flex-col gap-4 px-6 py-6",children:[c("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",r("span",{className:"text-fg",children:d(Number(t.grandTotal),t.currency)})," ","by card to confirm it now."]}),!b&&!k&&r("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),r("div",{ref:p}),k&&r("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),r("button",{type:"button",onClick:S,disabled:!b||h,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!b||h?"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:h?c(q,{children:["Processing\u2026 ",r("span",{children:"\xB7"})]}):c(q,{children:["Pay ",d(Number(t.grandTotal),t.currency),r("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),r("button",{type:"button",onClick:l,disabled:h,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"})]})]})})}function Zr({checked:t,onChange:e,label:n,sub:a}){return c("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[r("button",{type:"button",onClick:()=>e(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&r("span",{className:"text-[13px] text-accent",children:"\u2713"})}),c("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,a&&r("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:a})]})]})}function Qr({slug:t,name:e,qty:n,config:a,configSummary:o,price:s,currency:l}){let{catalog:d}=Xe(),{formatMoney:p}=oe(),u=d.find(k=>k.slug===t),v=u?.spokes??5,b=u?.mesh??!1,f=a.find(k=>k.gold)?.label,h=u?.finishes.find(k=>k.name===f&&k.src)??u?.finishes.find(k=>k.src),A=u?.finishes[0]?.color??Yt;return c("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[c("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[r("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}),h?.src?r(Rt,{src:h.src,alt:`${e.lead}${e.accent} \u2014 ${h.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):r("div",{className:"block w-[78%]",style:{color:A},children:r(zt,{spokes:v,mesh:b,className:"block w-full"})})]}),c("div",{className:"flex min-w-0 flex-col gap-0.5",children:[c("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[e.lead,r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:e.accent})]}),r("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:o})]}),r("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:p(s,l)})]})}function ie({label:t,value:e}){return c("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[r("span",{children:t}),r("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:e})]})}function ea(t){return t.map(e=>e.label).join(" \xB7 ")}import{jsx as ze}from"react/jsx-runtime";function ta(){let{settings:t,websiteName:e}=It(),n=e?{...Ze,name:e}:Ze,a=t?{url:t.logoUrl,reversed:t.logoReversed??null,inkIsDark:t.logoInkIsDark??null,reverse:t.reverseLogo,size:t.logoSize,sizePx:t.logoSizePx}:null;return ze("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:ze(Mt,{children:ze(Wt,{preview:!0,children:ze(lt,{site:n,logo:a,preview:!0})})})})}export{ta as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{fi as t}from"./chunk-X6N32X46.js";import"./chunk-MRRGYKU2.js";import"./chunk-UBIWN5OB.js";import"./chunk-Y6SLVHK3.js";import{jsx as e}from"react/jsx-runtime";import{default as r}from"efficient-easel/screen/components/ScreenStoreProvider";function p(o){return e(r,{...o,parts:t})}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as rt,j as pe,r as ot,t as it,u as at,w as H}from"./chunk-PF2VDYSO.js";import{Aa as et,Da as De,Ea as tt,za as me}from"./chunk-MRRGYKU2.js";import{e as Ze,q as nt,s as re}from"./chunk-UBIWN5OB.js";import{createContext as rn,useContext as on,useEffect as an,useMemo as ge,useState as ut}from"react";function st(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function oe(e,t){if(e.length===0)return null;let n=0;for(let r of e){let i=r.prices?.[t];if(typeof i!="number"||!Number.isFinite(i)||i<=0)return null;n+=i*r.wheels}return n}var Oe=4,yr=1,hr={unit:"set",spares:0,spareSide:"left"};function lt(e){return e.unit==="single"?1:Oe+e.spares}function br(e,t){return[{partNumber:e.partNumber,wheels:lt(t),prices:e.prices}]}function xr(e,t){let n=lt(t)-Oe;if(n<=0||e.length===0)return e;let r=tn(e),i=r?r[t.spareSide]:0;return e.map((o,a)=>a===i?{...o,wheels:o.wheels+n}:o)}function tn(e){let t,n;for(let r=0;r<e.length;r+=1){let i=e[r].hand;if(i!=="left"&&i!=="right")continue;if((i==="left"?t:n)!==void 0)return null;i==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function nn(e,t){return t.spares>0?`${e} + spare`:e}function Cr(e){return e.unit==="single"?"Single":nn(`Set of ${Oe}`,e)}var Sr="data-add-to-basket",Fe=9,Pe="en";function fe(e,t,n=0){return new Intl.NumberFormat(Pe,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}function vr(e,t){return new Intl.NumberFormat(Pe,{style:"currency",currency:t}).format(e)}import{jsx as un}from"react/jsx-runtime";var ct="storefront-country",dt=rn(null);function sn(e){return mt(e,"catalogue")}function ln(e){return mt(e,"money")}function mt(e,t){let n=new Map(e.map(i=>[i.code,i.decimalPlaces])),r=new Map;return(i,o)=>{if(!o)return"";let a=r.get(o);if(!a){let s=n.get(o)??0;a=new Intl.NumberFormat(Pe,{style:"currency",currency:o,minimumFractionDigits:t==="money"?s:0,maximumFractionDigits:s}),r.set(o,a)}return a.format(i)}}function Lr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:i}){let o=ge(()=>t??[],[t]),a=ge(()=>n??[],[n]),s=ge(()=>r||o.find(x=>x.isDefault)?.code||o[0]?.code||"",[r,o]),c=ge(()=>i||a.find(x=>x.isDefault)?.code||a[0]?.code||"",[i,a]),[u,p]=ut(c),[d,S]=ut(!1);an(()=>{let x=re.getItem(ct);x&&a.some(w=>w.code===x)&&p(x),S(!0)},[a]);function I(x){p(x),re.setItem(ct,x)}let b=ge(()=>{let x=a.find(L=>L.code===u)??null,w=x?.currency,N=w&&o.some(L=>L.code===w)?w:s,M=sn(o),C=ln(o);return{country:u,currency:N,setCountry:I,currencies:o,countries:a,activeCountry:x,formatPrice:(L,v)=>M(L,v??N),formatMoney:(L,v)=>C(L,v??N),ready:d}},[u,o,a,s,d]);return un(dt.Provider,{value:b,children:e})}function pt(){let e=on(dt);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}import{createContext as Pn,useCallback as R,useContext as In,useEffect as Y,useMemo as wt,useRef as ie,useState as k}from"react";function gt(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var yt="We'll confirm this discount when you place your order.",Rr="Confirmed at checkout";function kr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var ft="coupon_code: ";function Ar(e){return!(e instanceof pe)||e.status!==400||!e.message.startsWith(ft)?null:e.message.slice(ft.length)}function ht(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 Ie="Price on request",dn="Request a quote",mn="from ",Fr="From ",Ur="each",bt="Free";function Ue(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function $e(e,t){let n=e?.[t];return Ue(n)?n:null}function $r(e,t,n,r){let i=$e(e,n),o=$e(t,n);return i===null&&o===null?0:i===null?1:o===null?-1:r==="asc"?i-o:o-i}function Hr(e,t,n,r){if(n==null&&r==null)return!0;let i=$e(e,t);return!(i===null||n!=null&&i<n||r!=null&&i>r)}var pn={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function fn(e,t,n){if(!Ue(e))return pn;let r=Ue(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function qr(e,t,n=""){return!e.priced||e.unit==null?Ie:`${n}${fe(e.unit,t)}`}function Kr(e,t){return e.was==null?null:fe(e.was,t)}function gn(e,t,n=1){let r=oe(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let i=e.reduce((a,s)=>a+s.wheels,0),o=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:o,isFrom:o*i!==r,setTotal:r*n}}var yn={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function Wr(e,t,n,r=1){let i=fn(e.prices[n],e.msrpPrices?.[n],4),o=i.setTotal==null?null:i.setTotal*r;if(!t)return{priced:i.priced,unit:i.unit,isFrom:!0,was:i.was,onSale:i.onSale,setTotal:null,fromSetTotal:o};let a=gn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:o}:{...yn,fromSetTotal:o}}function hn(e,t){return!e.priced||e.unit==null?Ie:`${e.isFrom?mn:""}${fe(e.unit,t)}`}function Br(e,t){return e.was==null?null:fe(e.was,t)}function zr(e,t){return!e.priced||e.unit==null?dn:hn(e,t)}var bn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function xt(e){return bn.test(e.trim())}var Ct="sf:ga-purchases",xn=20;function vt(){return typeof window>"u"||window.parent!==window}function ye(...e){try{if(vt()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function Cn(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:oe(e.components,t)??0,quantity:e.qty}}function He(e,t){return e.filter(we).map(n=>Cn(n,t))}function Qr(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 Et(e,t){let n=He([e],t);n.length!==0&&ye("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Jr(e){let t=He(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 St=new Set;function Sn(e){if(St.has(e))return!1;St.add(e);try{let t=JSON.parse(re.getItem(Ct)??"[]");if(t.includes(e))return!1;re.setItem(Ct,JSON.stringify([...t,e].slice(-xn)))}catch{}return!0}function Zr(e){let t=e.confirmation;if(vt()||!Sn(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:He(e.lines,n)}),e.adsSendTo&&ye("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var vn="Arranged after review",Pt="Calculated at checkout",En=Pt,no=Pt;function It({quoted:e,optionCount:t,chosenAmount:n,couponWaivesFreight:r}){return e&&t===0?"arranged":r?"free":n===void 0?"pending":n===0?"free":"charged"}function ro(e){switch(e){case"arranged":return vn;case"pending":return En;case"free":return bt;case"charged":return null}}import{jsx as Nn}from"react/jsx-runtime";var wn=400,Ln=400,Tn=1500;function we(e){return(e.components?.length??0)>0}function Lt(e,t){return{code:e,valid:t.valid,deferred:gt(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Nt(e,t){return oe(e.components,t)}function qe(e,t){let n=Nt(e,t);return n===null?null:n*e.qty}function Tt(e){return e!=="tyre"}var _t=Pn(null);function yo({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:i}=pt(),[o,a]=k(t),[s,c]=k([]),[u,p]=k([]),[d,S]=k([]),[I,b]=k(!1),[x,w]=k(!1),[N,M]=k(!1),[C,L]=k(!1),[v,q]=k(null),[W,j]=k(void 0),h=ie(r),E=ie("");h.current=h.current||r;let[m,K]=k(null),[Q,G]=k(!1),[A,J]=k(null),Z=ie(void 0),D=R(()=>a(!0),[]),Ce=R(()=>a(!1),[]),O=R(()=>a(l=>!l),[]);Y(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&D()},[D,t]);let Se=R(l=>{L(!0),Tt(l)&&M(!0)},[]),ee=N||s.some(l=>Tt(l.kind)),se=C||s.length>0;Y(()=>{if(t||!ee||I)return;let l=!0;return H.listWheels().then(f=>{l&&(p(f),b(!0))}),()=>{l=!1}},[t,ee,I]),Y(()=>{if(t||!se||x)return;let l=!0;return H.listBundles().then(f=>{l&&(S(f),w(!0))}),()=>{l=!1}},[t,se,x]);let F=v?.deliveryOptions??[];Y(()=>{F.length!==0&&J(l=>l&&F.some(f=>f.id===l)?l:F[0]?.id??null)},[v]);let V=R(()=>s.filter(we).flatMap(l=>st(l.components,l.qty)),[s]),le=R(async(l,f)=>{let y=l.trim().toUpperCase();if(!y)return;let g=V();if(g.length===0){K({code:y,valid:!1,message:"Add a wheel to the cart first."});return}G(!0),Z.current=f;try{let T=await H.validateCoupon({code:y,items:g,currency:n,shippingMethodId:A??void 0,customerEmail:f});K(Lt(y,T))}catch{K({code:y,valid:!1,message:"Could not check that code. Please try again."})}finally{G(!1)}},[V,n,A]),te=R(()=>{K(null),Z.current=void 0},[]),ve=R(l=>{if(!m)return;let{code:f}=m;K(y=>y&&y.code===f?{code:f,valid:!1,refused:!0,message:l}:y)},[m]);Y(()=>{if(!m||m.refused)return;let l=m.code,f=g=>g!==null&&g.code===l&&!g.refused,y=setTimeout(async()=>{let g=V();if(g.length===0){K(T=>f(T)?{code:l,valid:!1,message:"Add a wheel to the cart first."}:T);return}G(!0);try{let T=await H.validateCoupon({code:l,items:g,currency:n,shippingMethodId:A??void 0,customerEmail:Z.current});K(de=>f(de)?Lt(l,T):de)}catch{}finally{G(!1)}},wn);return()=>clearTimeout(y)},[s,n,A]);let ue=m&&!m.refused?m.code:void 0;Y(()=>{if(t)return;let l=!0,f=setTimeout(async()=>{let y=V();if(y.length===0){q(null),j(void 0);return}try{let g=await H.quoteCart({items:y,currency:n,shippingMethodId:A??void 0,couponCode:ue,customerEmail:Z.current||void 0,country:h.current||void 0,subdivision:E.current||void 0});if(!l)return;q(g)}catch{if(!l)return}j(ue)},Ln);return()=>{l=!1,clearTimeout(f)}},[s,n,A,ue,r]);let P=R(l=>{c(f=>{let y=f.findIndex(g=>g.id===l.id);return y===-1?[...f,l]:f.map((g,T)=>T===y?{...g,qty:Math.min(Fe,g.qty+l.qty)}:g)}),Et(l,n)},[n]),U=R(l=>{c(f=>f.filter(y=>y.id!==l))},[]),X=R((l,f)=>{let y=Math.max(1,Math.min(Fe,f));c(g=>g.map(T=>T.id===l?{...T,qty:y}:T))},[]),Ge=R(l=>{c(l)},[]),[ce,Xt]=k(null),Ve=ie(null);Ve.current=ce;let $=ie(null),ke=ie(""),Xe=R((l,f)=>{let y=l.trim().toLowerCase();xt(y)&&Xt(g=>g&&g.email===y&&g.firstName===(f??"")?g:{email:y,firstName:f??""})},[]);Y(()=>{if(t||!ce)return;let l=ht(s.filter(we),g=>qe(g,n)===null?Ie:i(qe(g,n),n)),f={email:ce.email,firstName:ce.firstName,currency:n,items:l},y=JSON.stringify(f);if(y!==ke.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,ke.current=y,H.captureCart(f).catch(g=>{})},Tn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[s,ce,n,t]);let Ye=R(()=>{$.current&&(clearTimeout($.current),$.current=null);let l=Ve.current;l&&(ke.current="",H.captureCart({email:l.email,firstName:l.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),je=wt(()=>{let l=s.reduce((_,ne)=>{let Ee=qe(ne,n);return Ee===null?_:_+Ee},0),f=s.some(_=>Nt(_,n)===null),y=s.reduce((_,ne)=>_+ne.qty,0),g=m?.valid?m.effects:void 0,T=g?Math.min(l,Number(g.discountAmount)):0,de=v?.bundleDiscount??0,jt=v?.appliedBundles??[],Ae=!!g?.freeShipping,Qe=F.find(_=>_.id===A),Je=Ae?0:v?.shipping??Qe?.amount??0,Qt=It({quoted:v!==null,optionCount:F.length,chosenAmount:Qe?.amount,couponWaivesFreight:Ae}),Me={};for(let _ of g?.freeUnits??[])Me[_.partNumber]=(Me[_.partNumber]??0)+_.quantity;let Jt=v?.tax??null,Zt=v?v.grandTotal:l-T-de+Je;return{sets:y,units:s.reduce((_,ne)=>_+(ne.components??[]).reduce((Ee,en)=>Ee+en.wheels*ne.qty,0),0),subtotal:l,hasUnpricedLine:f,discount:T,bundleDiscount:de,appliedBundles:jt,shipping:Je,freeShipping:Ae,shippingStatus:Qt,freeUnitsByPartNumber:Me,tax:Jt,grand:Zt,repricing:!!m?.refused&&v!==null&&W===m?.code,currency:n}},[s,n,m,F,A,v,W]),Yt=wt(()=>({isOpen:o,preview:t,open:D,close:Ce,toggle:O,items:s,catalog:u,bundles:d,warmCatalog:Se,add:P,remove:U,setQty:X,replaceItems:Ge,identify:Xe,clearCapturedCart:Ye,coupon:m,applyCoupon:le,removeCoupon:te,refuseCoupon:ve,couponBusy:Q,deliveryOptions:F,shippingMethodId:A,setShippingMethodId:J,totals:je}),[o,t,D,Ce,O,s,u,d,Se,P,U,X,Ge,Xe,Ye,m,le,te,ve,Q,F,A,je]);return Nn(_t.Provider,{value:Yt,children:e})}function Rt(){let e=In(_t);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as Hn}from"react";function kt(e,t,n,r){for(;e.size>=t;){let i,o;for(let[s,c]of e){if(c.expiresAt<=r){i=s;break}o===void 0&&n(s)&&(o=s)}let a=i??o??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var _n=6e4,Rn=5e3,kn=500,Le=new Map;async function An(e){let{host:t,matchesRequestHost:n}=await ot();if(!t)return"";let r=await it();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Mn=e=>e.includes("|slug:")||e.includes("|xhost:");async function At(e,t){if(await at()!==null)return t();let n=await An(e);if(!n)return t();let r=Date.now(),i=Le.get(n);if(i&&i.expiresAt>r)return i.load;let o=await t(),a=o.outcome.state==="failed",s=a?Rn:_n,c=Le.get(n)?.lastGood,u=o.outcome.state==="ok"?o:a?c:void 0,p=a&&u?u:o;return kt(Le,kn,Mn,r),Le.set(n,{load:p,expiresAt:r+s,lastGood:u}),p}var Dn=404;function On(e){if(e instanceof pe&&e.status===Dn)return{state:"absent"};let t=e instanceof pe?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Fn="[storefront:chrome-load-failed]";function Un(e,t){console.error(`${Fn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Mt(e,t,n,r){try{let i=await t();return r?.(i)?{value:i,outcome:{state:"absent"}}:{value:i,outcome:{state:"ok"}}}catch(i){let o=On(i);return o.state==="failed"&&Un(e,o),{value:n,outcome:o}}}function $n(e){return e==="production"?"silent":"banner"}var Po=$n("production");function qn(e,t){return e?.trim()||t}function ko({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let i=qn(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${i}`}var Kn={name:me,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,mapsApiKey:null,mapsMapId:null,socialLinks:De},Ao=Hn(async()=>At("site",()=>Mt("site",async()=>{let e=await H.getSite();return{name:et(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,mapsApiKey:e.mapsApiKey??null,mapsMapId:e.mapsMapId??null,socialLinks:tt(e.socialLinks)}},Kn)));var Mo={name:me,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,mapsApiKey:null,mapsMapId:null,socialLinks:De};import{jsx as Ot,jsxs as Ft}from"react/jsx-runtime";import{useEffect as Te,useRef as Ut,useState as Ne}from"react";var he=new Map,Wn=64;async function Bn(e){if(!Ze())return null;try{let t=await fetch(`${nt()}/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:i}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof i=="boolean"?i:null}}catch{return null}}function Dt(e){let t=he.get(e);if(t)return t;let n=Bn(e);if(he.set(e,n),he.size>Wn){let r=he.keys().next();r.done||he.delete(r.value)}return n}var zn={small:54,medium:66,large:84},Gn=44,Vn=202/22,Bo=16,zo=140,Xn=.88,Go=16,Yn="invert(1)";function Vo({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,onLightSurface:i,reversedSrc:o,inkIsDark:a,size:s="medium",sizePx:c,wordmark:u,siteName:p=me,fitToContainer:d=!1,fitWordmarkToContainer:S=!1,fitFloorPx:I}){let b=u&&u.trim()?u.trim():p,[x,w]=Ne(!1),N=Ut(null),M=P=>{N.current=P};Te(()=>{let P=N.current?.ownerDocument??document,U=()=>{w(P.documentElement.getAttribute("data-theme")==="light")};U();let X=new MutationObserver(U);return X.observe(P.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>X.disconnect()},[]);let C=n&&n.trim()?n.trim():null,L=!!C&&rt(C),v=i??(x&&t),q=r&&L&&C&&o!=null?{reversed:o,inkIsDark:a??null}:null,W=q!==null,[j,h]=Ne(null);Te(()=>{if(!r||!C||!L||W){h(null);return}let P=!1;return h(null),Dt(C).then(U=>{P||h(U)}),()=>{P=!0}},[r,C,L,W]);let E=q??j,m=!!E&&E.inkIsDark!==null&&(v?!E.inkIsDark:E.inkIsDark),K=r&&!!C&&!L&&!v,Q=m&&E?E.reversed:C,G=Q?[Q]:[],[A,J]=Ne(0);Te(()=>{J(0)},[C,m]);let Z=e==="footer"?Gn:zn[s],D=c&&c>0?c:Z,Ce=Math.round(D*Vn),O=A<G.length?G[A]:null,[Se,ee]=Ne(Q),se=O!==null&&O===Se,F=Ut(null);Te(()=>{let P=F.current;if(!P||!P.complete)return;if(P.naturalWidth>0||P.naturalHeight>0){ee(O);return}let U=!1;return P.decode().then(()=>!U&&ee(O),()=>!U&&J(X=>X+1)),()=>{U=!0}},[O]);let V=d||S,le=`calc(100cqi / ${((b.length+1)*Xn).toFixed(2)})`,te=V&&I&&I>0?Math.min(I,D):null,ve=V?te===null?`min(${D}px, ${le})`:`clamp(${te}px, ${le}, ${D}px)`:`${D}px`,ue=Ft("span",{className:`font-display font-bold tracking-[0.18em] ${te===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:ve,lineHeight:1},"aria-label":b,children:[b,Ot("span",{className:"text-accent",children:"."})]});return Ft("span",{ref:M,className:"inline-flex items-center",children:[!se&&ue,O&&Ot("img",{ref:F,src:O,alt:b,width:Ce,height:D,className:"shrink-0 object-contain",style:{...se?{height:`${D}px`,width:"auto",...d?{maxWidth:"100cqi"}:{}}:{display:"none"},...K?{filter:Yn}:{}},onLoad:()=>ee(O),onError:()=>J(P=>P+1)},O)]})}import{Children as Qn,isValidElement as Jn,useEffect as Ht,useId as Zn,useLayoutEffect as Wt,useRef as B,useState as qt}from"react";var _e=(e,t)=>!!e[t]&&!e[t].disabled;function Ke(e,t,n){let r=e.length;for(let i=1;i<=r;i++){let o=((t+n*i)%r+r)%r;if(_e(e,o))return o}return t}function We(e,t){return Ke(e,t===1?-1:e.length,t)}function Be(e,t){return _e(e,t)?t:Math.max(We(e,1),0)}function $t(e,t,n){let{open:r,focus:i}=e,o=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),s=n.findIndex((c,u)=>_e(n,u)&&c.label.toLowerCase().startsWith(a));return{state:o({open:!0,typed:a,focus:s>=0?s:i}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:o({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:o({focus:Ke(n,i,1)}),handled:!0};case"ArrowUp":return{state:o({focus:Ke(n,i,-1)}),handled:!0};case"Home":return{state:o({focus:We(n,1)}),handled:!0};case"End":return{state:o({focus:We(n,-1)}),handled:!0};case"Enter":case" ":return _e(n,i)?{state:o({open:!1,typed:""}),commit:i,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:o({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:o({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as er}from"efficient-shell/ui";import{Fragment as ar,jsx as z,jsxs as Bt}from"react/jsx-runtime";var Kt={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function tr({items:e,value:t,onPick:n,open:r,onOpen:i,onClose:o}){let[a,s]=qt(!1),c=r!==void 0,u=c?r:a,[p,d]=qt(0),S=B({text:"",timer:0}),I=B(null),b=B(null),x=B(null),w=Zn(),N=B(null),M=e.findIndex(h=>h.value===t),C=h=>{h!==u&&(c||s(h),h?i?.():o?.())},L=h=>{let E=e[h];!E||E.disabled||(n(E.value),C(!1),b.current?.focus())},v=h=>{let E={open:u,focus:u?p:Be(e,M),typed:S.current.text},m=$t(E,h,e);return!m.handled&&m.state.open===u?!1:(m.state.typed!==E.typed&&(S.current.text=m.state.typed,window.clearTimeout(S.current.timer),S.current.timer=window.setTimeout(()=>{S.current.text=""},500)),d(m.state.focus),m.commit!==void 0?L(m.commit):C(m.state.open),m.refocus&&b.current?.focus(),m.handled)},q=B(v);q.current=v;let W=B(()=>C(!1));W.current=()=>C(!1);let j=h=>{u||(N.current=h.nativeEvent,q.current(h.key)&&h.preventDefault())};return Ht(()=>{if(!u)return;let h=m=>{I.current?.contains(m.target)||W.current()},E=m=>{m!==N.current&&q.current(m.key)&&m.preventDefault()};return document.addEventListener("mousedown",h),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",E)}},[u]),Ht(()=>{u&&(S.current.text||d(Be(e,M)))},[u]),Wt(()=>{if(!u||!x.current)return;x.current.children.item(p)?.scrollIntoView({block:"nearest"})},[p,u]),{open:u,toggle:()=>C(!u),close:()=>C(!1),focusIdx:p,setFocusIdx:d,pick:h=>L(e.findIndex(E=>E.value===h)),wrapRef:I,triggerRef:b,listRef:x,listId:w,onTriggerKeyDown:j,activeId:u?`${w}-${p}`:void 0}}var nr={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 ${Kt.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 ${Kt.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 rr(e,t){Wt(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let i=()=>{let o=n.style;o.top=o.bottom=o.marginTop=o.marginBottom=o.maxHeight=o.overflowY=o.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let s=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-s.right)<Math.abs(c.left-s.left)?"end":"start",p=er({trigger:{left:s.left,right:s.right,top:s.top,bottom:s.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"){o.top="auto",o.bottom="100%",o.marginTop="0px";let S=p.top+Math.min(c.height,p.maxHeight);o.marginBottom=`${Math.max(0,s.top-S)}px`}p.maxHeight<c.height&&(o.maxHeight=`${p.maxHeight}px`,o.overflowY="auto");let d=p.left-c.left;d&&(o.translate=`${d}px`)};return i(),r.addEventListener("resize",i),r.addEventListener("scroll",i,!0),()=>{r.removeEventListener("resize",i),r.removeEventListener("scroll",i,!0)}},[e,t])}function or({id:e,tone:t,items:n,value:r,focusIdx:i,onFocus:o,onPick:a,listRef:s,ariaLabel:c}){let u=nr[t],p=B(null);return rr(p,n.length),z("ul",{ref:d=>{p.current=d,s&&(s.current=d)},id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((d,S)=>{let I=d.value===r;return z("li",{id:`${e}-${S}`,role:"option","aria-selected":I,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&o(S),onMouseDown:b=>{b.preventDefault(),d.disabled||a(d.value)},className:u.item(S===i,I&&d.value!=="",!!d.disabled,S===n.length-1),style:u.itemStyle?.(I),children:d.meta===void 0?d.label:Bt(ar,{children:[d.lead,z("span",{className:"flex-1 whitespace-nowrap",children:d.label}),z("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${S}`)})})}function ir({value:e,onChange:t,disabled:n,children:r,className:i,style:o,name:a,id:s,"aria-label":c}){let u=Qn.toArray(r).flatMap(b=>{if(!Jn(b))return[];if(b.type!=="option")return[];let w=b.props,N=w.value!==void 0?String(w.value):"",M=w.children,C=typeof M=="string"||typeof M=="number"?String(M):N;return[{value:N,label:C,disabled:!!w.disabled}]}),p=e??"",d=tr({items:u,value:p,onPick:b=>t?.({target:{value:b}})}),I=u.find(b=>b.value===p)?.label??u[0]?.label??"";return Bt("div",{ref:d.wrapRef,className:"relative",children:[a&&z("input",{type:"hidden",name:a,value:p}),z("button",{ref:b=>{d.triggerRef.current=b},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:s,onClick:()=>!n&&d.toggle(),onKeyDown:b=>!n&&d.onTriggerKeyDown(b),className:`block w-full ${i??""}`,style:o,children:z("span",{className:"block w-full truncate text-left",children:I})}),d.open&&z(or,{id:d.listId,tone:"select",items:u,value:p,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef})]})}var ri="#c9a461",zt=[{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"}],oi={name:"",color:"var(--fg)",family:"silver",src:""};function sr(e,t){let n=r=>{let i=zt.findIndex(o=>o.f===r);return i===-1?zt.length:i};return n(e)-n(t)||e.localeCompare(t)}function ii(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(sr)}import{jsx as be,jsxs as Re}from"react/jsx-runtime";var lr="font-mono text-[length:var(--size-label,12px)]",ur="font-semibold uppercase tracking-[0.22em] text-fg";function Gt(e){return`${e??lr} ${ur}`}function Vt(){return be("span",{className:"text-accent",children:" *"})}function cr({children:e,required:t,labelFace:n}){return Re("span",{className:Gt(n),children:[e,t?be(Vt,{}):null]})}function dr({label:e,required:t,hint:n,separate:r,htmlFor:i,labelFace:o,className:a,children:s}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?be("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Re("div",{className:c,children:[Re("label",{htmlFor:i,className:Gt(o),children:[e,t?be(Vt,{}):null]}),s,u]}):Re("label",{htmlFor:i,className:c,children:[be(cr,{required:t,labelFace:o,children:e}),s]})}import{jsx as xe,jsxs as pr}from"react/jsx-runtime";function mr({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,s=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(s.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;s.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 pr("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"}),s.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))]})}import{useState as fr}from"react";import{jsx as ae,jsxs as ze}from"react/jsx-runtime";function gr({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:i}=Rt(),[o,a]=fr("");async function s(){i||!o.trim()||(await n(o,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:o,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},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:()=>{s()},disabled:i,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:i?"\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:yt}):t&&!t.valid&&t.message&&ae("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}function yi(){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)}`}export{Rr as a,kr as b,Ar as c,st as d,Oe as e,yr as f,hr as g,br as h,xr as i,tn as j,nn as k,Cr as l,Sr as m,Fe as n,Pe as o,fe as p,vr as q,Ie as r,dn as s,mn as t,Fr as u,Ur as v,bt as w,$e as x,$r as y,Hr as z,fn as A,qr as B,Kr as C,gn as D,Wr as E,hn as F,Br as G,zr as H,xt as I,Qr as J,Jr as K,Zr as L,no as M,ro as N,Lr as O,pt as P,we as Q,qe as R,yo as S,Rt as T,ko as U,Kn as V,Mo as W,zn as X,Gn as Y,Bo as Z,zo as _,Go as $,Vo as aa,tr as ba,or as ca,ir as da,ri as ea,zt as fa,oi as ga,sr as ha,ii as ia,cr as ja,dr as ka,mr as la,gr as ma,yi as na};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as we}from"react/jsx-runtime";import{createContext as en,useCallback as i,useContext as tn,useMemo as nn,useState as Ae}from"react";import{createContext as ie,useContext as x}from"react";import{createContext as mt}from"react";var re=mt(null);var St=ie(null),O=ie({logo:null,placeholder:!1,wordmark:null});function En(){let e=x(re),t=x(St),n=x(O),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 an}from"efficient-easel/draw/client";var Tn="storefront-theme",wn="sf:theme-mode",An="sf:theme-switch",Ln="hide",v="light";function pt(e){return e>=7&&e<18}function Cn(e){let{mode:t,override:n,switchShown:a,hour:o}=e;return a&&(n==="light"||n==="dark")?n:t==="auto"?pt(o)?"light":"dark":t==="light"?"light":"dark"}var h={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},_t=[{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"}],C={selected:0,themes:_t};function le(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...C}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function M(e,t,n){let a=L(e),o=L(t);if(a===null||o===null)return e;let l=r=>Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0");return`#${a.map((r,u)=>l(r+(o[u]-r)*n)).join("")}`}var yt={light:"#ffffff",dark:"#0a0a0a"},kn=["light","dark"];function In(e,t){let n=yt[t],a=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:M(e,a,.1),line:M(e,a,.22),muted:M(n,e,.35),brandInk:t}}function k(e){let t=le(e);return t.themes[t.selected]}function ce(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}}function L(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1].length===3?[...t[1]].map(r=>r+r).join(""):t[1],[a,o,l]=[0,2,4].map(r=>parseInt(n.slice(r,r+2),16));return[a,o,l]}function N(e){let t=L(e);if(t===null)return null;let[n,a,o]=t.map(l=>{let r=l/255;return r<=.04045?r/12.92:((r+.055)/1.055)**2.4});return .2126*n+.7152*a+.0722*o}var Et=.4,bt=4.5,Tt=3;function wt(e,t){let n=N(e),a=N(t);if(n===null||a===null)return null;let[o,l]=n>=a?[n,a]:[a,n];return(o+.05)/(l+.05)}var Hn={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Rn(e){return e>=bt?"good":e>=Tt?"large-only":"hard"}var D=["#000000","#ffffff"];function I(e){let t=D[0],n=-1;for(let a of D){let o=wt(e,a);if(o===null)return D[0];o>n&&(n=o,t=a)}return t}var At=[.25,.4,.55];function xn(e){let t=L(e);return t===null?[]:At.map(n=>"#"+t.map(a=>Math.round(a*(1-n)).toString(16).padStart(2,"0")).join(""))}function On(e){let t=k(e),n={"--theme-fg":t.text},a=N(t.text);return(a===null||a>=Et)&&(n["--overlay-fg"]=t.text),n}var Lt=82;function G(e){return`color-mix(in srgb, ${e} ${Lt}%, #000)`}function Mn(e){let t=k(e);return{"--theme-accent":t.accent,"--theme-accent-2":G(t.accent),"--theme-accent-ink":I(t.accent)}}function ue(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Dn(e){let t=k(e),n=ue(t),a=de(t);if(n===null&&a===null)return{};let o={};return n!==null&&(o["--theme-btn"]=n,o["--theme-btn-2"]=G(n)),o["--theme-btn-ink"]=a??I(n),o}function de(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Pn(e,t){return de(e)??I(ue(e)??t)}function Fn(e){let t={};return le(e).themes.forEach((n,a)=>{let o=ce(n);t[`--theme-preset-${a}-accent`]=o.accent,t[`--theme-preset-${a}-accent-2`]=G(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 Nn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function vn(e){let t=ce(k(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 Ct=["heading","body","label"];function Gn(e){if(!e)return null;for(let t of Ct)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var he=["headingLarge","headingMedium","headingSmall","accent","body","label"];var U={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},kt=8,It=200;function Ht(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=kt&&t<=It?t:null}function Rt(e){let t={};for(let n of he)t[n]=Ht(e?.[n]);return t}function Un(e){let t=Rt(e),n={};for(let a of he){let o=t[a];o!==null&&(n[`--size-${a}`]=`${o}px`)}return n}var xt=["square","small","large"],Ot="small";function Bn(e){return xt.includes(e??"")?e:Ot}var ge=0,Mt=40,zn={square:0,small:null,large:16},Dt={"--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 fe(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(Mt,Math.max(ge,Math.round(t))):null}function Pt(e){let t=fe(e);return t===null?{}:Object.fromEntries(Object.entries(Dt).map(([n,a])=>{let o=t*a/16;return[n,o===0?"0":`${o}rem`]}))}function $n(e){return Pt(fe(e)??ge)}var Ft=["none","soft","lifted"],Nt="soft",me="none",vt=["tight","normal","roomy"],Gt="normal",H="normal",Ut=["none","lift","highlight"],Bt="lift",zt="highlight",Se="#141416";function pe(e){return Ft.includes(e??"")?e:Nt}function $t(e){return vt.includes(e??"")?e:Gt}function _e(e){return Ut.includes(e??"")?e:Bt}function Vt(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():Se}function Vn(e){let t=pe(e);return t===me?void 0:t}function Wn(e){let t=$t(e);return t===H?void 0:t}function Yn(e){let t=_e(e);return t===zt?void 0:t}function Xn(e,t,n){let a=Vt(t);return a===Se?{}:pe(e)!==me||_e(n)==="lift"?{"--sf-shadow-color":a}:{}}var Wt=["normal","tight","compressed"],E="normal";function ye(e){return Wt.includes(e??"")?e:E}function qn(e){let t=ye(e);return t===E?void 0:t}function jn(e){switch(ye(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var B={case:"authored",weight:null,weightStrong:null,italicStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},P=100,F=900,Yt=24,Xt=200;function A(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function Ee(e){let t=A(e?.weight,P,F),n=e?.case==="sentence"?"sentence":"authored",a=l=>l==null?t:A(l,P,F),o=l=>l==="sentence"?"sentence":l==="authored"?"authored":n;return{case:n,weight:t,weightStrong:A(e?.weightStrong,P,F),italicStrong:typeof e?.italicStrong=="boolean"?e.italicStrong:null,maxPx:A(e?.maxPx,Yt,Xt),weight2:a(e?.weight2),weight3:a(e?.weight3),case2:o(e?.case2),case3:o(e?.case3)}}function Kn(e){let t=Ee(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 Zn(e){return Ee({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 be=[{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(be.map(e=>[e.key,e]));function Qn(e){return f.get(e)}var Te=["heading","heading2","heading3","body","accent","label"],ea={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},qt=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],jt=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,ta={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},Kt={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function na(e){let t=e?jt.exec(e):null;return t?Kt[t[1]]??null:Zt(e)}function Zt(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 qt)if(t.includes(n))return a;return null}var d={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function Jt(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:d.heading}return d[n]};return Object.fromEntries(Te.map(n=>[n,t(n)]))}function Qt(e,t){return f.get(e[t])??f.get(d[t])}function g(e,t){return`var(${Qt(e,t).cssVar})`}var aa=[...new Set(Te.map(e=>f.get(d[e]).cssVar))],oa=[...new Set(be.map(e=>e.cssVar))];function sa(e){let t=Jt(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 Ce=en({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:v,setThemeMode:()=>{},themeSwitchShown:!1,setThemeSwitchShown:()=>{},theme:C,setTheme:()=>{},fonts:d,setFonts:()=>{},sizes:U,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:H,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:E,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:B,setHeadingTypography:()=>{},textStyles:null,setTextStyles:()=>{},wordStyles:null,heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},shareButtonOnPosts:null,setShareButtonOnPosts:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function ga({children:e,websiteName:t=null,templateChrome:n=!1,templateName:a=null,chromePlaceholder:o=!1,themeMode:l=v,onThemeModeChange:r,themeSwitchShown:u=!1,onThemeSwitchShownChange:b,theme:T=C,onThemeChange:m,fonts:S=d,onFontsChange:p,sizes:_=U,onSizesChange:c,cornerRadiusPx:R=null,onCornerRadiusPxChange:w,cardShadow:Ie=null,onCardShadowChange:z,shadowColor:He=null,onShadowColorChange:$,cardGap:Re=H,onCardGapChange:V,hoverEffect:xe=null,onHoverEffectChange:W,headingCompression:Oe=E,onHeadingCompressionChange:Y,siteWidth:Me=null,onSiteWidthChange:X,siteGutter:De=null,blockGap:Pe=null,onSiteGutterChange:q,onBlockGapChange:j,headingTypography:Fe=B,onHeadingTypographyChange:K,textStyles:Ne=null,onTextStylesChange:Z,wordStyles:ve=null,heroBackgroundFollowsWidth:Ge=null,onHeroBackgroundFollowsWidthChange:J,photographyGrayscale:Ue=null,onPhotographyGrayscaleChange:Q,shareButtonOnPosts:Be=null,onShareButtonOnPostsChange:ee,themeFromDocument:ze=!1}){let[y,te]=Ae(null),$e=i(s=>te(ft=>ft??s),[]),[Ve,We]=Ae(!1),Ye=i(s=>r?.(s),[r]),Xe=i(s=>b?.(s),[b]),qe=i(s=>m?.(s),[m]),je=i(s=>p?.(s),[p]),Ke=i(s=>c?.(s),[c]),Ze=i(s=>X?.(s),[X]),Je=i(s=>q?.(s),[q]),Qe=i(s=>j?.(s),[j]),et=i(s=>J?.(s),[J]),tt=i(s=>Q?.(s),[Q]),nt=i(s=>ee?.(s),[ee]),at=i(s=>w?.(s),[w]),ot=i(s=>z?.(s),[z]),st=i(s=>$?.(s),[$]),rt=i(s=>V?.(s),[V]),it=i(s=>W?.(s),[W]),lt=i(s=>Y?.(s),[Y]),ct=i(s=>K?.(s),[K]),ut=i(s=>Z?.(s),[Z]),{select:dt,setSelectHandler:ht}=an(),ne=y?.logoUrl,ae=y?.logoReversed,oe=y?.logoInkIsDark,se=y!==null,gt=nn(()=>({logo:se?{logoUrl:ne,logoReversed:ae,logoInkIsDark:oe}:null,placeholder:n||o,wordmark:n?a:t}),[se,ne,ae,oe,n,o,a,t]);return we(O.Provider,{value:gt,children:we(Ce.Provider,{value:{settings:y,setSettings:te,primeSettings:$e,websiteName:t,templateChrome:n,templateName:a,chromePlaceholder:o,themeMode:l,setThemeMode:Ye,themeSwitchShown:u,setThemeSwitchShown:Xe,theme:T,setTheme:qe,fonts:S,setFonts:je,sizes:_,setSizes:Ke,cornerRadiusPx:R,setCornerRadiusPx:at,cardShadow:Ie,setCardShadow:ot,shadowColor:He,setShadowColor:st,cardGap:Re,setCardGap:rt,hoverEffect:xe,setHoverEffect:it,headingCompression:Oe,setHeadingCompression:lt,siteWidth:Me,setSiteWidth:Ze,siteGutter:De,blockGap:Pe,setSiteGutter:Je,setBlockGap:Qe,headingTypography:Fe,setHeadingTypography:ct,textStyles:Ne,setTextStyles:ut,wordStyles:ve,heroBackgroundFollowsWidth:Ge,setHeroBackgroundFollowsWidth:et,photographyGrayscale:Ue,setPhotographyGrayscale:tt,shareButtonOnPosts:Be,setShareButtonOnPosts:nt,themeFromDocument:ze,selected:Ve,setSelected:We,select:dt,setSelectHandler:ht},children:e})})}var fa=()=>tn(Ce);import{forwardRef as on}from"react";import{jsx as ln}from"react/jsx-runtime";var sn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"},rn=on(function({src:t,width:n,height:a,fill:o,priority:l,loading:r,style:u,quality:b,placeholder:T,blurDataURL:m,unoptimized:S,loader:p,overrideSrc:_,...c},R){let w=_??(typeof t=="string"?t:t.src);return ln("img",{ref:R,src:w,width:o?void 0:n,height:o?void 0:a,loading:l?"eager":r??"lazy",fetchPriority:l?"high":void 0,decoding:"async",style:o?{...sn,...u}:{color:"transparent",...u},...c})}),pa=rn;function _a(e){return{props:{src:e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),sizes:e.sizes}}}import{forwardRef as cn}from"react";import{jsx as hn}from"react/jsx-runtime";function un(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 dn=cn(function({href:t,prefetch:n,replace:a,scroll:o,shallow:l,legacyBehavior:r,passHref:u,locale:b,onClick:T,children:m,...S},p){let _=c=>{T?.(c),!(c.defaultPrevented||S.target==="_blank")&&c.preventDefault()};return hn("a",{ref:p,href:un(t),onClick:_,...S,children:m})}),Ta=dn;var gn="Storefront";function La(e){return e?.trim()||gn}var ke=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp","telegram","line","wechat"],fn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp",telegram:"Telegram",line:"LINE",wechat:"WeChat"},mn={};function ka(e){if(!e||typeof e!="object")return mn;let t={};for(let n of ke){let a=e[n];if(typeof a!="string")continue;let o=a.trim();!o||!/^https?:\/\//i.test(o)||(t[n]=o)}return t}function Ia(e){return ke.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:fn[t]}]:[]})}var Ha=e=>`${e}_url`;export{pa as a,_a as b,Ta as c,be as d,Qn as e,Te as f,ea as g,ta as h,na as i,Zt as j,d as k,Jt as l,sa as m,Tn as n,wn as o,An as p,Ln as q,v as r,Cn as s,h as t,_t as u,le as v,kn as w,In as x,k as y,ce as z,wt as A,Hn as B,Rn as C,I as D,xn as E,On as F,Mn as G,ue as H,Dn as I,de as J,Pn as K,Fn as L,Nn as M,vn as N,Gn as O,U as P,Rt as Q,Un as R,Bn as S,ge as T,Mt as U,zn as V,fe as W,Pt as X,$n as Y,Ft as Z,Nt as _,me as $,H as aa,Ut as ba,Bt as ca,zt as da,Se as ea,pe as fa,$t as ga,_e as ha,Vt as ia,Vn as ja,Wn as ka,Yn as la,Xn as ma,E as na,ye as oa,qn as pa,jn as qa,B as ra,Ee as sa,Kn as ta,Zn as ua,re as va,En as wa,ga as xa,fa as ya,gn as za,La as Aa,ke as Ba,fn as Ca,mn as Da,ka as Ea,Ia as Fa,Ha as Ga};
|