efficient-storefront-blocks 0.101.0 → 0.109.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 +146 -0
- package/dist/chunks/{EditorPreviewCheckout-JMBBJSI7.js → EditorPreviewCheckout-IVYEDVVN.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-BKZW7KVN.js → SiteEditorProvider-KN5FKGBX.js} +1 -1
- package/dist/chunks/chunk-5VN7IA5L.js +1 -0
- package/dist/chunks/chunk-G5XZ736Y.js +339 -0
- package/dist/chunks/{chunk-YSKMBJ7V.js → chunk-UBOGEIFX.js} +1 -1
- package/dist/chunks/chunk-X3ERHC7Y.js +1 -0
- package/dist/chunks/{fitment-data-HMD5DDDB.js → fitment-data-Z3FDYFU6.js} +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuPicker.js +1 -1
- package/dist/editor/lib/document/blocks/service/SignUp/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/service/SignUp/fields.js +1 -0
- package/dist/editor/lib/document/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/service/index.js +1 -1
- package/dist/editor/lib/document/box-header.d.ts +3 -4
- package/dist/editor/lib/document/box-header.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +18 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.js +30 -30
- package/dist/render/app/globals.css +428 -145
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +1 -1
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/FooterGroup.js +1 -1
- package/dist/render/components/FooterLogo.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderDropdownPanel.d.ts +21 -0
- package/dist/render/components/HeaderDropdownPanel.js +1 -0
- package/dist/render/components/HeaderNavItem.d.ts +5 -5
- package/dist/render/components/HeaderNavItem.js +1 -1
- package/dist/render/components/MenuLinkBlock.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/SignUpFind.d.ts +25 -0
- package/dist/render/components/SignUpFind.js +1 -0
- package/dist/render/components/SignUpLink.d.ts +13 -0
- package/dist/render/components/SignUpLink.js +1 -0
- package/dist/render/components/SignUpSection.d.ts +47 -0
- package/dist/render/components/SignUpSection.js +1 -0
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardQuantity.d.ts +1 -0
- package/dist/render/components/card-pieces/CardQuantity.js +1 -0
- package/dist/render/components/card-pieces/CardSave.d.ts +1 -0
- package/dist/render/components/card-pieces/CardSave.js +1 -0
- package/dist/render/components/card-pieces/CardStatedFacts.d.ts +1 -0
- package/dist/render/components/card-pieces/CardStatedFacts.js +1 -0
- package/dist/render/components/card-pieces/ProductCardState.d.ts +9 -0
- package/dist/render/components/wheels-plp/useVehicleCatalog.js +1 -1
- package/dist/render/lib/api/index.d.ts +31 -8
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +12 -0
- package/dist/render/lib/catalog/plp-vehicle-slice.d.ts +2 -2
- package/dist/render/lib/catalog/plp-vehicle-slice.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactCards/meta.d.ts +1 -1
- package/dist/render/lib/document/blocks/service/SignUp/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/service/SignUp/meta.js +1 -0
- package/dist/render/lib/document/blocks/service/SignUp/render.d.ts +4 -0
- package/dist/render/lib/document/blocks/service/SignUp/render.js +1 -0
- package/dist/render/lib/document/blocks/service/metas.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/metas.js +1 -1
- package/dist/render/lib/document/blocks/service/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/service/renders.js +1 -1
- package/dist/render/lib/document/blocks/text-part-shapes.json +34 -0
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/font-table.json +150 -0
- package/dist/render/lib/menu-link.d.ts +19 -2
- package/dist/render/lib/menu-link.js +1 -1
- package/dist/render/lib/next-fonts.js +1 -1
- package/dist/render/lib/sections/product-grid-pages.d.ts +1 -0
- package/dist/render/lib/sections/product-grid-pages.js +1 -1
- package/dist/render/lib/sections/sign-up-catalogue.d.ts +3 -0
- package/dist/render/lib/sections/sign-up-catalogue.js +1 -0
- package/dist/render/lib/sections/sign-up-look.d.ts +5 -0
- package/dist/render/lib/sections/sign-up-look.js +1 -0
- package/dist/render/lib/sections/sign-up.d.ts +205 -0
- package/dist/render/lib/sections/sign-up.js +1 -0
- package/dist/render/lib/wheels/plp-hydrate.d.ts +2 -1
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/selected-ranges.d.ts +1 -0
- package/dist/render/lib/wheels/selected-ranges.js +1 -1
- package/dist/words.d.ts +20 -0
- package/dist/words.js +3 -3
- package/package.json +2 -2
- package/dist/chunks/chunk-AF5TRBQB.js +0 -1
- package/dist/chunks/chunk-GJZGQCDM.js +0 -1
- package/dist/chunks/chunk-KV3EHFHB.js +0 -339
- /package/dist/chunks/{chunk-KV3EHFHB.js.LEGAL.txt → chunk-G5XZ736Y.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-XNUK2QNK.js → chunk-SUX7QH3R.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as m}from"react/jsx-runtime";import D from"next/link";import{useEffect as h}from"react";import{useCart as A}from"../CartContext.js";import g from"../QuoteLink.js";import{NO_HIDE as R,useTakeViewHide as B,withViewHide as S}from"efficient-web-builder/render/components/ViewHideRoot";import{useSiteTakesOrders as k}from"../SiteRecordContext.js";import L from"../wheels-plp/PlpNotifyMeDialog.js";import{DEFAULT_PURCHASE_STATE as N}from"../../lib/catalog/purchase.js";import{ADD_TO_BASKET_ATTR as x}from"../../lib/commerce.js";import{STOCK_WORDS as w}from"../../lib/content/stock-words.js";import{tyreCartLine as z}from"../../lib/tyres/tyre-purchase.js";import{UNPRICED_LABEL as H,priceIn as P,resolveWheelPrice as $}from"../../lib/wheels/price-display.js";import{isOneWheelDesign as W,setLabel as I}from"../../lib/wheels/variants.js";import{splitWheelName as V}from"../../lib/wheels/wheel-name.js";import{CARD_TEXT_SIZE as C,CardButtonRow as y}from"./card-row.js";import{TYRE_BUY_CHIPS_CLASS as j,TyreSizeChips as q}from"./CardSizes.js";import{useHeroStateOrNull as F,useProductCardStateOrNull as U,useWheelCardState as G}from"./ProductCardState.js";const O="mt-3 flex flex-col gap-2",u=`cursor-pointer bg-btn px-4 py-3 font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-btn-ink transition-colors hover:bg-fg`,K=`border border-btn px-4 py-3 text-center font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,Y="View sizes & fitment",M="mt-3 block font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.18em] text-accent underline-offset-4 group-hover:underline";function X({wheel:e,sel:t,price:n,editing:r}){const{addAndOpen:i,warmCatalog:s}=A();h(()=>{r||s(void 0,e.slug)},[r,s,e.slug]);const{arm:c}=t;h(()=>{c()},[c]);function d(){const a=t.selectedVariant;!a||!t.canAdd||n.priced&&(r||i({id:`${e.slug}|${a.finishName}|${a.size}|quick`,slug:e.slug,name:V(e.name),process:e.process,positionNo:"01",config:[{label:a.size},{label:a.finishName,gold:!0},{label:I(a)}],finishName:a.finishName,size:a.size,components:a.components,qty:1}))}return o("button",{type:"button",onClick:d,[x]:"",disabled:!t.canAdd,className:t.canAdd?u:`${u} opacity-80`,children:"Add to basket"})}function Q(e,t,n){return W(e)?t.outOfStock?"notify":t.unsellable||!n||t.detailState==="ready"&&!t.canAdd?"choose":"add":"choose"}function Z({state:e,buy:t,page:n}){const{wheel:r,sel:i,price:s,editing:c,setNotifyOpen:d}=e,a=k(),l=Q(r,i,s.priced),f=t?l==="notify"?o("button",{type:"button",onClick:()=>d(!0),className:u,children:"Notify me when back"}):l==="add"?a?o(X,{wheel:r,sel:i,price:s,editing:c}):o(g,{className:u}):null:null,p=!n||f?null:m("span",{"aria-hidden":!0,className:M,children:[Y," →"]});return o(y,{children:f||p?m("div",{className:O,children:[f,p]}):null})}function J({state:e}){const{tyre:t,currency:n,pagePath:r,detail:i,variant:s,canAdd:c,detailReady:d,unsellable:a,editing:l}=e,{addAndOpen:f,warmCatalog:p}=A(),b=k();h(()=>{!l&&b&&p("tyre")},[l,b,p]);const _=$(P(t.prices,n),null).priced;function E(){!i||!s||!c||l||f(z(i,s,N.choice,N.qty))}return m(y,{children:[o("div",{className:j,children:o(q,{state:e})}),m("div",{className:O,children:[!a&&_&&!b&&o(g,{className:u}),!a&&_&&b&&o("button",{type:"button",onClick:E,[x]:"",disabled:d&&!c,className:c||!d?`${u}${c?"":" opacity-80"}`:`cursor-not-allowed border border-dashed border-accent/50 px-4 py-3 font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-accent/70`,children:d&&!c?"Select a size":"Add to basket"}),r&&o(D,{href:r,className:K,children:"Open product page"})]})]})}const ee="flex-1 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em]",te="flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40";function T(e,t){return!t||e.isSet&&!e.priced?"quote":e.priced?e.outOfStock?"outOfStock":"add":"unpriced"}function v({buy:e,takesOrders:t,add:n,take:r=R}){const i=T(e,t);return i==="quote"?o(g,{className:S("flex-1 cursor-pointer bg-btn px-6 py-4 text-center font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg",r.className)??"",attrs:r.attrs}):i!=="add"?o("button",{type:"button",disabled:!0,"aria-disabled":!0,className:S(te,r.className),...r.attrs,children:i==="outOfStock"?w.outOfStock:H}):m("button",{type:"button",[x]:"",onClick:()=>{const s=e.lineToAdd();s&&n(s)},"aria-disabled":!e.canAdd,className:S([`${ee} transition-colors`,e.canAdd?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),r.className),style:e.canAdd?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},...r.attrs,children:["Add to Cart",e.totalLabel!=null?` · ${e.totalLabel}`:""]})}const re=()=>{};function ne({buy:e,take:t}){const{addAndOpen:n}=A();return o(v,{buy:e,takesOrders:!0,add:r=>n(r),take:t})}function oe({buy:e}){const t=k(),n=B();return n.scope(T(e,t)==="add"?o(ne,{buy:e,take:n}):o(v,{buy:e,takesOrders:t,add:re,take:n}))}function ae({buy:e=!0,page:t=!0}){const n=F(),r=U();if(n)return n.buy?o(oe,{buy:n.buy}):null;if(!r)throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return r.kind==="bundle"?o(y,{}):r.kind==="tyre"?o(J,{state:r}):o(Z,{state:r,buy:e,page:t})}function _e(){const{wheel:e,sel:t,editing:n,notifyOpen:r,setNotifyOpen:i}=G();return r?o(L,{wheelName:e.name,productSlug:e.slug,finishName:t.confirmedFinishName,variants:t.outOfStockVariants,initialSize:t.selectedVariant?.size,onClose:()=>i(!1),editing:n}):null}export{Y as CARD_PAGE_WORDS,_e as CardBuyDialog,v as HeroBuyButton,ae as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CardQuantity(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import r from"../QuantityStepper.js";import{useHeroStateOrNull as o}from"./ProductCardState.js";function n(){const t=o();return t?.takesQty?e(r,{value:t.qty,onChange:t.setQty,size:"large"}):null}export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CardSave(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{useWishlist as n}from"../WishlistContext.js";import{useHeroStateOrNull as i}from"./ProductCardState.js";function c(){const e=i()?.save;return e?o(l,{slug:e.slug,name:e.name}):null}function l({slug:e,name:r}){const{has:a,toggle:s}=n(),t=a(e);return o("button",{type:"button",title:t?"Saved":"Save","aria-label":t?`Remove ${r} from wishlist`:`Save ${r} to wishlist`,"aria-pressed":t,onClick:()=>s(e),className:["h-12 w-12 cursor-pointer border-2 bg-transparent transition-colors",t?"border-accent text-accent":"border-fg-dim/50 text-fg hover:border-accent hover:text-accent"].join(" "),children:t?"♥":"♡"})}export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function CardStatedFacts(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as a,jsx as s}from"react/jsx-runtime";import{useEnglish as r}from"../EnglishVariant.js";import{useHeroStateOrNull as n}from"./ProductCardState.js";function i(){const e=n()?.facts,t=r();return!e||e.length===0?null:s("div",{className:"border-b border-line pb-[26px]",children:s("dl",{className:"flex flex-col gap-2",children:e.map(l=>a("div",{className:"flex flex-wrap items-baseline gap-x-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.22em]",children:[a("dt",{className:"text-fg-dim",children:[t(l.label)," ·"]}),s("dd",{className:"font-semibold text-fg",children:l.value.label})]},l.key))})})}export{i as default};
|
|
@@ -3,6 +3,7 @@ import type { CartLine } from "../CartContext.js";
|
|
|
3
3
|
import { type TyreDetailState } from "../useTyreDetail.js";
|
|
4
4
|
import { type PlpCardSelection } from "../wheels-plp/usePlpCardSelection.js";
|
|
5
5
|
import type { Bundle, Tyre, TyreProductSummary, TyreVariant, WheelSummary } from "../../lib/api/index.js";
|
|
6
|
+
import type { OptionFact } from "../../lib/catalog/product-options.js";
|
|
6
7
|
import { type SelectionPriceDisplay } from "../../lib/wheels/price-display.js";
|
|
7
8
|
export interface WheelCardState {
|
|
8
9
|
readonly kind: "wheel";
|
|
@@ -68,6 +69,14 @@ export interface HeroState {
|
|
|
68
69
|
readonly unitLabel: string | null;
|
|
69
70
|
readonly packBadge: string | null;
|
|
70
71
|
readonly buy: HeroBuyState | null;
|
|
72
|
+
readonly qty: number;
|
|
73
|
+
readonly setQty: (next: number) => void;
|
|
74
|
+
readonly takesQty: boolean;
|
|
75
|
+
readonly save: {
|
|
76
|
+
readonly slug: string;
|
|
77
|
+
readonly name: string;
|
|
78
|
+
} | null;
|
|
79
|
+
readonly facts: readonly OptionFact[] | null;
|
|
71
80
|
}
|
|
72
81
|
export declare function useHeroStateOrNull(): HeroState | null;
|
|
73
82
|
export declare function HeroStateProvider({ value, children }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useCallback as C,useEffect as N,useMemo as q,useState as o}from"react";import{products as v}from"../../lib/api/index.js";import{itemSlug as O}from"../../lib/catalog/plp-item.js";import{catalogSliceRequest as V,catalogVehicleQuery as F,mergeNarrowedSlice as J,serverNarrowedKinds as b}from"../../lib/catalog/plp-vehicle-slice.js";function H({catalog:
|
|
1
|
+
"use client";import{useCallback as C,useEffect as N,useMemo as q,useState as o}from"react";import{products as v}from"../../lib/api/index.js";import{itemSlug as O}from"../../lib/catalog/plp-item.js";import{catalogSliceRequest as V,catalogVehicleQuery as F,mergeNarrowedSlice as J,serverNarrowedKinds as b}from"../../lib/catalog/plp-vehicle-slice.js";function H({catalog:i,shownKinds:g,vehicle:p,editing:h=!1}){const u=b(g),y=h?null:F(p),[c,a]=o(null),[f,l]=o(null),[S,k]=o(0),d=V(u,y),e=d?JSON.stringify(d):"";!e&&(c!==null||f!==null)&&(a(null),l(null)),N(()=>{if(!e)return;const t=JSON.parse(e);let r=!0;return v.listCatalog(t.kinds,t.vehicle,{throwOnFailure:!0}).then(n=>{r&&(a({key:e,slugs:n.map(O)}),l(null))}).catch(n=>{console.error("[useVehicleCatalog] catalog refetch failed",n),r&&l(e)}),()=>{r=!1}},[e,S]);const m=c?.slugs??null,s=u.join(","),K=q(()=>J(i,s?s.split(","):[],m),[i,s,m]),w=C(()=>k(t=>t+1),[]);return{items:K,failed:!!e&&f===e,retry:w}}export{H as useVehicleCatalog};
|
|
@@ -203,6 +203,7 @@ export type Brand = {
|
|
|
203
203
|
};
|
|
204
204
|
import type { components, operations } from "./types.js";
|
|
205
205
|
import { type DealerList } from "../sections/dealer-finder.js";
|
|
206
|
+
import { type LinkState, type SignUpAvailability, type SignUpSent } from "../sections/sign-up.js";
|
|
206
207
|
export declare function resolveMediaUrls<T>(value: T): T;
|
|
207
208
|
export type Process = components["schemas"]["Process"];
|
|
208
209
|
export type FinishFamily = components["schemas"]["FinishFamily"];
|
|
@@ -543,10 +544,8 @@ export interface AdminHeaderSettings {
|
|
|
543
544
|
label: string;
|
|
544
545
|
url: string;
|
|
545
546
|
dropdown_menu: string | null;
|
|
546
|
-
dropdown_items:
|
|
547
|
-
|
|
548
|
-
url: string;
|
|
549
|
-
}[];
|
|
547
|
+
dropdown_items: AdminMenuDropdownItem[];
|
|
548
|
+
dropdown_aside?: AdminMenuAside | null;
|
|
550
549
|
}[];
|
|
551
550
|
menu_position: "left" | "center" | "right" | "beside";
|
|
552
551
|
menu_split: number;
|
|
@@ -601,15 +600,32 @@ export type AdminSocialSettings = {
|
|
|
601
600
|
site: string;
|
|
602
601
|
} & Record<`${SocialPlatform}_url`, string>;
|
|
603
602
|
export type AdminSocialSettingsPatch = Partial<Record<`${SocialPlatform}_url`, string>>;
|
|
604
|
-
export interface
|
|
605
|
-
id: string;
|
|
603
|
+
export interface AdminMenuDropdownItem {
|
|
606
604
|
label: string;
|
|
607
605
|
url: string;
|
|
608
|
-
|
|
609
|
-
|
|
606
|
+
description?: string;
|
|
607
|
+
image?: string;
|
|
608
|
+
badge?: string;
|
|
609
|
+
}
|
|
610
|
+
export interface AdminMenuAside {
|
|
611
|
+
eyebrow?: string;
|
|
612
|
+
title?: string;
|
|
613
|
+
text?: string;
|
|
614
|
+
links?: {
|
|
610
615
|
label: string;
|
|
611
616
|
url: string;
|
|
612
617
|
}[];
|
|
618
|
+
}
|
|
619
|
+
export interface AdminMenuItem {
|
|
620
|
+
id: string;
|
|
621
|
+
label: string;
|
|
622
|
+
url: string;
|
|
623
|
+
description?: string;
|
|
624
|
+
image?: string;
|
|
625
|
+
badge?: string;
|
|
626
|
+
dropdown_menu: string | null;
|
|
627
|
+
dropdown_items?: AdminMenuDropdownItem[];
|
|
628
|
+
dropdown_aside?: AdminMenuAside | null;
|
|
613
629
|
sort_order: number;
|
|
614
630
|
}
|
|
615
631
|
export interface AdminMenu {
|
|
@@ -617,6 +633,7 @@ export interface AdminMenu {
|
|
|
617
633
|
name: string;
|
|
618
634
|
handle: string;
|
|
619
635
|
sort_order: number;
|
|
636
|
+
aside?: AdminMenuAside;
|
|
620
637
|
items: AdminMenuItem[];
|
|
621
638
|
item_count: number;
|
|
622
639
|
}
|
|
@@ -850,3 +867,9 @@ export declare const storefrontAdmin: {
|
|
|
850
867
|
};
|
|
851
868
|
export declare function dealersPath(near: string): string;
|
|
852
869
|
export declare function fetchDealers(near: string): Promise<DealerList>;
|
|
870
|
+
export declare function fetchSignUpAvailability(product: string, slug?: string): Promise<SignUpAvailability>;
|
|
871
|
+
export declare function askToSignUp(body: Record<string, string>): Promise<SignUpSent>;
|
|
872
|
+
export declare function openSignUpLink(token: string): Promise<LinkState>;
|
|
873
|
+
export declare function joinSignUpWaitingList(product: string, email: string): Promise<void>;
|
|
874
|
+
export declare function askForWorkspaces(product: string, email: string): Promise<void>;
|
|
875
|
+
export declare function openWorkspaceFind(token: string): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as it,SITE_HOST_HEADER as ct,SITE_SLUG_HEADER as dt}from"../site-headers.js";import{PRODUCT_API_BASE as ut,PRODUCT_BACKEND_URL as x}from"./origins.js";import{listRows as m}from"./list-rows.js";import{backendHopHeaders as lt,clientIpFromForwardedFor as pt,FORWARDED_FOR_HEADER as yt,hopCachingOf as ht}from"../forwarded-for.js";import ft from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as gt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as $}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as H}from"../wheels/renderable-finishes.js";const mt=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class S extends Error{status;data;constructor(e,n,s){super(n),this.status=e,this.data=s}}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.",wt=new Set([502,503,504]),v=0,St="This editor runs on its host's own backend, which does not serve this request.",Pt=5e3,Ot=15e3,bt=()=>typeof window>"u"?Pt:Ot;function F(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(bt())}const M=t=>t instanceof Error&&t.name==="TimeoutError",B=(t,e)=>wt.has(t)?N:e,Tt=["admin","venue"];let q="admin";function fe(t){q=Tt.includes(t)?t:"admin"}function Rt(){return q}const At=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let G=null;function ge(t){G=t&&At.test(t)?t:null}function Et(){return G}function $t(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=Z();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:n,baseUrl:s,headers:u,audience:l,...y}=e;if(typeof window<"u"&&!gt())throw new S(v,St,null);if(typeof window>"u"&&s===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 a=typeof FormData<"u"&&y.body instanceof FormData;let r;try{r=await fetch(`${s??mt}${$t(t)}`,{...y,headers:{...a?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...u},signal:y.signal??F({...y,audience:l})})}catch(h){throw h instanceof TypeError||M(h)?new S(v,N,null):h}let o;try{o=await r.text()}catch(h){throw M(h)?new S(v,N,null):h}let p=null;if(o)try{p=JSON.parse(o)}catch{throw new S(r.status,r.ok?"Expected JSON but received a non-JSON response":B(r.status,r.statusText),o)}if(!r.ok){const h=(p&&typeof p=="object"&&"detail"in p&&typeof p.detail=="string"?p.detail:null)??B(r.status,r.statusText);throw new S(r.status,h,p)}return p}let T=null;async function W(){return T||(T=Ct().finally(()=>{T=null}),T)}async function Ct(){const t=O.takeLegacyRefresh(),e=await It.refresh(t??void 0);return O.setTokens(e.access),e.access}async function j(){return O.getAccess()??W()}async function g(t,e={}){let n;try{n=await j()}catch{throw O.clear(),new S(401,"Not signed in",null)}try{return await i(t,{...e,token:n})}catch(s){if(!(s instanceof S)||s.status!==401)throw s;try{const u=await W();return await i(t,{...e,token:u})}catch{throw O.clear(),s}}}const _t=100,z=20;function Ut(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function K(t,e){const[n,s=""]=t.split("?"),u=[];let l="1";for(let y=0;y<z&&l;y++){const a=new URLSearchParams(s);a.set("page_size",String(_t)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=Ut(r.next)}return l&&console.warn(`[${e}] stopped at ${z} pages (${u.length} rows); list may be truncated`),u}async function X(t,e={}){if(O.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(n){if(!(n instanceof S)||n.status!==401)throw n}return{data:await i(t,e),asShopper:!1}}async function V(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw O.clear(),new S(403,"This session is not valid for this shop.",null);return t}const It={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()=>{O.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await j();return await V(),t},me:V,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,n)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:n})}),brands:()=>g("/api/products/brands/"),myOrders:()=>K("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>K(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const n=new FormData;return n.append("claim_item",t),n.append("file",e),n.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:n})}};import{media as Nt,absolutizeApiUrl as k}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as vt,isSvgUrl as kt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Lt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Jt,webRuntimeSiteSlug as Z}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Dt}from"../sections/dealer-finder.js";function w(t){if(typeof t=="string")return t.startsWith("/media/")?Nt(t):t;if(Array.isArray(t))return t.map(w);if(t&&typeof t=="object"){const e={};for(const[n,s]of Object.entries(t))e[n]=n==="captions"&&s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).map(([u,l])=>[w(u),l])):w(s);return e}return t}import{PRODUCT_API_BASE as Ue}from"./origins.js";const Y=typeof window>"u"&&x!=="",xt=Y?x:ut,Ht=Jt,b=()=>({baseUrl:Ht(),audience:null});function c(t,e){const n=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${n}`}const Q=100,tt=50;function L(t,e,n){const s=new URLSearchParams;for(const[u,l]of Object.entries(e))l!=null&&l!==""&&s.set(u,String(l));return s.set("pageSize",String(Q)),n&&s.set("cursor",n),`/api/v1${t}?${s.toString()}`}function Ft(t,e){return L("/wheels",{process:t},e)}const et=Q;function Mt(t,e){return L("/wheels",{slug:t.join(",")},e)}function Bt(t,e,n){return L("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function qt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function J(t,e,n=()=>!1,s=()=>!1){const u=[];let l=null;try{for(let y=0;y<tt;y++){const a=await i(await e(l),await d());if(u.push(...m(a)),l=qt(a.next),!l)break;if(s(u))return u}l&&console.warn(`[${t}] stopped at ${tt} pages (${u.length} rows); catalog may be truncated`)}catch(y){if(n(y))throw y;console.warn(`[${t}] product API unavailable, returning []`,y)}return u}const at=t=>t instanceof S&&t.status===400;function rt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?$([e]):[e])}async function nt(){return(await Gt()).host}async function Gt(){try{const{headers:t}=await import("next/headers"),e=await t(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,s=n(e.get(ct)??e.get("x-forwarded-host")??e.get("host")),u=n(e.get("host"));return{host:s,matchesRequestHost:s!==null&&s===u}}catch{return{host:null,matchesRequestHost:!1}}}async function Wt(){try{const{headers:t}=await import("next/headers");return pt((await t()).get(yt))}catch{return null}}async function jt(){try{const{headers:t}=await import("next/headers");return(await t()).get(dt)||null}catch{return null}}async function zt(){const t=await jt();if(t)return`site=${encodeURIComponent(t)}`;const e=await nt();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=Z();return e?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await zt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Kt="preview";async function Xt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(it)}catch{return null}}async function Vt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function D(t,e){const n=await Xt();if(n===null)return[await f(t),await d(e)];const s=C(await f(t),`${Kt}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await Vt();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function Zt(t){if(!Y)return;const[e,n]=await Promise.all([nt(),Wt()]),s=lt(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await Zt(ht(t)),n={baseUrl:xt,...t};return e&&(n.headers={...e,...t?.headers}),n}const R=typeof window>"u";function A(t,e){const n=new URLSearchParams;for(const[u,l]of Object.entries(e))l!==void 0&&l!==""&&n.set(u,String(l));const s=n.toString();return`/api/v1/fitment${t}${s?`?${s}`:""}`}const be={listMakes:async t=>{if(R){const{fitmentData:n}=await import("./fitment-data.js");return n.makes(t)}const e=await i(A("/makes",{region:t}),b());return m(e)},listModels:async(t,e)=>{if(R){const{fitmentData:s}=await import("./fitment-data.js");return s.models(t,e)}const n=await i(A("/models",{make:t,region:e}),b());return m(n)},listYears:async(t,e,n)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.years(t,e,n)}const s=await i(A("/years",{make:t,model:e,region:n}),b());return m(s)},listModifications:async(t,e,n,s)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.modifications(t,e,n,s)}const u=await i(A("/modifications",{make:t,model:e,year:n,region:s}),b());return m(u)},getStockFitment:async(t,e,n,s,u)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.stockFitment(t,e,n,s,u)}return i(A("/stock-fitment",{make:t,model:e,year:n,modification:s,region:u}),b())}},Te={listWheels:async(t,e={})=>{const n=await J("products.listWheels",async s=>await f(Ft(t,s)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:s=>$([...s]).length>=e.maxRows);return $(w(n))},listWheelsBySlug:async(t,e={})=>{const n=[...new Set(t.map(a=>a.trim()).filter(Boolean))];if(n.length===0)return[];const s=[];for(let a=0;a<n.length;a+=et)s.push(n.slice(a,a+et));const u=await Promise.all(s.map(a=>J("products.listWheelsBySlug",async r=>await f(Mt(a,r)),e.throwOnFailure?()=>!0:at))),l=new Set(n),y=u.flat().filter(a=>l.has(a.slug));return $(w(y))},listCatalog:async(t,e,n={})=>{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 s=await J("products.listCatalog",async u=>await f(Bt(t,e,u)),n.throwOnFailure?()=>!0:at,n.maxRows===void 0?void 0:u=>rt([...u]).length>=n.maxRows);return rt(w(s))},getWheel:async t=>H(w(await i(await f(c(`/wheels/${t}`)),await d()))),getTyre:async t=>w(await i(await f(c(`/tyres/${t}`)),await d())),listBundles:async(t={})=>{try{return await i(await f(c("/bundles")),await d())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(c(`/bundles/${t}`)),await d()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:n=null}=t;if(typeof window>"u"){const{listGalleryBuilds:s}=await import("./gallery-builds-data.js");return w(s(e,n))}try{const s=new URLSearchParams;e&&s.set("process",e),n&&s.set("wheelSlug",n);const u=s.toString(),l=await i(`/api/v1/gallery-builds${u?`?${u}`:""}`,b());return w(m(l))}catch(s){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",s),[]}},getSite:async()=>i(await f(c("/site")),await d()),getSiteBySlug:async t=>i(`${c("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await d():void 0),listPages:async()=>w(await i(await f(c("/pages")),await d())),listPopups:async()=>i(await f(c("/popups")),await d()),listProductTemplates:async()=>{try{return await i(await f(c("/product-templates")),await d())}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(`${c("/dynamic-pages")}${e}`),await d())}catch(n){if(n instanceof S&&n.status===404)return[];throw n}},getRecord:async(t,e)=>{try{return await i(await f(c(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await d())}catch(n){if(n instanceof S&&n.status===404)return null;throw n}},listRecordKeys:async t=>{try{const e=await i(await f(c(`/records/${encodeURIComponent(t)}`)),await d({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(e){if(e instanceof S&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(c("/product-type-choices")),await d())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(c("/field-usage")),await d())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const n=e.record?`?record=${encodeURIComponent(e.record)}`:"",[s,u]=await D(c(`/pages/${t}`)+n,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return w(await i(s,u))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const n=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(c("/blog-posts")+n,await d())).map(u=>({...u,coverImage:k(u.coverImage)??""}))}catch(s){if(e)throw s;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(c(`/blog-posts/${t}`),await d());return{...e,coverImage:k(e.coverImage)??""}},createOrder:async t=>i(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(c("/orders/lookup"),await d({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(c("/payments/intent"),await d({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(c("/checkouts/release"),await d({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(c("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(c("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(c("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(c("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(c("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(c("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(c("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(c("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(c("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(c("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(c("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(c("/stock-alerts"),await d({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(c("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(c("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(c("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(c("/carts"),await d({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(c("/carts/restore"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(c("/carts/unsubscribe"),await d({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 n=c("/reviews"),s=e.toString();try{return await i(await f(s?`${n}?${s}`:n),await d())}catch(u){return console.warn("[products.listReviews] product API unavailable, returning []",u),[]}},submitReview:async t=>i(c("/reviews"),await d({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(c(`/forms/${encodeURIComponent(t)}`),await d()),submitForm:async(t,e)=>i(c(`/forms/${encodeURIComponent(t)}/submissions`),await d({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await d())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(c(`/countries/${encodeURIComponent(t)}/subdivisions`),await d())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=c("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await X(e,n)).data:i(e,n)},validateCoupon:async t=>{const{data:e,asShopper:n}=await X(c("/coupons/validate"),await d({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:n}},getHeaderSettings:async()=>{const t=F({method:"GET"}),e=await i(...await D(c("/header-settings"),{signal:t})),n=k(e.logoUrl);let s=null,u=null;if(n&&kt(n)){const l=await vt(n,t);l&&(s=l.reversed,u=l.inkIsDark)}return{...e,logoUrl:n,logoReversed:s,logoInkIsDark:u}},getThemeSettings:async()=>i(...await D(c("/theme-settings"))),getChatSettings:async()=>i(await f(c("/chat-settings")),await d())},Re={listServices:async()=>{try{return await i(c("/bookings/services"),await d())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(c(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await d()),create:async t=>i(c("/bookings"),await d({method:"POST",body:JSON.stringify(t)})),get:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}`),await d()),cancel:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await d({method:"POST"})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class Yt extends Error{slug;count;constructor(e,n){super(`Slug "${e}" exists on ${n} websites; a site is required to pick one.`),this.slug=e,this.count=n,this.name="AmbiguousPageSlugError"}}const _=(t,e,n)=>{const s=new URLSearchParams({...e?{site:e}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${s?`?${s}`:""}`},U=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Qt=t=>`${U(t)}currencies/`,te="/api/storefront/media/ingest/";class ee 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 ae(){const t=Lt();if(!t)throw new ee;return`${te}?${new URLSearchParams({site:t})}`}const re="X-Puck-Media-Manifest",st=ft.contentHash,I={"X-Media-Manifest":st,[re]:st},Ae=ot({});function ot(t){return(e,n={})=>{const s=Et(),u=t.headers||s?{...s?{"Accept-Language":s}:{},...t.headers,...n.headers}:void 0;return i(e,{...n,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...u?{headers:u}:{},audience:t.audience??Rt()})}}function ne(t={}){const e=ot(t),n=t.siteDrafts===!0,s=a=>_("header-settings",a,n),u=a=>_("theme-settings",a,n),l=a=>_("chat-settings",a,n),y=a=>_("social-settings",a,n);return{findPageBySlug:async(a,r,o)=>{const p=new URLSearchParams({slug:a});o&&p.set("site",o);const h=await e(`/api/storefront/pages/?${p.toString()}`,{token:r}),P=m(h);if(!o&&P.length>1)throw new Yt(a,P.length);return P[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,o,p,h)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:p,...h?{client_id:h}:{}}),token:o}),duplicatePage:(a,r,o)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:o}),geocode:(a,r,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:a,country:o}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,o,p=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:p}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:I,token:o}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,o)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),listTemplatePages:async(a,r)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return m(o)},findTemplatePageBySlug:async(a,r,o)=>{const p=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:o});return m(p)[0]??null},createTemplatePage:(a,r,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:I,token:o}),saveTemplatePageLayout:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),deleteTemplatePage:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/pages/?${o.toString()}`,{token:a});return m(p)},createPage:(a,r,o,p)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:o}),token:p}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(s(r),{token:a}),listMenus:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/menus/?${o}`,{token:a});return m(p)},listBlogPosts:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:a});return m(p)},listFieldUsage:async(a,r)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/categories/?${o.toString()}`,{token:a});return[...m(p)].sort((P,E)=>P.sort_order-E.sort_order||P.name.localeCompare(E.name))},listForms:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/forms/?${o.toString()}`,{token:a});return[...m(p)].sort((P,E)=>P.title.localeCompare(E.title))},listWheelSummaries:async(a,r={})=>{const o=new URLSearchParams;r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/wheel-curations/summaries/${p?`?${p}`:""}`,{token:a});return w(h)},listProducts:async(a,r={})=>{const o=new URLSearchParams;r.kinds?.length&&o.set("kind",r.kinds.join(",")),r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/products/${p?`?${p}`:""}`,{token:a});return w(h)},getWheelDetail:async(a,r,o={})=>{const p=new URLSearchParams({slug:r});return o.siteId&&p.set("site",o.siteId),H(w(await e(`/api/storefront/wheel-curations/detail/?${p.toString()}`,{token:a})))},updateHeaderSettings:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(U(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return m(r)},listSiteCurrencies:async(a,r)=>{const o=await e(Qt(a),{token:r});return Array.isArray(o)?o:[]},publishSite:(a,r)=>e(`${U(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${U(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(u(r),{token:a}),updateThemeSettings:(a,r,o)=>e(u(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getMyPreferences:async a=>(await e("/api/auth/me/",{token:a})).preferences??{},updateMyPreferences:(a,r)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:a}),token:r}),getChatSettings:(a,r)=>e(l(r),{token:a}),updateChatSettings:(a,r,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(y(r),{token:a}),updateSocialSettings:(a,r,o)=>e(y(o),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,o)=>{const p=new FormData;return p.append("logo",a),e(s(o),{method:"PATCH",body:p,token:r})},clearHeaderLogo:(a,r)=>e(s(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const o=new FormData;return o.append("file",a),e(ae(),{method:"POST",body:o,token:r})},listMedia:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("kind",r);const p=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:a});return m(p)}}}const Ee=ne({siteDrafts:!0});function se(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function $e(t){return Dt(await i(se(t)))}export{mt as API_URL,Yt as AmbiguousPageSlugError,S as ApiError,Ot as BROWSER_READ_TIMEOUT_MS,St as EFFICIENT_CLIENT_CLOSED_MESSAGE,ee as MediaUploadDestinationError,Kt as PREVIEW_PARAM,Ue as PRODUCT_API_BASE,Pt as SERVER_READ_TIMEOUT_MS,N as SERVER_UNREACHABLE_MESSAGE,v as STATUS_NETWORK_ERROR,Ae as adminFetch,It as api,i as apiFetch,C as appendSiteQuery,Re as bookings,ne as createStorefrontAdmin,se as dealersPath,F as defaultRequestDeadline,ae as editorMediaUploadPath,Rt as editorPortalAudience,Et as editorRequestLanguage,$e as fetchDealers,be as fitment,Te as products,bt as readDeadlineMs,Wt as resolveClientIp,w as resolveMediaUrls,Xt as resolvePreviewToken,nt as resolveSiteHost,Gt as resolveSiteHostSource,jt as resolveSiteSlug,ge as setEditorLanguage,fe as setEditorPortalAudience,Ee as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as dt,SITE_HOST_HEADER as ut,SITE_SLUG_HEADER as lt}from"../site-headers.js";import{PRODUCT_API_BASE as pt,PRODUCT_BACKEND_URL as H}from"./origins.js";import{listRows as m}from"./list-rows.js";import{backendHopHeaders as yt,clientIpFromForwardedFor as ht,FORWARDED_FOR_HEADER as ft,hopCachingOf as gt}from"../forwarded-for.js";import mt from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as O}from"../auth.js";import{efficientClientOpen as wt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as U}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as F}from"../wheels/renderable-finishes.js";const St=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class w extends Error{status;data;constructor(e,n,s){super(n),this.status=e,this.data=s}}const v="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.",Pt=new Set([502,503,504]),k=0,Ot="This editor runs on its host's own backend, which does not serve this request.",bt=5e3,Tt=15e3,At=()=>typeof window>"u"?bt:Tt;function M(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(At())}const B=t=>t instanceof Error&&t.name==="TimeoutError",q=(t,e)=>Pt.has(t)?v:e,Rt=["admin","venue"];let G="admin";function Ee(t){G=Rt.includes(t)?t:"admin"}function Et(){return G}const _t=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let W=null;function _e(t){W=t&&_t.test(t)?t:null}function Ut(){return W}function $t(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=Y();return!e||/[?&]site=/.test(t)?t:$(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:n,baseUrl:s,headers:u,audience:l,...y}=e;if(typeof window<"u"&&!wt())throw new w(k,Ot,null);if(typeof window>"u"&&s===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 a=typeof FormData<"u"&&y.body instanceof FormData;let r;try{r=await fetch(`${s??St}${$t(t)}`,{...y,headers:{...a?{}:{"Content-Type":"application/json"},...n?{Authorization:`Bearer ${n}`}:{},...l===null?{}:{"X-Portal-Audience":l??"shop"},...u},signal:y.signal??M({...y,audience:l})})}catch(h){throw h instanceof TypeError||B(h)?new w(k,v,null):h}let o;try{o=await r.text()}catch(h){throw B(h)?new w(k,v,null):h}let p=null;if(o)try{p=JSON.parse(o)}catch{throw new w(r.status,r.ok?"Expected JSON but received a non-JSON response":q(r.status,r.statusText),o)}if(!r.ok){const h=(p&&typeof p=="object"&&"detail"in p&&typeof p.detail=="string"?p.detail:null)??q(r.status,r.statusText);throw new w(r.status,h,p)}return p}let A=null;async function j(){return A||(A=Ct().finally(()=>{A=null}),A)}async function Ct(){const t=O.takeLegacyRefresh(),e=await vt.refresh(t??void 0);return O.setTokens(e.access),e.access}async function z(){return O.getAccess()??j()}async function g(t,e={}){let n;try{n=await z()}catch{throw O.clear(),new w(401,"Not signed in",null)}try{return await i(t,{...e,token:n})}catch(s){if(!(s instanceof w)||s.status!==401)throw s;try{const u=await j();return await i(t,{...e,token:u})}catch{throw O.clear(),s}}}const Nt=100,K=20;function It(t){if(!t)return null;try{return new URL(t,"http://page.invalid").searchParams.get("page")}catch{return null}}async function V(t,e){const[n,s=""]=t.split("?"),u=[];let l="1";for(let y=0;y<K&&l;y++){const a=new URLSearchParams(s);a.set("page_size",String(Nt)),l!=="1"&&a.set("page",l);const r=await g(`${n}?${a.toString()}`);u.push(...m(r)),l=It(r.next)}return l&&console.warn(`[${e}] stopped at ${K} pages (${u.length} rows); list may be truncated`),u}async function X(t,e={}){if(O.getAccess())try{return{data:await g(t,e),asShopper:!0}}catch(n){if(!(n instanceof w)||n.status!==401)throw n}return{data:await i(t,e),asShopper:!1}}async function Z(){const t=await g("/api/auth/me/");if(t.portal!=="shop")throw O.clear(),new w(403,"This session is not valid for this shop.",null);return t}const vt={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()=>{O.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await z();return await Z(),t},me:Z,updateMe:t=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>g("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>g("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>g("/api/shop-portal/profile/"),updateMyProfile:t=>g("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>g("/api/shop-portal/delivery-locations/"),createAddress:t=>g("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>g(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,n)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:n})}),brands:()=>g("/api/products/brands/"),myOrders:()=>V("/api/shop-portal/orders/","api.myOrders"),myOrder:t=>g(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>g(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>V(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`,"api.myReturns"),createReturn:t=>g("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>g(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const n=new FormData;return n.append("claim_item",t),n.append("file",e),n.append("media_type",e.type.startsWith("video/")?"video":"image"),g("/api/shop-portal/return-media/",{method:"POST",body:n})}};import{media as kt,absolutizeApiUrl as L}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Lt,isSvgUrl as Jt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as xt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Dt,webRuntimeSiteSlug as Y}from"efficient-web-builder/format/lib/web-runtime";import{readDealerList as Ht}from"../sections/dealer-finder.js";import{SIGN_UP_PATH as Ft,SIGN_UP_VERIFY_PATH as Mt,SIGN_UP_WAITING_PATH as Bt,WORKSPACE_FINDS_PATH as qt,WORKSPACE_FIND_OPEN_PATH as Gt,signInUrlOf as Wt,readLinkAnswer as Q,readSignUpAvailability as jt,readSignUpSent as zt,signUpAvailabilityPath as Kt}from"../sections/sign-up.js";function S(t){if(typeof t=="string")return t.startsWith("/media/")?kt(t):t;if(Array.isArray(t))return t.map(S);if(t&&typeof t=="object"){const e={};for(const[n,s]of Object.entries(t))e[n]=n==="captions"&&s&&typeof s=="object"&&!Array.isArray(s)?Object.fromEntries(Object.entries(s).map(([u,l])=>[S(u),l])):S(s);return e}return t}import{PRODUCT_API_BASE as Ke}from"./origins.js";const tt=typeof window>"u"&&H!=="",Vt=tt?H:pt,Xt=Dt,b=()=>({baseUrl:Xt(),audience:null});function c(t,e){const n=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${n}`}const et=100,at=50;function J(t,e,n){const s=new URLSearchParams;for(const[u,l]of Object.entries(e))l!=null&&l!==""&&s.set(u,String(l));return s.set("pageSize",String(et)),n&&s.set("cursor",n),`/api/v1${t}?${s.toString()}`}function Zt(t,e){return J("/wheels",{process:t},e)}const rt=et;function Yt(t,e){return J("/wheels",{slug:t.join(",")},e)}function Qt(t,e,n){return J("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},n)}function te(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function x(t,e,n=()=>!1,s=()=>!1){const u=[];let l=null;try{for(let y=0;y<at;y++){const a=await i(await e(l),await d());if(u.push(...m(a)),l=te(a.next),!l)break;if(s(u))return u}l&&console.warn(`[${t}] stopped at ${at} pages (${u.length} rows); catalog may be truncated`)}catch(y){if(n(y))throw y;console.warn(`[${t}] product API unavailable, returning []`,y)}return u}const nt=t=>t instanceof w&&t.status===400;function st(t){return t.flatMap(e=>e.kind==="alloy-wheel"?U([e]):[e])}async function ot(){return(await ee()).host}async function ee(){try{const{headers:t}=await import("next/headers"),e=await t(),n=l=>l?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,s=n(e.get(ut)??e.get("x-forwarded-host")??e.get("host")),u=n(e.get("host"));return{host:s,matchesRequestHost:s!==null&&s===u}}catch{return{host:null,matchesRequestHost:!1}}}async function ae(){try{const{headers:t}=await import("next/headers");return ht((await t()).get(ft))}catch{return null}}async function re(){try{const{headers:t}=await import("next/headers");return(await t()).get(lt)||null}catch{return null}}async function ne(){const t=await re();if(t)return`site=${encodeURIComponent(t)}`;const e=await ot();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=Y();return e?$(t,`site=${encodeURIComponent(e)}`):t}return $(t,await ne())}function $(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const se="preview";async function oe(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(dt)}catch{return null}}async function ie(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function D(t,e){const n=await oe();if(n===null)return[await f(t),await d(e)];const s=$(await f(t),`${se}=${encodeURIComponent(n)}`),{next:u,cache:l,...y}=e??{},a=await d({...y,cache:"no-store"}),r=await ie();return r&&(a.headers={...a.headers,"user-agent":r}),[s,a]}async function ce(t){if(!tt)return;const[e,n]=await Promise.all([ot(),ae()]),s=yt(e,n,t);return Object.keys(s).length>0?s:void 0}async function d(t){const e=await ce(gt(t)),n={baseUrl:Vt,...t};return e&&(n.headers={...e,...t?.headers}),n}const R=typeof window>"u";function E(t,e){const n=new URLSearchParams;for(const[u,l]of Object.entries(e))l!==void 0&&l!==""&&n.set(u,String(l));const s=n.toString();return`/api/v1/fitment${t}${s?`?${s}`:""}`}const ke={listMakes:async t=>{if(R){const{fitmentData:n}=await import("./fitment-data.js");return n.makes(t)}const e=await i(E("/makes",{region:t}),b());return m(e)},listModels:async(t,e)=>{if(R){const{fitmentData:s}=await import("./fitment-data.js");return s.models(t,e)}const n=await i(E("/models",{make:t,region:e}),b());return m(n)},listYears:async(t,e,n)=>{if(R){const{fitmentData:u}=await import("./fitment-data.js");return u.years(t,e,n)}const s=await i(E("/years",{make:t,model:e,region:n}),b());return m(s)},listModifications:async(t,e,n,s)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.modifications(t,e,n,s)}const u=await i(E("/modifications",{make:t,model:e,year:n,region:s}),b());return m(u)},getStockFitment:async(t,e,n,s,u)=>{if(R){const{fitmentData:l}=await import("./fitment-data.js");return l.stockFitment(t,e,n,s,u)}return i(E("/stock-fitment",{make:t,model:e,year:n,modification:s,region:u}),b())}},Le={listWheels:async(t,e={})=>{const n=await x("products.listWheels",async s=>await f(Zt(t,s)),e.throwOnFailure?()=>!0:void 0,e.maxRows===void 0?void 0:s=>U([...s]).length>=e.maxRows);return U(S(n))},listWheelsBySlug:async(t,e={})=>{const n=[...new Set(t.map(a=>a.trim()).filter(Boolean))];if(n.length===0)return[];const s=[];for(let a=0;a<n.length;a+=rt)s.push(n.slice(a,a+rt));const u=await Promise.all(s.map(a=>x("products.listWheelsBySlug",async r=>await f(Yt(a,r)),e.throwOnFailure?()=>!0:nt))),l=new Set(n),y=u.flat().filter(a=>l.has(a.slug));return U(S(y))},listCatalog:async(t,e,n={})=>{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 s=await x("products.listCatalog",async u=>await f(Qt(t,e,u)),n.throwOnFailure?()=>!0:nt,n.maxRows===void 0?void 0:u=>st([...u]).length>=n.maxRows);return st(S(s))},getWheel:async t=>F(S(await i(await f(c(`/wheels/${t}`)),await d()))),getTyre:async t=>S(await i(await f(c(`/tyres/${t}`)),await d())),listBundles:async(t={})=>{try{return await i(await f(c("/bundles")),await d())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(c(`/bundles/${t}`)),await d()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:n=null}=t;if(typeof window>"u"){const{listGalleryBuilds:s}=await import("./gallery-builds-data.js");return S(s(e,n))}try{const s=new URLSearchParams;e&&s.set("process",e),n&&s.set("wheelSlug",n);const u=s.toString(),l=await i(`/api/v1/gallery-builds${u?`?${u}`:""}`,b());return S(m(l))}catch(s){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",s),[]}},getSite:async()=>i(await f(c("/site")),await d()),getSiteBySlug:async t=>i(`${c("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await d():void 0),listPages:async()=>S(await i(await f(c("/pages")),await d())),listPopups:async()=>i(await f(c("/popups")),await d()),listProductTemplates:async()=>{try{return await i(await f(c("/product-templates")),await d())}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(`${c("/dynamic-pages")}${e}`),await d())}catch(n){if(n instanceof w&&n.status===404)return[];throw n}},getRecord:async(t,e)=>{try{return await i(await f(c(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await d())}catch(n){if(n instanceof w&&n.status===404)return null;throw n}},listRecordKeys:async t=>{try{const e=await i(await f(c(`/records/${encodeURIComponent(t)}`)),await d({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(n=>typeof n=="string"&&n!==""):[]}catch(e){if(e instanceof w&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(c("/product-type-choices")),await d())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(c("/field-usage")),await d())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const n=e.record?`?record=${encodeURIComponent(e.record)}`:"",[s,u]=await D(c(`/pages/${t}`)+n,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return S(await i(s,u))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const n=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(c("/blog-posts")+n,await d())).map(u=>({...u,coverImage:L(u.coverImage)??""}))}catch(s){if(e)throw s;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(c(`/blog-posts/${t}`),await d());return{...e,coverImage:L(e.coverImage)??""}},createOrder:async t=>i(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>g(c("/orders"),await d({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(c("/orders/lookup"),await d({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(c("/payments/intent"),await d({method:"POST",body:JSON.stringify(t)})),releaseCheckout:async t=>i(c("/checkouts/release"),await d({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(c("/payments/paypal/order"),await d({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(c("/payments/paypal/capture"),await d({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(c("/payments/afterpay/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(c("/payments/afterpay/capture"),await d({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(c("/payments/square/charge"),await d({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(c("/payments/gocardless/billing-request"),await d({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(c("/payments/gocardless/complete"),await d({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(c("/payments/zip/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(c("/payments/zip/capture"),await d({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(c("/payments/klarna/checkout"),await d({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(c("/payments/klarna/capture"),await d({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(c("/stock-alerts"),await d({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(c("/pre-order-intents"),await d({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(c("/newsletter-subscriptions"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(c("/newsletter-unsubscribe"),await d({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(c("/carts"),await d({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(c("/carts/restore"),await d({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(c("/carts/unsubscribe"),await d({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 n=c("/reviews"),s=e.toString();try{return await i(await f(s?`${n}?${s}`:n),await d())}catch(u){return console.warn("[products.listReviews] product API unavailable, returning []",u),[]}},submitReview:async t=>i(c("/reviews"),await d({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(c(`/forms/${encodeURIComponent(t)}`),await d()),submitForm:async(t,e)=>i(c(`/forms/${encodeURIComponent(t)}/submissions`),await d({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(c("/shipping-methods"),await d())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(c(`/countries/${encodeURIComponent(t)}/subdivisions`),await d())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=c("/cart/quote"),n=await d({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await X(e,n)).data:i(e,n)},validateCoupon:async t=>{const{data:e,asShopper:n}=await X(c("/coupons/validate"),await d({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:n}},getHeaderSettings:async()=>{const t=M({method:"GET"}),e=await i(...await D(c("/header-settings"),{signal:t})),n=L(e.logoUrl);let s=null,u=null;if(n&&Jt(n)){const l=await Lt(n,t);l&&(s=l.reversed,u=l.inkIsDark)}return{...e,logoUrl:n,logoReversed:s,logoInkIsDark:u}},getThemeSettings:async()=>i(...await D(c("/theme-settings"))),getChatSettings:async()=>i(await f(c("/chat-settings")),await d())},Je={listServices:async()=>{try{return await i(c("/bookings/services"),await d())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(c(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await d()),create:async t=>i(c("/bookings"),await d({method:"POST",body:JSON.stringify(t)})),get:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}`),await d()),cancel:async t=>i(c(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await d({method:"POST"})),createPaymentIntent:async t=>i(c("/bookings/payments/intent"),await d({method:"POST",body:JSON.stringify({manageToken:t})}))};class de extends Error{slug;count;constructor(e,n){super(`Slug "${e}" exists on ${n} websites; a site is required to pick one.`),this.slug=e,this.count=n,this.name="AmbiguousPageSlugError"}}const C=(t,e,n)=>{const s=new URLSearchParams({...e?{site:e}:{},...n?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${s?`?${s}`:""}`},N=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,ue=t=>`${N(t)}currencies/`,le="/api/storefront/media/ingest/";class pe 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 ye(){const t=xt();if(!t)throw new pe;return`${le}?${new URLSearchParams({site:t})}`}const he="X-Puck-Media-Manifest",it=mt.contentHash,I={"X-Media-Manifest":it,[he]:it},xe=ct({});function ct(t){return(e,n={})=>{const s=Ut(),u=t.headers||s?{...s?{"Accept-Language":s}:{},...t.headers,...n.headers}:void 0;return i(e,{...n,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...u?{headers:u}:{},audience:t.audience??Et()})}}function fe(t={}){const e=ct(t),n=t.siteDrafts===!0,s=a=>C("header-settings",a,n),u=a=>C("theme-settings",a,n),l=a=>C("chat-settings",a,n),y=a=>C("social-settings",a,n);return{findPageBySlug:async(a,r,o)=>{const p=new URLSearchParams({slug:a});o&&p.set("site",o);const h=await e(`/api/storefront/pages/?${p.toString()}`,{token:r}),P=m(h);if(!o&&P.length>1)throw new de(a,P.length);return P[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,o,p,h)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:p,...h?{client_id:h}:{}}),token:o}),duplicatePage:(a,r,o)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:o}),geocode:(a,r,o)=>e(`/api/storefront/geocode/?${new URLSearchParams(o?{q:a,country:o}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,o,p=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:o,takeover:p}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,o)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:I,token:o}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,o)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),listTemplatePages:async(a,r)=>{const o=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return m(o)},findTemplatePageBySlug:async(a,r,o)=>{const p=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:o});return m(p)[0]??null},createTemplatePage:(a,r,o)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:I,token:o}),saveTemplatePageLayout:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:I,token:o}),deleteTemplatePage:(a,r,o)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...o?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/pages/?${o.toString()}`,{token:a});return m(p)},createPage:(a,r,o,p)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:o}),token:p}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(s(r),{token:a}),listMenus:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("site",r);const p=await e(`/api/storefront/menus/?${o}`,{token:a});return m(p)},listBlogPosts:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/blog-posts/?${o.toString()}`,{token:a});return m(p)},listFieldUsage:async(a,r)=>{const o=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(o?.entries)?o.entries:[]},listCategories:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.visibleOnly&&o.set("is_visible","true"),r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/categories/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.sort_order-_.sort_order||P.name.localeCompare(_.name))},listForms:async(a,r={})=>{const o=new URLSearchParams({no_page:"true"});r.siteId&&o.set("site",r.siteId);const p=await e(`/api/storefront/forms/?${o.toString()}`,{token:a});return[...m(p)].sort((P,_)=>P.title.localeCompare(_.title))},listWheelSummaries:async(a,r={})=>{const o=new URLSearchParams;r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/wheel-curations/summaries/${p?`?${p}`:""}`,{token:a});return S(h)},listProducts:async(a,r={})=>{const o=new URLSearchParams;r.kinds?.length&&o.set("kind",r.kinds.join(",")),r.siteId&&o.set("site",r.siteId);const p=o.toString(),h=await e(`/api/storefront/products/${p?`?${p}`:""}`,{token:a});return S(h)},getWheelDetail:async(a,r,o={})=>{const p=new URLSearchParams({slug:r});return o.siteId&&p.set("site",o.siteId),F(S(await e(`/api/storefront/wheel-curations/detail/?${p.toString()}`,{token:a})))},updateHeaderSettings:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e(N(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return m(r)},listSiteCurrencies:async(a,r)=>{const o=await e(ue(a),{token:r});return Array.isArray(o)?o:[]},publishSite:(a,r)=>e(`${N(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${N(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(u(r),{token:a}),updateThemeSettings:(a,r,o)=>e(u(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getMyPreferences:async a=>(await e("/api/auth/me/",{token:a})).preferences??{},updateMyPreferences:(a,r)=>e("/api/auth/me/",{method:"PATCH",body:JSON.stringify({preferences:a}),token:r}),getChatSettings:(a,r)=>e(l(r),{token:a}),updateChatSettings:(a,r,o)=>e(l(o),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(y(r),{token:a}),updateSocialSettings:(a,r,o)=>e(y(o),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,o)=>{const p=new FormData;return p.append("logo",a),e(s(o),{method:"PATCH",body:p,token:r})},clearHeaderLogo:(a,r)=>e(s(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,o)=>e(s(o),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const o=new FormData;return o.append("file",a),e(ye(),{method:"POST",body:o,token:r})},listMedia:async(a,r)=>{const o=new URLSearchParams({no_page:"true"});r&&o.set("kind",r);const p=await e(`/api/storefront/media-assets/?${o.toString()}`,{token:a});return m(p)}}}const De=fe({siteDrafts:!0});function ge(t){const e=t.trim();return e?`/api/v1/dealers?${new URLSearchParams({near:e}).toString()}`:"/api/v1/dealers"}async function He(t){return Ht(await i(ge(t)))}const T={audience:null,baseUrl:""};async function Fe(t,e){return jt(await i(Kt(t,e),T))}async function Me(t){return zt(await i(Ft,{...T,method:"POST",body:JSON.stringify(t)}))}async function Be(t){try{const e=await i(Mt,{...T,method:"POST",body:JSON.stringify({token:t})});return Q(202,e)}catch(e){if(e instanceof w)return Q(e.status,e.data);throw e}}async function qe(t,e){await i(Bt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function Ge(t,e){await i(qt,{...T,method:"POST",body:JSON.stringify({email:e.trim(),...t?{product:t}:{}})})}async function We(t){try{return Wt(await i(Gt,{...T,method:"POST",body:JSON.stringify({token:t})}))}catch(e){if(e instanceof w)return"";throw e}}export{St as API_URL,de as AmbiguousPageSlugError,w as ApiError,Tt as BROWSER_READ_TIMEOUT_MS,Ot as EFFICIENT_CLIENT_CLOSED_MESSAGE,pe as MediaUploadDestinationError,se as PREVIEW_PARAM,Ke as PRODUCT_API_BASE,bt as SERVER_READ_TIMEOUT_MS,v as SERVER_UNREACHABLE_MESSAGE,k as STATUS_NETWORK_ERROR,xe as adminFetch,vt as api,i as apiFetch,$ as appendSiteQuery,Ge as askForWorkspaces,Me as askToSignUp,Je as bookings,fe as createStorefrontAdmin,ge as dealersPath,M as defaultRequestDeadline,ye as editorMediaUploadPath,Et as editorPortalAudience,Ut as editorRequestLanguage,He as fetchDealers,Fe as fetchSignUpAvailability,ke as fitment,qe as joinSignUpWaitingList,Be as openSignUpLink,We as openWorkspaceFind,Le as products,At as readDeadlineMs,ae as resolveClientIp,S as resolveMediaUrls,oe as resolvePreviewToken,ot as resolveSiteHost,ee as resolveSiteHostSource,re as resolveSiteSlug,_e as setEditorLanguage,Ee as setEditorPortalAudience,De as storefrontAdmin};
|
|
@@ -1677,7 +1677,19 @@ export interface components {
|
|
|
1677
1677
|
dropdownItems: {
|
|
1678
1678
|
label: string;
|
|
1679
1679
|
url: string;
|
|
1680
|
+
description?: string;
|
|
1681
|
+
image?: string;
|
|
1682
|
+
badge?: string;
|
|
1680
1683
|
}[];
|
|
1684
|
+
dropdownAside?: {
|
|
1685
|
+
eyebrow: string;
|
|
1686
|
+
title: string;
|
|
1687
|
+
text: string;
|
|
1688
|
+
links: {
|
|
1689
|
+
label: string;
|
|
1690
|
+
url: string;
|
|
1691
|
+
}[];
|
|
1692
|
+
} | null;
|
|
1681
1693
|
}[];
|
|
1682
1694
|
menuPosition: "left" | "center" | "right" | "beside";
|
|
1683
1695
|
menuSplit: number;
|
|
@@ -7,7 +7,7 @@ export declare function serverNarrowedKinds(shown: readonly ProductKind[]): Prod
|
|
|
7
7
|
export declare function catalogVehicleQuery(vehicle: VehicleSelection | null | undefined): TyreFitVehicleQuery | null;
|
|
8
8
|
export interface CatalogSliceRequest {
|
|
9
9
|
kinds: ProductKind[];
|
|
10
|
-
vehicle: TyreFitVehicleQuery
|
|
10
|
+
vehicle: TyreFitVehicleQuery;
|
|
11
11
|
}
|
|
12
|
-
export declare function catalogSliceRequest(narrowedKinds: readonly ProductKind[], vehicle: TyreFitVehicleQuery | null
|
|
12
|
+
export declare function catalogSliceRequest(narrowedKinds: readonly ProductKind[], vehicle: TyreFitVehicleQuery | null): CatalogSliceRequest | null;
|
|
13
13
|
export declare function mergeNarrowedSlice(catalog: readonly PlpItem[], narrowedKinds: readonly ProductKind[], slugs: readonly string[] | null): PlpItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{itemKind as i,itemSlug as u}from"./plp-item.js";import{isCompleteVehicle as l}from"../wheels/plp-vehicle-params.js";const f=["tyre"];function c(r){return f.filter(t=>r.includes(t))}function p(r){return!r||!l(r)||r.year===null?null:{make:r.make,model:r.model,year:r.year,modification:r.modification}}function d(r,t
|
|
1
|
+
import{itemKind as i,itemSlug as u}from"./plp-item.js";import{isCompleteVehicle as l}from"../wheels/plp-vehicle-params.js";const f=["tyre"];function c(r){return f.filter(t=>r.includes(t))}function p(r){return!r||!l(r)||r.year===null?null:{make:r.make,model:r.model,year:r.year,modification:r.modification}}function d(r,t){return r.length===0||!t?null:{kinds:[...r],vehicle:t}}function s(r,t,e){if(e===null||t.length===0)return[...r];const o=new Set(e);return r.filter(n=>!t.includes(i(n))||o.has(u(n)))}export{f as SERVER_NARROWED_KINDS,d as catalogSliceRequest,p as catalogVehicleQuery,s as mergeNarrowedSlice,c as serverNarrowedKinds};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
2
|
export declare const CONTACT_KIND_OPTIONS: {
|
|
3
3
|
label: string;
|
|
4
|
-
value: "phone" | "
|
|
4
|
+
value: "phone" | "email" | "whatsapp" | "telegram" | "line" | "wechat" | "kakaotalk";
|
|
5
5
|
}[];
|
|
6
6
|
export declare const CONTACT_KIND_FALLBACK = "phone";
|
|
7
7
|
export declare const ContactCardsMeta: Omit<BlockRender, "render">;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const SIGN_UP_LEGAL: {
|
|
3
|
+
readonly terms: "https://efficient-erp.com/terms";
|
|
4
|
+
readonly privacy: "https://efficient-erp.com/privacy";
|
|
5
|
+
};
|
|
6
|
+
export declare const SignUpMeta: Omit<BlockRender, "render">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SIGN_UP_WORDS as r}from"../../../../sections/sign-up.js";const e={terms:"https://efficient-erp.com/terms",privacy:"https://efficient-erp.com/privacy"},p={label:"Sign-up Form",defaultProps:{mode:"create",product:"",productName:"",freeLine:r.freeLine,zone:"",askCountry:!1,termsHref:e.terms,privacyHref:e.privacy,findHref:"/find"}};export{e as SIGN_UP_LEGAL,p as SignUpMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import i from"../../../../../components/SignUpSection.js";import{SignUpMeta as a}from"./meta.js";const o=()=>({firstName:"Amelia",lastName:"Chen",email:"amelia@harbourlane.co",company:"Harbour Lane Studio",slug:"harbourlane",country:"AU",currency:"AUD"}),r=(e,n="")=>typeof e=="string"?e.trim():n,c={...a,render:e=>t(i,{mode:e.mode==="find"?"find":"create",product:r(e.product),productName:r(e.productName),freeLine:r(e.freeLine),zone:r(e.zone),askCountry:e.askCountry===!0,termsHref:r(e.termsHref),privacyHref:r(e.privacyHref),findHref:r(e.findHref),contained:e.contained!==!1,sample:e.editor?.isEditing?o():void 0})};export{c as SignUpRender,o as signUpSample};
|
|
@@ -4,6 +4,7 @@ export declare const SERVICE_METAS: {
|
|
|
4
4
|
BookingBox: Omit<BlockRender, "render">;
|
|
5
5
|
ContactRouting: Omit<BlockRender, "render">;
|
|
6
6
|
DealerFinder: Omit<BlockRender, "render">;
|
|
7
|
+
SignUp: Omit<BlockRender, "render">;
|
|
7
8
|
Events: Omit<BlockRender, "render">;
|
|
8
9
|
Footer: Omit<BlockRender, "render">;
|
|
9
10
|
FooterDivider: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{DealerFinderMeta as m}from"./DealerFinder/meta.js";import{
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{DealerFinderMeta as m}from"./DealerFinder/meta.js";import{SignUpMeta as a}from"./SignUp/meta.js";import{EventsMeta as p}from"./Events/meta.js";import{FooterDividerMeta as n}from"./FooterDivider/meta.js";import{FooterEmailSignupMeta as M}from"./FooterEmailSignup/meta.js";import{FooterGroupMeta as f}from"./FooterGroup/meta.js";import{FooterLogoMeta as g}from"./FooterLogo/meta.js";import{FooterMenuMeta as F}from"./FooterMenu/meta.js";import{ArticleBodyMeta as s}from"./ArticleBody/meta.js";import{FooterMeta as l}from"./Footer/meta.js";import{FooterSocialMeta as u}from"./FooterSocial/meta.js";import{FooterPaymentMeta as B}from"./FooterPayment/meta.js";import{FooterTextMeta as S}from"./FooterText/meta.js";import{FormMeta as c}from"./Form/meta.js";import{LegalLineBlockMeta as b}from"./LegalLineBlock/meta.js";import{MenuLinkBlockMeta as E}from"./MenuLinkBlock/meta.js";import{OpeningHoursMeta as d}from"./OpeningHours/meta.js";import{RateTableMeta as R}from"./RateTable/meta.js";import{MessagingCardsMeta as k}from"./MessagingCards/meta.js";import{FooterMessagingMeta as T}from"./FooterMessaging/meta.js";import{ContactCardsMeta as C}from"./ContactCards/meta.js";import{RatingBlockMeta as v}from"./RatingBlock/meta.js";import{ReviewFormMeta as L}from"./ReviewForm/meta.js";import{ReviewsMeta as x}from"./Reviews/meta.js";import{SiteFooterMeta as A}from"./SiteFooter/meta.js";import{SiteHeaderMeta as D}from"./SiteHeader/meta.js";import{SubmitBoxMeta as _}from"./SubmitBox/meta.js";import{SubmitBuildMeta as w}from"./SubmitBuild/meta.js";import{SubscribeBlogsMeta as y}from"./SubscribeBlogs/meta.js";import{SubscribeMeta as H}from"./Subscribe/meta.js";const uo={AppointmentBooking:r,BookingBox:e,ContactRouting:i,DealerFinder:m,SignUp:a,Events:p,Footer:l,FooterDivider:n,FooterEmailSignup:M,FooterGroup:f,FooterLogo:g,FooterMenu:F,ArticleBody:s,FooterSocial:u,FooterPayment:B,FooterText:S,Form:c,LegalLineBlock:b,MenuLinkBlock:E,OpeningHours:d,RateTable:R,MessagingCards:k,FooterMessaging:T,ContactCards:C,RatingBlock:v,ReviewForm:L,Reviews:x,[o]:A,[t]:D,SubmitBox:_,SubmitBuild:w,Subscribe:H,SubscribeBlogs:y};export{uo as SERVICE_METAS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{ArticleBodyRender as t}from"./ArticleBody/render.js";import{BookingBoxRender as i}from"./BookingBox/render.js";import{ContactRoutingRender as m}from"./ContactRouting/render.js";import{DealerFinderRender as n}from"./DealerFinder/render.js";import{
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/document/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{ArticleBodyRender as t}from"./ArticleBody/render.js";import{BookingBoxRender as i}from"./BookingBox/render.js";import{ContactRoutingRender as m}from"./ContactRouting/render.js";import{DealerFinderRender as n}from"./DealerFinder/render.js";import{SignUpRender as R}from"./SignUp/render.js";import{EventsRender as p}from"./Events/render.js";import{FooterRender as d}from"./Footer/render.js";import{FooterDividerRender as f}from"./FooterDivider/render.js";import{FooterEmailSignupRender as a}from"./FooterEmailSignup/render.js";import{FooterGroupRender as g}from"./FooterGroup/render.js";import{FooterLogoRender as F}from"./FooterLogo/render.js";import{FooterMenuRender as s}from"./FooterMenu/render.js";import{FooterSocialRender as l}from"./FooterSocial/render.js";import{FooterPaymentRender as u}from"./FooterPayment/render.js";import{FooterTextRender as B}from"./FooterText/render.js";import{FormRender as S}from"./Form/render.js";import{LegalLineBlockRender as c}from"./LegalLineBlock/render.js";import{MenuLinkBlockRender as E}from"./MenuLinkBlock/render.js";import{OpeningHoursRender as b}from"./OpeningHours/render.js";import{RateTableRender as k}from"./RateTable/render.js";import{MessagingCardsRender as C}from"./MessagingCards/render.js";import{FooterMessagingRender as T}from"./FooterMessaging/render.js";import{ContactCardsRender as v}from"./ContactCards/render.js";import{RatingBlockRender as L}from"./RatingBlock/render.js";import{ReviewFormRender as M}from"./ReviewForm/render.js";import{ReviewsRender as x}from"./Reviews/render.js";import{SiteFooterRender as D}from"./SiteFooter/render.js";import{SiteHeaderRender as A}from"./SiteHeader/render.js";import{SubmitBoxRender as _}from"./SubmitBox/render.js";import{SubmitBuildRender as w}from"./SubmitBuild/render.js";import{SubscribeRender as y}from"./Subscribe/render.js";import{SubscribeBlogsRender as H}from"./SubscribeBlogs/render.js";const uo={AppointmentBooking:e,BookingBox:i,ContactRouting:m,DealerFinder:n,SignUp:R,Events:p,Footer:d,FooterDivider:f,FooterEmailSignup:a,FooterGroup:g,FooterLogo:F,FooterMenu:s,ArticleBody:t,FooterSocial:l,FooterPayment:u,FooterText:B,Form:S,LegalLineBlock:c,MenuLinkBlock:E,OpeningHours:b,RateTable:k,MessagingCards:C,FooterMessaging:T,ContactCards:v,RatingBlock:L,ReviewForm:M,Reviews:x,[o]:D,[r]:A,SubmitBox:_,SubmitBuild:w,Subscribe:y,SubscribeBlogs:H};export{uo as SERVICE_RENDERS};
|
|
@@ -1155,6 +1155,40 @@
|
|
|
1155
1155
|
}
|
|
1156
1156
|
}
|
|
1157
1157
|
},
|
|
1158
|
+
"SignUp": {
|
|
1159
|
+
"product": {
|
|
1160
|
+
"type": "custom",
|
|
1161
|
+
"__text": {
|
|
1162
|
+
"control": "text",
|
|
1163
|
+
"label": "Product key",
|
|
1164
|
+
"placeholder": "crm"
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1167
|
+
"productName": {
|
|
1168
|
+
"type": "custom",
|
|
1169
|
+
"__text": {
|
|
1170
|
+
"control": "text",
|
|
1171
|
+
"label": "Product name",
|
|
1172
|
+
"placeholder": "The product's name"
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
"freeLine": {
|
|
1176
|
+
"type": "custom",
|
|
1177
|
+
"__text": {
|
|
1178
|
+
"control": "text",
|
|
1179
|
+
"label": "Free plan line",
|
|
1180
|
+
"placeholder": "Free to start. No card needed."
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
"zone": {
|
|
1184
|
+
"type": "custom",
|
|
1185
|
+
"__text": {
|
|
1186
|
+
"control": "text",
|
|
1187
|
+
"label": "Workspace domain",
|
|
1188
|
+
"placeholder": "This website's own"
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
},
|
|
1158
1192
|
"Events": {
|
|
1159
1193
|
"num": {
|
|
1160
1194
|
"type": "custom",
|