efficient-storefront-blocks 0.96.0 → 0.97.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/chunks/{EditorPreviewCheckout-BXTY7X47.js → EditorPreviewCheckout-O7F36ZXB.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-JF3MS6J7.js → SiteEditorProvider-VZUU5OPZ.js} +1 -1
- package/dist/chunks/chunk-AOZEO73W.js +401 -0
- package/dist/chunks/{chunk-KJQS4BOV.js → chunk-MXWQOFM6.js} +1 -1
- package/dist/chunks/chunk-NYEB6V2R.js +1 -0
- package/dist/chunks/{chunk-QNBU3FGY.js → chunk-SQ62RGWV.js} +1 -1
- package/dist/chunks/chunk-UFEEFZ5M.js +1 -0
- package/dist/chunks/{fitment-data-KWJP5ZQB.js → fitment-data-MCGKHSA4.js} +1 -1
- package/dist/contract.js +10 -2
- package/dist/editor.css +1 -1
- package/dist/index.js +57 -62
- package/dist/render/app/globals.css +7 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/ContactRouting.d.ts +6 -0
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/ProductCard.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +3 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +3 -10
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/card-pieces/CardSurfaceFrame.d.ts +12 -0
- package/dist/render/components/card-pieces/CardSurfaceFrame.js +1 -0
- package/dist/render/components/card-pieces/card-row.js +1 -1
- package/dist/render/components/catalog/ShopperChips.d.ts +7 -4
- package/dist/render/components/catalog/ShopperChips.js +1 -1
- package/dist/render/components/catalog/ShopperFilters.d.ts +1 -0
- package/dist/render/components/catalog/ShopperFilters.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpFacetRows.d.ts +6 -4
- package/dist/render/components/wheels-plp/PlpFacetRows.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.d.ts +19 -14
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/PlpTypePicker.d.ts +2 -5
- package/dist/render/lib/api/index.d.ts +3 -1
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +28 -0
- package/dist/render/lib/content/contact-card-seed.js +1 -1
- package/dist/render/lib/content/facet-row-seed.d.ts +14 -0
- package/dist/render/lib/content/facet-row-seed.js +1 -1
- package/dist/render/lib/content/filter-card-seed.js +1 -1
- package/dist/render/lib/content/hero-option-seed.js +1 -1
- package/dist/render/lib/content/square-box.d.ts +4 -0
- package/dist/render/lib/content/square-box.js +1 -0
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +4 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/render.js +1 -1
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-detail.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-listing.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-spec.js +1 -1
- package/dist/words.d.ts +10 -0
- package/dist/words.js +3 -3
- package/package.json +4 -4
- package/dist/chunks/chunk-KNUGQTUV.js +0 -1
- package/dist/chunks/chunk-YCB5WS3U.js +0 -1
- package/dist/chunks/chunk-Z2TVM6MN.js +0 -389
- package/dist/render/components/ProductCardChrome.d.ts +0 -38
- package/dist/render/components/ProductCardChrome.js +0 -1
- /package/dist/chunks/{chunk-Z2TVM6MN.js.LEGAL.txt → chunk-AOZEO73W.js.LEGAL.txt} +0 -0
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import type { ProductKind } from "../../lib/api/index.js";
|
|
3
3
|
import type { TyreSizePart } from "../../lib/tyres/tyre-size.js";
|
|
4
4
|
import { type PlpFacetGroup, type PlpFacetKey, type PlpFilterState, type PlpTypeOption, type PlpTyreSizeBox } from "../../lib/wheels/plp-filters.js";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { type RailOwner } from "./PlpFacetRows.js";
|
|
6
|
+
export default function PlpSidebar<K extends string = PlpFacetKey>({ facets, filters, typeOptions, sizeBoxes, sizeMatches, noun, priceBounds, inStockCount, onToggle, onPickType, onPickSize, onPriceMax, onInStockOnly, onClearAll, price, foot, owner, editing, }: {
|
|
7
|
+
facets: (Omit<PlpFacetGroup, "key"> & {
|
|
8
|
+
key: K;
|
|
9
|
+
})[];
|
|
7
10
|
filters: PlpFilterState;
|
|
8
|
-
typeOptions
|
|
9
|
-
sizeBoxes
|
|
10
|
-
sizeMatches
|
|
11
|
+
typeOptions?: PlpTypeOption[];
|
|
12
|
+
sizeBoxes?: PlpTyreSizeBox[] | null;
|
|
13
|
+
sizeMatches?: number | null;
|
|
11
14
|
noun: {
|
|
12
15
|
one: string;
|
|
13
16
|
many: string;
|
|
14
17
|
};
|
|
15
|
-
priceBounds
|
|
18
|
+
priceBounds?: {
|
|
16
19
|
min: number;
|
|
17
20
|
max: number;
|
|
18
21
|
} | null;
|
|
19
22
|
inStockCount: number | null;
|
|
20
|
-
onToggle: (key:
|
|
21
|
-
onPickType
|
|
22
|
-
onPickSize
|
|
23
|
-
onPriceMax
|
|
23
|
+
onToggle: (key: K, value: string) => void;
|
|
24
|
+
onPickType?: (kind: ProductKind | null) => void;
|
|
25
|
+
onPickSize?: (part: TyreSizePart, value: number | null) => void;
|
|
26
|
+
onPriceMax?: (value: number | null) => void;
|
|
24
27
|
onInStockOnly: (value: boolean) => void;
|
|
25
28
|
onClearAll: () => void;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
price?: {
|
|
30
|
+
label: string;
|
|
31
|
+
control: ReactNode;
|
|
29
32
|
};
|
|
33
|
+
foot?: ReactNode;
|
|
34
|
+
owner: RailOwner;
|
|
30
35
|
editing?: boolean;
|
|
31
36
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import E from"../catalog/ClearAllButton.js";import{useState as F}from"react";import{say as A}from"efficient-web-builder/format/lib/editor-words";import{useCurrency as _}from"../CurrencyContext.js";import{useEnglish as L}from"../EnglishVariant.js";import{formatPrice as g}from"../../lib/commerce.js";import{facetRow as M}from"../../lib/content/facet-row-seed.js";import{optionCardRows as R}from"../../lib/sections/filter-option-rows.js";import{hasActivePlpFilters as O,isDeadPlpOption as N,PLP_FACET_LABELS as D}from"../../lib/wheels/plp-filters.js";import I from"./PlpFacetRows.js";import U from"./PlpInStockToggle.js";import q from"./PlpTypePicker.js";import G from"./PlpTyreSizeBoxes.js";function H({facets:o,filters:t,typeOptions:c=[],sizeBoxes:m=null,sizeMatches:w=null,noun:s,priceBounds:n=null,inStockCount:x,onToggle:P,onPickType:S,onPickSize:C,onPriceMax:$,onInStockOnly:j,onClearAll:z,price:d,foot:h,owner:b,editing:y=!1}){const{currency:u}=_(),p=L(),[f,v]=F({});return r("aside",{className:"-mx-3 w-[calc(100%+1.5rem)] flex-none px-3 lg:sticky lg:[--sf-plp-rail-gap:16px] lg:[--sf-plp-rail-top:calc(var(--sf-header-h,88px)+var(--sf-plp-rail-gap))] lg:top-[var(--sf-plp-rail-top)] lg:max-h-[calc(100svh-var(--sf-plp-rail-top)-var(--sf-plp-rail-gap))] lg:w-[292px] lg:overflow-y-auto lg:overscroll-contain lg:pr-[22px]",children:[r("div",{className:"flex items-center justify-between pb-2",children:[e("h2",{className:"font-display text-[18px] font-medium uppercase tracking-[-0.01em]",children:A("Filter")}),O(t)&&e(E,{onClick:z,size:"text-[11px]"})]}),c.length>0&&e("div",{className:"pb-1 pt-1",children:e(q,{options:c,noun:s.many,onPick:S??(()=>{}),owner:b,editing:y})}),x!==null&&e("div",{className:"border-t border-line py-2",children:e(U,{checked:t.inStockOnly,count:x,noun:s.many,onChange:j})}),m&&e(k,{label:p(D.tyreSizes),open:!f.tyreSizes,onToggle:()=>v(l=>({...l,tyreSizes:!l.tyreSizes})),children:!f.tyreSizes&&e("div",{className:"pb-3",children:e(G,{boxes:m,composed:t.tyreSizes[0]??"",matches:w,noun:s.many,onPick:C??(()=>{})})})}),o.map(l=>{if(l.options.length===0)return null;const i=!f[l.key],T=R(l.options,{item:a=>M(a,a.checked),selected:a=>a.checked,press:a=>()=>P(l.key,a.value),label:a=>`${p(l.label)}: ${a.label} (${a.count} ${s.many})`,disabled:N});return e(k,{label:p(l.label),open:i,onToggle:()=>v(a=>({...a,[l.key]:!a[l.key]})),children:i&&e(I,{owner:b,rows:T,dead:l.options.map(N),label:p(l.label),className:"pb-3",editing:y})},l.key)}),d?r("div",{className:"border-t border-line py-3",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:d.label}),e("div",{className:"mt-2",children:d.control})]}):n&&r("div",{className:"border-t border-line py-3",children:[r("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:["Price · per ",s.one]}),e("input",{type:"range",min:n.min,max:n.max,step:5,value:t.priceMax??n.max,onChange:l=>{const i=Number(l.target.value);$?.(i>=n.max?null:i)},className:"mt-2 w-full accent-[var(--accent)]","aria-label":`Maximum price per ${s.one}`}),r("div",{className:"mt-1.5 flex justify-between font-mono text-[11px] tabular-nums",children:[e("span",{className:"text-fg-dim",children:g(n.min,u)}),r("span",{children:["Up to ",g(t.priceMax??n.max,u)]})]})]}),h&&e("div",{className:"border-t border-line py-3",children:h})]})}function k({label:o,open:t,onToggle:c,children:m}){return r("div",{className:"border-t border-line",children:[r("button",{type:"button",onClick:c,"aria-expanded":t,"aria-label":`${t?"Collapse":"Expand"} ${o} filters`,className:"flex w-full cursor-pointer items-center justify-between py-3 text-left",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.2em]",children:o}),e("span",{"aria-hidden":"true",className:`font-mono text-[10px] text-fg-dim transition-transform ${t?"rotate-180":""}`,children:"▾"})]}),m]})}export{H as default};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { SlotComponent } from "efficient-easel/blocks";
|
|
2
1
|
import { type PlpTypeOption } from "../../lib/wheels/plp-filters.js";
|
|
3
2
|
import type { ProductKind } from "../../lib/api/index.js";
|
|
3
|
+
import { type RailOwner } from "./PlpFacetRows.js";
|
|
4
4
|
export default function PlpTypePicker({ options, noun, onPick, owner, editing, }: {
|
|
5
5
|
options: PlpTypeOption[];
|
|
6
6
|
noun: string;
|
|
7
7
|
onPick: (kind: ProductKind | null) => void;
|
|
8
|
-
owner:
|
|
9
|
-
id: string;
|
|
10
|
-
facetTemplate?: SlotComponent;
|
|
11
|
-
};
|
|
8
|
+
owner: RailOwner;
|
|
12
9
|
editing?: boolean;
|
|
13
10
|
}): import("react").JSX.Element | null;
|
|
@@ -333,7 +333,9 @@ export declare const fitment: {
|
|
|
333
333
|
getStockFitment: (make: string, model: string, year: number, modification: string, region?: string) => Promise<StockFitment | null>;
|
|
334
334
|
};
|
|
335
335
|
export declare const products: {
|
|
336
|
-
listWheels: (process?: string | null, opts?: ListReadOpts
|
|
336
|
+
listWheels: (process?: string | null, opts?: ListReadOpts & {
|
|
337
|
+
maxRows?: number;
|
|
338
|
+
}) => Promise<WheelSummary[]>;
|
|
337
339
|
listWheelsBySlug: (slugs: readonly string[], opts?: ListReadOpts) => Promise<WheelSummary[]>;
|
|
338
340
|
listCatalog: (kinds: readonly ProductKind[], vehicle?: TyreFitVehicleQuery | null, opts?: {
|
|
339
341
|
maxRows?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as st,SITE_HOST_HEADER as nt,SITE_SLUG_HEADER as ot}from"../site-headers.js";import{PRODUCT_API_BASE as it,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ct,clientIpFromForwardedFor as dt,FORWARDED_FOR_HEADER as ut,hopCachingOf as lt}from"../forwarded-for.js";import pt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as yt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as x}from"../wheels/renderable-finishes.js";const ht=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="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.",ft=new Set([502,503,504]),I=0,gt="This editor runs on its host's own backend, which does not serve this request.",wt=5e3,mt=15e3,St=()=>typeof window>"u"?wt:mt;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(St())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ft.has(t)?N:e,Pt=["admin","venue"];let B="admin";function ie(t){B=Pt.includes(t)?t:"admin"}function Ot(){return B}const bt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&bt.test(t)?t:null}function At(){return q}function Tt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...g}=e;if(typeof window<"u"&&!yt())throw new m(I,gt,null);if(typeof window>"u"&&o===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"&&g.body instanceof FormData;let a;try{a=await fetch(`${o??ht}${Tt(t)}`,{...g,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:g.signal??H({...g,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}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=Rt().finally(()=>{b=null}),b)}async function Rt(){const t=P.takeLegacyRefresh(),e=await Et.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(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(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(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 z(){const t=await h("/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 Et={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 z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/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:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/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"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Ct,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as $t,isSvgUrl as _t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ut}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Nt,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Ct(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[w(l),p])):w(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",It=V?D:it,vt=Nt,O=()=>({baseUrl:vt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function kt(t,e){return k("/wheels",{process:t},e)}const Y=X;function Jt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Lt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Dt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1,o=()=>!1){const l=[];let p=null;try{for(let g=0;g<Z;g++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Dt(r.next),!p)break;if(o(l))return l}p&&console.warn(`[${t}] stopped at ${Z} pages (${l.length} rows); catalog may be truncated`)}catch(g){if(s(g))throw g;console.warn(`[${t}] product API unavailable, returning []`,g)}return l}const Q=t=>t instanceof m&&t.status===400;function tt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function et(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(nt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return dt((await t()).get(ut))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(ot)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await et();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Mt())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(st)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...g}=e??{},r=await u({...g,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([et(),Ht()]),o=ct(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(lt(t)),s={baseUrl:It,...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 o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={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:o}=await import("./fitment-data.js");return o.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,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(kt(t,o)),e.throwOnFailure?()=>!0:void 0);return U(w(s))},listWheelsBySlug:async(t,e={})=>{const s=[...new Set(t.map(r=>r.trim()).filter(Boolean))];if(s.length===0)return[];const o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(Jt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),g=l.flat().filter(r=>p.has(r.slug));return U(w(g))},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 o=await J("products.listCatalog",async l=>await f(Lt(t,e,l)),Q,s.maxRows===void 0?void 0:l=>tt([...l]).length>=s.maxRows);return tt(w(o))},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:o}=await import("./gallery-builds-data.js");return w(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},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)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(o,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(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},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=>h(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"),o=e.toString();try{return await i(await f(o?`${s}?${o}`: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 j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(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 L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&_t(s)){const p=await $t(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={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 jt 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 o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${$(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt 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 Xt(){const t=Ut();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",rt=pt.contentHash,_={"X-Media-Manifest":rt,[Zt]:rt},ge=at({});function at(t){return(e,s={})=>{const o=At(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Ot()})}}function Yt(t={}){const e=at(t),s=t.siteDrafts===!0,o=r=>C("header-settings",r,s),l=r=>C("theme-settings",r,s),p=r=>C("chat-settings",r,s),g=r=>C("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{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,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:_,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:_,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:_,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.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 n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{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 n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},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,n)=>e(l(n),{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,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(g(a),{token:r}),updateSocialSettings:(r,a,n)=>e(g(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{ht as API_URL,jt as AmbiguousPageSlugError,m as ApiError,mt as BROWSER_READ_TIMEOUT_MS,gt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,wt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Et as api,i as apiFetch,E as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Ot as editorPortalAudience,At as editorRequestLanguage,ye as fitment,he as products,St as readDeadlineMs,Ht as resolveClientIp,w as resolveMediaUrls,qt as resolvePreviewToken,et as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as st,SITE_HOST_HEADER as nt,SITE_SLUG_HEADER as ot}from"../site-headers.js";import{PRODUCT_API_BASE as it,PRODUCT_BACKEND_URL as D}from"./origins.js";import{backendHopHeaders as ct,clientIpFromForwardedFor as dt,FORWARDED_FOR_HEADER as ut,hopCachingOf as lt}from"../forwarded-for.js";import pt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as yt}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 ht=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const N="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.",ft=new Set([502,503,504]),I=0,gt="This editor runs on its host's own backend, which does not serve this request.",wt=5e3,mt=15e3,St=()=>typeof window>"u"?wt:mt;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(St())}const F=t=>t instanceof Error&&t.name==="TimeoutError",M=(t,e)=>ft.has(t)?N:e,Pt=["admin","venue"];let B="admin";function ie(t){B=Pt.includes(t)?t:"admin"}function Ot(){return B}const bt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let q=null;function ce(t){q=t&&bt.test(t)?t:null}function At(){return q}function Tt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=K();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...g}=e;if(typeof window<"u"&&!yt())throw new m(I,gt,null);if(typeof window>"u"&&o===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"&&g.body instanceof FormData;let a;try{a=await fetch(`${o??ht}${Tt(t)}`,{...g,headers:{...r?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:g.signal??H({...g,audience:p})})}catch(y){throw y instanceof TypeError||F(y)?new m(I,N,null):y}let n;try{n=await a.text()}catch(y){throw F(y)?new m(I,N,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(a.status,a.ok?"Expected JSON but received a non-JSON response":M(a.status,a.statusText),n)}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=Rt().finally(()=>{b=null}),b)}async function Rt(){const t=P.takeLegacyRefresh(),e=await Et.refresh(t??void 0);return P.setTokens(e.access),e.access}async function W(){return P.getAccess()??G()}async function h(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(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await G();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function j(t,e={}){if(P.getAccess())try{return{data:await h(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 z(){const t=await h("/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 Et={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 z(),t},me:z,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/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:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/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"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as Ct,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as $t,isSvgUrl as _t}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Ut}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Nt,webRuntimeSiteSlug as K}from"efficient-web-builder/format/lib/web-runtime";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Ct(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[w(l),p])):w(o);return e}return t}import{PRODUCT_API_BASE as Pe}from"./origins.js";const V=typeof window>"u"&&D!=="",It=V?D:it,vt=Nt,O=()=>({baseUrl:vt(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const X=100,Z=50;function k(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(X)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function kt(t,e){return k("/wheels",{process:t},e)}const Y=X;function Jt(t,e){return k("/wheels",{slug:t.join(",")},e)}function Lt(t,e,s){return k("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function Dt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,s=()=>!1,o=()=>!1){const l=[];let p=null;try{for(let g=0;g<Z;g++){const r=await i(await e(p),await u());if(l.push(...r.results),p=Dt(r.next),!p)break;if(o(l))return l}p&&console.warn(`[${t}] stopped at ${Z} pages (${l.length} rows); catalog may be truncated`)}catch(g){if(s(g))throw g;console.warn(`[${t}] product API unavailable, returning []`,g)}return l}const Q=t=>t instanceof m&&t.status===400;function tt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?E([e]):[e])}async function et(){return(await xt()).host}async function xt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(nt)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Ht(){try{const{headers:t}=await import("next/headers");return dt((await t()).get(ut))}catch{return null}}async function Ft(){try{const{headers:t}=await import("next/headers");return(await t()).get(ot)||null}catch{return null}}async function Mt(){const t=await Ft();if(t)return`site=${encodeURIComponent(t)}`;const e=await et();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=K();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await Mt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Bt="preview";async function qt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(st)}catch{return null}}async function Gt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function L(t,e){const s=await qt();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Bt}=${encodeURIComponent(s)}`),{next:l,cache:p,...g}=e??{},r=await u({...g,cache:"no-store"}),a=await Gt();return a&&(r.headers={...r.headers,"user-agent":a}),[o,r]}async function Wt(t){if(!V)return;const[e,s]=await Promise.all([et(),Ht()]),o=ct(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Wt(lt(t)),s={baseUrl:It,...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 o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const ye={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:o}=await import("./fitment-data.js");return o.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,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},he={listWheels:async(t,e={})=>{const s=await J("products.listWheels",async o=>await f(kt(t,o)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:o=>E([...o]).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 o=[];for(let r=0;r<s.length;r+=Y)o.push(s.slice(r,r+Y));const l=await Promise.all(o.map(r=>J("products.listWheelsBySlug",async a=>await f(Jt(r,a)),e.throwOnFailure?()=>!0:Q))),p=new Set(s),g=l.flat().filter(r=>p.has(r.slug));return E(w(g))},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 o=await J("products.listCatalog",async l=>await f(Lt(t,e,l)),Q,s.maxRows===void 0?void 0:l=>tt([...l]).length>=s.maxRows);return tt(w(o))},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:o}=await import("./gallery-builds-data.js");return w(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return w(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},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)}`:"",[o,l]=await L(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(o,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(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},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=>h(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"),o=e.toString();try{return await i(await f(o?`${s}?${o}`: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 j(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await j(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 L(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&_t(s)){const p=await $t(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await L(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},fe={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 jt 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 $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},_=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,zt=t=>`${_(t)}currencies/`,Kt="/api/storefront/media/ingest/";class Vt 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 Xt(){const t=Ut();if(!t)throw new Vt;return`${Kt}?${new URLSearchParams({site:t})}`}const Zt="X-Puck-Media-Manifest",rt=pt.contentHash,U={"X-Media-Manifest":rt,[Zt]:rt},ge=at({});function at(t){return(e,s={})=>{const o=At(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??Ot()})}}function Yt(t={}){const e=at(t),s=t.siteDrafts===!0,o=r=>$("header-settings",r,s),l=r=>$("theme-settings",r,s),p=r=>$("chat-settings",r,s),g=r=>$("social-settings",r,s);return{findPageBySlug:async(r,a,n)=>{const c=new URLSearchParams({slug:r});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:a}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new jt(r,S.length);return S[0]??null},getPageById:(r,a)=>e(`/api/storefront/pages/${r}/`,{token:a}),saveLayout:(r,a,n,c,y)=>e(`/api/storefront/pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(r,a,n)=>e(`/api/storefront/pages/${r}/duplicate/`,{method:"POST",body:JSON.stringify({title:a.title,slug:a.slug}),token:n}),geocode:(r,a,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:r,country:n}:{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,n,c=!1)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:a}),releasePageEditLock:(r,a)=>e(`/api/storefront/pages/${r}/edit-lock/`,{method:"DELETE",token:a}),createTemplate:(r,a,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:r,layout:a}),headers:U,token:n}),getTemplate:(r,a)=>e(`/api/storefront/page-templates/${r}/`,{token:a}),saveTemplateLayout:(r,a,n)=>e(`/api/storefront/page-templates/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:n}),listTemplatePages:async(r,a)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(r,a,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(r)}&slug=${encodeURIComponent(a)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(r,a,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:r,...a}),headers:U,token:n}),saveTemplatePageLayout:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"PATCH",body:JSON.stringify({layout:a}),headers:U,token:n}),deleteTemplatePage:(r,a,n)=>e(`/api/storefront/template-pages/${r}/`,{method:"DELETE",token:a,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},createPage:(r,a,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:r,slug:a,layout:n}),token:c}),deletePage:(r,a)=>e(`/api/storefront/pages/${r}/`,{method:"DELETE",token:a}),getHeaderSettings:(r,a)=>e(o(a),{token:r}),listMenus:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("site",a);const c=await e(`/api/storefront/menus/?${n}`,{token:r});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(r,a)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(r,a={})=>{const n=new URLSearchParams({no_page:"true"});a.visibleOnly&&n.set("is_visible","true"),a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/categories/?${n.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 n=new URLSearchParams({no_page:"true"});a.siteId&&n.set("site",a.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:r});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(r,a={})=>{const n=new URLSearchParams;a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:r});return w(y)},listProducts:async(r,a={})=>{const n=new URLSearchParams;a.kinds?.length&&n.set("kind",a.kinds.join(",")),a.siteId&&n.set("site",a.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:r});return w(y)},getWheelDetail:async(r,a,n={})=>{const c=new URLSearchParams({slug:a});return n.siteId&&c.set("site",n.siteId),x(w(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:r})))},updateHeaderSettings:(r,a,n)=>e(o(n),{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 n=await e(zt(r),{token:a});return Array.isArray(n)?n:[]},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,n)=>e(l(n),{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,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(r),token:a}),getSocialSettings:(r,a)=>e(g(a),{token:r}),updateSocialSettings:(r,a,n)=>e(g(n),{method:"PATCH",body:JSON.stringify(r),token:a}),uploadHeaderLogo:(r,a,n)=>{const c=new FormData;return c.append("logo",r),e(o(n),{method:"PATCH",body:c,token:a})},clearHeaderLogo:(r,a)=>e(o(a),{method:"PATCH",body:JSON.stringify({logo:null}),token:r}),setHeaderLogoFromAsset:(r,a,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:r}),token:a}),uploadMedia:async(r,a)=>{const n=new FormData;return n.append("file",r),e(Xt(),{method:"POST",body:n,token:a})},listMedia:async(r,a)=>{const n=new URLSearchParams({no_page:"true"});a&&n.set("kind",a);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:r});return Array.isArray(c)?c:c.results??[]}}}const we=Yt({siteDrafts:!0});export{ht as API_URL,jt as AmbiguousPageSlugError,m as ApiError,mt as BROWSER_READ_TIMEOUT_MS,gt as EFFICIENT_CLIENT_CLOSED_MESSAGE,Vt as MediaUploadDestinationError,Bt as PREVIEW_PARAM,Pe as PRODUCT_API_BASE,wt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,ge as adminFetch,Et as api,i as apiFetch,C as appendSiteQuery,fe as bookings,Yt as createStorefrontAdmin,H as defaultRequestDeadline,Xt as editorMediaUploadPath,Ot as editorPortalAudience,At as editorRequestLanguage,ye as fitment,he as products,St as readDeadlineMs,Ht as resolveClientIp,w as resolveMediaUrls,qt as resolvePreviewToken,et as resolveSiteHost,xt as resolveSiteHostSource,Ft as resolveSiteSlug,ce as setEditorLanguage,ie as setEditorPortalAudience,we as storefrontAdmin};
|
|
@@ -1549,6 +1549,7 @@ export interface components {
|
|
|
1549
1549
|
};
|
|
1550
1550
|
cornerStyle: "square" | "small" | "large";
|
|
1551
1551
|
cornerRadiusPx?: number | null;
|
|
1552
|
+
cornerRadiusUnit?: "px" | "vw" | null;
|
|
1552
1553
|
cardShadow: "none" | "soft" | "lifted";
|
|
1553
1554
|
shadowColor: string;
|
|
1554
1555
|
cardGap: "tight" | "normal" | "roomy";
|
|
@@ -1571,8 +1572,15 @@ export interface components {
|
|
|
1571
1572
|
};
|
|
1572
1573
|
textStyles?: components["schemas"]["ThemeTextStyle"][] | null;
|
|
1573
1574
|
siteWidth: number;
|
|
1575
|
+
siteWidthUnit?: "px" | "%" | "vw" | null;
|
|
1574
1576
|
siteGutter: number;
|
|
1577
|
+
siteGutterUnit?: "px" | "%" | "vw" | null;
|
|
1578
|
+
siteGutterPhone?: number | null;
|
|
1579
|
+
siteGutterPhoneUnit?: "px" | "%" | "vw" | null;
|
|
1575
1580
|
blockGap?: number | null;
|
|
1581
|
+
blockGapUnit?: "px" | "%" | "vw" | null;
|
|
1582
|
+
blockGapPhone?: number | null;
|
|
1583
|
+
blockGapPhoneUnit?: "px" | "%" | "vw" | null;
|
|
1576
1584
|
heroBackgroundFollowsWidth: boolean;
|
|
1577
1585
|
sectionBackgroundWidth: "full" | "content" | null;
|
|
1578
1586
|
sectionContentWidth: "full" | "content" | null;
|
|
@@ -1598,14 +1606,32 @@ export interface components {
|
|
|
1598
1606
|
font?: string;
|
|
1599
1607
|
color?: string;
|
|
1600
1608
|
size?: number;
|
|
1609
|
+
sizeTablet?: number;
|
|
1601
1610
|
sizePhone?: number;
|
|
1611
|
+
sizeUnit?: "px" | "vw";
|
|
1612
|
+
sizeUnitTablet?: "px" | "vw";
|
|
1613
|
+
sizeUnitPhone?: "px" | "vw";
|
|
1602
1614
|
weight?: number;
|
|
1603
1615
|
italic?: boolean;
|
|
1604
1616
|
lineHeight?: number;
|
|
1617
|
+
lineHeightTablet?: number;
|
|
1618
|
+
lineHeightPhone?: number;
|
|
1605
1619
|
letterSpacing?: number;
|
|
1620
|
+
letterSpacingTablet?: number;
|
|
1621
|
+
letterSpacingPhone?: number;
|
|
1606
1622
|
paragraphSpacing?: number;
|
|
1623
|
+
paragraphSpacingTablet?: number;
|
|
1624
|
+
paragraphSpacingPhone?: number;
|
|
1625
|
+
paragraphSpacingUnit?: "px" | "%" | "vw";
|
|
1626
|
+
paragraphSpacingUnitTablet?: "px" | "%" | "vw";
|
|
1627
|
+
paragraphSpacingUnitPhone?: "px" | "%" | "vw";
|
|
1607
1628
|
letterCase?: "none" | "upper" | "capitalize" | "lower";
|
|
1608
1629
|
largestSize?: number;
|
|
1630
|
+
largestSizeTablet?: number;
|
|
1631
|
+
largestSizePhone?: number;
|
|
1632
|
+
largestSizeUnit?: "px" | "vw";
|
|
1633
|
+
largestSizeUnitTablet?: "px" | "vw";
|
|
1634
|
+
largestSizeUnitPhone?: "px" | "vw";
|
|
1609
1635
|
};
|
|
1610
1636
|
WordStyle: {
|
|
1611
1637
|
font?: string | null;
|
|
@@ -1635,6 +1661,7 @@ export interface components {
|
|
|
1635
1661
|
logoPosition: "left" | "center" | "right";
|
|
1636
1662
|
logoSize: "small" | "medium" | "large";
|
|
1637
1663
|
logoSizePx: number | null;
|
|
1664
|
+
logoSizeUnit?: "px" | "%" | "vw" | null;
|
|
1638
1665
|
reverseLogo: boolean;
|
|
1639
1666
|
menuHandle: string | null;
|
|
1640
1667
|
menuItems: {
|
|
@@ -1649,6 +1676,7 @@ export interface components {
|
|
|
1649
1676
|
menuSplit: number;
|
|
1650
1677
|
menuRow: "top" | "bottom" | "inline";
|
|
1651
1678
|
menuGapPx?: number | null;
|
|
1679
|
+
menuGapUnit?: "px" | "%" | "vw" | null;
|
|
1652
1680
|
searchEnabled: boolean;
|
|
1653
1681
|
searchPosition: "left" | "right";
|
|
1654
1682
|
searchRow: "top" | "bottom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_HIDE_WHEN_ROW_EMPTY as
|
|
1
|
+
import{BOX_HIDE_WHEN_ROW_EMPTY as C,CARD_ROW_LINK_PROP as E}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as l}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as n}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as S,DIM as r,INNER_BOX as b,TEXT as c,boxPadding as d,labelStyle as N,seedNodes as f,token as O}from"efficient-web-builder/format/lib/document/seed-parts";const h="template",_="reasonTemplate",L="channelTemplate",y={key:"title",label:"Title",plain:!0},$=[{key:"eyebrow",label:"Eyebrow",plain:!0},y,{key:"copy",label:"Body",multiline:!0},{key:"response",label:"Response time"}],M=[y],V=[{key:"label",label:"Label",plain:!0},{key:"value",label:"Value",plain:!0},{key:"sub",label:"Sub line",plain:!0},{key:"href",label:"Link",kind:"link"}],Y=["Text","ImageBlock",o],p=(e,t)=>({...N(e),letterSpacing:t,lineHeight:1.5}),m={...p(12,.24),color:"main"},P={textStyle:"heading-3",...O("headingSmall",26),weight:500,case:"upper",lineHeight:1.05,letterSpacing:-.02},x={textStyle:"heading-1",...O("body",14),weight:400,case:"none",lineHeight:1.5,letterSpacing:0,color:"muted"},u=p(12,.22),w=p(12,.2),A={...p(12,.3),color:"main"},R={textStyle:"heading-3",...O("headingSmall",24),weight:500,case:"none",lineHeight:1.2,letterSpacing:-.02},H={...p(12,.2),color:"muted"},s=(e,t,i={})=>({...b,name:e,gap:t,gapPhone:t,...i}),I=()=>({type:o,props:s("Topic",16,{justify:"between",...d(40,32),sectionHeightMode:"fixed",sectionHeightValue:240,sectionHeightUnit:"px"}),slots:{[l]:[{type:o,props:s("Head",16),slots:{[l]:[n("eyebrow",{...c,tag:"p",widthFit:"fill"},m),n("title",{...c,tag:"h3",widthFit:"fill"},P)]}},{type:o,props:s("Foot",24),slots:{[l]:[n("copy",{...r,tag:"p",widthFit:"fill"},x),{type:o,props:{...S,name:"Response",direction:"row",justify:"between",align:"center",gap:16,gapPhone:16,phoneRow:2,sharePhone:"content",wrapPhone:"nowrap",...d(0,0),sectionPaddingTop:16,sectionPaddingTopPhone:16,sectionBorder:{top:1},[C]:["response"]},slots:{[l]:[{type:"Text",props:{...r,tag:"p",text:"Response",_partStyles:{text:u}}},n("response",{...c,tag:"p"},u)]}}]}}]}}),B=()=>({type:o,props:{...s("Reason",0),...d(12,16),sectionBorder:{width:1}},slots:{[l]:[n("title",{...r,tag:"p"},w)]}}),k=()=>({type:o,props:{...s("Channel",12),...d(32,20,20,20),sectionPaddingLeft:22,sectionPaddingTopTablet:20,sectionPaddingRightTablet:20,sectionPaddingBottomTablet:20,sectionPaddingLeftTablet:20,sectionBorder:{bottom:1}},slots:{[l]:[n("label",{...c,tag:"p",widthFit:"fill"},A),{type:o,props:{...s("Value",0),[E]:"href"},slots:{[l]:[n("value",{...c,tag:"p",widthFit:"fill"},R)]}},n("sub",{...r,tag:"p",widthFit:"fill"},H)]}});function g(e,t,i){return f([e],(T,a)=>a==="0"?`${t}~${i}`:`${t}~${i}.${a.slice(2)}`)}const F=e=>typeof e.id=="string"&&e.id.trim()?e.id:"ContactRouting";function U(e){const t=e[h]===void 0,i=e[_]===void 0,T=e[L]===void 0;if(!t&&!i&&!T)return e;const a=F(e);return{...e,...t?{[h]:g(I(),a,"topic")}:{},...i?{[_]:g(B(),a,"reason")}:{},...T?{[L]:g(k(),a,"channel")}:{}}}export{V as CONTACT_CHANNEL_FIELDS,L as CONTACT_CHANNEL_SLOT,M as CONTACT_REASON_FIELDS,_ as CONTACT_REASON_SLOT,Y as CONTACT_TEMPLATE_ALLOW,$ as CONTACT_TOPIC_FIELDS,h as CONTACT_TOPIC_SLOT,k as contactChannelSeed,B as contactReasonSeed,I as contactTopicSeed,U as withContactTemplates};
|
|
@@ -126,6 +126,20 @@ export declare const NAMED_EXCEPTIONS: readonly [{
|
|
|
126
126
|
readonly reason: "The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.";
|
|
127
127
|
readonly owner: "storefront sections owner";
|
|
128
128
|
readonly due: "2026-12-18";
|
|
129
|
+
}, {
|
|
130
|
+
readonly part: "Tick box";
|
|
131
|
+
readonly kind: "corner";
|
|
132
|
+
readonly value: 2;
|
|
133
|
+
readonly reason: "The browser's own checkbox corners (2 px on 16 px), below the shell's smallest corner step (--radius-sm 4 px); kept so the tick box keeps the rail's look.";
|
|
134
|
+
readonly owner: "storefront sections owner";
|
|
135
|
+
readonly due: "2026-12-18";
|
|
136
|
+
}, {
|
|
137
|
+
readonly part: "Tick";
|
|
138
|
+
readonly kind: "corner";
|
|
139
|
+
readonly value: 1;
|
|
140
|
+
readonly reason: "The tick box's ground inside its 1 px ring follows the box's 2 px corners (2 - 1).";
|
|
141
|
+
readonly owner: "storefront sections owner";
|
|
142
|
+
readonly due: "2026-12-18";
|
|
129
143
|
}, {
|
|
130
144
|
readonly part: "aside";
|
|
131
145
|
readonly kind: "padding";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_SWATCH_PROP as
|
|
1
|
+
import{BOX_SWATCH_PROP as c}from"efficient-web-builder/format/lib/content/box-background";import{BOX_ROW_IMAGE_PROP as C}from"efficient-web-builder/format/lib/content/box-card-rule";import{BOX_HIDE_WHEN_ROW_EMPTY as l}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as t,CONTAINER_BLOCKS_SLOT as r}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as f}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as y,DIM as R,INNER_BOX as d,TEXT as m,boxPadding as i,seedNodes as E}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as p,squareBox as T}from"./square-box.js";const h="facetTemplate",X="Filter option template",z=[{key:"facetLabel",label:"Filter option"},{key:"facetName",label:"Type name"},{key:"facetCount",label:"Option count"},{key:"facetColour",label:"Option colour",kind:"colour"},{key:"facetTickFill",label:"Tick box fill",kind:"colour"},{key:"facetTick",label:"Tick mark",kind:"image"},{key:"facetTickMark",label:"Tick box shown"},{key:"facetRadioMark",label:"Round mark shown"},{key:"facetDot",label:"Round mark dot",kind:"colour"}],O="sf-facet-tick-picture",v="data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%271%200.75%2014%2014%27%20id%3D%27"+O+"%27%3E%3Cpath%20d%3D%27M3.2%208%206.4%2011.2%2012.8%203.2%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%272.56%27%2F%3E%3C%2Fsvg%3E",H="--sf-facet-tick",G="[&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-image:none]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[background-color:var(--accent-ink)]! [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[-webkit-mask:var(--sf-facet-tick)_center/cover_no-repeat] [&_[data-sf-card-state~=selected]_.sf-card[style*=sf-facet-tick-picture]]:[mask:var(--sf-facet-tick)_center/cover_no-repeat]";function U(e,n){return{facetLabel:e.label,facetName:"",facetCount:String(e.count),facetColour:e.swatch??"",facetTickFill:n?"main":"",facetTick:n?v:"",facetTickMark:"tick",facetRadioMark:"",facetDot:""}}function $(e,n){return{facetLabel:"",facetName:e.label,facetCount:String(e.count),facetColour:"",facetTickFill:n?"main":"",facetTick:"",facetTickMark:"",facetRadioMark:"radio",facetDot:n?"main":""}}const Y=["Text","ImageBlock",t],x={...y,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},k=13,s=10,w=2,g=1,o="2026-12-18",a="storefront sections owner",j=[{part:"facetLabel",kind:"size",value:k,reason:"The old rail's option words were 13 px; kept so no facet word moves.",owner:a,due:o},{part:"facetName",kind:"size",value:k,reason:"A type's name takes the facet words' 13 px, so the type picker has the same rail look.",owner:a,due:o},{part:"Option",kind:"gap",value:s,reason:"The old rail's 10 px between the option and its count; kept so no word moves.",owner:a,due:o},{part:"Choice",kind:"gap",value:s,reason:"The old rail's 10 px between tick box, dot and words; kept so no word moves.",owner:a,due:o},{part:"Tick box",kind:"padding",value:1,reason:"The 1 px ring round the tick box, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio",kind:"padding",value:1,reason:"The 1 px ring round the round mark, drawn as the Box's own Fill inside 1 px padding.",owner:a,due:o},{part:"Radio ground",kind:"padding",value:3,reason:"The 3 px between the round mark's ring and its 8 px dot, as the browser's own radio.",owner:a,due:o},{part:"Tick",kind:"box",value:14,reason:"The tick box's ground inside its 1 px ring: 16 px less the ring each side, the browser's own checkbox size.",owner:a,due:o},{part:"Radio ground",kind:"box",value:14,reason:"The round mark's ground inside its 1 px ring: 16 px less the ring each side, the browser's own radio size.",owner:a,due:o},{part:"Ring",kind:"box",value:13,reason:"The colour dot's 1 px ring as the old rail drew it (13 px round); kept so no swatch or word moves.",owner:a,due:o},{part:"Colour",kind:"box",value:11,reason:"The colour dot inside its 1 px ring (13 px less the ring each side), as the old rail drew it.",owner:a,due:o},{part:"Tick box",kind:"corner",value:w,reason:"The browser's own checkbox corners (2 px on 16 px), below the shell's smallest corner step (--radius-sm 4 px); kept so the tick box keeps the rail's look.",owner:a,due:o},{part:"Tick",kind:"corner",value:g,reason:"The tick box's ground inside its 1 px ring follows the box's 2 px corners (2 - 1).",owner:a,due:o},{part:"aside",kind:"padding",value:22,reason:"The rail box's right padding at lg (PlpSidebar lg:pr-[22px]): 12 px room for the picked frame plus main's 10 px scrollbar room, so the content stays main's 258 px wide.",owner:a,due:o}],A={size:k,case:"capitalize",lineHeight:1.5},F={size:k,case:"none",lineHeight:1.5},L={textStyle:"body-5",size:11,case:"none",letterSpacing:0,lineHeight:1.5},_="muted",b="surface",N=()=>({type:t,props:{...x,name:"Option",justify:"between",gap:s,gapPhone:s,...i(4,12)},slots:{[r]:[{type:t,props:{...x,name:"Choice",gap:s,gapPhone:s,minWidth:0},slots:{[r]:[{type:t,props:{...d,name:"Tick mark",[l]:["facetTickMark"]},slots:{[r]:[{type:t,props:{...T(16,{sectionCorners:w,fillColor:_,[c]:"facetTickFill",...i(1,1)}),name:"Tick box"},slots:{[r]:[{type:t,props:{...T(14,{sectionCorners:g,fillColor:b,[c]:"facetTickFill",[C]:"facetTick",...i(0,0)}),name:"Tick"}}]}}]}},{type:t,props:{...d,name:"Round mark",[l]:["facetRadioMark"]},slots:{[r]:[{type:t,props:{...p(16,{fillColor:_,[c]:"facetTickFill",...i(1,1)}),name:"Radio"},slots:{[r]:[{type:t,props:{...p(14,{fillColor:b,...i(3,3)}),name:"Radio ground"},slots:{[r]:[{type:t,props:{...p(8,{[c]:"facetDot",...i(0,0)}),name:"Dot"}}]}}]}}]}},{type:t,props:{...d,name:"Swatch",[l]:["facetColour"]},slots:{[r]:[{type:t,props:{...p(13,{sectionBorder:{width:1}}),name:"Ring"},slots:{[r]:[{type:t,props:{...p(11,{[c]:"facetColour"}),name:"Colour"}}]}}]}},{type:t,props:{...d,name:"Label",[l]:["facetLabel"]},slots:{[r]:[f("facetLabel",{...m,tag:"span",minWidth:0},A)]}},{type:t,props:{...d,name:"Name",[l]:["facetName"]},slots:{[r]:[f("facetName",{...m,tag:"span",minWidth:0},F)]}}]}},f("facetCount",{...R,tag:"span"},L)]}});function P(e){return E([N()],(n,u)=>u==="0"?`${e}~facet`:`${e}~facet.${u.slice(2)}`)}function q(e){if(e[h]!==void 0)return e;const n=typeof e.id=="string"&&e.id.trim()?e.id:"AlloyWheelsListing";return{...e,[h]:P(n)}}export{z as FACET_ROW_FIELDS,Y as FACET_TEMPLATE_ALLOW,X as FACET_TEMPLATE_LABEL,h as FACET_TEMPLATE_SLOT,v as FACET_TICK,G as FACET_TICK_INK_CLASS,O as FACET_TICK_MARK,H as FACET_TICK_VAR,j as NAMED_EXCEPTIONS,U as facetRow,P as facetRowSeed,$ as typeRow,q as withFacetTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CARD_LIST_TYPE as
|
|
1
|
+
import{CARD_LIST_TYPE as s,CARD_ROW_FIELD_PROP as h}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as n,CONTAINER_BLOCKS_SLOT as p}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as f,DIM as m,INNER_BOX as L,TEXT as l,boxPadding as O,labelStyle as E,seedNodes as T}from"efficient-web-builder/format/lib/document/seed-parts";const I="options",y=["Text","ImageBlock",n,s],A=["Text","ImageBlock",n],a=(t,e)=>({...E(t),letterSpacing:e,lineHeight:1.2}),P=a(12,.32),_=a(12,.18),d={...a(11,.14),color:"main"},c=(t,e,i={})=>({...f,direction:"row",align:"center",gap:t,gapPhone:t,phoneRow:2,sharePhone:"content",...e?{wrapPhone:"nowrap"}:{},...i}),w=()=>({type:n,props:{...c(8,!0),name:"Option",...O(8,12),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},_),r("count",{...m,tag:"p"},_)]}});function x(t){const e=o=>o==="0"?`${t}~group`:`${t}~group.${o.slice(2)}`,i={type:n,props:{...L,name:"Group",gap:12,gapPhone:12},slots:{[p]:[r("label",{...m,tag:"p"},P),{type:n,props:{...c(8,!1,{align:"start",wrap:!0}),name:"Options"},slots:{[p]:[{type:s,props:{[h]:I},slots:{template:[w()]}}]}}]}};return T([i],(o,g)=>e(g))}function C(t){const e={type:n,props:{...c(8,!0),name:"Chip",...O(4,8),sectionBorder:{width:1}},slots:{[p]:[r("label",{...l,tag:"p"},d),r("mark",{...l,tag:"p"},d)]}};return T([e],(i,o)=>o==="0"?`${t}~chip`:`${t}~chip.${o.slice(2)}`)}const u=(t,e)=>typeof t.id=="string"&&t.id.trim()?t.id:e;function N(t){return t.template!==void 0?t:{...t,template:x(u(t,"FilterBlock"))}}function b(t){return t.template!==void 0?t:{...t,template:C(u(t,"FilterChipsBlock"))}}export{A as FILTER_CHIPS_TEMPLATE_ALLOW,I as FILTER_OPTIONS_FIELD,y as FILTER_TEMPLATE_ALLOW,x as filterCardSeed,C as filterChipSeed,b as withFilterChipsTemplate,N as withFilterTemplate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as
|
|
1
|
+
import{BOX_SWATCH_PROP as d}from"efficient-web-builder/format/lib/content/box-background";import{BOX_HIDE_WHEN_ROW_EMPTY as s}from"efficient-web-builder/format/lib/content/card-template";import{BOX_TYPE as o,CONTAINER_BLOCKS_SLOT as i}from"efficient-web-builder/format/lib/document/container-blocks";import{rowFieldTextSeed as r}from"efficient-web-builder/format/lib/document/blocks/general/Cards/card-seed";import{BOX as O,DIM as _,INNER_BOX as l,TEXT as c,boxPadding as p,labelStyle as h,seedNodes as T}from"efficient-web-builder/format/lib/document/seed-parts";import{roundBox as w}from"./square-box.js";const m="optionTemplate",B="Option template",H=[{key:"swatch",label:"Finish colour",kind:"colour"},{key:"name",label:"Finish name"},{key:"label",label:"Option"},{key:"note",label:"Option note"}],R=["Text",o],a=(e,t,n={})=>({...h(e),letterSpacing:t,lineHeight:1.5,...n}),E={...O,direction:"row",align:"center",phoneRow:2,sharePhone:"content",wrapPhone:"nowrap"},P=()=>({type:o,props:{...O,direction:"column",name:"Option",...p(12,12),sectionBorder:{width:2}},slots:{[i]:[{type:o,props:{...E,name:"Finish",gap:12,gapPhone:12,[s]:["swatch"]},slots:{[i]:[{type:o,props:{...l,name:"Swatch"},slots:{[i]:[{type:o,props:{...w(20,{...p(0,0),sectionBorder:{width:1},[d]:"swatch"}),name:"Dot"}}]}},r("name",{...c,tag:"span",minWidth:0},a(12,.18,{weight:700}))]}},{type:o,props:{...l,name:"Words",gap:4,gapPhone:4,...p(0,4),[s]:["label"]},slots:{[i]:[r("label",{...c,tag:"span"},a(14,.18)),r("note",{..._,tag:"span"},a(11,.12))]}}]}});function g(e){return T([P()],(t,n)=>n==="0"?`${e}~option`:`${e}~option.${n.slice(2)}`)}function b(e){if(e[m]!==void 0)return e;const t=typeof e.id=="string"&&e.id.trim()?e.id:"ProductHero";return{...e,[m]:g(t)}}export{R as HERO_OPTION_ALLOW,H as HERO_OPTION_FIELDS,m as HERO_OPTION_SLOT,B as HERO_OPTION_SLOT_LABEL,g as heroOptionSeed,b as withHeroOptionTemplate};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{markBoxProps as e}from"efficient-web-builder/format/lib/document/seed-parts";const t=(o,r={})=>{const{fillColor:s,...n}=e(o,void 0);return{...n,...r}},c=(o,r={})=>t(o,{sectionCorners:Math.ceil(o/2),...r});export{c as roundBox,t as squareBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as l}from"react/jsx-runtime";import r from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as n}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{PAGE_TITLE_LEVEL_PROP as r}from"efficient-web-builder/format/lib/document/one-h1";import m from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as n}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as g,listingHiddenFacets as f}from"../../../../wheels/plp-filters.js";import{cardHoverOf as h}from"efficient-web-builder/format/lib/animation/hover";import{phHide as a}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as c}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as s}from"../../../../content/facet-row-seed.js";import{AlloyWheelsListingMeta as L,ALLOYWHEELSLISTING_PH as d}from"./meta.js";const k={...L,render:e=>{const t=c(e),i=o=>t?void 0:o;return l(m,{titleLevel:e[r],heading:i(a(e.heading,d.heading,e.editor)),intro:i(a(e.intro,d.intro,e.editor)),omitHead:t,askForCar:e.askForCar!==!1,gateHeading:n(e.gateHeading),gateIntro:n(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:g(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[s],hover:h(e,"AlloyWheelsListing"),hiddenFacets:f(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}};export{k as AlloyWheelsListingRender};
|
|
@@ -4,5 +4,9 @@ export declare const FilterBlockSlots: {
|
|
|
4
4
|
type: "slot";
|
|
5
5
|
allow: ("Flex" | "Text" | "ImageBlock" | "CardList")[];
|
|
6
6
|
};
|
|
7
|
+
facetTemplate: {
|
|
8
|
+
type: "slot";
|
|
9
|
+
allow: ("Flex" | "Text" | "ImageBlock")[];
|
|
10
|
+
};
|
|
7
11
|
};
|
|
8
12
|
export declare const FilterBlockMeta: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{phoneKey as o}from"efficient-easel/draw";import{
|
|
1
|
+
import{phoneKey as o}from"efficient-easel/draw";import{FACET_TEMPLATE_ALLOW as t,FACET_TEMPLATE_SLOT as l}from"../../../../content/facet-row-seed.js";import{FILTER_TEMPLATE_ALLOW as e}from"../../../../content/filter-card-seed.js";import{DEFAULT_FILTER_LOOK as r,DEFAULT_FILTER_LOOK_PHONE as E,DEFAULT_OPENING_SORT as L,DEFAULT_SHOWN_FILTERS as T}from"../../../../sections/shopper-filters.js";const _={template:{type:"slot",allow:[...e]},[l]:{type:"slot",allow:[...t]}},A={label:"Filters",fields:_,defaultProps:{look:r,[o("look")]:E,filtersShown:[...T],showSort:!0,openingSort:L,filtersBelow:!1}};export{A as FilterBlockMeta,_ as FilterBlockSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{phoneKey as t}from"efficient-easel/draw";import i from"../../../../../components/catalog/ShopperFilters.js";import{
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{phoneKey as t}from"efficient-easel/draw";import i from"../../../../../components/catalog/ShopperFilters.js";import{FACET_TEMPLATE_SLOT as r}from"../../../../content/facet-row-seed.js";import{FIRST_ROWS_PROP as l}from"../../../../wheels/shopper-first-paint.js";import{parseFilterLook as n,parseFilterLookPhone as m,parseOpeningSort as f,parseShownFilters as a}from"../../../../sections/shopper-filters.js";import{FilterBlockMeta as S}from"./meta.js";const T={...S,render:e=>o(i,{owner:{id:String(e.id??""),template:e.template,facetTemplate:e[r]},look:n(e.look),lookPhone:m(e[t("look")]),shown:a(e.filtersShown),showSort:e.showSort!==!1,openingSort:f(e.openingSort),filtersBelow:e.filtersBelow===!0,fieldUsage:e.fieldUsage,firstRows:e[l],editing:e.editor?.isEditing})};export{T as FilterBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import o from"../../../../../components/catalog/ShopperChips.js";import{FIRST_SHOWN_PROP as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{CARD_TEMPLATE_SLOT as r}from"efficient-web-builder/format/lib/content/card-template";import{cardPressTitlesOf as i}from"efficient-web-builder/render/lib/document/card-press-titles";import o from"../../../../../components/catalog/ShopperChips.js";import{FIRST_SHOWN_PROP as s}from"../../../../wheels/shopper-first-paint.js";import{FilterChipsBlockMeta as m}from"./meta.js";const w={...m,render:t=>e(o,{owner:{id:String(t.id??""),template:t.template,pressTitles:i(t,r)},showCount:t.showCount!==!1,showClear:t.showClear!==!1,showSort:t.showSort===!0,firstShown:t[s],editing:t.editor?.isEditing})};export{w as FilterChipsBlockRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as L}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as L}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as g}from"efficient-web-builder/format/lib/content/section-width";import A from"../../../../../components/LinkedProductHero.js";import l from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import O from"../../../../../components/SectionNotice.js";import{trustBulletsRow as R,trustBulletsSlot as y}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as F}from"../../../../sections/hero-trust-bullets.js";import{HERO_OPTION_SLOT as m}from"../../../../content/hero-option-seed.js";import{cardPressTitlesOf as w}from"efficient-web-builder/render/lib/document/card-press-titles";import{useCurrentProduct as D}from"../../../current-product.js";import{isEditorOnDynamicPage as I}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as S,parseHeroPricePlacement as U}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as p,DEFAULT_HERO_RATIO as M,DEFAULT_HERO_TEXT_ALIGN as k,parseHeroLayout as x,parseHeroRatio as B,parseHeroTextAlign as C}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as G,DEFAULT_HERO_IMAGE_FIT as N,parseHeroGalleryMode as V,parseHeroImageFit as b}from"../../../../sections/hero-gallery.js";import{say as j}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as v}from"./meta.js";import{HideTaker as Q}from"efficient-web-builder/render/components/ViewHideRoot";function W({source:e,editing:t=!1,pricePlacement:i=S,showVehicleFitment:o=!0,heroLayout:a=p,imageRatio:u=M,textAlign:c=k,showSpecTable:f=!0,showPriceQuote:d=!0,galleryMode:s=G,imageFit:T=N,trustBullets:E,nodeId:_,priceTemplate:P,optionTemplate:H,optionPressTitles:h}){const n={heroLayout:a,imageRatio:u,textAlign:c,showSpecTable:f,showPriceQuote:d,galleryMode:s,imageFit:T,trustBullets:R(E,t),nodeId:_,priceTemplate:P,optionTemplate:H,optionPressTitles:h};return D()||t&&I()?r(l,{editing:t,pricePlacement:i,showVehicleFitment:o,...n}):e?.slug?r(A,{slug:e.slug,kind:e.kind??"wheel",editing:t,pricePlacement:i,showVehicleFitment:o,...n}):t?r(O,{size:"tall",children:j("Pick a product in the panel to fill this hero.")}):r(l,{pricePlacement:i,showVehicleFitment:o,...n})}function Y(e,t){return g(e,"full").mode!=="page"?t:r(Q,{as:"div",style:{"--sf-content-cap":L},children:t})}const de={...v,render:e=>Y(e,r(W,{source:e.source,editing:e.editor?.isEditing,pricePlacement:U(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:x(e.heroLayout),imageRatio:B(e.imageRatio),textAlign:C(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:V(e.galleryMode),imageFit:b(e.imageFit),trustBullets:y(e[F]),nodeId:typeof e.id=="string"?e.id:void 0,priceTemplate:typeof e.template=="function"?e.template:void 0,optionTemplate:typeof e[m]=="function"?e[m]:void 0,optionPressTitles:w(e,m)}))};export{de as ProductHeroRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as f}from"react/jsx-runtime";import l from"../../../../../components/ContactRouting.js";import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as g}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as o}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{cardPressTitlesOf as r}from"efficient-web-builder/render/lib/document/card-press-titles";import{CONTACT_CHANNEL_SLOT as d,CONTACT_REASON_SLOT as T,CONTACT_TOPIC_SLOT as u}from"../../../../content/contact-card-seed.js";import{ContactRoutingMeta as h}from"./meta.js";const A={...h,render:e=>{const m=g(e.headPlacement)==="own-box",a=n=>m?void 0:n;return f(l,{routingNumber:a(o(e.routingNumber,t.routingNumber,e.editor)),routingTagline:a(o(e.routingTagline,t.routingTagline,e.editor)),omitHead:m,templates:{ownerId:String(e.id??""),topic:e[u],reason:e[T],channel:e[d],pressTitles:{topic:r(e,u),reason:r(e,T),channel:r(e,d)}},groups:e.groups??[],formNumber:o(e.formNumber,t.formNumber,e.editor),formHeading:o(e.formHeading,t.formHeading,e.editor),metaLines:(e.metaItems??[]).map(n=>n?.text??"").filter(Boolean),showOther:e.showOther,otherLabel:i(e.otherLabel)||t.otherLabel,otherNoteTitle:o(e.otherNoteTitle,t.otherNoteTitle,e.editor),otherNoteBody:o(e.otherNoteBody,t.otherNoteBody,e.editor),buttonText:i(e.buttonText)||t.buttonText,consent:o(e.consent,t.consent,e.editor),channels:e.channels??[],formSlug:i(e.formSlug)||void 0,form:e.form,editing:e.editor?.isEditing})}};export{A as ContactRoutingRender};
|