efficient-storefront-blocks 0.135.0 → 0.135.2

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.
@@ -1,3 +1,4 @@
1
+ export declare const GALLERY_DETAIL_SIZES = "(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw";
1
2
  export declare const galleryTileNumber: (index: number, total: number) => string;
2
3
  export interface Build {
3
4
  car: string;
@@ -25,6 +26,7 @@ interface Props {
25
26
  styleOwner?: string;
26
27
  editing?: boolean;
27
28
  setCount?: number;
29
+ sizes?: string;
28
30
  }
29
- export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing, setCount }: Props): import("react").JSX.Element;
31
+ export default function GalleryCard({ build, hiddenMobile, alwaysShowOverlay, forceHover, index, total, ratio, captionPlace, display, displayPhone, styleOwner, editing, setCount, sizes }: Props): import("react").JSX.Element;
30
32
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import{useState as S}from"react";import T from"next/image";import u from"efficient-web-builder/render/components/Placeholder";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import{galleryCaptionIsBelow as _,galleryCardRatioClass as w}from"efficient-web-builder/format/lib/content/gallery-card-layout";import{partDisplayClass as R}from"efficient-web-builder/format/lib/content/part-display";import{PART_STYLE_KIND_ATTR as A,PART_STYLE_OWNER_ATTR as C}from"efficient-web-builder/render/lib/document/text-parts";import E from"efficient-web-builder/render/components/PartStyledKind";import{gallerySetChip as L}from"../lib/sections/gallery-mosaic.js";const P=(e,o)=>`${String(e).padStart(2,"0")} / ${String(o).padStart(2,"0")}`;function D({build:e,hiddenMobile:o,alwaysShowOverlay:n,forceHover:l,index:c,total:m,ratio:p,captionPlace:b,display:N,displayPhone:z,styleOwner:h,editing:f=!1,setCount:v}){const a=g=>R(N,z,g),r=g=>f&&h?{[C]:h,[A]:`@${g}`}:{},i=(g,y)=>!f&&h?t(E,{kind:`@${g}`,shared:!0,children:y}):y,[k,j]=S(!1);if(v!=null)return t(I,{build:e,count:v,ratio:p,shown:a,keptAttrs:r,kept:i});const $=_(b),x=s("div",{className:["sf-card group relative overflow-hidden bg-surface-2",w(p),o?"max-view-wide:hidden":""].join(" "),children:[s("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"scale-[1.06] opacity-0 [filter:brightness(0.5)]":"group-hover:scale-[1.06] group-hover:opacity-0 group-hover:[filter:brightness(0.5)]"].join(" "),children:[t(u,{label:e.imageLabel,src:e.imageSrc}),!n&&t("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.35)"}})]}),t("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"opacity-100 scale-[1.06] [filter:brightness(0.5)]":"opacity-0 group-hover:scale-[1.06] group-hover:opacity-100 group-hover:[filter:brightness(0.5)]"].join(" "),style:{background:"var(--site-surface)"},children:e.detailSrc&&t(T,{src:e.detailSrc,alt:"",fill:!0,sizes:"(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw",loading:"lazy",className:"absolute inset-0 z-[3] object-cover",style:{display:k?"none":"block"},onError:()=>j(!0)})}),(e.process||c!=null&&m!=null)&&s("div",{className:"pointer-events-none absolute top-3 left-3 right-3 z-[3] flex items-baseline gap-2 max-view-wide:top-2.5 max-view-wide:left-2.5 max-view-wide:right-2.5",children:[e.process&&t("span",{...r("tag"),className:["min-w-0 truncate font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-accent",a("tag"),"transition-opacity duration-300 ease-out",n||l?"opacity-100":"opacity-0 group-hover:opacity-100 max-view-wide:opacity-100"].join(" "),children:i("tag",d(e.process))}),c!=null&&m!=null&&t("span",{...r("number"),className:`ml-auto shrink-0 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] ${a("number")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:i("number",P(c,m))})]}),t("div",{className:["absolute inset-0 z-[2]","transition-[opacity,transform] duration-300 ease-out",n||l?"opacity-100 translate-y-0":"opacity-0 translate-y-2 group-hover:opacity-100 group-hover:translate-y-0 max-view-wide:opacity-100 max-view-wide:translate-y-0"].join(" "),style:{color:"var(--overlay-fg)",background:n?"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)":"linear-gradient(180deg, transparent 40%, rgba(10,10,10,.85) 100%)"},children:s("div",{className:"absolute inset-x-0 bottom-0 top-9 flex flex-col justify-end gap-1 overflow-hidden p-6 max-view-wide:top-8 max-view-wide:p-3.5",children:[e.car&&t("div",{...r("eyebrow"),className:`truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-accent max-view-wide:text-[length:var(--size-label,11px)] max-view-wide:tracking-[0.15em] ${a("eyebrow")}`.trim(),children:i("eyebrow",e.car)}),e.wheel&&t("div",{...r("title"),className:`font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.05] tracking-[-0.02em] max-view-wide:text-[length:var(--size-body,16px)] ${n?"uppercase ":""}${a("title")}`.trim(),children:i("title",e.wheel)}),e.finish&&t("div",{...r("meta"),className:`mt-1.5 flex gap-3.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.12em] ${a("meta")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:t("span",{children:i("meta",d(e.finish))})})]})})]});return $?s("div",{className:o?"max-view-wide:hidden":"",children:[x,s("div",{className:"bg-surface px-3.5 pt-3 pb-3.5",children:[e.wheel&&t("div",{...r("title"),className:`font-display text-[length:var(--size-body,15px)] font-medium leading-[1.25] tracking-[-0.01em] text-fg ${a("title")}`.trim(),children:i("title",e.wheel)}),(e.finish||e.car)&&t("div",{...r(e.finish?"meta":"eyebrow"),className:`mt-0.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] text-fg-dim ${a(e.finish?"meta":"eyebrow")}`.trim(),children:i(e.finish?"meta":"eyebrow",d(e.finish||e.car))})]})]}):x}function I({build:e,count:o,ratio:n,shown:l,keptAttrs:c,kept:m}){const p=L(o);return s("div",{className:`sf-card relative overflow-hidden bg-surface-2 ${w(n)}`,style:{color:"var(--overlay-fg)"},children:[t("div",{className:"absolute inset-0 flex items-center justify-center",children:t(u,{label:e.imageLabel,src:e.imageSrc})}),t("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 0%, transparent) 45%, color-mix(in srgb, var(--overlay-scrim) 70%, transparent))"}}),p&&t("span",{"data-gallery-set-chip":"",className:"absolute right-3 top-3 z-1 bg-overlay-scrim/45 px-2 py-1 text-[length:var(--size-label,11px)] tracking-[0.12em]",children:p}),s("div",{className:"absolute bottom-[18px] left-5 right-5 z-1 max-view-wide:bottom-2.5 max-view-wide:left-3",children:[e.wheel&&t("div",{...c("title"),className:`text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] opacity-85 ${l("title")}`.trim(),children:m("title",d(e.wheel))}),e.car&&t("div",{...c("eyebrow"),className:`mt-1 text-lg leading-normal max-view-wide:text-sm ${l("eyebrow")}`.trim(),children:m("eyebrow",e.car)})]})]})}export{D as default,P as galleryTileNumber};
1
+ "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{useState as T}from"react";import _ from"next/image";import b from"efficient-web-builder/render/components/Placeholder";import{withRMark as f}from"efficient-web-builder/render/components/RMark";import{galleryCaptionIsBelow as R,galleryCardRatioClass as N}from"efficient-web-builder/format/lib/content/gallery-card-layout";import{partDisplayClass as A}from"efficient-web-builder/format/lib/content/part-display";import{PART_STYLE_KIND_ATTR as E,PART_STYLE_OWNER_ATTR as L}from"efficient-web-builder/render/lib/document/text-parts";import C from"efficient-web-builder/render/components/PartStyledKind";import{gallerySetChip as I}from"../lib/sections/gallery-mosaic.js";const D="(max-width: 800px) 100vw, (max-width: 1500px) 33vw, 25vw",P=(e,o)=>`${String(e).padStart(2,"0")} / ${String(o).padStart(2,"0")}`;function G({build:e,hiddenMobile:o,alwaysShowOverlay:s,forceHover:l,index:c,total:m,ratio:p,captionPlace:d,display:k,displayPhone:z,styleOwner:v,editing:x=!1,setCount:y,sizes:h}){const a=g=>A(k,z,g),r=g=>x&&v?{[L]:v,[E]:`@${g}`}:{},i=(g,w)=>!x&&v?t(C,{kind:`@${g}`,shared:!0,children:w}):w,[j,$]=T(!1);if(y!=null)return t(Y,{build:e,count:y,ratio:p,sizes:h,shown:a,keptAttrs:r,kept:i});const S=R(d),u=n("div",{className:["sf-card group relative overflow-hidden bg-surface-2",N(p),o?"max-view-wide:hidden":""].join(" "),children:[n("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"scale-[1.06] opacity-0 [filter:brightness(0.5)]":"group-hover:scale-[1.06] group-hover:opacity-0 group-hover:[filter:brightness(0.5)]"].join(" "),children:[t(b,{label:e.imageLabel,src:e.imageSrc,...h?{sizes:h}:{}}),!s&&t("div",{className:"absolute inset-0",style:{background:"rgba(0,0,0,0.35)"}})]}),t("div",{className:["absolute inset-0 z-[1] flex items-center justify-center transition-[transform,filter,opacity] duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",l?"opacity-100 scale-[1.06] [filter:brightness(0.5)]":"opacity-0 group-hover:scale-[1.06] group-hover:opacity-100 group-hover:[filter:brightness(0.5)]"].join(" "),style:{background:"var(--site-surface)"},children:e.detailSrc&&t(_,{src:e.detailSrc,alt:"",fill:!0,sizes:h??D,loading:"lazy",className:"absolute inset-0 z-[3] object-cover",style:{display:j?"none":"block"},onError:()=>$(!0)})}),(e.process||c!=null&&m!=null)&&n("div",{className:"pointer-events-none absolute top-3 left-3 right-3 z-[3] flex items-baseline gap-2 max-view-wide:top-2.5 max-view-wide:left-2.5 max-view-wide:right-2.5",children:[e.process&&t("span",{...r("tag"),className:["min-w-0 truncate font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] text-accent",a("tag"),"transition-opacity duration-300 ease-out",s||l?"opacity-100":"opacity-0 group-hover:opacity-100 max-view-wide:opacity-100"].join(" "),children:i("tag",f(e.process))}),c!=null&&m!=null&&t("span",{...r("number"),className:`ml-auto shrink-0 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.24em] ${a("number")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:i("number",P(c,m))})]}),t("div",{className:["absolute inset-0 z-[2]","transition-[opacity,transform] duration-300 ease-out",s||l?"opacity-100 translate-y-0":"opacity-0 translate-y-2 group-hover:opacity-100 group-hover:translate-y-0 max-view-wide:opacity-100 max-view-wide:translate-y-0"].join(" "),style:{color:"var(--overlay-fg)",background:s?"linear-gradient(180deg, rgba(10,10,10,.55) 0%, transparent 35%, transparent 55%, rgba(10,10,10,.92) 100%)":"linear-gradient(180deg, transparent 40%, rgba(10,10,10,.85) 100%)"},children:n("div",{className:"absolute inset-x-0 bottom-0 top-9 flex flex-col justify-end gap-1 overflow-hidden p-6 max-view-wide:top-8 max-view-wide:p-3.5",children:[e.car&&t("div",{...r("eyebrow"),className:`truncate font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-accent max-view-wide:text-[length:var(--size-label,11px)] max-view-wide:tracking-[0.15em] ${a("eyebrow")}`.trim(),children:i("eyebrow",e.car)}),e.wheel&&t("div",{...r("title"),className:`font-heading3 text-[length:var(--size-headingSmall,22px)] font-medium leading-[1.05] tracking-[-0.02em] max-view-wide:text-[length:var(--size-body,16px)] ${s?"uppercase ":""}${a("title")}`.trim(),children:i("title",e.wheel)}),e.finish&&t("div",{...r("meta"),className:`mt-1.5 flex gap-3.5 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.12em] ${a("meta")}`.trim(),style:{color:"rgba(245,241,232,0.7)"},children:t("span",{children:i("meta",f(e.finish))})})]})})]});return S?n("div",{className:o?"max-view-wide:hidden":"",children:[u,n("div",{className:"bg-surface px-3.5 pt-3 pb-3.5",children:[e.wheel&&t("div",{...r("title"),className:`font-display text-[length:var(--size-body,15px)] font-medium leading-[1.25] tracking-[-0.01em] text-fg ${a("title")}`.trim(),children:i("title",e.wheel)}),(e.finish||e.car)&&t("div",{...r(e.finish?"meta":"eyebrow"),className:`mt-0.5 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] text-fg-dim ${a(e.finish?"meta":"eyebrow")}`.trim(),children:i(e.finish?"meta":"eyebrow",f(e.finish||e.car))})]})]}):u}function Y({build:e,count:o,ratio:s,sizes:l,shown:c,keptAttrs:m,kept:p}){const d=I(o);return n("div",{className:`sf-card relative overflow-hidden bg-surface-2 ${N(s)}`,style:{color:"var(--overlay-fg)"},children:[t("div",{className:"absolute inset-0 flex items-center justify-center",children:t(b,{label:e.imageLabel,src:e.imageSrc,...l?{sizes:l}:{}})}),t("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in srgb, var(--overlay-scrim) 0%, transparent) 45%, color-mix(in srgb, var(--overlay-scrim) 70%, transparent))"}}),d&&t("span",{"data-gallery-set-chip":"",className:"absolute right-3 top-3 z-1 bg-overlay-scrim/45 px-2 py-1 text-[length:var(--size-label,11px)] tracking-[0.12em]",children:d}),n("div",{className:"absolute bottom-[18px] left-5 right-5 z-1 max-view-wide:bottom-2.5 max-view-wide:left-3",children:[e.wheel&&t("div",{...m("title"),className:`text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] opacity-85 ${c("title")}`.trim(),children:p("title",f(e.wheel))}),e.car&&t("div",{...m("eyebrow"),className:`mt-1 text-lg leading-normal max-view-wide:text-sm ${c("eyebrow")}`.trim(),children:p("eyebrow",e.car)})]})]})}export{D as GALLERY_DETAIL_SIZES,G as default,P as galleryTileNumber};
@@ -1,3 +1,3 @@
1
- "use client";import{jsx as r,jsxs as me}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as pe}from"next/navigation";import{containerGapProps as fe}from"efficient-web-builder/format/lib/content/container-gap";import ge from"efficient-web-builder/render/components/Btn";import ue,{GALLERY_GRID_ATTR as ye,GalleryLinksContext as he,GalleryTilesContext as we}from"./GalleryItem.js";import{useShopperGallery as Le}from"./catalog/ShopperScope.js";import{galleryShownIds as Se,galleryToolbarIdle as Ce,WALL_PLACED_CELL as xe,WALL_PLACED_CSS as ve,wallSpanAt as Ge}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ne,galleryMosaicRowsCss as _e}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as Ae}from"./SiteRecordContext.js";import{SharedPartKinds as Pe}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as ke}from"efficient-web-builder/render/components/goldPhrases";import Oe from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as be,framedBandPad as Ie,headIsEmpty as Te,withBandClasses as Ee}from"../lib/sections/band-padding.js";import{galleryFrame as Re,galleryTemplate as Me}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as je,withSideOnce as Be}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as $e,resolveGridMobileColumns as De}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as Ye,resolveGalleryLayout as ze}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Fe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Ue}from"efficient-web-builder/render/components/SideSpaceOnce";function We({items:c,template:D,nodeId:Y,sourced:a,galleryLink:z=!0,num:x,title:w,linkText:v,linkHref:F,galleryHref:g="/gallery",submitHref:U="/contact",previewHover:W,display:K,displayPhone:V,styleOwner:q,layout:G,layoutPhone:H,columns:u,columnsMobile:J,gap:Q,gapPhone:X,sets:N=!1,omitHead:L=!1,pads:Z,editing:_=!1}){const ee=Ue(),le=pe(),se=Ae(),re=z&&g!==le&&(se||g!=="/gallery"),y={layout:G,layoutPhone:H},m=ze(y),te=!m&&u!=null&&u!=="",i=fe("GalleryB",Q,"both",X),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:te?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String($e(u)),"--sf-grid-cols-phone":String(De(J,u))}}:{className:`sf-card-grid grid grid-cols-4${i.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:i.style},P=v?{text:v,href:F||"#"}:void 0,ne=w?ke(w,!1):void 0,[k,oe]=B({}),O=j((e,s)=>{oe(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:Ke,...ce}=l;return ce}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
2
- `),b=f(()=>h!==void 0?h?h.split(`
3
- `):[]:c?.blockIds,[h,c?.blockIds]),d=f(()=>(b??[]).map(e=>k[e]).filter(e=>!!e),[b,k]),{ref:ae,toolbar:p}=Le(d),I=p!==null&&!Ce(p,d),t=f(()=>I&&p?Se(d,p):null,[I,p,d]),n=f(()=>t??d.map(e=>e.id),[t,d]),[T,ie]=B(null),E=j((e,s)=>{const l=n.indexOf(e);l<0||n.length<2||ie({id:n[(l+s+n.length)%n.length],at:s>0?"first":"last"})},[n]),de=f(()=>{const e=new Map((t??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=t?e.get(s):void 0;return l===void 0?null:{index:l+1,total:t.length}},walkCount:n.length,walk:E,opening:T}},[O,t,n.length,E,T]),S=t?e=>{const s=t.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=Ge(m,s,t.length);return{className:xe,style:{order:s,"--sf-wall-c":l.col,"--sf-wall-r":l.row,"--sf-wall-cp":l.colPhone,"--sf-wall-rp":l.rowPhone}}}:void 0,R=m?Ye(y)+(G===Ne?_e($(y)):""):"",C=Ie(Z,be,{noTop:L,nonNegative:!0}),M=Me(D,!a);return r(Fe,{as:"section",ref:ae,...C.attrs,className:Ee(Re(L,!!M),C),style:C.style,children:me("div",{className:Be(je,ee),children:[L||!_&&Te(x,w,P?.text)?null:r(Oe,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(t?ve:"")}}):null,(c||a)&&r(he.Provider,{value:{galleryHref:g,submitHref:U,previewHover:W,display:K,displayPhone:V,styleOwner:q,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(we.Provider,{value:de,children:r(Pe,{children:r("div",{[ye]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ue,{...s,tile:e,editing:_},e.id),o=S?.(e.id);return o?r("div",{className:o.className,style:o.style,children:l},e.id):l})}):c?r(c,{...A,minEmptyHeight:320,...S?{cell:S}:{}}):null})})})}),re&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(ge,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{We as default};
1
+ "use client";import{jsx as r,jsxs as me}from"react/jsx-runtime";import{useCallback as z,useMemo as m,useState as B}from"react";import{usePathname as fe}from"next/navigation";import{containerGapProps as pe}from"efficient-web-builder/format/lib/content/container-gap";import ge from"efficient-web-builder/render/components/Btn";import ue,{GALLERY_GRID_ATTR as he,GalleryLinksContext as ye,GalleryTilesContext as we}from"./GalleryItem.js";import{useShopperGallery as Se}from"./catalog/ShopperScope.js";import{galleryShownIds as Le,galleryToolbarIdle as xe,WALL_PLACED_CELL as Ce,WALL_PLACED_CSS as ve,wallSpanAt as Ge,wallTileSizes as Ne}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as _e,galleryMosaicRowsCss as Oe}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as Ae}from"./SiteRecordContext.js";import{SharedPartKinds as ke}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Te}from"efficient-web-builder/render/components/goldPhrases";import be from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Ie,framedBandPad as Pe,headIsEmpty as Ee,withBandClasses as Re}from"../lib/sections/band-padding.js";import{galleryFrame as Me,galleryTemplate as je}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as ze,withSideOnce as Be}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as $e,resolveGridMobileColumns as De}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as Ye,resolveGalleryLayout as Fe}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as Ue}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as We}from"efficient-web-builder/render/components/SideSpaceOnce";function Ke({items:f,template:D,nodeId:Y,sourced:a,galleryLink:F=!0,num:N,title:S,linkText:_,linkHref:U,galleryHref:g="/gallery",submitHref:W="/contact",previewHover:K,display:V,displayPhone:q,styleOwner:H,layout:u,layoutPhone:L,columns:h,columnsMobile:J,gap:Q,gapPhone:X,sets:O=!1,omitHead:x=!1,pads:Z,editing:A=!1}){const ee=We(),se=fe(),ne=Ae(),re=F&&g!==se&&(ne||g!=="/gallery"),C={layout:u,layoutPhone:L},o=m(()=>Fe({layout:u,layoutPhone:L}),[u,L]),le=!o&&h!=null&&h!=="",d=pe("GalleryB",Q,"both",X),k=o?{className:`sf-card-grid sf-gallery-zone ${$(C)} grid${d.className}`,style:d.style}:le?{className:`sf-card-grid sf-grid-zone grid${d.className}`,style:{...d.style,"--sf-grid-cols":String($e(h)),"--sf-grid-cols-phone":String(De(J,h))}}:{className:`sf-card-grid grid grid-cols-4${d.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:d.style},T=_?{text:_,href:U||"#"}:void 0,te=S?Te(S,!1):void 0,[b,oe]=B({}),I=z((e,n)=>{oe(s=>{const t=s[e.id];if(n){if(!t)return s;const{[e.id]:Ve,...ce}=s;return ce}return t&&t.tag===e.tag&&t.name===e.name?s:{...s,[e.id]:e}})},[]),y=a?.map(e=>e.tile.id).join(`
2
+ `),w=m(()=>y!==void 0?y?y.split(`
3
+ `):[]:f?.blockIds,[y,f?.blockIds]),c=m(()=>(w??[]).map(e=>b[e]).filter(e=>!!e),[w,b]),{ref:ie,toolbar:p}=Se(c),P=p!==null&&!xe(p,c),l=m(()=>P&&p?Le(c,p):null,[P,p,c]),i=m(()=>l??c.map(e=>e.id),[l,c]),[E,ae]=B(null),R=z((e,n)=>{const s=i.indexOf(e);s<0||i.length<2||ae({id:i[(s+n+i.length)%i.length],at:n>0?"first":"last"})},[i]),de=m(()=>{const e=new Map((l??[]).map((n,s)=>[n,s]));return{report:I,positionOf:n=>{const s=l?e.get(n):void 0;return s===void 0?null:{index:s+1,total:l.length}},sizesOf:n=>{if(!o)return;const s=l??w??[],t=s.indexOf(n);return t<0?void 0:Ne(o,t,s.length)},walkCount:i.length,walk:R,opening:E}},[I,l,w,o,i.length,R,E]),v=l?e=>{const n=l.indexOf(e);if(n<0)return{style:{display:"none"}};if(!o)return{style:{order:n}};const s=Ge(o,n,l.length);return{className:Ce,style:{order:n,"--sf-wall-c":s.col,"--sf-wall-r":s.row,"--sf-wall-cp":s.colPhone,"--sf-wall-rp":s.rowPhone}}}:void 0,M=o?Ye(C)+(u===_e?Oe($(C)):""):"",G=Pe(Z,Ie,{noTop:x,nonNegative:!0}),j=je(D,!a);return r(Ue,{as:"section",ref:ie,...G.attrs,className:Re(Me(x,!!j),G),style:G.style,children:me("div",{className:Be(ze,ee),children:[x||!A&&Ee(N,S,T?.text)?null:r(be,{num:N,title:te,link:T}),M?r("style",{dangerouslySetInnerHTML:{__html:M+(l?ve:"")}}):null,(f||a)&&r(ye.Provider,{value:{galleryHref:g,submitHref:W,previewHover:K,display:V,displayPhone:q,styleOwner:H,wordsAtRest:!!a,ownerId:Y,Template:j,...O?{sets:O}:{}},children:r(we.Provider,{value:de,children:r(ke,{children:r("div",{[he]:"",style:{display:"contents"},children:a?r("div",{...k,children:a.map(({tile:e,...n})=>{const s=r(ue,{...n,tile:e,editing:A},e.id),t=v?.(e.id);return t?r("div",{className:t.className,style:t.style,children:s},e.id):s})}):f?r(f,{...k,minEmptyHeight:320,...v?{cell:v}:{}}):null})})})}),re&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(ge,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{Ke as default};
@@ -33,6 +33,7 @@ export declare const GALLERY_TILE_PARTS: readonly [{
33
33
  export declare const GalleryTilesContext: import("react").Context<{
34
34
  report: (tile: GalleryTile, gone?: boolean) => void;
35
35
  positionOf: (id: string) => TilePosition | null;
36
+ sizesOf?: (id: string) => string | undefined;
36
37
  walkCount: number;
37
38
  walk: (fromId: string, dir: 1 | -1) => void;
38
39
  opening: {
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as l,Fragment as y}from"react/jsx-runtime";import{createContext as K,useCallback as de,useContext as J,useEffect as Q,useRef as me,useState as z}from"react";import I from"next/link";import{SiteLink as pe}from"efficient-web-builder/render/lib/site-runtime";import{GALLERY_PHONE_BREAKPOINT as fe}from"efficient-web-builder/format/lib/content/gallery-layout";import{slugify as he}from"efficient-shell/format";import{CardTemplateRows as xe}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ge,SIDE_ONCE_HOLDS_CLASS as ue}from"efficient-web-builder/format/lib/content/page-width";import be,{galleryTileNumber as we}from"./GalleryCard.js";import ee,{LightboxClose as te,LIGHTBOX_CLOSE_TINT as ve}from"./Lightbox.js";import{useSiteSells as ye}from"./SiteRecordContext.js";import{renderGold as b,renderHeadline as re}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as A}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as Ne}from"efficient-shell/hooks";import{HideTaker as oe}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as ke}from"efficient-web-builder/render/components/SideSpaceOnce";const Se="(max-width: 1100px) 100vw, min(59vw, 1050px)",_e=K({}),et=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Ce=K(null),Le="data-gallery-grid",j="data-gallery-tile";function Te(t,o){const[a,c]=z(null);return Q(()=>{const i=t.current,n=i?.closest(`[${Le}]`);if(!i||!n)return;const w=()=>{const g=Array.from(n.querySelectorAll(`[${j}]`)),f=g.indexOf(i),m=f>=0?{index:f+1,total:g.length}:null;c(N=>N?.index===m?.index&&N?.total===m?.total?N:m)};if(w(),!o)return;const x=new MutationObserver(w);return x.observe(n,{childList:!0,subtree:!0}),()=>x.disconnect()},[t,o]),a}const tt={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},$e=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),rt=Array.from({length:6},$e);function Ee(t){const o=(t.photos??[]).map(n=>n?.src).filter(n=>!!n),a=t.image||o[0]||"",c=[a,...o].filter(n=>!!n),i=he(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:a||void 0,detailSrc:o[0]||a||void 0,photos:c,href:t.href}}function Oe({editing:t=!1,previewHover:o,ratio:a,captionPlace:c,tile:i,...n}){const w=ke(),{galleryHref:x="/gallery",submitHref:g="/contact",previewHover:f,display:m,displayPhone:N,styleOwner:ae,photosOnly:ne=!1,wordsAtRest:ie=!1,Template:G,ownerId:se,sets:R=!1}=J(_e),e=Ee(n),k=ye()&&!ne,B=!k&&!Pe(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),M=me(null),D=de(s=>{M.current=s},[]),ce=Te(M,t),v=J(Ce),C=v?.report,p=i?.id,W=i?.tag??"",Y=i?.name??"";Ne(()=>{if(!C||!p)return;const s={id:p,tag:W,name:Y};return C(s),()=>C(s,!0)},[C,p,W,Y]);const S=(p?v?.positionOf(p):null)??ce,F=t&&(!!o||!!f),[U,h]=z(!1),[_,L]=z(0),X=!!p&&!!v&&v.walkCount>1,V=s=>{const P=_+s;if(X&&(P<0||P>=d.length)){h(!1),v.walk(p,s);return}L((P+d.length)%d.length)},T=()=>V(-1),$=()=>V(1),u=d.length>1||X,E=v?.opening;Q(()=>{!E||E.id!==p||(L(E.at==="last"?Math.max(0,d.length-1):0),h(!0))},[E,p]);const O=d[_]??e.imageSrc??"",Z=d.slice(1),q=G?r("div",{className:`block w-full min-w-0 ${ge}${w?` ${ue}`:""}`,children:r(xe,{ownerId:se??"GalleryB",ownerType:"GalleryB",Template:G,rows:[{key:p??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:S?we(S.index,S.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:Z.length?{photos:[{finish:"",items:Z.map(s=>({url:s,kind:"image"}))}]}:null}],previewHover:F,fallback:null,children:s=>s})}):r(be,{build:e,forceHover:F,alwaysShowOverlay:ie,index:S?.index,total:S?.total,ratio:a,captionPlace:c,display:m,displayPhone:N,styleOwner:ae,editing:t,...R?{setCount:d.length}:{}});return l(y,{children:[t?r(oe,{as:"div",ref:D,[j]:"",className:"block w-full text-left",children:q}):r(oe,{as:"button",ref:D,[j]:"",type:"button","aria-label":k?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:H(e),onClick:()=>{L(0),h(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:q}),R?r(ee,{open:U,onClose:()=>h(!1),label:e.car&&e.wheel?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"bg-bg",children:r(je,{build:e,set:d,index:_,onPick:L,onPrev:u?T:void 0,onNext:u?$:void 0,onLeave:()=>h(!1)})}):r(ee,{open:U,onClose:()=>h(!1),label:k?`${e.car} on ${e.wheel}`:H(e),onPrev:u?T:void 0,onNext:u?$:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:l("div",{onClick:s=>s.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${B?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(te,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ve},children:"✕"}),l("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[O&&r("img",{...A(O,{fallbackWidth:1280}),sizes:Se,alt:`${(k?e.car:e.wheel||e.car)||"Photo"} — ${_+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},O),u&&l(y,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:T,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:$,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),d.length>1&&l("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[_+1," / ",d.length]})]})]}),k?l("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:b(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(e.wheel,!1)}),e.car&&l("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:b(e.car,!0)})]}),l("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:b(e.wheel)})]}),e.process&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:b(e.process)})]}),e.finish&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:b(e.finish)})]}),e.car&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:b(e.car)})]})]}),l("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[l(I,{href:e.href||"/wheels",onClick:()=>h(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),l(I,{href:x,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),l(I,{href:g,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!B&&r(ze,{build:e})]})})]})}function le(t){return[t.process,t.car,t.finish].filter((o,a,c)=>!!o&&o!==t.wheel&&c.indexOf(o)===a)}function Pe(t){return!!t.wheel||le(t).length>0}function H(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function ze({build:t}){const o=t.wheel,a=le(t);return l("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:re(o,!1)}),a.map(c=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:b(c)},c))]})}const Ie=360,Ae="120px";function je({build:t,set:o,index:a,onPick:c,onPrev:i,onNext:n,onLeave:w}){const x=o[a]??t.imageSrc??"",g="absolute top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg bg-bg text-lg text-fg max-view-wide:hidden";return l("div",{onClick:f=>f.stopPropagation(),className:"grid h-full w-full grid-cols-[1fr_360px] bg-bg text-fg max-view-wide:grid-cols-1 max-view-wide:grid-rows-[auto_1fr] max-view-wide:overflow-auto",children:[l("div",{className:"relative grid min-h-0 place-items-center bg-surface-2 py-12 max-view-wide:p-0",children:[x&&r("img",{...A(x,{fallbackWidth:1280}),sizes:`(max-width: ${fe}px) 100vw, calc(100vw - ${Ie}px)`,alt:`${t.car||t.wheel||"Photo"} — ${a+1} of ${o.length}`,className:"block max-h-[calc(100vh-96px)] max-w-[calc(100%-192px)] max-view-wide:max-h-[60vh] max-view-wide:max-w-full"},x),i&&r("button",{type:"button","aria-label":"Previous photo",onClick:i,className:`${g} left-6`,children:"‹"}),n&&r("button",{type:"button","aria-label":"Next photo",onClick:n,className:`${g} right-6`,children:"›"})]}),l("div",{"data-gallery-set-side":"",className:"flex min-h-0 flex-col overflow-auto p-8 max-view-wide:px-4 max-view-wide:py-5",children:[r(te,{label:"Close popup",className:"flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center self-end border border-fg bg-bg text-lg text-fg max-view-wide:fixed max-view-wide:right-3 max-view-wide:top-3 max-view-wide:z-5",children:"✕"}),t.wheel&&r("div",{className:"mt-10 text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-fg-dim max-view-wide:mt-0",children:t.wheel}),t.car&&r("div",{className:"mt-2 mb-2 text-2xl leading-normal",children:t.car}),l("div",{className:"text-xs leading-normal text-fg-dim",children:[a+1," / ",o.length]}),o.length>1&&r("div",{className:"mt-8 grid grid-cols-3 gap-2 max-view-wide:grid-cols-5",children:o.map((f,m)=>r("button",{type:"button","data-gallery-set-thumb":"","aria-label":`Show photo ${m+1}`,"aria-current":m===a?"true":void 0,onClick:()=>c(m),className:`block cursor-pointer p-0 ${m===a?"opacity-100 outline outline-1 outline-offset-2 outline-fg":"opacity-50"}`,children:r("img",{...A(f,{fallbackWidth:320,maxWidth:640}),sizes:Ae,alt:"",loading:"lazy",className:"block aspect-[4/3] w-full object-cover"})},`${f}-${m}`))}),t.wheel&&t.href&&l(pe,{href:t.href,onClick:w,className:"mt-auto inline-block self-start border border-fg px-8 py-3 text-xs text-fg max-view-wide:mt-6",children:["See ",t.wheel]})]})]})}export{Le as GALLERY_GRID_ATTR,tt as GALLERY_ITEM_HINTS,rt as GALLERY_ITEM_SEEDS,j as GALLERY_TILE_ATTR,et as GALLERY_TILE_PARTS,_e as GalleryLinksContext,Ce as GalleryTilesContext,Oe as default};
1
+ "use client";import{jsx as r,jsxs as l,Fragment as y}from"react/jsx-runtime";import{createContext as J,useCallback as me,useContext as Q,useEffect as ee,useRef as pe,useState as z}from"react";import I from"next/link";import{SiteLink as fe}from"efficient-web-builder/render/lib/site-runtime";import{GALLERY_PHONE_BREAKPOINT as he}from"efficient-web-builder/format/lib/content/gallery-layout";import{slugify as xe}from"efficient-shell/format";import{CardTemplateRows as ge}from"efficient-web-builder/render/components/CardRowContext";import{BOX_HOLDS_NO_GUTTER_CLASS as ue,SIDE_ONCE_HOLDS_CLASS as be}from"efficient-web-builder/format/lib/content/page-width";import we,{galleryTileNumber as ve}from"./GalleryCard.js";import te,{LightboxClose as re,LIGHTBOX_CLOSE_TINT as ye}from"./Lightbox.js";import{useSiteSells as Ne}from"./SiteRecordContext.js";import{renderGold as w,renderHeadline as oe}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as A}from"efficient-web-builder/format/lib/sized-image";import{useBrowserLayoutEffect as ke}from"efficient-shell/hooks";import{HideTaker as le}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Se}from"efficient-web-builder/render/components/SideSpaceOnce";const _e="(max-width: 1100px) 100vw, min(59vw, 1050px)",Ce=J({}),tt=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],Le=J(null),Te="data-gallery-grid",j="data-gallery-tile";function $e(t,o){const[n,c]=z(null);return ee(()=>{const i=t.current,a=i?.closest(`[${Te}]`);if(!i||!a)return;const v=()=>{const g=Array.from(a.querySelectorAll(`[${j}]`)),f=g.indexOf(i),p=f>=0?{index:f+1,total:g.length}:null;c(N=>N?.index===p?.index&&N?.total===p?.total?N:p)};if(v(),!o)return;const x=new MutationObserver(v);return x.observe(a,{childList:!0,subtree:!0}),()=>x.disconnect()},[t,o]),n}const rt={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},Oe=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),ot=Array.from({length:6},Oe);function Ee(t){const o=(t.photos??[]).map(a=>a?.src).filter(a=>!!a),n=t.image||o[0]||"",c=[n,...o].filter(a=>!!a),i=xe(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:n||void 0,detailSrc:o[0]||n||void 0,photos:c,href:t.href}}function Pe({editing:t=!1,previewHover:o,ratio:n,captionPlace:c,tile:i,...a}){const v=Se(),{galleryHref:x="/gallery",submitHref:g="/contact",previewHover:f,display:p,displayPhone:N,styleOwner:ae,photosOnly:ie=!1,wordsAtRest:se=!1,Template:G,ownerId:ce,sets:R=!1}=Q(Ce),e=Ee(a),k=Ne()&&!ie,B=!k&&!ze(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),M=pe(null),D=me(s=>{M.current=s},[]),de=$e(M,t),u=Q(Le),C=u?.report,m=i?.id,W=i?.tag??"",Y=i?.name??"";ke(()=>{if(!C||!m)return;const s={id:m,tag:W,name:Y};return C(s),()=>C(s,!0)},[C,m,W,Y]);const S=(m?u?.positionOf(m):null)??de,F=m?u?.sizesOf?.(m):void 0,U=t&&(!!o||!!f),[X,h]=z(!1),[_,L]=z(0),V=!!m&&!!u&&u.walkCount>1,Z=s=>{const P=_+s;if(V&&(P<0||P>=d.length)){h(!1),u.walk(m,s);return}L((P+d.length)%d.length)},T=()=>Z(-1),$=()=>Z(1),b=d.length>1||V,O=u?.opening;ee(()=>{!O||O.id!==m||(L(O.at==="last"?Math.max(0,d.length-1):0),h(!0))},[O,m]);const E=d[_]??e.imageSrc??"",q=d.slice(1),K=G?r("div",{className:`block w-full min-w-0 ${ue}${v?` ${be}`:""}`,children:r(ge,{ownerId:ce??"GalleryB",ownerType:"GalleryB",Template:G,rows:[{key:m??e.imageSrc??"tile",image:e.imageSrc??"",tag:e.process,number:S?ve(S.index,S.total):"",eyebrow:e.car,name:e.wheel,meta:e.finish,href:e.href??""}],items:[{hoverMedia:q.length?{photos:[{finish:"",items:q.map(s=>({url:s,kind:"image"}))}]}:null}],previewHover:U,fallback:null,children:s=>s})}):r(we,{build:e,forceHover:U,alwaysShowOverlay:se,index:S?.index,total:S?.total,ratio:n,captionPlace:c,display:p,displayPhone:N,styleOwner:ae,editing:t,...R?{setCount:d.length}:{},...F?{sizes:F}:{}});return l(y,{children:[t?r(le,{as:"div",ref:D,[j]:"",className:"block w-full text-left",children:K}):r(le,{as:"button",ref:D,[j]:"",type:"button","aria-label":k?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:H(e),onClick:()=>{L(0),h(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:K}),R?r(te,{open:X,onClose:()=>h(!1),label:e.car&&e.wheel?`${e.car} on ${e.wheel}`:H(e),onPrev:b?T:void 0,onNext:b?$:void 0,className:"bg-bg",children:r(He,{build:e,set:d,index:_,onPick:L,onPrev:b?T:void 0,onNext:b?$:void 0,onLeave:()=>h(!1)})}):r(te,{open:X,onClose:()=>h(!1),label:k?`${e.car} on ${e.wheel}`:H(e),onPrev:b?T:void 0,onNext:b?$:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:l("div",{onClick:s=>s.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${B?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(re,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:ye},children:"✕"}),l("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[E&&r("img",{...A(E,{fallbackWidth:1280}),sizes:_e,alt:`${(k?e.car:e.wheel||e.car)||"Photo"} — ${_+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},E),b&&l(y,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:T,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:$,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),d.length>1&&l("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[_+1," / ",d.length]})]})]}),k?l("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:w(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:oe(e.wheel,!1)}),e.car&&l("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:w(e.car,!0)})]}),l("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:w(e.wheel)})]}),e.process&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:w(e.process)})]}),e.finish&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:w(e.finish)})]}),e.car&&l(y,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:w(e.car)})]})]}),l("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[l(I,{href:e.href||"/wheels",onClick:()=>h(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),l(I,{href:x,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),l(I,{href:g,onClick:()=>h(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!B&&r(Ie,{build:e})]})})]})}function ne(t){return[t.process,t.car,t.finish].filter((o,n,c)=>!!o&&o!==t.wheel&&c.indexOf(o)===n)}function ze(t){return!!t.wheel||ne(t).length>0}function H(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function Ie({build:t}){const o=t.wheel,n=ne(t);return l("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:oe(o,!1)}),n.map(c=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:w(c)},c))]})}const Ae=360,je="120px";function He({build:t,set:o,index:n,onPick:c,onPrev:i,onNext:a,onLeave:v}){const x=o[n]??t.imageSrc??"",g="absolute top-1/2 flex h-12 w-12 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg bg-bg text-lg text-fg max-view-wide:hidden";return l("div",{onClick:f=>f.stopPropagation(),className:"grid h-full w-full grid-cols-[1fr_360px] bg-bg text-fg max-view-wide:grid-cols-1 max-view-wide:grid-rows-[auto_1fr] max-view-wide:overflow-auto",children:[l("div",{className:"relative grid min-h-0 place-items-center bg-surface-2 py-12 max-view-wide:p-0",children:[x&&r("img",{...A(x,{fallbackWidth:1280}),sizes:`(max-width: ${he}px) 100vw, calc(100vw - ${Ae}px)`,alt:`${t.car||t.wheel||"Photo"} — ${n+1} of ${o.length}`,className:"block max-h-[calc(100vh-96px)] max-w-[calc(100%-192px)] max-view-wide:max-h-[60vh] max-view-wide:max-w-full"},x),i&&r("button",{type:"button","aria-label":"Previous photo",onClick:i,className:`${g} left-6`,children:"‹"}),a&&r("button",{type:"button","aria-label":"Next photo",onClick:a,className:`${g} right-6`,children:"›"})]}),l("div",{"data-gallery-set-side":"",className:"flex min-h-0 flex-col overflow-auto p-8 max-view-wide:px-4 max-view-wide:py-5",children:[r(re,{label:"Close popup",className:"flex h-10 w-10 shrink-0 cursor-pointer items-center justify-center self-end border border-fg bg-bg text-lg text-fg max-view-wide:fixed max-view-wide:right-3 max-view-wide:top-3 max-view-wide:z-5",children:"✕"}),t.wheel&&r("div",{className:"mt-10 text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-fg-dim max-view-wide:mt-0",children:t.wheel}),t.car&&r("div",{className:"mt-2 mb-2 text-2xl leading-normal",children:t.car}),l("div",{className:"text-xs leading-normal text-fg-dim",children:[n+1," / ",o.length]}),o.length>1&&r("div",{className:"mt-8 grid grid-cols-3 gap-2 max-view-wide:grid-cols-5",children:o.map((f,p)=>r("button",{type:"button","data-gallery-set-thumb":"","aria-label":`Show photo ${p+1}`,"aria-current":p===n?"true":void 0,onClick:()=>c(p),className:`block cursor-pointer p-0 ${p===n?"opacity-100 outline outline-1 outline-offset-2 outline-fg":"opacity-50"}`,children:r("img",{...A(f,{fallbackWidth:320,maxWidth:640}),sizes:je,alt:"",loading:"lazy",className:"block aspect-[4/3] w-full object-cover"})},`${f}-${p}`))}),t.wheel&&t.href&&l(fe,{href:t.href,onClick:v,className:"mt-auto inline-block self-start border border-fg px-8 py-3 text-xs text-fg max-view-wide:mt-6",children:["See ",t.wheel]})]})]})}export{Te as GALLERY_GRID_ATTR,rt as GALLERY_ITEM_HINTS,ot as GALLERY_ITEM_SEEDS,j as GALLERY_TILE_ATTR,tt as GALLERY_TILE_PARTS,Ce as GalleryLinksContext,Le as GalleryTilesContext,Pe as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as m,Fragment as S}from"react/jsx-runtime";import{partSkus as Ge}from"../lib/catalog/part-skus.js";import pe from"next/link";import{useEffect as z,useRef as de,useState as Qe}from"react";import{useCart as Xe}from"./CartContext.js";import{useSiteTakesOrders as qe}from"./SiteRecordContext.js";import Je from"./EmailCaptureForm.js";import{useEnglish as ue}from"./EnglishVariant.js";import{MarkedLabel as fe,heroView as Ze}from"./product-hero/hero-view.js";import{HeroOptionLooksProvider as et,OptionDropdown as tt,OptionLabel as he,optionWords as lt,useHeroOptionLooks as at}from"./product-hero/OptionLooks.js";import{DEFAULT_HERO_OPTION_LOOKS as nt}from"../lib/sections/hero-option-looks.js";import{useRootIsDark as st}from"efficient-shell/theme";import{useStockAlertSignup as rt}from"./useStockAlertSignup.js";import{SPARE_WORDS as it,productCartLine as ot}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as U}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as mt}from"../lib/catalog/product-options.js";import{trackViewItem as ct}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as pt,DEFAULT_HERO_RATIO as dt,DEFAULT_HERO_TEXT_ALIGN as ut,parseHeroLayout as ft,parseHeroRatio as ht,parseHeroTextAlign as bt}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as gt,UNITS_PER_SET as be,formatPrice as ge,spareAxleOf as xt}from"../lib/commerce.js";import{formatSelectionPrice as xe,formatSparePrice as vt}from"../lib/wheels/price-display.js";import{productIsDually as Tt,productIsTwoObjects as kt,setSuppressesRow as yt}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ve}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as St,STICKY_SECTION_ATTR as Ot}from"../lib/sections/hero-sticky.js";import{STAGE_EDGE_ATTR as _t,stageEdgeClass as Nt,stageEdgeCols as Rt}from"../lib/sections/hero-stage-edge.js";import{useStickyColumns as Et}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as Lt}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as j}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as F}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as wt}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as At}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as Ct,HERO_TILE_SLOT as It}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as $t,HERO_QUANTITY_PART as Pt,HERO_SAVE_PART as Ht}from"../lib/content/hero-buy-seed.js";import{HERO_PART as v}from"../lib/content/hero-seed.js";import Dt from"./card-pieces/CardQuantity.js";import Mt from"./card-pieces/CardSave.js";import zt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as Ut}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as K}from"../lib/document/document-nodes.js";import{withSideOnce as Te}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as jt}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as ke}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSplitPads as Ft}from"./SectionPadScope.js";const Kt=4e3;function Vt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const ye=[{}],Bt=(e,s)=>s===Pt?t(Dt,{}):s===Ht?t(Mt,{}):null,Wt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function Yt({product:e,selection:s,onLightbox:i,editing:r=!1,showVehicleFitment:o=!0,heroLayout:p=pt,imageRatio:d=dt,textAlign:l=ut,showSpecTable:n=!0,stickyColumns:f=!1,stageToEdge:Oe=!1,showBreadcrumb:V=!0,nodeId:N,template:_e,optionTemplate:Ne,optionPressTitles:Re,tileTemplate:Ee,buyTemplate:Le,optionLooks:B=nt,spareWords:we,startChosen:R=!1}){const W=jt(),Ae=ue(),h=ft(p),Y=bt(l),y=ht(d),E=f===!0&&h!=="stacked",O=Oe===!0&&h!=="stacked",G=de(null);Et(G,E);const Ce=O?Rt(y,h==="imageRight"):h==="imageRight"?`${100-y}fr ${y}fr`:`${y}fr ${100-y}fr`,L=O?{gap:"",y:"",yTablet:""}:{gap:"gap-10 ",y:"py-14 ",yTablet:"max-view-tablet:py-8 "},{picked:Ie,pick:Q,qty:X,setQty:$e,choice:q,setChoice:Pe,angleIdx:el,setAngleIdx:tl,showValidation:He,setShowValidation:w,manualMode:J,vehicle:A,rows:Z,facts:De,part:b,outOfStock:ee,offer:C,preOrder:I,canAddToCart:te,currency:g,price:c,set:le,msrpLabel:Me}=s,u=Ze(e,s,r),{chooseStart:ze}=s;z(()=>{R&&ze()},[R,e.slug]);const ae=Tt(e),Ue=kt(e),$=o?u.vehicle:null,je=o?u.vehicleMemory:null,ne=!st({whenUnset:!0}),{warmCatalog:se}=Xe(),_=qe();z(()=>{!r&&_&&se(e.kind,e.slug)},[r,_,e.kind,e.slug,se]);const re=Z.filter(a=>!I||a.values.length>0),ie=re.filter(a=>a.role==="resolves"),P=re.filter(a=>a.role==="describes"&&!yt(Ue,a.key)),oe=P.findIndex(a=>a.chosen===null),me=(!$||!u.vehicleAnswersSpecs||s.fitmentSet)&&mt(Z,I)?oe===-1?P:P.slice(0,oe+1):[],Fe=[...ie,...me];function Ke(){return te?(w(!1),r?null:ot(e,b,Ie,{choice:q,qty:X},{fitmentLabel:J?u.specCaption:A.appliedName?`For ${A.appliedName}`:"",fitmentKey:J?`manual|${u.specCaption}`:`vehicle|${Vt(A.applied?.vehicle)}`})):(w(!0),window.setTimeout(()=>w(!1),Kt),null)}const Ve={kind:"hero",msrpLabel:Me||null,amount:xe(c,g),unitLabel:c.priced?u.unitLabel:null,packBadge:c.setTotal!=null?`${C.quantityLabel}: ${ge(le,g)}`:null,buy:{isSet:ae,priced:c.priced,outOfStock:ee,canAdd:te,totalLabel:c.setTotal!=null?ge(le,g):null,lineToAdd:Ke},qty:X,setQty:$e,takesQty:_&&!(ae&&!c.priced),save:{slug:e.slug,name:e.name},facts:n?De:null,title:{eyebrow:e.eyebrow,name:u.heading,badge:e.badge||null},product:e,selection:s,openLightbox:i,sku:Ge(b),designCode:e.kind==="alloy-wheel"&&e.source.designCode||null,setLine:Xt(c,Qt(C.quantityLabel,e.kind),g),startChosen:R},H={nodeId:N??"",template:Ne,tileTemplate:Ee,pressTitles:Re,editing:r},x=!!(I&&u.preOrder),Be={[v.fitmentLine]:je,[v.options]:m(et,{looks:B,children:[ie.map(a=>t(Se,{row:a,onPick:Q,options:H},a.key)),!x&&$,!x&&me.map(a=>t(Se,{row:a,onPick:Q,options:H},a.key))]}),[v.facts]:x?null:t(zt,{}),[v.howMany]:x?null:t(Jt,{offer:C,asksSpares:_&&c.priced,choice:q,setChoice:Pe,options:H,spareLook:B.spare,spareWords:we,spareCost:c.priced?vt(c,g):null}),[v.buy]:x?u.preOrder:t(F,{children:t(j,{ownerId:N??"",ownerType:K,slot:$t,Template:Le,rows:ye,fallback:null,hostParts:Bt,children:a=>a})}),[v.notify]:!x&&ee&&c.priced&&b?t(Zt,{partNumbers:b.components.map(a=>a.partNumber),productSlug:e.slug},b.id):null,[v.reminder]:!x&&He?Ye():null},We=(a,T)=>Be[T]??null;function Ye(){const a=Fe.filter(M=>M.chosen===null).map(M=>Ae(M.prompt).replace(/^Select\s+/i,""));if($&&u.vehicleAnswersSpecs&&!s.fitmentSet&&a.push("vehicle fitment"),a.length===0)return null;const T=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return m("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",T," first."]})}const ce=de(null);z(()=>{r||ce.current===e.slug||(ce.current=e.slug,ct({itemId:b?`${e.slug}|${b.id}`:e.slug,itemName:e.name,variant:u.metaValue,pricePerSet:c.setTotal??c.fromSetTotal??0,currency:g}))},[r,e.slug,e.name,u.metaValue,b,c,g]);const D=Ft();return m(S,{children:[V&&t("nav",{...ke(Te(`border-b border-line ${ve} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,W),D?.first?.atTop,ne?void 0:{background:"var(--section-bg)"}),children:e.crumbs.map((a,T)=>m("span",{children:[T>0&&m(S,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(pe,{href:a.href,className:"hover:text-fg",children:t(fe,{text:a.label})}):t("span",{className:"text-fg",children:t(fe,{text:a.label})})]},`${a.label}-${T}`))}),t("section",{ref:G,"data-hero-layout":h,"data-hero-align":Y,...E?{[Ot]:""}:{},...O?{[_t]:""}:{},...ke([Te(`grid ${L.gap}${ve} ${L.y}max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] ${L.yTablet}${Wt}`,W),Y==="center"?Lt.center:"",h==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",E?St:"",O?Nt(h==="imageRight"):""].filter(Boolean).join(" "),V?D?.second?.atTop:D?.secondOnly?.atTop,{...ne?{}:{background:"var(--section-bg)"},...h==="stacked"?{}:{"--hero-cols":Ce}}),children:t(Ut,{value:Ve,children:t(F,{children:t(j,{ownerId:N??"",ownerType:K,Template:_e,rows:ye,fallback:null,hostParts:We,children:a=>a})})})})]})}const Gt="wheels";function Qt(e,s){return s==="alloy-wheel"&&/\d$/.test(e)?`${e} ${Gt}`:e}function Xt(e,s,i){if(!e.priced)return null;const r=e.setTotal==null?e.openSettled?.setTotal??null:null,o=e.setTotal??r??e.fromSetTotal;return o==null?null:{label:s,total:xe({...e,unit:o,isFrom:e.setTotal==null&&r==null},i)}}const qt={caps:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em]",plain:"font-body text-[length:var(--size-body,13px)]"};function Jt({offer:e,asksSpares:s,choice:i,setChoice:r,options:o,spareLook:p,spareWords:d,spareCost:l}){return e.packs.length>0||s&&(e.extra||e.spareCounts.length>0)?m("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&m(S,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:o,values:e.packs,item:n=>({label:n.label}),picked:n=>i.unit===n.value,press:n=>()=>r(f=>({...f,unit:n.value}))})})]}),s&&e.extra&&m("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 ${qt[p]} text-fg`,children:[t("input",{type:"checkbox",checked:i.spares>0,onChange:n=>r(f=>({...f,spares:n.target.checked?gt:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),d?.trim()||e.extra.label,l&&t("span",{className:"ml-auto whitespace-nowrap",children:l})]}),s&&e.spareCounts.length>0&&m(S,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:it.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(k,{hero:o,values:e.spareCounts,item:n=>({label:`${n.value} · ${n.label}`}),picked:n=>i.spares===n.value-be,press:n=>()=>r(f=>({...f,spares:n.value-be}))})})]}),s&&e.spareSide&&m(S,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:o,values:e.spareSide.options,item:n=>({label:n.label}),picked:n=>i.spareSide===n.value&&(n.axle===void 0||xt(i)===n.axle),press:n=>()=>r(f=>({...f,spareSide:n.value,...n.axle?{spareAxle:n.axle}:{}}))})})]})]}):null}function Se({row:e,onPick:s,options:i}){const r=ue(),o=at();if(e.values.length===0&&!e.empty)return null;const p=e.values.find(l=>l.value===e.chosen),d=p&&[p.label,p.note].filter(Boolean).join(" · ");return e.values.length>0&&e.display==="swatch"&&o.finish==="tiles"?m("div",{[U]:e.key,children:[t(he,{label:r(e.label),chosen:p?.label}),t("div",{className:"flex flex-wrap gap-2","data-option-tiles":"",children:t(k,{hero:i,tiles:!0,values:e.values,item:l=>({swatch:l.swatch??"",name:l.label}),label:l=>l.label,picked:l=>l.value===e.chosen,press:l=>()=>s(e.key,l.value)})})]}):e.values.length>0&&e.display==="pill"&&e.role==="resolves"&&o.size==="dropdown"?m("div",{[U]:e.key,children:[t(he,{label:r(e.label)}),t(tt,{rowKey:e.key,label:r(e.label),shown:d||r(e.prompt),items:e.values.map(l=>({value:l.value,label:lt(l)})),value:e.chosen??"",onPick:l=>s(e.key,l),editing:i.editing})]}):m("div",{className:"border-b border-line pb-[26px]",[U]:e.key,children:[m("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[r(e.label)," · ",t("span",{className:"text-accent",children:d??r(e.prompt)})]}),e.values.length===0?m("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(pe,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(k,{hero:i,values:e.values,item:l=>({swatch:l.swatch??"",name:l.label}),picked:l=>l.value===e.chosen,press:l=>()=>s(e.key,l.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:i,values:e.values,item:l=>({label:l.label,note:l.note??""}),picked:l=>l.value===e.chosen,press:l=>()=>s(e.key,l.value)})})]})}function k({hero:e,values:s,item:i,label:r,picked:o,press:p,tiles:d=!1}){const l=At(s,{item:i,selected:o,press:p,label:r});return t(F,{children:t(j,{ownerId:e.nodeId,ownerType:K,slot:d?It:Ct,Template:d?e.tileTemplate:e.template,rows:l.items.map(wt),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:d?void 0:e.pressTitles,fallback:null,children:n=>n})})}function Zt({partNumbers:e,productSlug:s}){const[i,r]=Qe(""),{status:o,submit:p,reset:d}=rt();function l(){p({partNumbers:e,email:i,productSlug:s})}return o==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(Je,{className:"-mt-1",email:i,onEmailChange:r,status:o,onResetVerdict:d,onSubmit:l,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{Yt as default};
1
+ "use client";import{jsx as t,jsxs as m,Fragment as S}from"react/jsx-runtime";import{partSkus as Qe}from"../lib/catalog/part-skus.js";import pe from"next/link";import{useEffect as U,useRef as de,useState as Xe}from"react";import{useCart as qe}from"./CartContext.js";import{useSiteTakesOrders as Je}from"./SiteRecordContext.js";import Ze from"./EmailCaptureForm.js";import{useEnglish as ue}from"./EnglishVariant.js";import{carStillToPick as et}from"./product-hero/CarPickerRow.js";import{MarkedLabel as fe,heroView as tt}from"./product-hero/hero-view.js";import{HeroOptionLooksProvider as lt,OptionDropdown as at,OptionLabel as he,optionWords as nt,useHeroOptionLooks as st}from"./product-hero/OptionLooks.js";import{DEFAULT_HERO_OPTION_LOOKS as rt}from"../lib/sections/hero-option-looks.js";import{useRootIsDark as it}from"efficient-shell/theme";import{useStockAlertSignup as ot}from"./useStockAlertSignup.js";import{SPARE_WORDS as mt,productCartLine as ct}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as z}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as pt}from"../lib/catalog/product-options.js";import{trackViewItem as dt}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as ut,DEFAULT_HERO_RATIO as ft,DEFAULT_HERO_TEXT_ALIGN as ht,parseHeroLayout as bt,parseHeroRatio as gt,parseHeroTextAlign as xt}from"../lib/sections/hero-arrangement.js";import{MAX_SPARES as vt,UNITS_PER_SET as be,formatPrice as ge,spareAxleOf as Tt}from"../lib/commerce.js";import{formatSelectionPrice as xe,formatSparePrice as kt}from"../lib/wheels/price-display.js";import{productIsDually as yt,productIsTwoObjects as St,setSuppressesRow as Ot}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ve}from"../lib/sections/content-cap-gutter.js";import{STICKY_COLUMNS_CLASS as _t,STICKY_SECTION_ATTR as Nt}from"../lib/sections/hero-sticky.js";import{STAGE_EDGE_ATTR as Rt,stageEdgeClass as Et,stageEdgeCols as Lt}from"../lib/sections/hero-stage-edge.js";import{useStickyColumns as wt}from"./useStickyColumns.js";import{BLOCK_ALIGN_TEXT as At}from"efficient-web-builder/format/lib/content/block-align";import{CardTemplateRows as j}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as F}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as Ct}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as It}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as $t,HERO_TILE_SLOT as Pt}from"../lib/content/hero-option-seed.js";import{HERO_BUY_SLOT as Ht,HERO_QUANTITY_PART as Dt,HERO_SAVE_PART as Mt}from"../lib/content/hero-buy-seed.js";import{HERO_PART as v}from"../lib/content/hero-seed.js";import Ut from"./card-pieces/CardQuantity.js";import zt from"./card-pieces/CardSave.js";import jt from"./card-pieces/CardStatedFacts.js";import{HeroStateProvider as Ft}from"./card-pieces/ProductCardState.js";import{PRODUCT_HERO_TYPE as K}from"../lib/document/document-nodes.js";import{withSideOnce as Te}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as Kt}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as ke}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSplitPads as Vt}from"./SectionPadScope.js";const Bt=4e3;function Wt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const ye=[{}],Yt=(e,n)=>n===Dt?t(Ut,{}):n===Mt?t(zt,{}):null,Gt="[&>[data-sf-repeat]]:contents [&>[data-sf-repeat]>div]:contents";function Qt({product:e,selection:n,onLightbox:i,editing:r=!1,showVehicleFitment:o=!0,heroLayout:p=ut,imageRatio:d=ft,textAlign:l=ht,showSpecTable:s=!0,stickyColumns:f=!1,stageToEdge:_e=!1,showBreadcrumb:V=!0,nodeId:N,template:Ne,optionTemplate:Re,optionPressTitles:Ee,tileTemplate:Le,buyTemplate:we,optionLooks:B=rt,spareWords:Ae,startChosen:R=!1}){const W=Kt(),Ce=ue(),h=bt(p),Y=xt(l),y=gt(d),E=f===!0&&h!=="stacked",O=_e===!0&&h!=="stacked",G=de(null);wt(G,E);const Ie=O?Lt(y,h==="imageRight"):h==="imageRight"?`${100-y}fr ${y}fr`:`${y}fr ${100-y}fr`,L=O?{gap:"",y:"",yTablet:""}:{gap:"gap-10 ",y:"py-14 ",yTablet:"max-view-tablet:py-8 "},{picked:$e,pick:Q,qty:X,setQty:Pe,choice:q,setChoice:He,angleIdx:tl,setAngleIdx:ll,showValidation:De,setShowValidation:w,manualMode:J,vehicle:A,rows:Z,facts:Me,part:b,outOfStock:ee,offer:C,preOrder:I,canAddToCart:te,currency:g,price:c,set:le,msrpLabel:Ue}=n,u=tt(e,n,r),{chooseStart:ze}=n;U(()=>{R&&ze()},[R,e.slug]);const ae=yt(e),je=St(e),$=o?u.vehicle:null,Fe=o?u.vehicleMemory:null,ne=!it({whenUnset:!0}),{warmCatalog:se}=qe(),_=Je();U(()=>{!r&&_&&se(e.kind,e.slug)},[r,_,e.kind,e.slug,se]);const re=Z.filter(a=>!I||a.values.length>0),ie=re.filter(a=>a.role==="resolves"),P=re.filter(a=>a.role==="describes"&&!Ot(je,a.key)),oe=P.findIndex(a=>a.chosen===null),me=(!$||!u.vehicleAnswersSpecs||n.fitmentSet)&&pt(Z,I)?oe===-1?P:P.slice(0,oe+1):[],Ke=[...ie,...me];function Ve(){return te?(w(!1),r?null:ct(e,b,$e,{choice:q,qty:X},{fitmentLabel:J?u.specCaption:A.appliedName?`For ${A.appliedName}`:"",fitmentKey:J?`manual|${u.specCaption}`:`vehicle|${Wt(A.applied?.vehicle)}`})):(w(!0),window.setTimeout(()=>w(!1),Bt),null)}const Be={kind:"hero",msrpLabel:Ue||null,amount:xe(c,g),unitLabel:c.priced?u.unitLabel:null,packBadge:c.setTotal!=null?`${C.quantityLabel}: ${ge(le,g)}`:null,buy:{isSet:ae,priced:c.priced,outOfStock:ee,canAdd:te,totalLabel:c.setTotal!=null?ge(le,g):null,lineToAdd:Ve},qty:X,setQty:Pe,takesQty:_&&!(ae&&!c.priced),save:{slug:e.slug,name:e.name},facts:s?Me:null,title:{eyebrow:e.eyebrow,name:u.heading,badge:e.badge||null},product:e,selection:n,openLightbox:i,sku:Qe(b),designCode:e.kind==="alloy-wheel"&&e.source.designCode||null,setLine:Jt(c,qt(C.quantityLabel,e.kind),g),startChosen:R},H={nodeId:N??"",template:Re,tileTemplate:Le,pressTitles:Ee,editing:r},x=!!(I&&u.preOrder),We={[v.fitmentLine]:Fe,[v.options]:m(lt,{looks:B,children:[ie.map(a=>t(Oe,{row:a,onPick:Q,options:H},a.key)),!x&&$,!x&&me.map(a=>t(Oe,{row:a,onPick:Q,options:H},a.key))]}),[v.facts]:x?null:t(jt,{}),[v.howMany]:x?null:t(Zt,{offer:C,asksSpares:_&&c.priced,choice:q,setChoice:He,options:H,spareLook:B.spare,spareWords:Ae,spareCost:c.priced?kt(c,g):null}),[v.buy]:x?u.preOrder:t(F,{children:t(j,{ownerId:N??"",ownerType:K,slot:Ht,Template:we,rows:ye,fallback:null,hostParts:Yt,children:a=>a})}),[v.notify]:!x&&ee&&c.priced&&b?t(el,{partNumbers:b.components.map(a=>a.partNumber),productSlug:e.slug},b.id):null,[v.reminder]:!x&&De?Ge():null},Ye=(a,T)=>We[T]??null;function Ge(){const a=Ke.filter(M=>M.chosen===null).map(M=>Ce(M.prompt).replace(/^Select\s+/i,""));if($&&u.vehicleAnswersSpecs&&!n.fitmentSet&&a.push(et(n.vehicle.cascade)),a.length===0)return null;const T=a.length===1?a[0]:a.length===2?`${a[0]} and ${a[1]}`:`${a.slice(0,-1).join(", ")}, and ${a.at(-1)}`;return m("p",{role:"alert",className:`-mt-1 ${Se.plain}`,style:{color:"var(--alert)"},children:["Select ",T,"."]})}const ce=de(null);U(()=>{r||ce.current===e.slug||(ce.current=e.slug,dt({itemId:b?`${e.slug}|${b.id}`:e.slug,itemName:e.name,variant:u.metaValue,pricePerSet:c.setTotal??c.fromSetTotal??0,currency:g}))},[r,e.slug,e.name,u.metaValue,b,c,g]);const D=Vt();return m(S,{children:[V&&t("nav",{...ke(Te(`border-b border-line ${ve} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,W),D?.first?.atTop,ne?void 0:{background:"var(--section-bg)"}),children:e.crumbs.map((a,T)=>m("span",{children:[T>0&&m(S,{children:[t("span",{className:"mx-3 text-accent",children:"/"}),t("wbr",{})]}),a.href?t(pe,{href:a.href,className:"hover:text-fg",children:t(fe,{text:a.label})}):t("span",{className:"text-fg",children:t(fe,{text:a.label})})]},`${a.label}-${T}`))}),t("section",{ref:G,"data-hero-layout":h,"data-hero-align":Y,...E?{[Nt]:""}:{},...O?{[Rt]:""}:{},...ke([Te(`grid ${L.gap}${ve} ${L.y}max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] ${L.yTablet}${Gt}`,W),Y==="center"?At.center:"",h==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]",E?_t:"",O?Et(h==="imageRight"):""].filter(Boolean).join(" "),V?D?.second?.atTop:D?.secondOnly?.atTop,{...ne?{}:{background:"var(--section-bg)"},...h==="stacked"?{}:{"--hero-cols":Ie}}),children:t(Ft,{value:Be,children:t(F,{children:t(j,{ownerId:N??"",ownerType:K,Template:Ne,rows:ye,fallback:null,hostParts:Ye,children:a=>a})})})})]})}const Xt="wheels";function qt(e,n){return n==="alloy-wheel"&&/\d$/.test(e)?`${e} ${Xt}`:e}function Jt(e,n,i){if(!e.priced)return null;const r=e.setTotal==null?e.openSettled?.setTotal??null:null,o=e.setTotal??r??e.fromSetTotal;return o==null?null:{label:n,total:xe({...e,unit:o,isFrom:e.setTotal==null&&r==null},i)}}const Se={caps:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em]",plain:"font-body text-[length:var(--size-body,13px)]"};function Zt({offer:e,asksSpares:n,choice:i,setChoice:r,options:o,spareLook:p,spareWords:d,spareCost:l}){return e.packs.length>0||n&&(e.extra||e.spareCounts.length>0)?m("div",{className:"border-b border-line pb-[26px]",children:[e.packs.length>0&&m(S,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:o,values:e.packs,item:s=>({label:s.label}),picked:s=>i.unit===s.value,press:s=>()=>r(f=>({...f,unit:s.value}))})})]}),n&&e.extra&&m("label",{className:`${e.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 ${Se[p]} text-fg`,children:[t("input",{type:"checkbox",checked:i.spares>0,onChange:s=>r(f=>({...f,spares:s.target.checked?vt:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),d?.trim()||e.extra.label,l&&t("span",{className:"ml-auto whitespace-nowrap",children:l})]}),n&&e.spareCounts.length>0&&m(S,{children:[t("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:mt.howMany}),t("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:t(k,{hero:o,values:e.spareCounts,item:s=>({label:`${s.value} · ${s.label}`}),picked:s=>i.spares===s.value-be,press:s=>()=>r(f=>({...f,spares:s.value-be}))})})]}),n&&e.spareSide&&m(S,{children:[t("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:e.spareSide.label}),t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:o,values:e.spareSide.options,item:s=>({label:s.label}),picked:s=>i.spareSide===s.value&&(s.axle===void 0||Tt(i)===s.axle),press:s=>()=>r(f=>({...f,spareSide:s.value,...s.axle?{spareAxle:s.axle}:{}}))})})]})]}):null}function Oe({row:e,onPick:n,options:i}){const r=ue(),o=st();if(e.values.length===0&&!e.empty)return null;const p=e.values.find(l=>l.value===e.chosen),d=p&&[p.label,p.note].filter(Boolean).join(" · ");return e.values.length>0&&e.display==="swatch"&&o.finish==="tiles"?m("div",{[z]:e.key,children:[t(he,{label:r(e.label),chosen:p?.label}),t("div",{className:"flex flex-wrap gap-2","data-option-tiles":"",children:t(k,{hero:i,tiles:!0,values:e.values,item:l=>({swatch:l.swatch??"",name:l.label}),label:l=>l.label,picked:l=>l.value===e.chosen,press:l=>()=>n(e.key,l.value)})})]}):e.values.length>0&&e.display==="pill"&&e.role==="resolves"&&o.size==="dropdown"?m("div",{[z]:e.key,children:[t(he,{label:r(e.label)}),t(at,{rowKey:e.key,label:r(e.label),shown:d||r(e.prompt),items:e.values.map(l=>({value:l.value,label:nt(l)})),value:e.chosen??"",onPick:l=>n(e.key,l),editing:i.editing})]}):m("div",{className:"border-b border-line pb-[26px]",[z]:e.key,children:[m("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[r(e.label)," · ",t("span",{className:"text-accent",children:d??r(e.prompt)})]}),e.values.length===0?m("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",t(pe,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?t("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:t(k,{hero:i,values:e.values,item:l=>({swatch:l.swatch??"",name:l.label}),picked:l=>l.value===e.chosen,press:l=>()=>n(e.key,l.value)})}):t("div",{className:"flex flex-wrap gap-1.5",children:t(k,{hero:i,values:e.values,item:l=>({label:l.label,note:l.note??""}),picked:l=>l.value===e.chosen,press:l=>()=>n(e.key,l.value)})})]})}function k({hero:e,values:n,item:i,label:r,picked:o,press:p,tiles:d=!1}){const l=It(n,{item:i,selected:o,press:p,label:r});return t(F,{children:t(j,{ownerId:e.nodeId,ownerType:K,slot:d?Pt:$t,Template:d?e.tileTemplate:e.template,rows:l.items.map(Ct),items:l.items,states:l.states,actions:e.editing?void 0:l.actions,pressTitles:d?void 0:e.pressTitles,fallback:null,children:s=>s})})}function el({partNumbers:e,productSlug:n}){const[i,r]=Xe(""),{status:o,submit:p,reset:d}=ot();function l(){p({partNumbers:e,email:i,productSlug:n})}return o==="sent"?t("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):t(Ze,{className:"-mt-1",email:i,onEmailChange:r,status:o,onResetVerdict:d,onSubmit:l,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{Qt as default};
@@ -3,12 +3,14 @@ import { type SelectItem } from "../ThemedSelect.js";
3
3
  import { type VehicleField } from "../../lib/wheels/vehicle-field-focus.js";
4
4
  export interface CarPickerStep {
5
5
  field: VehicleField;
6
+ sofar: string;
6
7
  shown: string;
7
8
  items: SelectItem[];
8
9
  value: string;
9
10
  pick: (value: string) => void;
10
11
  }
11
12
  export declare function carPickerStep(cascade: FitmentCascade): CarPickerStep;
13
+ export declare function carStillToPick(cascade: FitmentCascade): string;
12
14
  export default function CarPickerRow({ cascade }: {
13
15
  cascade: FitmentCascade;
14
16
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as l,jsxs as a}from"react/jsx-runtime";import{useRef as u,useState as m}from"react";import{pickerItems as p}from"../fitment/PickerField.js";import{vehicleLevelNames as d,vehicleLevelOptions as v,vehicleLevelSetters as h,vehicleLevelStates as L,vehicleLevelValues as x,VEHICLE_FIELD_ORDER as I}from"../fitment/vehicle-level-state.js";import{DROPDOWN_BUTTON as R,DropdownChevron as k}from"./OptionLooks.js";import{ThemedSelectList as w,useThemedSelect as E}from"../ThemedSelect.js";import{VEHICLE_FIELD_LABEL as c,firstUnansweredVehicleField as O}from"../../lib/wheels/vehicle-field-focus.js";const _="Select your car";function C(r){const e=O(r.vehicle)??"trim",i=d(r),s=I.map(o=>i[o]).filter(Boolean).join(" ");return{field:e,shown:s||_,items:p(v(r)[e],L(r)[e].placeholder),value:x(r)[e],pick:h(r)[e]}}function D({cascade:r}){const e=C(r),[i,s]=m(!1),o=u(!1),t=E({items:e.items,value:e.value,onPick:n=>{n&&(e.pick(n),o.current=e.field!=="trim")},open:i,onOpen:()=>s(!0),onClose:()=>{if(o.current){o.current=!1,t.setFocusIdx(0);return}s(!1)}}),f=`${c[e.field]}, ${e.shown}`;return a("div",{ref:t.wrapRef,className:"relative","data-car-picker-row":"",children:[a("button",{ref:n=>{t.triggerRef.current=n},type:"button","aria-haspopup":"listbox","aria-expanded":i,"aria-controls":i?t.listId:void 0,"aria-activedescendant":t.activeId,"aria-label":f,onClick:t.toggle,onKeyDown:t.onTriggerKeyDown,className:R,children:[l("span",{className:"truncate",children:e.shown}),l(k,{})]}),i&&l(w,{id:t.listId,tone:"hairline",items:e.items,value:e.value,focusIdx:t.focusIdx,onFocus:t.setFocusIdx,onPick:t.pick,listRef:t.listRef,ariaLabel:c[e.field]})]})}export{C as carPickerStep,D as default};
1
+ "use client";import{jsx as c,jsxs as u}from"react/jsx-runtime";import{useRef as v,useState as h}from"react";import{pickerItems as x}from"../fitment/PickerField.js";import{vehicleLevelNames as L,vehicleLevelOptions as R,vehicleLevelSetters as I,vehicleLevelStates as k,vehicleLevelValues as w,VEHICLE_FIELD_ORDER as C}from"../fitment/vehicle-level-state.js";import{DROPDOWN_BUTTON as E,DropdownChevron as O}from"./OptionLooks.js";import{ThemedSelectList as S,useThemedSelect as _}from"../ThemedSelect.js";import{VEHICLE_FIELD_LABEL as a,firstUnansweredVehicleField as f}from"../../lib/wheels/vehicle-field-focus.js";const m="your car",D=`Select ${m}`;function p(o){const e=f(o.vehicle),r=e??"trim",n=L(o),i=C.map(l=>n[l]).filter(Boolean).join(" "),t=i?e?`${i} · Select ${d(e)}`:i:D;return{field:r,sofar:i,shown:t,items:x(R(o)[r],k(o)[r].placeholder),value:w(o)[r],pick:I(o)[r]}}const d=o=>a[o].toLowerCase();function y(o){const e=f(o.vehicle),{sofar:r}=p(o);return r&&e?`your ${r}'s ${d(e)}`:m}function g({cascade:o}){const e=p(o),[r,n]=h(!1),i=v(!1),t=_({items:e.items,value:e.value,onPick:s=>{s&&(e.pick(s),i.current=e.field!=="trim")},open:r,onOpen:()=>n(!0),onClose:()=>{if(i.current){i.current=!1,t.setFocusIdx(0);return}n(!1)}}),l=`${a[e.field]}, ${e.shown}`;return u("div",{ref:t.wrapRef,className:"relative","data-car-picker-row":"",children:[u("button",{ref:s=>{t.triggerRef.current=s},type:"button","aria-haspopup":"listbox","aria-expanded":r,"aria-controls":r?t.listId:void 0,"aria-activedescendant":t.activeId,"aria-label":l,onClick:t.toggle,onKeyDown:t.onTriggerKeyDown,className:E,children:[c("span",{className:"truncate",children:e.shown}),c(O,{})]}),r&&c(S,{id:t.listId,tone:"hairline",items:e.items,value:e.value,focusIdx:t.focusIdx,onFocus:t.setFocusIdx,onPick:t.pick,listRef:t.listRef,ariaLabel:a[e.field]})]})}export{p as carPickerStep,y as carStillToPick,g as default};
@@ -23,5 +23,6 @@ export interface WallSpan {
23
23
  rowPhone: number;
24
24
  }
25
25
  export declare function wallSpanAt(layout: GalleryLayout, at: number, count: number): WallSpan;
26
+ export declare function wallTileSizes(layout: GalleryLayout, at: number, count: number): string;
26
27
  export declare const WALL_PLACED_CELL = "sf-wall-placed";
27
28
  export declare const WALL_PLACED_CSS: string;
@@ -1 +1 @@
1
- import{galleryCellAt as a}from"efficient-web-builder/format/lib/content/gallery-layout";const u=["newest","name"],f={newest:"Newest",name:"Name A–Z"},w={tag:null,sort:"newest"};function i(n){const r=[];for(const o of n){const t=o.tag.trim();t&&!r.includes(t)&&r.push(t)}return r}function s(n,r){return n!==null&&i(r).includes(n)?n:null}function L(n,r){return s(n.tag,r)===null&&n.sort==="newest"}function g(n,r){const o=s(r.tag,n),t=o===null?[...n]:n.filter(e=>e.tag.trim()===o);return r.sort==="name"&&t.sort((e,l)=>e.name.localeCompare(l.name)),t.map(e=>e.id)}function d(n,r,o){const[t,e]=a(n,!1,r,o),[l,c]=a(n,!0,r,o);return{col:t,row:e,colPhone:l,rowPhone:c}}const p="sf-wall-placed",x=`.${p}{grid-column:span var(--sf-wall-c) !important;grid-row:span var(--sf-wall-r) !important}@media (max-width:800px){.${p}{grid-column:span var(--sf-wall-cp) !important;grid-row:span var(--sf-wall-rp) !important}}`;export{w as EMPTY_GALLERY_TOOLBAR,u as GALLERY_SORT_KEYS,f as GALLERY_SORT_LABELS,p as WALL_PLACED_CELL,x as WALL_PLACED_CSS,s as clampGalleryTag,g as galleryShownIds,i as galleryTags,L as galleryToolbarIdle,d as wallSpanAt};
1
+ import{GALLERY_COLUMNS as L,GALLERY_COLUMNS_PHONE as m,GALLERY_PHONE_BREAKPOINT as u,galleryCellAt as a}from"efficient-web-builder/format/lib/content/gallery-layout";const g=["newest","name"],x={newest:"Newest",name:"Name A–Z"},E={tag:null,sort:"newest"};function w(n){const t=[];for(const o of n){const r=o.tag.trim();r&&!t.includes(r)&&t.push(r)}return t}function s(n,t){return n!==null&&w(t).includes(n)?n:null}function _(n,t){return s(n.tag,t)===null&&n.sort==="newest"}function d(n,t){const o=s(t.tag,n),r=o===null?[...n]:n.filter(e=>e.tag.trim()===o);return t.sort==="name"&&r.sort((e,l)=>e.name.localeCompare(l.name)),r.map(e=>e.id)}function f(n,t,o){const[r,e]=a(n,!1,t,o),[l,i]=a(n,!0,t,o);return{col:r,row:e,colPhone:l,rowPhone:i}}const c=(n,t)=>`${Math.ceil(n*100/t)}vw`;function S(n,t,o){const r=f(n,t,o);return`(max-width: ${u}px) ${c(r.colPhone,m)}, ${c(r.col,L)}`}const p="sf-wall-placed",R=`.${p}{grid-column:span var(--sf-wall-c) !important;grid-row:span var(--sf-wall-r) !important}@media (max-width:800px){.${p}{grid-column:span var(--sf-wall-cp) !important;grid-row:span var(--sf-wall-rp) !important}}`;export{E as EMPTY_GALLERY_TOOLBAR,g as GALLERY_SORT_KEYS,x as GALLERY_SORT_LABELS,p as WALL_PLACED_CELL,R as WALL_PLACED_CSS,s as clampGalleryTag,d as galleryShownIds,w as galleryTags,_ as galleryToolbarIdle,f as wallSpanAt,S as wallTileSizes};