efficient-storefront-blocks 0.99.0 → 0.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/chunks/EditorPreviewCheckout-EBG3NMJI.js +4 -0
- package/dist/chunks/{chunk-EIBYUCDE.js → chunk-5VSNQZU6.js} +1 -1
- package/dist/chunks/chunk-DOJJTEJV.js +1 -0
- package/dist/chunks/{fitment-data-OUHMES66.js → fitment-data-PXY35OVC.js} +1 -1
- package/dist/editor/lib/document/blocks/service/DealerFinder/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/DealerFinder/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/index.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +29 -29
- package/dist/render/components/CouponField.d.ts +2 -1
- package/dist/render/components/CouponField.js +1 -1
- package/dist/render/components/DealerFinderSection.d.ts +18 -0
- package/dist/render/components/DealerFinderSection.js +1 -0
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/useTaxNote.d.ts +1 -0
- package/dist/render/components/card-pieces/useTaxNote.js +1 -0
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +2 -0
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/lib/api/index.d.ts +3 -0
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/catalog/tax-note.d.ts +4 -0
- package/dist/render/lib/catalog/tax-note.js +1 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/DealerFinder/render.js +1 -0
- package/dist/render/lib/document/blocks/service/metas.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/metas.js +1 -1
- package/dist/render/lib/document/blocks/service/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +10 -0
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/sections/dealer-finder.d.ts +41 -0
- package/dist/render/lib/sections/dealer-finder.js +1 -0
- package/dist/words.d.ts +1 -0
- package/dist/words.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/EditorPreviewCheckout-J76THKIJ.js +0 -4
- package/dist/chunks/chunk-GOVYQQA4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useState as u}from"react";import{COUPON_DEFERRED_MESSAGE as m}from"../lib/cart/coupon-preview.js";import{useCart as x}from"./CartContext.js";function f({customerEmail:c,disabled:o=!1}){const{coupon:e,applyCoupon:l,removeCoupon:d,couponBusy:n}=x(),[r,s]=u("");async function p(){o||n||!r.trim()||(await l(r,c),s(""))}return i("div",{className:"flex flex-col gap-2",children:[e===null?i("div",{className:"flex border border-line",children:[t("input",{type:"text",value:r,onChange:a=>s(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),p())},placeholder:"Coupon code","aria-label":"Coupon code",disabled:o,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"}),t("button",{type:"button",onClick:()=>{p()},disabled:n||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:n?"…":"Apply"})]}):i("div",{className:["flex items-center justify-between gap-3 border px-4 py-3",e.valid?"border-accent":"border-line"].join(" "),style:e.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[t("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",e.valid?"text-accent":e.deferred||e.unchecked?"text-fg":"text-fg-dim line-through"].join(" "),children:e.code}),e.unchecked&&t("button",{type:"button",onClick:()=>{l(e.code,c)},disabled:n||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:n?"…":"Try again"}),!o&&t("button",{type:"button",onClick:d,"aria-label":`Remove coupon ${e.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"✕"})]}),e?.deferred?t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:m}):e&&!e.valid&&e.message&&t("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:e.message})]})}export{f as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type FormEvent } from "react";
|
|
2
|
+
import { type DealerList } from "../lib/sections/dealer-finder.js";
|
|
3
|
+
interface DealerFinderProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
contained: boolean;
|
|
6
|
+
sample?: DealerList;
|
|
7
|
+
}
|
|
8
|
+
export default function DealerFinder({ title, contained, sample }: DealerFinderProps): import("react").JSX.Element;
|
|
9
|
+
interface DealerFinderViewProps {
|
|
10
|
+
title?: string;
|
|
11
|
+
query: string;
|
|
12
|
+
list: DealerList | null;
|
|
13
|
+
busy?: boolean;
|
|
14
|
+
onQuery?: (value: string) => void;
|
|
15
|
+
onSearch?: (event: FormEvent<HTMLFormElement>) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function DealerFinderView({ title, query, list, busy, onQuery, onSearch }: DealerFinderViewProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a,jsxs as s}from"react/jsx-runtime";import{useState as h}from"react";import b from"efficient-web-builder/render/components/BlockFrame";import{renderHeadline as g}from"efficient-web-builder/render/components/goldPhrases";import{phoneHref as y}from"efficient-web-builder/format/lib/links/phone-href";import{fetchDealers as N}from"../lib/api/index.js";import{DEALER_WORDS as r,dealerFinderNotice as v,dealerPins as w,dealerTownLine as k,distanceLabel as _}from"../lib/sections/dealer-finder.js";function j({title:c,contained:d,sample:n}){const[t,m]=h(""),[p,i]=h(n??null),[l,o]=h(!1);return a(b,{contained:d,className:"py-6",children:a(D,{title:c,query:t,list:p,busy:l,onQuery:m,onSearch:async f=>{if(f.preventDefault(),!(n||!t.trim())){o(!0);try{i(await N(t))}catch{i({near:"try_again",dealers:[]})}finally{o(!1)}}}})})}function D({title:c,query:d,list:n,busy:t=!1,onQuery:m,onSearch:p}){const i=n?v(n.near):null,l=n&&n.near!=="not_found"?n.dealers:[],o=w(l);return s("div",{className:"flex flex-col gap-5",children:[c&&a("h2",{className:"font-heading3 text-[length:min(var(--size-headingSmall,28px),var(--sf-heading-max,9999px))] font-medium leading-[1.1] tracking-[-0.02em]",children:g(c,!1)}),s("form",{role:"search",className:"flex max-w-[560px] gap-2",onSubmit:p,children:[a("input",{type:"search",name:"near",value:d,onChange:e=>m?.(e.target.value),placeholder:r.placeholder,"aria-label":r.placeholder,maxLength:120,className:"min-w-0 flex-1 rounded-sm border border-line bg-transparent px-3 py-2 text-[15px]"}),a("button",{type:"submit",disabled:t,className:"rounded-sm bg-btn px-4 py-2 text-[15px] font-medium text-btn-ink disabled:opacity-60",children:t?r.searching:r.search})]}),i&&a("p",{role:"status",className:"text-[15px] opacity-80",children:i}),n&&n.near!=="not_found"&&!l.length&&a("p",{role:"status",className:"text-[15px] opacity-80",children:r.none}),l.length>0&&s("div",{className:"grid gap-5 md:grid-cols-2",children:[a("ol",{className:"flex flex-col text-[15px]",children:l.map((e,f)=>{const u=_(e.distanceKm),x=k(e);return s("li",{className:"flex gap-3 border-b border-line py-3 last:border-b-0",children:[a("span",{"aria-hidden":!0,className:"w-6 shrink-0 font-medium tabular-nums",children:f+1}),s("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4",children:[a("span",{className:"font-medium",children:e.name}),u&&a("span",{className:"tabular-nums opacity-70",children:u})]}),e.address&&a("span",{children:e.address}),x&&a("span",{children:x}),e.phone&&a("a",{href:y(e.phone),className:"underline-offset-2 hover:underline",children:e.phone}),e.website&&a("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline",children:r.website})]})]},e.id)})}),o.length>0&&a("div",{role:"img","aria-label":r.map,className:"relative min-h-[280px] overflow-hidden rounded-sm border border-line",style:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},children:o.map(e=>a("span",{"data-dealer-pin":e.index+1,className:"absolute flex h-6 w-6 -translate-x-1/2 -translate-y-full items-center justify-center rounded-full bg-accent text-[12px] font-medium text-accent-ink",style:{left:`${e.left}%`,top:`${e.top}%`},children:e.index+1},e.id))})]})]})}export{D as DealerFinderView,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as
|
|
1
|
+
"use client";import{jsx as r,jsxs as c,Fragment as f}from"react/jsx-runtime";import{formatPrice as P}from"../../lib/commerce.js";import{say as k}from"efficient-web-builder/format/lib/editor-words";import{HideTaker as p}from"efficient-web-builder/render/components/ViewHideRoot";import{setLabel as L}from"../../lib/wheels/variants.js";import{wheelCardPriceLine as h}from"../../lib/wheels/set-mode.js";import{bundlePrice as S,EACH_UNIT as w,formatSelectionPrice as y,formatSelectionWasPrice as T,formatWheelPrice as x,formatWheelWasPrice as _,FROM_PREFIX as g,priceIn as C,resolveWheelPrice as b,SET_QUOTE_LABEL as E}from"../../lib/wheels/price-display.js";import{CARD_TEXT_SIZE as s,CardRow as v}from"./card-row.js";import{RegionBridge as R,RegionWords as W,regionAttr as z}from"./card-text-region.js";import{useHeroStateOrNull as B,useProductCardState as $}from"./ProductCardState.js";import{useTaxNote as N}from"./useTaxNote.js";function j(e,i){if(e.kind==="tyre"){const a=b(C(e.tyre.prices,e.currency),null);return{was:null,amount:x(a,e.currency,g),note:a.priced?w:null,priced:a.priced}}const{wheel:n,currency:t,price:o,sel:m,isSet:d}=e,l=b(n.prices[t],n.msrpPrices?.[t]),u=i.setTotal&&o.priced&&o.setTotal!=null&&m.selectedVariant?`${L(m.selectedVariant)} · ${P(o.setTotal,t)}`:null;return d&&i.quoteSets?{was:null,amount:l.priced?h(x(l,t,g),!0):E,note:u,priced:l.priced}:{was:i.wasFollowsSize?T(o,t):_(l,t),amount:h(y(o,t),o.priced),note:u,priced:o.priced}}function F({state:e,region:i}){const n=N(),t=c(p,{className:"flex items-baseline gap-5 border-t border-line pt-[18px]",children:[e.msrpLabel&&r("div",{className:"font-mono text-[length:var(--size-label,15px)] text-fg-dim line-through",children:e.msrpLabel}),r("div",{className:"font-heading2 text-[length:min(var(--size-headingMedium,36px),var(--sf-heading-max,9999px))] font-bold leading-none tracking-[-0.01em] text-fg",...z(i,"price"),children:r(W,{region:i,at:"price",children:e.amount})}),e.unitLabel&&r("div",{className:"font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.unitLabel}),e.unitLabel&&n&&r("div",{className:"font-mono text-[length:var(--size-label,13px)] text-fg-dim","data-tax-note":"",children:n}),e.packBadge&&r("div",{className:"ml-auto border border-accent px-3 py-2 font-mono text-[length:var(--size-label,13px)] font-bold uppercase tracking-[0.18em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)"},children:e.packBadge})]});return r(R,{region:i,sectionType:"ProductPrice",children:t})}function A({show:e=!0,region:i,...n}){const t=B();return t?r(F,{state:t,region:i}):r(I,{show:e,...n})}function H({state:e,show:i}){if(!i)return null;const n=S(e.bundle,e.currency);return c(f,{children:[n&&c(p,{className:`mt-1 font-mono ${s.labelLarge}`,children:[r("span",{className:"mr-2 text-fg-dim line-through",children:n.was}),n.amount]}),!e.bundle.inStock&&r(p,{className:`mt-1 font-mono ${s.labelSmall} uppercase tracking-[0.24em] text-fg-dim`,children:k("Currently unavailable")})]})}function I({show:e=!0,...i}){const n=$(),t=N();if(n.kind==="bundle")return r(H,{state:n,show:e});const{was:o,amount:m,note:d,priced:l}=j(n,i),a=[d,l?t:null].filter(Boolean).join(" · ")||null;return c(f,{children:[r(v,{children:e?c("div",{className:`mt-2 font-mono ${s.labelLarge}`,children:[o&&r("span",{className:"mr-2 text-fg-dim line-through",children:o}),m]}):null}),r(v,{children:e&&a?r("div",{className:`mt-[2px] font-mono ${s.labelSmall} tracking-[0.08em] text-fg-dim`,children:a}):null})]})}export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTaxNote(): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useCurrency as t}from"../CurrencyContext.js";import{taxNote as e}from"../../lib/catalog/tax-note.js";function u(){return e(t({optional:!0})?.activeCountry)}export{u as useTaxNote};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as N,jsxs as a}from"react/jsx-runtime";import{useId as E}from"react";import W from"next/image";import T from"next/link";import{lineTotal as K,useCart as X}from"../CartContext.js";import{useCurrency as Z}from"../CurrencyContext.js";import{Notice as R}from"../Notice.js";import{FREE_PRICE as F}from"../../lib/wheels/price-display.js";import J from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as Q}from"../../lib/cart/coupon-preview.js";import{orderReference as V}from"../../lib/checkout/pay-first.js";import{shippingWords as ee,TAX_PENDING as te}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as ne}from"../../lib/wheels/finish-defaults.js";import $ from"../ThemedSelect.js";import f from"../WebFormField.js";import ae from"../WheelSvg.js";import{NO_PAYMENT_METHOD_NOTE as re,SHIPPING_RETRY_NOTE as ie,useCheckout as k}from"./checkout-state.js";import{FIELD_INPUT_CLASS as u}from"../../lib/field-input.js";function Ee(){const{email:t,setEmail:i,firstName:n,setFirstName:o,lastName:c,setLastName:m,company:s,setCompany:y,me:x,checkoutSignOut:g}=k(),h=E();return a(w,{num:"N° 01",title:"Contact",children:[e(f,{label:"Email",htmlFor:h,hint:x?a(N,{children:["Signed in ·"," ",e("button",{type:"button",onClick:g,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{id:h,type:"email",value:t,onChange:l=>i(l.target.value),placeholder:"you@example.com",readOnly:x!==null,className:u+(x?" opacity-70":"")})}),a(M,{children:[e(f,{label:"First name",children:e("input",{type:"text",value:n,onChange:l=>o(l.target.value),className:u})}),e(f,{label:"Last name",children:e("input",{type:"text",value:c,onChange:l=>m(l.target.value),className:u})})]}),e(f,{label:"Company (optional)",children:e("input",{type:"text",value:s,onChange:l=>y(l.target.value),autoComplete:"organization",className:u})})]})}function Fe(){const{pickupLocation:t,servedCountries:i,address1:n,setAddress1:o,address2:c,setAddress2:m,city:s,setCity:y,postcode:x,setPostcode:g,phone:h,setPhone:l,country:d,setCountry:p,subdivision:C,setSubdivision:b,subdivisions:A,destination:ce,postcodeLabel:z,subdivisionLabel:U,me:I,savedAddresses:L,selectedAddressId:_,setSelectedAddressId:P,saveAddress:O,setSaveAddress:D,saveLabel:H,setSaveLabel:q,fillFromAddress:G}=k(),B=E(),j=E();return a(w,{num:"N° 02",title:t?"Collection":"Shipping address",children:[t?a("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:t.name}),[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).join(", ")}),t.openingHours&&e("span",{className:"opacity-80",children:t.openingHours}),t.instructions&&e("span",{className:"opacity-80",children:t.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):a(N,{children:[I!==null&&L.length>0&&a("div",{className:"grid gap-3",children:[L.map(r=>e(S,{active:_===r.id,onClick:()=>{P(r.id),G(r)},title:r.label,body:r.formatted_address,price:null},r.id)),e(S,{active:_==="new",onClick:()=>P("new"),title:"New address",body:null,price:null})]}),e(f,{label:"Address line 1",children:e("input",{type:"text",value:n,onChange:r=>o(r.target.value),className:u})}),e(f,{label:"Address line 2",children:e("input",{type:"text",value:c,onChange:r=>m(r.target.value),placeholder:"Apartment, unit, garage bay…",className:u})}),a(M,{cols:"three",children:[e(f,{label:"City",children:e("input",{type:"text",value:s,onChange:r=>y(r.target.value),className:u})}),e(f,{label:z,children:e("input",{type:"text",value:x,onChange:r=>g(r.target.value),className:u})}),e(f,{label:"Country",separate:!0,htmlFor:B,children:e($,{id:B,value:d,onChange:r=>p(r.target.value),className:u+" pr-10",style:Y,children:i.map(r=>e("option",{value:r.code,children:r.name},r.code))})})]}),e(f,{label:U,separate:!0,htmlFor:j,children:A.length>0?a($,{id:j,value:C,onChange:r=>b(r.target.value),className:u+" pr-10",style:Y,children:[e("option",{value:"",children:"Select…"}),A.map(r=>e("option",{value:r.code||r.name,children:r.name},r.code||r.name))]}):e("input",{id:j,type:"text",value:C,onChange:r=>b(r.target.value),className:u})})]}),e(f,{label:"Phone",children:e("input",{type:"tel",value:h,onChange:r=>l(r.target.value),className:u})}),!t&&I!==null&&_==="new"&&a(N,{children:[e(le,{checked:O,onChange:D,label:"Save this address to my account"}),O&&e(f,{label:"Address label",children:e("input",{type:"text",value:H,onChange:r=>q(r.target.value),placeholder:"Home",className:u})})]})]})}function Ae(){const{totals:t,coupon:i,deliveryOptions:n,shippingMethodId:o,setShippingMethodId:c,pickupLocation:m,formatMoney:s,city:y,destination:x,courierUnavailable:g,retryCourier:h}=k();return e(w,{num:"N° 03",title:"Shipping",children:a("div",{className:"grid gap-3",children:[n.map(l=>{const d=l.pickupLocation,p=d?[d.address,d.city,d.state,d.zipCode].filter(Boolean).join(", "):null;return e(S,{active:o===l.id,onClick:()=>c(l.id),title:d?`${l.name} — ${d.name}`:l.name,body:d?[p,d.openingHours,d.instructions,l.description].filter(Boolean).join(" · "):l.description||null,price:t.freeShipping||l.amount===0?F:s(l.amount,t.currency),tag:l.tag||void 0},l.id)}),g?a("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ie," ",e("button",{type:"button",onClick:h,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Ie(){const{payChoice:t,setPayChoice:i,placing:n,payment:o,payOptions:c,noPaymentMethod:m}=k();return a(w,{num:"N° 04",title:"Payment",children:[m&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:re}),e("div",{className:"grid gap-3",children:c.map(s=>e(S,{active:t===s.key,onClick:()=>i(s.key),title:s.title,body:s.body,price:s.price,tag:s.tag},s.key))}),t==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):t==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):t==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):t==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):t==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):t==="bank"?e("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 Le(){const{site:t,items:i,totals:n,coupon:o,formatMoney:c,payChoice:m,placing:s,email:y,orderError:x,payment:g,noPaymentMethod:h,unpaidOrder:l,placeOrder:d}=k();return a("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-view-desktop:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[a("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:[e("span",{children:"Your order"}),e(T,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?a("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(T,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(p=>e(oe,{slug:p.slug,name:p.name,qty:p.qty,config:p.config,configSummary:se(p.config),price:K(p,n.currency)??0,currency:n.currency},p.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(J,{customerEmail:y})}),a("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(v,{label:"Subtotal",value:c(n.subtotal,n.currency)}),n.discount>0&&o?.valid&&e(v,{label:`Coupon · ${o.code}`,value:a("span",{className:"font-semibold text-green",children:["− ",c(n.discount,n.currency)]})}),o?.deferred&&e(v,{label:`Coupon · ${o.code}`,value:Q}),o?.valid&&o.effects?.gift&&e(v,{label:`Free gift · ${o.effects.gift.partNumber}${o.effects.gift.quantity>1?` ×${o.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:F})}),e(v,{label:"Shipping",value:n.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:F}):ee(n.shippingStatus)??c(n.shipping,n.currency)}),n.tax&&(n.tax.charged?e(v,{label:n.tax.inclusive?`${n.tax.name} included · ${n.tax.rate}%`:n.tax.name,value:c(n.tax.amount,n.currency)}):n.tax.name?e(v,{label:n.tax.name,value:te}):null)]}),a("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:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"…":c(n.grand,n.currency)})]}),a("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[x&&e(R,{role:"alert",children:x}),n.hasUnpricedLine&&a(R,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:d,disabled:s||!l&&(h||i.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",s||!l&&(i.length===0||h||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:s?a(N,{children:["Building order… ",e("span",{children:"·"})]}):h?a(N,{children:["No online payment ",e("span",{children:"·"})]}):l?a(N,{children:["Try payment again · ",V(l),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}):n.repricing?a(N,{children:["Updating total… ",e("span",{children:"·"})]}):a(N,{children:[m==="bank"?"Place order":"Continue to payment"," ·"," ",c(n.grand,n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})}const Y={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 w({num:t,title:i,children:n}){return a("section",{className:"mb-6 border border-line bg-bg",children:[a("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:i})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function M({cols:t="two",children:i}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:i})}function S({active:t,onClick:i,title:n,body:o,price:c,tag:m}){return a("button",{type:"button",onClick:i,"aria-pressed":t,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),a("span",{className:"flex min-w-0 flex-col gap-1",children:[a("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,m&&e("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:m})]}),o&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:o})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:c})]})}function le({checked:t,onChange:i,label:n,sub:o}){return a("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>i(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),a("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,o&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:o})]})]})}function oe({slug:t,name:i,qty:n,config:o,configSummary:c,price:m,currency:s}){const{catalog:y}=X(),{formatMoney:x}=Z(),g=y.find(b=>b.slug===t),h=g?.spokes??5,l=g?.mesh??!1,d=o.find(b=>b.gold)?.label,p=g?.finishes.find(b=>b.name===d&&b.src)??g?.finishes.find(b=>b.src),C=g?.finishes[0]?.color??ne;return a("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[a("div",{className:"relative aspect-square",children:[e("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:p?.src?e(W,{src:p.src,alt:`${i.lead}${i.accent} — ${p.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:C},children:e(ae,{spokes:h,mesh:l,className:"block w-full"})})}),e("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})]}),a("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[i.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:i.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:c})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:x(m,s)})]})}function v({label:t,value:i}){return a("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:t}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:i})]})}function se(t){return t.map(i=>i.label).join(" · ")}export{Ee as CheckoutContact,Le as CheckoutOrderSummary,Ie as CheckoutPayment,Fe as CheckoutShippingAddress,Ae as CheckoutShippingMethod};
|
|
1
|
+
"use client";import{jsx as e,Fragment as k,jsxs as a}from"react/jsx-runtime";import{useId as E}from"react";import X from"next/image";import Y from"next/link";import{lineTotal as Z,useCart as J}from"../CartContext.js";import{useCurrency as Q}from"../CurrencyContext.js";import{Notice as F}from"../Notice.js";import{FREE_PRICE as O}from"../../lib/wheels/price-display.js";import ee from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as te}from"../../lib/cart/coupon-preview.js";import{orderReference as ne}from"../../lib/checkout/pay-first.js";import{shippingWords as ae,TAX_PENDING as re}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as ie}from"../../lib/wheels/finish-defaults.js";import D from"../ThemedSelect.js";import x from"../WebFormField.js";import le from"../WheelSvg.js";import{NO_PAYMENT_METHOD_NOTE as oe,placedOrderLockNote as se,SHIPPING_RETRY_NOTE as ce,useCheckout as w}from"./checkout-state.js";import{FIELD_INPUT_CLASS as I}from"../../lib/field-input.js";function Pe(){const{email:t,setEmail:i,firstName:n,setFirstName:o,lastName:m,setLastName:h,company:s,setCompany:v,me:b,checkoutSignOut:f,orderLocked:d,unpaidOrder:g}=w(),c=E();return a(S,{num:"N° 01",title:"Contact",children:[d&&g&&e(de,{orderNumber:g.orderNumber}),e(x,{label:"Email",htmlFor:c,hint:b?a(k,{children:["Signed in ·"," ",e("button",{type:"button",onClick:f,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{id:c,type:"email",value:t,onChange:l=>i(l.target.value),placeholder:"you@example.com",readOnly:b!==null,disabled:d,className:I+(b||d?P:"")})}),a(U,{children:[e(x,{label:"First name",children:e("input",{type:"text",value:n,onChange:l=>o(l.target.value),disabled:d,className:N(d)})}),e(x,{label:"Last name",children:e("input",{type:"text",value:m,onChange:l=>h(l.target.value),disabled:d,className:N(d)})})]}),e(x,{label:"Company (optional)",children:e("input",{type:"text",value:s,onChange:l=>v(l.target.value),autoComplete:"organization",disabled:d,className:N(d)})})]})}function Ae(){const{pickupLocation:t,servedCountries:i,address1:n,setAddress1:o,address2:m,setAddress2:h,city:s,setCity:v,postcode:b,setPostcode:f,phone:d,setPhone:g,country:c,setCountry:l,subdivision:u,setSubdivision:y,subdivisions:A,destination:he,postcodeLabel:q,subdivisionLabel:H,me:B,savedAddresses:T,selectedAddressId:_,setSelectedAddressId:R,saveAddress:$,setSaveAddress:G,saveLabel:W,setSaveLabel:K,fillFromAddress:V,orderLocked:p}=w(),M=E(),j=E();return a(S,{num:"N° 02",title:t?"Collection":"Shipping address",children:[t?a("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:t.name}),[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[t.address,t.city,t.state,t.zipCode,t.country].filter(Boolean).join(", ")}),t.openingHours&&e("span",{className:"opacity-80",children:t.openingHours}),t.instructions&&e("span",{className:"opacity-80",children:t.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):a(k,{children:[B!==null&&T.length>0&&a("div",{className:"grid gap-3",children:[T.map(r=>e(L,{active:_===r.id,disabled:p,onClick:()=>{R(r.id),V(r)},title:r.label,body:r.formatted_address,price:null},r.id)),e(L,{active:_==="new",disabled:p,onClick:()=>R("new"),title:"New address",body:null,price:null})]}),e(x,{label:"Address line 1",children:e("input",{type:"text",value:n,onChange:r=>o(r.target.value),disabled:p,className:N(p)})}),e(x,{label:"Address line 2",children:e("input",{type:"text",value:m,onChange:r=>h(r.target.value),placeholder:"Apartment, unit, garage bay…",disabled:p,className:N(p)})}),a(U,{cols:"three",children:[e(x,{label:"City",children:e("input",{type:"text",value:s,onChange:r=>v(r.target.value),disabled:p,className:N(p)})}),e(x,{label:q,children:e("input",{type:"text",value:b,onChange:r=>f(r.target.value),disabled:p,className:N(p)})}),e(x,{label:"Country",separate:!0,htmlFor:M,children:e(D,{id:M,value:c,onChange:r=>l(r.target.value),disabled:p,className:N(p)+" pr-10",style:z,children:i.map(r=>e("option",{value:r.code,children:r.name},r.code))})})]}),e(x,{label:H,separate:!0,htmlFor:j,children:A.length>0?a(D,{id:j,value:u,onChange:r=>y(r.target.value),disabled:p,className:N(p)+" pr-10",style:z,children:[e("option",{value:"",children:"Select…"}),A.map(r=>e("option",{value:r.code||r.name,children:r.name},r.code||r.name))]}):e("input",{id:j,type:"text",value:u,onChange:r=>y(r.target.value),disabled:p,className:N(p)})})]}),e(x,{label:"Phone",children:e("input",{type:"tel",value:d,onChange:r=>g(r.target.value),disabled:p,className:N(p)})}),!t&&B!==null&&_==="new"&&!p&&a(k,{children:[e(pe,{checked:$,onChange:G,label:"Save this address to my account"}),$&&e(x,{label:"Address label",children:e("input",{type:"text",value:W,onChange:r=>K(r.target.value),placeholder:"Home",className:I})})]})]})}function Be(){const{totals:t,coupon:i,deliveryOptions:n,shippingMethodId:o,setShippingMethodId:m,pickupLocation:h,formatMoney:s,city:v,destination:b,courierUnavailable:f,retryCourier:d,orderLocked:g}=w();return e(S,{num:"N° 03",title:"Shipping",children:a("div",{className:"grid gap-3",children:[n.map(c=>{const l=c.pickupLocation,u=l?[l.address,l.city,l.state,l.zipCode].filter(Boolean).join(", "):null;return e(L,{active:o===c.id,disabled:g,onClick:()=>m(c.id),title:l?`${c.name} — ${l.name}`:c.name,body:l?[u,l.openingHours,l.instructions,c.description].filter(Boolean).join(" · "):c.description||null,price:t.freeShipping||c.amount===0?O:s(c.amount,t.currency),tag:c.tag||void 0},c.id)}),f?a("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:[ce," ",e("button",{type:"button",onClick:d,className:"underline transition-colors hover:text-accent",children:"Try again"})]}):n.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})})}function Te(){const{payChoice:t,setPayChoice:i,placing:n,payment:o,payOptions:m,noPaymentMethod:h}=w();return a(S,{num:"N° 04",title:"Payment",children:[h&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:oe}),e("div",{className:"grid gap-3",children:m.map(s=>e(L,{active:t===s.key,onClick:()=>i(s.key),title:s.title,body:s.body,price:s.price,tag:s.tag},s.key))}),t==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):t==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):t==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):t==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):t==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):t==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):t==="bank"?e("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 Re(){const{site:t,items:i,totals:n,coupon:o,formatMoney:m,payChoice:h,placing:s,email:v,orderError:b,payment:f,noPaymentMethod:d,unpaidOrder:g,orderLocked:c,placeOrder:l}=w();return a("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-view-desktop:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[a("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:[e("span",{children:"Your order"}),e(Y,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?a("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(Y,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(u=>e(me,{slug:u.slug,name:u.name,qty:u.qty,config:u.config,configSummary:ue(u.config),price:Z(u,n.currency)??0,currency:n.currency},u.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(ee,{customerEmail:v,disabled:c})}),a("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(C,{label:"Subtotal",value:m(n.subtotal,n.currency)}),n.discount>0&&o?.valid&&e(C,{label:`Coupon · ${o.code}`,value:a("span",{className:"font-semibold text-green",children:["− ",m(n.discount,n.currency)]})}),o?.deferred&&e(C,{label:`Coupon · ${o.code}`,value:te}),o?.valid&&o.effects?.gift&&e(C,{label:`Free gift · ${o.effects.gift.partNumber}${o.effects.gift.quantity>1?` ×${o.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:O})}),e(C,{label:"Shipping",value:n.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:O}):ae(n.shippingStatus)??m(n.shipping,n.currency)}),n.tax&&(n.tax.charged?e(C,{label:n.tax.inclusive?`${n.tax.name} included · ${n.tax.rate}%`:n.tax.name,value:m(n.tax.amount,n.currency)}):n.tax.name?e(C,{label:n.tax.name,value:re}):null)]}),a("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:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:n.repricing?"…":m(n.grand,n.currency)})]}),a("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[b&&e(F,{role:"alert",children:b}),n.hasUnpricedLine&&a(F,{role:"status",children:["One or more items have no price in ",n.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:l,disabled:s||!g&&(d||i.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",s||!g&&(i.length===0||d||n.hasUnpricedLine||n.repricing)?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:s?a(k,{children:["Building order… ",e("span",{children:"·"})]}):d?a(k,{children:["No online payment ",e("span",{children:"·"})]}):g?a(k,{children:["Try payment again · ",ne(g),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]}):n.repricing?a(k,{children:["Updating total… ",e("span",{children:"·"})]}):a(k,{children:[h==="bank"?"Place order":"Continue to payment"," ·"," ",m(n.grand,n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})}const P=" cursor-not-allowed opacity-70";function N(t){return I+(t?P:"")}function de({orderNumber:t}){return e(F,{tone:"quiet",role:"status",children:a("span",{className:"flex items-start gap-2",children:[a("svg",{"aria-hidden":!0,viewBox:"0 0 16 16",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mt-[3px] shrink-0",children:[e("rect",{x:"3",y:"7",width:"10",height:"7",rx:"1"}),e("path",{d:"M5 7V5a3 3 0 0 1 6 0v2"})]}),e("span",{children:se(t)})]})})}const z={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 S({num:t,title:i,children:n}){return a("section",{className:"mb-6 border border-line bg-bg",children:[a("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:t}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:i})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:n})]})}function U({cols:t="two",children:i}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",t==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:i})}function L({active:t,onClick:i,title:n,body:o,price:m,tag:h,disabled:s=!1}){return a("button",{type:"button",onClick:i,"aria-pressed":t,disabled:s,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",t?"border-accent outline outline-1 outline-accent -outline-offset-1":s?"border-line":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]",s?P.trim():""].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[t&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",t?"border-accent":"border-fg-dim"].join(" "),children:t&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),a("span",{className:"flex min-w-0 flex-col gap-1",children:[a("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[n,h&&e("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:h})]}),o&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:o})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:m})]})}function pe({checked:t,onChange:i,label:n,sub:o}){return a("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>i(!t),"aria-pressed":t,"aria-label":n,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",t?"border-accent":"border-line"].join(" "),style:t?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:t&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),a("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[n,o&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:o})]})]})}function me({slug:t,name:i,qty:n,config:o,configSummary:m,price:h,currency:s}){const{catalog:v}=J(),{formatMoney:b}=Q(),f=v.find(y=>y.slug===t),d=f?.spokes??5,g=f?.mesh??!1,c=o.find(y=>y.gold)?.label,l=f?.finishes.find(y=>y.name===c&&y.src)??f?.finishes.find(y=>y.src),u=f?.finishes[0]?.color??ie;return a("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[a("div",{className:"relative aspect-square",children:[e("div",{className:"flex h-full w-full items-center justify-center overflow-hidden border border-line bg-surface",children:l?.src?e(X,{src:l.src,alt:`${i.lead}${i.accent} — ${l.name}`,width:120,height:120,sizes:"60px",className:"block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:u},children:e(le,{spokes:d,mesh:g,className:"block w-full"})})}),e("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})]}),a("div",{className:"flex min-w-0 flex-col gap-0.5",children:[a("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[i.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:i.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:m})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:b(h,s)})]})}function C({label:t,value:i}){return a("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:t}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:i})]})}function ue(t){return t.map(i=>i.label).join(" · ")}export{Pe as CheckoutContact,Re as CheckoutOrderSummary,Te as CheckoutPayment,Ae as CheckoutShippingAddress,Be as CheckoutShippingMethod};
|
|
@@ -17,6 +17,7 @@ export declare function buildPayOptions(site: SiteIdentity, { canParkContext, }?
|
|
|
17
17
|
export declare const NO_PAYMENT_METHOD_NOTE = "This shop does not take payment online yet. Please contact the shop to order.";
|
|
18
18
|
export declare function paymentNotStartedMessage(conf: Pick<OrderConfirmation, "orderNumber" | "checkoutNumber">, err: unknown): string;
|
|
19
19
|
export declare const SHIPPING_RETRY_NOTE = "Shipping cannot be calculated right now. Please try again.";
|
|
20
|
+
export declare function placedOrderLockNote(orderNumber: string): string;
|
|
20
21
|
export interface CheckoutProps {
|
|
21
22
|
site: SiteIdentity;
|
|
22
23
|
logo?: {
|
|
@@ -176,6 +177,7 @@ declare function useCheckoutState({ site, logo, preview }: CheckoutProps): {
|
|
|
176
177
|
shippingMethod?: string | null;
|
|
177
178
|
couponCode?: string | null;
|
|
178
179
|
} | null;
|
|
180
|
+
orderLocked: boolean;
|
|
179
181
|
payNote: string | null;
|
|
180
182
|
afterpayConfirming: boolean;
|
|
181
183
|
gocardlessConfirming: boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{jsx as T}from"react/jsx-runtime";import{createContext as
|
|
2
|
-
`);return m===-1?[
|
|
3
|
-
${$e.trim()}`:me,$n=ur({email:V,firstName:L,lastName:ee,company:Le.trim(),phone:te,address:Ke,city:G,subdivision:_,postcode:$,country:l,lines:i.map(e=>[e.id,e.qty]),shippingMethodId:le,couponCode:Vt(D),currency:I.currency,shopperId:Pe?.id??null}),h=JSON.stringify([$n,w]),R=f(null),De=f(null),xe=f(!1),O=f(!1),j=f(null),Oe=f(!1),P=f(h);P.current=h;const Kt=f(fe);Kt.current=fe;const xt=()=>O.current&&P.current!==R.current,U=f(null);y(()=>{Kt.current||(h!==U.current&&(U.current=null),!(!O.current||!b||b.orderNumber)&&(h===R.current||h===U.current||Ee(b)))},[h,b]);async function Ee(e){if(Oe.current)return null;Oe.current=!0,S(!0);try{const t=j.current?await sr(j.current):"none";if(t==="succeeded"||t==="processing")return O.current=!1,K(null),E("card"),t==="succeeded"?await B(void 0,e):$t(e),null;if(t===void 0||!cr.has(t))return U.current=P.current,K(e),N(t==="requires_action"?or:Xe),null;const n=await jt(oe);if(n==="committed")return O.current=!1,K(null),E("card"),await B(void 0,e),null;if(n!=="released")return U.current=P.current,K(e),N(Xe),null;O.current=!1,j.current=null,U.current=null,N(null),K(null);const c=ue();return Se(c),c}finally{Oe.current=!1,S(!1)}}async function Fn(){if(!(p||fe||Oe.current)){if(b){if((O.current?h!==R.current:ae())&&!b.orderNumber){const c=await Ee(b);c&&P.current===h&&await Ot(c);return}S(!0),N(null),xe.current=!1,await qe();const t=z(P.current)[1],n=b.orderNumber?t:"card";if(n&&rn.has(n)&&ae()&&z(P.current)[0]!==De.current){Et(b);return}E(n),n!==w&&pe(n),await Ft(b,n,!b.orderNumber);return}await Ot(oe)}}async function Ot(e){if(i.length===0||I.repricing||!w||!Z.some(s=>s.key===w))return;const t=i.filter(Gt).flatMap(s=>jn(s.components,s.qty));if(t.length===0){N("Pick a size on each wheel's product page before checking out.");return}S(!0),N(null);let n,c=e,r=w,u=!1;try{const s=Pe?C.createOrderAuthed:C.createOrder,g=Jn(),d={customer:{email:V,name:`${L} ${ee}`.trim(),phone:te.trim()||void 0,companyName:Le.trim()||void 0,address:Ke,city:G,state:_||void 0,zipCode:$,country:l},items:t,currency:I.currency,idempotencyKey:e,shippingMethodId:le??void 0,couponCode:Vt(D),...g==="denied"?{}:Gn(),...g?{adConsent:g}:{},...ar(w)?{checkoutFlow:Zt}:{}};F.current=()=>s(d),ft(null),De.current=null,xe.current=!1,j.current=null,O.current=!1,U.current=null,R.current=h,ce.current=i;const k=Y.current,Bt=k?.key===d.idempotencyKey&&(k.shape!==h&&(!!d.checkoutFlow||!!k.method||!!k.plainMethod)||!!d.checkoutFlow&&!!k.plainMethod);Bt&&(X.current=d.idempotencyKey);const Ht=Mt(d,s),zt=Bt||!d.checkoutFlow&&X.current===d.idempotencyKey,Dt=!Ht&&!zt&&!d.checkoutFlow&&!!k&&!k.method;Dt&&(k.plainMethod=w,k.plainLines=i,k.plainShape=h);const H=await(zt?It(d,s):s(d).then(se=>({answer:se,request:d})).catch(se=>(Ht?Tt(se,d.idempotencyKey):Dt&&Qt(se)&&(k.plainMethod=""),Yn(se,d,s))));if(!H)return;n=H.answer,c=H.request.idempotencyKey,r=H.method??r,E(r),u=ae()||r!==z(P.current)[1],H.method&&H.method!==w&&pe(H.method),n.orderNumber&&(Rt(n),q()),await qe()}catch(s){const g=dr(s);g?(cn(g),N(`${g} Your order has not been placed. Place it again to continue without the code.`)):s instanceof Ie?N(Xe):N(s instanceof Te?s.message:"Could not place the order. Please try again."),S(!1);return}if(r&&rn.has(r)&&(u||ae())){Et(n);return}await Ft(n,r,!1,c)}function Et(e){De.current=z(P.current)[0],N(`${nn(e,null)} ${Xt}`),K(e),S(!1)}function Tt(e,t){Qt(e)&&!Wt(e)&&Y.current?.key===t&&(Y.current=null)}async function Yn(e,t,n){if(We(e))return _t(t,n);if(!Wt(e))throw e;return X.current=t.idempotencyKey,It(t,n,!0)}async function It(e,t,n=!1){const c=await jt(e.idempotencyKey);if(c==="released")return P.current===h?_t(e,t):(Se(ue()),S(!1),null);if(c!=="committed")throw new Ie;const r=Y.current?.key===e.idempotencyKey?Y.current:null;if(ce.current=r?.lines??i,r?.method&&!n){X.current=null,F.current=r.send;const g=await r.send().catch(()=>{throw new Ie});return R.current=r.shape,{answer:g,request:e,method:r.method}}const u=r&&!r.method?r.send:()=>t({...e,checkoutFlow:Zt});F.current=u;const s=await u().catch(()=>null);if(!s&&r?.plainMethod)throw new Ie;return s?.orderNumber&&s.status!==ir?(X.current=null,r?.plainMethod&&(ce.current=r.plainLines),r&&(R.current=r.plainMethod?r.plainShape:r.shape),{answer:s,request:e,method:r?.plainMethod||void 0}):(S(!1),r&&(R.current=r.shape),E("card"),await Lt("",s?async()=>s:()=>Promise.reject(new Error("The order request did not answer."))),await qe(),null)}function ae(){const e=R.current;return e!==null&&z(e)[0]!==z(P.current)[0]}function E(e){e!==z(P.current)[1]&&(xe.current=!0),ft(xe.current||ae()?Xt:null)}async function _t(e,t){const n={...e,idempotencyKey:ue()};X.current=null,Se(n.idempotencyKey),F.current=()=>t(n),Mt(n,t);try{return{answer:await t(n),request:n}}catch(c){throw Tt(c,n.idempotencyKey),c}}function Mt(e,t){return Y.current?.key===e.idempotencyKey?!1:(Y.current={key:e.idempotencyKey,send:()=>t(e),lines:i,shape:h,method:e.checkoutFlow?"":w??"",plainMethod:"",plainLines:i,plainShape:h},!0)}function Rt(e){Xn({confirmation:e,lines:ce.current,adsSendTo:a.googleAdsId&&a.googleAdsConversionLabel?`${a.googleAdsId}/${a.googleAdsConversionLabel}`:null}),Zn({confirmation:e,lines:ce.current})}async function B(e,t=M){if(!t)return;const n=e?async()=>e:F.current;if(t.orderNumber||!n){W(!0),A(t);return}await Lt(t.checkoutNumber,n)}async function Lt(e,t){q(),await lr({checkoutNumber:e,resend:t,page:{setConfirming:In,land:A,markPaid:()=>W(!0),track:Rt,unplaced:bt}})}function $t(e=M){if(e){if(e.orderNumber){A(e);return}q(),bt({kind:"processing",checkoutNumber:e.checkoutNumber})}}async function qe(){const e=JSON.stringify([Be.trim(),L,ee,te.trim(),Ke,G,_,$,l]);if(!(!Pe||!lt||ut!=="new"||mt.current===e))try{await ie.createAddress({label:Be.trim()||"Home",contact_name:`${L} ${ee}`.trim(),phone:te.trim(),address:Ke,city:G,zip_code:$,state:_,country:l}),mt.current=e,pt("Address saved to your account.")}catch{pt("We couldn't save the address to your account — you can add it under Account → Addresses.")}}async function Ft(e,t=w,n=!1,c=oe){K(null);try{if(t==="card"&&a.paymentMethods.includes("card")){const r=await C.createPaymentIntent({idempotencyKey:c});if(j.current=r,n&&xt()){await Ee(e);return}let u=e;if(n){const s=await F.current?.().catch(()=>null);if(s?.orderNumber){E("card"),await B(s,e);return}if(u=Yt(e,s)??{...e,expiresAt:null},xt()){await Ee(e);return}}E("card"),J(u),He(!1),Ae(r)}else if(t==="paypal"&&a.paymentMethods.includes("paypal"))J(e),bn(!0);else if(t==="afterpay"&&a.paymentMethods.includes("afterpay")){const r=window.location.origin,u=await C.createAfterpayCheckout({idempotencyKey:c,confirmUrl:`${r}/checkout?afterpay=confirm`,cancelUrl:`${r}/checkout?afterpay=cancel`}),s={idempotencyKey:c,confirmation:e};v.setItem(Vn,JSON.stringify(s)),window.location.assign(u.redirectCheckoutUrl);return}else if(t==="square"&&a.paymentMethods.includes("square"))J(e),Pn(!0);else if(t==="gocardless"&&a.paymentMethods.includes("gocardless")){const r=window.location.origin,u=await C.createGocardlessBillingRequest({idempotencyKey:c,confirmUrl:`${r}/checkout?gocardless=confirm`,cancelUrl:`${r}/checkout?gocardless=cancel`}),s={idempotencyKey:c,confirmation:e};v.setItem(Ge,JSON.stringify(s)),window.location.assign(u.authorisationUrl);return}else if(t==="zip"&&a.paymentMethods.includes("zip")){const r=window.location.origin,u=await C.createZipCheckout({idempotencyKey:c,redirectUrl:`${r}/checkout?zip=return`}),s={idempotencyKey:c,confirmation:e};v.setItem(tr,JSON.stringify(s)),window.location.assign(u.redirectUrl);return}else if(t==="klarna"&&a.paymentMethods.includes("klarna")){const r=window.location.origin,u=await C.createKlarnaCheckout({idempotencyKey:c,confirmUrl:`${r}/checkout?klarna=confirm`,cancelUrl:`${r}/checkout?klarna=cancel`}),s={idempotencyKey:c,confirmation:e};v.setItem(Je,JSON.stringify(s)),window.location.assign(u.redirectUrl);return}else E(t),A(e)}catch(r){if((n||t==="card")&&r instanceof Te&&r.status===409){E(t),await B(void 0,e);return}Ut(e,r),S(!1)}}function Yt(e,t){return t&&!t.orderNumber&&t.status==="open"&&t.checkoutNumber===e.checkoutNumber?t:null}function Ut(e,t){N(nn(e,t)),!e.orderNumber&&We(t)?(O.current=!1,Se(ue())):K(e)}async function Un(e){if(!M)return;const t=M;try{const n=await C.createPaymentIntent({idempotencyKey:oe}),c=await F.current?.().catch(()=>null);if(c?.orderNumber){await B(c);return}const r=Yt(t,c);J(r??{...t,expiresAt:null}),He(e&&r!==null),j.current=n,Ae(n)}catch(n){if(n instanceof Te&&n.status===409){await B();return}Ae(null),J(null),Ut(t,n),S(!1)}}function Bn(){M&&(O.current=!0,K(M),Ae(null),J(null),He(!1),S(!1))}return{site:a,logo:m,items:i,totals:I,coupon:D,deliveryOptions:Ze,courierUnavailable:yn,retryCourier:hn,shippingMethodId:le,setShippingMethodId:an,pickupLocation:ln,servedCountries:Q,formatMoney:dn,payChoice:w,setPayChoice:pe,placing:fe,email:V,setEmail:_e,firstName:L,setFirstName:Me,lastName:ee,setLastName:Re,company:Le,setCompany:rt,address1:me,setAddress1:ye,address2:$e,setAddress2:he,city:G,setCity:we,postcode:$,setPostcode:ge,phone:te,setPhone:ke,country:l,setCountry:Ce,subdivision:_,setSubdivision:Ne,subdivisions:ne,destination:ct,postcodeLabel:fn,subdivisionLabel:mn,me:Pe,savedAddresses:wn,selectedAddressId:ut,setSelectedAddressId:Ue,saveAddress:lt,setSaveAddress:dt,saveLabel:Be,setSaveLabel:gn,addressSaveNote:kn,lostChangeNote:Cn,idemKey:oe,confirmation:yt,setConfirmation:A,orderError:Nn,payment:ht,paypalStep:wt,squareStep:gt,pendingConf:M,paid:Sn,setPaid:W,unpaidOrder:b,payNote:An,afterpayConfirming:vn,gocardlessConfirming:xn,zipConfirming:On,klarnaConfirming:Tn,cardConfirming:Nt,checkoutResult:ze,confirmCardPayment:B,cardStillProcessing:$t,renewCardPayment:Un,holdRenewed:_n,leaveCardPayment:Bn,checkoutRootRef:At,setCheckoutHeaderEl:Mn,fillFromAddress:vt,checkoutSignOut:Rn,payOptions:Z,noPaymentMethod:Ln,placeOrder:Fn}}const on=Hn(null);function Ir({children:a,...m}){const p=pr(m);return T(on.Provider,{value:p,children:a})}function _r(){const a=zn(on);if(!a)throw new Error("useCheckout must be used inside CheckoutStateProvider");return a}export{Ir as CheckoutStateProvider,Er as NO_PAYMENT_METHOD_NOTE,Tr as SHIPPING_RETRY_NOTE,tn as buildPayOptions,nn as paymentNotStartedMessage,_r as useCheckout};
|
|
1
|
+
"use client";import{jsx as T}from"react/jsx-runtime";import{createContext as zn,useContext as Dn,useEffect as y,useMemo as qt,useRef as f,useState as o}from"react";import{isOrderable as Gt,useCart as qn}from"../CartContext.js";import{useCurrency as Gn}from"../CurrencyContext.js";import{getClickIds as Jn}from"../../lib/click-ids.js";import{adConsentForOrder as Wn}from"../../lib/consent/choice.js";import{trackBeginCheckout as Xn,trackPurchase as Zn}from"../../lib/google-tag.js";import{trackMetaPurchase as jn}from"../../lib/meta-pixel.js";import{ApiError as Te,api as ie,products as N}from"../../lib/api/index.js";import{uuid as ue}from"../../lib/uuid.js";import{orderLinesForSets as Qn}from"../../lib/commerce.js";import{canPersist as Vn,safeSessionStorage as v}from"efficient-web-builder/format/lib/safe-storage";import{AFTERPAY_CONTEXT_KEY as er,AFTERPAY_RETURN as tr,GOCARDLESS_CONTEXT_KEY as Ge,KLARNA_CONTEXT_KEY as Je,ZIP_CONTEXT_KEY as nr,ZIP_RETURN as rr,runWalletReturn as Jt}from"../../lib/checkout/wallet-return.js";import{matchSubdivision as or}from"../../lib/checkout/match-subdivision.js";import{checkoutGone as We,checkoutWaiting as Wt,BANK_WAITING as cr,DROPPABLE_INTENT as ar,NOT_CHECKED as Xe,LOST_CHANGE as Xt,PAY_FIRST_FLOW as Zt,paysFirst as sr,readIntentStatus as ir,releaseHeldCheckout as jt,CHECKOUT_COMMITTED as ur,goodsShapeOf as lr,refusedForGood as Qt,settlePayFirst as dr}from"../../lib/checkout/pay-first.js";import{couponCodeForOrder as Vt,couponRefusedByOrder as pr}from"../../lib/cart/coupon-preview.js";function en(c){const m=c.indexOf(`
|
|
2
|
+
`);return m===-1?[c,""]:[c.slice(0,m),c.slice(m+1)]}function tn(c,{canParkContext:m}={canParkContext:!0}){const p=c.paymentMethods,i=[];return p.includes("card")&&i.push({key:"card",title:"Card",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),p.includes("paypal")&&c.paypalClientId&&i.push({key:"paypal",title:"PayPal",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL · CARDS"})}),p.includes("afterpay")&&i.push({key:"afterpay",title:"Afterpay",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 × INTEREST-FREE"})}),p.includes("square")&&c.squareApplicationId&&c.squareLocationId&&i.push({key:"square",title:"Card (Square)",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),p.includes("gocardless")&&m&&i.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),p.includes("zip")&&i.push({key:"zip",title:"Zip",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),p.includes("klarna")&&m&&i.push({key:"klarna",title:"Klarna",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),p.includes("bank")&&i.push({key:"bank",title:"Bank transfer",body:null,price:T("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),i}const Tr="This shop does not take payment online yet. Please contact the shop to order.";class Ie extends Error{}function nn(c,m){if(!c.orderNumber&&We(m))return m.message;const p=m instanceof Te?` (${m.message})`:"";return c.orderNumber?`Your order ${c.orderNumber} is saved, but the payment did not start${p}. Try the payment again — your order will not be placed twice.`:`Your items are held under ${c.checkoutNumber}, but the payment did not start${p}. Try the payment again — you will not be charged twice.`}const rn=new Set(["paypal","square","afterpay","gocardless","zip","klarna"]),z=c=>JSON.parse(c),Ir="Shipping cannot be calculated right now. Please try again.";function _r(c){return`Your order is saved, so its contact, address, delivery and discount can't change here. To change any of them, contact the shop and quote ${c}.`}function fr({site:c,logo:m,preview:p=!1}){const{items:i,totals:I,coupon:D,refuseCoupon:cn,deliveryOptions:Ze,shippingMethodId:le,setShippingMethodId:an,setQuoteDestination:de,courier:sn,requote:un,identify:je,clearCapturedCart:q,replaceItems:Qe,removeCoupon:Ve}=qn(),ln=Ze.find(e=>e.id===le)?.pickupLocation??null,{country:et,countries:Q,activeCountry:tt,formatMoney:dn}=Gn(),[w,pe]=o(()=>tn(c)[0]?.key??null),[nt,pn]=o(!0);y(()=>{pn(Vn(v))},[]);const[fe,S]=o(!1),[V,_e]=o(""),[L,Me]=o(""),[ee,Re]=o(""),[Le,rt]=o(""),[me,ye]=o(""),[$e,he]=o(""),[G,we]=o(""),[$,ge]=o(""),[te,ke]=o(""),[l,Ce]=o(()=>et||Q[0]?.code||""),[_,Ne]=o(""),[ne,ot]=o([]),[Fe,Ye]=o(null),[be,re]=o(null),ct=qt(()=>Q.find(e=>e.code===l)??tt,[Q,l,tt]),fn=ct?.postalLabel||"Postal Code",mn=ne[0]?.divisionType||"State / Province";y(()=>{if(!l){ot([]),Ye(l);return}Ye(null);let e=!1;return N.listCountrySubdivisions(l).then(t=>{e||(ot(t),Ye(l),Ne(""))}),()=>{e=!0}},[l]);const at=me.trim()!==""&&G.trim()!==""&&$.trim()!==""&&Fe===l&&(ne.length===0||_!=="")?$.trim():"";y(()=>{de(l?{country:l,subdivision:_,postcode:at}:null)},[l,_,at,de]),y(()=>()=>de(null),[de]);const yn=sn?.status==="unavailable",hn=un,[Pe,st]=o(null),[wn,it]=o([]),[ut,Be]=o("new"),[lt,dt]=o(!1),[Ue,gn]=o("Home"),[kn,pt]=o(null),[Cn,ft]=o(null),[oe,Se]=o(()=>ue()),mt=f(null),[yt,A]=o(null),[Nn,b]=o(null),[ht,Ae]=o(null),[wt,bn]=o(!1),[gt,Pn]=o(!1),[M,J]=o(null),[Sn,W]=o(!1),[g,x]=o(null),An=!!g?.orderNumber,[vn,K]=o(null),[xn,Kn]=o(!1),[On,kt]=o(!1),[En,Tn]=o(!1),[In,Ct]=o(!1),[Nt,_n]=o(!1),[Mn,He]=o(!1),[ze,bt]=o(null),F=f(null),ce=f(i),Y=f(null),X=f(null),Pt=!!(yt||ze&&ze.kind!=="processing"||Nt||wt||gt||ht&&M?.orderNumber);y(()=>{Pt&&(Qe([]),Ve())},[Pt,Qe,Ve]);const St=f(!1);y(()=>{p||St.current||!i.some(Gt)||(St.current=!0,Xn({lines:i,currency:I.currency,value:I.subtotal-I.discount,coupon:D?.valid?D.code:void 0}))},[i,I,D,p]),y(()=>{je(V,L.trim()||void 0)},[V,L,je]);const At=f(null),[ve,Rn]=o(null);y(()=>{const e=At.current;if(!ve||!e)return;const t=()=>e.style.setProperty("--sf-checkout-header-h",`${ve.offsetHeight}px`);t();const n=new ResizeObserver(t);return n.observe(ve),()=>n.disconnect()},[ve]),y(()=>{const e=n=>({setConfirming:n,land:A,markPaid:()=>W(!0),note:K,fail:b,clearCart:q}),t={search:window.location.search,storage:v,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};Jt(tr,{...t,capture:N.captureAfterpayPayment,page:e(Kn)}),Jt(rr,{...t,capture:N.captureZipPayment,page:e(Tn)})},[]),y(()=>{const t=new URLSearchParams(window.location.search).get("gocardless");if(t!=="confirm"&&t!=="cancel")return;const n=v.getItem(Ge);if(v.removeItem(Ge),window.history.replaceState(null,"",window.location.pathname),!n)return;let a;try{a=JSON.parse(n)}catch{return}if(q(),t==="cancel"){K("The direct debit was not set up — our team will follow up on payment."),A(a.confirmation);return}kt(!0),N.completeGocardlessPayment({idempotencyKey:a.idempotencyKey}).then(r=>{r.status==="paid"?W(!0):r.status==="declined"?K("The direct debit was declined — our team will follow up on payment."):K("Your direct debit is set up — the payment is collecting and will clear in a few days.")}).catch(()=>{K("We could not confirm the direct debit — our team will follow up on payment.")}).finally(()=>{A(a.confirmation),kt(!1)})},[]),y(()=>{const e=new URLSearchParams(window.location.search),t=e.get("klarna");if(t!=="confirm"&&t!=="cancel")return;const n=v.getItem(Je);v.removeItem(Je);const a=e.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!n)return;let r;try{r=JSON.parse(n)}catch{return}if(q(),t==="cancel"||!a){K("The Klarna payment was not completed — our team will follow up on payment."),A(r.confirmation);return}Ct(!0),N.captureKlarnaPayment({idempotencyKey:r.idempotencyKey,authorizationToken:a}).then(u=>{u.status==="paid"?W(!0):u.status==="declined"?K("Klarna declined the payment — our team will follow up on payment."):K("Your Klarna payment is being reviewed — we'll confirm the outcome shortly.")}).catch(()=>{K("We could not confirm the Klarna payment — our team will follow up on payment.")}).finally(()=>{A(r.confirmation),Ct(!1)})},[]);function vt(e){const[t,n]=en(e.address);ye(t),he(n),we(e.city),ge(e.zip_code),e.country&&Ce(e.country),e.phone&&ke(e.phone),re({country:e.country||null,state:e.state??""})}y(()=>{if(be){if((be.country||l)!==l){re(null);return}Fe===l&&(Ne(or(l,be.state,ne)),re(null))}},[be,l,Fe,ne]),y(()=>{let e=!1;return(async()=>{try{const[t,n,a]=await Promise.all([ie.me(),ie.myProfile().catch(()=>null),ie.myAddresses().catch(()=>[])]);if(e)return;st(t);const r=a.filter(d=>d.is_active);it(r),_e(t.email);const u=(n?.contact_name??"").split(/\s+/);Me(t.first_name||u[0]||""),Re(t.last_name||u.slice(1).join(" "));const s=t.phone||n?.phone;s&&ke(s);const k=r.find(d=>d.id===t.default_delivery_location)??r[0];if(k)Be(k.id),vt(k);else if(n){const[d,C]=en(n.address??"");ye(d),he(C),we(n.city??""),ge(n.zip_code??""),n.country&&Ce(n.country),re({country:n.country||null,state:n.state??""})}}catch{}})(),()=>{e=!0}},[]);function Ln(){ie.logout(),st(null),it([]),Be("new"),dt(!1),_e(""),Me(""),Re(""),rt(""),ye(""),he(""),we(""),ge(""),ke(""),Ce(et||Q[0]?.code||""),Ne(""),re(null)}const Z=qt(()=>tn(c,{canParkContext:nt}),[c,nt]);y(()=>{Z.some(e=>e.key===w)||pe(Z[0]?.key??null)},[Z,w]);const $n=Z.length===0,xe=$e.trim()?`${me}
|
|
3
|
+
${$e.trim()}`:me,Fn=lr({email:V,firstName:L,lastName:ee,company:Le.trim(),phone:te,address:xe,city:G,subdivision:_,postcode:$,country:l,lines:i.map(e=>[e.id,e.qty]),shippingMethodId:le,couponCode:Vt(D),currency:I.currency,shopperId:Pe?.id??null}),h=JSON.stringify([Fn,w]),R=f(null),De=f(null),Ke=f(!1),O=f(!1),j=f(null),Oe=f(!1),P=f(h);P.current=h;const xt=f(fe);xt.current=fe;const Kt=()=>O.current&&P.current!==R.current,B=f(null);y(()=>{xt.current||(h!==B.current&&(B.current=null),!(!O.current||!g||g.orderNumber)&&(h===R.current||h===B.current||Ee(g)))},[h,g]);async function Ee(e){if(Oe.current)return null;Oe.current=!0,S(!0);try{const t=j.current?await ir(j.current):"none";if(t==="succeeded"||t==="processing")return O.current=!1,x(null),E("card"),t==="succeeded"?await U(void 0,e):$t(e),null;if(t===void 0||!ar.has(t))return B.current=P.current,x(e),b(t==="requires_action"?cr:Xe),null;const n=await jt(oe);if(n==="committed")return O.current=!1,x(null),E("card"),await U(void 0,e),null;if(n!=="released")return B.current=P.current,x(e),b(Xe),null;O.current=!1,j.current=null,B.current=null,b(null),x(null);const a=ue();return Se(a),a}finally{Oe.current=!1,S(!1)}}async function Yn(){if(!(p||fe||Oe.current)){if(g){if((O.current?h!==R.current:ae())&&!g.orderNumber){const a=await Ee(g);a&&P.current===h&&await Ot(a);return}S(!0),b(null),Ke.current=!1,await qe();const t=z(P.current)[1],n=g.orderNumber?t:"card";if(n&&rn.has(n)&&ae()&&z(P.current)[0]!==De.current){Et(g);return}E(n),n!==w&&pe(n),await Ft(g,n,!g.orderNumber);return}await Ot(oe)}}async function Ot(e){if(i.length===0||I.repricing||!w||!Z.some(s=>s.key===w))return;const t=i.filter(Gt).flatMap(s=>Qn(s.components,s.qty));if(t.length===0){b("Pick a size on each wheel's product page before checking out.");return}S(!0),b(null);let n,a=e,r=w,u=!1;try{const s=Pe?N.createOrderAuthed:N.createOrder,k=Wn(),d={customer:{email:V,name:`${L} ${ee}`.trim(),phone:te.trim()||void 0,companyName:Le.trim()||void 0,address:xe,city:G,state:_||void 0,zipCode:$,country:l},items:t,currency:I.currency,idempotencyKey:e,shippingMethodId:le??void 0,couponCode:Vt(D),...k==="denied"?{}:Jn(),...k?{adConsent:k}:{},...sr(w)?{checkoutFlow:Zt}:{}};F.current=()=>s(d),ft(null),De.current=null,Ke.current=!1,j.current=null,O.current=!1,B.current=null,R.current=h,ce.current=i;const C=Y.current,Ut=C?.key===d.idempotencyKey&&(C.shape!==h&&(!!d.checkoutFlow||!!C.method||!!C.plainMethod)||!!d.checkoutFlow&&!!C.plainMethod);Ut&&(X.current=d.idempotencyKey);const Ht=Mt(d,s),zt=Ut||!d.checkoutFlow&&X.current===d.idempotencyKey,Dt=!Ht&&!zt&&!d.checkoutFlow&&!!C&&!C.method;Dt&&(C.plainMethod=w,C.plainLines=i,C.plainShape=h);const H=await(zt?It(d,s):s(d).then(se=>({answer:se,request:d})).catch(se=>(Ht?Tt(se,d.idempotencyKey):Dt&&Qt(se)&&(C.plainMethod=""),Bn(se,d,s))));if(!H)return;n=H.answer,a=H.request.idempotencyKey,r=H.method??r,E(r),u=ae()||r!==z(P.current)[1],H.method&&H.method!==w&&pe(H.method),n.orderNumber&&(Rt(n),q()),await qe()}catch(s){const k=pr(s);k?(cn(k),b(`${k} Your order has not been placed. Place it again to continue without the code.`)):s instanceof Ie?b(Xe):b(s instanceof Te?s.message:"Could not place the order. Please try again."),S(!1);return}if(r&&rn.has(r)&&(u||ae())){Et(n);return}await Ft(n,r,!1,a)}function Et(e){De.current=z(P.current)[0],b(`${nn(e,null)} ${Xt}`),x(e),S(!1)}function Tt(e,t){Qt(e)&&!Wt(e)&&Y.current?.key===t&&(Y.current=null)}async function Bn(e,t,n){if(We(e))return _t(t,n);if(!Wt(e))throw e;return X.current=t.idempotencyKey,It(t,n,!0)}async function It(e,t,n=!1){const a=await jt(e.idempotencyKey);if(a==="released")return P.current===h?_t(e,t):(Se(ue()),S(!1),null);if(a!=="committed")throw new Ie;const r=Y.current?.key===e.idempotencyKey?Y.current:null;if(ce.current=r?.lines??i,r?.method&&!n){X.current=null,F.current=r.send;const k=await r.send().catch(()=>{throw new Ie});return R.current=r.shape,{answer:k,request:e,method:r.method}}const u=r&&!r.method?r.send:()=>t({...e,checkoutFlow:Zt});F.current=u;const s=await u().catch(()=>null);if(!s&&r?.plainMethod)throw new Ie;return s?.orderNumber&&s.status!==ur?(X.current=null,r?.plainMethod&&(ce.current=r.plainLines),r&&(R.current=r.plainMethod?r.plainShape:r.shape),{answer:s,request:e,method:r?.plainMethod||void 0}):(S(!1),r&&(R.current=r.shape),E("card"),await Lt("",s?async()=>s:()=>Promise.reject(new Error("The order request did not answer."))),await qe(),null)}function ae(){const e=R.current;return e!==null&&z(e)[0]!==z(P.current)[0]}function E(e){e!==z(P.current)[1]&&(Ke.current=!0),ft(Ke.current||ae()?Xt:null)}async function _t(e,t){const n={...e,idempotencyKey:ue()};X.current=null,Se(n.idempotencyKey),F.current=()=>t(n),Mt(n,t);try{return{answer:await t(n),request:n}}catch(a){throw Tt(a,n.idempotencyKey),a}}function Mt(e,t){return Y.current?.key===e.idempotencyKey?!1:(Y.current={key:e.idempotencyKey,send:()=>t(e),lines:i,shape:h,method:e.checkoutFlow?"":w??"",plainMethod:"",plainLines:i,plainShape:h},!0)}function Rt(e){Zn({confirmation:e,lines:ce.current,adsSendTo:c.googleAdsId&&c.googleAdsConversionLabel?`${c.googleAdsId}/${c.googleAdsConversionLabel}`:null}),jn({confirmation:e,lines:ce.current})}async function U(e,t=M){if(!t)return;const n=e?async()=>e:F.current;if(t.orderNumber||!n){W(!0),A(t);return}await Lt(t.checkoutNumber,n)}async function Lt(e,t){q(),await dr({checkoutNumber:e,resend:t,page:{setConfirming:_n,land:A,markPaid:()=>W(!0),track:Rt,unplaced:bt}})}function $t(e=M){if(e){if(e.orderNumber){A(e);return}q(),bt({kind:"processing",checkoutNumber:e.checkoutNumber})}}async function qe(){const e=JSON.stringify([Ue.trim(),L,ee,te.trim(),xe,G,_,$,l]);if(!(!Pe||!lt||ut!=="new"||mt.current===e))try{await ie.createAddress({label:Ue.trim()||"Home",contact_name:`${L} ${ee}`.trim(),phone:te.trim(),address:xe,city:G,zip_code:$,state:_,country:l}),mt.current=e,pt("Address saved to your account.")}catch{pt("We couldn't save the address to your account — you can add it under Account → Addresses.")}}async function Ft(e,t=w,n=!1,a=oe){x(null);try{if(t==="card"&&c.paymentMethods.includes("card")){const r=await N.createPaymentIntent({idempotencyKey:a});if(j.current=r,n&&Kt()){await Ee(e);return}let u=e;if(n){const s=await F.current?.().catch(()=>null);if(s?.orderNumber){E("card"),await U(s,e);return}if(u=Yt(e,s)??{...e,expiresAt:null},Kt()){await Ee(e);return}}E("card"),J(u),He(!1),Ae(r)}else if(t==="paypal"&&c.paymentMethods.includes("paypal"))J(e),bn(!0);else if(t==="afterpay"&&c.paymentMethods.includes("afterpay")){const r=window.location.origin,u=await N.createAfterpayCheckout({idempotencyKey:a,confirmUrl:`${r}/checkout?afterpay=confirm`,cancelUrl:`${r}/checkout?afterpay=cancel`}),s={idempotencyKey:a,confirmation:e};v.setItem(er,JSON.stringify(s)),window.location.assign(u.redirectCheckoutUrl);return}else if(t==="square"&&c.paymentMethods.includes("square"))J(e),Pn(!0);else if(t==="gocardless"&&c.paymentMethods.includes("gocardless")){const r=window.location.origin,u=await N.createGocardlessBillingRequest({idempotencyKey:a,confirmUrl:`${r}/checkout?gocardless=confirm`,cancelUrl:`${r}/checkout?gocardless=cancel`}),s={idempotencyKey:a,confirmation:e};v.setItem(Ge,JSON.stringify(s)),window.location.assign(u.authorisationUrl);return}else if(t==="zip"&&c.paymentMethods.includes("zip")){const r=window.location.origin,u=await N.createZipCheckout({idempotencyKey:a,redirectUrl:`${r}/checkout?zip=return`}),s={idempotencyKey:a,confirmation:e};v.setItem(nr,JSON.stringify(s)),window.location.assign(u.redirectUrl);return}else if(t==="klarna"&&c.paymentMethods.includes("klarna")){const r=window.location.origin,u=await N.createKlarnaCheckout({idempotencyKey:a,confirmUrl:`${r}/checkout?klarna=confirm`,cancelUrl:`${r}/checkout?klarna=cancel`}),s={idempotencyKey:a,confirmation:e};v.setItem(Je,JSON.stringify(s)),window.location.assign(u.redirectUrl);return}else E(t),A(e)}catch(r){if((n||t==="card")&&r instanceof Te&&r.status===409){E(t),await U(void 0,e);return}Bt(e,r),S(!1)}}function Yt(e,t){return t&&!t.orderNumber&&t.status==="open"&&t.checkoutNumber===e.checkoutNumber?t:null}function Bt(e,t){b(nn(e,t)),!e.orderNumber&&We(t)?(O.current=!1,Se(ue())):x(e)}async function Un(e){if(!M)return;const t=M;try{const n=await N.createPaymentIntent({idempotencyKey:oe}),a=await F.current?.().catch(()=>null);if(a?.orderNumber){await U(a);return}const r=Yt(t,a);J(r??{...t,expiresAt:null}),He(e&&r!==null),j.current=n,Ae(n)}catch(n){if(n instanceof Te&&n.status===409){await U();return}Ae(null),J(null),Bt(t,n),S(!1)}}function Hn(){M&&(O.current=!0,x(M),Ae(null),J(null),He(!1),S(!1))}return{site:c,logo:m,items:i,totals:I,coupon:D,deliveryOptions:Ze,courierUnavailable:yn,retryCourier:hn,shippingMethodId:le,setShippingMethodId:an,pickupLocation:ln,servedCountries:Q,formatMoney:dn,payChoice:w,setPayChoice:pe,placing:fe,email:V,setEmail:_e,firstName:L,setFirstName:Me,lastName:ee,setLastName:Re,company:Le,setCompany:rt,address1:me,setAddress1:ye,address2:$e,setAddress2:he,city:G,setCity:we,postcode:$,setPostcode:ge,phone:te,setPhone:ke,country:l,setCountry:Ce,subdivision:_,setSubdivision:Ne,subdivisions:ne,destination:ct,postcodeLabel:fn,subdivisionLabel:mn,me:Pe,savedAddresses:wn,selectedAddressId:ut,setSelectedAddressId:Be,saveAddress:lt,setSaveAddress:dt,saveLabel:Ue,setSaveLabel:gn,addressSaveNote:kn,lostChangeNote:Cn,idemKey:oe,confirmation:yt,setConfirmation:A,orderError:Nn,payment:ht,paypalStep:wt,squareStep:gt,pendingConf:M,paid:Sn,setPaid:W,unpaidOrder:g,orderLocked:An,payNote:vn,afterpayConfirming:xn,gocardlessConfirming:On,zipConfirming:En,klarnaConfirming:In,cardConfirming:Nt,checkoutResult:ze,confirmCardPayment:U,cardStillProcessing:$t,renewCardPayment:Un,holdRenewed:Mn,leaveCardPayment:Hn,checkoutRootRef:At,setCheckoutHeaderEl:Rn,fillFromAddress:vt,checkoutSignOut:Ln,payOptions:Z,noPaymentMethod:$n,placeOrder:Yn}}const on=zn(null);function Mr({children:c,...m}){const p=fr(m);return T(on.Provider,{value:p,children:c})}function Rr(){const c=Dn(on);if(!c)throw new Error("useCheckout must be used inside CheckoutStateProvider");return c}export{Mr as CheckoutStateProvider,Tr as NO_PAYMENT_METHOD_NOTE,Ir as SHIPPING_RETRY_NOTE,tn as buildPayOptions,nn as paymentNotStartedMessage,_r as placedOrderLockNote,Rr as useCheckout};
|
|
@@ -202,6 +202,7 @@ export type Brand = {
|
|
|
202
202
|
design_count: number;
|
|
203
203
|
};
|
|
204
204
|
import type { components, operations } from "./types.js";
|
|
205
|
+
import { type DealerList } from "../sections/dealer-finder.js";
|
|
205
206
|
export declare function resolveMediaUrls<T>(value: T): T;
|
|
206
207
|
export type Process = components["schemas"]["Process"];
|
|
207
208
|
export type FinishFamily = components["schemas"]["FinishFamily"];
|
|
@@ -847,3 +848,5 @@ export declare const storefrontAdmin: {
|
|
|
847
848
|
}>;
|
|
848
849
|
listMedia: (token: string, kind?: "image" | "video") => Promise<MediaAsset[]>;
|
|
849
850
|
};
|
|
851
|
+
export declare function dealersPath(near: string): string;
|
|
852
|
+
export declare function fetchDealers(near: string): Promise<DealerList>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as ot,SITE_HOST_HEADER as it,SITE_SLUG_HEADER as ct}from"../site-headers.js";import{PRODUCT_API_BASE as dt,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ut,clientIpFromForwardedFor as lt,FORWARDED_FOR_HEADER as pt,hopCachingOf as yt}from"../forwarded-for.js";import ht from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ft}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as E}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const gt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,n){super(s),this.status=e,this.data=n}}const I="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",wt=new Set([502,503,504]),N=0,mt="This editor runs on its host's own backend, which does not serve this request.",St=5e3,Pt=15e3,Ot=()=>typeof window>"u"?St:Pt;function H(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(Ot())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>wt.has(t)?I:e,bt=["admin","venue"];let B="admin";function le(t){B=bt.includes(t)?t:"admin"}function At(){return B}const Tt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function pe(t){q=t&&Tt.test(t)?t:null}function Rt(){return q}function Et(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=V();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:n,headers:l,audience:p,...h}=e;if(typeof window<"u"&&!ft())throw new m(N,mt,null);if(typeof window>"u"&&n===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const r=typeof FormData<"u"&&h.body instanceof FormData;let a;try{a=await fetch(`${n??gt}${Et(t)}`,{...h,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:h.signal??H({...h,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(N,I,null):y}let o;try{o=await a.text()}catch(y){throw F(y)?new m(N,I,null):y}let c=null;if(o)try{c=JSON.parse(o)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),o)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new m(a.status,y,c)}return c}let b=null;async function G(){return b||(b=$t().finally(()=>{b=null}),b)}async function $t(){const t=P.takeLegacyRefresh(),e=await Ut.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function g(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(n){if(!(n instanceof m)||n.status!==401)throw n;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),n}}}const Ct=100,j=20;function _t(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function z(t,e){const[s,n=""]=t.split("?"),l=[];let p="1";for(let h=0;h<j&&p;h++){const r=new URLSearchParams(n);r.set("page_size",String(Ct)),p!=="1"&&r.set("page",p);const a=await g(`${s}?${r.toString()}`);l.push(...a.results),p=_t(a.next)}return p&&console.warn(`[${e}] stopped at ${j} pages (${l.length} rows); list may be truncated`),l}async function K(t,e={}){if(P.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function X(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ut={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await X(),t},me:X,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>g("/api/products/brands/"),myOrders:()=>z("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>z(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as It,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Nt,isSvgUrl as vt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as kt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Lt,webRuntimeSiteSlug as V}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?It(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,n]of Object.entries(t))e[s]=s==="captions"&&n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).map(([l,p])=>[w(l),p])):w(n);return e}return t}import{PRODUCT_API_BASE as Te}from"./origins.js";const Z=typeof window>"u"&&D!=="",Jt=Z?D:dt,Dt=Lt,O=()=>({baseUrl:Dt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Y=100,Q=50;function k(t,e,s){const n=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&n.set(l,String(p));return n.set("pageSize",String(Y)),s&&n.set("cursor",s),`/api/v1${t}?${n.toString()}`}function xt(t,e){return k("/wheels",{process:t},e)}const tt=Y;function Ht(t,e){return k("/wheels",{slug:t.join(",")},e)}function Ft(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Mt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function L(t,e,s=()=>!1,n=()=>!1){const l=[];let p=null;try{for(let h=0;h<Q;h++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Mt(r.next),!p)break;if(n(l))return l}p&&console.warn(`[${t}] stopped at ${Q} pages (${l.length} rows); catalog may be truncated`)}catch(h){if(s(h))throw h;console.warn(`[${t}] product API unavailable, returning []`,h)}return l}const et=t=>t instanceof m&&t.status===400;function rt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?E([e]):[e])}async function at(){return(await Bt()).host}async function Bt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,n=s(e.get(it)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:n,matchesRequestHost:n!==null&&n===l}}catch{return{host:null,matchesRequestHost:!1}}}async function qt(){try{const{headers:t}=await import("next/headers");return lt((await t()).get(pt))}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get(ct)||null}catch{return null}}async function Wt(){const t=await Gt();if(t)return`site=${encodeURIComponent(t)}`;const e=await at();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=V();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await Wt())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const jt="preview";async function zt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(ot)}catch{return null}}async function Kt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function J(t,e){const s=await zt();if(s===null)return[await f(t),await u(e)];const n=$(await f(t),`${jt}=${encodeURIComponent(s)}`),{next:l,cache:p,...h}=e??{},r=await u({...h,cache:"no-store"}),a=await Kt();return a&&(r.headers={...r.headers,"user-agent":a}),[n,r]}async function Xt(t){if(!Z)return;const[e,s]=await Promise.all([at(),qt()]),n=ut(e,s,t);return Object.keys(n).length>0?n:void 0}async function u(t){const e=await Xt(yt(t)),s={baseUrl:Jt,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const n=s.toString();return`/api/v1/fitment${t}${n?`?${n}`:""}`}const we={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:n}=await import("./fitment-data.js");return n.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,n)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,n)}return(await i(T("/modifications",{make:t,model:e,year:s,region:n}),O())).results},getStockFitment:async(t,e,s,n,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,n,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:n,region:l}),O())}},me={listWheels:async(t,e={})=>{const s=await L("products.listWheels",async n=>await f(xt(t,n)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:n=>E([...n]).length>=e.maxRows);return E(w(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const n=[];for(let r=0;r<s.length;r+=tt)n.push(s.slice(r,r+tt));const l=await Promise.all(n.map(r=>L("products.listWheelsBySlug",async a=>await f(Ht(r,a)),e.throwOnFailure?()=>!0:et))),p=new Set(s),h=l.flat().filter(r=>p.has(r.slug));return E(w(h))},listCatalog:async(t,e,s={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const n=await L("products.listCatalog",async l=>await f(Ft(t,e,l)),s.throwOnFailure?()=>!0:et,s.maxRows===void 0?void 0:l=>rt([...l]).length>=s.maxRows);return rt(w(n))},getWheel:async t=>x(w(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>w(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:n}=await import("./gallery-builds-data.js");return w(n(e,s))}try{const n=new URLSearchParams;e&&n.set("process",e),s&&n.set("wheelSlug",s);const l=n.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(n){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",n),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>w(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[n,l]=await J(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(n,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(n){if(e)throw n;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",n),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),n=e.toString();try{return await i(await f(n?`${s}?${n}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await K(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await K(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await J(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let n=null,l=null;if(s&&vt(s)){const p=await Nt(s,t);p&&(n=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:n,logoInkIsDark:l}},getThemeSettings:async()=>i(...await J(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},Se={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Vt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const n=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${n?`?${n}`:""}`},_=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Zt=t=>`${_(t)}currencies/`,Yt="/api/storefront/media/ingest/";class Qt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function te(){const t=kt();if(!t)throw new Qt;return`${Yt}?${new URLSearchParams({site:t})}`}const ee="X-Puck-Media-Manifest",st=ht.contentHash,U={"X-Media-Manifest":st,[ee]:st},Pe=nt({});function nt(t){return(e,s={})=>{const n=Rt(),l=t.headers||n?{...n?{"Accept-Language":n}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??At()})}}function re(t={}){const e=nt(t),s=t.siteDrafts===!0,n=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),h=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,o)=>{const c=new URLSearchParams({slug:r});o&&c.set("site",o);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!o&&S.length>1)throw new Vt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,o,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:o}),duplicatePage:(r,a,o)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:o}),geocode:(r,a,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:r,country:o}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,o,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:U,token:o}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,o)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),listTemplatePages:async(r,a)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o)?o:o.results??[]},findTemplatePageBySlug:async(r,a,o)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:o});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:U,token:o}),saveTemplatePageLayout:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),deleteTemplatePage:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/pages/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,o,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:o}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(n(a),{token:r}),listMenus:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/menus/?${o}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const o=new URLSearchParams;a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const o=new URLSearchParams;a.kinds?.length&&o.set("kind",a.kinds.join(",")),a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,o={})=>{const c=new URLSearchParams({slug:a});return o.siteId&&c.set("site",o.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e(_(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const o=await e(Zt(r),{token:a});return Array.isArray(o)?o:[]},publishSite:(r,a)=>e(`${_(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${_(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,o)=>e(p(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(h(a),{token:r}),updateSocialSettings:(r,a,o)=>e(h(o),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,o)=>{const c=new FormData;return c.append("logo",r),e(n(o),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(n(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const o=new FormData;return o.append("file",r),e(te(),{method:"POST",body:o,token:a})},listMedia:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("kind",a);const c=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const Oe=re({siteDrafts:!0});export{gt as API_URL,Vt as AmbiguousPageSlugError,m as ApiError,Pt as BROWSER_READ_TIMEOUT_MS,mt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Qt as MediaUploadDestinationError,jt as PREVIEW_PARAM,Te as PRODUCT_API_BASE,St as SERVER_READ_TIMEOUT_MS,I as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,Pe as adminFetch,Ut as api,i as apiFetch,$ as appendSiteQuery,Se as bookings,re as createStorefrontAdmin,H as defaultRequestDeadline,te as editorMediaUploadPath,At as editorPortalAudience,Rt as editorRequestLanguage,we as fitment,me as products,Ot as readDeadlineMs,qt as resolveClientIp,w as resolveMediaUrls,zt as resolvePreviewToken,at as resolveSiteHost,Bt as resolveSiteHostSource,Gt as resolveSiteSlug,pe as setEditorLanguage,le as setEditorPortalAudience,Oe as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as ot,SITE_HOST_HEADER as it,SITE_SLUG_HEADER as ct}from"../site-headers.js";import{PRODUCT_API_BASE as dt,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ut,clientIpFromForwardedFor as lt,FORWARDED_FOR_HEADER as pt,hopCachingOf as yt}from"../forwarded-for.js";import ht from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ft}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as E}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const gt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class w extends Error{status;data;constructor(e,s,n){super(s),this.status=e,this.data=n}}const I="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",mt=new Set([502,503,504]),N=0,wt="This editor runs on its host's own backend, which does not serve this request.",St=5e3,Pt=15e3,Ot=()=>typeof window>"u"?St:Pt;function H(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(Ot())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>mt.has(t)?I:e,bt=["admin","venue"];let B="admin";function ye(t){B=bt.includes(t)?t:"admin"}function At(){return B}const Tt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function he(t){q=t&&Tt.test(t)?t:null}function Rt(){return q}function Et(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=V();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:n,headers:l,audience:p,...h}=e;if(typeof window<"u"&&!ft())throw new w(N,wt,null);if(typeof window>"u"&&n===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const r=typeof FormData<"u"&&h.body instanceof FormData;let a;try{a=await fetch(`${n??gt}${Et(t)}`,{...h,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:h.signal??H({...h,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new w(N,I,null):y}let o;try{o=await a.text()}catch(y){throw F(y)?new w(N,I,null):y}let c=null;if(o)try{c=JSON.parse(o)}catch{throw new w(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),o)}if(!a.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??M(a.status,a.statusText);throw new w(a.status,y,c)}return c}let b=null;async function G(){return b||(b=$t().finally(()=>{b=null}),b)}async function $t(){const t=P.takeLegacyRefresh(),e=await Ut.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function g(t,e={}){let s;try{s=await W()}catch{throw P.clear(),new w(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(n){if(!(n instanceof w)||n.status!==401)throw n;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),n}}}const Ct=100,j=20;function _t(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function z(t,e){const[s,n=""]=t.split("?"),l=[];let p="1";for(let h=0;h<j&&p;h++){const r=new URLSearchParams(n);r.set("page_size",String(Ct)),p!=="1"&&r.set("page",p);const a=await g(`${s}?${r.toString()}`);l.push(...a.results),p=_t(a.next)}return p&&console.warn(`[${e}] stopped at ${j} pages (${l.length} rows); list may be truncated`),l}async function K(t,e={}){if(P.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(s){if(!(s instanceof w)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function X(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new w(403,"This session is not valid for this shop.",null);return t}const Ut={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await W();return await X(),t},me:X,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>g("/api/products/brands/"),myOrders:()=>z("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>z(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as It,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Nt,isSvgUrl as vt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as kt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Lt,webRuntimeSiteSlug as V}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Jt}from"../sections/dealer-finder.js";function m(t){if(typeof t=="string")return t.startsWith("/media/")?It(t):t;if(Array.isArray(t))return t.map(m);if(t&&typeof t=="object"){const e={};for(const[s,n]of Object.entries(t))e[s]=s==="captions"&&n&&typeof n=="object"&&!Array.isArray(n)?Object.fromEntries(Object.entries(n).map(([l,p])=>[m(l),p])):m(n);return e}return t}import{PRODUCT_API_BASE as Ce}from"./origins.js";const Z=typeof window>"u"&&D!=="",Dt=Z?D:dt,xt=Lt,O=()=>({baseUrl:xt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Y=100,Q=50;function k(t,e,s){const n=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&n.set(l,String(p));return n.set("pageSize",String(Y)),s&&n.set("cursor",s),`/api/v1${t}?${n.toString()}`}function Ht(t,e){return k("/wheels",{process:t},e)}const tt=Y;function Ft(t,e){return k("/wheels",{slug:t.join(",")},e)}function Mt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Bt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function L(t,e,s=()=>!1,n=()=>!1){const l=[];let p=null;try{for(let h=0;h<Q;h++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Bt(r.next),!p)break;if(n(l))return l}p&&console.warn(`[${t}] stopped at ${Q} pages (${l.length} rows); catalog may be truncated`)}catch(h){if(s(h))throw h;console.warn(`[${t}] product API unavailable, returning []`,h)}return l}const et=t=>t instanceof w&&t.status===400;function rt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?E([e]):[e])}async function at(){return(await qt()).host}async function qt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,n=s(e.get(it)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:n,matchesRequestHost:n!==null&&n===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Gt(){try{const{headers:t}=await import("next/headers");return lt((await t()).get(pt))}catch{return null}}async function Wt(){try{const{headers:t}=await import("next/headers");return(await t()).get(ct)||null}catch{return null}}async function jt(){const t=await Wt();if(t)return`site=${encodeURIComponent(t)}`;const e=await at();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=V();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await jt())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const zt="preview";async function Kt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(ot)}catch{return null}}async function Xt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function J(t,e){const s=await Kt();if(s===null)return[await f(t),await u(e)];const n=$(await f(t),`${zt}=${encodeURIComponent(s)}`),{next:l,cache:p,...h}=e??{},r=await u({...h,cache:"no-store"}),a=await Xt();return a&&(r.headers={...r.headers,"user-agent":a}),[n,r]}async function Vt(t){if(!Z)return;const[e,s]=await Promise.all([at(),Gt()]),n=ut(e,s,t);return Object.keys(n).length>0?n:void 0}async function u(t){const e=await Vt(yt(t)),s={baseUrl:Dt,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const n=s.toString();return`/api/v1/fitment${t}${n?`?${n}`:""}`}const Pe={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:n}=await import("./fitment-data.js");return n.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,n)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,n)}return(await i(T("/modifications",{make:t,model:e,year:s,region:n}),O())).results},getStockFitment:async(t,e,s,n,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,n,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:n,region:l}),O())}},Oe={listWheels:async(t,e={})=>{const s=await L("products.listWheels",async n=>await f(Ht(t,n)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:n=>E([...n]).length>=e.maxRows);return E(m(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const n=[];for(let r=0;r<s.length;r+=tt)n.push(s.slice(r,r+tt));const l=await Promise.all(n.map(r=>L("products.listWheelsBySlug",async a=>await f(Ft(r,a)),e.throwOnFailure?()=>!0:et))),p=new Set(s),h=l.flat().filter(r=>p.has(r.slug));return E(m(h))},listCatalog:async(t,e,s={})=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const n=await L("products.listCatalog",async l=>await f(Mt(t,e,l)),s.throwOnFailure?()=>!0:et,s.maxRows===void 0?void 0:l=>rt([...l]).length>=s.maxRows);return rt(m(n))},getWheel:async t=>x(m(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>m(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:n}=await import("./gallery-builds-data.js");return m(n(e,s))}try{const n=new URLSearchParams;e&&n.set("process",e),s&&n.set("wheelSlug",s);const l=n.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return m(p.results)}catch(n){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",n),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>m(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof w&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof w&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof w&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[n,l]=await J(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return m(await i(n,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:v(l.coverImage)??""}))}catch(n){if(e)throw n;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",n),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(d("/checkouts/release"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),n=e.toString();try{return await i(await f(n?`${s}?${n}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await K(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await K(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=H({method:"GET"}),e=await i(...await J(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let n=null,l=null;if(s&&vt(s)){const p=await Nt(s,t);p&&(n=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:n,logoInkIsDark:l}},getThemeSettings:async()=>i(...await J(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},be={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Zt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const n=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${n?`?${n}`:""}`},_=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Yt=t=>`${_(t)}currencies/`,Qt="/api/storefront/media/ingest/";class te extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function ee(){const t=kt();if(!t)throw new te;return`${Qt}?${new URLSearchParams({site:t})}`}const re="X-Puck-Media-Manifest",st=ht.contentHash,U={"X-Media-Manifest":st,[re]:st},Ae=nt({});function nt(t){return(e,s={})=>{const n=Rt(),l=t.headers||n?{...n?{"Accept-Language":n}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??At()})}}function ae(t={}){const e=nt(t),s=t.siteDrafts===!0,n=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),h=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,o)=>{const c=new URLSearchParams({slug:r});o&&c.set("site",o);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!o&&S.length>1)throw new Zt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,o,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:o}),duplicatePage:(r,a,o)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:o}),geocode:(r,a,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:r,country:o}:{q:r})}`,{token:a}),listBlockSources:r=>e("/api/storefront/block-sources/",{token:r}),listRecordTypes:r=>e("/api/storefront/record-types/",{token:r}),createPagePreviewLink:(r,a)=>e(`/api/storefront/pages/${r}/preview-link/`,{method:"POST",token:a}),claimPageEditLock:(r,a,o,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:U,token:o}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,o)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),listTemplatePages:async(r,a)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o)?o:o.results??[]},findTemplatePageBySlug:async(r,a,o)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:o});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:U,token:o}),saveTemplatePageLayout:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:o}),deleteTemplatePage:(r,a,o)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/pages/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,o,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:o}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(n(a),{token:r}),listMenus:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("site",a);const c=await e(`/api/storefront/menus/?${o}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.visibleOnly&&o.set("is_visible","true"),a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(r,a={})=>{const o=new URLSearchParams({no_page:"true"});a.siteId&&o.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${o.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const o=new URLSearchParams;a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return m(y)},listProducts:async(r,a={})=>{const o=new URLSearchParams;a.kinds?.length&&o.set("kind",a.kinds.join(",")),a.siteId&&o.set("site",a.siteId);const c=o.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return m(y)},getWheelDetail:async(r,a,o={})=>{const c=new URLSearchParams({slug:a});return o.siteId&&c.set("site",o.siteId),x(m(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSite:(r,a)=>e(_(r),{token:a}),listSites:async r=>{const a=await e("/api/storefront/sites/?no_page=true",{token:r});return Array.isArray(a)?a:a.results??[]},listSiteCurrencies:async(r,a)=>{const o=await e(Yt(r),{token:a});return Array.isArray(o)?o:[]},publishSite:(r,a)=>e(`${_(r)}publish/`,{method:"POST",token:a}),getSiteLiveState:(r,a)=>e(`${_(r)}live-state/`,{token:a}),getThemeSettings:(r,a)=>e(l(a),{token:r}),updateThemeSettings:(r,a,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getMyPreferences:async r=>(await e("/api/auth/me/",{token:r})).preferences??{},updateMyPreferences:(r,a)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:r}),token:a}),getChatSettings:(r,a)=>e(p(a),{token:r}),updateChatSettings:(r,a,o)=>e(p(o),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(h(a),{token:r}),updateSocialSettings:(r,a,o)=>e(h(o),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,o)=>{const c=new FormData;return c.append("logo",r),e(n(o),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(n(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,o)=>e(n(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const o=new FormData;return o.append("file",r),e(ee(),{method:"POST",body:o,token:a})},listMedia:async(r,a)=>{const o=new URLSearchParams({no_page:"true"});a&&o.set("kind",a);const c=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const Te=ae({siteDrafts:!0});function se(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function Re(t){return Jt(await i(se(t)))}export{gt as API_URL,Zt as AmbiguousPageSlugError,w as ApiError,Pt as BROWSER_READ_TIMEOUT_MS,wt as EFFICIENT_CLIENT_CLOSED_MESSAGE,te as MediaUploadDestinationError,zt as PREVIEW_PARAM,Ce as PRODUCT_API_BASE,St as SERVER_READ_TIMEOUT_MS,I as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,Ae as adminFetch,Ut as api,i as apiFetch,$ as appendSiteQuery,be as bookings,ae as createStorefrontAdmin,se as dealersPath,H as defaultRequestDeadline,ee as editorMediaUploadPath,At as editorPortalAudience,Rt as editorRequestLanguage,Re as fetchDealers,Pe as fitment,Oe as products,Ot as readDeadlineMs,Gt as resolveClientIp,m as resolveMediaUrls,Kt as resolvePreviewToken,at as resolveSiteHost,qt as resolveSiteHostSource,Wt as resolveSiteSlug,he as setEditorLanguage,ye as setEditorPortalAudience,Te as storefrontAdmin};
|
|
@@ -1586,6 +1586,7 @@ export interface components {
|
|
|
1586
1586
|
sectionContentWidth: "full" | "content" | null;
|
|
1587
1587
|
photographyGrayscale?: boolean;
|
|
1588
1588
|
englishVariant?: "international" | "us";
|
|
1589
|
+
shareButtonOnPosts?: boolean | null;
|
|
1589
1590
|
catalogFilterLabels?: {
|
|
1590
1591
|
vehicle?: string;
|
|
1591
1592
|
process?: string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SiteCountry } from "../content/site.js";
|
|
2
|
+
export type TaxNoteCountry = Pick<SiteCountry, "chargeTax" | "taxDisplay" | "taxName" | "taxRate">;
|
|
3
|
+
export declare const TAX_AT_CHECKOUT = "calculated at checkout";
|
|
4
|
+
export declare function taxNote(country: TaxNoteCountry | null | undefined): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a="calculated at checkout";function l(e){if(!e||!e.chargeTax)return null;const t=(e.taxName??"").trim();return t?e.taxDisplay==="inclusive"?`incl. ${t}`:e.taxDisplay==="exclusive"?e.taxRate==null?`+ ${t}, ${a}`:`+ ${t}`:null:null}export{a as TAX_AT_CHECKOUT,l as taxNote};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEALER_WORDS as e}from"../../../../sections/dealer-finder.js";const l={label:"Find a dealer",defaultProps:{title:e.title}};export{l as DealerFinderMeta};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DealerList } from "../../../../sections/dealer-finder.js";
|
|
2
|
+
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
3
|
+
export declare const dealerFinderSample: () => DealerList;
|
|
4
|
+
export declare const DealerFinderRender: BlockRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import a from"../../../../../components/DealerFinderSection.js";import{readHidable as d}from"efficient-easel/screen/lib/document/hidable";import{DealerFinderMeta as s}from"./meta.js";const i=()=>({near:"found",dealers:[{id:"sample-1",name:"Harbour Wheels",address:"12 Quay St",city:"Sydney",state:"NSW",postcode:"2000",country:"AU",phone:"02 9000 0000",website:"https://example.com",lat:-33.86,lng:151.21,distanceKm:1.2},{id:"sample-2",name:"Western Tyres",address:"4 Great Western Hwy",city:"Parramatta",state:"NSW",postcode:"2150",country:"AU",phone:"02 9600 0000",website:"",lat:-33.81,lng:151,distanceKm:21.4}]}),o=e=>{const{text:t,hidden:n}=d(e);return n||!t?void 0:t},y={...s,render:e=>r(a,{title:o(e.title),contained:e.contained!==!1,sample:e.editor?.isEditing?i():void 0})};export{y as DealerFinderRender,i as dealerFinderSample};
|
|
@@ -3,6 +3,7 @@ export declare const SERVICE_METAS: {
|
|
|
3
3
|
AppointmentBooking: Omit<BlockRender, "render">;
|
|
4
4
|
BookingBox: Omit<BlockRender, "render">;
|
|
5
5
|
ContactRouting: Omit<BlockRender, "render">;
|
|
6
|
+
DealerFinder: Omit<BlockRender, "render">;
|
|
6
7
|
Events: Omit<BlockRender, "render">;
|
|
7
8
|
Footer: Omit<BlockRender, "render">;
|
|
8
9
|
FooterDivider: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{DealerFinderMeta as m}from"./DealerFinder/meta.js";import{EventsMeta as a}from"./Events/meta.js";import{FooterDividerMeta as p}from"./FooterDivider/meta.js";import{FooterEmailSignupMeta as n}from"./FooterEmailSignup/meta.js";import{FooterGroupMeta as M}from"./FooterGroup/meta.js";import{FooterLogoMeta as f}from"./FooterLogo/meta.js";import{FooterMenuMeta as F}from"./FooterMenu/meta.js";import{ArticleBodyMeta as g}from"./ArticleBody/meta.js";import{FooterMeta as s}from"./Footer/meta.js";import{FooterSocialMeta as l}from"./FooterSocial/meta.js";import{FooterPaymentMeta as u}from"./FooterPayment/meta.js";import{FooterTextMeta as B}from"./FooterText/meta.js";import{FormMeta as c}from"./Form/meta.js";import{LegalLineBlockMeta as S}from"./LegalLineBlock/meta.js";import{MenuLinkBlockMeta as b}from"./MenuLinkBlock/meta.js";import{OpeningHoursMeta as E}from"./OpeningHours/meta.js";import{RateTableMeta as d}from"./RateTable/meta.js";import{MessagingCardsMeta as R}from"./MessagingCards/meta.js";import{FooterMessagingMeta as k}from"./FooterMessaging/meta.js";import{ContactCardsMeta as T}from"./ContactCards/meta.js";import{RatingBlockMeta as C}from"./RatingBlock/meta.js";import{ReviewFormMeta as v}from"./ReviewForm/meta.js";import{ReviewsMeta as L}from"./Reviews/meta.js";import{SiteFooterMeta as x}from"./SiteFooter/meta.js";import{SiteHeaderMeta as A}from"./SiteHeader/meta.js";import{SubmitBoxMeta as D}from"./SubmitBox/meta.js";import{SubmitBuildMeta as _}from"./SubmitBuild/meta.js";import{SubscribeBlogsMeta as w}from"./SubscribeBlogs/meta.js";import{SubscribeMeta as y}from"./Subscribe/meta.js";const so={AppointmentBooking:r,BookingBox:e,ContactRouting:i,DealerFinder:m,Events:a,Footer:s,FooterDivider:p,FooterEmailSignup:n,FooterGroup:M,FooterLogo:f,FooterMenu:F,ArticleBody:g,FooterSocial:l,FooterPayment:u,FooterText:B,Form:c,LegalLineBlock:S,MenuLinkBlock:b,OpeningHours:E,RateTable:d,MessagingCards:R,FooterMessaging:k,ContactCards:T,RatingBlock:C,ReviewForm:v,Reviews:L,[o]:x,[t]:A,SubmitBox:D,SubmitBuild:_,Subscribe:y,SubscribeBlogs:w};export{so as SERVICE_METAS};
|