efficient-storefront-blocks 0.87.0 → 0.89.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/dist/chunks/{EditorPreviewCheckout-GD4IJ4WK.js → EditorPreviewCheckout-R7XG75DW.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-2UVCJZXS.js → SiteEditorProvider-YNUCDQ2D.js} +1 -1
- package/dist/chunks/chunk-BYBBZS7L.js +1 -0
- package/dist/chunks/{chunk-H4IHUSCU.js → chunk-E54FFOUS.js} +1 -1
- package/dist/chunks/chunk-G4Y7XXRV.js +1 -0
- package/dist/chunks/chunk-WRDUOJZO.js +382 -0
- package/dist/chunks/{fitment-data-5GBUMO2O.js → fitment-data-URBK335I.js} +1 -1
- package/dist/contract.js +14 -2
- package/dist/editor/components/CategorySource.d.ts +8 -1
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FinishPicker.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/components/ProductPicker.js +1 -1
- package/dist/editor/components/ReviewsProductSource.js +1 -1
- package/dist/editor/components/SocialLinksDoor.js +1 -1
- package/dist/editor/components/SpecTableSource.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FilterBlock/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/FilterBlock/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/FilterChipsBlock/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/FilterChipsBlock/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductBuyButton/fields.d.ts +2 -0
- package/dist/editor/lib/document/blocks/commerce/ProductBuyButton/fields.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductName/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/controls.d.ts +4 -0
- package/dist/editor/lib/document/blocks/commerce/controls.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/document/blocks/commerce/index.js +1 -1
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/editor-words-kept.d.ts +1 -0
- package/dist/editor/lib/editor-words-kept.js +1 -0
- package/dist/editor/lib/efficient-backend.d.ts +6 -1
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/storefront-document.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +33 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +134 -81
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +111 -0
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BundleCard.d.ts +2 -1
- package/dist/render/components/BundleCard.js +1 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +11 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GridCardTemplate.d.ts +7 -1
- package/dist/render/components/GridCardTemplate.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +5 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ProductRef.d.ts +8 -2
- package/dist/render/components/ProductRef.js +1 -1
- package/dist/render/components/SectionBand.d.ts +3 -2
- package/dist/render/components/SectionBand.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.d.ts +8 -1
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
- package/dist/render/components/card-pieces/CardName.d.ts +2 -1
- package/dist/render/components/card-pieces/CardName.js +1 -1
- package/dist/render/components/card-pieces/CardPrice.js +1 -1
- package/dist/render/components/card-pieces/CardProductBadge.d.ts +2 -1
- package/dist/render/components/card-pieces/CardProductBadge.js +1 -1
- package/dist/render/components/card-pieces/CardProductPicture.d.ts +5 -0
- package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
- package/dist/render/components/card-pieces/CardSpecs.js +1 -1
- package/dist/render/components/card-pieces/HostPart.js +1 -1
- package/dist/render/components/card-pieces/ProductCardState.d.ts +25 -6
- package/dist/render/components/card-pieces/ProductCardState.js +1 -1
- package/dist/render/components/catalog/CatalogFilterContext.d.ts +4 -1
- package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
- package/dist/render/components/catalog/ClearAllButton.d.ts +4 -0
- package/dist/render/components/catalog/ClearAllButton.js +1 -0
- package/dist/render/components/catalog/FilterPill.d.ts +4 -2
- package/dist/render/components/catalog/FilterPill.js +1 -1
- package/dist/render/components/catalog/ShopperChips.d.ts +13 -0
- package/dist/render/components/catalog/ShopperChips.js +1 -0
- package/dist/render/components/catalog/ShopperFilters.d.ts +20 -0
- package/dist/render/components/catalog/ShopperFilters.js +1 -0
- package/dist/render/components/catalog/ShopperScope.d.ts +72 -0
- package/dist/render/components/catalog/ShopperScope.js +3 -0
- package/dist/render/components/catalog/SortSelect.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/wheels-plp/PlpActiveChips.js +1 -1
- package/dist/render/components/wheels-plp/PlpPagination.d.ts +2 -1
- package/dist/render/components/wheels-plp/PlpPagination.js +1 -1
- package/dist/render/components/wheels-plp/PlpSidebar.js +1 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.d.ts +2 -0
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.js +1 -1
- package/dist/render/lib/api/index.d.ts +6 -0
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/catalog/related-cards.d.ts +4 -1
- package/dist/render/lib/catalog/relationships.d.ts +9 -2
- package/dist/render/lib/catalog/relationships.js +1 -1
- package/dist/render/lib/commerce.d.ts +2 -0
- package/dist/render/lib/commerce.js +1 -1
- package/dist/render/lib/content/article-body.js +1 -5
- package/dist/render/lib/content/filter-card-seed.d.ts +10 -0
- package/dist/render/lib/content/filter-card-seed.js +1 -0
- package/dist/render/lib/content/product-card-seed.d.ts +5 -0
- package/dist/render/lib/content/product-card-seed.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/FilterBlock/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.d.ts +8 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/FilterChipsBlock/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/GalleryB/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/meta.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/meta.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/commerce/ProductBuyButton/render.js +1 -0
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductName/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/metas.d.ts +3 -0
- package/dist/render/lib/document/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/document/blocks/commerce/renders.d.ts +3 -0
- package/dist/render/lib/document/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/document/card-templates.d.ts +1 -0
- package/dist/render/lib/document/card-templates.js +1 -1
- package/dist/render/lib/document/document-nodes.d.ts +24 -0
- package/dist/render/lib/document/document-nodes.js +1 -0
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-config.js +1 -1
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/links/link-rules.js +1 -1
- package/dist/render/lib/sections/bundle-to-grid.d.ts +8 -0
- package/dist/render/lib/sections/bundle-to-grid.js +1 -0
- package/dist/render/lib/sections/catalog-text-size.d.ts +2 -0
- package/dist/render/lib/sections/catalog-text-size.js +1 -1
- package/dist/render/lib/sections/filter-option-rows.d.ts +37 -0
- package/dist/render/lib/sections/filter-option-rows.js +1 -0
- package/dist/render/lib/sections/gallery-toolbar.d.ts +27 -0
- package/dist/render/lib/sections/gallery-toolbar.js +1 -0
- package/dist/render/lib/sections/grid-no-hole.d.ts +3 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -1
- package/dist/render/lib/sections/product-grid-pages.d.ts +42 -0
- package/dist/render/lib/sections/product-grid-pages.js +1 -0
- package/dist/render/lib/sections/shopper-filters.d.ts +45 -0
- package/dist/render/lib/sections/shopper-filters.js +1 -0
- package/dist/render/lib/wheels/plp-filters.d.ts +6 -3
- package/dist/render/lib/wheels/plp-filters.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +5 -3
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/selected-ranges.d.ts +16 -0
- package/dist/render/lib/wheels/selected-ranges.js +1 -0
- package/dist/render/lib/wheels/set-mode.d.ts +10 -0
- package/dist/render/lib/wheels/set-mode.js +1 -1
- package/dist/render/lib/wheels/shopper-first-paint.d.ts +28 -0
- package/dist/render/lib/wheels/shopper-first-paint.js +1 -0
- package/dist/render/lib/wheels/shopper-scope.d.ts +11 -0
- package/dist/render/lib/wheels/shopper-scope.js +1 -0
- package/dist/words.d.ts +46 -6
- package/dist/words.js +6 -6
- package/package.json +4 -4
- package/dist/chunks/chunk-QLR6IVWJ.js +0 -369
- package/dist/chunks/chunk-SYK5QPNV.js +0 -1
- package/dist/chunks/chunk-XZ46W3NV.js +0 -1
- package/dist/render/components/pdp-dynamic/DynamicBundleOffer.d.ts +0 -13
- package/dist/render/components/pdp-dynamic/DynamicBundleOffer.js +0 -1
- /package/dist/chunks/{chunk-QLR6IVWJ.js.LEGAL.txt → chunk-WRDUOJZO.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-DLWIDJS5.js → chunk-ZA3ULZOA.js} +0 -0
package/dist/links.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ze={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var J=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var x=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],ee=["highlight","quiet"],$e=J.map(e=>e.style).filter(e=>x.some(n=>n.kind===e)).filter(e=>!ee.includes(e)),Be=[...x,{open:"*",close:"*",kind:"accent"}],We=[...x,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var Ge=["http","https","mailto","tel"];function v(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||Ge.includes(n[1].toLowerCase())}var ne=["width","profile","rim"];var Ye=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,He={width:[100,500],profile:[20,100],rim:[10,30]};function U(e){let n=Ye.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return ne.every(i=>{let[a,u]=He[i];return t[i]>=a&&t[i]<=u})?t:null}function T(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let n=`${e.width}/${e.profile}`;return e.rim==null?n:`${n} R${e.rim}`}function te(e){return[T({width:e.width}),T({width:e.width,profile:e.profile}),T(e)]}var S=["alloy-wheel","tyre"],re=["alloy-wheel"],L={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var Jn=S.map(e=>({value:e,label:L[e]}));function w(e){return e==null?[...re]:Array.isArray(e)?S.filter(n=>e.includes(n)):[...re]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function D(e){return m(e).brand??""}function ie(e){return m(e).prices??void 0}function oe(e){return m(e).inStock!==!1}function le(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function z(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function se(e){return z(e).map(n=>n.family)}function $(e){if(f(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function ae(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function ue(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ce(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function pe(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>U(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var B=e=>typeof e=="string"&&e?e:void 0;var de=null;function fe(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(n,r)?String(n[r]):t):e}function y(e,n){let t=de?de[e]:void 0;if(typeof t=="function"){try{let r=B(t(n??{}));if(r)return r}catch{}return fe(e,n)}return fe(B(t)??e,n)}function W(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function me(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var he="homepage";var F=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function _(e){return e.offersCommerce&&e.offersService?F:F.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var G="#popup:";function ge(e){return`${G}${e}`}function ye(e){return e.startsWith(G)&&e.slice(G.length).trim()||null}function P(e){return e===he?"/":`/${e}`}function A(e){return`/journal/${e}`}function E(e){return`/wheels/${e}`}function R(e,n){return`${P(e)}#${n}`}function I(...e){let n=new Set,t=[];for(let r of e)for(let i of r?.content??[]){let a=me(i?.props?.anchor);if(!a)continue;let u=W(a);!u||n.has(u)||(n.add(u),t.push({slug:u,name:a}))}return t}function Pe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var qe=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function O(e,n,t){if(!e)return"page";if(ye(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Pe(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||n.includes(r))return"anchor"}return e==="/"||n.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function be(e,n){let t=qe(),r=e.pages.map(l=>({value:P(l.slug),label:l.title})),i=n?.pageOptions?n.pageOptions(r):r,a=i.map(l=>l.value),u=e.pages.map(l=>({label:l.title,options:I(...l.docs).map(c=>({value:R(l.slug,c.slug),label:c.name}))})).filter(l=>l.options.length>0),p=l=>{switch(l){case"page":return{type:"select",options:i,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:u,placeholder:u.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(c=>({value:A(c.slug),label:c.title||c.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(c=>({value:c.href,label:c.name||c.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(c=>({value:ge(c.slug),label:c.title||c.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},s=_(e.offers).map(l=>({value:l.value,label:y(l.label),target:p(l.value),...l.value==="anchor"?{hint:t.sectionHint}:{},...l.value==="blog"||l.value==="product"||l.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:s,rules:{kindOf:l=>O(l,a),targetOf:l=>l,readFilter:()=>null,withFilter:l=>l}};let o=l=>{let c=n.withFilter(l,null);return n.listingPaths.includes(c)?c:l};return{kinds:s,rules:{kindOf:l=>O(l,a,{listingPaths:n.listingPaths,targetOf:o}),targetOf:o,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:l=>n.listingPaths.includes(l)?n.filtersFor(l):null}}var Se=Object.freeze([]);function Y(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function ke(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let i of e){let a=i[t];if(typeof a!="number"||!Number.isFinite(a))continue;let u=r.get(i.fieldKey);(u===void 0||a<u)&&r.set(i.fieldKey,a)}return i=>i?r.get(i):void 0}function xe(e,n,t,r){let i=new Map;for(let s of t){let o=s[r];typeof o=="number"&&i.set(s.fieldKey,o)}if(i.size===0)return e;let a=[],u=[];e.forEach((s,o)=>{let l=n(s);l&&(a.push(o),u.push({item:s,index:o,order:i.get(l)}))}),u.sort((s,o)=>s.order!==void 0&&o.order!==void 0?s.order-o.order||s.index-o.index:s.order!==void 0?-1:o.order!==void 0?1:s.index-o.index);let p=[...e];return a.forEach((s,o)=>{p[s]=u[o].item}),p.every((s,o)=>s===e[o])?e:p}function Te(e){return Ze(e,"filter")}var je="collection";function H(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":je},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function Ze(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}function Ve(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Le(e,n){let t=e?.[n];return Ve(t)?t:null}function we(e,n,t,r){if(t==null&&r==null)return!0;let i=Le(e,n);return!(i===null||t!=null&&i<t||r!=null&&i>r)}var Qe={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},Dt=Object.keys(Qe);var Fe=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Xe={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},Je={diameters:"tyreSizes"};function en(e){if(e.length===0)return[];let n=Fe.filter(t=>e.every(r=>Xe[t].includes(r)));return n.filter(t=>{let r=Je[t];return!r||!n.includes(r)})}function nn(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var _e={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function tn(e,n,t,r=null){if(r!=="kind"&&n.kind&&f(e)!==n.kind)return!1;for(let i of Fe){if(r===i)continue;let a=n[i];if(a.length===0)continue;let u=a.map(String);if(!Ae(e,i).some(p=>u.includes(p)))return!1}return!(r!=="price"&&!we(ie(e),t,null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!oe(e))}var rn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ae(e,n){switch(n){case"tyreSizes":return[...new Set(pe(e).flatMap(te))];case"brands":return D(e)?[D(e)]:[];case"finishes":return se(e);case"diameters":return le(e).map(String);case"collections":return $(e);case"pcds":return ae(e);case"tyreTypes":return ue(e);case"speedRatings":return ce(e)}}function on(e){let n=new Map;for(let t of e)for(let r of z(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function Ee(e,n,t,r=nn(e),i=Se){let a=o=>sn(o,r,i),u=on(e),p=en(r).filter(o=>o!=="tyreSizes").filter(a).map(o=>{let l=n[o].map(String),c=new Set,M=new Map,k=new Map;for(let d of e){let b=Ae(d,o);for(let h of b)c.add(h);for(let h of new Set(b))k.set(h,(k.get(h)??0)+1);if(tn(d,n,t,o))for(let h of new Set(b))M.set(h,(M.get(h)??0)+1)}let De=[...c].map(d=>({value:d,label:o==="diameters"?`${d}\u2033`:d,count:M.get(d)??0,checked:l.includes(d),swatch:o==="finishes"?u.get(d)??null:null})).sort((d,b)=>{if(o==="diameters")return Number(d.value)-Number(b.value);let h=(k.get(b.value)??0)-(k.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:o,label:rn[o],options:De}}).filter(o=>o.options.length>ln),s=[];for(let o of p){let l=an(o.key,r,i);l!==void 0&&s.push({fieldKey:o.key,filterOrder:l})}return[...xe(p,o=>o.key,s,"filterOrder")]}var ln=1;function Re(e){return e.showCollection===!1?["collections"]:[]}function sn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Te(Y(t,r))(H(e,r)))}function an(e,n,t){if(t.length===0)return;let r;for(let i of n){let a=ke(Y(t,i),"filter")(H(e,i));a!==void 0&&(r===void 0||a<r)&&(r=a)}return r}var q={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},j="type";var Ie="AlloyWheelsListing";function Oe(e){return v(e.trim())}var C="/wheels",N="Products";function Ce(e,n){return n>1?`${N} \xB7 ${e}`:N}function Z(...e){for(let n of e){let t=(n?.content??[]).find(r=>r?.type===Ie);if(t)return t.props??{}}return null}function K(...e){return Z(...e)!==null}function Ne(e,n){let t=e.filter(r=>K(...r.docs)).map(r=>P(r.slug));return t.length===0&&n.fallback?[C]:t}var V=[j,...Object.entries(q).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ke(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),i=r.indexOf("?");return{path:i===-1?r:r.slice(0,i),query:i===-1?"":r.slice(i+1),hash:t}}function un(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Me(e){let n=new URLSearchParams(Ke(e).query);for(let t of V){let r=n.get(t);if(r)return{param:t,value:r}}return null}function Q(e,n){let{path:t,query:r,hash:i}=Ke(e),a=r.split("&").filter(u=>u&&!V.includes(un(u.split("=")[0])));return n?.value&&a.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${a.length?`?${a.join("&")}`:""}${i}`}function ve(e,n){let t=Q(e,null);return n.includes(t)?t:e}function cn(e,n,t=[]){return O(e,n,{listingPaths:t,targetOf:r=>ve(r,t)})}function pn(e){return Array.isArray(e)?e.filter(n=>typeof n?.kind=="string"&&typeof n.field_key=="string").map(n=>({kind:n.kind,fieldKey:n.field_key,...typeof n.filter=="boolean"?{filter:n.filter}:{},filterOrder:n.filter_order??null})):[]}var Ue="Product type",dn="AUD";function X(e,n){let t=n.listing??{},r=w(t.kinds),i=e.filter(s=>r.includes(f(s))),a=Re(t),u=Ee(i,_e,dn,r,n.fieldUsage).filter(s=>!a.includes(s.key)).map(s=>({param:q[s.key],label:s.label,values:s.options.filter(o=>!o.value.includes(",")).map(o=>({value:o.value,label:o.label}))})).filter(s=>s.values.length>0),p=S.filter(s=>r.includes(s)&&i.some(o=>f(o)===s));return p.length>1&&u.unshift({param:j,label:Ue,values:p.map(s=>({value:s,label:L[s]}))}),u}function fn(e){return n=>{let t=Ne(n,{fallback:e.offersCommerce}),r=n.filter(i=>K(...i.docs)).length;return{listingPaths:t,pageOptions:i=>{let a=i.map(u=>{let p=n.find(s=>P(s.slug)===u.value);return p&&K(...p.docs)?{...u,label:Ce(p.title,r)}:u});return r===0&&e.offersCommerce&&!a.some(u=>u.value===C)&&a.push({value:C,label:N}),a},filtersFor:i=>{if(!t.includes(i))return null;let a=n.find(u=>P(u.slug)===i);return X(e.catalogue,{listing:a?Z(...a.docs):null,fieldUsage:e.fieldUsage})},readFilter:Me,withFilter:Q}}}function mn(e){let n=fn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=be({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:E(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Oe},filtersFor:t.filtersFor??(()=>null)}}function lr(e,n){return X(e,n)}export{C as BUILT_IN_LISTING_PATH,F as LINK_KINDS,V as LISTING_FILTER_PARAMS,N as LISTING_PAGE_LABEL,Ue as PRODUCT_TYPE_FILTER_LABEL,R as anchorPath,pn as fieldUsageFromAdminRows,cn as inferLinkKind,K as isProductListingPage,Oe as isSafeLink,_ as linkKindsFor,mn as linkPickerSetup,lr as listingFilterFields,Z as listingNode,Ce as listingPageLabel,ve as listingTarget,I as pageAnchors,P as pagePath,A as postPath,Ne as productListingPaths,Me as readListingFilter,E as wheelPath,Q as withListingFilter};
|
|
1
|
+
var h={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var Je={bold:h.bold.placeholder,italic:h.italic.placeholder,strike:h.strike.placeholder,code:h.code.placeholder,highlight:h.highlight.placeholder,quiet:h.quiet.placeholder,link:"link text",underline:h.underline.placeholder,sup:h.sup.placeholder,sub:h.sub.placeholder,color:"colored text",style:"styled text"};var ue=[{style:"bold",label:"B",name:"Strong",title:"Strong \xB7 **words** \xB7 \u2318B",shortcut:"b"},{style:"italic",label:"I",name:"Italic",title:"Italic \xB7 _words_ \xB7 \u2318I",shortcut:"i"},{style:"strike",label:"S",name:"Strikethrough",title:"Strikethrough \xB7 ~~words~~"},{style:"highlight",label:"\u25C6",name:"Emphasis",title:"Emphasis \xB7 ==words=="},{style:"quiet",label:"a",name:"Quiet",title:"Quiet \xB7 ^^words^^"},{style:"code",label:"\u2039\u203A",name:"Code",title:"Code"},{style:"link",label:"\u{1F517}",name:"Link",title:"Link \xB7 [words](https://\u2026) \xB7 \u2318K",shortcut:"k"},{style:"bullet",label:"\u2022",name:"Bulleted list",title:"Bulleted list"},{style:"number",label:"1.",name:"Numbered list",title:"Numbered list"},{style:"quote",label:"\u275D",name:"Quote",title:"Quote"},{style:"clear",label:"T\xD7",name:"Clear marks",title:"Clear marks \xB7 \u2318\u21E7X",shortcut:"shift+x"}];var F=[{open:"**",close:"**",kind:"bold"},{open:"==",close:"==",kind:"highlight"},{open:"~~",close:"~~",kind:"strike"},{open:"_",close:"_",kind:"italic",wordBoundary:!0},{open:"^^",close:"^^",kind:"quiet"},{open:"@@",close:"@@",kind:"highlight"},{open:"++",close:"++",kind:"bold",wordStart:!0}],ce=["highlight","quiet"],et=ue.map(e=>e.style).filter(e=>F.some(t=>t.kind===e)).filter(e=>!ce.includes(e)),tt=[...F,{open:"*",close:"*",kind:"accent"}],nt=[...F,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var rt=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let t=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!t||rt.includes(t[1].toLowerCase())}var pe=["width","profile","rim"];var ot=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,it={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let t=ot.exec(e??"");if(!t)return null;let n={width:Number(t[1]),profile:Number(t[2]),rim:Number(t[3])};return pe.every(o=>{let[i,a]=it[o];return n[o]>=i&&n[o]<=a})?n:null}function _(e){if(e.width==null)return"";if(e.profile==null)return String(e.width);let t=`${e.width}/${e.profile}`;return e.rim==null?t:`${t} R${e.rim}`}function de(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],fe=["alloy-wheel"],R={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var mn=k.map(e=>({value:e,label:R[e]}));function O(e){return e==null?[...fe]:Array.isArray(e)?k.filter(t=>e.includes(t)):[...fe]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function me(e){return m(e).prices??void 0}function ge(e){return m(e).inStock!==!1}function he(e){let t=m(e),n=d(e)==="tyre"?t.rimDiameters:t.sizes;return Array.isArray(n)?n.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(t=>typeof t?.family=="string").map(t=>({family:t.family,color:t.color??null}))}function ye(e){return G(e).map(t=>t.family)}function H(e){if(d(e)==="tyre")return[];let t=m(e);return Array.isArray(t.categories)?t.categories:t.process?[t.process]:[]}function Pe(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function Se(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function be(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function ke(e){if(d(e)!=="tyre")return[];let t=m(e).sizes;return Array.isArray(t)?t.map(n=>B(typeof n=="string"?n:null)).filter(n=>n!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var xe=null;function we(e,t){return t?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(n,r)=>Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):n):e}function y(e,t){let n=xe?xe[e]:void 0;if(typeof n=="function"){try{let r=Y(n(t??{}));if(r)return r}catch{}return we(e,t)}return we(Y(n)??e,t)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var E=(e,t,n,r)=>({default:e,min:t,max:n,step:r}),bn=E(30,0,100,10),kn=E(0,0,100,5),xn=E(100,0,100,5),wn=E(2,0,4,.5);function Le(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Te="homepage";var A=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function I(e){return e.offersCommerce&&e.offersService?A:A.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function Fe(e){return`${j}${e}`}function _e(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Te?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function K(e,t){return`${P(e)}#${t}`}function v(...e){let t=new Set,n=[];for(let r of e)for(let o of r?.content??[]){let i=Le(o?.props?.anchor);if(!i)continue;let a=q(i);!a||t.has(a)||(t.add(a),n.push({slug:a,name:i}))}return n}function Re(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var st=()=>({choosePage:y("Choose a page"),chooseSection:y("Choose a section"),noSections:y("No section anchors yet"),sectionHint:y("Jumps to a section on that page."),choosePost:y("Choose a post"),chooseProduct:y("Choose a product"),choosePopup:y("Choose a popup")});function D(e,t,n){if(!e)return"page";if(_e(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Re(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||t.includes(r))return"anchor"}return e==="/"||t.includes(e)||n&&n.listingPaths.includes(n.targetOf(e))?"page":"custom"}function Oe(e,t){let n=st(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=t?.pageOptions?t.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:v(...s.docs).map(u=>({value:K(s.slug,u.slug),label:u.name}))})).filter(s=>s.options.length>0),p=s=>{switch(s){case"page":return{type:"select",options:o,placeholder:n.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?n.chooseSection:n.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:n.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:n.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:Fe(u.slug),label:u.title||u.slug})),placeholder:n.choosePopup};case"custom":return{type:"text"}}},l=I(e.offers).map(s=>({value:s.value,label:y(s.label),target:p(s.value),...s.value==="anchor"?{hint:n.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!t)return{kinds:l,rules:{kindOf:s=>D(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=t.withFilter(s,null);return t.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>D(s,i,{listingPaths:t.listingPaths,targetOf:c}),targetOf:c,readFilter:t.readFilter,withFilter:t.withFilter},filtersFor:s=>t.listingPaths.includes(s)?t.filtersFor(s):null}}var Ee=Object.freeze([]);function V(e,t){return e.length===0?e:e.filter(n=>n.kind===void 0||n.kind===t)}function Ae(e,t){let n=t==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[n];if(typeof i!="number"||!Number.isFinite(i))continue;let a=r.get(o.fieldKey);(a===void 0||i<a)&&r.set(o.fieldKey,i)}return o=>o?r.get(o):void 0}function Ie(e,t,n,r){let o=new Map;for(let l of n){let c=l[r];typeof c=="number"&&o.set(l.fieldKey,c)}if(o.size===0)return e;let i=[],a=[];e.forEach((l,c)=>{let s=t(l);s&&(i.push(c),a.push({item:l,index:c,order:o.get(s)}))}),a.sort((l,c)=>l.order!==void 0&&c.order!==void 0?l.order-c.order||l.index-c.index:l.order!==void 0?-1:c.order!==void 0?1:l.index-c.index);let p=[...e];return i.forEach((l,c)=>{p[l]=a[c].item}),p.every((l,c)=>l===e[c])?e:p}function Ne(e){return at(e,"filter")}var lt="collection";function Z(e,t){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":lt},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[t]}function at(e,t){let n=new Set(e.filter(r=>r[t]===!1).map(r=>r.fieldKey));return r=>!r||!n.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function ut(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ce(e,t){let n=e?.[t];return ut(n)?n:null}function Ke(e,t,n,r){if(n==null&&r==null)return!0;let o=Ce(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}function ve(e){let t=e.spec?.lugs;return typeof t=="number"?t:null}var ct={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},lr=Object.keys(ct);var X=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],J={tyreSizes:["tyre"],brands:["alloy-wheel","tyre"],finishes:["alloy-wheel"],diameters:["alloy-wheel","tyre"],collections:["alloy-wheel"],pcds:["alloy-wheel"],tyreTypes:["tyre"],speedRatings:["tyre"]},pt={diameters:"tyreSizes"};function dt(e){if(e.length===0)return[];let t=X.filter(n=>e.every(r=>J[n].includes(r)));return t.filter(n=>{let r=pt[n];return!r||!t.includes(r)})}function ft(e){let t=new Set;for(let n of e)t.add(d(n));return[...t]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function De(e,t,n,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&t.kind&&i!==t.kind)return!1;for(let p of X){if(r===p)continue;let l=t[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Me(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&t.lugs&&t.lugs.length>0&&a("lugs")){let p=ve(e);if(p===null||!t.lugs.includes(p))return!1}return!(r!=="price"&&!Ke(me(e),n,t.priceMin??null,t.priceMax)||r!=="inStock"&&t.inStockOnly&&!ge(e))}var mt={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Me(e,t){switch(t){case"tyreSizes":return[...new Set(ke(e).flatMap(de))];case"brands":return W(e)?[W(e)]:[];case"finishes":return ye(e);case"diameters":return he(e).map(String);case"collections":return H(e);case"pcds":return Pe(e);case"tyreTypes":return Se(e);case"speedRatings":return be(e)}}function gt(e){let t=new Map;for(let n of e)for(let r of G(n))r.color&&!t.has(r.family)&&t.set(r.family,r.color);return t}function Ue(e,t,n,r=ft(e),o=Ee,i="fail"){let a=u=>yt(u,r,o),p=gt(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):dt(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=t[u].map(String),ae=new Set,z=new Map,T=new Map;for(let f of e){let S=Me(f,u);for(let g of S)ae.add(g);for(let g of new Set(S))T.set(g,(T.get(g)??0)+1);if(De(f,t,n,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Xe=[...ae].map(f=>({value:f,label:u==="diameters"?`${f}\u2033`:f,count:z.get(f)??0,checked:b.includes(f),swatch:u==="finishes"?p.get(f)??null:null})).sort((f,S)=>{if(u==="diameters")return Number(f.value)-Number(S.value);let g=(T.get(S.value)??0)-(T.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:mt[u],options:Xe}}).filter(u=>u.options.length>ht),s=[];for(let u of c){let b=Pt(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ie(c,u=>u.key,s,"filterOrder")]}var ht=1;function ze(e){return e.showCollection===!1?["collections"]:[]}function yt(e,t,n){return t.length===0||n.length===0?!0:t.some(r=>Ne(V(n,r))(Z(e,r)))}function Pt(e,t,n){if(n.length===0)return;let r;for(let o of t){let i=Ae(V(n,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var te={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},ne="type";var x="FilterBlock";function $e(e){let t=e;return!!t&&typeof t=="object"&&typeof t.type=="string"&&!!t.props&&typeof t.props=="object"}function St(e){return Object.entries(e.props??{}).filter(t=>Array.isArray(t[1])&&t[1].length>0&&t[1].every($e))}function bt(e){let t=e??{},n=[];Array.isArray(t.content)&&n.push(t.content);for(let r of Object.values(t.zones??{}))Array.isArray(r)&&n.push(r);return n}function Be(e){let t=[],n=(r,o)=>{let i=[r,...o];for(let a of r)if($e(a)){t.push({node:a,order:t.length,lists:i});for(let[,p]of St(a))n(p,i)}};for(let r of bt(e))n(r,[]);return t}function w(e){return Be(e).map(t=>t.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var Pr=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var Ge="AlloyWheelsListing";function He(e){return $(e.trim())}var L="/wheels",M="Products";function Ye(e,t){return t>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let t of[Ge,x])for(let n of e){let r=w({content:n?.content}).find(o=>o.type===t);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function qe(e,t){let n=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return t.fallback&&!n.includes(L)?[...n,L]:n}var ie=[ne,...Object.entries(te).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function je(e){let t=e.indexOf("#"),n=t===-1?"":e.slice(t),r=t===-1?e:e.slice(0,t),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:n}}function wt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ve(e){let t=new URLSearchParams(je(e).query);for(let n of ie){let r=t.get(n);if(r)return{param:n,value:r}}return null}function se(e,t){let{path:n,query:r,hash:o}=je(e),i=r.split("&").filter(a=>a&&!ie.includes(wt(a.split("=")[0])));return t?.value&&i.push(`${encodeURIComponent(t.param)}=${encodeURIComponent(t.value)}`),`${n}${i.length?`?${i.join("&")}`:""}${o}`}function Ze(e,t){let n=se(e,null);return t.includes(n)?n:e}function Lt(e,t,n=[]){return D(e,t,{listingPaths:n,targetOf:r=>Ze(r,n)})}function Tt(e){return Array.isArray(e)?e.filter(t=>typeof t?.kind=="string"&&typeof t.field_key=="string").map(t=>({kind:t.kind,fieldKey:t.field_key,...typeof t.filter=="boolean"?{filter:t.filter}:{},filterOrder:t.filter_order??null})):[]}var Qe="Product type",Ft="AUD";function le(e,t){let n=t.listing??{},r=O(n.kinds),o=e.filter(l=>r.includes(d(l))),i=ze(n),a=Ue(o,ee,Ft,r,t.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:te[l.key],label:l.label,values:l.options.filter(c=>!c.value.includes(",")).map(c=>({value:c.value,label:c.label}))})).filter(l=>l.values.length>0),p=k.filter(l=>r.includes(l)&&o.some(c=>d(c)===l));return p.length>1&&a.unshift({param:ne,label:Qe,values:p.map(l=>({value:l,label:R[l]}))}),a}function _t(e){return t=>{let n=qe(t,{fallback:e.offersCommerce}),r=t.filter(o=>U(...o.docs)).length;return{listingPaths:n,pageOptions:o=>{let i=o.map(a=>{let p=t.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:Ye(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===L)&&i.push({value:L,label:M}),i},filtersFor:o=>{if(!n.includes(o))return null;let i=t.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ve,withFilter:se}}}function Rt(e){let t=_t({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),n=Oe({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},t);return{...n,rules:{...n.rules,isSafe:He},filtersFor:n.filtersFor??(()=>null)}}function ao(e,t){return le(e,t)}export{L as BUILT_IN_LISTING_PATH,A as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Qe as PRODUCT_TYPE_FILTER_LABEL,K as anchorPath,Tt as fieldUsageFromAdminRows,Lt as inferLinkKind,U as isProductListingPage,He as isSafeLink,I as linkKindsFor,Rt as linkPickerSetup,ao as listingFilterFields,oe as listingNode,Ye as listingPageLabel,Ze as listingTarget,v as pageAnchors,P as pagePath,N as postPath,qe as productListingPaths,Ve as readListingFilter,C as wheelPath,se as withListingFilter};
|
|
@@ -1515,6 +1515,54 @@ body:has([data-page-width="full"]) footer {
|
|
|
1515
1515
|
position: static;
|
|
1516
1516
|
}
|
|
1517
1517
|
|
|
1518
|
+
/* Where a pin stops under the header: `--sf-pin-header`, read by
|
|
1519
|
+
efficient-web-builder, which writes efficient-shell's `--motion-pin-top` on a
|
|
1520
|
+
pinned node as `calc(var(--sf-pin-header, var(--sf-header-h, 88px)) +
|
|
1521
|
+
<distance>)`. The shell's pin knows no host's header, so the host says it
|
|
1522
|
+
here. It is set on <body> because app/layout.tsx and useHeaderBar publish
|
|
1523
|
+
`--sf-header-h` there too (an inline value on <body> shadows <html>). When the
|
|
1524
|
+
header does not stay pinned (`data-header-sticky` "none" / "on_scroll_up" on
|
|
1525
|
+
<html>), there is no header to stop under: the stop is the screen top.
|
|
1526
|
+
In `@layer base` with the other <body> rules (scripts/test-css-layers.ts);
|
|
1527
|
+
the name is used nowhere else, so the layer cannot lose it to another rule.
|
|
1528
|
+
scripts/test-pin-header-var.ts. */
|
|
1529
|
+
@layer base {
|
|
1530
|
+
body {
|
|
1531
|
+
--sf-pin-header: var(--sf-header-h, 88px);
|
|
1532
|
+
}
|
|
1533
|
+
:root[data-header-sticky="none"] body,
|
|
1534
|
+
:root[data-header-sticky="on_scroll_up"] body {
|
|
1535
|
+
--sf-pin-header: 0px;
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/* Each view's answer for efficient-shell's pin. The shell reads ONE
|
|
1540
|
+
`--motion-pin-top` and ONE `--motion-pin-position`. efficient-web-builder
|
|
1541
|
+
writes each view's answer on the pinned node: `--sf-pin-distance` and
|
|
1542
|
+
`--sf-pin-position`, and a `-tablet` / `-phone` pair only where that view's
|
|
1543
|
+
answer differs from the desktop's (its view-var split). So an unwritten phone
|
|
1544
|
+
value equals the desktop's: the phone falls back to the desktop, never to the
|
|
1545
|
+
tablet. The stop is the header stop above plus the distance; a node that
|
|
1546
|
+
stops at the screen top (the Scroll-Over intro) sets `--sf-pin-header: 0px`
|
|
1547
|
+
on itself. The widths are the tablet and phone blocks' of `.sf-section-stick`
|
|
1548
|
+
below. scripts/test-pin-header-var.ts §4. */
|
|
1549
|
+
[data-motion-pin] {
|
|
1550
|
+
--motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance, 0px));
|
|
1551
|
+
--motion-pin-position: var(--sf-pin-position, sticky);
|
|
1552
|
+
}
|
|
1553
|
+
@media (min-width: 720px) and (max-width: 1099.98px) {
|
|
1554
|
+
[data-motion-pin] {
|
|
1555
|
+
--motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance-tablet, var(--sf-pin-distance, 0px)));
|
|
1556
|
+
--motion-pin-position: var(--sf-pin-position-tablet, var(--sf-pin-position, sticky));
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
@media not all and (min-width: 720px) {
|
|
1560
|
+
[data-motion-pin] {
|
|
1561
|
+
--motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance-phone, var(--sf-pin-distance, 0px)));
|
|
1562
|
+
--motion-pin-position: var(--sf-pin-position-phone, var(--sf-pin-position, sticky));
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1518
1566
|
/* Stick to top — the pin any section or card can be given (efficient-web-builder
|
|
1519
1567
|
lib/content/section-sticky.ts, card [ADD] Every Section Can Stick To The Top).
|
|
1520
1568
|
The pass wraps a node that sticks in `.sf-section-stick` and publishes the
|
|
@@ -3389,6 +3437,21 @@ em.text-accent {
|
|
|
3389
3437
|
padding-block: 0;
|
|
3390
3438
|
}
|
|
3391
3439
|
|
|
3440
|
+
/* THE CARD LIST'S ITEMS (lib/document/lazy-draws `CardList`):
|
|
3441
|
+
a Card list in a Box draws its items inside ONE `display: contents`
|
|
3442
|
+
element (`[data-sf-box-items]`), and each item is a copy of its template
|
|
3443
|
+
(`[data-sf-repeat]`, a `<div>` or, for an item that acts, a `<button>`)
|
|
3444
|
+
round the template's slot. The items are blocks of the Box all the same,
|
|
3445
|
+
so its Gap only reaches the element itself and the blocks in each copy,
|
|
3446
|
+
in the shapes above. Unlayered, like the rules above, for their reason. */
|
|
3447
|
+
.sf-box-gap-only > [data-sf-box-items] > *,
|
|
3448
|
+
.sf-box-gap-only > [data-sf-box-items] > [data-sf-repeat] > * > *,
|
|
3449
|
+
.sf-box-gap-only > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > *,
|
|
3450
|
+
.sf-box-gap-only > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > *,
|
|
3451
|
+
.sf-box-gap-only > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > * {
|
|
3452
|
+
padding-block: 0;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3392
3455
|
/* A Box's own Block spacing per view. The
|
|
3393
3456
|
builder (efficient-web-builder Flex) writes the desktop answer as above and,
|
|
3394
3457
|
only where a view's answer differs from the desktop's, `sf-box-each-tablet` /
|
|
@@ -3419,6 +3482,22 @@ em.text-accent {
|
|
|
3419
3482
|
.sf-box-each-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3420
3483
|
padding-block: revert-layer;
|
|
3421
3484
|
}
|
|
3485
|
+
/* …and the Card list's items (THE CARD LIST'S ITEMS, above). */
|
|
3486
|
+
.sf-box-each-tablet > [data-sf-box-items] > *,
|
|
3487
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > *,
|
|
3488
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > *,
|
|
3489
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > *,
|
|
3490
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > * {
|
|
3491
|
+
padding-block: revert-layer;
|
|
3492
|
+
}
|
|
3493
|
+
/* …keeping an Overlap block's own padding, as above. */
|
|
3494
|
+
.sf-box-each-tablet > [data-sf-box-items] > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3495
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3496
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3497
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3498
|
+
.sf-box-each-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both) {
|
|
3499
|
+
padding-block: var(--sf-gap-overlap-eff);
|
|
3500
|
+
}
|
|
3422
3501
|
/* …but `revert-layer` also drops a nested Box's own Overlap padding (its
|
|
3423
3502
|
unlayered `.sf-gap-overlap-*` rule, above), which an Each Box draws: so a
|
|
3424
3503
|
block shape that IS an Overlap Box takes its overlap padding back here. */
|
|
@@ -3458,6 +3537,14 @@ em.text-accent {
|
|
|
3458
3537
|
.sf-box-gap-only-tablet > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3459
3538
|
padding-block: 0;
|
|
3460
3539
|
}
|
|
3540
|
+
/* …and the Card list's items, as above. */
|
|
3541
|
+
.sf-box-gap-only-tablet > [data-sf-box-items] > *,
|
|
3542
|
+
.sf-box-gap-only-tablet > [data-sf-box-items] > [data-sf-repeat] > * > *,
|
|
3543
|
+
.sf-box-gap-only-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > *,
|
|
3544
|
+
.sf-box-gap-only-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > *,
|
|
3545
|
+
.sf-box-gap-only-tablet > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > * {
|
|
3546
|
+
padding-block: 0;
|
|
3547
|
+
}
|
|
3461
3548
|
}
|
|
3462
3549
|
@media not all and (min-width: 720px) {
|
|
3463
3550
|
.sf-box-each-phone > *,
|
|
@@ -3478,6 +3565,22 @@ em.text-accent {
|
|
|
3478
3565
|
.sf-box-each-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3479
3566
|
padding-block: revert-layer;
|
|
3480
3567
|
}
|
|
3568
|
+
/* …and the Card list's items (THE CARD LIST'S ITEMS, above). */
|
|
3569
|
+
.sf-box-each-phone > [data-sf-box-items] > *,
|
|
3570
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > *,
|
|
3571
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > *,
|
|
3572
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > *,
|
|
3573
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > * {
|
|
3574
|
+
padding-block: revert-layer;
|
|
3575
|
+
}
|
|
3576
|
+
/* …keeping an Overlap block's own padding, as above. */
|
|
3577
|
+
.sf-box-each-phone > [data-sf-box-items] > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3578
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3579
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3580
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > :is(.sf-gap-overlap-block, .sf-gap-overlap-both),
|
|
3581
|
+
.sf-box-each-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > :is(.sf-gap-overlap-block, .sf-gap-overlap-both) {
|
|
3582
|
+
padding-block: var(--sf-gap-overlap-eff);
|
|
3583
|
+
}
|
|
3481
3584
|
/* …but `revert-layer` also drops a nested Box's own Overlap padding (its
|
|
3482
3585
|
unlayered `.sf-gap-overlap-*` rule, above), which an Each Box draws: so a
|
|
3483
3586
|
block shape that IS an Overlap Box takes its overlap padding back here. */
|
|
@@ -3517,6 +3620,14 @@ em.text-accent {
|
|
|
3517
3620
|
.sf-box-gap-only-phone > [data-easel-block] > [data-sf-part-host] > .sf-block-size > .sf-entrance > .sf-section-pad > * {
|
|
3518
3621
|
padding-block: 0;
|
|
3519
3622
|
}
|
|
3623
|
+
/* …and the Card list's items, as above. */
|
|
3624
|
+
.sf-box-gap-only-phone > [data-sf-box-items] > *,
|
|
3625
|
+
.sf-box-gap-only-phone > [data-sf-box-items] > [data-sf-repeat] > * > *,
|
|
3626
|
+
.sf-box-gap-only-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-entrance > *,
|
|
3627
|
+
.sf-box-gap-only-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-section-pad > *,
|
|
3628
|
+
.sf-box-gap-only-phone > [data-sf-box-items] > [data-sf-repeat] > * > .sf-block-size > * {
|
|
3629
|
+
padding-block: 0;
|
|
3630
|
+
}
|
|
3520
3631
|
}
|
|
3521
3632
|
|
|
3522
3633
|
/* ── THE VISITOR'S OWN "REDUCE MOTION" SETTING ──────────────────────────────
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Bundle, Currency } from "../lib/api/index.js";
|
|
2
|
-
|
|
2
|
+
import { bundleSaving } from "../lib/commerce.js";
|
|
3
|
+
export { bundleSaving };
|
|
3
4
|
export default function BundleCard({ bundle, currency, }: {
|
|
4
5
|
bundle: Bundle;
|
|
5
6
|
currency: Currency;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import n from"next/link";import o from"next/image";import{bundleSaving as r}from"../lib/commerce.js";function c({bundle:e,currency:i}){const s=r(e,i);return a(n,{href:`/bundles/${e.slug}`,className:"sf-card group flex flex-col border border-line bg-bg transition-colors hover:border-accent",children:[a("div",{className:"sf-card-image relative aspect-[4/3] overflow-hidden bg-surface",children:[e.image?t(o,{src:e.image,alt:e.name,fill:!0,sizes:"(max-width: 640px) 100vw, 33vw",className:"object-cover transition-transform duration-500 group-hover:scale-[1.03]"}):a("div",{className:"flex h-full items-center justify-center font-mono text-[10px] uppercase tracking-[0.3em] text-fg-dim",children:[e.components.length," piece",e.components.length===1?"":"s"]}),s&&t("span",{className:"absolute left-0 top-4 bg-accent px-3 py-2 font-mono text-[10px] uppercase tracking-[0.24em] text-bg",children:s})]}),a("div",{className:"flex flex-1 flex-col gap-2 px-5 py-4",children:[t("span",{className:"font-display text-[18px] font-medium tracking-[-0.015em] text-fg",children:e.name}),e.subtitle&&t("span",{className:"text-[13px] leading-snug text-fg-dim",children:e.subtitle}),!e.inStock&&t("span",{className:"mt-1 font-mono text-[9px] uppercase tracking-[0.24em] text-fg-dim",children:"Currently unavailable"})]})]})}export{r as bundleSaving,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as Y}from"react/jsx-runtime";import{useCallback as q,useMemo as g,useState as H}from"react";import{usePathname as J}from"next/navigation";import{containerGapProps as Q}from"efficient-web-builder/format/lib/content/container-gap";import Z from"efficient-web-builder/render/components/Btn";import{GALLERY_GRID_ATTR as ee,GalleryLinksContext as se,GalleryTilesContext as re}from"./GalleryItem.js";import{useShopperGallery as te}from"./catalog/ShopperScope.js";import{galleryShownIds as le,galleryToolbarIdle as oe,WALL_PLACED_CELL as ne,WALL_PLACED_CSS as ae,wallSpanAt as ie}from"../lib/sections/gallery-toolbar.js";import{useSiteSells as de}from"./SiteRecordContext.js";import{SharedPartKinds as ce}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as me}from"efficient-web-builder/render/components/goldPhrases";import pe from"efficient-web-builder/render/components/SectionHeader";import{headIsEmpty as fe,ownPadding as ge}from"../lib/sections/own-padding.js";import{resolveGridColumns as ue,resolveGridMobileColumns as ye}from"efficient-web-builder/format/lib/content/grid-span";import{galleryLayoutClass as xe,galleryLayoutCss as he,resolveGalleryLayout as we}from"efficient-web-builder/format/lib/content/gallery-layout";const ve="relative z-[2] bg-bg py-[120px] max-view-wide:py-[70px]",Le="relative z-[2] bg-bg pt-0 pb-[120px] max-view-wide:pt-0 max-view-wide:pb-[70px]",Se="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";function Ne({items:p,num:u,title:f,linkText:y,linkHref:G,galleryHref:i="/gallery",submitHref:C="/contact",previewHover:P,display:E,displayPhone:A,styleOwner:I,layout:x,columns:d,columnsMobile:M,gap:R,gapPhone:k,omitHead:h=!1,padTop:O,padBottom:T,editing:j=!1}){const z=J(),$=de(),B=i!==z&&($||i!=="/gallery"),w=we(x),o=w?x:null,D=!w&&d!=null&&d!=="",n=Q("GalleryB",R,"both",k),W=o?{className:`sf-card-grid sf-gallery-zone ${xe(o)} grid${n.className}`,style:n.style}:D?{className:`sf-card-grid sf-grid-zone grid${n.className}`,style:{...n.style,"--sf-grid-cols":String(ue(d)),"--sf-grid-cols-phone":String(ye(M,d))}}:{className:`sf-card-grid grid grid-cols-4${n.className} max-[1500px]:grid-cols-3 max-view-wide:grid-cols-1`,style:n.style},v=y?{text:y,href:G||"#"}:void 0,F=f?me(f,!1):void 0,[L,K]=H({}),S=q((s,r)=>{K(e=>{const m=e[s.id];if(r){if(!m)return e;const{[s.id]:_e,...X}=e;return X}return m&&m.tag===s.tag&&m.name===s.name?e:{...e,[s.id]:s}})},[]),N=p?.blockIds,c=g(()=>(N??[]).map(s=>L[s]).filter(s=>!!s),[N,L]),{ref:U,toolbar:a}=te(c),_=a!==null&&!oe(a,c),l=g(()=>_&&a?le(c,a):null,[_,a,c]),V=g(()=>{const s=new Map((l??[]).map((r,e)=>[r,e]));return{report:S,positionOf:r=>{const e=l?s.get(r):void 0;return e===void 0?null:{index:e+1,total:l.length}}}},[S,l]),b=l?s=>{const r=l.indexOf(s);if(r<0)return{style:{display:"none"}};if(!o)return{style:{order:r}};const e=ie(o,r,l.length);return{className:ne,style:{order:r,"--sf-wall-c":e.col,"--sf-wall-r":e.row,"--sf-wall-cp":e.colPhone,"--sf-wall-rp":e.rowPhone}}}:void 0;return t("section",{ref:U,className:h?Le:ve,style:ge(O,T),children:Y("div",{className:Se,children:[h||!j&&fe(u,f,v?.text)?null:t(pe,{num:u,title:F,link:v}),o&&t("style",{dangerouslySetInnerHTML:{__html:he(o)+(l?ae:"")}}),p&&t(se.Provider,{value:{galleryHref:i,submitHref:C,previewHover:P,display:E,displayPhone:A,styleOwner:I},children:t(re.Provider,{value:V,children:t(ce,{children:t("div",{[ee]:"",style:{display:"contents"},children:t(p,{...W,minEmptyHeight:320,...b?{cell:b}:{}})})})})}),B&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(Z,{href:i,variant:"ghost",children:"See Gallery"})})]})})}export{Ne as default};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type GalleryShowcaseCard } from "./GalleryShowcase.js";
|
|
2
|
+
import type { GalleryTile } from "../lib/sections/gallery-toolbar.js";
|
|
2
3
|
export declare const GalleryLinksContext: import("react").Context<{
|
|
3
4
|
galleryHref?: string;
|
|
4
5
|
submitHref?: string;
|
|
@@ -24,8 +25,16 @@ export declare const GALLERY_TILE_PARTS: readonly [{
|
|
|
24
25
|
readonly id: "number";
|
|
25
26
|
readonly label: "Card number";
|
|
26
27
|
}];
|
|
28
|
+
export declare const GalleryTilesContext: import("react").Context<{
|
|
29
|
+
report: (tile: GalleryTile, gone?: boolean) => void;
|
|
30
|
+
positionOf: (id: string) => TilePosition | null;
|
|
31
|
+
} | null>;
|
|
27
32
|
export declare const GALLERY_GRID_ATTR = "data-gallery-grid";
|
|
28
33
|
export declare const GALLERY_TILE_ATTR = "data-gallery-tile";
|
|
34
|
+
export interface TilePosition {
|
|
35
|
+
index: number;
|
|
36
|
+
total: number;
|
|
37
|
+
}
|
|
29
38
|
export declare const GALLERY_ITEM_HINTS: {
|
|
30
39
|
readonly process: "Category";
|
|
31
40
|
readonly eyebrow: "Subtitle";
|
|
@@ -38,5 +47,6 @@ export interface GalleryItemProps extends GalleryShowcaseCard {
|
|
|
38
47
|
captionPlace?: string;
|
|
39
48
|
editing?: boolean;
|
|
40
49
|
previewHover?: boolean;
|
|
50
|
+
tile?: GalleryTile;
|
|
41
51
|
}
|
|
42
|
-
export default function GalleryItem({ editing, previewHover: ownPreviewHover, ratio, captionPlace, ...card }: GalleryItemProps): import("react").JSX.Element;
|
|
52
|
+
export default function GalleryItem({ editing, previewHover: ownPreviewHover, ratio, captionPlace, tile: toolbarTile, ...card }: GalleryItemProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as n,Fragment as m}from"react/jsx-runtime";import{createContext as
|
|
1
|
+
"use client";import{jsx as r,jsxs as n,Fragment as m}from"react/jsx-runtime";import{createContext as R,useCallback as U,useContext as M,useEffect as X,useRef as Z,useState as C}from"react";import _ from"next/link";import{slugify as J}from"efficient-shell/format";import K from"./GalleryCard.js";import Q,{LightboxClose as ee,LIGHTBOX_CLOSE_TINT as te}from"./Lightbox.js";import{useSiteSells as re}from"./SiteRecordContext.js";import{renderGold as p,renderHeadline as Y}from"efficient-web-builder/render/components/goldPhrases";import{sizedImage as oe}from"efficient-web-builder/format/lib/sized-image";import{useIsoLayoutEffect as ne}from"./catalog/ShopperScope.js";const le="(max-width: 1100px) 100vw, min(59vw, 1050px)",se=R({}),Ce=[{id:"tag",label:"Tag"},{id:"eyebrow",label:"Eyebrow"},{id:"title",label:"Title"},{id:"meta",label:"Meta"},{id:"number",label:"Card number"}],ae=R(null),ie="data-gallery-grid",P="data-gallery-tile";function ce(t,o){const[l,a]=C(null);return X(()=>{const i=t.current,s=i?.closest(`[${ie}]`);if(!i||!s)return;const b=()=>{const y=Array.from(s.querySelectorAll(`[${P}]`)),w=y.indexOf(i),f=w>=0?{index:w+1,total:y.length}:null;a(x=>x?.index===f?.index&&x?.total===f?.total?x:f)};if(b(),!o)return;const v=new MutationObserver(b);return v.observe(s,{childList:!0,subtree:!0}),()=>v.disconnect()},[t,o]),l}const _e={process:"Category",eyebrow:"Subtitle",name:"Item name",meta:"Detail"},de=()=>({image:"",href:"#",process:"",eyebrow:"",name:"",meta:""}),Pe=Array.from({length:6},de);function pe(t){const o=(t.photos??[]).map(s=>s?.src).filter(s=>!!s),l=t.image||o[0]||"",a=[l,...o].filter(s=>!!s),i=J(t.name)||"gallery-item";return{car:t.eyebrow??"",wheel:t.name??"",process:t.process??"",finish:t.meta??"",imageLabel:`${i}.jpg`,detailLabel:`${i}-detail.jpg`,imageSrc:l||void 0,detailSrc:o[0]||l||void 0,photos:a,href:t.href}}function me({editing:t=!1,previewHover:o,ratio:l,captionPlace:a,tile:i,...s}){const{galleryHref:b="/gallery",submitHref:v="/contact",previewHover:y,display:w,displayPhone:f,styleOwner:x,photosOnly:D=!1}=M(se),e=pe(s),h=re()&&!D,T=!h&&!fe(e),d=e.photos??(e.imageSrc?[e.imageSrc]:[]),z=Z(null),E=U(c=>{z.current=c},[]),F=ce(z,t),O=M(ae),N=O?.report,u=i?.id,j=i?.tag??"",I=i?.name??"";ne(()=>{if(!N||!u)return;const c={id:u,tag:j,name:I};return N(c),()=>N(c,!0)},[N,u,j,I]);const $=(u?O?.positionOf(u):null)??F,V=t&&(!!o||!!y),[q,g]=C(!1),[k,L]=C(0),A=()=>L(c=>(c-1+d.length)%d.length),G=()=>L(c=>(c+1)%d.length),S=d[k]??e.imageSrc??"",H=r(K,{build:e,forceHover:V,index:$?.index,total:$?.total,ratio:l,captionPlace:a,display:w,displayPhone:f,styleOwner:x,editing:t});return n(m,{children:[t?r("div",{ref:E,[P]:"",className:"block w-full text-left",children:H}):r("button",{ref:E,[P]:"",type:"button","aria-label":h?`Open ${e.car||"build"} on ${e.wheel||"wheel"}`:W(e),onClick:()=>{L(0),g(!0)},className:"block w-full cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",children:H}),r(Q,{open:q,onClose:()=>g(!1),label:h?`${e.car} on ${e.wheel}`:W(e),onPrev:d.length>1?A:void 0,onNext:d.length>1?G:void 0,className:"flex items-center justify-center p-6 max-[700px]:p-3",children:n("div",{onClick:c=>c.stopPropagation(),className:`relative grid w-[min(1800px,100%)] max-h-[calc(100vh-48px)] ${T?"grid-cols-1":"grid-cols-[1.4fr_1fr]"} overflow-hidden border border-line bg-bg max-view-desktop:grid-cols-1 max-view-desktop:overflow-auto`,style:{boxShadow:"0 60px 120px -20px color-mix(in srgb, var(--sf-shadow-color, #141416) 70%, transparent)"},children:[r(ee,{label:"Close popup",className:"absolute right-[24px] top-[24px] z-[5] flex h-[56px] w-[56px] items-center justify-center border border-line font-mono text-[length:var(--size-label,21px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:te},children:"✕"}),n("div",{className:"relative flex min-h-[690px] items-center justify-center overflow-hidden bg-surface-2 max-view-desktop:min-h-[450px]",children:[S&&r("img",{...oe(S,{fallbackWidth:1280}),sizes:le,alt:`${(h?e.car:e.wheel||e.car)||"Photo"} — ${k+1} of ${d.length}`,className:"block h-full max-h-[88vh] w-full object-cover"},S),d.length>1&&n(m,{children:[r("button",{type:"button","aria-label":"Previous photo",onClick:A,className:"absolute left-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"◁"}),r("button",{type:"button","aria-label":"Next photo",onClick:G,className:"absolute right-4 top-1/2 flex h-16 w-16 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,24px)] text-fg-dim transition-colors hover:border-accent hover:text-accent",children:"▷"}),n("span",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[k+1," / ",d.length]})]})]}),h?n("div",{className:"flex flex-col gap-[30px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[e.process&&r("span",{className:"font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.3em] text-accent",children:p(e.process)}),e.wheel&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Y(e.wheel,!1)}),e.car&&n("div",{className:"font-heading3 text-[length:var(--size-headingSmall,27px)] leading-[1.4] text-fg",children:["on ",r("em",{className:"font-serif font-normal italic text-accent tracking-[-0.01em]",children:p(e.car,!0)})]}),n("dl",{className:"mt-3 grid grid-cols-[auto_1fr] gap-x-7 gap-y-[18px] border-y border-line py-[30px] font-mono text-[length:var(--size-label,15px)] uppercase tracking-[0.22em]",children:[e.wheel&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Wheel"}),r("dd",{className:"text-fg",children:p(e.wheel)})]}),e.process&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Process"}),r("dd",{className:"text-fg",children:p(e.process)})]}),e.finish&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Finish"}),r("dd",{className:"text-fg",children:p(e.finish)})]}),e.car&&n(m,{children:[r("dt",{className:"text-fg-dim",children:"Vehicle"}),r("dd",{className:"text-fg",children:p(e.car)})]})]}),n("div",{className:"mt-auto flex flex-col gap-3.5 pt-6",children:[n(_,{href:e.href||"/wheels",onClick:()=>g(!1),className:"group flex items-center justify-between gap-6 border border-btn bg-btn px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-btn-ink transition-colors hover:border-fg hover:bg-fg",children:[r("span",{children:"View product"}),r("span",{className:"transition-transform group-hover:translate-x-[6px]",children:"→"})]}),n(_,{href:b,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"See more builds"}),r("span",{children:"→"})]}),n(_,{href:v,onClick:()=>g(!1),className:"flex items-center justify-between gap-6 border border-line px-9 py-6 font-mono text-[length:var(--size-label,16px)] uppercase tracking-[0.3em] text-fg transition-colors hover:border-accent hover:text-accent",children:[r("span",{children:"Submit your build"}),r("span",{children:"→"})]})]})]}):!T&&r(xe,{build:e})]})})]})}function B(t){return[t.process,t.car,t.finish].filter((o,l,a)=>!!o&&o!==t.wheel&&a.indexOf(o)===l)}function fe(t){return!!t.wheel||B(t).length>0}function W(t){const o=t.wheel||t.car;return o?`Open photo of ${o}`:"Open photo"}function xe({build:t}){const o=t.wheel,l=B(t);return n("div",{className:"flex flex-col gap-[24px] px-[60px] py-[72px] max-view-desktop:px-9 max-view-desktop:py-[54px]",children:[o&&r("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(42px,4.5vw,60px)),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.95] tracking-[-0.025em]",children:Y(o,!1)}),l.map(a=>r("p",{className:"text-[length:var(--size-body,18px)] leading-[1.5] text-fg",children:p(a)},a))]})}export{ie as GALLERY_GRID_ATTR,_e as GALLERY_ITEM_HINTS,Pe as GALLERY_ITEM_SEEDS,P as GALLERY_TILE_ATTR,Ce as GALLERY_TILE_PARTS,se as GalleryLinksContext,ae as GalleryTilesContext,me as default};
|
|
@@ -2,7 +2,7 @@ import { type CSSProperties, type ReactNode } from "react";
|
|
|
2
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
3
|
import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
|
|
4
4
|
import type { SourceRow } from "efficient-web-builder/format/lib/content/block-sources";
|
|
5
|
-
import type { WheelSummary } from "../lib/api/index.js";
|
|
5
|
+
import type { Bundle, WheelSummary } from "../lib/api/index.js";
|
|
6
6
|
import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
|
|
7
7
|
export declare function gridIndexCss(cls: string): string;
|
|
8
8
|
export declare function cardRowsGrid(gapZone: {
|
|
@@ -27,8 +27,14 @@ export declare function GridCardProvider({ value, children }: {
|
|
|
27
27
|
children: ReactNode;
|
|
28
28
|
}): import("react").JSX.Element;
|
|
29
29
|
export declare function productCardRow(wheel: WheelSummary): SourceRow;
|
|
30
|
+
export declare const bundlePagePath: (bundle: Bundle) => string;
|
|
31
|
+
export declare function bundleCardRow(bundle: Bundle): SourceRow;
|
|
30
32
|
export declare function GridCards({ wheels, finishes, children, }: {
|
|
31
33
|
wheels: readonly WheelSummary[];
|
|
32
34
|
finishes?: readonly (string | undefined)[];
|
|
33
35
|
children: (copies: ReactNode) => ReactNode;
|
|
34
36
|
}): import("react").JSX.Element;
|
|
37
|
+
export declare function GridBundleCards({ bundles, children }: {
|
|
38
|
+
bundles: readonly Bundle[];
|
|
39
|
+
children: (copies: ReactNode) => ReactNode;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as
|
|
1
|
+
"use client";import{jsx as t,jsxs as c,Fragment as b}from"react/jsx-runtime";import v from"next/link";import{createContext as h,useContext as g}from"react";import{CardTemplateRows as m}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as w}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardHoverOf as S}from"efficient-web-builder/format/lib/animation/hover";import{NO_FIELD_ANSWERS as _}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as y}from"../lib/sections/card-image-sizes.js";import{CardLookContext as f}from"./card-pieces/card-row.js";import{CardBuyDialog as I}from"./card-pieces/CardBuyButton.js";import{BundleCardStateProvider as R,useWheelCardState as E,WheelCardStateProvider as P}from"./card-pieces/ProductCardState.js";import{say as G}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as T,cardIndexCss as A}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as N}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as D}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as L,cardRowsGap as O,cardRowsGridStyle as $}from"./WheelCardFrame.js";function ce(e){return T.map(({value:r})=>r==="off"?"":A(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function me(e){return e.className.includes(D)?{className:`${e.className} ${L} ${N}`,style:{...e.style,...$(O(e))}}:e}const F={ownerId:"",Template:void 0,hover:S({},"ProductGrid"),imageSizes:y,fieldUsage:_,reserveEyebrow:!1,editing:!1},p=h(F);function d(){return g(p)}function fe({value:e,children:r}){return t(p.Provider,{value:e,children:r})}function k(e){return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:""}}const u=e=>`/bundles/${e.slug}`;function W(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:u(e)}}const j="sf-card sf-card-fill group relative flex flex-col bg-[var(--card-bg)] transition-colors duration-200 hover:bg-[var(--card-bg-hover)] [.sf-card-rows>&]:mb-[var(--sf-card-row-gap)]",z="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",B="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",U="relative z-[2] flex flex-1 flex-col pointer-events-none [&_a]:pointer-events-auto [&_button]:pointer-events-auto [&_input]:pointer-events-auto [&_select]:pointer-events-auto [&_label]:pointer-events-auto",H="relative flex flex-1 flex-col";function x({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:l}){const{editing:i}=d(),s=a?z:j;return c("article",{className:n?`${s} ${B}`:s,children:[l,!i&&r?t(v,{href:r,"aria-label":o,className:"absolute inset-0 z-[1]"}):null,t("div",{className:i?H:U,children:t(w,{children:e})})]})}function Y({copy:e}){const{wheel:r,sel:o,isSet:n}=E();return c(b,{children:[t(x,{copy:e,href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes}),t(I,{})]})}function K(e,r,o){const n=r.item;return t(P,{wheel:n,defaultFinish:o?.[r.index],children:t(f.Provider,{value:"catalog",children:t(Y,{copy:e})})})}function pe({wheels:e,finishes:r,children:o}){const{ownerId:n,Template:a,editing:l}=d();return t(m,{ownerId:n,ownerType:"ProductGrid",Template:a,rows:e.map(k),items:e,fallback:l?t(C,{}):null,wrapCopy:(i,s)=>K(i,s,r),children:o})}function M(e,r){const o=r.item;return t(R,{bundle:o,children:t(f.Provider,{value:"catalog",children:t(x,{copy:e,href:u(o),label:o.name,kit:!0})})})}function ue({bundles:e,children:r}){const{ownerId:o,Template:n,editing:a}=d();return t(m,{ownerId:o,ownerType:"ProductGrid",Template:n,rows:e.map(W),items:e,fallback:a?t(C,{}):null,wrapCopy:M,children:r})}function C(){return t("div",{"data-grid-card-empty":"",className:"p-4 text-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.2em] text-fg-dim",children:G("The card is empty. Add parts to its card template in Layers.")})}export{ue as GridBundleCards,fe as GridCardProvider,pe as GridCards,W as bundleCardRow,u as bundlePagePath,me as cardRowsGrid,ce as gridIndexCss,k as productCardRow,d as useGridCard};
|
|
@@ -2,6 +2,7 @@ import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/
|
|
|
2
2
|
import type { SlotComponent } from "efficient-easel/blocks";
|
|
3
3
|
import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
|
|
4
4
|
import type { CategorySourceValue } from "../lib/content/source-values.js";
|
|
5
|
+
import { type MoreProducts } from "../lib/sections/product-grid-pages.js";
|
|
5
6
|
import type { ProductSummary, WheelSummary } from "../lib/api/index.js";
|
|
6
7
|
export declare const TITLE_SIZES: readonly [{
|
|
7
8
|
readonly value: "para";
|
|
@@ -41,11 +42,14 @@ interface Props {
|
|
|
41
42
|
wheels?: WheelSummary[];
|
|
42
43
|
source?: CategorySourceValue;
|
|
43
44
|
catalog?: ProductSummary[];
|
|
45
|
+
firstCountInChips?: boolean;
|
|
44
46
|
kinds?: string[];
|
|
45
47
|
columns?: number;
|
|
46
48
|
columnsPhone?: unknown;
|
|
47
49
|
columnsTablet?: unknown;
|
|
48
50
|
limit?: number;
|
|
51
|
+
moreProducts?: MoreProducts;
|
|
52
|
+
perPage?: number;
|
|
49
53
|
editing?: boolean;
|
|
50
54
|
contentCapped?: boolean;
|
|
51
55
|
hover?: CardHoverDrawn;
|
|
@@ -53,5 +57,5 @@ interface Props {
|
|
|
53
57
|
ownerId?: string;
|
|
54
58
|
template?: SlotComponent;
|
|
55
59
|
}
|
|
56
|
-
export default function ProductGridSection({ num, catalog, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit, editing, contentCapped, hover, fieldUsage, ownerId, template, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
|
|
60
|
+
export default function ProductGridSection({ num, catalog, firstCountInChips, kinds, title, titleSize, padTop, description, link, products: Products, wheels, source, columns, columnsPhone, columnsTablet, limit: limitProp, moreProducts, perPage, editing, contentCapped, hover, fieldUsage, ownerId, template, gap: gapProp, gapPhone, }: Props): import("react").JSX.Element | null;
|
|
57
61
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as x,Fragment as Ie}from"react/jsx-runtime";import{useScopeClass as _e}from"../lib/use-scope-class.js";import{useEffect as T,useMemo as p,useState as He}from"react";import{cardHoverOf as Pe}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as Be}from"efficient-web-builder/format/lib/content/container-gap";import Oe from"next/link";import{cardRowsGrid as Re,GridCardProvider as Ae,GridCards as Ge,gridIndexCss as ke}from"./GridCardTemplate.js";import{gridClassImageSizes as Fe}from"../lib/sections/card-image-sizes.js";import{fillRowCss as Ue}from"../lib/sections/fill-row.js";import{hiddenCardsRule as je,noHoleBands as J,noHoleCss as Q,showsASetCard as ee}from"../lib/sections/grid-no-hole.js";import{setIsWide as We,summarySetBuild as De}from"../lib/wheels/set-mode.js";import{answersForKind as re,NO_FIELD_ANSWERS as Ke}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as Xe}from"./ProductCardEyebrow.js";import Ze from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as qe,centredCap as Ve}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as Ye,SectionWheelsProvider as Je}from"./ProductRef.js";import{useCurrency as Qe}from"./CurrencyContext.js";import{COLLECTION_ATTR as er,useCatalogFilter as rr}from"./catalog/CatalogFilterContext.js";import tr from"./SectionBand.js";import{useInsideBox as nr,useInsideSiteGutter as sr}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as ir}from"../lib/sections/product-grid-columns.js";import{renderGold as k,renderHeadline as ar}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as or}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as lr}from"../lib/wheels/wheel-summary-casing.js";import dr from"./TyreSummaryCard.js";import{itemKind as F,plpKindNoun as mr}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as cr,gridKindsOf as pr,gridRowsOf as ur}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as gr}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as fr}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as hr}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as xr}from"../lib/wheels/lug-count.js";import{diametersOf as wr}from"../lib/wheels/size-range.js";import{say as vr}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as yr}from"../lib/sections/product-grid-title.js";const br=Pe({},"ProductGrid"),s={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},te=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${s.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium1} ${s.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium2} ${s.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium3} ${s.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${s.headingMedium4} ${s.headingMediumUpTo800Xl}`}];function Cr(w){return(te.find(u=>u.value===w)??te.find(u=>u.value===yr)).cls}function Sr({num:w,catalog:u,kinds:z,title:E,titleSize:ne,padTop:U,description:b,link:v,products:se,wheels:ie,source:m,columns:ae,columnsPhone:oe,columnsTablet:le,limit:i,editing:g,contentCapped:de=!1,hover:me,fieldUsage:f,ownerId:ce="",template:pe,gap:ue,gapPhone:ge}){const L=p(()=>f?re(f,"alloy-wheel"):void 0,[f]),fe=p(()=>f?re(f,"tyre"):void 0,[f]),e=_e("pg"),d=ir(ae,oe,le),j=typeof i=="number"&&i>0,W=de,he=sr(),xe=nr(),we=he||xe,D=gr(g===!0&&!!m),o=p(()=>m?lr(ur(m,z,D??u??[])):null,[u,D,m,z]),c=cr(m),h=c!==null,{filters:C,reportCount:I,reportLugs:_,reportSizes:H,reportFinishes:P,reportCategories:B,vehicle:K}=rr(),{currency:O}=Qe(),R=h&&!!C.process&&C.process!==c,t=p(()=>o?h?or(o,C,O,K.fit):o:null,[o,h,C,O,K.fit]);T(()=>(B(e,c===null?[]:[c]),()=>B(e,[])),[c,B,e]),T(()=>{if(h)return I(e,R?0:t?.length??0),()=>I(e,0)},[h,R,t,I,e]);const S=p(()=>({lugs:xr(o??[]),sizes:wr(o??[]),finishes:hr(o??[])}),[o]);T(()=>(_(e,S.lugs),H(e,S.sizes),P(e,S.finishes),()=>{_(e,[]),H(e,[]),P(e,[])}),[S,_,H,P,e]);const A=Be("ProductGrid",ue,"both",ge),ve=`${e} grid${A.className} bg-[var(--catalog-grid-bg)] ${d}`,X=Re(A),ye=`${e} grid${X.className} bg-[var(--catalog-grid-bg)] ${d}`,be=X.style,Ce=p(()=>{const n=(t??[]).filter(l=>F(l)!=="tyre");if(n.length===0)return!1;const a=n.some(l=>!!l.process);return n.some(l=>!!l.setWords)||Xe({kind:!1,brand:!1,process:a},L??[])},[t,L]),Se=t?t.length>0?r("div",{className:ye,style:be,children:t.map((n,a)=>F(n)==="tyre"?r(dr,{item:n,currency:O,editing:g,fieldUsage:fe},`tyre:${n.slug}-${a}`):r(Ge,{wheels:[n],children:y=>y},`${n.slug}-${a}`))}):g?r("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:r("span",{className:`font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:vr("No products in “{name}” yet",{name:m?.name??""})})}):null:r(se,{className:ve,style:A.style,minEmptyHeight:320}),$=t?t.length:null,Z=mr(pr(m,z)),$e=w||E||b||v?x("div",{className:`${fr} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${W||we?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[x("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[w&&r("span",{className:`font-mono ${s.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:k(w)}),E&&r("h2",{className:`${Cr(ne)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:ar(E,!1)})]}),(b||v||$!==null)&&x("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[b&&r("span",{className:`max-w-[340px] truncate font-display ${s.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:k(b)}),v&&x(Oe,{href:v.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${s.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[k(v.text),r("span",{"aria-hidden":!0,children:"→"})]}),$!==null&&x("span",{className:`whitespace-nowrap font-mono ${s.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[$," ",$===1?Z.one:Z.many]})]})]}):null,Me=typeof U=="number"?{"--pg-pt":`${U}px`}:{},M=p(()=>{if(!t)return null;const n=t.map(a=>F(a)!=="tyre"&&We(De(a))?2:1);return ee(n,i)?J(d,n,i):null},[t,d,i]),[Ne,Te]=He("");T(()=>{if(t)return;const n=document.querySelector(`.${e}`);if(!n)return;const a=()=>{const l=[...n.children].map(Le=>Le.classList.contains("col-span-2")?2:1);Te(ee(l,i)?Q(e,J(d,l,i,!1),l.length):"")};a();const y=new MutationObserver(a);return y.observe(n,{childList:!0}),()=>y.disconnect()},[t,e,d,i]);const ze=M?M[0].tracks:t?j?Math.min(t.length,i):t.length:void 0,N=M?Q(e,M,t.length):Ne,q=N?"":Ue(e,d,{limit:i,cards:t?.length}),V=ke(e),Y=x(Ie,{children:[j&&!N&&r("style",{children:je(e,i+1)}),N&&r("style",{children:N}),q&&r("style",{children:q}),V&&r("style",{children:V}),$e,Se,r(Ze,{editing:g})]});if(R)return null;const G=r(tr,{attrs:h&&c!==null?{[er]:c}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Me,defaults:{"--pg-pt":"120px"},children:W?r("div",{style:Ve(qe),children:Y}):Y}),Ee=o?G:g?r(Ye,{children:G}):r(Je,{wheels:ie,children:G});return r(Ae,{value:{ownerId:ce,Template:pe,hover:me??br,imageSizes:Fe(d,ze),fieldUsage:L??Ke,reserveEyebrow:Ce,editing:g===!0},children:Ee})}export{te as TITLE_SIZES,Sr as default};
|
|
1
|
+
"use client";import{jsx as t,jsxs as f,Fragment as tt}from"react/jsx-runtime";import{useScopeClass as rt}from"../lib/use-scope-class.js";import{useEffect as A,useMemo as u,useState as me}from"react";import{cardHoverOf as nt}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as it}from"efficient-web-builder/format/lib/content/container-gap";import st from"next/link";import{cardRowsGrid as ot,GridCardProvider as at,GridCards as lt,gridIndexCss as mt}from"./GridCardTemplate.js";import{gridClassImageSizes as dt}from"../lib/sections/card-image-sizes.js";import{fillRowCss as de}from"../lib/sections/fill-row.js";import{hiddenCardsRule as ce,noHoleBands as pe,noHoleCss as ue,ONE_WHEEL_MARK as ct,oneWheelScope as ge,pairScope as pt,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as ut,summarySetBuild as gt}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ft}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as ht}from"./ProductCardEyebrow.js";import xt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as wt,centredCap as vt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as yt,SectionWheelsProvider as bt}from"./ProductRef.js";import{useCurrency as St}from"./CurrencyContext.js";import{COLLECTION_ATTR as Ct,useCatalogFilter as Mt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Nt}from"./catalog/ShopperScope.js";import Et from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as Tt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as zt,hasActivePlpFilters as Pt}from"../lib/wheels/plp-filters.js";import Lt from"./catalog/ClearAllButton.js";import{gridPagingOf as It,gridShownOf as _t}from"../lib/sections/product-grid-pages.js";import Ot from"./SectionBand.js";import{useInsideBox as At,useInsideSiteGutter as Ht}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Bt}from"../lib/sections/product-grid-columns.js";import{renderGold as V,renderHeadline as Rt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as Gt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as kt}from"../lib/wheels/wheel-summary-casing.js";import Ft from"./TyreSummaryCard.js";import{itemKind as Y,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Wt,gridKindsOf as we,gridRowsOf as jt}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Ut}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Kt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Xt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Dt}from"../lib/wheels/lug-count.js";import{diametersOf as Zt}from"../lib/wheels/size-range.js";import{say as qt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Vt}from"../lib/sections/product-grid-title.js";const Yt=nt({},"ProductGrid"),i={headingMediumUpTo800Xs:"max-view-wide:text-[length:var(--size-headingMedium,28px)]",headingMediumUpTo800Small:"max-view-wide:text-[length:var(--size-headingMedium,32px)]",headingMediumUpTo800Large:"max-view-wide:text-[length:var(--size-headingMedium,36px)]",headingMediumUpTo800Xl:"max-view-wide:text-[length:var(--size-headingMedium,40px)]",body:"text-[length:var(--size-body,13px)]",headingMedium1:"text-[length:var(--size-headingMedium,40px)]",headingMedium2:"text-[length:var(--size-headingMedium,48px)]",headingMedium3:"text-[length:var(--size-headingMedium,56px)]",headingMedium4:"text-[length:var(--size-headingMedium,64px)]",labelSmall:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"},ve=[{value:"para",label:"Paragraph size — 13px",cls:`font-mono font-normal uppercase tracking-[0.22em] ${i.labelLarge}`},{value:"sm",label:"Small — 40px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium1} ${i.headingMediumUpTo800Xs}`},{value:"md",label:"Medium — 48px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium2} ${i.headingMediumUpTo800Small}`},{value:"lg",label:"Large — 56px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium3} ${i.headingMediumUpTo800Large}`},{value:"xl",label:"Extra large — 64px",cls:`font-heading2 font-medium tracking-[-0.03em] ${i.headingMedium4} ${i.headingMediumUpTo800Xl}`}];function Jt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Vt)).cls}function Qt({num:M,catalog:h,firstCountInChips:ye=!1,kinds:T,title:H,titleSize:be,padTop:J,description:z,link:$,products:Se,wheels:Ce,source:p,columns:Me,columnsPhone:$e,columnsTablet:Ne,limit:Ee,moreProducts:Te,perPage:ze,editing:x,contentCapped:Pe=!1,hover:Le,fieldUsage:w,ownerId:Ie="",template:_e,gap:Oe,gapPhone:Ae}){const B=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),He=u(()=>w?he(w,"tyre"):void 0,[w]),e=rt("pg"),{paged:v,per:y,limit:l,cap:N}=It({moreProducts:Te,perPage:ze,limit:Ee}),d=Bt(Me,$e,Ne),Q=Pe,Be=Ht(),Re=At(),Ge=Be||Re,ee=Ut(x===!0&&!!p),o=u(()=>p?kt(jt(p,T,ee??h??[])):null,[h,ee,p,T]),R=Nt("grid",o),a=o?R.scope:null,g=Wt(p),b=g!==null&&!a,{filters:P,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Mt(),{currency:S}=St(),U=b&&!!P.process&&P.process!==g,K=a?.state,n=u(()=>o?K?zt(o,K,S):b?Gt(o,P,S,te.fit):o:null,[o,K,b,P,S,te.fit]),[ke,Fe]=me(1),X=v&&n?Math.max(1,Math.ceil(n.length/y)):1,C=Math.min(X,Math.max(1,a?a.state.page:ke)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(_t(n.length,{paged:v,per:y,cap:N},C))},[re,n,D,v,C,y,N]);const We=r=>a?a.update({page:r}):Fe(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);A(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),A(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const L=u(()=>({lugs:Dt(o??[]),sizes:Zt(o??[]),finishes:Xt(o??[])}),[o]);A(()=>(k(e,L.lugs),F(e,L.sizes),W(e,L.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[L,k,F,W,e]);const Z=it("ProductGrid",Oe,"both",Ae),je=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${d}`,ne=ot(Z),Ue=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${d}`,Ke=ne.style,Xe=u(()=>{const r=(n??[]).filter(c=>Y(c)!=="tyre");if(r.length===0)return!1;const m=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||ht({kind:!1,brand:!1,process:m},B??[])},[n,B]),De=s?s.length>0?t("div",{className:Ue,style:Ke,children:s.map((r,m)=>Y(r)==="tyre"?t(Ft,{item:r,currency:S,editing:x,fieldUsage:He},`tyre:${r.slug}-${m}`):t(lt,{wheels:[r],children:E=>E},`${r.slug}-${m}`))}):a&&Pt(a.state)?f("div",{className:"flex min-h-[320px] flex-col items-center justify-center gap-4 bg-surface-2 p-4 text-center",children:[t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:`No ${xe(we(p,T)).many} match those filters`}),t(Lt,{onClick:a.clear})]}):x?t("div",{className:"flex min-h-[320px] items-center justify-center rounded bg-surface-2 p-4 text-center",children:t("span",{className:`font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:qt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Se,{className:je,style:Z.style,minEmptyHeight:320}),Ze=a?a.countInChips:ye,I=n&&!Ze?n.length:null,ie=xe(we(p,T)),qe=M||H||z||$?f("div",{className:`${Kt} sticky top-[var(--sf-header-h,88px)] z-30 mb-5 flex items-center justify-between gap-4 max-view-wide:flex-wrap max-view-wide:gap-y-2 border-b border-line bg-bg/95 py-3 backdrop-blur-md ${Q||Ge?"":"-mx-[var(--sf-site-gutter,40px)] px-[var(--sf-site-gutter,40px)] max-view-wide:-mx-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]"}`,children:[f("div",{className:"flex min-w-0 items-end gap-6 max-view-wide:flex-col max-view-wide:items-stretch max-view-wide:gap-3",children:[M&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:V(M)}),H&&t("h2",{className:`${Jt(be)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Rt(H,!1)})]}),(z||$||I!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[z&&t("span",{className:`max-w-[340px] truncate font-display ${i.body} leading-[1.4] text-fg-dim max-view-wide:hidden view-wide:w-0 view-wide:grow view-wide:text-right`,children:V(z)}),$&&f(st,{href:$.href,className:`inline-flex items-center gap-2 whitespace-nowrap font-mono ${i.labelLarge} uppercase tracking-[0.2em] text-fg-dim transition-colors hover:text-fg`,children:[V($.text),t("span",{"aria-hidden":!0,children:"→"})]}),I!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[I," ",I===1?ie.one:ie.many]})]})]}):null,Ve=typeof J=="number"?{"--pg-pt":`${J}px`}:{},_=u(()=>{if(!s)return null;const r=s.map(m=>Y(m)!=="tyre"&&ut(gt(m))?2:1);return fe(r,l)?pe(d,r,l):null},[s,d,l]),[Ye,Je]=me("");A(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const m=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(ct)?2:1);Je(fe(c,l)?ue(e,pe(d,c,l,!1),c.length):"")};m();const E=new MutationObserver(m);return E.observe(r,{childList:!0}),()=>E.disconnect()},[s,e,d,l]);const Qe=_?_[0].tracks:s?N?Math.min(s.length,l):s.length:void 0,O=_?ue(pt(e),_,s.length)+(N?ce(ge(e),l+1):"")+de(ge(e),d,{limit:l,cards:s.length}):Ye,se=O?"":de(e,d,{limit:l,cards:s?.length}),oe=mt(e),ae=f(tt,{children:[N&&!O&&t("style",{children:ce(e,l+1)}),O&&t("style",{children:O}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),qe,De,v&&X>1&&t(Et,{textSize:Tt.labelSmall,page:C,pageCount:X,onPage:We}),t(xt,{editing:x})]});if(U)return null;const q=t(Ot,{rootRef:R.ref,attrs:b&&g!==null?{[Ct]:g}:void 0,className:"relative z-[2] bg-bg px-[var(--sf-site-gutter,40px)] pt-[var(--pg-pt)] pb-[120px] max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))] max-view-wide:pt-[70px] max-view-wide:pb-[70px]",column:null,inAnyBox:!0,style:Ve,defaults:{"--pg-pt":"120px"},children:Q?t("div",{style:vt(wt),children:ae}):ae}),et=o?q:x?t(yt,{currency:S,children:q}):t(bt,{wheels:Ce,currency:S,children:q});return t(at,{value:{ownerId:Ie,Template:_e,hover:Le??Yt,imageSizes:dt(d,Qe),fieldUsage:B??ft,reserveEyebrow:Xe,editing:x===!0},children:et})}export{ve as TITLE_SIZES,Qt as default};
|