efficient-storefront-blocks 0.76.0 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/chunks/EditorPreviewCheckout-IEFQC4T3.js +4 -0
  3. package/dist/chunks/{SiteEditorProvider-AJUWZYHT.js → SiteEditorProvider-YTZPWUDV.js} +1 -1
  4. package/dist/chunks/chunk-4O66UMLS.js +1 -0
  5. package/dist/chunks/chunk-LZTJCQ4A.js +311 -0
  6. package/dist/chunks/chunk-MZPZ4B7Y.js +1 -0
  7. package/dist/chunks/chunk-TI4ZGDSG.js +1 -0
  8. package/dist/chunks/chunk-WC4XIVX3.js +1 -0
  9. package/dist/chunks/{fitment-data-IZYCNTET.js → fitment-data-VU5A7VKV.js} +1 -1
  10. package/dist/editor/components/CategorySource.js +1 -1
  11. package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
  12. package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
  13. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/service/FooterGroup/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/service/FooterSocial/fields.js +1 -1
  16. package/dist/index.js +31 -31
  17. package/dist/render/app/globals.css +44 -0
  18. package/dist/render/built-with.json +1 -1
  19. package/dist/render/components/ChatWidget.js +1 -1
  20. package/dist/render/components/ConsentPanel.js +1 -1
  21. package/dist/render/components/Events.d.ts +2 -1
  22. package/dist/render/components/Events.js +1 -1
  23. package/dist/render/components/FooterGroup.d.ts +2 -1
  24. package/dist/render/components/FooterGroup.js +1 -1
  25. package/dist/render/components/GalleryGrid.d.ts +2 -1
  26. package/dist/render/components/GalleryGrid.js +1 -1
  27. package/dist/render/components/Notice.d.ts +6 -0
  28. package/dist/render/components/Notice.js +1 -0
  29. package/dist/render/components/ProductGridSection.d.ts +2 -1
  30. package/dist/render/components/ProductGridSection.js +1 -1
  31. package/dist/render/components/SubscribePopup.js +2 -2
  32. package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
  33. package/dist/render/components/TyreFitVerdicts.js +1 -1
  34. package/dist/render/components/TyreVehicleFitment.js +1 -1
  35. package/dist/render/components/WheelCardFrame.d.ts +3 -0
  36. package/dist/render/components/WheelCardFrame.js +1 -1
  37. package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
  38. package/dist/render/components/checkout/CheckoutPageClient.d.ts +4 -0
  39. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  40. package/dist/render/components/checkout/checkout-parts.js +1 -1
  41. package/dist/render/components/checkout/checkout-state.d.ts +14 -2
  42. package/dist/render/components/checkout/checkout-state.js +3 -3
  43. package/dist/render/components/product-hero/TyreHeroFitment.d.ts +2 -1
  44. package/dist/render/components/product-hero/TyreHeroFitment.js +1 -1
  45. package/dist/render/components/product-hero/VehicleQuestion.d.ts +0 -4
  46. package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
  47. package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
  48. package/dist/render/components/product-hero/trust-bullets.js +1 -1
  49. package/dist/render/components/useTyreFitAnswer.d.ts +1 -0
  50. package/dist/render/components/useTyreFitAnswer.js +1 -1
  51. package/dist/render/lib/api/index.d.ts +7 -3
  52. package/dist/render/lib/api/index.js +1 -1
  53. package/dist/render/lib/api/types.d.ts +5 -0
  54. package/dist/render/lib/checkout/pay-first.d.ts +34 -0
  55. package/dist/render/lib/checkout/pay-first.js +1 -0
  56. package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
  57. package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
  58. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  59. package/dist/render/lib/document/blocks/service/FooterGroup/render.js +1 -1
  60. package/dist/render/lib/tyres/tyre-fit-copy.js +1 -1
  61. package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +3 -1
  62. package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
  63. package/dist/render/lib/wheels/plp-grid.d.ts +2 -1
  64. package/dist/render/lib/wheels/plp-grid.js +1 -1
  65. package/dist/words.d.ts +0 -5
  66. package/dist/words.js +2 -2
  67. package/package.json +3 -3
  68. package/dist/chunks/EditorPreviewCheckout-ANI7HUYX.js +0 -4
  69. package/dist/chunks/chunk-3IQQNZIM.js +0 -311
  70. package/dist/chunks/chunk-4F5CAFXO.js +0 -1
  71. package/dist/chunks/chunk-5NXOTPHK.js +0 -1
  72. package/dist/chunks/chunk-YAYHH5GY.js +0 -1
  73. package/dist/chunks/chunk-YFPWVNDB.js +0 -1
  74. /package/dist/chunks/{chunk-3IQQNZIM.js.LEGAL.txt → chunk-LZTJCQ4A.js.LEGAL.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.78.0 - 2026-11-03
4
+
5
+ **A major for hosts (major version zero, so a minor number):** the peer moves to `efficient-web-builder` `^47.1.0` (was `^47.0.0`), because the Product Hero's trust line imports the builder's new `InsideSiteColumn`. A host must install web-builder 47.1.0 or later with this release. No stored page needs a data move. Storefront: do not promote to production before this release and web-builder 47.1.0 are synced in; storefront main (web-builder 47.0.0) draws 32px more around the 2 sized Hartes Texts than production does.
6
+
7
+ - **BREAKING: peer `efficient-web-builder` `^47.1.0`** (#326). Peer and dev, here and in `package/`.
8
+ - **The Gap only rule reaches every sized block** (#327, #326). Web-builder 47 puts a block with a stored Size in a `sf-block-size` wrapper, so a Gap only Box's rule stopped at the wrapper and the block's frame `py-4` came back. The rule now reaches through the wrapper (on the page, with an entrance, on the canvas): a sized Button or Text in a Gap only Box draws no frame padding, as production draws today. Stored: 3 sized Texts on the US sites (hartes-metal Home and About, 900; storefront site-footer, 360) keep their look.
9
+ - **The Product Hero's trust line stands in the hero's column** (#326). A Box in the `trustBullets` slot drew the site's Side space as if it were a section, so the line started 60px right of Add to Cart. The slot now stands in `InsideSiteColumn` (`efficient-web-builder/render/components/SiteGutterFrame`), which adds no element.
10
+ - **The wheels listing follows the site's phone Block gap** (#325). Below 720px, `.plp-card-grid` reads `--sf-block-gap-phone-rem` (new export `PLP_PHONE_GAP_VAR`); the gutter and the column arithmetic share the one term. A site with no phone value draws what it draws today. In the editor the previewed view answers.
11
+ - **What follows a pinned Scroll-Over Intro paints over it** (#328). `:where(.sf-scroll-over ~ *)` gives a follower `position: relative; z-index: 2`, weighing nothing, so a Box after a pinned intro slides over it as old sections do. The mark comes from web-builder #442; until a host runs that release, the rule matches nothing.
12
+ - **A tyre page can read only the wheels it names** (#324). New `products.listWheelsBySlug(slugs, opts?)`: `GET /wheels?slug=…`, no request for an empty list, slugs deduplicated and read 100 at a time, only the named rows returned, the same degrade-to-`[]` as `listWheels`. Needs efficient-backend 101.18.0 or later to filter; an older backend answers the whole catalogue (the old cost, no wrong card). `src/render/lib/api/types.ts` gains `WheelSlugsFilter`.
13
+ - Guards: changed `scripts/test-gap-only-one-rule.tsx` (§6, #327 and #326), `scripts/test-hero-button-row.ts`, `scripts/test-shell-peer-range.ts`; new `scripts/test-trust-bullets-fill-the-column.tsx` (#326); changed `scripts/test-plp-grid.tsx` (#325), `scripts/test-section-sticky-css.ts` (#328); new `scripts/test-every-row-has-a-view.tsx` (#322, every own panel row per view); new `scripts/dry-run-whole-page.tsx`, `scripts/dry-run-page-checks.ts`, `scripts/browser-dry-run-page-checks.tsx`, `scripts/compile-canvas-sheet.ts` (#323, a read-only whole-page run of the section conversion); `scripts/test-checkout-pay-first.tsx` §20 (#320, a change during a press's address save waits).
14
+
15
+ ## 0.77.0 - 2026-11-02
16
+
17
+ **A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^47.0.0` (was `^46.0.0`) and `efficient-easel` `^26.7.0` (was `^26.1.0`), five editor phrases leave `words`, and the `Box` export of `render/components/product-hero/VehicleQuestion` goes. A host must: install web-builder 47 and easel `>=26.7.0` together with this release; delete the five removed phrases below from its editor catalogue; and use `Notice` where it imported `Box`. No stored page needs a data move. The shop's card checkout pays first (#315): serve it from efficient-backend v101.4.1 or later. An older backend ignores `checkoutFlow` and keeps the old flow, without the `checkout_unavailable` refusal code.
18
+
19
+ - **BREAKING: one themed Notice box for every shop notice** (#314). New `render/components/Notice` (tones: `bad`, the default, `good`, `quiet`; a `role` passes through). The `Box` export of `render/components/product-hero/VehicleQuestion` is removed: use `Notice`. Seen by a shopper: the checkout, payment and subscribe errors, the no-price notice, the 9 fitment verdicts and the consent panel's Global Privacy Control note take the site's panel colour, a 1px border in the tone's token and body text at 14px; before, the checkout and subscribe boxes were fixed red and amber. The checkout, payment and subscribe errors carry `role="alert"`; the no-price notice carries `role="status"`. The chat error line uses `text-alert`. The order summary's quantity bubble shows as a full circle.
20
+ - **The Product content status is one line** (#317). The Product Grid's Product content row reads `9 wheels · Refresh now`; the long sentence moves into the tooltip.
21
+ - **The shop's card checkout pays first** (#315). A card order sends `checkoutFlow: 2`: the order request opens a checkout that holds the items under its own number (`CK#…`), and the sales order is made after the card clears. PayPal, Afterpay, Square, GoCardless, Zip, Klarna and bank transfer still place the order at submit. New screens: the held-until line on the payment step, "Confirming your payment…", "Payment processing", "Payment received" and "Order not placed" (released or expired, with the refund line). "← Back to checkout" returns to the form with the basket. A change after Back drops the held checkout only when its card intent can no longer be paid. "Pay later" leaves the card step only. The basket and the abandoned-cart snapshot stay until the card clears. New render module `lib/checkout/pay-first`; `OrderRequest.checkoutFlow`, `OrderConfirmation.checkoutNumber` and `expiresAt` in the API types.
22
+
23
+ - **BREAKING: web-builder 47, easel 26.7** (#307). Peer and dev, here and in `package/`: `efficient-web-builder` `^47.0.0`, `efficient-easel` `^26.7.0`. The words catalogue drops 5 builder phrases that builder 47 no longer says (Duplicate page): "Another page uses this URL handle.", "Couldn’t duplicate the page — please retry.", "Duplicate page", "The copy is a draft and stays hidden until you publish it. It opens in the editor.", "URL handle".
24
+ - **Four sections have their own phone Gap** (#307, C38). GalleryB, FooterGroup, ProductGrid and Events draw the Box's phone Gap row through web-builder's `containerGapRows`. Unset, the phone row shows half the desktop Gap in grey and stores nothing; `--sf-gap-len-phone` is written only when a phone value is stored. 0 data moves.
25
+ - The Product Grid's shared card rows follow the phone Gap: `cardRowsGap(zone)` reads the `containerGapProps` answer (`var(--sf-card-row-gap-auto)` only when the zone draws a phone length). No phone value keeps the bytes it was.
26
+ - Social Logos keeps its own 0-32 Gap row, now a Desktop-view row (hidden on a phone; no page changes).
27
+ - **List reads can report a failure** (#312). `products.listWheels`, `products.listBundles` and `products.listBlogPosts` take an optional `{ throwOnFailure: true }` (new exported type `ListReadOpts`): a failed read, or a wheel sweep that fails part-way, is thrown instead of returned as an empty list, so a page can show an error with a retry. Without the option each read degrades to an empty list as before; no current caller changes.
28
+ - **A failed tyre fit check says so** (#311). When the backend cannot be reached or answers 5xx, the tyre page's fit section and the buy-hero verdict say the check could not be done now and show a Try again button for the same car. The answer stays 'unknown', so it never reads as a fit. A real no-data reply keeps the no-factory-data wording.
29
+ - **The catalog price boxes have names** (#310). The Price panel's two boxes carry `aria-label` "Minimum price" and "Maximum price"; the placeholders read "Min" and "Max", with no "$" in any currency.
30
+ - Guards: new `scripts/test-catalog-price-box-names.tsx` (#310), `scripts/test-list-reads-report-failure.ts` (#312); changed `scripts/test-tyre-vehicle-fitment.tsx` (#311); new `scripts/test-section-gap-phone.tsx` (#307, a census of every Gap row in the registry); new `scripts/test-shop-notice.tsx` (#314), `scripts/test-checkout-pay-first.tsx` (#315); changed `scripts/test-checkout-payment-start-failure.tsx`, `scripts/test-wallet-return.ts`, `scripts/test-idempotency-key.ts` (#315); changed `scripts/test-product-content.tsx` (#317); new `scripts/browser-city-card-heights.tsx` (#319, a browser measure of the city cards' heights).
31
+
3
32
  ## 0.76.0 - 2026-10-31
4
33
 
5
34
  **A major for hosts (major version zero, so a minor number):** the peers move to `efficient-web-builder` `^46.0.0` (was `^44.0.0`), `efficient-easel` `^26.1.0` (was `^23.1.0`) and `efficient-shell` `^11.8.0` (was `^10.13.0`), published names and paths go, and stored pages need data moves. A host must: install the three new peers (its Tailwind must resolve `efficient-shell/motion.css`); follow the page theme with `!useRootIsDark({ whenUnset: true })` from `efficient-shell/theme` in place of `render/components/useIsLightTheme`; stop importing `lib/wheels/collections` and call `scopeCatalogSections(data)` with the page only; pass the theme row's `theme` to `RenderClient`; stop using the removed names listed below; and delete the removed words from its editor catalogue. For efficient-storefront: do not take this release until the US-site width data move M1 (114 rows / 22 pages, by CLI) and the #392 data move (maxWidth on 3 Text blocks, inovit_us) have run; in the sync PR that takes it, change `app/wheels/[slug]/PDPClient.tsx`, `app/wheels/CatalogPageClient.tsx`, `components/CollectionHeader.tsx`, `lib/wheels/range-collections.ts` and `app/wheels/page.tsx`, delete `scripts/harness/panel-row-wrap.tsx` and `probe-panel-row-wrap.mjs`, and update the old `data-menu-align` start / end CSS in `scripts/harness/box-panels-converge.html`. After the storefront sync: the admin-portal bump, then the CLI moves of the Product Hero trust bullets (1 page), the hartesmetal.com `/wheels` Product Grid source (4 cells) and the footer Menu's `linkAlign` (4 copies).
@@ -0,0 +1,4 @@
1
+ "use client";import{$ as Un,L as An,M as Tn,N as Ln,O as _n,P as Fn,Q as pe,S as Ge,T as qn,U as jn,V as ct,W as Dn,Y as Tt,_ as Mn,aa as $n,b as Rn,c as At,d as On,e as In,fa as Kn,ga as Ee,la as Wn,ma as lt,pa as Lt,ra as Q,sa as X,x as st}from"./chunk-4O66UMLS.js";import{i as de,o as De,v as U}from"./chunk-MZPZ4B7Y.js";import{Da as wn,xa as Nn,za as ue}from"./chunk-WC4XIVX3.js";import{k as En,l as He,m as re}from"./chunk-TI4ZGDSG.js";import{a as It,b as Ra}from"./chunk-Y6SLVHK3.js";var zn=It(($o,Bn)=>{"use strict";var Ia="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";Bn.exports=Ia});var Jn=It((Ko,Vn)=>{"use strict";var Aa=zn();function Hn(){}function Gn(){}Gn.resetWarningCache=Hn;Vn.exports=function(){function e(r,a,i,c,p,d){if(d!==Aa){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Gn,resetWarningCache:Hn};return n.PropTypes=n,n}});var Zn=It((Bo,Xn)=>{"use strict";Xn.exports=Jn()();var Wo,Yo});import{useEffect as ea,useMemo as Jr,useRef as $e,useState as Oe}from"react";import{rootIsDark as Oa}from"efficient-shell/format";function Yn(){if(typeof document>"u")return;let e=getComputedStyle(document.documentElement),t=(r,a)=>e.getPropertyValue(r).trim()||a,n=Oa({whenUnset:!0});return{theme:n?"night":"stripe",variables:{colorPrimary:t("--accent",n?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",n?"#131313":"#ffffff"),colorText:t("--fg",n?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}var _=Ra(Zn(),1);import I from"react";function Qn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ta(e){if(Array.isArray(e))return e}function ar(e,t,n){return(t=Da(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function La(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,c,p=[],d=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(d=(r=i.call(n)).done)&&(p.push(r.value),p.length!==t);d=!0);}catch(y){u=!0,a=y}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(u)throw a}}return p}}function _a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?er(Object(n),!0).forEach(function(r){ar(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):er(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fa(e,t){if(e==null)return{};var n,r,a=qa(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function qa(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function or(e,t){return Ta(e)||La(e,t)||Ma(e,t)||_a()}function ja(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Da(e){var t=ja(e,"string");return typeof t=="symbol"?t:t+""}function _t(e){"@babel/helpers - typeof";return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}function Ma(e,t){if(e){if(typeof e=="string")return Qn(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qn(e,t):void 0}}var W=function(t,n,r){var a=!!r,i=I.useRef(r);I.useEffect(function(){i.current=r},[r]),I.useEffect(function(){if(!a||!t)return function(){};var c=function(){if(i.current)return i.current.apply(i,arguments)};return t.on(n,c),function(){t.off(n,c)}},[a,n,t,i])},Ft=function(t){var n=I.useRef(t);return I.useEffect(function(){n.current=t},[t]),n.current},Me=function(t){return t!==null&&_t(t)==="object"},Ua=function(t){return Me(t)&&typeof t.then=="function"},$a=function(t){return Me(t)&&typeof t.elements=="function"&&typeof t.createToken=="function"&&typeof t.createPaymentMethod=="function"&&typeof t.confirmCardPayment=="function"},nr="[object Object]",Ka=function e(t,n){if(t===n)return!0;if(!Me(t)||!Me(n))return t===n;var r=Array.isArray(t),a=Array.isArray(n);if(r!==a)return!1;var i=Object.prototype.toString.call(t)===nr,c=Object.prototype.toString.call(n)===nr;if(i!==c)return!1;if(!i&&!r)return t===n;var p=Object.keys(t),d=Object.keys(n);if(p.length!==d.length)return!1;for(var u={},y=0;y<p.length;y+=1)u[p[y]]=!0;for(var v=0;v<d.length;v+=1)u[d[v]]=!0;var b=Object.keys(u);if(b.length!==p.length)return!1;var m=t,w=n,N=function(V){return e(m[V],w[V])};return b.every(N)},ir=function(t,n,r){return Me(t)?Object.keys(t).reduce(function(a,i){var c=!Me(n)||!Ka(t[i],n[i]);return r.includes(i)?(c&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),a):c?tr(tr({},a||{}),{},ar({},i,t[i])):a},null):null},sr="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",rr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sr;if(t===null||$a(t))return t;throw new Error(n)},Wa=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sr;if(Ua(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return rr(a,n)})};var r=rr(t,n);return r===null?{tag:"empty"}:{tag:"sync",stripe:r}},Ya=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"6.12.0"}),t.registerAppInfo({name:"react-stripe-js",version:"6.12.0",url:"https://stripe.com/docs/stripe-js/react"}))},ut=I.createContext(null);ut.displayName="ElementsContext";var cr=function(t,n){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(n," in an <Elements> provider."));return t},jt=function(t){var n=t.stripe,r=t.options,a=t.children,i=I.useMemo(function(){return Wa(n)},[n]),c=I.useState(function(){return{stripe:i.tag==="sync"?i.stripe:null,elements:i.tag==="sync"?i.stripe.elements(r):null}}),p=or(c,2),d=p[0],u=p[1];I.useEffect(function(){var b=!0,m=function(N){u(function(R){return R.stripe?R:{stripe:N,elements:N.elements(r)}})};return i.tag==="async"&&!d.stripe?i.stripePromise.then(function(w){w&&b&&m(w)}):i.tag==="sync"&&!d.stripe&&m(i.stripe),function(){b=!1}},[i,d,r]);var y=Ft(n);I.useEffect(function(){y!==null&&y!==n&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[y,n]);var v=Ft(r);return I.useEffect(function(){if(d.elements){var b=ir(r,v,["clientSecret","fonts"]);b&&d.elements.update(b)}},[r,v,d.elements]),I.useEffect(function(){Ya(d.stripe)},[d.stripe]),I.createElement(ut.Provider,{value:d},a)};jt.propTypes={stripe:_.default.any,options:_.default.object};var lr=function(t){var n=I.useContext(ut);return cr(n,t)},ur=function(){var t=lr("calls useElements()"),n=t.elements;return n},Ba=function(t){var n=t.children,r=lr("mounts <ElementsConsumer>");return n(r)};Ba.propTypes={children:_.default.func.isRequired};var za=I.createContext(null);za.displayName="CheckoutContext";var dr=I.createContext(null);dr.displayName="CheckoutSdkContext";var qt=function(t){var n=I.useContext(dr),r=I.useContext(ut);if(n){if(r)throw new Error("You cannot wrap the part of your app that ".concat(t," in both a checkout provider and <Elements> provider."));return n}else return cr(r,t)},Ha=["mode"],Ga=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},F=function(t,n,r){var a="".concat(Ga(t),"Element"),i=function(u){var y=u.id,v=u.className,b=u.options,m=b===void 0?{}:b,w=u.onBlur,N=u.onFocus,R=u.onReady,V=u.onChange,E=u.onEscape,C=u.onClick,M=u.onLoadError,B=u.onLoaderStart,D=u.onNetworksChange,ae=u.onConfirm,me=u.onCancel,Se=u.onShippingAddressChange,oe=u.onShippingRateChange,z=u.onSavedPaymentMethodRemove,te=u.onSavedPaymentMethodUpdate,ie=u.onAvailablePaymentMethodsChange,L=qt("mounts <".concat(a,">")),x="elements"in L?L.elements:null,H="checkoutSdk"in L?L.checkoutSdk:null,Ke=I.useState(null),Ne=or(Ke,2),j=Ne[0],We=Ne[1],G=I.useRef(null),se=I.useRef(null);W(j,"blur",w),W(j,"focus",N),W(j,"escape",E),W(j,"click",C),W(j,"loaderror",M),W(j,"loaderstart",B),W(j,"networkschange",D),W(j,"confirm",ae),W(j,"cancel",me),W(j,"shippingaddresschange",Se),W(j,"shippingratechange",oe),W(j,"savedpaymentmethodremove",z),W(j,"savedpaymentmethodupdate",te),W(j,"availablepaymentmethodschange",ie),W(j,"change",V);var he;R&&(t==="expressCheckout"?he=R:he=function(){R(j)}),W(j,"ready",he),I.useLayoutEffect(function(){if(G.current===null&&se.current!==null&&(x||H)){var A=null;if(H){var J=H,Ie=H;switch(t){case"paymentForm":A=Ie.createForm(m);break;case"payment":A=J.createPaymentElement(m);break;case"address":if("mode"in m){var T=m.mode,we=Fa(m,Ha);if(T==="shipping")A=J.createShippingAddressElement(we);else if(T==="billing")A=J.createBillingAddressElement(we);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":A=J.createExpressCheckoutElement(m);break;case"currencySelector":A=H.createCurrencySelectorElement();break;case"taxId":A=J.createTaxIdElement(m);break;case"contactDetails":A=J.createContactDetailsElement();break;case"linkSignup":if("createLinkSignupElement"in H)A=H.createLinkSignupElement(m);else throw new Error("<LinkSignupElement> requires <CheckoutElementsProvider> and is not supported inside <CheckoutFormProvider>.");break;case"terms":A=J.createTermsElement(m);break;default:throw new Error("<".concat(a,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else x&&(A=x.create(t,m));G.current=A,We(A),A&&A.mount(se.current)}},[x,H,m]);var ce=Ft(m);return I.useEffect(function(){if(G.current){var A=ir(m,ce,["paymentRequest"]);A&&"update"in G.current&&G.current.update(A)}},[m,ce]),I.useLayoutEffect(function(){return function(){if(G.current&&typeof G.current.destroy=="function")try{G.current.destroy(),G.current=null}catch{}}},[]),I.createElement("div",{id:y,className:v,ref:se})},c=function(u){qt("mounts <".concat(a,">"));var y=u.id,v=u.className;return I.createElement("div",{id:y,className:v})},p=n?c:i;return p.propTypes={id:_.default.string,className:_.default.string,onChange:_.default.func,onBlur:_.default.func,onFocus:_.default.func,onReady:_.default.func,onEscape:_.default.func,onClick:_.default.func,onLoadError:_.default.func,onLoaderStart:_.default.func,onNetworksChange:_.default.func,onConfirm:_.default.func,onCancel:_.default.func,onShippingAddressChange:_.default.func,onShippingRateChange:_.default.func,onSavedPaymentMethodRemove:_.default.func,onSavedPaymentMethodUpdate:_.default.func,onAvailablePaymentMethodsChange:_.default.func,options:_.default.object},p.displayName=a,p.__elementType=t,p},q=typeof window>"u",Va=I.createContext(null);Va.displayName="EmbeddedCheckoutProviderContext";var pr=function(){var t=qt("calls useStripe()"),n=t.stripe;return n},Ho=F("auBankAccount",q),Go=F("card",q),Vo=F("cardNumber",q),Jo=F("cardExpiry",q),Xo=F("cardCvc",q),Zo=F("currencySelector",q),Qo=F("iban",q),mr=F("payment",q),ei=F("expressCheckout",q),ti=F("paymentRequestButton",q),ni=F("linkAuthentication",q),ri=F("linkSignup",q),ai=F("contactDetails",q),oi=F("address",q),ii=F("shippingAddress",q),si=F("paymentMethodMessaging",q),ci=F("taxId",q),li=F("issuingCardNumberDisplay",q),ui=F("issuingCardCvcDisplay",q),di=F("issuingCardExpiryDisplay",q),pi=F("issuingCardPinDisplay",q),mi=F("issuingCardCopyButton",q),fi=F("terms",q);function mt(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?mt=function(t){return typeof t}:mt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mt(e)}var yr="dahlia",Ja=function(t){return t===3?"v3":t},hr="https://js.stripe.com",Xa="".concat(hr,"/").concat(yr,"/stripe.js"),Za=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Qa=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,fr="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",eo=function(t){return Za.test(t)||Qa.test(t)},to=function(){for(var t=document.querySelectorAll('script[src^="'.concat(hr,'"]')),n=0;n<t.length;n++){var r=t[n];if(eo(r.src))return r}return null},gr=function(t){var n=t&&!t.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src="".concat(Xa).concat(n);var a=document.head||document.body;if(!a)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return a.appendChild(r),r},no=function(t,n){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"9.17.0",startTime:n})},Ve=null,dt=null,pt=null,ro=function(t){return function(n){t(new Error("Failed to load Stripe.js",{cause:n}))}},ao=function(t,n){return function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))}},oo=function(t){return Ve!==null?Ve:(Ve=new Promise(function(n,r){if(typeof window>"u"||typeof document>"u"){n(null);return}if(window.Stripe&&t&&console.warn(fr),window.Stripe){n(window.Stripe);return}try{var a=to();if(a&&t)console.warn(fr);else if(!a)a=gr(t);else if(a&&pt!==null&&dt!==null){var i;a.removeEventListener("load",pt),a.removeEventListener("error",dt),(i=a.parentNode)===null||i===void 0||i.removeChild(a),a=gr(t)}pt=ao(n,r),dt=ro(r),a.addEventListener("load",pt),a.addEventListener("error",dt)}catch(c){r(c);return}}),Ve.catch(function(n){return Ve=null,Promise.reject(n)}))},io=function(t,n,r){if(t===null)return null;var a=n[0];if(typeof a!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(mt(a)," instead."));var i=a.match(/^pk_test/),c=Ja(t.version),p=yr;i&&c!==p&&console.warn("Stripe.js@".concat(c," was loaded on the page, but @stripe/stripe-js@").concat("9.17.0"," expected Stripe.js@").concat(p,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var d=t.apply(void 0,n);return no(d,r),d},Je,br=!1,vr=function(){return Je||(Je=oo(null).catch(function(t){return Je=null,Promise.reject(t)}),Je)};Promise.resolve().then(function(){return vr()}).catch(function(e){br||console.warn(e)});var ft=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];br=!0;var a=Date.now();return vr().then(function(i){return io(i,n,a)})};var xr=2;function Cr(e){return e==="card"}var so="checkout_unavailable",Ue="We could not check your payment. Please try again.",co=1e4;async function kr(e,t=co){let n,r=new Promise(i=>{n=setTimeout(()=>i(void 0),t)}),a=(async()=>{try{return(await(await ft(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([a,r])}finally{clearTimeout(n)}}var Pr=new Set(["none","requires_payment_method","canceled"]);function Dt(e){return e instanceof de&&typeof e.data=="object"&&e.data!==null&&e.data.code===so}function gt(e){return e.orderNumber||e.checkoutNumber}function lo(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function Sr({checkoutNumber:e,resend:t,page:n}){n.setConfirming(!0);let r;try{r=lo(await t())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(n.markPaid(),n.track(r.order),n.land(r.order)):n.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),n.setConfirming(!1)}import{createContext as xo,useContext as Co,useEffect as Y,useMemo as qr,useRef as ee,useState as k}from"react";var uo="sf:gclid",po="sf:fbclid",mo=2160*60*60*1e3;function Er(){return typeof window<"u"}function Nr(e){let t=He.getItem(e);if(!t)return"";try{let{v:n,t:r}=JSON.parse(t);return!n||typeof r!="number"||Date.now()-r>mo?"":n}catch{return""}}function wr(e){if(!Er())return"";let t=e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1"),n=document.cookie.match(new RegExp(`(?:^|; )${t}=([^;]*)`));return n?decodeURIComponent(n[1]):""}function Rr(){if(!Er())return{};let e=Nr(uo),t=Nr(po),n=wr("_fbp"),r=wr("_fbc");!r&&t&&(r=`fb.1.${Date.now()}.${t}`);let a={};return e&&(a.gclid=e),t&&(a.fbclid=t),n&&(a.fbp=n),r&&(a.fbc=r),a}var Or="sf:meta-purchases",fo=20;function Ar(){return typeof window>"u"||window.parent!==window}function go(...e){try{if(Ar()||typeof window.fbq!="function")return;window.fbq(...e)}catch{}}var Ir=new Set;function yo(e){if(Ir.has(e))return!1;Ir.add(e);try{let t=JSON.parse(He.getItem(Or)??"[]");if(t.includes(e))return!1;He.setItem(Or,JSON.stringify([...t,e].slice(-fo)))}catch{}return!0}function ho(e){return[...new Set(e.filter(Ge).flatMap(t=>t.components.map(n=>n.partNumber)))]}function Tr(e){let t=e.confirmation;Ar()||!yo(t.orderNumber)||go("track","Purchase",{value:Number(t.grandTotal),currency:t.currency,content_type:"product",content_ids:ho(e.lines)},{eventID:t.orderNumber})}var Mt="checkout-afterpay-context",yt="checkout-gocardless-context",Ut="checkout-zip-context",ht="checkout-klarna-context";function bo({evidence:e,parked:t}){return e?{action:"capture",evidence:e,parked:t}:t?{action:"settle",parked:t}:{action:"ignore"}}function vo(e,t){let n=e.getItem(t);if(e.removeItem(t),!n)return null;try{return JSON.parse(n)}catch{return null}}var Lr={name:"Afterpay",legParam:"afterpay",legValues:["confirm","cancel"],storageKey:Mt,evidenceFrom(e,t){return t==="cancel"||(e.get("status")??"").toUpperCase()==="CANCELLED"?null:e.get("orderToken")},requestFrom:e=>({token:e})},_r={name:"Zip",legParam:"zip",legValues:["return"],storageKey:Ut,evidenceFrom(e){let t=(e.get("result")??"").toLowerCase();return t==="cancelled"||t==="declined"?null:e.get("checkoutId")},requestFrom:e=>({checkoutId:e})};async function $t(e,t){let n=new URLSearchParams(t.search),r=n.get(e.legParam);if(!r||!e.legValues.includes(r))return;let a=vo(t.storage,e.storageKey),i=e.evidenceFrom(n,r);t.scrubQuery();let c=bo({evidence:i,parked:a});if(c.action!=="ignore"){if(t.page.clearCart(),c.action==="settle"){t.page.note(`The ${e.name} payment was not completed \u2014 our team will follow up on payment.`),t.page.land(c.parked.confirmation);return}t.page.setConfirming(!0);try{let p=await t.capture(e.requestFrom(c.evidence));p.status==="paid"?t.page.markPaid():t.page.note(`${e.name} declined the payment \u2014 our team will follow up on payment.`),t.page.land(c.parked?.confirmation??p)}catch{c.parked?(t.page.note(`We could not confirm the ${e.name} payment \u2014 our team will follow up on payment.`),t.page.land(c.parked.confirmation)):t.page.fail(`We could not confirm your ${e.name} payment. Please contact us before trying again \u2014 your payment may already have been taken.`)}finally{t.page.setConfirming(!1)}}}function Fr(e,t,n){let r=(t??"").trim();if(!r)return"";if(n.length===0)return r;let a=r.toUpperCase(),i=`${e.toUpperCase()}-${a}`,c=n.find(p=>p.code&&p.code.toUpperCase()===a)??n.find(p=>p.code&&p.code.toUpperCase()===i)??n.find(p=>p.name.toUpperCase()===a);return c?c.code||c.name:""}import{jsx as ye}from"react/jsx-runtime";function jr(e){let t=e.indexOf(`
3
+ `);return t===-1?[e,""]:[e.slice(0,t),e.slice(t+1)]}function Dr(e,{canParkContext:t}={canParkContext:!0}){let n=e.paymentMethods,r=[];return n.includes("card")&&r.push({key:"card",title:"Card",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("paypal")&&e.paypalClientId&&r.push({key:"paypal",title:"PayPal",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL \xB7 CARDS"})}),n.includes("afterpay")&&r.push({key:"afterpay",title:"Afterpay",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 \xD7 INTEREST-FREE"})}),n.includes("square")&&e.squareApplicationId&&e.squareLocationId&&r.push({key:"square",title:"Card (Square)",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA \xB7 MC \xB7 AMEX"})}),n.includes("gocardless")&&t&&r.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),n.includes("zip")&&r.push({key:"zip",title:"Zip",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),n.includes("klarna")&&t&&r.push({key:"klarna",title:"Klarna",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),n.includes("bank")&&r.push({key:"bank",title:"Bank transfer",body:null,price:ye("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),r}var Mr="This shop does not take payment online yet. Please contact the shop to order.";function ko(e,t){if(!e.orderNumber&&Dt(t))return t.message;let n=t instanceof de?` (${t.message})`:"";return e.orderNumber?`Your order ${e.orderNumber} is saved, but the payment did not start${n}. Try the payment again \u2014 your order will not be placed twice.`:`Your items are held under ${e.checkoutNumber}, but the payment did not start${n}. Try the payment again \u2014 you will not be charged twice.`}var Ur="Shipping cannot be calculated right now. Please try again.";function Po({site:e,logo:t,preview:n=!1}){let{items:r,totals:a,coupon:i,refuseCoupon:c,deliveryOptions:p,shippingMethodId:d,setShippingMethodId:u,setQuoteDestination:y,courier:v,requote:b,identify:m,clearCapturedCart:w,replaceItems:N,removeCoupon:R}=ct(),V=p.find(l=>l.id===d)?.pickupLocation??null,{country:E,countries:C,activeCountry:M,formatMoney:B}=pe(),[D,ae]=k(()=>Dr(e)[0]?.key??null),[me,Se]=k(!0);Y(()=>{Se(En(re))},[]);let[oe,z]=k(!1),[te,ie]=k(""),[L,x]=k(""),[H,Ke]=k(""),[Ne,j]=k(""),[We,G]=k(""),[se,he]=k(""),[ce,A]=k(""),[J,Ie]=k(""),[T,we]=k(()=>E||C[0]?.code||""),[be,Xe]=k(""),[Ye,zt]=k([]),[Ct,kt]=k(null),[Ze,Be]=k(null),Ht=qr(()=>C.find(l=>l.code===T)??M,[C,T,M]),ta=Ht?.postalLabel||"Postal Code",na=Ye[0]?.divisionType||"State / Province";Y(()=>{if(!T){zt([]),kt(T);return}kt(null);let l=!1;return U.listCountrySubdivisions(T).then(f=>{l||(zt(f),kt(T),Xe(""))}),()=>{l=!0}},[T]);let Gt=Ne.trim()!==""&&se.trim()!==""&&ce.trim()!==""&&Ct===T&&(Ye.length===0||be!=="")?ce.trim():"";Y(()=>{y(T?{country:T,subdivision:be,postcode:Gt}:null)},[T,be,Gt,y]),Y(()=>()=>y(null),[y]);let ra=v?.status==="unavailable",aa=b,[Qe,Vt]=k(null),[oa,Jt]=k([]),[Xt,Pt]=k("new"),[Zt,Qt]=k(!1),[St,ia]=k("Home"),[sa,en]=k(null),[Z,tn]=k(()=>lt()),nn=ee(null),[rn,le]=k(null),[ca,fe]=k(null),[an,et]=k(null),[on,la]=k(!1),[sn,ua]=k(!1),[ve,Ae]=k(null),[da,Te]=k(!1),[ne,Le]=k(null),[pa,ge]=k(null),[ma,fa]=k(!1),[ga,cn]=k(!1),[ya,ha]=k(!1),[ba,ln]=k(!1),[un,va]=k(!1),[xa,Nt]=k(!1),[wt,dn]=k(null),tt=ee(null),Et=ee(r),pn=!!(rn||wt&&wt.kind!=="processing"||un||on||sn||an&&ve?.orderNumber);Y(()=>{pn&&(N([]),R())},[pn,N,R]);let mn=ee(!1);Y(()=>{n||mn.current||!r.some(Ge)||(mn.current=!0,An({lines:r,currency:a.currency,value:a.subtotal-a.discount,coupon:i?.valid?i.code:void 0}))},[r,a,i,n]),Y(()=>{m(te,L.trim()||void 0)},[te,L,m]);let fn=ee(null),[nt,Ca]=k(null);Y(()=>{let l=fn.current;if(!nt||!l)return;let f=()=>l.style.setProperty("--sf-checkout-header-h",`${nt.offsetHeight}px`);f();let g=new ResizeObserver(f);return g.observe(nt),()=>g.disconnect()},[nt]),Y(()=>{let l=g=>({setConfirming:g,land:le,markPaid:()=>Te(!0),note:ge,fail:fe,clearCart:w}),f={search:window.location.search,storage:re,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};$t(Lr,{...f,capture:U.captureAfterpayPayment,page:l(fa)}),$t(_r,{...f,capture:U.captureZipPayment,page:l(ha)})},[]),Y(()=>{let f=new URLSearchParams(window.location.search).get("gocardless");if(f!=="confirm"&&f!=="cancel")return;let g=re.getItem(yt);if(re.removeItem(yt),window.history.replaceState(null,"",window.location.pathname),!g)return;let P;try{P=JSON.parse(g)}catch{return}if(w(),f==="cancel"){ge("The direct debit was not set up \u2014 our team will follow up on payment."),le(P.confirmation);return}cn(!0),U.completeGocardlessPayment({idempotencyKey:P.idempotencyKey}).then(O=>{O.status==="paid"?Te(!0):O.status==="declined"?ge("The direct debit was declined \u2014 our team will follow up on payment."):ge("Your direct debit is set up \u2014 the payment is collecting and will clear in a few days.")}).catch(()=>{ge("We could not confirm the direct debit \u2014 our team will follow up on payment.")}).finally(()=>{le(P.confirmation),cn(!1)})},[]),Y(()=>{let l=new URLSearchParams(window.location.search),f=l.get("klarna");if(f!=="confirm"&&f!=="cancel")return;let g=re.getItem(ht);re.removeItem(ht);let P=l.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!g)return;let O;try{O=JSON.parse(g)}catch{return}if(w(),f==="cancel"||!P){ge("The Klarna payment was not completed \u2014 our team will follow up on payment."),le(O.confirmation);return}ln(!0),U.captureKlarnaPayment({idempotencyKey:O.idempotencyKey,authorizationToken:P}).then($=>{$.status==="paid"?Te(!0):$.status==="declined"?ge("Klarna declined the payment \u2014 our team will follow up on payment."):ge("Your Klarna payment is being reviewed \u2014 we'll confirm the outcome shortly.")}).catch(()=>{ge("We could not confirm the Klarna payment \u2014 our team will follow up on payment.")}).finally(()=>{le(O.confirmation),ln(!1)})},[]);function gn(l){let[f,g]=jr(l.address);j(f),G(g),he(l.city),A(l.zip_code),l.country&&we(l.country),l.phone&&Ie(l.phone),Be({country:l.country||null,state:l.state??""})}Y(()=>{if(Ze){if((Ze.country||T)!==T){Be(null);return}Ct===T&&(Xe(Fr(T,Ze.state,Ye)),Be(null))}},[Ze,T,Ct,Ye]),Y(()=>{let l=!1;return(async()=>{try{let[f,g,P]=await Promise.all([De.me(),De.myProfile().catch(()=>null),De.myAddresses().catch(()=>[])]);if(l)return;Vt(f);let O=P.filter(ze=>ze.is_active);Jt(O),ie(f.email);let $=(g?.contact_name??"").split(/\s+/);x(f.first_name||$[0]||""),Ke(f.last_name||$.slice(1).join(" "));let Sn=f.phone||g?.phone;Sn&&Ie(Sn);let Ot=O.find(ze=>ze.id===f.default_delivery_location)??O[0];if(Ot)Pt(Ot.id),gn(Ot);else if(g){let[ze,Ea]=jr(g.address??"");j(ze),G(Ea),he(g.city??""),A(g.zip_code??""),g.country&&we(g.country),Be({country:g.country||null,state:g.state??""})}}catch{}})(),()=>{l=!0}},[]);function ka(){De.logout(),Vt(null),Jt([]),Pt("new"),Qt(!1),ie(""),x(""),Ke(""),j(""),G(""),he(""),A(""),Ie(""),we(E||C[0]?.code||""),Xe(""),Be(null)}let _e=qr(()=>Dr(e,{canParkContext:me}),[e,me]);Y(()=>{_e.some(l=>l.key===D)||ae(_e[0]?.key??null)},[_e,D]);let Pa=_e.length===0,rt=We.trim()?`${Ne}
4
+ ${We.trim()}`:Ne,xe=JSON.stringify([te,L,H,J,rt,se,be,ce,T,r.map(l=>[l.id,l.qty]),d,At(i),D,a.currency,Qe?.id??null]),at=ee(null),Ce=ee(!1),Fe=ee(null),ot=ee(!1),Rt=ee(xe);Rt.current=xe;let yn=ee(oe);yn.current=oe;let hn=()=>Ce.current&&Rt.current!==at.current,qe=ee(null);Y(()=>{yn.current||(xe!==qe.current&&(qe.current=null),!(!Ce.current||!ne||ne.orderNumber)&&(xe===at.current||xe===qe.current||it(ne)))},[xe,ne]);async function it(l){if(!ot.current){ot.current=!0,z(!0);try{let f=Fe.current?await kr(Fe.current):"none";if(f==="succeeded"||f==="processing"){Ce.current=!1,Le(null),f==="succeeded"?await je(void 0,l):vn(l);return}if(f===void 0||!Pr.has(f)){qe.current=Rt.current,Le(l),fe(Ue);return}Ce.current=!1,Fe.current=null,qe.current=null,fe(null),Le(null),tn(lt())}finally{ot.current=!1,z(!1)}}}async function Sa(){if(n||oe||ot.current)return;if(ne){if(Ce.current&&!ne.orderNumber&&xe!==at.current){await it(ne);return}z(!0),fe(null),await xn();let g=ne.orderNumber?D:"card";g!==D&&ae(g),await Cn(ne,g,!ne.orderNumber);return}if(r.length===0||a.repricing||!D||!_e.some(g=>g.key===D))return;let l=r.filter(Ge).flatMap(g=>In(g.components,g.qty));if(l.length===0){fe("Pick a size on each wheel's product page before checking out.");return}z(!0),fe(null);let f;try{let g=Qe?U.createOrderAuthed:U.createOrder,P=Wn(),O={customer:{email:te,name:`${L} ${H}`.trim(),phone:J.trim()||void 0,address:rt,city:se,state:be||void 0,zipCode:ce,country:T},items:l,currency:a.currency,idempotencyKey:Z,shippingMethodId:d??void 0,couponCode:At(i),...P==="denied"?{}:Rr(),...P?{adConsent:P}:{},...Cr(D)?{checkoutFlow:xr}:{}};tt.current=()=>g(O),Fe.current=null,Ce.current=!1,qe.current=null,at.current=xe,Et.current=r,f=await g(O),f.orderNumber&&(bn(f),w()),await xn()}catch(g){let P=On(g);P?(c(P),fe(`${P} Your order has not been placed. Place it again to continue without the code.`)):fe(g instanceof de?g.message:"Could not place the order. Please try again."),z(!1);return}await Cn(f)}function bn(l){Tn({confirmation:l,lines:Et.current,adsSendTo:e.googleAdsId&&e.googleAdsConversionLabel?`${e.googleAdsId}/${e.googleAdsConversionLabel}`:null}),Tr({confirmation:l,lines:Et.current})}async function je(l,f=ve){if(!f)return;let g=l?async()=>l:tt.current;if(f.orderNumber||!g){Te(!0),le(f);return}w(),await Sr({checkoutNumber:f.checkoutNumber,resend:g,page:{setConfirming:va,land:le,markPaid:()=>Te(!0),track:bn,unplaced:dn}})}function vn(l=ve){if(l){if(l.orderNumber){le(l);return}w(),dn({kind:"processing",checkoutNumber:l.checkoutNumber})}}async function xn(){let l=JSON.stringify([St.trim(),L,H,J.trim(),rt,se,be,ce,T]);if(!(!Qe||!Zt||Xt!=="new"||nn.current===l))try{await De.createAddress({label:St.trim()||"Home",contact_name:`${L} ${H}`.trim(),phone:J.trim(),address:rt,city:se,zip_code:ce,state:be,country:T}),nn.current=l,en("Address saved to your account.")}catch{en("We couldn't save the address to your account \u2014 you can add it under Account \u2192 Addresses.")}}async function Cn(l,f=D,g=!1){Le(null);try{if(f==="card"&&e.paymentMethods.includes("card")){let P=await U.createPaymentIntent({idempotencyKey:Z});if(Fe.current=P,g&&hn()){await it(l);return}let O=l;if(g){let $=await tt.current?.().catch(()=>null);if($?.orderNumber){await je($,l);return}if(O=kn(l,$)??{...l,expiresAt:null},hn()){await it(l);return}}Ae(O),Nt(!1),et(P)}else if(f==="paypal"&&e.paymentMethods.includes("paypal"))Ae(l),la(!0);else if(f==="afterpay"&&e.paymentMethods.includes("afterpay")){let P=window.location.origin,O=await U.createAfterpayCheckout({idempotencyKey:Z,confirmUrl:`${P}/checkout?afterpay=confirm`,cancelUrl:`${P}/checkout?afterpay=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(Mt,JSON.stringify($)),window.location.assign(O.redirectCheckoutUrl);return}else if(f==="square"&&e.paymentMethods.includes("square"))Ae(l),ua(!0);else if(f==="gocardless"&&e.paymentMethods.includes("gocardless")){let P=window.location.origin,O=await U.createGocardlessBillingRequest({idempotencyKey:Z,confirmUrl:`${P}/checkout?gocardless=confirm`,cancelUrl:`${P}/checkout?gocardless=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(yt,JSON.stringify($)),window.location.assign(O.authorisationUrl);return}else if(f==="zip"&&e.paymentMethods.includes("zip")){let P=window.location.origin,O=await U.createZipCheckout({idempotencyKey:Z,redirectUrl:`${P}/checkout?zip=return`}),$={idempotencyKey:Z,confirmation:l};re.setItem(Ut,JSON.stringify($)),window.location.assign(O.redirectUrl);return}else if(f==="klarna"&&e.paymentMethods.includes("klarna")){let P=window.location.origin,O=await U.createKlarnaCheckout({idempotencyKey:Z,confirmUrl:`${P}/checkout?klarna=confirm`,cancelUrl:`${P}/checkout?klarna=cancel`}),$={idempotencyKey:Z,confirmation:l};re.setItem(ht,JSON.stringify($)),window.location.assign(O.redirectUrl);return}else le(l)}catch(P){if(g&&P instanceof de&&P.status===409){await je(void 0,l);return}Pn(l,P),z(!1)}}function kn(l,f){return f&&!f.orderNumber&&f.status==="open"&&f.checkoutNumber===l.checkoutNumber?f:null}function Pn(l,f){fe(ko(l,f)),!l.orderNumber&&Dt(f)?(Ce.current=!1,tn(lt())):Le(l)}async function Na(l){if(!ve)return;let f=ve;try{let g=await U.createPaymentIntent({idempotencyKey:Z}),P=await tt.current?.().catch(()=>null);if(P?.orderNumber){await je(P);return}let O=kn(f,P);Ae(O??{...f,expiresAt:null}),Nt(l&&O!==null),Fe.current=g,et(g)}catch(g){if(g instanceof de&&g.status===409){await je();return}et(null),Ae(null),Pn(f,g),z(!1)}}function wa(){ve&&(Ce.current=!0,Le(ve),et(null),Ae(null),Nt(!1),z(!1))}return{site:e,logo:t,items:r,totals:a,coupon:i,deliveryOptions:p,courierUnavailable:ra,retryCourier:aa,shippingMethodId:d,setShippingMethodId:u,pickupLocation:V,servedCountries:C,formatMoney:B,payChoice:D,setPayChoice:ae,placing:oe,email:te,setEmail:ie,firstName:L,setFirstName:x,lastName:H,setLastName:Ke,address1:Ne,setAddress1:j,address2:We,setAddress2:G,city:se,setCity:he,postcode:ce,setPostcode:A,phone:J,setPhone:Ie,country:T,setCountry:we,subdivision:be,setSubdivision:Xe,subdivisions:Ye,destination:Ht,postcodeLabel:ta,subdivisionLabel:na,me:Qe,savedAddresses:oa,selectedAddressId:Xt,setSelectedAddressId:Pt,saveAddress:Zt,setSaveAddress:Qt,saveLabel:St,setSaveLabel:ia,addressSaveNote:sa,idemKey:Z,confirmation:rn,setConfirmation:le,orderError:ca,payment:an,paypalStep:on,squareStep:sn,pendingConf:ve,paid:da,setPaid:Te,unpaidOrder:ne,payNote:pa,afterpayConfirming:ma,gocardlessConfirming:ga,zipConfirming:ya,klarnaConfirming:ba,cardConfirming:un,checkoutResult:wt,confirmCardPayment:je,cardStillProcessing:vn,renewCardPayment:Na,holdRenewed:xa,leaveCardPayment:wa,checkoutRootRef:fn,setCheckoutHeaderEl:Ca,fillFromAddress:gn,checkoutSignOut:ka,payOptions:_e,noPaymentMethod:Pa,placeOrder:Sa}}var $r=xo(null);function Kr({children:e,...t}){let n=Po(t);return ye($r.Provider,{value:n,children:e})}function ke(){let e=Co($r);if(!e)throw new Error("useCheckout must be used inside CheckoutStateProvider");return e}import{useId as Kt}from"react";import{Fragment as Pe,jsx as o,jsxs as S}from"react/jsx-runtime";function Yr(){let{email:e,setEmail:t,firstName:n,setFirstName:r,lastName:a,setLastName:i,me:c,checkoutSignOut:p}=ke(),d=Kt();return S(vt,{num:"N\xB0 01",title:"Contact",children:[o(Q,{label:"Email",htmlFor:d,hint:c?S(Pe,{children:["Signed in \xB7"," ",o("button",{type:"button",onClick:p,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:o("input",{id:d,type:"email",value:e,onChange:u=>t(u.target.value),placeholder:"you@example.com",readOnly:c!==null,className:X+(c?" opacity-70":"")})}),S(Vr,{children:[o(Q,{label:"First name",children:o("input",{type:"text",value:n,onChange:u=>r(u.target.value),className:X})}),o(Q,{label:"Last name",children:o("input",{type:"text",value:a,onChange:u=>i(u.target.value),className:X})})]})]})}function Br(){let{pickupLocation:e,servedCountries:t,address1:n,setAddress1:r,address2:a,setAddress2:i,city:c,setCity:p,postcode:d,setPostcode:u,phone:y,setPhone:v,country:b,setCountry:m,subdivision:w,setSubdivision:N,subdivisions:R,destination:V,postcodeLabel:E,subdivisionLabel:C,me:M,savedAddresses:B,selectedAddressId:D,setSelectedAddressId:ae,saveAddress:me,setSaveAddress:Se,saveLabel:oe,setSaveLabel:z,fillFromAddress:te}=ke(),ie=Kt(),L=Kt();return S(vt,{num:"N\xB0 02",title:e?"Collection":"Shipping address",children:[e?S("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[o("span",{className:"font-medium",children:e.name}),[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).length>0&&o("span",{className:"opacity-80",children:[e.address,e.city,e.state,e.zipCode,e.country].filter(Boolean).join(", ")}),e.openingHours&&o("span",{className:"opacity-80",children:e.openingHours}),e.instructions&&o("span",{className:"opacity-80",children:e.instructions}),o("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):S(Pe,{children:[M!==null&&B.length>0&&S("div",{className:"grid gap-3",children:[B.map(x=>o(bt,{active:D===x.id,onClick:()=>{ae(x.id),te(x)},title:x.label,body:x.formatted_address,price:null},x.id)),o(bt,{active:D==="new",onClick:()=>ae("new"),title:"New address",body:null,price:null})]}),o(Q,{label:"Address line 1",children:o("input",{type:"text",value:n,onChange:x=>r(x.target.value),className:X})}),o(Q,{label:"Address line 2",children:o("input",{type:"text",value:a,onChange:x=>i(x.target.value),placeholder:"Apartment, unit, garage bay\u2026",className:X})}),S(Vr,{cols:"three",children:[o(Q,{label:"City",children:o("input",{type:"text",value:c,onChange:x=>p(x.target.value),className:X})}),o(Q,{label:E,children:o("input",{type:"text",value:d,onChange:x=>u(x.target.value),className:X})}),o(Q,{label:"Country",separate:!0,htmlFor:ie,children:o(Lt,{id:ie,value:b,onChange:x=>m(x.target.value),className:X+" pr-10",style:Wr,children:t.map(x=>o("option",{value:x.code,children:x.name},x.code))})})]}),o(Q,{label:C,separate:!0,htmlFor:L,children:R.length>0?S(Lt,{id:L,value:w,onChange:x=>N(x.target.value),className:X+" pr-10",style:Wr,children:[o("option",{value:"",children:"Select\u2026"}),R.map(x=>o("option",{value:x.code||x.name,children:x.name},x.code||x.name))]}):o("input",{id:L,type:"text",value:w,onChange:x=>N(x.target.value),className:X})})]}),o(Q,{label:"Phone",children:o("input",{type:"tel",value:y,onChange:x=>v(x.target.value),className:X})}),!e&&M!==null&&D==="new"&&S(Pe,{children:[o(So,{checked:me,onChange:Se,label:"Save this address to my account"}),me&&o(Q,{label:"Address label",children:o("input",{type:"text",value:oe,onChange:x=>z(x.target.value),placeholder:"Home",className:X})})]})]})}function zr(){let{totals:e,coupon:t,deliveryOptions:n,shippingMethodId:r,setShippingMethodId:a,pickupLocation:i,formatMoney:c,city:p,destination:d,courierUnavailable:u,retryCourier:y}=ke();return o(vt,{num:"N\xB0 03",title:"Shipping",children:S("div",{className:"grid gap-3",children:[n.map(v=>{let b=v.pickupLocation,m=b?[b.address,b.city,b.state,b.zipCode].filter(Boolean).join(", "):null;return o(bt,{active:r===v.id,onClick:()=>a(v.id),title:b?`${v.name} \u2014 ${b.name}`:v.name,body:b?[m,b.openingHours,b.instructions,v.description].filter(Boolean).join(" \xB7 "):v.description||null,price:e.freeShipping||v.amount===0?st:c(v.amount,e.currency),tag:v.tag||void 0},v.id)}),u?S("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[Ur," ",o("button",{type:"button",onClick:y,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Hr(){let{payChoice:e,setPayChoice:t,placing:n,payment:r,payOptions:a,noPaymentMethod:i}=ke();return S(vt,{num:"N\xB0 04",title:"Payment",children:[i&&o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:Mr}),o("div",{className:"grid gap-3",children:a.map(c=>o(bt,{active:e===c.key,onClick:()=>t(c.key),title:c.title,body:c.body,price:c.price,tag:c.tag},c.key))}),e==="card"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="paypal"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll approve the payment with PayPal on the payment step after placing the order."}):e==="afterpay"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):e==="square"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll enter card details on the secure payment step after placing the order."}):e==="gocardless"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):e==="zip"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Zip to approve four instalments, then brought straight back."}):e==="klarna"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You\u2019ll be taken to Klarna to choose how to pay, then brought straight back."}):e==="bank"?o("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."}):null]})}function Gr(){let{site:e,items:t,totals:n,coupon:r,formatMoney:a,payChoice:i,placing:c,email:p,orderError:d,payment:u,noPaymentMethod:y,unpaidOrder:v,placeOrder:b}=ke();return S("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[S("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[o("span",{children:"Your order"}),o(ue,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit \u2197"})]}),o("div",{className:"flex flex-col px-6 py-2",children:t.length===0?S("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",o(ue,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog \u2192"})]}):t.map(m=>o(No,{slug:m.slug,name:m.name,qty:m.qty,config:m.config,configSummary:wo(m.config),price:qn(m,n.currency)??0,currency:n.currency},m.id))}),o("div",{className:"border-t border-line px-6 pt-5",children:o(Kn,{customerEmail:p})}),S("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[o(Re,{label:"Subtotal",value:a(n.subtotal,n.currency)}),n.discount>0&&r?.valid&&o(Re,{label:`Coupon \xB7 ${r.code}`,value:S("span",{className:"font-semibold text-green",children:["\u2212 ",a(n.discount,n.currency)]})}),r?.deferred&&o(Re,{label:`Coupon \xB7 ${r.code}`,value:Rn}),r?.valid&&r.effects?.gift&&o(Re,{label:`Free gift \xB7 ${r.effects.gift.partNumber}${r.effects.gift.quantity>1?` \xD7${r.effects.gift.quantity}`:""}`,value:o("span",{className:"font-semibold text-green",children:st})}),o(Re,{label:"Shipping",value:n.shippingStatus==="free"?o("span",{className:"font-semibold text-green",children:st}):_n(n.shippingStatus)??a(n.shipping,n.currency)}),n.tax&&(n.tax.charged?o(Re,{label:n.tax.inclusive?`${n.tax.name} included \xB7 ${n.tax.rate}%`:n.tax.name,value:a(n.tax.amount,n.currency)}):n.tax.name?o(Re,{label:n.tax.name,value:Ln}):null)]}),S("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[o("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),o("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"\u2026":a(n.grand,n.currency)})]}),S("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[d&&o(Ee,{role:"alert",children:d}),n.hasUnpricedLine&&S(Ee,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),o("button",{type:"button",onClick:b,disabled:c||!v&&(y||t.length===0||n.hasUnpricedLine||n.repricing),className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",c||!v&&(t.length===0||y||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:c?S(Pe,{children:["Building order\u2026 ",o("span",{children:"\xB7"})]}):y?S(Pe,{children:["No online payment ",o("span",{children:"\xB7"})]}):v?S(Pe,{children:["Try payment again \xB7 ",gt(v),o("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]}):n.repricing?S(Pe,{children:["Updating total\u2026 ",o("span",{children:"\xB7"})]}):S(Pe,{children:[i==="bank"?"Place order":"Continue to payment"," \xB7"," ",a(n.grand,n.currency),o("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})})]})]})}var Wr={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function vt({num:e,title:t,children:n}){return S("section",{className:"mb-6 border border-line bg-bg",children:[S("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[o("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e}),o("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:t})]}),o("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function Vr({cols:e="two",children:t}){return o("div",{className:["grid gap-3 max-[640px]:grid-cols-1",e==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:t})}function bt({active:e,onClick:t,title:n,body:r,price:a,tag:i}){return S("button",{type:"button",onClick:t,"aria-pressed":e,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",e?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[e&&o("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),o("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",e?"border-accent":"border-fg-dim"].join(" "),children:e&&o("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),S("span",{className:"flex min-w-0 flex-col gap-1",children:[S("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,i&&o("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:i})]}),r&&o("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:r})]}),o("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function So({checked:e,onChange:t,label:n,sub:r}){return S("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[o("button",{type:"button",onClick:()=>t(!e),"aria-pressed":e,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",e?"border-accent":"border-line"].join(" "),style:e?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:e&&o("span",{className:"text-[13px] text-accent",children:"\u2713"})}),S("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,r&&o("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:r})]})]})}function No({slug:e,name:t,qty:n,config:r,configSummary:a,price:i,currency:c}){let{catalog:p}=ct(),{formatMoney:d}=pe(),u=p.find(N=>N.slug===e),y=u?.spokes??5,v=u?.mesh??!1,b=r.find(N=>N.gold)?.label,m=u?.finishes.find(N=>N.name===b&&N.src)??u?.finishes.find(N=>N.src),w=u?.finishes[0]?.color??$n;return S("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[S("div",{className:"relative aspect-square",children:[o("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:m?.src?o(Nn,{src:m.src,alt:`${t.lead}${t.accent} \u2014 ${m.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):o("div",{className:"block w-[78%]",style:{color:w},children:o(Un,{spokes:y,mesh:v,className:"block w-full"})})}),o("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:n})]}),S("div",{className:"flex min-w-0 flex-col gap-0.5",children:[S("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[t.lead,o("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:t.accent})]}),o("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),o("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:d(i,c)})]})}function Re({label:e,value:t}){return S("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[o("span",{children:e}),o("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:t})]})}function wo(e){return e.map(t=>t.label).join(" \xB7 ")}import{Fragment as K,jsx as s,jsxs as h}from"react/jsx-runtime";function Bt(e){return s(Kr,{...e,children:s(Oo,{})})}function Eo({order:e,paid:t}){let{formatMoney:n}=pe();if(!e.grandTotal||!e.currency)return null;let r=c=>n(Number(c),e.currency),a=Number(e.freightCharge??0),i=Number(e.discountAmount??0);return h("dl",{className:"grid w-full max-w-sm grid-cols-[1fr_auto] gap-x-6 gap-y-1 border-y border-line py-3 text-left text-sm",children:[(e.shippingMethod||a>0)&&h(K,{children:[h("dt",{className:"text-fg-dim",children:["Delivery",e.shippingMethod?` \xB7 ${e.shippingMethod}`:""]}),s("dd",{className:"text-right font-mono",children:r(e.freightCharge??"0")})]}),i>0&&h(K,{children:[h("dt",{className:"text-fg-dim",children:["Discount",e.couponCode?` \xB7 ${e.couponCode}`:""]}),h("dd",{className:"text-right font-mono",children:["\u2212",r(e.discountAmount??"0")]})]}),s("dt",{className:"text-fg",children:t?"Total paid":"Order total"}),s("dd",{className:"text-right font-mono text-fg",children:r(e.grandTotal)})]})}function Ro({result:e}){let t=s("span",{className:"font-mono text-fg",children:e.checkoutNumber});return h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:e.kind==="refunded"||e.kind==="expired"?"Order not placed":e.kind==="processing"?"Payment processing":"Payment received"}),s("p",{className:"text-fg-dim",children:e.kind==="refunded"?h(K,{children:["An item sold out or an offer ended while you paid for checkout ",t,". Your payment is refunded to your card."]}):e.kind==="expired"?h(K,{children:["The hold on checkout ",t," ran out before your payment arrived. Your payment is refunded to your card."]}):e.kind==="processing"?h(K,{children:["Your payment for checkout ",t," is being processed. When it goes through, we will email your order confirmation."]}):h(K,{children:["Thank you \u2014 your payment for checkout ",t," has gone through. We will email you the order number shortly."]})}),s(ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]})}function Oo(){let{site:e,logo:t,items:n,placing:r,email:a,me:i,addressSaveNote:c,idemKey:p,confirmation:d,setConfirmation:u,payment:y,paypalStep:v,squareStep:b,pendingConf:m,paid:w,setPaid:N,payNote:R,afterpayConfirming:V,gocardlessConfirming:E,zipConfirming:C,klarnaConfirming:M,cardConfirming:B,checkoutResult:D,confirmCardPayment:ae,cardStillProcessing:me,renewCardPayment:Se,holdRenewed:oe,leaveCardPayment:z,checkoutRootRef:te,setCheckoutHeaderEl:ie}=ke();return d?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:w?"Payment received":"Order received"}),h("p",{className:"text-fg-dim",children:[w?h(K,{children:["Thank you \u2014 your payment for order"," ",s("span",{className:"font-mono text-fg",children:d.orderNumber})," has gone through."," "]}):h(K,{children:["Thank you \u2014 your order ",s("span",{className:"font-mono text-fg",children:d.orderNumber})," is being reviewed by our team."," "]}),i?h(K,{children:["Track it under"," ",s(ue,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):s(K,{children:"We\u2019ve emailed you a link to set a password and track it."})]}),s(Eo,{order:d,paid:w}),R&&s("p",{className:"text-sm text-fg-dim",children:R}),c&&s("p",{className:"text-sm text-fg-dim",children:c}),!i&&h("p",{className:"text-sm text-fg-dim",children:["You can also"," ",s(ue,{href:`/track?order=${encodeURIComponent(d.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email \u2014 no password needed."]}),s(ue,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):D?s(Ro,{result:D}):B?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Placing your order \u2014 one moment."})]}):V?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay \u2014 one moment."})]}):E?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Setting up your direct debit\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless \u2014 one moment."})]}):C?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip \u2014 one moment."})]}):M?h("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[s("h1",{className:"font-display text-3xl",children:"Confirming your payment\u2026"}),s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna \u2014 one moment."})]}):y&&m?s(Io,{payment:y,checkout:m,holdRenewed:oe,onPaid:ae,onProcessing:me,onRenew:Se,onBack:z}):v&&m?s(_o,{confirmation:m,clientId:e.paypalClientId??"",idemKey:p,onPaid:()=>{N(!0),u(m)},onSkip:()=>u(m)}):b&&m?s(qo,{confirmation:m,applicationId:e.squareApplicationId??"",locationId:e.squareLocationId??"",environment:e.squareEnvironment??"production",idemKey:p,onPaid:()=>{N(!0),u(m)},onSkip:()=>u(m)}):h("div",{ref:te,className:"bg-bg text-fg",children:[h("header",{ref:ie,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[h(ue,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",s("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),s(ue,{href:"/","aria-label":`${e.name} home`,className:"inline-flex items-center justify-center",children:s(Mn,{variant:"header",scrolled:!0,src:t?.url??null,reverse:t?.reverse??!1,reversedSrc:t?.reversed??null,inkIsDark:t?.inkIsDark??null,size:t?.size??"medium",sizePx:t?.sizePx??null,siteName:e.name})}),e.cardPayments?h("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[s("span",{className:"text-green",children:"\u25CF"}),s("span",{className:"max-[640px]:hidden",children:"Encrypted \xB7"})," Stripe"]}):s("span",{})]}),h("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[s("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),s("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(L=>h("span",{className:["relative flex items-center gap-2 transition-colors",L.state==="pending"?"text-fg-dim":"text-fg",L.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[s("span",{className:L.state==="done"?"text-accent font-bold":"",children:L.n}),s("span",{children:L.label})]},L.n))})]}),h("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[h("div",{children:[s(Yr,{}),s(Br,{}),s(zr,{}),s(Hr,{})]}),s(Gr,{})]}),s("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:s("span",{children:Dn({legalName:e.legalName,foundedYear:e.foundedYear,siteName:e.name})})})]})}function Io({payment:e,checkout:t,holdRenewed:n,onPaid:r,onProcessing:a,onRenew:i,onBack:c}){let{formatMoney:p}=pe(),d=s("span",{className:"text-fg",children:p(Number(e.amount),e.currency)}),u=Jr(()=>ft(e.publishableKey),[e.publishableKey]),y=Jr(()=>Yn(),[]);return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:gt(t)}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[s("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:t.orderNumber?h(K,{children:["Your order is placed. Pay ",d," by card to confirm it now."]}):n?h(K,{children:["Your hold ran out, so your items are held again",t.expiresAt?` until ${Xr(t.expiresAt)}`:"",". Enter your card again, then pay ",d,"."]}):h(K,{children:["Your items are held",t.expiresAt?` until ${Xr(t.expiresAt)}`:"",". Pay ",d," by card to place your order."]})}),s(jt,{stripe:u,options:{clientSecret:e.clientSecret,appearance:y},children:s(To,{payment:e,checkout:t,onPaid:r,onProcessing:a,onRenew:i,onBack:c})},e.clientSecret)]})]})})}function Xr(e){return new Date(e).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}var Ao=5;function To({payment:e,checkout:t,onPaid:n,onProcessing:r,onRenew:a,onBack:i}){let{formatMoney:c}=pe(),p=pr(),d=ur(),[u,y]=Oe(!1),[v,b]=Oe(null),m=$e(!1);async function w(){try{return(await p.retrievePaymentIntent(e.clientSecret)).paymentIntent?.status}catch{return}}async function N(E){let C=E;for(let M=0;C==="processing"&&M<Ao;M+=1)await new Promise(B=>setTimeout(B,1e3)),C=await w()??C;if(C==="succeeded"){n();return}if(C==="processing"){r();return}b("Payment did not complete. Please try again."),y(!1)}async function R(){if(!p||!d||u)return;y(!0),b(null),m.current=!0;let E=await p.confirmPayment({elements:d,redirect:"if_required"}).catch(()=>null);if(!E){let C=await w();if(C==="succeeded"||C==="processing"){await N(C);return}b(C===void 0?Ue:"Payment failed. Please try again."),y(!1);return}if(E.error){if(!t.orderNumber&&E.error.code==="payment_intent_unexpected_state"){let C=await w();if(C==="succeeded"||C==="processing"){await N(C);return}if(C===void 0){b(Ue),y(!1);return}await a(C==="canceled"),y(!1);return}b(E.error.message??"Payment failed. Please try again."),y(!1);return}await N(E.paymentIntent?.status)}async function V(){if(u)return;if(!m.current){i();return}y(!0),b(null);let E=await w();if(E==="succeeded"||E==="processing"){await N(E);return}if(y(!1),E===void 0){b(Ue);return}i()}return h("div",{className:"flex flex-col gap-4",children:[s(mr,{}),v&&s(Ee,{role:"alert",children:v}),s("button",{type:"button",onClick:R,disabled:!p||!d||u,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!p||!d||u?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?h(K,{children:["Processing\u2026 ",s("span",{children:"\xB7"})]}):h(K,{children:["Pay ",c(Number(e.amount),e.currency),s("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),!t.orderNumber&&!u&&h("button",{type:"button",onClick:V,className:"inline-flex items-center gap-3 self-start font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["\u2190",s("span",{children:"Back to checkout"})]})]})}var Zr="paypal-sdk-js",Wt=null;function Lo(e,t){let n=`${e}|${t}`;if(Wt?.key===n)return Wt.promise;let r=new Promise((a,i)=>{document.getElementById(Zr)?.remove();let c=document.createElement("script");c.id=Zr;let p=new URLSearchParams({"client-id":e,currency:t,intent:"capture"});c.src=`https://www.paypal.com/sdk/js?${p}`,c.onload=()=>{let d=window.paypal;d?a(d):i(new Error("PayPal SDK loaded without its namespace"))},c.onerror=()=>i(new Error("PayPal SDK failed to load")),document.head.appendChild(c)});return Wt={key:n,promise:r},r}function _o({confirmation:e,clientId:t,idemKey:n,onPaid:r,onSkip:a}){let{formatMoney:i}=pe(),c=$e(null),[p,d]=Oe(!1),[u,y]=Oe(null),v=$e(r);return v.current=r,ea(()=>{let b=!1,m=null;return Lo(t,e.currency).then(w=>{if(!(b||!c.current))return m=w.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await U.createPaypalOrder({idempotencyKey:n})).paypalOrderId,onApprove:async N=>{try{if((await U.capturePaypalOrder({idempotencyKey:n,paypalOrderId:N.orderID})).status==="paid"){v.current();return}y("PayPal did not complete the payment. Please try again.")}catch(R){y(R instanceof de?R.message:"PayPal payment failed. Please try again.")}},onError:()=>{y("PayPal could not process the payment. Please try again.")}}),m.render(c.current).then(()=>{b||d(!0)})}).catch(()=>{b||y("PayPal could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{b=!0,m?.close?.()}},[t,e.currency,n]),s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[h("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",s("span",{className:"text-fg",children:i(Number(e.grandTotal),e.currency)})," ","with PayPal to confirm it now."]}),!p&&!u&&s("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal\u2026"}),s("div",{ref:c}),u&&s(Ee,{role:"alert",children:u}),s("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}var Qr="square-web-sdk",Yt=null;function Fo(e){let t=e==="sandbox"?"sandbox":"production";if(Yt?.key===t)return Yt.promise;let n=new Promise((r,a)=>{document.getElementById(Qr)?.remove();let i=document.createElement("script");i.id=Qr,i.src=t==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",i.onload=()=>{let c=window.Square;c?r(c):a(new Error("Square SDK loaded without its namespace"))},i.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(i)});return Yt={key:t,promise:n},n}function qo({confirmation:e,applicationId:t,locationId:n,environment:r,idemKey:a,onPaid:i,onSkip:c}){let{formatMoney:p}=pe(),d=$e(null),u=$e(null),y=$e(null),[v,b]=Oe(!1),[m,w]=Oe(!1),[N,R]=Oe(null);ea(()=>{let E=!1,C=null;return Fo(r).then(async M=>{if(E||!d.current)return;let B=M.payments(t,n);y.current=B,C=await B.card(),await C.attach(d.current),u.current=C,E||b(!0)}).catch(()=>{E||R("Square could not be loaded. You can pay later \u2014 your order stands either way.")}),()=>{E=!0,C?.destroy?.()}},[t,n,r]);async function V(){let E=u.current;if(!(!E||m)){w(!0),R(null);try{let C=await E.tokenize();if(C.status!=="OK"||!C.token){R(C.errors?.[0]?.message??"Please check the card details and try again."),w(!1);return}let M;try{M=(await y.current?.verifyBuyer?.(C.token,{amount:String(e.grandTotal),currencyCode:e.currency,intent:"CHARGE"}))?.token}catch{}if((await U.chargeSquare({idempotencyKey:a,sourceId:C.token,...M?{verificationToken:M}:{}})).status==="paid"){i();return}R("Square did not complete the payment. Please try again.")}catch(C){R(C instanceof de?C.message:"Square payment failed. Please try again.")}w(!1)}}return s("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:h("div",{className:"w-full max-w-xl border border-line bg-bg",children:[h("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[s("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:e.orderNumber}),s("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),h("div",{className:"flex flex-col gap-4 px-6 py-6",children:[h("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",s("span",{className:"text-fg",children:p(Number(e.grandTotal),e.currency)})," ","by card to confirm it now."]}),!v&&!N&&s("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form\u2026"}),s("div",{ref:d}),N&&s(Ee,{role:"alert",children:N}),s("button",{type:"button",onClick:V,disabled:!v||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!v||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?h(K,{children:["Processing\u2026 ",s("span",{children:"\xB7"})]}):h(K,{children:["Pay ",p(Number(e.grandTotal),e.currency),s("span",{className:"transition-transform group-hover:translate-x-1",children:"\u2192"})]})}),s("button",{type:"button",onClick:c,disabled:m,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later \u2014 our team will be in touch"})]})]})})}import{jsx as xt}from"react/jsx-runtime";function jo(){let{settings:e,websiteName:t}=wn(),n=t?{...Tt,name:t}:Tt,r=e?{url:e.logoUrl,reversed:e.logoReversed??null,inkIsDark:e.logoInkIsDark??null,reverse:e.reverseLogo,size:e.logoSize,sizePx:e.logoSizePx}:null;return xt("div",{style:{position:"fixed",inset:0,zIndex:2147482e3,overflowY:"auto",background:"var(--bg)",color:"var(--fg)"},children:xt(Fn,{children:xt(jn,{preview:!0,children:xt(Bt,{site:n,logo:r,preview:!0})})})})}export{jo as default};
@@ -1 +1 @@
1
- "use client";import{Sk as r}from"./chunk-3IQQNZIM.js";import"./chunk-YAYHH5GY.js";import"./chunk-5NXOTPHK.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
1
+ "use client";import{Mk as r}from"./chunk-LZTJCQ4A.js";import"./chunk-WC4XIVX3.js";import"./chunk-TI4ZGDSG.js";import"./chunk-Y6SLVHK3.js";import{jsx as o}from"react/jsx-runtime";import e from"efficient-easel/screen/components/ScreenStoreProvider";function a(t){return o(e,{...t,parts:r})}export{a as default};
@@ -0,0 +1 @@
1
+ import{f as yt,i as he,q as bt,s as Ct,t as xt,v as G}from"./chunk-MZPZ4B7Y.js";import{Ia as ge,Ja as gt,Ma as qe,Na as ht,Qa as We,Ra as Ge}from"./chunk-WC4XIVX3.js";import{j as mt,l as ae}from"./chunk-TI4ZGDSG.js";import{createContext as Cn,useContext as _t,useEffect as xn,useMemo as be,useState as Pt}from"react";function vt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function se(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Ke=4,Fr=1,Ur={unit:"set",spares:0,spareSide:"left"};function Et(e){return e.unit==="single"?1:Ke+e.spares}function $r(e,t){return[{partNumber:e.partNumber,wheels:Et(t),prices:e.prices}]}function Hr(e,t){let n=Et(t)-Ke;if(n<=0||e.length===0)return e;let r=hn(e),o=r?r[t.spareSide]:0;return e.map((i,a)=>a===o?{...i,wheels:i.wheels+n}:i)}function hn(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function yn(e,t){return t.spares>0?`${e} + spare`:e}function Br(e){return e.unit==="single"?"Single":yn(`Set of ${Ke}`,e)}var qr="data-add-to-basket",ze=9,bn="en",St=new Map;function Le(e,t,n){let r=`${e}|${t??""}|${n??""}`,o=St.get(r);return o||(o=new Intl.NumberFormat(bn,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...n===void 0?{}:{maximumFractionDigits:n}}),St.set(r,o)),o}function ye(e,t,n=0){return Le(t,0,n).format(e)}function Wr(e,t){return Le(t).format(e)}import{jsx as Pn}from"react/jsx-runtime";var Sn="storefront-country",wt=Sn,Xe=Cn(null);function vn(e){return Rt(e,"catalogue")}function En(e){return Rt(e,"money")}function Rt(e,t){let n=new Map(e.map(r=>[r.code,r.decimalPlaces]));return(r,o)=>{if(!o)return"";let i=n.get(o)??0;return Le(o,t==="money"?i:0,i).format(r)}}function Vr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=be(()=>t??[],[t]),a=be(()=>n??[],[n]),l=be(()=>r||i.find(b=>b.isDefault)?.code||i[0]?.code||"",[r,i]),c=be(()=>o||a.find(b=>b.isDefault)?.code||a[0]?.code||"",[o,a]),[u,p]=Pt(c),[d,x]=Pt(!1);xn(()=>{let b=ae.getItem(wt);b&&a.some(E=>E.code===b)&&p(b),x(!0)},[a]);function R(b){p(b),ae.setItem(wt,b)}let C=be(()=>{let b=a.find(I=>I.code===u)??null,E=b?.currency,M=E&&i.some(I=>I.code===E)?E:l,D=vn(i),k=En(i);return{country:u,currency:M,setCountry:R,currencies:i,countries:a,activeCountry:b,formatPrice:(I,g)=>D(I,g??M),formatMoney:(I,g)=>k(I,g??M),ready:d}},[u,i,a,l,d]);return Pn(Xe.Provider,{value:C,children:e})}function Nt(){let e=_t(Xe);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}function Yr(){return _t(Xe)?.country??""}import{createContext as $n,useCallback as w,useContext as Hn,useEffect as V,useMemo as qt,useRef as xe,useState as _}from"react";function Lt(){return"/edit"}function It(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var Tt="We'll confirm this discount when you place your order.",eo="Confirmed at checkout";function to(e){return e&&(e.valid||e.deferred)?e.code:void 0}var kt="coupon_code: ";function no(e){return!(e instanceof he)||e.status!==400||!e.message.startsWith(kt)?null:e.message.slice(kt.length)}function At(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 ke="Price on request",_n="Request a quote",Rn="from ",ao="From ",so="each",Ot="Free";function Ve(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ye(e,t){let n=e?.[t];return Ve(n)?n:null}function lo(e,t,n,r){let o=Ye(e,n),i=Ye(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function uo(e,t,n,r){if(n==null&&r==null)return!0;let o=Ye(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var Nn={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function Ln(e,t,n){if(!Ve(e))return Nn;let r=Ve(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function co(e,t,n=""){return!e.priced||e.unit==null?ke:`${n}${ye(e.unit,t)}`}function fo(e,t){return e.was==null?null:ye(e.was,t)}function kn(e,t,n=1){let r=se(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((a,l)=>a+l.wheels,0),i=Math.min(...e.map(a=>a.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var In={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function po(e,t,n,r=1){let o=Ln(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let a=kn(t.components,n,r);return a.priced?{priced:!0,unit:a.unit,isFrom:a.isFrom,was:null,onSale:!1,setTotal:a.setTotal,fromSetTotal:i}:{...In,fromSetTotal:i}}function Tn(e,t){return!e.priced||e.unit==null?ke:`${e.isFrom?Rn:""}${ye(e.unit,t)}`}function mo(e,t){return e.was==null?null:ye(e.was,t)}function go(e,t){return!e.priced||e.unit==null?_n:Tn(e,t)}var An=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function Mt(e){return An.test(e.trim())}var Dt="sf:ga-purchases",On=20;function Ut(){return typeof window>"u"||window.parent!==window}function Ce(...e){try{if(Ut()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function Mn(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:se(e.components,t)??0,quantity:e.qty}}function Qe(e,t){return e.filter(Ie).map(n=>Mn(n,t))}function So(e){Ce("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 $t(e,t){let n=Qe([e],t);n.length!==0&&Ce("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function vo(e){let t=Qe(e.lines,e.currency);t.length!==0&&Ce("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var Ft=new Set;function Dn(e){if(Ft.has(e))return!1;Ft.add(e);try{let t=JSON.parse(ae.getItem(Dt)??"[]");if(t.includes(e))return!1;ae.setItem(Dt,JSON.stringify([...t,e].slice(-On)))}catch{}return!0}function Eo(e){let t=e.confirmation;if(Ut()||!Dn(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);Ce("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Qe(e.lines,n)}),e.adsSendTo&&Ce("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}var Fn="Arranged after review",Ht="Calculated at checkout",Un=Ht,_o=Ht;function Bt({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 Fn;case"pending":return Un;case"free":return Ot;case"charged":return null}}import{jsx as Gn}from"react/jsx-runtime";var Bn=400,qn=400,Wn=1500;function Ie(e){return(e.components?.length??0)>0}function Wt(e,t){return{code:e,valid:t.valid,deferred:It(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function Kt(e,t){return se(e.components,t)}function je(e,t){let n=Kt(e,t);return n===null?null:n*e.qty}function Gt(e){return e!=="tyre"}var zt=$n(null);function Ho({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=Nt(),[i,a]=_(t),[l,c]=_([]),[u,p]=_([]),[d,x]=_([]),[R,C]=_(!1),[b,E]=_(!1),[M,D]=_(!1),[k,I]=_(!1),[g,$]=_(null),[j,U]=_(0),y=w(()=>U(s=>s+1),[]),[P,S]=_(void 0),[K,Ue]=_(null),[v,T]=_(null),[le,ee]=_(!1),[A,ue]=_(null),Z=xe(void 0),H=w(()=>a(!0),[]),te=w(()=>a(!1),[]),B=w(()=>a(s=>!s),[]);V(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&H()},[H,t]);let ne=Lt(),F=xe(ne);V(()=>{F.current!==ne&&(F.current=ne,t||te())},[ne,t,te]);let we=w(s=>{Ue(f=>f?.country===s?.country&&f?.subdivision===s?.subdivision&&f?.postcode===s?.postcode?f:s)},[]),re=w(s=>{I(!0),Gt(s)&&D(!0)},[]),ce=M||l.some(s=>Gt(s.kind)),de=k||l.length>0;V(()=>{if(t||!ce||R)return;let s=!0;return G.listWheels().then(f=>{s&&(p(f),C(!0))}),()=>{s=!1}},[t,ce,R]),V(()=>{if(t||!de||b)return;let s=!0;return G.listBundles().then(f=>{s&&(x(f),E(!0))}),()=>{s=!1}},[t,de,b]);let q=g?.deliveryOptions??[],fe=g?.courier??null;V(()=>{g&&ue(s=>s&&q.some(f=>f.id===s)?s:q[0]?.id??null)},[g]);let X=w(()=>l.filter(Ie).flatMap(s=>vt(s.components,s.qty)),[l]),_e=w(async(s,f)=>{let h=s.trim().toUpperCase();if(!h)return;let m=X();if(m.length===0){T({code:h,valid:!1,message:"Add a wheel to the cart first."});return}ee(!0),Z.current=f;try{let L=await G.validateCoupon({code:h,items:m,currency:n,shippingMethodId:A??void 0,customerEmail:f});T(Wt(h,L))}catch{T({code:h,valid:!1,unchecked:!0,message:"Could not check that code. Please try again."})}finally{ee(!1)}},[X,n,A]),Re=w(()=>{T(null),Z.current=void 0},[]),N=w(s=>{if(!v)return;let{code:f}=v;T(h=>h&&h.code===f?{code:f,valid:!1,refused:!0,message:s}:h)},[v]);V(()=>{if(!v||v.refused)return;let s=v.code,f=m=>m!==null&&m.code===s&&!m.refused,h=setTimeout(async()=>{let m=X();if(m.length===0){T(L=>f(L)?{code:s,valid:!1,message:"Add a wheel to the cart first."}:L);return}ee(!0);try{let L=await G.validateCoupon({code:s,items:m,currency:n,shippingMethodId:A??void 0,customerEmail:Z.current});T(me=>f(me)?Wt(s,L):me)}catch{}finally{ee(!1)}},Bn);return()=>clearTimeout(h)},[l,n,A]);let z=v&&!v.refused?v.code:void 0;V(()=>{if(t)return;let s=!0,f=setTimeout(async()=>{let h=X();if(h.length===0){$(null),S(void 0);return}try{let m=await G.quoteCart({items:h,currency:n,shippingMethodId:A??void 0,couponCode:z,customerEmail:Z.current||void 0,country:K?.country||r||void 0,subdivision:K?.country&&K.subdivision||void 0,postcode:K?.country&&K.postcode||void 0});if(!s)return;$(m)}catch{if(!s)return}S(z)},qn);return()=>{s=!1,clearTimeout(f)}},[l,n,A,z,r,K,j]);let oe=w(s=>{c(f=>{let h=f.findIndex(m=>m.id===s.id);return h===-1?[...f,s]:f.map((m,L)=>L===h?{...m,qty:Math.min(ze,m.qty+s.qty)}:m)}),$t(s,n)},[n]),ot=w(s=>{c(f=>f.filter(h=>h.id!==s))},[]),it=w((s,f)=>{let h=Math.max(1,Math.min(ze,f));c(m=>m.map(L=>L.id===s?{...L,qty:h}:L))},[]),at=w(s=>{c(s)},[]),[pe,un]=_(null),st=xe(null);st.current=pe;let W=xe(null),$e=xe(""),lt=w((s,f)=>{let h=s.trim().toLowerCase();Mt(h)&&un(m=>m&&m.email===h&&m.firstName===(f??"")?m:{email:h,firstName:f??""})},[]);V(()=>{if(t||!pe)return;let s=At(l.filter(Ie),m=>je(m,n)===null?ke:o(je(m,n),n)),f={email:pe.email,firstName:pe.firstName,currency:n,items:s},h=JSON.stringify(f);if(h!==$e.current)return W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{W.current=null,$e.current=h,G.captureCart(f).catch(m=>{})},Wn),()=>{W.current&&(clearTimeout(W.current),W.current=null)}},[l,pe,n,t]);let ut=w(()=>{W.current&&(clearTimeout(W.current),W.current=null);let s=st.current;s&&($e.current="",G.captureCart({email:s.email,firstName:s.firstName,currency:n,items:[]}).catch(f=>{}))},[n]),ct=qt(()=>{let s=l.reduce((O,ie)=>{let Ne=je(ie,n);return Ne===null?O:O+Ne},0),f=l.some(O=>Kt(O,n)===null),h=l.reduce((O,ie)=>O+ie.qty,0),m=v?.valid?v.effects:void 0,L=m?Math.min(s,Number(m.discountAmount)):0,me=g?.bundleDiscount??0,dn=g?.appliedBundles??[],He=!!m?.freeShipping,ft=q.find(O=>O.id===A),pt=He?0:g?.shipping??ft?.amount??0,fn=Bt({quoted:g!==null,optionCount:q.length,chosenAmount:ft?.amount,couponWaivesFreight:He}),Be={};for(let O of m?.freeUnits??[])Be[O.partNumber]=(Be[O.partNumber]??0)+O.quantity;let pn=g?.tax??null,mn=g?g.grandTotal:s-L-me+pt;return{sets:h,units:l.reduce((O,ie)=>O+(ie.components??[]).reduce((Ne,gn)=>Ne+gn.wheels*ie.qty,0),0),subtotal:s,hasUnpricedLine:f,discount:L,bundleDiscount:me,appliedBundles:dn,shipping:pt,freeShipping:He,shippingStatus:fn,freeUnitsByPartNumber:Be,tax:pn,grand:mn,repricing:!!v?.refused&&g!==null&&P===v?.code,currency:n}},[l,n,v,q,A,g,P]),dt=w(s=>{oe(s),H()},[oe,H]),cn=qt(()=>({isOpen:i,preview:t,open:H,close:te,toggle:B,items:l,catalog:u,bundles:d,warmCatalog:re,add:oe,addAndOpen:dt,remove:ot,setQty:it,replaceItems:at,identify:lt,clearCapturedCart:ut,coupon:v,applyCoupon:_e,removeCoupon:Re,refuseCoupon:N,couponBusy:le,deliveryOptions:q,setQuoteDestination:we,courier:fe,requote:y,shippingMethodId:A,setShippingMethodId:ue,totals:ct}),[i,t,H,te,B,l,u,d,re,oe,dt,ot,it,at,lt,ut,v,_e,Re,N,le,q,we,fe,y,A,ct]);return Gn(zt.Provider,{value:cn,children:e})}function Xt(){let e=Hn(zt);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as tr}from"react";function Vt(e,t,n,r){for(;e.size>=t;){let o,i;for(let[l,c]of e){if(c.expiresAt<=r){o=l;break}i===void 0&&n(l)&&(i=l)}let a=o??i??e.keys().next().value;if(a===void 0)return;e.delete(a)}}var Kn=6e4,zn=5e3,Xn=500,Te=new Map;async function Vn(e){let{host:t,matchesRequestHost:n}=await bt();if(!t)return"";let r=await Ct();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var Yn=e=>e.includes("|slug:")||e.includes("|xhost:");async function Yt(e,t){if(await xt()!==null)return t();let n=await Vn(e);if(!n)return t();let r=Date.now(),o=Te.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),a=i.outcome.state==="failed",l=a?zn:Kn,c=Te.get(n)?.lastGood,u=i.outcome.state==="ok"?i:a?c:void 0,p=a&&u?u:i;return Vt(Te,Xn,Yn,r),Te.set(n,{load:p,expiresAt:r+l,lastGood:u}),p}var Qn=404;function jn(e){if(e instanceof he&&e.status===Qn)return{state:"absent"};let t=e instanceof he?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var Zn="[storefront:chrome-load-failed]";function Jn(e,t){console.error(`${Zn} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function Qt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=jn(o);return i.state==="failed"&&Jn(e,i),{value:n,outcome:i}}}function er(e){return e==="production"?"silent":"banner"}var Vo=er("production");function nr(e,t){return e?.trim()||t}function ni({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=nr(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var rr={name:ge,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:qe},ri=tr(async()=>Yt("site",()=>Qt("site",async()=>{let e=await G.getSite();return{name:gt(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,consentEnabled:e.consentEnabled??!1,consentPrivacyPage:e.consentPrivacyPage??null,consentNoticeOptOut:e.consentNoticeOptOut??!1,socialLinks:ht(e.socialLinks)}},rr)));var oi={name:ge,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,consentEnabled:!1,consentPrivacyPage:null,consentNoticeOptOut:!1,socialLinks:qe};import{jsx as ve,jsxs as Ze}from"react/jsx-runtime";import{useEffect as Ae,useId as sr,useRef as Zt,useState as Oe}from"react";import{useRootIsDark as lr}from"efficient-shell/theme";import{efficientClientOpen as or}from"efficient-easel/screen/lib/session";var Se=new Map,ir=64;async function ar(e){if(!or())return null;try{let t=await fetch(`${mt()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function jt(e){let t=Se.get(e);if(t)return t;let n=ar(e);if(Se.set(e,n),Se.size>ir){let r=Se.keys().next();r.done||Se.delete(r.value)}return n}var ur=202/22,cr=.88,xi=16,dr="invert(1)";function Si({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,color:o=null,onLightSurface:i,reversedSrc:a,inkIsDark:l,size:c="medium",sizePx:u,wordmark:p,siteName:d=ge,fitToContainer:x=!1,fitWordmarkToContainer:R=!1,fitFloorPx:C}){let b=p&&p.trim()?p.trim():d,[E,M]=Oe(null),D=Zt(null),k=N=>{D.current=N};Ae(()=>{M(D.current?.ownerDocument??null)},[]);let I=!lr({doc:E,whenUnset:!0}),g=n&&n.trim()?n.trim():null,$=!!g&&yt(g),j=i??(I&&t),U=o&&o.trim()?o.trim():null,y=r&&!U,P=`logo-color-${sr().replace(/[^A-Za-z0-9_-]/g,"")}`,S=y&&$&&g&&a!=null?{reversed:a,inkIsDark:l??null}:null,K=S!==null,[Ue,v]=Oe(null);Ae(()=>{if(!y||!g||!$||K){v(null);return}let N=!1;return v(null),jt(g).then(z=>{N||v(z)}),()=>{N=!0}},[y,g,$,K]);let T=S??Ue,le=!!T&&T.inkIsDark!==null&&(j?!T.inkIsDark:T.inkIsDark),ee=y&&!!g&&!$&&!j,A=le&&T?T.reversed:g,ue=A?[A]:[],[Z,H]=Oe(0);Ae(()=>{H(0)},[g,le]);let te=e==="footer"?Ge:We[c],B=u&&u>0?u:te,ne=Math.round(B*ur),F=Z<ue.length?ue[Z]:null,[we,re]=Oe(A),ce=F!==null&&F===we,de=Zt(null);Ae(()=>{let N=de.current;if(!N||!N.complete)return;if(N.naturalWidth>0||N.naturalHeight>0){re(F);return}let z=!1;return N.decode().then(()=>!z&&re(F),()=>!z&&H(oe=>oe+1)),()=>{z=!0}},[F]);let q=x||R,fe=`calc(100cqi / ${((b.length+1)*cr).toFixed(2)})`,X=q&&C&&C>0?Math.min(C,B):null,_e=q?X===null?`min(${B}px, ${fe})`:`clamp(${X}px, ${fe}, ${B}px)`:`${B}px`,Re=Ze("span",{className:`font-display font-bold tracking-[0.18em] ${X===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:_e,lineHeight:1,...U?{color:U}:{}},"aria-label":b,children:[b,ve("span",{className:"text-accent",style:U?{color:U}:void 0,children:"."})]});return Ze("span",{ref:k,className:"inline-flex items-center",children:[!ce&&Re,U&&F&&ve("svg",{"aria-hidden":"true",focusable:"false",width:"0",height:"0",style:{position:"absolute"},children:Ze("filter",{id:P,colorInterpolationFilters:"sRGB",children:[ve("feFlood",{style:{floodColor:U}}),ve("feComposite",{in2:"SourceAlpha",operator:"in"})]})}),F&&ve("img",{ref:de,src:F,alt:b,width:ne,height:B,className:"shrink-0 object-contain",style:{...ce?{height:`${B}px`,width:"auto",...x?{maxWidth:"100cqi"}:{}}:{display:"none"},...ee?{filter:dr}:{},...U?{filter:`url(#${P})`}:{}},onLoad:()=>re(F),onError:()=>H(N=>N+1)},F)]})}import{jsx as fr}from"react/jsx-runtime";function Ei({tone:e="bad",role:t,children:n}){return fr("div",{role:t,className:["border bg-surface px-4 py-3 text-[14px] leading-relaxed text-fg",e==="good"?"border-accent":e==="bad"?"border-alert":"border-line"].join(" "),children:n})}import{jsx as Ee,jsxs as mr}from"react/jsx-runtime";function pr({spokes:e,mesh:t=!1,className:n}){let a=c=>Math.round(c*1e3)/1e3,l=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(l.push({x1:a(100+Math.cos(u)*22),y1:a(100+Math.sin(u)*22),x2:a(100+Math.cos(u)*86),y2:a(100+Math.sin(u)*86),main:!0}),t){let p=u+Math.PI/e;l.push({x1:a(100+Math.cos(p)*22*1.4),y1:a(100+Math.sin(p)*22*1.4),x2:a(100+Math.cos(p)*78),y2:a(100+Math.sin(p)*78),main:!1})}}return mr("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:[Ee("circle",{cx:100,cy:100,r:92,strokeWidth:2}),Ee("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),Ee("circle",{cx:100,cy:100,r:22,strokeWidth:2}),Ee("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),l.map((c,u)=>Ee("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}var Ni="#c9a461",Jt=[{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"}],Li={name:"",color:"var(--fg)",family:"silver",src:""};function gr(e,t){let n=r=>{let o=Jt.findIndex(i=>i.f===r);return o===-1?Jt.length:o};return n(e)-n(t)||e.localeCompare(t)}function ki(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(gr)}import{useState as hr}from"react";import{jsx as J,jsxs as Je}from"react/jsx-runtime";function yr({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=Xt(),[i,a]=hr("");async function l(){o||!i.trim()||(await n(i,e),a(""))}return Je("div",{className:"flex flex-col gap-2",children:[t===null?Je("div",{className:"flex border border-line",children:[J("input",{type:"text",value:i,onChange:c=>a(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-4 py-4 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),J("button",{type:"button",onClick:()=>{l()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Je("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:[J("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred||t.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),t.unchecked&&J("button",{type:"button",onClick:()=>{n(t.code,e)},disabled:o,className:"ml-auto font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:text-fg disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Try again"}),J("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?J("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:Tt}):t&&!t.valid&&t.message&&J("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}var et="Ads on. Shopper can opt out.",Me="Ads and analytics off until Accept",br={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:et,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:Me,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:et,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:et,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:Me,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}};function Cr(e){let t=[...e.googleAds?["Google"]:[],...e.meta?["Facebook","Instagram"]:[]];return t.length<=1?t.join(""):`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`}function Fi(e,t,n){let r=Cr(n),o=r?`We use cookies to count visits and to show you ${t} ads on ${r}.`:"We use cookies to count visits.";return e.model==="opt-in"?{heading:r?"Cookies and ads":"Cookies",before:`${o} Nothing loads until you choose. You can change this at any time with `,link:e.footerLink,after:" at the bottom of every page."}:{heading:r?"Cookies and ads":"Cookies",before:`${o} You can say no at any time: choose Privacy choices, or use `,link:e.footerLink,after:" at the bottom of every page."}}var Ui={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};var xr={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};var Sr=xr;function qi(e=Sr){if(e.asked)return e.ads?"granted":"denied"}function Gi(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}import{Children as Er,isValidElement as Pr,useEffect as tn,useId as wr,useLayoutEffect as on,useRef as Y,useState as nn}from"react";var De=(e,t)=>!!e[t]&&!e[t].disabled;function tt(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(De(e,i))return i}return t}function nt(e,t){return tt(e,t===1?-1:e.length,t)}function rt(e,t){return De(e,t)?t:Math.max(nt(e,1),0)}function en(e,t,n){let{open:r,focus:o}=e,i=a=>({...e,...a});if(t.length===1&&/\S/.test(t)){let a=e.typed+t.toLowerCase(),l=n.findIndex((c,u)=>De(n,u)&&c.label.toLowerCase().startsWith(a));return{state:i({open:!0,typed:a,focus:l>=0?l:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:tt(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:tt(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:nt(n,1)}),handled:!0};case"End":return{state:i({focus:nt(n,-1)}),handled:!0};case"Enter":case" ":return De(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{placeMenu as _r}from"efficient-shell/ui";import{Fragment as Tr,jsx as Q,jsxs as an}from"react/jsx-runtime";var rn={body:"text-[length:var(--size-body,14px)]",label:"text-[length:var(--size-label,13px)]"};function Rr({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[a,l]=nn(!1),c=r!==void 0,u=c?r:a,[p,d]=nn(0),x=Y({text:"",timer:0}),R=Y(null),C=Y(null),b=Y(null),E=wr(),M=Y(null),D=e.findIndex(y=>y.value===t),k=y=>{y!==u&&(c||l(y),y?o?.():i?.())},I=y=>{let P=e[y];!P||P.disabled||(n(P.value),k(!1),C.current?.focus())},g=y=>{let P={open:u,focus:u?p:rt(e,D),typed:x.current.text},S=en(P,y,e);return!S.handled&&S.state.open===u?!1:(S.state.typed!==P.typed&&(x.current.text=S.state.typed,window.clearTimeout(x.current.timer),x.current.timer=window.setTimeout(()=>{x.current.text=""},500)),d(S.state.focus),S.commit!==void 0?I(S.commit):k(S.state.open),S.refocus&&C.current?.focus(),S.handled)},$=Y(g);$.current=g;let j=Y(()=>k(!1));j.current=()=>k(!1);let U=y=>{u||(M.current=y.nativeEvent,$.current(y.key)&&y.preventDefault())};return tn(()=>{if(!u)return;let y=S=>{R.current?.contains(S.target)||j.current()},P=S=>{S!==M.current&&$.current(S.key)&&S.preventDefault()};return document.addEventListener("mousedown",y),document.addEventListener("keydown",P),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("keydown",P)}},[u]),tn(()=>{u&&(x.current.text||d(rt(e,D)))},[u]),on(()=>{if(!u||!b.current)return;b.current.children.item(p)?.scrollIntoView({block:"nearest"})},[p,u]),{open:u,toggle:()=>k(!u),close:()=>k(!1),focusIdx:p,setFocusIdx:d,pick:y=>I(e.findIndex(P=>P.value===y)),wrapRef:R,triggerRef:C,listRef:b,listId:E,onTriggerKeyDown:U,activeId:u?`${E}-${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 ${rn.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 ${rn.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 Lr(e,t){on(()=>{let n=e.current,r=n?.ownerDocument.defaultView;if(!n||!r)return;let o=()=>{let i=n.style;i.top=i.bottom=i.marginTop=i.marginBottom=i.maxHeight=i.overflowY=i.translate="";let a=n.offsetParent??n.parentElement;if(!a)return;let l=a.getBoundingClientRect(),c=n.getBoundingClientRect(),u=Math.abs(c.right-l.right)<Math.abs(c.left-l.left)?"end":"start",p=_r({trigger:{left:l.left,right:l.right,top:l.top,bottom:l.bottom},menu:{width:c.width,height:c.height},bounds:{left:0,top:0,right:r.innerWidth,bottom:r.innerHeight},align:u,side:"bottom"});if(p.side==="top"){i.top="auto",i.bottom="100%",i.marginTop="0px";let x=p.top+Math.min(c.height,p.maxHeight);i.marginBottom=`${Math.max(0,l.top-x)}px`}p.maxHeight<c.height&&(i.maxHeight=`${p.maxHeight}px`,i.overflowY="auto");let d=p.left-c.left;d&&(i.translate=`${d}px`)};return o(),r.addEventListener("resize",o),r.addEventListener("scroll",o,!0),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o,!0)}},[e,t])}function kr({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:a,listRef:l,ariaLabel:c}){let u=Nr[t],p=Y(null);return Lr(p,n.length),Q("ul",{ref:d=>{p.current=d,l&&(l.current=d)},id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((d,x)=>{let R=d.value===r;return Q("li",{id:`${e}-${x}`,role:"option","aria-selected":R,"aria-disabled":d.disabled||void 0,onMouseEnter:()=>!d.disabled&&i(x),onMouseDown:C=>{C.preventDefault(),d.disabled||a(d.value)},className:u.item(x===o,R&&d.value!=="",!!d.disabled,x===n.length-1),style:u.itemStyle?.(R),children:d.meta===void 0?d.label:an(Tr,{children:[d.lead,Q("span",{className:"flex-1 whitespace-nowrap",children:d.label}),Q("span",{className:"ml-auto text-[12px] opacity-50",children:d.meta})]})},`${d.value}_${x}`)})})}function Ir({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:a,id:l,"aria-label":c}){let u=Er.toArray(r).flatMap(C=>{if(!Pr(C))return[];if(C.type!=="option")return[];let E=C.props,M=E.value!==void 0?String(E.value):"",D=E.children,k=typeof D=="string"||typeof D=="number"?String(D):M;return[{value:M,label:k,disabled:!!E.disabled}]}),p=e??"",d=Rr({items:u,value:p,onPick:C=>t?.({target:{value:C}})}),R=u.find(C=>C.value===p)?.label??u[0]?.label??"";return an("div",{ref:d.wrapRef,className:"relative",children:[a&&Q("input",{type:"hidden",name:a,value:p}),Q("button",{ref:C=>{d.triggerRef.current=C},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":d.open,"aria-controls":d.open?d.listId:void 0,"aria-activedescendant":d.activeId,"aria-label":c,id:l,onClick:()=>!n&&d.toggle(),onKeyDown:C=>!n&&d.onTriggerKeyDown(C),className:`block w-full ${o??""}`,style:i,children:Q("span",{className:"block w-full truncate text-left",children:R})}),d.open&&Q(kr,{id:d.listId,tone:"select",items:u,value:p,focusIdx:d.focusIdx,onFocus:d.setFocusIdx,onPick:d.pick,listRef:d.listRef})]})}import{jsx as Pe,jsxs as Fe}from"react/jsx-runtime";var Ar="font-mono text-[length:var(--size-label,12px)]",Or="font-semibold uppercase tracking-[0.22em] text-fg";function sn(e){return`${e??Ar} ${Or}`}function ln(){return Pe("span",{className:"text-accent",children:" *"})}function Mr({children:e,required:t,labelFace:n}){return Fe("span",{className:sn(n),children:[e,t?Pe(ln,{}):null]})}function Dr({label:e,required:t,hint:n,separate:r,htmlFor:o,labelFace:i,className:a,children:l}){let c=a?`flex flex-col gap-2 ${a}`:"flex flex-col gap-2",u=n?Pe("span",{className:"font-mono text-[11px] uppercase tracking-[0.22em] text-fg-dim",children:n}):null;return r||n?Fe("div",{className:c,children:[Fe("label",{htmlFor:o,className:sn(i),children:[e,t?Pe(ln,{}):null]}),l,u]}):Fe("label",{htmlFor:o,className:c,children:[Pe(Mr,{required:t,labelFace:i,children:e}),l]})}var na="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";export{Lt as a,eo as b,to as c,no as d,vt as e,Ke as f,Fr as g,Ur as h,$r as i,Hr as j,hn as k,yn as l,Br as m,qr as n,ze as o,Le as p,ye as q,Wr as r,ke as s,_n as t,Rn as u,ao as v,so as w,Ot as x,Ye as y,lo as z,uo as A,Ln as B,co as C,fo as D,kn as E,po as F,Tn as G,mo as H,go as I,Mt as J,So as K,vo as L,Eo as M,_o as N,Ro as O,Vr as P,Nt as Q,Yr as R,Ie as S,je as T,Ho as U,Xt as V,ni as W,rr as X,oi as Y,xi as Z,Si as _,pr as $,Ni as aa,Jt as ba,Li as ca,gr as da,ki as ea,yr as fa,Ei as ga,br as ha,Fi as ia,Ui as ja,xr as ka,qi as la,Gi as ma,Rr as na,kr as oa,Ir as pa,Mr as qa,Dr as ra,na as sa};