efficient-storefront-blocks 0.133.7 → 0.133.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
  3. package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
  4. package/dist/editor/lib/storefront-editor-words.js +1 -1
  5. package/dist/index.js +27 -27
  6. package/dist/render/components/ProductGallery.js +1 -1
  7. package/dist/render/components/product-hero/SpinLayer.d.ts +2 -1
  8. package/dist/render/components/product-hero/SpinLayer.js +1 -1
  9. package/dist/render/components/product-hero/hero-view.d.ts +1 -1
  10. package/dist/render/components/product-hero/hero-view.js +1 -1
  11. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +3 -1
  12. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  13. package/dist/render/components/wheels-plp/PlpFilterButton.d.ts +4 -1
  14. package/dist/render/components/wheels-plp/PlpFilterButton.js +1 -1
  15. package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/render.js +1 -1
  16. package/dist/render/lib/document/blocks/text-part-shapes.json +7 -0
  17. package/dist/render/lib/sections/hero-gallery.d.ts +1 -0
  18. package/dist/render/lib/sections/hero-gallery.js +1 -1
  19. package/dist/render/lib/sections/shopper-filters.d.ts +3 -0
  20. package/dist/render/lib/sections/shopper-filters.js +1 -1
  21. package/dist/render/lib/sections/spin-sets.d.ts +3 -1
  22. package/dist/render/lib/sections/spin-sets.js +1 -1
  23. package/dist/routine-index.json +1 -1
  24. package/dist/value-index.json +1 -1
  25. package/dist/words.d.ts +1 -0
  26. package/dist/words.js +1 -1
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- "use client";import{jsx as l,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as G}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import R from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as F,DEFAULT_HERO_GALLERY_MARKS as v,DEFAULT_HERO_GALLERY_MODE as B,DEFAULT_HERO_GALLERY_SHOW as V,DEFAULT_HERO_IMAGE_FIT as Y,DEFAULT_HERO_PHOTO_GROUND as w,parseHeroGalleryGap as W,parseHeroCloseUpsFill as q,parseHeroGalleryMarks as X,parseHeroGalleryMode as Z,parseHeroGalleryShow as K,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{spinSetFor as te}from"../lib/sections/spin-sets.js";import{productHasComposedRender as ae}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as le,swipeStep as ne}from"efficient-web-builder/format/lib/hero-swipe";function oe({product:t,view:e,angleIdx:o,onSelect:c,isLight:n,onLightbox:s,galleryMode:i=B,imageFit:h=Y,style:a,takesViewHide:m=!1,spin:p=re,ground:d=w,show:g=V,marks:y=v,gap:S=F,closeUpsFill:_=z}){const b=te(p,t.slug,e.metaValue),L=se(Q(d),n),f=K(g)==="closeUps"||b?ie(e):e,E=X(y),T=ce(e,f,q(_)),r=Z(i),x=ee(J(h),ae(t)),H=l(ue,{name:t.name,view:f,wellGround:L,angleIdx:o,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?l(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[l(me,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:W(S),fillsTile:T}),l(pe,{angleIdx:o,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[l("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&l(he,{name:t.name,view:f,angleIdx:o,onSelect:c,isLight:n,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",re={},k="sf-photo-ground-studio";function se(t,e){return t==="studio"?k:e?"bg-bg":""}function ie(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function ce(t,e,o){if(!o||e===t)return A;const c=new Set(t.closeUps.map(n=>n.url));return(n,s)=>s>0&&n!==void 0&&c.has(n)}const M=(t,e,o)=>[t,e.metaValue,o].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function me({name:t,view:e,wellGround:o,onLightbox:c,fit:n,spinSet:s,gap:i,fillsTile:h=A}){const a=s?l(R,{set:s,name:P(t,e)}):null,m=i===F;return l("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return l("div",{"data-hero-stack-photo":!0,className:[j,o].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:n,eager:d===0,fillsTile:h(p,d)})},p)})})}function pe({angleIdx:t,total:e,onSelect:o,children:c}){const n=G(null),s=G(null),i=le({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return l("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{n.current=i&&a.touches.length===1?h(a):null,s.current=n.current},onTouchMove:a=>{n.current&&(a.touches.length!==1?n.current=null:s.current=h(a))},onTouchEnd:()=>{const a=n.current,m=s.current;if(n.current=null,s.current=null,!a||!m)return;const p=ne(m.x-a.x,m.y-a.y,t,e);p!==t&&o(p)},children:c})}const de=6;function ue({name:t,view:e,angleIdx:o,onSelect:c,onLightbox:n,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(o,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(o,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(o+1).padStart(2,"0")," / ",S]}),l("span",{className:"text-fg-dim",children:"·"})]}),l("span",{children:t}),e.metaValue&&u(O,{children:[l("span",{className:"text-fg-dim",children:"·"}),l("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&l("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(o,g,c).map(r=>l("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>l("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?l(R,{set:i,name:P(t,e)}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>n(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&l("span",{children:e.specCaption}),e.referenceNote&&l("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&l("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),l("span",{children:e.originCaption})]})]})}function he({name:t,view:e,angleIdx:o,onSelect:c,isLight:n,tiled:s=!1}){const i=U(e);return i<2?null:l("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,de)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===o,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",n?"bg-bg":"",a===o?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[l("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{oe as default};
1
+ "use client";import{jsx as o,Fragment as O,jsxs as u}from"react/jsx-runtime";import{useRef as G}from"react";import{photoLabel as N}from"./product-hero/hero-view.js";import R from"./product-hero/SpinLayer.js";import{stageControls as $,useHeldStagePhoto as I}from"./product-hero/stage-photo.js";import{DEFAULT_HERO_CLOSE_UPS_FILL as z,DEFAULT_HERO_GALLERY_GAP as F,DEFAULT_HERO_GALLERY_MARKS as B,DEFAULT_HERO_GALLERY_MODE as V,DEFAULT_HERO_GALLERY_SHOW as v,DEFAULT_HERO_IMAGE_FIT as Y,DEFAULT_HERO_PHOTO_GROUND as W,parseHeroGalleryGap as q,parseHeroCloseUpsFill as X,parseHeroGalleryMarks as Z,parseHeroGalleryMode as w,parseHeroGalleryShow as K,parseHeroImageFit as J,parseHeroPhotoGround as Q,resolveHeroImageFit as ee}from"../lib/sections/hero-gallery.js";import{spinSetFor as te}from"../lib/sections/spin-sets.js";import{productHasComposedRender as ae}from"../lib/wheels/set-mode.js";import{HideTaker as C}from"efficient-web-builder/render/components/ViewHideRoot";import{swipeEnabled as oe,swipeStep as le}from"efficient-web-builder/format/lib/hero-swipe";function ne({product:t,view:e,angleIdx:n,onSelect:c,isLight:l,onLightbox:s,galleryMode:i=V,imageFit:h=Y,style:a,takesViewHide:m=!1,spin:p=re,ground:d=W,show:g=v,marks:y=B,gap:S=F,closeUpsFill:_=z}){const b=te(p,t.slug,e.metaValue),L=se(Q(d),l),f=K(g)==="closeUps"||b?ie(e):e,E=Z(y),T=ce(e,f,X(_)),r=w(i),x=ee(J(h),ae(t)),H=o(ue,{name:t.name,view:f,wellGround:L,angleIdx:n,onSelect:c,onLightbox:s,fit:x,spinSet:b,marks:E,fillsTile:T});return r==="stacked"?o(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,style:a,children:f.photos.length<2&&!b?H:u(O,{children:[o(me,{name:t.name,view:f,wellGround:L,onLightbox:s,fit:x,spinSet:b,gap:q(S),fillsTile:T}),o(pe,{angleIdx:n,total:U(f),onSelect:c,children:H})]})}):u(C,{as:"div",takes:m,"data-hero-gallery":r,"data-hero-fit":x,className:r==="tiled"?"flex items-start gap-3 max-view-tablet:gap-2":void 0,style:a,children:[o("div",{className:r==="tiled"?"min-w-0 flex-1":void 0,children:H}),r!=="main"&&o(he,{name:t.name,view:f,angleIdx:n,onSelect:c,isLight:l,tiled:r==="tiled"})]})}function U(t){return t.photos.length>0?t.photos.length:t.thumbFallbackCells}const j="relative flex aspect-square items-center justify-center overflow-hidden",re={},k="sf-photo-ground-studio";function se(t,e){return t==="studio"?k:e?"bg-bg":""}function ie(t){return t.photos.length===0||t.closeUps.length===0?t:{...t,photos:[t.photos[0],...t.closeUps.map(e=>e.url)],captions:[t.captions[0],...t.closeUps.map(e=>e.title)]}}const A=()=>!1;function ce(t,e,n){if(!n||e===t)return A;const c=new Set(t.closeUps.map(l=>l.url));return(l,s)=>s>0&&l!==void 0&&c.has(l)}const M=(t,e,n)=>[t,e.metaValue,n].filter(Boolean).join(" — "),P=(t,e)=>[t,e.metaValue].filter(Boolean).join(" "),D=(t,e)=>`Open ${[t,e.metaValue].filter(Boolean).join(" ")} at full resolution`;function me({name:t,view:e,wellGround:n,onLightbox:c,fit:l,spinSet:s,gap:i,fillsTile:h=A}){const a=s?o(R,{set:s,name:P(t,e),poster:e.photos[0]}):null,m=i===F;return o("div",{"data-hero-stack":!0,className:m?"flex flex-col gap-2 max-view-tablet:hidden":"flex flex-col max-view-tablet:hidden",style:m?void 0:{gap:`${i}px`},children:e.photos.map((p,d)=>{const g=M(t,e,N(e,d));return o("div",{"data-hero-stack-photo":!0,className:[j,n].join(" "),style:{color:e.tint},children:d===0&&a?a:e.stageImage({photo:p,alt:g,label:D(t,e),onZoom:()=>c(p,g),fit:l,eager:d===0,fillsTile:h(p,d)})},p)})})}function pe({angleIdx:t,total:e,onSelect:n,children:c}){const l=G(null),s=G(null),i=oe({count:e}),h=a=>({x:a.touches[0].clientX,y:a.touches[0].clientY});return o("div",{"data-hero-phone-stage":!0,className:"view-tablet:hidden",onTouchStart:a=>{l.current=i&&a.touches.length===1?h(a):null,s.current=l.current},onTouchMove:a=>{l.current&&(a.touches.length!==1?l.current=null:s.current=h(a))},onTouchEnd:()=>{const a=l.current,m=s.current;if(l.current=null,s.current=null,!a||!m)return;const p=le(m.x-a.x,m.y-a.y,t,e);p!==t&&n(p)},children:c})}const de=6;function ue({name:t,view:e,angleIdx:n,onSelect:c,onLightbox:l,fit:s,spinSet:i,wellGround:h,marks:a,fillsTile:m=A}){const p=e.photos[Math.min(n,e.photos.length-1)],d=I(e.photos,p),g=U(e),y=g>=2,S=String(g).padStart(2,"0"),_=Math.min(n,Math.max(e.photos.length-1,0)),b=y||e.captions[_]?N(e,_):"",L=M(t,e,b),f="max-view-tablet:static",E=[`${j} max-view-tablet:col-span-2`,h].join(" ");return u("div",{className:"relative max-view-tablet:grid max-view-tablet:grid-cols-[minmax(0,1fr)_auto] max-view-tablet:items-start max-view-tablet:gap-x-3 max-view-tablet:gap-y-2",style:{color:e.tint},children:[a&&u("div",{className:`absolute left-0 top-0 z-10 flex items-center gap-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-fg ${f} max-view-tablet:min-w-0 max-view-tablet:flex-wrap max-view-tablet:gap-x-2 max-view-tablet:gap-y-1`,children:[y&&u(O,{children:[u("span",{className:"text-accent",children:[String(n+1).padStart(2,"0")," / ",S]}),o("span",{className:"text-fg-dim",children:"·"})]}),o("span",{children:t}),e.metaValue&&u(O,{children:[o("span",{className:"text-fg-dim",children:"·"}),o("span",{className:"text-accent",children:e.metaValue})]})]}),a&&y&&o("div",{className:`absolute right-5 top-5 z-10 flex gap-1 ${f}`,children:$(n,g,c).map(r=>o("button",{type:"button","aria-label":r.label,title:r.label,onClick:r.onClick,className:"flex h-7 w-7 items-center justify-center border border-fg-dim/60 text-fg transition-colors hover:border-accent hover:text-accent",children:r.glyph},r.label))}),u("div",{className:E,children:[h!==k&&["top-3 left-3","top-3 right-3","bottom-3 left-3","bottom-3 right-3"].map((r,x)=>o("span",{className:`absolute ${r} h-3 w-3 border border-fg-dim/40`,style:{borderTop:r.includes("top")?"1px solid var(--site-line)":"none",borderBottom:r.includes("bottom")?"1px solid var(--site-line)":"none",borderLeft:r.includes("left")?"1px solid var(--site-line)":"none",borderRight:r.includes("right")?"1px solid var(--site-line)":"none"}},x)),i&&_===0?o(R,{set:i,name:P(t,e),poster:e.photos[0]}):e.stageImage({photo:d,alt:L,label:D(t,e),onZoom:()=>l(d,L),fit:s,fillsTile:m(d,e.photos.indexOf(d??""))})]}),a&&u("div",{className:`absolute bottom-0 left-0 right-0 z-10 flex items-end justify-between gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim ${f} max-view-tablet:col-span-2 max-view-tablet:flex-wrap`,children:[u("span",{className:"flex min-w-0 flex-col gap-1",children:[e.specCaption&&o("span",{children:e.specCaption}),e.referenceNote&&o("span",{"data-hero-reference-note":!0,children:e.referenceNote}),e.galleryHint&&o("span",{"data-hero-gallery-hint":!0,children:e.galleryHint})]}),o("span",{children:e.originCaption})]})]})}function he({name:t,view:e,angleIdx:n,onSelect:c,isLight:l,tiled:s=!1}){const i=U(e);return i<2?null:o("div",{className:s?"order-[-1] flex w-16 flex-col gap-2 max-view-tablet:w-12 max-view-tablet:gap-1":"mt-2 grid grid-cols-4 gap-2 max-view-tablet:gap-1",style:!s&&i>4?{gridTemplateColumns:`repeat(${Math.min(i,de)}, minmax(0, 1fr))`}:void 0,children:Array.from({length:i}).map((h,a)=>{const m=e.photos[a];return u("button",{type:"button",onClick:()=>c(a),"aria-label":`View ${N(e,a)}`,"aria-pressed":a===n,className:["relative flex aspect-square items-center justify-center overflow-hidden transition-colors",l?"bg-bg":"",a===n?"border border-accent":"border border-transparent hover:border-fg-dim"].join(" "),style:{color:e.tint},children:[o("span",{className:"absolute top-1.5 left-2 z-10 font-mono text-[length:var(--size-label,8px)] uppercase tracking-[0.18em] text-fg-dim",children:String(a+1).padStart(2,"0")}),e.thumbImage({photo:m,alt:`${t} — ${N(e,a)}`})]},a)})})}export{ne as default};
@@ -3,7 +3,8 @@ export declare const SpinChoices: import("react").Context<{
3
3
  autoTurn: boolean;
4
4
  turnHint: boolean;
5
5
  }>;
6
- export default function SpinLayer({ set, name }: {
6
+ export default function SpinLayer({ set, name, poster }: {
7
7
  set: SpinSet;
8
8
  name: string;
9
+ poster?: string;
9
10
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as x,Fragment as ie,jsxs as M}from"react/jsx-runtime";import{createContext as Me,useCallback as ae,useContext as Le,useEffect as w,useRef as y,useState as h}from"react";import{VIEW_TABLET_MIN as De}from"efficient-easel/screen/lib/content/view-tiers";import{cssStringBody as Ne}from"efficient-web-builder/format/lib/document/style-text";import{HALF_SIZES as j,sizedImage as He}from"efficient-web-builder/format/lib/sized-image";import{prefersReducedMotion as X}from"efficient-web-builder/render/components/useReducedMotion";import{DEFAULT_SPIN_AUTO_TURN as Re,DEFAULT_SPIN_HINT as $e,SPIN_HINT_HIDE_MS as Ce,SPIN_HINT_SHOW_MS as ce,SPIN_RESUME_MS as Oe,isFullTurn as le,spinAutoTurnStep as We,spinBlend as Ue,spinClampPosition as je,spinFrameIndex as L,spinPositionAfterDrag as ue,spinCell as z,spinStartPosition as B}from"../../lib/sections/spin-sets.js";const Xe=.3,ze=.85,de=24,fe=4,me=1e3,he=77/72,pe=`${(1-he)/2*100}%`,we=`${he*100}%`,q={left:pe,top:pe,width:we,height:we},Be=`(max-width: ${De-.02}px)`,K=new Map,ge=new Map;function G(t,v){let p=K.get(t);return p||(p=new Promise(P=>{const a=new Image,b=()=>{K.delete(t),ge.delete(t),P(null)},d=()=>P({w:a.naturalWidth,h:a.naturalHeight});a.onload=()=>{if(typeof a.decode!="function")return d();a.decode().then(d,b)},a.onerror=b,v&&(a.sizes=j,a.srcset=v),a.src=t,ge.set(t,a)}),K.set(t,p)),p}const qe=Me({autoTurn:Re,turnHint:$e});let D=!1;const Ke="M3 4.5c3.2 3.6 18.8 3.6 22 0M5.6 2.6 3 4.5l3 1.2M22.4 2.6 25 4.5l-3 1.2",N=t=>He(t,{fallbackWidth:me,maxWidth:me}),ye=(t,v)=>!!t.frames&&v===t.frames[0],ve=t=>({...q,backgroundImage:`url("${Ne(t.url)}")`,backgroundSize:`${t.cols*100}% ${t.rows*100}%`,backgroundPosition:`${t.cols>1?t.col*100/(t.cols-1):0}% ${t.rows>1?t.row*100/(t.rows-1):0}%`});function Ge({set:t,name:v}){const[p,P]=h(()=>B(t)),a=y(null),b=y(0),d=y(p),F=y(null),S=y(null),{autoTurn:f,turnHint:H}=Le(qe),[be,R]=h(!1),[Se,Z]=h(!1),[$,Q]=h(0),V=y(0),[Ee,Y]=h(!1),[_e,ke]=h(!0),[J,xe]=h(null),i=t.count,[C,ee]=h(null),O=y(null),[E,te]=h(null),g=le(t),_=L(p,i,g),A=ae(e=>{const n=je(e,i,g);return d.current=n,P(n),n},[i,g]),T=ae(()=>cancelAnimationFrame(b.current),[]);w(()=>{const e=window.matchMedia?.(Be);if(!e)return te(!1);const n=()=>te(e.matches);return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)},[]),w(()=>{if(!t.sheets||!t.startFrame||E===null)return;const e=E?t.sheets.phone:t.sheets.desktop,n=`${t.startFrame} ${e.urls[0]}`;if(S.current===n)return;S.current=n,ee({key:n,sheet:e,ready:new Set});const r=Math.floor(B(t)/(e.cols*e.rows)),u=e.urls.map((l,o)=>e.urls[(r+o)%e.urls.length]),c=N(t.startFrame);G(c.src,c.srcSet).then(()=>{for(const l of u)G(l).then(o=>{!o||o.w!==e.cols*e.frame||o.h!==e.rows*e.frame||S.current===n&&ee(m=>m?.key===n?{...m,ready:new Set(m.ready).add(l)}:m)})})},[t,E]),w(()=>{if(!t.frames)return;const e=t.frames,n=e[0];if(S.current===n)return;S.current=n;const r=L(B(t),i,le(t)),u=[];for(let l=0;l<fe;l+=1)for(let o=l;o<i;o+=fe)u.push((r+o)%i);const c=l=>{const o=N(e[l]);return G(o.src,o.srcSet)};c(u[0]).then(()=>Promise.all(u.slice(1).map(c))).then(l=>{S.current===n&&l.every(Boolean)&&xe(n)})},[i,t]),w(()=>T,[T]),w(()=>{if(!H||D)return;const e=window.setTimeout(()=>R(!D),ce),n=window.setTimeout(()=>{D=!0,R(!1)},ce+Ce);return()=>{window.clearTimeout(e),window.clearTimeout(n)}},[H]),w(()=>{const e=a.current;if(!f||!e)return;if(typeof IntersectionObserver>"u")return Y(!0);const n=new IntersectionObserver(r=>Y(r.some(u=>u.isIntersecting)));return n.observe(e),()=>n.disconnect()},[f]),w(()=>{if(!f)return;const e=()=>ke(document.visibilityState!=="hidden");return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f]);const Pe=e=>{T(),f&&Z(!0),H&&(D=!0,R(!1)),e.currentTarget.setPointerCapture?.(e.pointerId),F.current={x0:e.clientX,f0:d.current,last:e.clientX,speed:0}},Ae=e=>{const n=F.current,r=a.current;!n||!r||(n.speed=e.clientX-n.last,n.last=e.clientX,A(ue(n.f0,e.clientX-n.x0,r.clientWidth,i)))},ne=()=>{const e=F.current;F.current=null,f&&e&&(Z(!1),Q(c=>c+1));const n=a.current;if(!e||!n||X())return;let r=Math.max(-de,Math.min(de,e.speed));const u=()=>{if(Math.abs(r)<Xe)return;const c=ue(d.current,r,n.clientWidth,i);A(c)===c&&(r*=ze,b.current=requestAnimationFrame(u))};b.current=requestAnimationFrame(u)},Ie=e=>{const n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(e.key==="Home")A(0);else if(e.key==="End")A(i-1);else if(n)A(Math.round(d.current)+n);else return;T(),f&&Q(r=>r+1),e.preventDefault()},s=t.sheets&&C&&C.key.startsWith(`${t.startFrame} `)?C:null;s&&s.ready.has(z(s.sheet,_).url)&&(O.current={key:s.key,frame:_});const W=s&&O.current?.key===s.key?O.current.frame:null,I=s&&W!==null?{...z(s.sheet,W),cols:s.sheet.cols,rows:s.sheet.rows}:null,k=Ue(p,i,g,X()),U=s&&k.b!==null&&W===_?z(s.sheet,k.b):null,re=I&&U&&s.ready.has(U.url)?{...U,cols:I.cols,rows:I.rows}:null,oe=!s&&t.frames&&k.b!==null&&ye(t,J)?t.frames[k.b]:null,Fe=t.frames?ye(t,J):!!s&&s.ready.size===s.sheet.urls.length,se=f&&Fe&&Ee&&_e&&!Se;return w(()=>{if(!se)return;const e=V.current!==$;let n=-1,r=-1,u=1,c=0;const l=o=>{if(c=requestAnimationFrame(l),n<0&&(n=o),e&&o-n<Oe)return;if(V.current=$,r<0){r=o;return}const m=We(t,d.current,u,o-r);r=o,u=m.way;const Te=L(d.current,i,g);d.current=m.position,(!X()||L(m.position,i,g)!==Te)&&P(m.position)};return c=requestAnimationFrame(l),()=>cancelAnimationFrame(c)},[se,$,t,i,g]),M("div",{ref:a,"data-spin-well":!0,role:"slider",tabIndex:0,"aria-label":`${v}, 360° view: drag or use the arrow keys to turn`,"aria-valuemin":1,"aria-valuemax":i,"aria-valuenow":_+1,"aria-valuetext":`Angle ${_+1} of ${i}`,"data-spin-auto-turn":f?"":void 0,onKeyDown:Ie,className:"absolute inset-0 select-none overflow-hidden cursor-grab active:cursor-grabbing focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg",style:{touchAction:"pan-y"},onPointerDown:Pe,onPointerMove:Ae,onPointerUp:ne,onPointerCancel:ne,onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[I?M(ie,{children:[x("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:ve(I)}),re?x("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:{...ve(re),opacity:k.mix}}):null]}):M(ie,{children:[x("img",{...N(t.frames?t.frames[_]:t.startFrame??""),sizes:j,alt:"",draggable:!1,fetchPriority:"high","data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:q}),oe?x("img",{...N(oe),sizes:j,alt:"",draggable:!1,"data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:{...q,opacity:k.mix}}):null]}),be?M("span",{"data-spin-hint":!0,className:`pointer-events-none absolute inset-x-0 flex flex-col items-center gap-1 text-xs text-fg ${E?"bottom-3":"bottom-5"}`,children:[E?null:x("svg",{viewBox:"0 0 28 12",width:"28",height:"12","aria-hidden":"true",children:x("path",{d:Ke,fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),E?"Swipe to turn":"Drag to turn"]}):null]})}export{qe as SpinChoices,Ge as default};
1
+ "use client";import{jsx as b,Fragment as de,jsxs as H}from"react/jsx-runtime";import{createContext as $e,useCallback as fe,useContext as Oe,useEffect as h,useRef as p,useState as d}from"react";import{VIEW_TABLET_MIN as Re}from"efficient-easel/screen/lib/content/view-tiers";import{cssStringBody as Ce}from"efficient-web-builder/format/lib/document/style-text";import{HALF_SIZES as $,sizedImage as We}from"efficient-web-builder/format/lib/sized-image";import{prefersReducedMotion as G}from"efficient-web-builder/render/components/useReducedMotion";import{STAGE_PHOTO_BOX as Ue}from"../../lib/sections/hero-gallery.js";import{DEFAULT_SPIN_AUTO_TURN as je,DEFAULT_SPIN_HINT as Xe,SPIN_HINT_HIDE_MS as ze,SPIN_HINT_SHOW_MS as me,SPIN_RESUME_MS as Be,isFullTurn as he,spinAutoTurnStep as qe,spinBlend as Ge,spinClampPosition as Ke,spinFrameIndex as O,spinPositionAfterDrag as pe,spinCell as K,spinStartPosition as Z}from"../../lib/sections/spin-sets.js";const Ze=.3,Qe=.85,we=24,ge=4,ye=1e3,be=77/72,ve=`${(1-be)/2*100}%`,Se=`${be*100}%`,Q={left:ve,top:ve,width:Se,height:Se},Ve=`(max-width: ${Re-.02}px)`,V=new Map,Ee=new Map;function Y(t,v){let w=V.get(t);return w||(w=new Promise(M=>{const l=new Image,A=()=>{V.delete(t),Ee.delete(t),M(null)},S=()=>M({w:l.naturalWidth,h:l.naturalHeight});l.onload=()=>{if(typeof l.decode!="function")return S();l.decode().then(S,A)},l.onerror=A,v&&(l.sizes=$,l.srcset=v),l.src=t,Ee.set(t,l)}),V.set(t,w)),w}const Ye=$e({autoTurn:je,turnHint:Xe});let R=!1;const Je="M3 4.5c3.2 3.6 18.8 3.6 22 0M5.6 2.6 3 4.5l3 1.2M22.4 2.6 25 4.5l-3 1.2",F=t=>We(t,{fallbackWidth:ye,maxWidth:ye}),_e=(t,v)=>!!t.frames&&v===t.frames[0],Pe=t=>({...Q,backgroundImage:`url("${Ce(t.url)}")`,backgroundSize:`${t.cols*100}% ${t.rows*100}%`,backgroundPosition:`${t.cols>1?t.col*100/(t.cols-1):0}% ${t.rows>1?t.row*100/(t.rows-1):0}%`});function et({set:t,name:v,poster:w}){const[M,l]=d(null),A=p(null),[S,J]=d(()=>Z(t)),L=p(null),C=p(0),g=p(S),N=p(null),E=p(null),{autoTurn:f,turnHint:W}=Oe(Ye),[ke,U]=d(!1),[xe,ee]=d(!1),[j,te]=d(0),ne=p(0),[Ae,re]=d(!1),[Ie,Te]=d(!0),[oe,Fe]=d(null),i=t.count,[X,se]=d(null),z=p(null),[_,ie]=d(null),y=he(t),P=O(S,i,y),I=t.frames?t.frames[P]:t.startFrame??"";h(()=>{const e=A.current;e?.complete&&e.naturalWidth>0&&l(I)},[I]);const T=fe(e=>{const n=Ke(e,i,y);return g.current=n,J(n),n},[i,y]),D=fe(()=>cancelAnimationFrame(C.current),[]);h(()=>{const e=window.matchMedia?.(Ve);if(!e)return ie(!1);const n=()=>ie(e.matches);return n(),e.addEventListener?.("change",n),()=>e.removeEventListener?.("change",n)},[]),h(()=>{if(!t.sheets||!t.startFrame||_===null)return;const e=_?t.sheets.phone:t.sheets.desktop,n=`${t.startFrame} ${e.urls[0]}`;if(E.current===n)return;E.current=n,se({key:n,sheet:e,ready:new Set});const r=Math.floor(Z(t)/(e.cols*e.rows)),u=e.urls.map((c,o)=>e.urls[(r+o)%e.urls.length]),a=F(t.startFrame);Y(a.src,a.srcSet).then(()=>{for(const c of u)Y(c).then(o=>{!o||o.w!==e.cols*e.frame||o.h!==e.rows*e.frame||E.current===n&&se(m=>m?.key===n?{...m,ready:new Set(m.ready).add(c)}:m)})})},[t,_]),h(()=>{if(!t.frames)return;const e=t.frames,n=e[0];if(E.current===n)return;E.current=n;const r=O(Z(t),i,he(t)),u=[];for(let c=0;c<ge;c+=1)for(let o=c;o<i;o+=ge)u.push((r+o)%i);const a=c=>{const o=F(e[c]);return Y(o.src,o.srcSet)};a(u[0]).then(()=>Promise.all(u.slice(1).map(a))).then(c=>{E.current===n&&c.every(Boolean)&&Fe(n)})},[i,t]),h(()=>D,[D]),h(()=>{if(!W||R)return;const e=window.setTimeout(()=>U(!R),me),n=window.setTimeout(()=>{R=!0,U(!1)},me+ze);return()=>{window.clearTimeout(e),window.clearTimeout(n)}},[W]),h(()=>{const e=L.current;if(!f||!e)return;if(typeof IntersectionObserver>"u")return re(!0);const n=new IntersectionObserver(r=>re(r.some(u=>u.isIntersecting)));return n.observe(e),()=>n.disconnect()},[f]),h(()=>{if(!f)return;const e=()=>Te(document.visibilityState!=="hidden");return e(),document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[f]);const Me=e=>{D(),f&&ee(!0),W&&(R=!0,U(!1)),e.currentTarget.setPointerCapture?.(e.pointerId),N.current={x0:e.clientX,f0:g.current,last:e.clientX,speed:0}},Le=e=>{const n=N.current,r=L.current;!n||!r||(n.speed=e.clientX-n.last,n.last=e.clientX,T(pe(n.f0,e.clientX-n.x0,r.clientWidth,i)))},ae=()=>{const e=N.current;N.current=null,f&&e&&(ee(!1),te(a=>a+1));const n=L.current;if(!e||!n||G())return;let r=Math.max(-we,Math.min(we,e.speed));const u=()=>{if(Math.abs(r)<Ze)return;const a=pe(g.current,r,n.clientWidth,i);T(a)===a&&(r*=Qe,C.current=requestAnimationFrame(u))};C.current=requestAnimationFrame(u)},Ne=e=>{const n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(e.key==="Home")T(0);else if(e.key==="End")T(i-1);else if(n)T(Math.round(g.current)+n);else return;D(),f&&te(r=>r+1),e.preventDefault()},s=t.sheets&&X&&X.key.startsWith(`${t.startFrame} `)?X:null;s&&s.ready.has(K(s.sheet,P).url)&&(z.current={key:s.key,frame:P});const B=s&&z.current?.key===s.key?z.current.frame:null,k=s&&B!==null?{...K(s.sheet,B),cols:s.sheet.cols,rows:s.sheet.rows}:null,x=Ge(S,i,y,G()),q=s&&x.b!==null&&B===P?K(s.sheet,x.b):null,ce=k&&q&&s.ready.has(q.url)?{...q,cols:k.cols,rows:k.rows}:null,le=!s&&t.frames&&x.b!==null&&_e(t,oe)?t.frames[x.b]:null,De=t.frames?_e(t,oe):!!s&&s.ready.size===s.sheet.urls.length,ue=f&&De&&Ae&&Ie&&!xe;return h(()=>{if(!ue)return;const e=ne.current!==j;let n=-1,r=-1,u=1,a=0;const c=o=>{if(a=requestAnimationFrame(c),n<0&&(n=o),e&&o-n<Be)return;if(ne.current=j,r<0){r=o;return}const m=qe(t,g.current,u,o-r);r=o,u=m.way;const He=O(g.current,i,y);g.current=m.position,(!G()||O(m.position,i,y)!==He)&&J(m.position)};return a=requestAnimationFrame(c),()=>cancelAnimationFrame(a)},[ue,j,t,i,y]),H("div",{ref:L,"data-spin-well":!0,role:"slider",tabIndex:0,"aria-label":`${v}, 360° view: drag or use the arrow keys to turn`,"aria-valuemin":1,"aria-valuemax":i,"aria-valuenow":P+1,"aria-valuetext":`Angle ${P+1} of ${i}`,"data-spin-auto-turn":f?"":void 0,onKeyDown:Ne,className:"absolute inset-0 select-none overflow-hidden cursor-grab active:cursor-grabbing focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-fg",style:{touchAction:"pan-y"},onPointerDown:Me,onPointerMove:Le,onPointerUp:ae,onPointerCancel:ae,onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[k?H(de,{children:[b("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:Pe(k)}),ce?b("div",{"data-spin-frame":!0,className:"pointer-events-none absolute",style:{...Pe(ce),opacity:x.mix}}):null]}):H(de,{children:[b("img",{...F(I),ref:A,onLoad:()=>l(I),sizes:$,alt:"",draggable:!1,fetchPriority:"high","data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:Q}),le?b("img",{...F(le),sizes:$,alt:"",draggable:!1,"data-spin-frame":!0,className:"pointer-events-none absolute max-w-none object-contain",style:{...Q,opacity:x.mix}}):null]}),w&&!k&&M!==I?b("img",{...F(w),sizes:$,alt:"",draggable:!1,"data-spin-poster":!0,className:`pointer-events-none absolute inset-[6%] ${Ue} object-contain`}):null,ke?H("span",{"data-spin-hint":!0,className:`pointer-events-none absolute inset-x-0 flex flex-col items-center gap-1 text-xs text-fg ${_?"bottom-3":"bottom-5"}`,children:[_?null:b("svg",{viewBox:"0 0 28 12",width:"28",height:"12","aria-hidden":"true",children:b("path",{d:Je,fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})}),_?"Swipe to turn":"Drag to turn"]}):null]})}export{Ye as SpinChoices,et as default};
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { ProductSelection } from "../useProductSelection.js";
3
3
  import type { StoreProduct } from "../../lib/catalog/store-product.js";
4
- import type { HeroImageFit } from "../../lib/sections/hero-gallery.js";
4
+ import { type HeroImageFit } from "../../lib/sections/hero-gallery.js";
5
5
  export interface HeroView {
6
6
  heading: string;
7
7
  photos: string[];
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as y,jsxs as N}from"react/jsx-runtime";import E from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as w}from"./stage-photo.js";import{HeroVehicleMemory as k}from"./VehicleQuestion.js";import z from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import j from"efficient-web-builder/render/components/RMark";import P from"../TyreImage.js";import F from"../WheelImage.js";import I from"../WheelSvg.js";import{partVariant as S,wheelFinish as H}from"../../lib/catalog/from-wheel.js";import{tyreModelLine as L}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as R,lugRenderingsFor as _}from"../../lib/wheels/cover-rendering.js";import{namedDetailShots as A}from"../../lib/wheels/detail-shots.js";import{finishAngles as T}from"../../lib/wheels/finish-photos.js";import{selectedStuds as B}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as O,stageIsFallback as V}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as W}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as M}from"../../lib/wheels/variant-spec.js";function me(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function ce({text:t}){return t==="FusionForge®"?N(y,{children:["FusionForge",a(j,{})]}):a(y,{children:t})}function pe(t,e,h){if(t.kind==="tyre"){const r=t.source,l=e.shown.size??r.sizes[0]??"",n=r.variants.find(m=>m.size===l),f=n?.specs.tireType??r.variants[0]?.specs.tireType??null,d=[n?.image,r.coverImage].filter(m=>!!m);return{heading:L(r.brand,r.name),photos:d.slice(0,1),tint:void 0,stageImage:()=>a(P,{image:n?.image??r.coverImage,size:l,type:f,sizes:w,priority:!0,className:"h-full w-full"}),thumbImage:()=>null,captions:[],closeUps:[],thumbFallbackCells:0,galleryHint:"",referenceNote:"",metaValue:l,specCaption:n?[n.specs.loadIndex,n.specs.speedRating].filter(Boolean).join(""):"",originCaption:r.brand,unitLabel:"per tyre",vehicle:a(E,{slug:r.slug,variants:r.variants,vehicle:e.vehicle,manualMode:e.manualMode,setManualMode:e.setManualMode}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!1,preOrder:null}}const o=t.source,i=H(o,e.shown.finish),s=S(o,e.part),c=B(e),x=s?.components.find(r=>r.hand!=="right")??s?.components[0],p=R(i,x?.renderKey),u=p?null:_(i,c),v=p?[...p]:u?[...u]:T(i),g=v.length>0?v:o.coverImage?[o.coverImage]:[];return{heading:t.name,photos:g,tint:i.color,stageImage:({photo:r,alt:l,label:n,onZoom:f,fit:d,eager:m=!0,fillsTile:b=!1})=>a(F,{src:r,alt:l,fill:!0,sizes:w,className:b||d==="cover"?"object-cover":"object-contain",priority:m,onImageClick:f,imageButtonClassName:b?"relative block h-full w-full cursor-zoom-in":"relative block h-[88%] w-[88%] cursor-zoom-in",imageButtonLabel:n,fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[70%] w-[70%]"})}),thumbImage:({photo:r,alt:l})=>a(F,{src:r,alt:l,fill:!0,sizes:"(max-width: 720px) 20vw, (max-width: 1100px) 10vw, 120px",className:"object-contain",imageWrapperClassName:"relative h-[80%] w-[80%]",fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[55%] w-[55%]"})}),captions:g.map(r=>i.captions?.[r]),closeUps:A(i,c),thumbFallbackCells:4,galleryHint:U(g,i,c,e.manualMode),referenceNote:!p&&V(i,s,c,u!=null)?O:"",metaValue:i.name,specCaption:s?M(s):"",originCaption:o.process==="FusionForge®"?"FusionForge® · Hybrid":`${o.process} · 1-piece`,unitLabel:W,vehicle:a(z,{selection:e,spec:s?M(s):"",vehicle:e.vehicle,wheel:o}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!0,preOrder:a(C,{wheel:o,editing:h})}}function U(t,e,h,o){return t.length>=2||h!=null||!Object.values(e.lugRenderings??{}).some(s=>Array.isArray(s)&&s.filter(Boolean).length>=2)?"":o?"Pick a bolt pattern to see every angle":"Pick your vehicle to see every angle"}export{ce as MarkedLabel,pe as heroView,me as photoLabel};
1
+ "use client";import{jsx as a,Fragment as y,jsxs as E}from"react/jsx-runtime";import N from"./TyreHeroFitment.js";import{STAGE_IMAGE_SIZES as w}from"./stage-photo.js";import{HeroVehicleMemory as k}from"./VehicleQuestion.js";import z from"./WheelHeroFitment.js";import C from"../PreOrderPanel.js";import P from"efficient-web-builder/render/components/RMark";import S from"../TyreImage.js";import F from"../WheelImage.js";import I from"../WheelSvg.js";import{partVariant as _,wheelFinish as j}from"../../lib/catalog/from-wheel.js";import{STAGE_PHOTO_BOX as H}from"../../lib/sections/hero-gallery.js";import{tyreModelLine as A}from"../../lib/tyres/tyre-brand-name.js";import{axisRenderingsFor as L,lugRenderingsFor as O}from"../../lib/wheels/cover-rendering.js";import{namedDetailShots as R}from"../../lib/wheels/detail-shots.js";import{finishAngles as T}from"../../lib/wheels/finish-photos.js";import{selectedStuds as B}from"../../lib/wheels/selected-studs.js";import{REFERENCE_NOTE as V,stageIsFallback as W}from"../../lib/wheels/render-fit.js";import{PER_WHEEL_UNIT as G}from"../../lib/wheels/set-mode.js";import{variantSpecLabel as M}from"../../lib/wheels/variant-spec.js";function pe(t,e){return t.captions[e]?.trim()||`Photo ${e+1}`}function he({text:t}){return t==="FusionForge®"?E(y,{children:["FusionForge",a(P,{})]}):a(y,{children:t})}function ue(t,e,h){if(t.kind==="tyre"){const r=t.source,l=e.shown.size??r.sizes[0]??"",n=r.variants.find(m=>m.size===l),f=n?.specs.tireType??r.variants[0]?.specs.tireType??null,d=[n?.image,r.coverImage].filter(m=>!!m);return{heading:A(r.brand,r.name),photos:d.slice(0,1),tint:void 0,stageImage:()=>a(S,{image:n?.image??r.coverImage,size:l,type:f,sizes:w,priority:!0,className:"h-full w-full"}),thumbImage:()=>null,captions:[],closeUps:[],thumbFallbackCells:0,galleryHint:"",referenceNote:"",metaValue:l,specCaption:n?[n.specs.loadIndex,n.specs.speedRating].filter(Boolean).join(""):"",originCaption:r.brand,unitLabel:"per tyre",vehicle:a(N,{slug:r.slug,variants:r.variants,vehicle:e.vehicle,manualMode:e.manualMode,setManualMode:e.setManualMode}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!1,preOrder:null}}const o=t.source,i=j(o,e.shown.finish),s=_(o,e.part),c=B(e),x=s?.components.find(r=>r.hand!=="right")??s?.components[0],p=L(i,x?.renderKey),u=p?null:O(i,c),v=p?[...p]:u?[...u]:T(i),g=v.length>0?v:o.coverImage?[o.coverImage]:[];return{heading:t.name,photos:g,tint:i.color,stageImage:({photo:r,alt:l,label:n,onZoom:f,fit:d,eager:m=!0,fillsTile:b=!1})=>a(F,{src:r,alt:l,fill:!0,sizes:w,className:b||d==="cover"?"object-cover":"object-contain",priority:m,onImageClick:f,imageButtonClassName:b?"relative block h-full w-full cursor-zoom-in":`relative block ${H} cursor-zoom-in`,imageButtonLabel:n,fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[70%] w-[70%]"})}),thumbImage:({photo:r,alt:l})=>a(F,{src:r,alt:l,fill:!0,sizes:"(max-width: 720px) 20vw, (max-width: 1100px) 10vw, 120px",className:"object-contain",imageWrapperClassName:"relative h-[80%] w-[80%]",fallback:a(I,{spokes:o.spokes,mesh:o.mesh,className:"block h-[55%] w-[55%]"})}),captions:g.map(r=>i.captions?.[r]),closeUps:R(i,c),thumbFallbackCells:4,galleryHint:U(g,i,c,e.manualMode),referenceNote:!p&&W(i,s,c,u!=null)?V:"",metaValue:i.name,specCaption:s?M(s):"",originCaption:o.process==="FusionForge®"?"FusionForge® · Hybrid":`${o.process} · 1-piece`,unitLabel:G,vehicle:a(z,{selection:e,spec:s?M(s):"",vehicle:e.vehicle,wheel:o}),vehicleMemory:e.manualMode?null:a(k,{vehicle:e.vehicle}),vehicleAnswersSpecs:!0,preOrder:a(C,{wheel:o,editing:h})}}function U(t,e,h,o){return t.length>=2||h!=null||!Object.values(e.lugRenderings??{}).some(s=>Array.isArray(s)&&s.filter(Boolean).length>=2)?"":o?"Pick a bolt pattern to see every angle":"Pick your vehicle to see every angle"}export{he as MarkedLabel,ue as heroView,pe as photoLabel};
@@ -8,6 +8,8 @@ import { type GridSource } from "../../lib/wheels/grid-source.js";
8
8
  export interface AlloyWheelsListingProps {
9
9
  filterLook?: unknown;
10
10
  filterLookPhone?: unknown;
11
+ filterLabel?: string;
12
+ filterFloat?: string | null;
11
13
  cellLook?: unknown;
12
14
  titleLevel?: number;
13
15
  heading?: string;
@@ -40,4 +42,4 @@ export declare const PLP_GATE_DEFAULTS: {
40
42
  readonly heading: "Let's find wheels that fit your car.";
41
43
  readonly intro: "Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you.";
42
44
  };
43
- export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, source, products, wheels, addressQuery, editing, ownerId, template, facetTemplate, railTemplate, railHeadTemplate, hover, titleLevel, omitHead, cellLook, filterLook, filterLookPhone, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
45
+ export default function AlloyWheelsListing({ heading, intro, askForCar, gateHeading, gateIntro, perPage, columns, defaultSort, hiddenFacets, fieldUsage, showPrice, showInStock, kinds, source, products, wheels, addressQuery, editing, ownerId, template, facetTemplate, railTemplate, railHeadTemplate, hover, titleLevel, omitHead, cellLook, filterLook, filterLookPhone, filterLabel, filterFloat, }: AlloyWheelsListingProps): import("react").JSX.Element | null;
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as l,Fragment as fe}from"react/jsx-runtime";import{useScopeClass as lt}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as ct,useMemo as s,useRef as at,useState as pt}from"react";import{cardHoverOf as mt}from"efficient-web-builder/format/lib/animation/hover";import{pageTitleTag as dt}from"efficient-web-builder/format/lib/document/one-h1";import{SHARED_ROWS_LIST_CLASS as ut}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as ft,answersForKind as he}from"../../lib/content/field-usage.js";import{useCurrency as ht}from"../CurrencyContext.js";import gt from"../NoCurrencyNote.js";import{usePreviewDevice as yt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as St,renderHeadline as xt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as bt}from"../useProductCatalog.js";import{scrollBehavior as wt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as Pt,PLP_GRID_GAP_VAR as kt,plpGridVars as vt}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as Nt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as Ct,cardRowsGridStyle as Tt}from"../WheelCardFrame.js";import{applyPlpFilters as _t,buildPlpFacets as At,buildPlpTypeOptions as Lt,buildTyreSizeBoxes as Ft,EMPTY_PLP_FILTERS as ge,hasActivePlpFilters as zt,paginatePlp as It,pickTyreSize as Ot,plpTyreSizeBoxesShown as Mt,plpInStockCount as Rt,plpOpeningSort as Vt,plpPriceBounds as Et,plpShownKinds as Gt,plpSortKeysFor as Kt,PLP_SORT_LABELS as jt}from"../../lib/wheels/plp-filters.js";import{itemKind as I,itemSlug as Bt,itemTyreSizes as Dt,plpBrandVaries as Wt,plpProcessVaries as $t,plpItemsOfKinds as Yt,plpKindNoun as ye,resolvePlpKinds as Ht}from"../../lib/catalog/plp-item.js";import{plpGateWords as qt,plpVehicleCopy as Jt}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Qt,oemTyreSizes as Ut}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as Xt}from"../../lib/wheels/plp-fitment-match.js";import Zt from"./PlpActiveChips.js";import{GridCardProvider as eo,GridMixedCards as to,gridIndexCss as oo,LISTING_CARD_RULES as ro}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as no}from"../ProductCardEyebrow.js";import io from"./PlpPagination.js";import so from"./PlpSidebar.js";import lo from"./PlpFilterButton.js";import{plpFilterViews as co}from"../../lib/sections/shopper-filters.js";import{PlpResultRange as ao,PlpToolbar as po}from"./PlpToolbar.js";import mo from"../catalog/SortSelect.js";import uo from"./PlpVehicleBar.js";import fo from"./PlpVehicleGate.js";import{useVehicleCatalog as ho}from"./useVehicleCatalog.js";import{useVehicleFit as go}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as yo}from"./usePlpFiltersInUrl.js";import{productContentOf as So,rowsForGridSource as xo}from"../../lib/wheels/grid-source.js";import{say as D}from"efficient-web-builder/format/lib/editor-words";import{ALLOY_WHEELS_LISTING_TYPE as Se}from"../../lib/document/document-nodes.js";import{withRootPad as bo}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as wo}from"../SectionPadScope.js";const mr={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function Po({level:k,className:v,children:N}){const O=dt(k);return o(O,{className:v,children:N})}const ko=mt({},Se),xe="px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]";function vo({heading:k="",intro:v="",askForCar:N=!0,gateHeading:O="",gateIntro:be="",perPage:W=24,columns:we,defaultSort:Pe="recommended",hiddenFacets:$=[],fieldUsage:h=ft,showPrice:Y=!0,showInStock:ke=!0,kinds:ve,source:H,products:Ne,wheels:Ce,addressQuery:Te,editing:d=!1,ownerId:q="",template:_e,facetTemplate:Ae,railTemplate:Le,railHeadTemplate:Fe,hover:ze=ko,titleLevel:Ie,omitHead:M=!1,cellLook:J,filterLook:Oe,filterLookPhone:Me}){const{currency:a}=ht(),Q=wo(),u=Ht(ve),U=yt(),X=Pt(we),Re=vt(X,d?U:null),Ve=Nt(X,d?U:null),Z=lt("plp"),Ee=oo(Z),Ge=bt(),ee=Ne??Ce??Ge??[],x=So(H)==="category"?H?.name??"":null,te=s(()=>{const t=Yt(ee,u);return x===null?t:xo({name:x},t)},[ee,u.join(","),x]),r=go({editing:d,enabled:N,autoApply:!0}),[Ke,R]=pt(!1),je=Vt(Pe,u),g=r.applied?.vehicle??null,[_,b]=yo({editing:d,openingSort:je,appliedVehicle:g,vehicleRestored:r.restored,addressQuery:Te}),e=s(()=>x===null||_.collections.length===0?_:{..._,collections:[]},[_,x]),p=Gt(u,e.kind),n=m(t=>b(t),[b]),oe=m((t,f)=>{const c=e[t],it=c.map(String).includes(f)?c.filter(st=>String(st)!==f):[...c,t==="diameters"?Number(f):f];n({...e,[t]:it,page:1})},[e,n]),re=m(t=>n({...e,priceMin:t,page:1}),[e,n]),ne=m(t=>n({...e,priceMax:t,page:1}),[e,n]),ie=m(t=>n({...e,inStockOnly:t,page:1}),[e,n]),se=m(t=>n({...ge,kind:t,inStockOnly:e.inStockOnly,priceMin:e.priceMin,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMin,e.priceMax,e.sort,n]),Be=m(t=>n({...e,sort:t,page:1}),[e,n]),De=m(t=>{n({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:wt()})},[e,n]),le=m(()=>n({...ge,sort:e.sort}),[e.sort,n]),{clear:A}=r,ce=m(()=>{A(),R(!0),b(t=>({...t,page:1}))},[A]),We=m(()=>{A(),R(!1),b(t=>({...t,page:1}))},[A]),L=g?[g.make,g.model,g.year,g.modification].join("|"):"",F=at(null);ct(()=>{if(r.restored){if(F.current===null){F.current=L;return}F.current!==L&&(F.current=L,b(t=>t.page===1?t:{...t,page:1}))}},[r.restored,L,b]);const{items:z,failed:ae,retry:$e}=ho({catalog:te,shownKinds:u,vehicle:g,editing:d}),i=s(()=>{if(!r.fit)return z;const t=z.filter(c=>I(c)==="alloy-wheel"),f=new Set(Xt(t,r.fit).map(c=>c.slug));return z.filter(c=>I(c)!=="alloy-wheel"||f.has(Bt(c)))},[z,r.fit]),w=(x===null?$:[...$,"collections"]).join(","),Ye=s(()=>{const t=new Set(w?w.split(","):[]);return At(i,e,a,p,h).filter(f=>!t.has(f.key))},[i,e,a,w,p.join(","),h]),y=s(()=>_t(i,e,a),[i,e,a]),He=p.length>1,pe=s(()=>he(h,"alloy-wheel"),[h]),qe=s(()=>he(h,"tyre"),[h]),V=s(()=>Wt(y),[y]),E=s(()=>$t(y),[y]),G=He?ye(["alloy-wheel"]).one:null,Je=s(()=>({kindLabel:G,brand:V,process:E}),[G,V,E]),Qe=no({kind:!!G,brand:V,process:E},pe),Ue=s(()=>Y?Et(i,a):null,[i,a,Y]),Xe=s(()=>Rt(i,e,a),[i,e,a]),Ze=s(()=>Lt(i,u,e,a),[i,u.join(","),e,a]),et=m((t,f)=>{const c=Ot(i.flatMap(Dt),e.tyreSizes[0]??"",t,f);n({...e,tyreSizes:c?[c]:[],page:1})},[i,e,n]),tt=s(()=>{const t=new Set(w?w.split(","):[]);return!Mt(i,p)||t.has("tyreSizes")?null:Ft(i,e,a)},[i,e,a,w,p.join(","),h]),S=s(()=>It(y,e.page,W),[y,e.page,W]),P=ye(p),K=Jt(p),me=qt(O,be,p,u),de=p.length===1&&p[0]==="tyre",ue=r.applied?.stock??null,C=s(()=>Ut(ue),[ue]),ot=s(()=>i.filter(t=>p.includes(I(t))).length,[i,p.join(",")]),j=te.length===0,rt=!j&&i.length===0,nt=N&&!d&&!r.applied&&!Ke;if(u.length===0)return null;const B=o(so,{facets:Ye,filters:e,typeOptions:Ze,sizeBoxes:tt,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:P,priceBounds:Ue,inStockCount:ke?Xe:null,onToggle:oe,onPickType:se,onPickSize:et,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onClearAll:le,owner:{id:q,facetTemplate:Ae,railTemplate:Le,railHeadTemplate:Fe},editing:d}),T=co(Oe,Me);return l("section",{children:[N&&o(uo,{cascade:r.cascade,appliedName:r.appliedName,fit:r.fit,fitSummary:de&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:r.resolving,unresolved:de?!!r.applied&&!r.resolving&&C.length===0:r.unresolved,matchCount:ot,copy:K,onAmend:We,onClear:ce,cellLook:J}),nt&&o(fo,{cascade:r.cascade,heading:me.heading,intro:me.intro,ready:r.restored,copy:K,onSkip:()=>R(!0),cellLook:J}),l("div",{...Q?bo(M?"":xe,Q):{className:M?void 0:xe},children:[!M&&(k||v)&&l("header",{className:"mb-6",children:[k&&o(Po,{level:Ie,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:xt(k,!1)}),v&&o("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:St(v)})]}),l("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[T.rail===""?B:T.rail!==null&&o("div",{className:T.rail,children:B}),l("div",{className:"min-w-0 flex-1",children:[o(po,{className:"mb-4",start:l(fe,{children:[o(ao,{total:S.total,range:{from:S.from,to:S.to},noun:P}),o(Zt,{filters:e,onToggle:oe,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onPickType:se})]}),end:l(fe,{children:[T.button!==null&&o("div",{className:T.button||void 0,children:o(lo,{filters:e,editing:d,children:B})}),o(mo,{value:e.sort,keys:Kt(u),labels:jt,onChange:Be})]})}),ae&&!j&&l("div",{role:"status",className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 border border-line px-4 py-3",children:[o("p",{className:"text-[14px] text-fg-dim",children:"We couldn't check your car just now — try again."}),o("button",{type:"button",onClick:$e,className:"cursor-pointer bg-btn px-4 py-2 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Try again"})]}),j?o("div",{className:"border border-dashed border-line p-10",children:o("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?P.many==="wheels"?D("No wheels in this website's catalog yet — curate products to see them here."):P.many==="tyres"?D("No tyres in this website's catalog yet — curate products to see them here."):D("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):rt?ae?null:l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",r.appliedName]}),o("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:K.nothingFits}),l("button",{type:"button",onClick:ce,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",P.many]})]}):S.total===0?l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",P.many," match those filters"]}),o("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),zt(e)&&o("button",{type:"button",onClick:le,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):l(eo,{value:{ownerId:q,ownerType:Se,Template:_e,hover:ze,imageSizes:Ve,fieldUsage:pe,tyreFieldUsage:qe,reserveEyebrow:Qe,editing:d,eyebrow:Je,fit:r.fit,colours:e.finishes,rules:ro},children:[o("style",{children:Ee}),o("div",{className:`plp-card-grid ${Z} ${Ct} ${ut}`,style:{...Re,...Tt(`var(${kt})`)},children:o(to,{items:S.items,tyreOf:t=>I(t)==="tyre"?t:null,tyreFit:t=>C.length>0?Qt(t.sizes,C):null})})]}),o(io,{page:S.page,pageCount:S.pageCount,onPage:De}),o(gt,{editing:d})]})]})]})]})}export{mr as PLP_GATE_DEFAULTS,vo as default};
1
+ "use client";import{jsx as o,jsxs as l,Fragment as fe}from"react/jsx-runtime";import{useScopeClass as at}from"../../lib/use-scope-class.js";import{useCallback as m,useEffect as pt,useMemo as s,useRef as mt,useState as dt}from"react";import{cardHoverOf as ut}from"efficient-web-builder/format/lib/animation/hover";import{pageTitleTag as ft}from"efficient-web-builder/format/lib/document/one-h1";import{SHARED_ROWS_LIST_CLASS as ht}from"efficient-web-builder/render/lib/content/box-shared-columns";import{NO_FIELD_ANSWERS as gt,answersForKind as he}from"../../lib/content/field-usage.js";import{useCurrency as yt}from"../CurrencyContext.js";import St from"../NoCurrencyNote.js";import{usePreviewDevice as xt}from"efficient-easel/screen/components/PreviewDeviceContext";import{renderGold as bt,renderHeadline as wt}from"efficient-web-builder/render/components/goldPhrases";import{useUnifiedProductCatalog as Pt}from"../useProductCatalog.js";import{scrollBehavior as kt}from"efficient-web-builder/render/components/useReducedMotion";import{normalizePlpColumns as vt,PLP_GRID_GAP_VAR as Nt,plpGridVars as Ct}from"../../lib/wheels/plp-grid.js";import{plpCardImageSizes as Tt}from"../../lib/sections/card-image-sizes.js";import{CARD_ROWS_GRID_CLASS as _t,cardRowsGridStyle as At}from"../WheelCardFrame.js";import{applyPlpFilters as Lt,buildPlpFacets as Ft,buildPlpTypeOptions as zt,buildTyreSizeBoxes as It,EMPTY_PLP_FILTERS as ge,hasActivePlpFilters as Ot,paginatePlp as Mt,pickTyreSize as Rt,plpTyreSizeBoxesShown as Vt,plpInStockCount as Et,plpOpeningSort as Gt,plpPriceBounds as Kt,plpShownKinds as jt,plpSortKeysFor as Bt,PLP_SORT_LABELS as Dt}from"../../lib/wheels/plp-filters.js";import{itemKind as I,itemSlug as Wt,itemTyreSizes as $t,plpBrandVaries as Yt,plpProcessVaries as Ht,plpItemsOfKinds as qt,plpKindNoun as ye,resolvePlpKinds as Jt}from"../../lib/catalog/plp-item.js";import{plpGateWords as Qt,plpVehicleCopy as Ut}from"../../lib/catalog/plp-vehicle-copy.js";import{oemBadgeSize as Xt,oemTyreSizes as Zt}from"../../lib/tyres/tyre-vehicle-fitment.js";import{wheelsFittingVehicle as eo}from"../../lib/wheels/plp-fitment-match.js";import to from"./PlpActiveChips.js";import{GridCardProvider as oo,GridMixedCards as ro,gridIndexCss as no,LISTING_CARD_RULES as io}from"../GridCardTemplate.js";import{wheelCardEyebrowShows as so}from"../ProductCardEyebrow.js";import lo from"./PlpPagination.js";import co from"./PlpSidebar.js";import ao from"./PlpFilterButton.js";import{plpFilterViews as po}from"../../lib/sections/shopper-filters.js";import{PlpResultRange as mo,PlpToolbar as uo}from"./PlpToolbar.js";import fo from"../catalog/SortSelect.js";import ho from"./PlpVehicleBar.js";import go from"./PlpVehicleGate.js";import{useVehicleCatalog as yo}from"./useVehicleCatalog.js";import{useVehicleFit as So}from"../fitment/useVehicleFit.js";import{usePlpFiltersInUrl as xo}from"./usePlpFiltersInUrl.js";import{productContentOf as bo,rowsForGridSource as wo}from"../../lib/wheels/grid-source.js";import{say as D}from"efficient-web-builder/format/lib/editor-words";import{ALLOY_WHEELS_LISTING_TYPE as Se}from"../../lib/document/document-nodes.js";import{withRootPad as Po}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as ko}from"../SectionPadScope.js";const ur={heading:"Let's find wheels that fit your car.",intro:"Tell us what you drive and we'll show you every set that bolts straight on — bolt pattern, offset and hub bore checked for you."};function vo({level:k,className:v,children:N}){const O=ft(k);return o(O,{className:v,children:N})}const No=ut({},Se),xe="px-5 py-10 md:px-[max(2.5rem,calc((100%_-_var(--sf-content-cap,100%))/2_+_2.5rem))]";function Co({heading:k="",intro:v="",askForCar:N=!0,gateHeading:O="",gateIntro:be="",perPage:W=24,columns:we,defaultSort:Pe="recommended",hiddenFacets:$=[],fieldUsage:h=gt,showPrice:Y=!0,showInStock:ke=!0,kinds:ve,source:H,products:Ne,wheels:Ce,addressQuery:Te,editing:d=!1,ownerId:q="",template:_e,facetTemplate:Ae,railTemplate:Le,railHeadTemplate:Fe,hover:ze=No,titleLevel:Ie,omitHead:M=!1,cellLook:J,filterLook:Oe,filterLookPhone:Me,filterLabel:Re,filterFloat:Ve=null}){const{currency:a}=yt(),Q=ko(),u=Jt(ve),U=xt(),X=vt(we),Ee=Ct(X,d?U:null),Ge=Tt(X,d?U:null),Z=at("plp"),Ke=no(Z),je=Pt(),ee=Ne??Ce??je??[],x=bo(H)==="category"?H?.name??"":null,te=s(()=>{const t=qt(ee,u);return x===null?t:wo({name:x},t)},[ee,u.join(","),x]),r=So({editing:d,enabled:N,autoApply:!0}),[Be,R]=dt(!1),De=Gt(Pe,u),g=r.applied?.vehicle??null,[_,b]=xo({editing:d,openingSort:De,appliedVehicle:g,vehicleRestored:r.restored,addressQuery:Te}),e=s(()=>x===null||_.collections.length===0?_:{..._,collections:[]},[_,x]),p=jt(u,e.kind),n=m(t=>b(t),[b]),oe=m((t,f)=>{const c=e[t],lt=c.map(String).includes(f)?c.filter(ct=>String(ct)!==f):[...c,t==="diameters"?Number(f):f];n({...e,[t]:lt,page:1})},[e,n]),re=m(t=>n({...e,priceMin:t,page:1}),[e,n]),ne=m(t=>n({...e,priceMax:t,page:1}),[e,n]),ie=m(t=>n({...e,inStockOnly:t,page:1}),[e,n]),se=m(t=>n({...ge,kind:t,inStockOnly:e.inStockOnly,priceMin:e.priceMin,priceMax:e.priceMax,sort:e.sort}),[e.inStockOnly,e.priceMin,e.priceMax,e.sort,n]),We=m(t=>n({...e,sort:t,page:1}),[e,n]),$e=m(t=>{n({...e,page:t}),typeof window<"u"&&window.scrollTo({top:0,behavior:kt()})},[e,n]),le=m(()=>n({...ge,sort:e.sort}),[e.sort,n]),{clear:A}=r,ce=m(()=>{A(),R(!0),b(t=>({...t,page:1}))},[A]),Ye=m(()=>{A(),R(!1),b(t=>({...t,page:1}))},[A]),L=g?[g.make,g.model,g.year,g.modification].join("|"):"",F=mt(null);pt(()=>{if(r.restored){if(F.current===null){F.current=L;return}F.current!==L&&(F.current=L,b(t=>t.page===1?t:{...t,page:1}))}},[r.restored,L,b]);const{items:z,failed:ae,retry:He}=yo({catalog:te,shownKinds:u,vehicle:g,editing:d}),i=s(()=>{if(!r.fit)return z;const t=z.filter(c=>I(c)==="alloy-wheel"),f=new Set(eo(t,r.fit).map(c=>c.slug));return z.filter(c=>I(c)!=="alloy-wheel"||f.has(Wt(c)))},[z,r.fit]),w=(x===null?$:[...$,"collections"]).join(","),qe=s(()=>{const t=new Set(w?w.split(","):[]);return Ft(i,e,a,p,h).filter(f=>!t.has(f.key))},[i,e,a,w,p.join(","),h]),y=s(()=>Lt(i,e,a),[i,e,a]),Je=p.length>1,pe=s(()=>he(h,"alloy-wheel"),[h]),Qe=s(()=>he(h,"tyre"),[h]),V=s(()=>Yt(y),[y]),E=s(()=>Ht(y),[y]),G=Je?ye(["alloy-wheel"]).one:null,Ue=s(()=>({kindLabel:G,brand:V,process:E}),[G,V,E]),Xe=so({kind:!!G,brand:V,process:E},pe),Ze=s(()=>Y?Kt(i,a):null,[i,a,Y]),et=s(()=>Et(i,e,a),[i,e,a]),tt=s(()=>zt(i,u,e,a),[i,u.join(","),e,a]),ot=m((t,f)=>{const c=Rt(i.flatMap($t),e.tyreSizes[0]??"",t,f);n({...e,tyreSizes:c?[c]:[],page:1})},[i,e,n]),rt=s(()=>{const t=new Set(w?w.split(","):[]);return!Vt(i,p)||t.has("tyreSizes")?null:It(i,e,a)},[i,e,a,w,p.join(","),h]),S=s(()=>Mt(y,e.page,W),[y,e.page,W]),P=ye(p),K=Ut(p),me=Qt(O,be,p,u),de=p.length===1&&p[0]==="tyre",ue=r.applied?.stock??null,C=s(()=>Zt(ue),[ue]),nt=s(()=>i.filter(t=>p.includes(I(t))).length,[i,p.join(",")]),j=te.length===0,it=!j&&i.length===0,st=N&&!d&&!r.applied&&!Be;if(u.length===0)return null;const B=o(co,{facets:qe,filters:e,typeOptions:tt,sizeBoxes:rt,sizeMatches:e.tyreSizes.length>0?y.length:null,noun:P,priceBounds:Ze,inStockCount:ke?et:null,onToggle:oe,onPickType:se,onPickSize:ot,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onClearAll:le,owner:{id:q,facetTemplate:Ae,railTemplate:Le,railHeadTemplate:Fe},editing:d}),T=po(Oe,Me);return l("section",{children:[N&&o(ho,{cascade:r.cascade,appliedName:r.appliedName,fit:r.fit,fitSummary:de&&C.length>0?`Takes ${C.join(" · ")}`:null,resolving:r.resolving,unresolved:de?!!r.applied&&!r.resolving&&C.length===0:r.unresolved,matchCount:nt,copy:K,onAmend:Ye,onClear:ce,cellLook:J}),st&&o(go,{cascade:r.cascade,heading:me.heading,intro:me.intro,ready:r.restored,copy:K,onSkip:()=>R(!0),cellLook:J}),l("div",{...Q?Po(M?"":xe,Q):{className:M?void 0:xe},children:[!M&&(k||v)&&l("header",{className:"mb-6",children:[k&&o(vo,{level:Ie,className:"font-display text-[clamp(28px,4vw,40px)] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[1.05] tracking-[-0.02em]",children:wt(k,!1)}),v&&o("p",{className:"mt-2 max-w-[60ch] text-[15px] text-fg-dim",children:bt(v)})]}),l("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[T.rail===""?B:T.rail!==null&&o("div",{className:T.rail,children:B}),l("div",{className:"min-w-0 flex-1",children:[o(uo,{className:"mb-4",start:l(fe,{children:[o(mo,{total:S.total,range:{from:S.from,to:S.to},noun:P}),o(to,{filters:e,onToggle:oe,onPriceMin:re,onPriceMax:ne,onInStockOnly:ie,onPickType:se})]}),end:l(fe,{children:[T.button!==null&&o("div",{className:T.button||void 0,children:o(ao,{filters:e,editing:d,label:Re,floating:Ve,children:B})}),o(fo,{value:e.sort,keys:Bt(u),labels:Dt,onChange:We})]})}),ae&&!j&&l("div",{role:"status",className:"mb-4 flex flex-wrap items-center gap-x-4 gap-y-2 border border-line px-4 py-3",children:[o("p",{className:"text-[14px] text-fg-dim",children:"We couldn't check your car just now — try again."}),o("button",{type:"button",onClick:He,className:"cursor-pointer bg-btn px-4 py-2 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Try again"})]}),j?o("div",{className:"border border-dashed border-line p-10",children:o("p",{className:"font-mono text-[12px] uppercase tracking-[0.16em] text-fg-dim",children:d?P.many==="wheels"?D("No wheels in this website's catalog yet — curate products to see them here."):P.many==="tyres"?D("No tyres in this website's catalog yet — curate products to see them here."):D("No products in this website's catalog yet — curate products to see them here."):"Our catalog is being updated. Please check back shortly."})}):it?ae?null:l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No confirmed fit for your ",r.appliedName]}),o("p",{className:"mt-2 max-w-[52ch] text-[14px] text-fg-dim",children:K.nothingFits}),l("button",{type:"button",onClick:ce,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:["Show all ",P.many]})]}):S.total===0?l("div",{className:"border border-line p-10",children:[l("h3",{className:"font-display text-[22px] font-medium uppercase tracking-[-0.01em]",children:["No ",P.many," match those filters"]}),o("p",{className:"mt-2 max-w-[46ch] text-[14px] text-fg-dim",children:"Try widening the price range or clearing a filter."}),Ot(e)&&o("button",{type:"button",onClick:le,className:"mt-4 cursor-pointer bg-btn px-4 py-3 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-btn-ink hover:bg-fg",children:"Clear all filters"})]}):l(oo,{value:{ownerId:q,ownerType:Se,Template:_e,hover:ze,imageSizes:Ge,fieldUsage:pe,tyreFieldUsage:Qe,reserveEyebrow:Xe,editing:d,eyebrow:Ue,fit:r.fit,colours:e.finishes,rules:io},children:[o("style",{children:Ke}),o("div",{className:`plp-card-grid ${Z} ${_t} ${ht}`,style:{...Ee,...At(`var(${Nt})`)},children:o(ro,{items:S.items,tyreOf:t=>I(t)==="tyre"?t:null,tyreFit:t=>C.length>0?Xt(t.sizes,C):null})})]}),o(lo,{page:S.page,pageCount:S.pageCount,onPage:$e}),o(St,{editing:d})]})]})]})]})}export{ur as PLP_GATE_DEFAULTS,Co as default};
@@ -1,7 +1,10 @@
1
1
  import { type ReactNode } from "react";
2
2
  import { type PlpFilterState } from "../../lib/wheels/plp-filters.js";
3
- export default function PlpFilterButton({ filters, editing, children }: {
3
+ export declare const FILTERS_WORD = "Filters";
4
+ export default function PlpFilterButton({ filters, editing, label, floating, children }: {
4
5
  filters: PlpFilterState;
5
6
  editing?: boolean;
7
+ label?: string;
8
+ floating?: string | null;
6
9
  children: ReactNode;
7
10
  }): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n,Fragment as g}from"react/jsx-runtime";import{useRef as h,useState as _}from"react";import{POPUP_LOOK_DEFAULTS as b}from"efficient-web-builder/format/lib/popup/look";import{PillButton as x}from"../catalog/FilterPill.js";import{CATALOG_TEXT_SIZE as s}from"../../lib/sections/catalog-text-size.js";import P from"../PopupFrame.js";import{PLP_RAIL_WIDTH as T}from"./PlpSidebar.js";import{UTIL_WORDS as L}from"../HeaderTools.js";import{useCurrency as S}from"../CurrencyContext.js";import{formatPrice as A}from"../../lib/commerce.js";import{plpActiveChips as E}from"../../lib/wheels/plp-filters.js";const i="Filters",F=32,O=T+2*F;function R({filters:a,editing:m=!1,children:c}){const[o,t]=_(!1),{currency:f}=S(),l=h(null),r=()=>t(!1),p=E(a,f,A).length,u={...b,placement:"left",height:"full",closeButton:"none",width:O};return n(g,{children:[e(x,{labelSize:s.labelSmall,size:"toolbar",label:i,badge:p,open:o,onToggle:()=>t(d=>!d)}),o&&e(P,{look:u,drawer:{closeRef:l,lockScroll:!m},open:!0,onClose:r,label:i,children:n("div",{"data-plp-filter-panel":"",className:"flex h-full flex-col overflow-y-auto bg-bg px-8 pb-8 text-fg lg:[&_aside]:static lg:[&_aside]:max-h-none",children:[e("div",{className:"relative z-10 -mb-4 flex shrink-0 justify-end",children:e("button",{ref:l,type:"button",onClick:r,className:`inline-flex h-11 items-center font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim hover:text-fg`,children:L.close})}),c]})})]})}export{R as default};
1
+ "use client";import{jsx as n,jsxs as x,Fragment as v}from"react/jsx-runtime";import{useEffect as E,useRef as P,useState as d}from"react";import{createPortal as L}from"react-dom";import{POPUP_LOOK_DEFAULTS as S}from"efficient-web-builder/format/lib/popup/look";import{PillButton as h}from"../catalog/FilterPill.js";import{CATALOG_TEXT_SIZE as f}from"../../lib/sections/catalog-text-size.js";import T from"../PopupFrame.js";import{PLP_RAIL_WIDTH as A}from"./PlpSidebar.js";import{UTIL_WORDS as C}from"../HeaderTools.js";import{useCurrency as k}from"../CurrencyContext.js";import{formatPrice as F}from"../../lib/commerce.js";import{plpActiveChips as R}from"../../lib/wheels/plp-filters.js";const z="Filters";function N(){const e=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--sf-header-h"));return Number.isFinite(e)?e:0}function I(e,r){const[s,o]=d(!1);return E(()=>{if(!r||!e)return;const a=e.closest("section")??e,t=()=>{const i=(e.firstElementChild??e).getBoundingClientRect(),l=a.getBoundingClientRect().bottom;o(i.bottom<N()&&l>window.innerHeight/2)};return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[e,r]),r&&s}const O=32,j=A+2*O;function B({filters:e,editing:r=!1,label:s,floating:o=null,children:a}){const t=s?.trim()||z,[i,l]=d(!1),[p,y]=d(null),c=I(p,o!==null),{currency:w}=k(),u=P(null),b=()=>l(!1),g=R(e,w,F).length,_={...S,placement:"left",height:"full",closeButton:"none",width:j};return x(v,{children:[o===null?n(h,{labelSize:f.labelSmall,size:"toolbar",label:t,badge:g,open:i,onToggle:()=>l(m=>!m)}):n("span",{ref:y,className:"contents",children:n(h,{labelSize:f.labelSmall,size:"toolbar",label:t,badge:g,open:i,onToggle:()=>l(m=>!m)})}),o!==null&&p&&L(n("button",{type:"button","data-plp-filter-float":"","aria-hidden":!c,tabIndex:c?0:-1,onClick:()=>l(!0),className:["fixed bottom-8 left-1/2 z-40 inline-flex h-12 -translate-x-1/2 items-center sf-button bg-btn px-6 font-display text-sm font-medium tracking-[0.04em] text-btn-ink transition-[opacity,transform] motion-reduce:transition-none",c?"translate-y-0 opacity-100":"pointer-events-none translate-y-6 opacity-0",o].filter(Boolean).join(" "),children:t}),document.body),i&&n(T,{look:_,drawer:{closeRef:u,lockScroll:!r},open:!0,onClose:b,label:t,children:x("div",{"data-plp-filter-panel":"",className:"flex h-full flex-col overflow-y-auto bg-bg px-8 pb-8 text-fg lg:[&_aside]:static lg:[&_aside]:max-h-none",children:[n("div",{className:"relative z-10 -mb-4 flex shrink-0 justify-end",children:n("button",{ref:u,type:"button",onClick:b,className:`inline-flex h-11 items-center font-mono ${f.labelSmall} uppercase tracking-[0.2em] text-fg-dim hover:text-fg`,children:C.close})}),a]})})]})}export{z as FILTERS_WORD,B as default};
@@ -1 +1 @@
1
- import{jsx as l}from"react/jsx-runtime";import{FITMENT_CELL_LOOK_PROP as L}from"../../../../sections/fitment-cell-look.js";import{LISTING_FILTER_LOOK_PROP as o,parseListingFilterLook as f,parseListingFilterLookPhone as T}from"../../../../sections/shopper-filters.js";import{phoneKey as g}from"efficient-easel/draw";import{PAGE_TITLE_LEVEL_PROP as h}from"efficient-web-builder/format/lib/document/one-h1";import E from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as r}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as _,listingHiddenFacets as P}from"../../../../wheels/plp-filters.js";import{addressQueryOf as c}from"../../../../wheels/selected-ranges.js";import{cardHoverOf as I}from"efficient-web-builder/format/lib/animation/hover";import{phHide as a}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as s}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as O}from"../../../../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_SLOT as u,RAIL_TEMPLATE_SLOT as A}from"../../../../content/rail-row-seed.js";import{AlloyWheelsListingMeta as S,ALLOYWHEELSLISTING_PH as n}from"./meta.js";import{ALLOY_WHEELS_LISTING_TYPE as d}from"../../../document-nodes.js";import{padsItself as k}from"../../../pads-itself.js";const U=k(d,{...S,render:e=>{const t=s(e),i=m=>t?void 0:m;return l(E,{titleLevel:e[h],heading:i(a(e.heading,n.heading,e.editor)),intro:i(a(e.intro,n.intro,e.editor)),omitHead:t,askForCar:e.askForCar!==!1,addressQuery:c(e)||void 0,gateHeading:r(e.gateHeading),gateIntro:r(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:_(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[O],railTemplate:e[A],railHeadTemplate:e[u],hover:I(e,d),cellLook:e[L],filterLook:f(e[o]),filterLookPhone:T(e[g(o)]),hiddenFacets:P(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,source:e.source,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}});export{U as AlloyWheelsListingRender};
1
+ import{jsx as m}from"react/jsx-runtime";import{FITMENT_CELL_LOOK_PROP as f}from"../../../../sections/fitment-cell-look.js";import{LISTING_FILTER_FLOAT_PROP as T,LISTING_FILTER_LABEL_PROP as _,LISTING_FILTER_LOOK_PROP as t,parseListingFilterLook as E,parseListingFilterLookPhone as I,plpFilterFloatViews as P}from"../../../../sections/shopper-filters.js";import{phoneKey as i}from"efficient-easel/draw";import{PAGE_TITLE_LEVEL_PROP as g}from"efficient-web-builder/format/lib/document/one-h1";import h from"../../../../../components/wheels-plp/AlloyWheelsListing.js";import{hidableText as o}from"efficient-easel/screen/lib/document/hidable";import{asPlpSortKey as c,listingHiddenFacets as O}from"../../../../wheels/plp-filters.js";import{addressQueryOf as s}from"../../../../wheels/selected-ranges.js";import{cardHoverOf as A}from"efficient-web-builder/format/lib/animation/hover";import{phHide as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{headInOwnBox as F}from"efficient-web-builder/render/lib/sections/section-to-box";import{FACET_TEMPLATE_SLOT as S}from"../../../../content/facet-row-seed.js";import{RAIL_HEAD_TEMPLATE_SLOT as u,RAIL_TEMPLATE_SLOT as k}from"../../../../content/rail-row-seed.js";import{AlloyWheelsListingMeta as H,ALLOYWHEELSLISTING_PH as d}from"./meta.js";import{ALLOY_WHEELS_LISTING_TYPE as l}from"../../../document-nodes.js";import{padsItself as R}from"../../../pads-itself.js";const D=R(l,{...H,render:e=>{const r=F(e),a=L=>r?void 0:L;return m(h,{titleLevel:e[g],heading:a(n(e.heading,d.heading,e.editor)),intro:a(n(e.intro,d.intro,e.editor)),omitHead:r,askForCar:e.askForCar!==!1,addressQuery:s(e)||void 0,gateHeading:o(e.gateHeading),gateIntro:o(e.gateIntro),perPage:e.perPage,columns:e.columns,defaultSort:c(e.defaultSort),ownerId:typeof e.id=="string"?e.id:"",template:e.template,facetTemplate:e[S],railTemplate:e[k],railHeadTemplate:e[u],hover:A(e,l),cellLook:e[f],filterLook:E(e[t]),filterLookPhone:I(e[i(t)]),filterLabel:o(e[_])||void 0,filterFloat:P(e[i(t)],e[i(T)]),hiddenFacets:O(e),showPrice:e.showPrice,showInStock:e.showInStock!==!1,kinds:e.kinds,source:e.source,products:e.products,wheels:e.wheels,fieldUsage:e.fieldUsage,editing:e.editor?.isEditing})}});export{D as AlloyWheelsListingRender};
@@ -16,6 +16,13 @@
16
16
  "placeholder": "Filter by brand, colour, size and fitment to find your set."
17
17
  }
18
18
  },
19
+ "filterLabel": {
20
+ "type": "custom",
21
+ "__text": {
22
+ "control": "plainText",
23
+ "label": "Button"
24
+ }
25
+ },
19
26
  "gateHeading": {
20
27
  "type": "custom",
21
28
  "__text": {
@@ -5,6 +5,7 @@ export declare const HERO_GALLERY_MODES: readonly ["main", "thumbs", "tiled", "s
5
5
  export declare const DEFAULT_HERO_GALLERY_MODE: HeroGalleryMode;
6
6
  export declare function parseHeroGalleryMode(v: unknown): HeroGalleryMode;
7
7
  export type HeroImageFit = ImageFit;
8
+ export declare const STAGE_PHOTO_BOX = "h-[88%] w-[88%]";
8
9
  export declare const HERO_IMAGE_FITS: readonly HeroImageFit[];
9
10
  export declare const DEFAULT_HERO_IMAGE_FIT: HeroImageFit;
10
11
  export declare function parseHeroImageFit(v: unknown): HeroImageFit;
@@ -1 +1 @@
1
- import{parseOption as t}from"efficient-shell/format";import{PICTURE_GROUNDS as r}from"./picture-grounds.js";import{IMAGE_FIT_LABEL as n,parseImageFit as p}from"efficient-web-builder/format/lib/content/image-fit";const a=["main","thumbs","tiled","stacked"],s="thumbs";function f(e){return t(a,s,e)}const _=["contain","cover"],E="contain";function F(e){return p(e,E)}function U(){return _.map(e=>({label:n[e],value:e}))}function I(e,o){return o?"contain":e}const l=r.filter(e=>e.value!=="soft"),c="flat";function M(e){return t(l.map(o=>o.value),c,e)}const i=[{label:"Every picture",value:"all"},{label:"First picture + close-ups",value:"closeUps"}],u="all";function T(e){return t(i.map(o=>o.value),u,e)}const L=!1,D=e=>typeof e=="boolean"?e:L,O=!0;function S(e){return typeof e=="boolean"?e:O}const R=0,H=24,A=8;function b(e){const o=typeof e=="number"?e:Number.NaN;return Number.isFinite(o)?Math.min(H,Math.max(R,Math.round(o))):A}export{L as DEFAULT_HERO_CLOSE_UPS_FILL,A as DEFAULT_HERO_GALLERY_GAP,O as DEFAULT_HERO_GALLERY_MARKS,s as DEFAULT_HERO_GALLERY_MODE,u as DEFAULT_HERO_GALLERY_SHOW,E as DEFAULT_HERO_IMAGE_FIT,c as DEFAULT_HERO_PHOTO_GROUND,H as HERO_GALLERY_GAP_MAX,R as HERO_GALLERY_GAP_MIN,a as HERO_GALLERY_MODES,i as HERO_GALLERY_SHOWS,_ as HERO_IMAGE_FITS,l as HERO_PHOTO_GROUNDS,U as heroImageFitOptions,D as parseHeroCloseUpsFill,b as parseHeroGalleryGap,S as parseHeroGalleryMarks,f as parseHeroGalleryMode,T as parseHeroGalleryShow,F as parseHeroImageFit,M as parseHeroPhotoGround,I as resolveHeroImageFit};
1
+ import{parseOption as t}from"efficient-shell/format";import{PICTURE_GROUNDS as r}from"./picture-grounds.js";import{IMAGE_FIT_LABEL as n,parseImageFit as p}from"efficient-web-builder/format/lib/content/image-fit";const a=["main","thumbs","tiled","stacked"],s="thumbs";function f(e){return t(a,s,e)}const F="h-[88%] w-[88%]",_=["contain","cover"],E="contain";function T(e){return p(e,E)}function U(){return _.map(e=>({label:n[e],value:e}))}function I(e,o){return o?"contain":e}const l=r.filter(e=>e.value!=="soft"),c="flat";function M(e){return t(l.map(o=>o.value),c,e)}const i=[{label:"Every picture",value:"all"},{label:"First picture + close-ups",value:"closeUps"}],u="all";function D(e){return t(i.map(o=>o.value),u,e)}const O=!1,S=e=>typeof e=="boolean"?e:O,L=!0;function b(e){return typeof e=="boolean"?e:L}const H=0,R=24,A=8;function h(e){const o=typeof e=="number"?e:Number.NaN;return Number.isFinite(o)?Math.min(R,Math.max(H,Math.round(o))):A}export{O as DEFAULT_HERO_CLOSE_UPS_FILL,A as DEFAULT_HERO_GALLERY_GAP,L as DEFAULT_HERO_GALLERY_MARKS,s as DEFAULT_HERO_GALLERY_MODE,u as DEFAULT_HERO_GALLERY_SHOW,E as DEFAULT_HERO_IMAGE_FIT,c as DEFAULT_HERO_PHOTO_GROUND,R as HERO_GALLERY_GAP_MAX,H as HERO_GALLERY_GAP_MIN,a as HERO_GALLERY_MODES,i as HERO_GALLERY_SHOWS,_ as HERO_IMAGE_FITS,l as HERO_PHOTO_GROUNDS,F as STAGE_PHOTO_BOX,U as heroImageFitOptions,S as parseHeroCloseUpsFill,h as parseHeroGalleryGap,b as parseHeroGalleryMarks,f as parseHeroGalleryMode,D as parseHeroGalleryShow,T as parseHeroImageFit,M as parseHeroPhotoGround,I as resolveHeroImageFit};
@@ -80,5 +80,8 @@ export declare function plpFilterViews(look: unknown, lookPhone: unknown): {
80
80
  rail: string | null;
81
81
  button: string | null;
82
82
  };
83
+ export declare const LISTING_FILTER_LABEL_PROP = "filterLabel";
84
+ export declare const LISTING_FILTER_FLOAT_PROP = "filterFloat";
85
+ export declare function plpFilterFloatViews(lookPhone: unknown, floatPhone: unknown): string | null;
83
86
  export declare function parseShownFilters(value: unknown): ShownFilter[];
84
87
  export declare function parseOpeningSort(value: unknown): PlpSortKey;
@@ -1 +1 @@
1
- import{DEFAULT_CATALOG_FILTER_LABELS as a}from"../content/catalog-filter-labels.js";import{STOCK_WORDS as I}from"../content/stock-words.js";import{parseOption as l}from"efficient-shell/format";import{viewHideClass as b}from"efficient-web-builder/format/lib/content/view-hide-class";import{asPlpSortKey as S}from"../wheels/plp-filters.js";const p=[{value:"bar-pills",label:"Bar · pills"},{value:"bar-columns",label:"Bar · columns"},{value:"rail",label:"Side rail"},{value:"button",label:"Filters button"}],E="bar-pills",u=[{value:"bar",label:"Bar"},{value:"button",label:"Filters button"},{value:"rail",label:"Side rail"}],F="bar",d=[{value:"inStock",label:I.inStock},{value:"category",label:"Category"},{value:"lugs",label:a.lugs},{value:"price",label:a.price}],x=["inStock","category","lugs","price"],v="recommended";function y(t){return l(p.map(o=>o.value),E,typeof t=="string"?t:void 0)}function K(t){return l(u.map(o=>o.value),F,typeof t=="string"?t:void 0)}const i=["rail","button"],w="filterLook",g="rail",L=t=>i.includes(t.value),D=p.filter(L),G=u.filter(L);function c(t){return l(i,g,typeof t=="string"?t:void 0)}const k=c,m="lg:flex-none lg:self-stretch";function H(t,o){const r=c(t),O=k(o),_=e=>e.desk&&e.phone?"":e.desk||e.phone?b({desktop:!e.desk,tablet:!e.desk,mobile:!e.phone}):null,s=e=>_({desk:r===e,phone:O===e}),f=e=>e&&`${e} ${m}`,n={rail:null,button:null};for(const e of i)switch(e){case"rail":n.rail=f(s(e));break;case"button":n.button=s(e);break;default:{const T=e;throw new Error(`no drawing for listing look ${String(T)}`)}}return n}function U(t){if(!Array.isArray(t))return[...x];const o=new Set(d.map(r=>r.value));return t.filter(r=>typeof r=="string"&&o.has(r))}function C(t){return S(typeof t=="string"?t:void 0)}export{E as DEFAULT_FILTER_LOOK,F as DEFAULT_FILTER_LOOK_PHONE,g as DEFAULT_LISTING_FILTER_LOOK,v as DEFAULT_OPENING_SORT,x as DEFAULT_SHOWN_FILTERS,p as FILTER_LOOK_OPTIONS,u as FILTER_LOOK_PHONE_OPTIONS,i as LISTING_FILTER_LOOKS,D as LISTING_FILTER_LOOK_OPTIONS,G as LISTING_FILTER_LOOK_PHONE_OPTIONS,w as LISTING_FILTER_LOOK_PROP,d as SHOWN_FILTER_OPTIONS,L as isListingFilterLook,y as parseFilterLook,K as parseFilterLookPhone,c as parseListingFilterLook,k as parseListingFilterLookPhone,C as parseOpeningSort,U as parseShownFilters,H as plpFilterViews};
1
+ import{DEFAULT_CATALOG_FILTER_LABELS as a}from"../content/catalog-filter-labels.js";import{STOCK_WORDS as b}from"../content/stock-words.js";import{parseOption as l}from"efficient-shell/format";import{viewHideClass as p}from"efficient-web-builder/format/lib/content/view-hide-class";import{asPlpSortKey as E}from"../wheels/plp-filters.js";const u=[{value:"bar-pills",label:"Bar · pills"},{value:"bar-columns",label:"Bar · columns"},{value:"rail",label:"Side rail"},{value:"button",label:"Filters button"}],S="bar-pills",L=[{value:"bar",label:"Bar"},{value:"button",label:"Filters button"},{value:"rail",label:"Side rail"}],d="bar",x=[{value:"inStock",label:b.inStock},{value:"category",label:"Category"},{value:"lugs",label:a.lugs},{value:"price",label:a.price}],k=["inStock","category","lugs","price"],v="recommended";function w(e){return l(u.map(o=>o.value),S,typeof e=="string"?e:void 0)}function y(e){return l(L.map(o=>o.value),d,typeof e=="string"?e:void 0)}const i=["rail","button"],K="filterLook",g="rail",c=e=>i.includes(e.value),G=u.filter(c),D=L.filter(c);function O(e){return l(i,g,typeof e=="string"?e:void 0)}const _=O,N="lg:flex-none lg:self-stretch";function H(e,o){const r=O(e),f=_(o),I=t=>t.desk&&t.phone?"":t.desk||t.phone?p({desktop:!t.desk,tablet:!t.desk,mobile:!t.phone}):null,s=t=>I({desk:r===t,phone:f===t}),T=t=>t&&`${t} ${N}`,n={rail:null,button:null};for(const t of i)switch(t){case"rail":n.rail=T(s(t));break;case"button":n.button=s(t);break;default:{const F=t;throw new Error(`no drawing for listing look ${String(F)}`)}}return n}const U="filterLabel",B="filterFloat";function C(e,o){return o!==!0||_(e)!=="button"?null:p({desktop:!0,tablet:!0,mobile:!1})}function W(e){if(!Array.isArray(e))return[...k];const o=new Set(x.map(r=>r.value));return e.filter(r=>typeof r=="string"&&o.has(r))}function V(e){return E(typeof e=="string"?e:void 0)}export{S as DEFAULT_FILTER_LOOK,d as DEFAULT_FILTER_LOOK_PHONE,g as DEFAULT_LISTING_FILTER_LOOK,v as DEFAULT_OPENING_SORT,k as DEFAULT_SHOWN_FILTERS,u as FILTER_LOOK_OPTIONS,L as FILTER_LOOK_PHONE_OPTIONS,B as LISTING_FILTER_FLOAT_PROP,U as LISTING_FILTER_LABEL_PROP,i as LISTING_FILTER_LOOKS,G as LISTING_FILTER_LOOK_OPTIONS,D as LISTING_FILTER_LOOK_PHONE_OPTIONS,K as LISTING_FILTER_LOOK_PROP,x as SHOWN_FILTER_OPTIONS,c as isListingFilterLook,w as parseFilterLook,y as parseFilterLookPhone,O as parseListingFilterLook,_ as parseListingFilterLookPhone,V as parseOpeningSort,W as parseShownFilters,C as plpFilterFloatViews,H as plpFilterViews};
@@ -15,6 +15,7 @@ export interface SpinSet {
15
15
  };
16
16
  arc?: number;
17
17
  start?: number;
18
+ autoArc?: number;
18
19
  }
19
20
  export type SpinSets = Record<string, Record<string, SpinSet>>;
20
21
  export declare const DEFAULT_SPIN_AUTO_TURN = false;
@@ -23,7 +24,8 @@ export declare function parseSpinSwitch(v: unknown): boolean;
23
24
  export declare const SPIN_HINT_SHOW_MS = 1000;
24
25
  export declare const SPIN_HINT_HIDE_MS = 6000;
25
26
  export declare const SPIN_TURN_MS = 14000;
26
- export declare const SPIN_RESUME_MS = 2500;
27
+ export declare const SPIN_RESUME_MS = 5000;
28
+ export declare const DEFAULT_SPIN_AUTO_ARC = 160;
27
29
  export declare function spinAutoTurnStep(set: SpinSet, position: number, way: 1 | -1, ms: number): {
28
30
  position: number;
29
31
  way: 1 | -1;
@@ -1 +1 @@
1
- import{resolveMedia as S}from"efficient-web-builder/render/lib/media";const a=4096,c=360,h=.9,A=!1,g=!1;function P(t){return t===!0}const d=1e3,E=6e3,m=14e3,M=1e-6,j=2500;function F(t,n,r,e){const o=p(t)?c:t.arc,s=n+r*e*t.count*c/(m*o);if(p(t))return{position:(s%t.count+t.count)%t.count,way:r};const i=t.count-M;return s>=i?{position:i,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const _=t=>Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string"&&n.length>0),l=t=>S(t)??t,f=t=>Number.isInteger(t)&&t>0;function x(t,n){if(!t||typeof t!="object")return null;const{frame:r,cols:e,rows:o,urls:s}=t;return!f(r)||!f(e)||!f(o)||!_(s)||r*e>a||r*o>a||s.length!==Math.ceil(n/(e*o))?null:{frame:r,cols:e,rows:o,urls:s.map(l)}}function y(t){const{frames:n,count:r,startFrame:e,sheets:o}=t,s=_(n)?{count:n.length,frames:n.map(l)}:null;if(o&&typeof o=="object"&&f(r)&&typeof e=="string"&&e){const i=x(o.desktop,r),u=x(o.phone,r);if(i&&u)return{count:r,startFrame:l(e),sheets:{desktop:i,phone:u}}}return s}function N(t){if(!t||typeof t!="object")return null;const{arc:n,start:r}=t,e=y(t);if(!e)return null;if(n!==void 0){if(typeof n!="number"||!(n>0&&n<=c))return null;e.arc=n}return Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function U(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,e]of Object.entries(t)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[s,i]of Object.entries(e)){const u=N(i);u&&(o[s]=u)}Object.keys(o).length>0&&(n[r]=o)}return n}function R(t,n,r){return r?t[n]?.[r]??null:null}function L(t,n){const r=Object.keys(t?.[n]??{});return r.length>0?{finish:r}:null}function p(t){return t.arc===void 0||t.arc>=c}function I(t){return p(t)?0:Math.floor(t.count/2)}function k(t){return t.start??I(t)}function T(t,n,r=!0){return r?(Math.floor(t)%n+n)%n:Math.max(0,Math.min(n-1,Math.floor(t)))}function D(t,n,r,e){const o=T(t,n,r),s=t-Math.floor(t),i=r?(o+1)%n:o+1<n?o+1:null;return e||s===0||i===null?{a:o,b:null,mix:0}:{a:o,b:i,mix:s}}function H(t,n,r){return r?t:Math.max(0,Math.min(n-1,t))}function O(t,n,r,e){return r<=0?t:t-n/r*e*h}function C(t,n){const r=t.cols*t.rows,e=n%r;return{url:t.urls[Math.floor(n/r)],col:e%t.cols,row:Math.floor(e/t.cols)}}export{A as DEFAULT_SPIN_AUTO_TURN,g as DEFAULT_SPIN_HINT,E as SPIN_HINT_HIDE_MS,d as SPIN_HINT_SHOW_MS,j as SPIN_RESUME_MS,a as SPIN_SHEET_MAX_SIDE,m as SPIN_TURN_MS,p as isFullTurn,U as parseSpinSets,P as parseSpinSwitch,F as spinAutoTurnStep,D as spinBlend,C as spinCell,H as spinClampPosition,T as spinFrameIndex,O as spinPositionAfterDrag,L as spinPreference,R as spinSetFor,k as spinStartPosition};
1
+ import{resolveMedia as m}from"efficient-web-builder/render/lib/media";const x=4096,c=360,M=.9,E=!1,U=!1;function F(t){return t===!0}const j=1e3,R=6e3,S=14e3,y=1e-6,L=5e3,N=160;function D(t,n,r,e){const o=t.autoArc??N;if(a(t)&&o<c)return g(t.count,o,n,r,e*t.count/S);const i=a(t)?c:t.arc,s=n+r*e*t.count*c/(S*i);if(a(t))return{position:(s%t.count+t.count)%t.count,way:r};const u=t.count-y;return s>=u?{position:u,way:-1}:s<=0?{position:0,way:1}:{position:s,way:r}}const h=t=>Array.isArray(t)&&t.length>0&&t.every(n=>typeof n=="string"&&n.length>0),_=t=>m(t)??t,p=t=>Number.isInteger(t)&&t>0;function A(t,n){if(!t||typeof t!="object")return null;const{frame:r,cols:e,rows:o,urls:i}=t;return!p(r)||!p(e)||!p(o)||!h(i)||r*e>x||r*o>x||i.length!==Math.ceil(n/(e*o))?null:{frame:r,cols:e,rows:o,urls:i.map(_)}}function T(t){const{frames:n,count:r,startFrame:e,sheets:o}=t,i=h(n)?{count:n.length,frames:n.map(_)}:null;if(o&&typeof o=="object"&&p(r)&&typeof e=="string"&&e){const s=A(o.desktop,r),u=A(o.phone,r);if(s&&u)return{count:r,startFrame:_(e),sheets:{desktop:s,phone:u}}}return i}function I(t){if(!t||typeof t!="object")return null;const{arc:n,start:r}=t,e=T(t);if(!e)return null;if(n!==void 0){if(typeof n!="number"||!(n>0&&n<=c))return null;e.arc=n}const{autoArc:o}=t;return typeof o=="number"&&o>0&&o<=c&&(e.autoArc=o),Number.isInteger(r)&&r>=0&&r<e.count&&(e.start=r),e}function O(t){if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,e]of Object.entries(t)){if(!e||typeof e!="object"||Array.isArray(e))continue;const o={};for(const[i,s]of Object.entries(e)){const u=I(s);u&&(o[i]=u)}Object.keys(o).length>0&&(n[r]=o)}return n}function k(t,n,r){return r?t[n]?.[r]??null:null}function w(t,n){const r=Object.keys(t?.[n]??{});return r.length>0?{finish:r}:null}function a(t){return t.arc===void 0||t.arc>=c}function g(t,n,r,e,o){const i=t*n/(2*c),s=(r%t+t)%t,u=s>t/2?s-t:s;let f=u>i?-1:u<-i?1:e,l=u+f*o;return f===1&&u<=i&&l>=i?[l,f]=[i,-1]:f===-1&&u>=-i&&l<=-i&&([l,f]=[-i,1]),{position:(l%t+t)%t,way:f}}function b(t){return a(t)?0:Math.floor(t.count/2)}function H(t){return t.start??b(t)}function d(t,n,r=!0){return r?(Math.floor(t)%n+n)%n:Math.max(0,Math.min(n-1,Math.floor(t)))}function C(t,n,r,e){const o=d(t,n,r),i=t-Math.floor(t),s=r?(o+1)%n:o+1<n?o+1:null;return e||i===0||s===null?{a:o,b:null,mix:0}:{a:o,b:s,mix:i}}function W(t,n,r){return r?t:Math.max(0,Math.min(n-1,t))}function B(t,n,r,e){return r<=0?t:t-n/r*e*M}function G(t,n){const r=t.cols*t.rows,e=n%r;return{url:t.urls[Math.floor(n/r)],col:e%t.cols,row:Math.floor(e/t.cols)}}export{N as DEFAULT_SPIN_AUTO_ARC,E as DEFAULT_SPIN_AUTO_TURN,U as DEFAULT_SPIN_HINT,R as SPIN_HINT_HIDE_MS,j as SPIN_HINT_SHOW_MS,L as SPIN_RESUME_MS,x as SPIN_SHEET_MAX_SIDE,S as SPIN_TURN_MS,a as isFullTurn,O as parseSpinSets,F as parseSpinSwitch,D as spinAutoTurnStep,C as spinBlend,G as spinCell,W as spinClampPosition,d as spinFrameIndex,B as spinPositionAfterDrag,w as spinPreference,k as spinSetFor,H as spinStartPosition};