efficient-storefront-blocks 0.133.4 → 0.133.5

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.
@@ -8,6 +8,7 @@ export interface GalleryGridProps {
8
8
  template?: SlotComponent;
9
9
  nodeId?: string;
10
10
  sourced?: readonly ProductPictureTile[];
11
+ galleryLink?: boolean;
11
12
  num?: string;
12
13
  title?: string;
13
14
  linkText?: string;
@@ -26,4 +27,4 @@ export interface GalleryGridProps {
26
27
  gapPhone?: unknown;
27
28
  sets?: boolean;
28
29
  }
29
- export default function GalleryGrid({ items: Items, template, nodeId, sourced, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, sets, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
30
+ export default function GalleryGrid({ items: Items, template, nodeId, sourced, galleryLink, num, title, linkText, linkHref, galleryHref, submitHref, previewHover, display, displayPhone, styleOwner, layout, layoutPhone, columns, columnsMobile, gap: gapProp, gapPhone, sets, omitHead, pads, editing, }: GalleryGridProps): import("react").JSX.Element;
@@ -1,3 +1,3 @@
1
- "use client";import{jsx as r,jsxs as ce}from"react/jsx-runtime";import{useCallback as j,useMemo as f,useState as B}from"react";import{usePathname as me}from"next/navigation";import{containerGapProps as pe}from"efficient-web-builder/format/lib/content/container-gap";import fe from"efficient-web-builder/render/components/Btn";import ge,{GALLERY_GRID_ATTR as ue,GalleryLinksContext as ye,GalleryTilesContext as he}from"./GalleryItem.js";import{useShopperGallery as we}from"./catalog/ShopperScope.js";import{galleryShownIds as Le,galleryToolbarIdle as Se,WALL_PLACED_CELL as Ce,WALL_PLACED_CSS as xe,wallSpanAt as ve}from"../lib/sections/gallery-toolbar.js";import{GALLERY_MOSAIC_LAYOUT as Ge,galleryMosaicRowsCss as Ne}from"../lib/sections/gallery-mosaic.js";import{useSiteSells as _e}from"./SiteRecordContext.js";import{SharedPartKinds as Ae}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as Pe}from"efficient-web-builder/render/components/goldPhrases";import ke from"efficient-web-builder/render/components/SectionHeader";import{FRAME_120 as Oe,framedBandPad as be,headIsEmpty as Ie,withBandClasses as Te}from"../lib/sections/band-padding.js";import{galleryFrame as Ee,galleryTemplate as Re}from"../lib/sections/gallery-frame.js";import{SITE_COLUMN as Me,withSideOnce as je}from"efficient-web-builder/format/lib/content/page-width";import{resolveGridColumns as Be,resolveGridMobileColumns as $e}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as $,galleryLayoutCss as De,resolveGalleryLayout as Ye}from"efficient-web-builder/format/lib/content/gallery-layout";import{HideTaker as ze}from"efficient-web-builder/render/components/ViewHideRoot";import{useSideSpaceOnce as Fe}from"efficient-web-builder/render/components/SideSpaceOnce";function Ue({items:c,template:D,nodeId:Y,sourced:a,num:x,title:w,linkText:v,linkHref:z,galleryHref:g="/gallery",submitHref:F="/contact",previewHover:U,display:W,displayPhone:K,styleOwner:V,layout:G,layoutPhone:q,columns:u,columnsMobile:H,gap:J,gapPhone:Q,sets:N=!1,omitHead:L=!1,pads:X,editing:_=!1}){const Z=Fe(),ee=me(),le=_e(),se=g!==ee&&(le||g!=="/gallery"),y={layout:G,layoutPhone:q},m=Ye(y),re=!m&&u!=null&&u!=="",i=pe("GalleryB",J,"both",Q),A=m?{className:`sf-card-grid sf-gallery-zone ${$(y)} grid${i.className}`,style:i.style}:re?{className:`sf-card-grid sf-grid-zone grid${i.className}`,style:{...i.style,"--sf-grid-cols":String(Be(u)),"--sf-grid-cols-phone":String($e(H,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:z||"#"}:void 0,ne=w?Pe(w,!1):void 0,[k,te]=B({}),O=j((e,s)=>{te(l=>{const o=l[e.id];if(s){if(!o)return l;const{[e.id]:We,...de}=l;return de}return o&&o.tag===e.tag&&o.name===e.name?l:{...l,[e.id]:e}})},[]),h=a?.map(e=>e.tile.id).join(`
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
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:oe,toolbar:p}=we(d),I=p!==null&&!Se(p,d),n=f(()=>I&&p?Le(d,p):null,[I,p,d]),t=f(()=>n??d.map(e=>e.id),[n,d]),[T,ae]=B(null),E=j((e,s)=>{const l=t.indexOf(e);l<0||t.length<2||ae({id:t[(l+s+t.length)%t.length],at:s>0?"first":"last"})},[t]),ie=f(()=>{const e=new Map((n??[]).map((s,l)=>[s,l]));return{report:O,positionOf:s=>{const l=n?e.get(s):void 0;return l===void 0?null:{index:l+1,total:n.length}},walkCount:t.length,walk:E,opening:T}},[O,n,t.length,E,T]),S=n?e=>{const s=n.indexOf(e);if(s<0)return{style:{display:"none"}};if(!m)return{style:{order:s}};const l=ve(m,s,n.length);return{className:Ce,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?De(y)+(G===Ge?Ne($(y)):""):"",C=be(X,Oe,{noTop:L,nonNegative:!0}),M=Re(D,!a);return r(ze,{as:"section",ref:oe,...C.attrs,className:Te(Ee(L,!!M),C),style:C.style,children:ce("div",{className:je(Me,Z),children:[L||!_&&Ie(x,w,P?.text)?null:r(ke,{num:x,title:ne,link:P}),R?r("style",{dangerouslySetInnerHTML:{__html:R+(n?xe:"")}}):null,(c||a)&&r(ye.Provider,{value:{galleryHref:g,submitHref:F,previewHover:U,display:W,displayPhone:K,styleOwner:V,wordsAtRest:!!a,ownerId:Y,Template:M,...N?{sets:N}:{}},children:r(he.Provider,{value:ie,children:r(Ae,{children:r("div",{[ue]:"",style:{display:"contents"},children:a?r("div",{...A,children:a.map(({tile:e,...s})=>{const l=r(ge,{...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})})})}),se&&r("div",{className:"mt-12 flex flex-col items-center gap-3",children:r(fe,{href:g,variant:"ghost",children:"See Gallery"})})]})})}export{Ue as default};
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 +1 @@
1
- import{Fragment as g,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import k,{SourcedGalleryGrid as P}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import y from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as w,productPictureTiles as T,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{hidableText as a}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as G}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as u}from"../../../../sections/band-padding.js";import{GalleryBMeta as B,GALLERY_B_PH as l}from"./meta.js";const U={...B,render:e=>{const m=G(e.headPlacement)==="own-box",t=n=>m?void 0:n,o={num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),omitHead:m,linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),galleryHref:a(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],sets:e.sets===!0,pads:u(e),editing:e.editor?.isEditing,template:e.template,nodeId:typeof e.id=="string"?e.id:void 0},c=h(e);if(c===w){const n=!!e.editor?.isEditing,r=T(e,n,e.limit);return!n&&r.length===0?d(g,{}):d(y,{...o,layout:v(e),sourced:r})}if(c!==""){const n=!!e.editor?.isEditing,{rows:r,sample:f}=x(e,n);return d(P,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,rows:f?[]:r,limit:e.limit,layout:e.layout,editing:n,pads:u(e)})}return e.dynamic?d(k,{num:t(i(e.num,l.num,e.editor)),title:t(i(e.title,l.title,e.editor)),linkText:t(i(e.linkText,l.link,e.editor)),linkHref:t(a(e.linkHref)||"/contact"),omitHead:m,galleryHref:a(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:u(e),template:o.template,nodeId:o.nodeId}):d(y,{...o,items:e.items})}};export{U as GalleryBRender};
1
+ import{Fragment as f,jsx as d}from"react/jsx-runtime";import{phoneKey as H}from"efficient-easel/draw";import P,{SourcedGalleryGrid as k}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as h,sourcedRows as x}from"efficient-web-builder/format/lib/content/block-sources";import u from"../../../../../components/GalleryGrid.js";import{PRODUCT_PICTURES_SOURCE as T,productPictureTiles as w,productPicturesLayout as v}from"../../../../sections/product-pictures.js";import{PRODUCT_SETS_PROP as E,stampedProductSets as G}from"../../../../sections/gallery-product-sets.js";import{hidableText as m}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as R}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{bandPadProps as c}from"../../../../sections/band-padding.js";import{GalleryBMeta as S,GALLERY_B_PH as l}from"./meta.js";const F={...S,render:e=>{const o=R(e.headPlacement)==="own-box",t=i=>o?void 0:i,a={num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),omitHead:o,linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),galleryHref:m(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,layoutPhone:e.layoutPhone,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,gapPhone:e[H("gap")],sets:e.sets===!0,pads:c(e),editing:e.editor?.isEditing,template:e.template,nodeId:typeof e.id=="string"?e.id:void 0};if(e[E]===!0&&!e.editor?.isEditing){const i=G(e);return!i||i.length===0?d(f,{}):d(u,{...a,num:void 0,title:void 0,linkText:void 0,omitHead:!0,galleryLink:!1,sourced:i})}const y=h(e);if(y===T){const i=!!e.editor?.isEditing,r=w(e,i,e.limit);return!i&&r.length===0?d(f,{}):d(u,{...a,layout:v(e),sourced:r})}if(y!==""){const i=!!e.editor?.isEditing,{rows:r,sample:g}=x(e,i);return d(k,{num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),omitHead:o,rows:g?[]:r,limit:e.limit,layout:e.layout,editing:i,pads:c(e)})}return e.dynamic?d(P,{num:t(n(e.num,l.num,e.editor)),title:t(n(e.title,l.title,e.editor)),linkText:t(n(e.linkText,l.link,e.editor)),linkHref:t(m(e.linkHref)||"/contact"),omitHead:o,galleryHref:m(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.editor?.isEditing,pads:c(e),template:a.template,nodeId:a.nodeId}):d(u,{...a,items:e.items})}};export{F as GalleryBRender};
@@ -0,0 +1,11 @@
1
+ import type { Data } from "efficient-easel/blocks";
2
+ import type { ProductPictureTile } from "./product-pictures.js";
3
+ export declare const PRODUCT_SETS_PROP = "productSets";
4
+ export declare const PRODUCT_SETS_STAMP_PROP = "productSetTiles";
5
+ export declare const GALLERY_PAGE_SLUG = "gallery";
6
+ export declare function setTagMatches(tag: string, productName: string): boolean;
7
+ export declare function gallerySetTiles(page: Data | null | undefined): ProductPictureTile[];
8
+ export declare function pageWantsProductSets(data: Data | null | undefined): boolean;
9
+ export declare function stampProductSets(data: Data, galleryPage: Data | null | undefined, productName: string): Data;
10
+ export declare function stripProductSets(data: Data): Data;
11
+ export declare function stampedProductSets(props: Record<string, unknown>): ProductPictureTile[] | null;
@@ -0,0 +1 @@
1
+ import{documentNodes as a,mapDocumentNodes as m}from"../document/document-nodes.js";const S="productSets",p="productSetTiles",h="gallery",l="GalleryB",x="GalleryItem";function i(t){if(typeof t=="string")return t.trim();const r=t?.text;return typeof r=="string"?r.trim():""}function y(t){if(typeof t=="string")return t.trim();const r=t?.src;return typeof r=="string"?r.trim():""}function A(t,r){const e=t.trim().toLocaleLowerCase();return e!==""&&e===r.trim().toLocaleLowerCase()}function L(t){const r=a(t).filter(e=>e.type===l);return r.find(e=>e.props?.sets===!0)??r[0]}function T(t){const r=L(t)?.props?.items;if(!Array.isArray(r))return[];const e=[];return r.forEach((n,o)=>{if(n?.type!==x||!n.props)return;const s=n.props,c=y(s.image);if(!c)return;const g=Array.isArray(s.photos)?s.photos.map(y).filter(Boolean).map(P=>({src:P})):[],u=i(s.process),f=i(s.name);e.push({image:c,photos:g,href:i(s.href)||void 0,process:u||void 0,eyebrow:i(s.eyebrow)||void 0,name:f||void 0,meta:i(s.meta)||void 0,tile:{id:typeof s.id=="string"&&s.id?s.id:`set-${o+1}`,tag:u,name:f}})}),e}const d=t=>t?.type===l&&t.props?.[S]===!0;function _(t){return a(t).some(r=>d(r))}function G(t,r,e){if(!_(t))return t;const n=T(r).filter(o=>A(o.tile.tag,e));return m(t,o=>d(o)?{...o,props:{...o.props??{},[p]:n}}:o)}function R(t){return m(t,r=>{const e=r.props;if(!e||!(p in e))return r;const{[p]:n,...o}=e;return{...r,props:o}})}function w(t){const r=t[p];return Array.isArray(r)?r:null}export{h as GALLERY_PAGE_SLUG,S as PRODUCT_SETS_PROP,p as PRODUCT_SETS_STAMP_PROP,T as gallerySetTiles,_ as pageWantsProductSets,A as setTagMatches,G as stampProductSets,w as stampedProductSets,R as stripProductSets};
@@ -1 +1 @@
1
- import{cardHoverOf as G}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as I}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as O,gridPagingOf as W}from"../sections/product-grid-pages.js";import{gridKindsOf as R,gridRowsOf as v,isAllProductsSource as C,isLinkedSource as H}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as T,PRODUCT_GRID_TYPE as w,documentNodes as N,mapDocumentNodes as U}from"../document/document-nodes.js";import{stripLinkedHeroRecords as g}from"../document/linked-hero-hydrate.js";import{selectedRangesOf as D,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as B,withoutShopperFirstPaint as K,withoutShopperFirstPaintNode as k}from"./shopper-first-paint.js";const m="catalog",F="catalogTotal",Y="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===w&&H(l(e))}function a(e){return e?.type===Y||e?.type===T}function S(e,r){if(r)return;const{limit:t,cap:o}=W(e.props??{});return o?Math.ceil(t)+O:void 0}function _(e){return e?.type===u||p(e)||a(e)}const c=e=>N(e);function M(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function ne(e){return e?M(e)||c(e).some(r=>k(r)!==r)||h(e)!==e||g(e)!==e:!1}function oe(e){return e?c(e).some(_):!1}function se(e,r){return r.length===0?e:y(e,_,t=>({...t,props:{...t.props??{},[f]:r}}))}function z(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const o=t.props?.kinds;for(const n of p(t)?R(l(t),o):I(o))r.add(n)}return[...r]}function ie(e){if(!e)return;const r=c(e);if(r.some(a))return;const t=z(e).length;let o;for(const n of r){if(n?.type===u)return;if(!p(n))continue;const s=S(n,!1),i=n.props??{},d=new Set(R(l(n),i.kinds)),E=["num","title","description","linkText"].some(L=>typeof i[L]=="string"&&i[L]!=="");if(s===void 0||!C(l(n))||d.size!==t||E)return;o=Math.max(o??0,s)}return o}function pe(e){return e.length===1&&e[0]==="alloy-wheel"}function ue(e,r,{everyHoverPhoto:t=!1}={}){const o=D(e.root?.props),n=c(e).some(a),s=t?b:V;return B(q(e,i=>p(i)?j(i,r,S(i,n),s):{...i,props:{...x(i).props,products:s(i,r)}}),o)}const b=(e,r)=>[...r];function V(e,r){const t=G(e.props??{},e.type??""),o=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function j(e,r,t,o){const n=o(e,v(l(e),e.props?.kinds,r)),s={...P(e).props};return t!==void 0&&n.length>t?(s[m]=n.slice(0,t),s[F]=n.length):s[m]=n,{...e,props:s}}function ce(e){return K(y(g(h(e)),_,r=>a(r)?A(r):p(r)?P(r):x(r)))}function A(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function P(e){const{[m]:r,[F]:t,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...d}=s;n.source=d}return{...e,props:n}}function fe(e){const r=g(h({content:[e]})).content[0],t=k(r);return p(t)?P(t):a(t)?A(t):t?.type===u?x(t):t}function x(e){const{wheels:r,products:t,[f]:o,...n}=e.props??{};return{...e,props:n}}function q(e,r){return y(e,t=>t?.type===u||p(t),r)}function y(e,r,t){return U(e,o=>r(o)?t(o):o)}export{Y as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,T as FILTER_BLOCK_TYPE,m as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,O as GRID_TOP_UP_SPARE,w as PRODUCT_GRID_TYPE,ce as dehydrateWheelsListing,fe as dehydrateWheelsListingNode,se as hydrateFieldUsage,ue as hydrateWheelsListing,ie as listingCatalogBound,z as listingCatalogKinds,pe as listingWantsWheelsOnly,ne as pageHasHydratedValues,M as pageHasWheelsListing,oe as pageReadsFieldUsage};
1
+ import{cardHoverOf as I}from"efficient-web-builder/format/lib/animation/hover";import{resolvePlpKinds as W}from"../catalog/plp-item.js";import{GRID_TOP_UP_SPARE as R,gridPagingOf as v}from"../sections/product-grid-pages.js";import{gridKindsOf as T,gridRowsOf as C,isAllProductsSource as H,isLinkedSource as N}from"./grid-source.js";import{ALLOY_WHEELS_LISTING_TYPE as u,FILTER_BLOCK_TYPE as w,PRODUCT_GRID_TYPE as S,documentNodes as U,mapDocumentNodes as D}from"../document/document-nodes.js";import{stripLinkedHeroRecords as g}from"../document/linked-hero-hydrate.js";import{stripProductSets as m}from"../sections/gallery-product-sets.js";import{selectedRangesOf as B,stripSelectedRanges as h}from"./selected-ranges.js";import{withShopperFirstPaint as K,withoutShopperFirstPaint as Y,withoutShopperFirstPaintNode as k}from"./shopper-first-paint.js";const _="catalog",F="catalogTotal",M="CatalogFilterBar",f="fieldUsage";function l(e){return e.props?.source}function p(e){return e?.type===S&&N(l(e))}function d(e){return e?.type===M||e?.type===w}function A(e,r){if(r)return;const{limit:t,cap:o}=v(e.props??{});return o?Math.ceil(t)+R:void 0}function P(e){return e?.type===u||p(e)||d(e)}const c=e=>U(e);function z(e){return e?c(e).some(r=>r?.type===u||p(r)):!1}function se(e){return e?z(e)||c(e).some(r=>k(r)!==r)||h(e)!==e||g(e)!==e||m(e)!==e:!1}function ie(e){return e?c(e).some(P):!1}function pe(e,r){return r.length===0?e:L(e,P,t=>({...t,props:{...t.props??{},[f]:r}}))}function b(e){if(!e)return[];const r=new Set;for(const t of c(e)){if(t?.type!==u&&!p(t))continue;const o=t.props?.kinds;for(const n of p(t)?T(l(t),o):W(o))r.add(n)}return[...r]}function ue(e){if(!e)return;const r=c(e);if(r.some(d))return;const t=b(e).length;let o;for(const n of r){if(n?.type===u)return;if(!p(n))continue;const s=A(n,!1),i=n.props??{},a=new Set(T(l(n),i.kinds)),G=["num","title","description","linkText"].some(O=>typeof i[O]=="string"&&i[O]!=="");if(s===void 0||!H(l(n))||a.size!==t||G)return;o=Math.max(o??0,s)}return o}function ce(e){return e.length===1&&e[0]==="alloy-wheel"}function fe(e,r,{everyHoverPhoto:t=!1}={}){const o=B(e.root?.props),n=c(e).some(d),s=t?V:j;return K(J(e,i=>p(i)?q(i,r,A(i,n),s):{...i,props:{...y(i).props,products:s(i,r)}}),o)}const V=(e,r)=>[...r];function j(e,r){const t=I(e.props??{},e.type??""),o=t.kind==="nextImage"&&t.media&&t.media.kind!=="renderings"?t.media.kind:null;return r.map(n=>{const{hoverMedia:s,...i}=n;return s===void 0?n:o&&s?.[o]?{...i,hoverMedia:{[o]:s[o]}}:i})}function q(e,r,t,o){const n=o(e,C(l(e),e.props?.kinds,r)),s={...x(e).props};return t!==void 0&&n.length>t?(s[_]=n.slice(0,t),s[F]=n.length):s[_]=n,{...e,props:s}}function le(e){return Y(L(m(g(h(e))),P,r=>d(r)?E(r):p(r)?x(r):y(r)))}function E(e){if(!e.props||!(f in e.props))return e;const{[f]:r,...t}=e.props;return{...e,props:t}}function x(e){const{[_]:r,[F]:t,[f]:o,...n}=e.props??{},s=n.source;if(s&&"wheels"in s){const{wheels:i,...a}=s;n.source=a}return{...e,props:n}}function de(e){const r=m(g(h({content:[e]}))).content[0],t=k(r);return p(t)?x(t):d(t)?E(t):t?.type===u?y(t):t}function y(e){const{wheels:r,products:t,[f]:o,...n}=e.props??{};return{...e,props:n}}function J(e,r){return L(e,t=>t?.type===u||p(t),r)}function L(e,r,t){return D(e,o=>r(o)?t(o):o)}export{M as CATALOG_FILTER_BAR_TYPE,f as FIELD_USAGE_PROP,w as FILTER_BLOCK_TYPE,_ as GRID_CATALOG_PROP,F as GRID_CATALOG_TOTAL_PROP,R as GRID_TOP_UP_SPARE,S as PRODUCT_GRID_TYPE,le as dehydrateWheelsListing,de as dehydrateWheelsListingNode,pe as hydrateFieldUsage,fe as hydrateWheelsListing,ue as listingCatalogBound,b as listingCatalogKinds,ce as listingWantsWheelsOnly,se as pageHasHydratedValues,z as pageHasWheelsListing,ie as pageReadsFieldUsage};