efficient-storefront-blocks 0.92.0 → 0.94.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/chunks/{EditorPreviewCheckout-VHPWPS3N.js → EditorPreviewCheckout-OPDSFBJH.js} +1 -1
  3. package/dist/chunks/{SiteEditorProvider-C4HT4BT4.js → SiteEditorProvider-ZP6NAWYT.js} +1 -1
  4. package/dist/chunks/{chunk-RAOSZKA3.js → chunk-ATCBSW73.js} +1 -1
  5. package/dist/chunks/{chunk-7L5DVQZ4.js → chunk-CEFKTE5A.js} +1 -1
  6. package/dist/chunks/chunk-JKJ76CRT.js +388 -0
  7. package/dist/chunks/chunk-JTDOMQMQ.js +1 -0
  8. package/dist/chunks/{fitment-data-URJZ24LU.js → fitment-data-IPAMN5IH.js} +1 -1
  9. package/dist/editor/components/GalleryPicturesSource.d.ts +4 -16
  10. package/dist/editor/components/GalleryPicturesSource.js +1 -1
  11. package/dist/editor/components/GalleryProductBinding.js +1 -1
  12. package/dist/editor/components/GalleryShowcaseSource.js +1 -1
  13. package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/commerce/ProductPicture/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/index.d.ts +1 -1
  16. package/dist/editor/lib/storefront-document.js +1 -1
  17. package/dist/editor/lib/storefront-editor-words-kept.js +1 -1
  18. package/dist/editor/lib/storefront-editor-words.d.ts +4 -7
  19. package/dist/editor/lib/storefront-editor-words.js +1 -1
  20. package/dist/index.js +74 -80
  21. package/dist/links.js +1 -1
  22. package/dist/render/app/globals.css +42 -3
  23. package/dist/render/built-with.json +1 -1
  24. package/dist/render/components/DefaultProductHero.d.ts +12 -0
  25. package/dist/render/components/DefaultProductHero.js +1 -0
  26. package/dist/render/components/GridCardTemplate.d.ts +10 -6
  27. package/dist/render/components/GridCardTemplate.js +1 -1
  28. package/dist/render/components/ProductGridSection.js +1 -1
  29. package/dist/render/components/ProductHeroPanel.d.ts +2 -1
  30. package/dist/render/components/ProductHeroPanel.js +1 -1
  31. package/dist/render/components/PublishedFooter.js +1 -1
  32. package/dist/render/components/PublishedHeader.js +1 -1
  33. package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
  34. package/dist/render/components/card-pieces/CardName.js +1 -1
  35. package/dist/render/components/card-pieces/CardProductPicture.d.ts +3 -0
  36. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  37. package/dist/render/components/card-pieces/CardSizes.d.ts +10 -2
  38. package/dist/render/components/card-pieces/CardSizes.js +1 -1
  39. package/dist/render/components/card-pieces/CardSpecs.d.ts +2 -0
  40. package/dist/render/components/card-pieces/CardSpecs.js +1 -1
  41. package/dist/render/components/card-pieces/ProductCardState.d.ts +14 -4
  42. package/dist/render/components/card-pieces/ProductCardState.js +1 -1
  43. package/dist/render/components/catalog/ShopperChips.js +1 -1
  44. package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
  45. package/dist/render/components/useProductCatalog.d.ts +1 -0
  46. package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +1 -1
  47. package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
  48. package/dist/render/lib/api/types.d.ts +1 -0
  49. package/dist/render/lib/content/hero-option-seed.d.ts +28 -0
  50. package/dist/render/lib/content/hero-option-seed.js +1 -0
  51. package/dist/render/lib/content/product-card-seed.d.ts +12 -0
  52. package/dist/render/lib/content/product-card-seed.js +1 -1
  53. package/dist/render/lib/document/blocks/commerce/ProductEyebrow/render.js +1 -1
  54. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +4 -0
  55. package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
  56. package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
  57. package/dist/render/lib/document/blocks/commerce/ProductPicture/render.js +1 -1
  58. package/dist/render/lib/document/blocks/commerce/ProductSpecs/render.js +1 -1
  59. package/dist/render/lib/document/blocks/service/SiteHeader/render.js +1 -1
  60. package/dist/render/lib/document/card-templates.js +1 -1
  61. package/dist/render/lib/document/published-header-bar.d.ts +10 -0
  62. package/dist/render/lib/document/published-header-bar.js +1 -0
  63. package/dist/render/lib/document/section-to-box-rows-service.js +1 -1
  64. package/dist/render/lib/logo/surface-is-light.js +1 -1
  65. package/dist/render/lib/sections/card-tone.d.ts +9 -0
  66. package/dist/render/lib/sections/card-tone.js +1 -0
  67. package/dist/render/lib/sections/filter-option-rows.d.ts +14 -0
  68. package/dist/render/lib/sections/filter-option-rows.js +1 -1
  69. package/dist/render/lib/sections/product-pictures.d.ts +3 -0
  70. package/dist/render/lib/sections/product-pictures.js +1 -1
  71. package/dist/render/lib/wheels/plp-hydrate.d.ts +4 -1
  72. package/dist/render/lib/wheels/plp-hydrate.js +1 -1
  73. package/dist/words.d.ts +19 -7
  74. package/dist/words.js +5 -5
  75. package/package.json +4 -4
  76. package/dist/chunks/chunk-PW7BA4ZJ.js +0 -1
  77. package/dist/chunks/chunk-S2WLJ6H2.js +0 -388
  78. package/dist/render/components/TyrePlpCard.d.ts +0 -20
  79. package/dist/render/components/TyrePlpCard.js +0 -1
  80. package/dist/render/components/TyreSummaryCard.d.ts +0 -12
  81. package/dist/render/components/TyreSummaryCard.js +0 -1
  82. package/dist/render/lib/document/published-chrome-data.d.ts +0 -2
  83. package/dist/render/lib/document/published-chrome-data.js +0 -1
  84. /package/dist/chunks/{chunk-S2WLJ6H2.js.LEGAL.txt → chunk-JKJ76CRT.js.LEGAL.txt} +0 -0
  85. /package/dist/chunks/{chunk-JB6ISWYA.js → chunk-LRLOANKA.js} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
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 ue=["main","text","background","muted"],en=[...ue,"surface"];var nn={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 ce=[{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}],pe=["highlight","quiet"],tn=ce.map(e=>e.style).filter(e=>F.some(n=>n.kind===e)).filter(e=>!pe.includes(e)),rn=[...F,{open:"*",close:"*",kind:"accent"}],on=[...F,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||sn.includes(n[1].toLowerCase())}var de=["width","profile","rim"];var ln=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,an={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let n=ln.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return de.every(o=>{let[i,a]=an[o];return t[o]>=i&&t[o]<=a})?t:null}function _(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 fe(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],me=["alloy-wheel"],R={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var yt=k.map(e=>({value:e,label:R[e]}));function O(e){return e==null?[...me]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...me]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function ge(e){return m(e).prices??void 0}function he(e){return m(e).inStock!==!1}function ye(e){let n=m(e),t=d(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function Pe(e){return G(e).map(n=>n.family)}function H(e){if(d(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function Se(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function be(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function xe(e){if(d(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>B(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var we=null;function Le(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=we?we[e]:void 0;if(typeof t=="function"){try{let r=Y(t(n??{}));if(r)return r}catch{}return Le(e,n)}return Le(Y(t)??e,n)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var A=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),wt=A(30,0,100,10),Lt=A(0,0,100,5),Tt=A(100,0,100,5),Ft=A(2,0,4,.5);function Te(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var Fe="homepage";var E=[{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?E:E.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function _e(e){return`${j}${e}`}function Re(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Fe?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function K(e,n){return`${P(e)}#${n}`}function D(...e){let n=new Set,t=[];for(let r of e)for(let o of r?.content??[]){let i=Te(o?.props?.anchor);if(!i)continue;let a=q(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Oe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var un=()=>({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 v(e,n,t){if(!e)return"page";if(Re(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Oe(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 Ae(e,n){let t=un(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=n?.pageOptions?n.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:D(...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:t.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:_e(u.slug),label:u.title||u.slug})),placeholder:t.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:t.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:l,rules:{kindOf:s=>v(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=n.withFilter(s,null);return n.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>v(s,i,{listingPaths:n.listingPaths,targetOf:c}),targetOf:c,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:s=>n.listingPaths.includes(s)?n.filtersFor(s):null}}var Ee=Object.freeze([]);function V(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function Ie(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[t];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 Ne(e,n,t,r){let o=new Map;for(let l of t){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=n(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 Ce(e){return pn(e,"filter")}var cn="collection";function Z(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":cn},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function pn(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ke(e,n){let t=e?.[n];return dn(t)?t:null}function De(e,n,t,r){if(t==null&&r==null)return!0;let o=Ke(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function ve(e){let n=e.spec?.lugs;return typeof n=="number"?n:null}var fn={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},cr=Object.keys(fn);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"]},mn={diameters:"tyreSizes"};function gn(e){if(e.length===0)return[];let n=X.filter(t=>e.every(r=>J[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function hn(e){let n=new Set;for(let t of e)n.add(d(t));return[...n]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Me(e,n,t,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of X){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Ue(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=ve(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!De(ge(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!he(e))}var yn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ue(e,n){switch(n){case"tyreSizes":return[...new Set(xe(e).flatMap(fe))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Pe(e);case"diameters":return ye(e).map(String);case"collections":return H(e);case"pcds":return Se(e);case"tyreTypes":return be(e);case"speedRatings":return ke(e)}}function Pn(e){let n=new Map;for(let t of e)for(let r of G(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function ze(e,n,t,r=hn(e),o=Ee,i="fail"){let a=u=>bn(u,r,o),p=Pn(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):gn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=n[u].map(String),ae=new Set,z=new Map,T=new Map;for(let f of e){let S=Ue(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(Me(f,n,t,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Je=[...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:yn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let b=kn(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ne(c,u=>u.key,s,"filterOrder")]}var Sn=1;function $e(e){return e.showCollection===!1?["collections"]:[]}function bn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ce(V(t,r))(Z(e,r)))}function kn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Ie(V(t,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var ne={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},te="type";var x="FilterBlock";function Be(e){let n=e;return!!n&&typeof n=="object"&&typeof n.type=="string"&&!!n.props&&typeof n.props=="object"}function xn(e){return Object.entries(e.props??{}).filter(n=>Array.isArray(n[1])&&n[1].length>0&&n[1].every(Be))}function wn(e){let n=e??{},t=[];Array.isArray(n.content)&&t.push(n.content);for(let r of Object.values(n.zones??{}))Array.isArray(r)&&t.push(r);return t}function We(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)if(Be(a)){n.push({node:a,order:n.length,lists:i});for(let[,p]of xn(a))t(p,i)}};for(let r of wn(e))t(r,[]);return n}function w(e){return We(e).map(n=>n.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var kr=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var He="AlloyWheelsListing";function Ye(e){return $(e.trim())}var L="/wheels",M="Products";function qe(e,n){return n>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let n of[He,x])for(let t of e){let r=w({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function je(e,n){let t=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(L)?[...t,L]:t}var ie=[te,...Object.entries(ne).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ve(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function _n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ze(e){let n=new URLSearchParams(Ve(e).query);for(let t of ie){let r=n.get(t);if(r)return{param:t,value:r}}return null}function se(e,n){let{path:t,query:r,hash:o}=Ve(e),i=r.split("&").filter(a=>a&&!ie.includes(_n(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Qe(e,n){let t=se(e,null);return n.includes(t)?t:e}function Rn(e,n,t=[]){return v(e,n,{listingPaths:t,targetOf:r=>Qe(r,t)})}function On(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 Xe="Product type",An="AUD";function le(e,n){let t=n.listing??{},r=O(t.kinds),o=e.filter(l=>r.includes(d(l))),i=$e(t),a=ze(o,ee,An,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:ne[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:te,label:Xe,values:p.map(l=>({value:l,label:R[l]}))}),a}function En(e){return n=>{let t=je(n,{fallback:e.offersCommerce}),r=n.filter(o=>U(...o.docs)).length;return{listingPaths:t,pageOptions:o=>{let i=o.map(a=>{let p=n.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:qe(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(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:se}}}function In(e){let n=En({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Ae({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ye},filtersFor:t.filtersFor??(()=>null)}}function fo(e,n){return le(e,n)}export{L as BUILT_IN_LISTING_PATH,E as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Xe as PRODUCT_TYPE_FILTER_LABEL,K as anchorPath,On as fieldUsageFromAdminRows,Rn as inferLinkKind,U as isProductListingPage,Ye as isSafeLink,I as linkKindsFor,In as linkPickerSetup,fo as listingFilterFields,oe as listingNode,qe as listingPageLabel,Qe as listingTarget,D as pageAnchors,P as pagePath,N as postPath,je as productListingPaths,Ze as readListingFilter,C as wheelPath,se 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 ue=["main","text","background","muted"],en=[...ue,"surface"];var nn={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 ce=[{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}],pe=["highlight","quiet"],tn=ce.map(e=>e.style).filter(e=>F.some(n=>n.kind===e)).filter(e=>!pe.includes(e)),rn=[...F,{open:"*",close:"*",kind:"accent"}],on=[...F,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function $(e){if(e===""||/[\s\u0000-\u001f\u007f]/.test(e))return!1;let n=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e);return!n||sn.includes(n[1].toLowerCase())}var de=["width","profile","rim"];var ln=/^\s*(\d{2,3})\s*\/\s*(\d{2,3})\s*[A-Za-z]*\s*(\d{2}(?:\.\d+)?)\s*$/,an={width:[100,500],profile:[20,100],rim:[10,30]};function B(e){let n=ln.exec(e??"");if(!n)return null;let t={width:Number(n[1]),profile:Number(n[2]),rim:Number(n[3])};return de.every(o=>{let[i,a]=an[o];return t[o]>=i&&t[o]<=a})?t:null}function _(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 fe(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],me=["alloy-wheel"],R={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var yt=k.map(e=>({value:e,label:R[e]}));function O(e){return e==null?[...me]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...me]}var m=e=>e;function d(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function W(e){return m(e).brand??""}function ge(e){return m(e).prices??void 0}function he(e){return m(e).inStock!==!1}function ye(e){let n=m(e),t=d(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function G(e){return d(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function Pe(e){return G(e).map(n=>n.family)}function H(e){if(d(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function Se(e){return d(e)==="tyre"?[]:m(e).spec?.pcds??[]}function be(e){return d(e)!=="tyre"?[]:m(e).tyreTypes??[]}function ke(e){return d(e)!=="tyre"?[]:m(e).speedRatings??[]}function xe(e){if(d(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>B(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var Y=e=>typeof e=="string"&&e?e:void 0;var we=null;function Te(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=we?we[e]:void 0;if(typeof t=="function"){try{let r=Y(t(n??{}));if(r)return r}catch{}return Te(e,n)}return Te(Y(t)??e,n)}function q(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var E=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),wt=E(30,0,100,10),Tt=E(0,0,100,5),Lt=E(100,0,100,5),Ft=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 Fe="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(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var j="#popup:";function _e(e){return`${j}${e}`}function Re(e){return e.startsWith(j)&&e.slice(j.length).trim()||null}function P(e){return e===Fe?"/":`/${e}`}function N(e){return`/journal/${e}`}function C(e){return`/wheels/${e}`}function v(e,n){return`${P(e)}#${n}`}function K(...e){let n=new Set,t=[];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||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Oe(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}var un=()=>({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,n,t){if(!e)return"page";if(Re(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Oe(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 Ee(e,n){let t=un(),r=e.pages.map(s=>({value:P(s.slug),label:s.title})),o=n?.pageOptions?n.pageOptions(r):r,i=o.map(s=>s.value),a=e.pages.map(s=>({label:s.title,options:K(...s.docs).map(u=>({value:v(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:t.choosePage};case"anchor":return{type:"groups",groups:a,placeholder:a.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:N(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:_e(u.slug),label:u.title||u.slug})),placeholder:t.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:t.sectionHint}:{},...s.value==="blog"||s.value==="product"||s.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!n)return{kinds:l,rules:{kindOf:s=>D(s,i),targetOf:s=>s,readFilter:()=>null,withFilter:s=>s}};let c=s=>{let u=n.withFilter(s,null);return n.listingPaths.includes(u)?u:s};return{kinds:l,rules:{kindOf:s=>D(s,i,{listingPaths:n.listingPaths,targetOf:c}),targetOf:c,readFilter:n.readFilter,withFilter:n.withFilter},filtersFor:s=>n.listingPaths.includes(s)?n.filtersFor(s):null}}var Ae=Object.freeze([]);function V(e,n){return e.length===0?e:e.filter(t=>t.kind===void 0||t.kind===n)}function Ie(e,n){let t=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(let o of e){let i=o[t];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 Ne(e,n,t,r){let o=new Map;for(let l of t){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=n(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 Ce(e){return pn(e,"filter")}var cn="collection";function Z(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":cn},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function pn(e,n){let t=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!t.has(r)}var Q={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function ve(e,n){let t=e?.[n];return dn(t)?t:null}function Ke(e,n,t,r){if(t==null&&r==null)return!0;let o=ve(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function De(e){let n=e.spec?.lugs;return typeof n=="number"?n:null}var fn={recommended:"Recommended","price-asc":"Price \xB7 low to high","price-desc":"Price \xB7 high to low",new:"Newest",name:"Name A\u2013Z"},cr=Object.keys(fn);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"]},mn={diameters:"tyreSizes"};function gn(e){if(e.length===0)return[];let n=X.filter(t=>e.every(r=>J[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function hn(e){let n=new Set;for(let t of e)n.add(d(t));return[...n]}var ee={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function Me(e,n,t,r=null,o="fail"){let i=d(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":J[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of X){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!Ue(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=De(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!Ke(ge(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!he(e))}var yn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function Ue(e,n){switch(n){case"tyreSizes":return[...new Set(xe(e).flatMap(fe))];case"brands":return W(e)?[W(e)]:[];case"finishes":return Pe(e);case"diameters":return ye(e).map(String);case"collections":return H(e);case"pcds":return Se(e);case"tyreTypes":return be(e);case"speedRatings":return ke(e)}}function Pn(e){let n=new Map;for(let t of e)for(let r of G(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function ze(e,n,t,r=hn(e),o=Ae,i="fail"){let a=u=>bn(u,r,o),p=Pn(e),c=(i==="pass"?X.filter(u=>r.some(b=>J[u].includes(b))):gn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let b=n[u].map(String),ae=new Set,z=new Map,L=new Map;for(let f of e){let S=Ue(f,u);for(let g of S)ae.add(g);for(let g of new Set(S))L.set(g,(L.get(g)??0)+1);if(Me(f,n,t,u,i))for(let g of new Set(S))z.set(g,(z.get(g)??0)+1)}let Je=[...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=(L.get(S.value)??0)-(L.get(f.value)??0);return g!==0?g:f.value.localeCompare(S.value)});return{key:u,label:yn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let b=kn(u.key,r,o);b!==void 0&&s.push({fieldKey:u.key,filterOrder:b})}return[...Ne(c,u=>u.key,s,"filterOrder")]}var Sn=1;function $e(e){return e.showCollection===!1?["collections"]:[]}function bn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ce(V(t,r))(Z(e,r)))}function kn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Ie(V(t,o),"filter")(Z(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var ne={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},te="type";var x="FilterBlock";function Be(e){let n=e;return!!n&&typeof n=="object"&&typeof n.type=="string"&&!!n.props&&typeof n.props=="object"}function xn(e){return Object.entries(e.props??{}).filter(n=>Array.isArray(n[1])&&n[1].length>0&&n[1].every(Be))}function wn(e){let n=e??{},t=[];Array.isArray(n.content)&&t.push(n.content);for(let r of Object.values(n.zones??{}))Array.isArray(r)&&t.push(r);return t}function We(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)if(Be(a)){n.push({node:a,order:n.length,lists:i});for(let[,p]of xn(a))t(p,i)}};for(let r of wn(e))t(r,[]);return n}function w(e){return We(e).map(n=>n.node)}var re={vehicle:"My Car",process:"Process",size:"Size",lugs:"Lugs",finish:"Finish",price:"Price"};var kr=[{value:"inStock",label:Q.inStock},{value:"category",label:"Category"},{value:"lugs",label:re.lugs},{value:"price",label:re.price}];var He="AlloyWheelsListing";function Ye(e){return $(e.trim())}var T="/wheels",M="Products";function qe(e,n){return n>1?`${M} \xB7 ${e}`:M}function oe(...e){for(let n of[He,x])for(let t of e){let r=w({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function U(...e){return oe(...e)!==null}function je(e,n){let t=e.filter(r=>U(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(T)?[...t,T]:t}var ie=[te,...Object.entries(ne).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function Ve(e){let n=e.indexOf("#"),t=n===-1?"":e.slice(n),r=n===-1?e:e.slice(0,n),o=r.indexOf("?");return{path:o===-1?r:r.slice(0,o),query:o===-1?"":r.slice(o+1),hash:t}}function _n(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}}function Ze(e){let n=new URLSearchParams(Ve(e).query);for(let t of ie){let r=n.get(t);if(r)return{param:t,value:r}}return null}function se(e,n){let{path:t,query:r,hash:o}=Ve(e),i=r.split("&").filter(a=>a&&!ie.includes(_n(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Qe(e,n){let t=se(e,null);return n.includes(t)?t:e}function Rn(e,n,t=[]){return D(e,n,{listingPaths:t,targetOf:r=>Qe(r,t)})}function On(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 Xe="Product type",En="AUD";function le(e,n){let t=n.listing??{},r=O(t.kinds),o=e.filter(l=>r.includes(d(l))),i=$e(t),a=ze(o,ee,En,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:ne[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:te,label:Xe,values:p.map(l=>({value:l,label:R[l]}))}),a}function An(e){return n=>{let t=je(n,{fallback:e.offersCommerce}),r=n.filter(o=>U(...o.docs)).length;return{listingPaths:t,pageOptions:o=>{let i=o.map(a=>{let p=n.find(l=>P(l.slug)===a.value);return p&&U(...p.docs)?{...a,label:qe(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===T)&&i.push({value:T,label:M}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return le(e.catalogue,{listing:i?oe(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:se}}}function In(e){let n=An({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Ee({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:C(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ye},filtersFor:t.filtersFor??(()=>null)}}function fo(e,n){return le(e,n)}export{T as BUILT_IN_LISTING_PATH,A as LINK_KINDS,ie as LISTING_FILTER_PARAMS,M as LISTING_PAGE_LABEL,Xe as PRODUCT_TYPE_FILTER_LABEL,v as anchorPath,On as fieldUsageFromAdminRows,Rn as inferLinkKind,U as isProductListingPage,Ye as isSafeLink,I as linkKindsFor,In as linkPickerSetup,fo as listingFilterFields,oe as listingNode,qe as listingPageLabel,Qe as listingTarget,K as pageAnchors,P as pagePath,N as postPath,je as productListingPaths,Ze as readListingFilter,C as wheelPath,se as withListingFilter};
@@ -119,9 +119,12 @@
119
119
  /* Its mirror: foreground text that sits over a LIGHT surface and must stay
120
120
  near-black in BOTH themes. Same contract as --overlay-fg above — declared
121
121
  once here and deliberately NOT overridden in the [data-theme="light"] block
122
- below. Its one consumer is the site header's "Text colour at the top =
122
+ below. Its two consumers: the site header's "Text colour at the top =
123
123
  Dark" override, which is a merchant saying "the thing under my nav is
124
- light" about a page in either theme, so it cannot be var(--fg). The value
124
+ light" about a page in either theme, so it cannot be var(--fg); and a
125
+ Box filled from its card row with a light colour (efficient-web-builder
126
+ `ON_LIGHT_INK`, `rowFillInkStyle`), whose words must be dark whatever the
127
+ theme. The value
125
128
  is the same near-black the deleted light surface class used to paint. */
126
129
  --overlay-fg-on-light: #0a0a0a;
127
130
  /* Alert / destructive accent — a muted terracotta. Used for inline
@@ -1545,21 +1548,32 @@ body:has([data-page-width="full"]) footer {
1545
1548
  tablet. The stop is the header stop above plus the distance; a node that
1546
1549
  stops at the screen top (the Scroll-Over intro) sets `--sf-pin-header: 0px`
1547
1550
  on itself. The widths are the tablet and phone blocks' of `.sf-section-stick`
1548
- below. scripts/test-pin-header-var.ts §4. */
1551
+ below. scripts/test-pin-header-var.ts §4.
1552
+ The track form (a section pinned for its Screens) reads `--motion-pin-on`
1553
+ and `--motion-pin-length` the same way, from `--sf-pin-on` and
1554
+ `--sf-pin-length`. No default is written here: an unwritten one makes the
1555
+ shell's variable invalid, so the shell's own default holds (on, 2 screens).
1556
+ §5. */
1549
1557
  [data-motion-pin] {
1550
1558
  --motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance, 0px));
1551
1559
  --motion-pin-position: var(--sf-pin-position, sticky);
1560
+ --motion-pin-on: var(--sf-pin-on);
1561
+ --motion-pin-length: var(--sf-pin-length);
1552
1562
  }
1553
1563
  @media (min-width: 720px) and (max-width: 1099.98px) {
1554
1564
  [data-motion-pin] {
1555
1565
  --motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance-tablet, var(--sf-pin-distance, 0px)));
1556
1566
  --motion-pin-position: var(--sf-pin-position-tablet, var(--sf-pin-position, sticky));
1567
+ --motion-pin-on: var(--sf-pin-on-tablet, var(--sf-pin-on));
1568
+ --motion-pin-length: var(--sf-pin-length-tablet, var(--sf-pin-length));
1557
1569
  }
1558
1570
  }
1559
1571
  @media not all and (min-width: 720px) {
1560
1572
  [data-motion-pin] {
1561
1573
  --motion-pin-top: calc(var(--sf-pin-header, var(--sf-header-h, 88px)) + var(--sf-pin-distance-phone, var(--sf-pin-distance, 0px)));
1562
1574
  --motion-pin-position: var(--sf-pin-position-phone, var(--sf-pin-position, sticky));
1575
+ --motion-pin-on: var(--sf-pin-on-phone, var(--sf-pin-on));
1576
+ --motion-pin-length: var(--sf-pin-length-phone, var(--sf-pin-length));
1563
1577
  }
1564
1578
  }
1565
1579
 
@@ -3736,3 +3750,28 @@ em.text-accent {
3736
3750
  scroll-behavior: auto !important;
3737
3751
  }
3738
3752
  }
3753
+
3754
+ /* THE PRODUCT HERO'S OPTION LINES. Each option of the hero's questions is one
3755
+ copy of its option template (lib/content/hero-option-seed: a Box frame, a
3756
+ swatch Box, Texts), marked `data-sf-repeat="<id>:optionTemplate"` by the
3757
+ Card list. The picked look (main frame, outline, bar, wash) and the hover
3758
+ frame are efficient-web-builder's, drawn on the copy (card-state, the
3759
+ owner's ruling 2026-11-09: one picked look from the theme main). The frame
3760
+ Box stores only its line WIDTH; the two line colours it does not store are
3761
+ set here:
3762
+ the frame a 2 px line in the muted ink at half strength;
3763
+ the dot its 1 px line in the frame's muted ink (the dot's swatch fill
3764
+ sets its own section colours, so its own --fg-dim differs).
3765
+ Each rule sets `border-color` itself: the Box's border rules stay the only
3766
+ readers of --sf-border-*. The selectors follow the builder's copy markup
3767
+ (a copy > its div > the frame Box); scripts/test-hero-option-rows-on-card-list
3768
+ fails if that markup moves. Follow-up (storefront sections owner, by
3769
+ 2026-12-18): the frame's two colours become its own settings, and these
3770
+ rules go. */
3771
+ [data-sf-repeat$=":optionTemplate"] > div > .sf-section-border-self {
3772
+ border-color: color-mix(in oklab, var(--fg-dim) 50%, transparent);
3773
+ --sf-hero-option-dot: var(--fg-dim);
3774
+ }
3775
+ [data-sf-repeat$=":optionTemplate"] .sf-section-border-self .sf-section-border-self {
3776
+ border-color: var(--sf-hero-option-dot);
3777
+ }
@@ -1,3 +1,3 @@
1
1
  {
2
- "efficient-web-builder": "59.3.0"
2
+ "efficient-web-builder": "62.0.0"
3
3
  }
@@ -0,0 +1,12 @@
1
+ import type { ProductSelection } from "./useProductSelection.js";
2
+ import type { WheelSummary } from "../lib/api/index.js";
3
+ import type { StoreProduct } from "../lib/catalog/store-product.js";
4
+ export declare const DEFAULT_PRODUCT_HERO_ID = "ProductHero-default";
5
+ export declare function defaultProductHeroData(id?: string): unknown;
6
+ export default function DefaultProductHero({ product, selection, onLightbox, relatedWheels, id, }: {
7
+ product: StoreProduct;
8
+ selection: ProductSelection;
9
+ onLightbox: (src: string, alt: string) => void;
10
+ relatedWheels?: WheelSummary[];
11
+ id?: string;
12
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{useMemo as d}from"react";import s from"efficient-web-builder/render/lib/document/page-render";import{PRODUCT_RECORD_TYPE as u}from"efficient-web-builder/format/lib/content/record-types";import{CurrentRecordProvider as m}from"../lib/document/current-record.js";import{renderConfig as p}from"../lib/document/render-config.js";const t="ProductHero-default";function l(e=t){return{root:{props:{}},content:[{type:"ProductHero",props:{id:e}}],zones:{}}}function P({product:e,selection:n,onLightbox:f,relatedWheels:c=[],id:o=t}){const i=d(()=>l(o),[o]),a={type:u,key:e.slug,title:e.name,fields:D,value:{product:e,relatedWheels:c,fieldUsage:[],selection:n,openLightbox:f}};return r(m,{record:a,children:r(s,{config:p(),data:i})})}const D=Object.freeze({});export{t as DEFAULT_PRODUCT_HERO_ID,P as default,l as defaultProductHeroData};
@@ -1,8 +1,8 @@
1
1
  import { type CSSProperties, type ReactNode } from "react";
2
2
  import type { SlotComponent } from "efficient-easel/blocks";
3
- import { type CardHoverDrawn } from "efficient-web-builder/format/lib/animation/hover";
3
+ import { type CardHoverDrawn, type HoverMediaCover } 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 { Bundle, WheelSummary } from "../lib/api/index.js";
5
+ import type { Bundle, TyreProductSummary, WheelSummary } from "../lib/api/index.js";
6
6
  import type { VehicleFitment } from "../lib/wheels/plp-fitment-match.js";
7
7
  import { type FieldUsageAnswer } from "../lib/content/field-usage.js";
8
8
  export declare function gridIndexCss(cls: string): string;
@@ -28,6 +28,7 @@ export interface GridCardEyebrow {
28
28
  kindLabel: string | null;
29
29
  brand: boolean;
30
30
  process: boolean;
31
+ tyreBrand?: boolean;
31
32
  }
32
33
  export interface GridCardValues {
33
34
  ownerId: string;
@@ -36,6 +37,7 @@ export interface GridCardValues {
36
37
  hover: CardHoverDrawn;
37
38
  imageSizes: string;
38
39
  fieldUsage: readonly FieldUsageAnswer[];
40
+ tyreFieldUsage?: readonly FieldUsageAnswer[];
39
41
  reserveEyebrow: boolean;
40
42
  editing: boolean;
41
43
  eyebrow?: GridCardEyebrow;
@@ -50,18 +52,20 @@ export declare function GridCardProvider({ value, children }: {
50
52
  value: GridCardValues;
51
53
  children: ReactNode;
52
54
  }): import("react").JSX.Element;
53
- export declare function productCardRow(wheel: WheelSummary): SourceRow;
55
+ export declare function productCardRow(wheel: WheelSummary, finishColour?: string): SourceRow;
56
+ export declare function tyreCardRow(tyre: TyreProductSummary): SourceRow;
54
57
  export declare const bundlePagePath: (bundle: Bundle) => string;
55
58
  export declare function bundleCardRow(bundle: Bundle): SourceRow;
59
+ export declare function useCardHoverLayer(cover: HoverMediaCover, ground?: string): ReactNode;
56
60
  export declare function GridCards({ wheels, finishes, children, }: {
57
61
  wheels: readonly WheelSummary[];
58
62
  finishes?: readonly (string | undefined)[];
59
63
  children: (copies: ReactNode) => ReactNode;
60
64
  }): import("react").JSX.Element;
61
- export declare function GridMixedCards<T>({ items, isWheel, other, }: {
65
+ export declare function GridMixedCards<T>({ items, tyreOf, tyreFit, }: {
62
66
  items: readonly T[];
63
- isWheel: (item: T) => boolean;
64
- other: (item: T, at: number) => ReactNode;
67
+ tyreOf: (item: T) => TyreProductSummary | null;
68
+ tyreFit?: (tyre: TyreProductSummary) => string | null;
65
69
  }): import("react").JSX.Element;
66
70
  export declare function GridBundleCards({ bundles, children }: {
67
71
  bundles: readonly Bundle[];
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as f,Fragment as p}from"react/jsx-runtime";import _ from"next/link";import{createContext as v,useContext as y,useMemo as R}from"react";import{CardTemplateRows as m}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as I}from"efficient-web-builder/render/components/SiteGutterFrame";import{HideTaker as T}from"efficient-web-builder/render/components/ViewHideRoot";import{cardHoverOf as E}from"efficient-web-builder/format/lib/animation/hover";import{NO_FIELD_ANSWERS as O}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as G}from"../lib/sections/card-image-sizes.js";import{CardLookContext as x}from"./card-pieces/card-row.js";import{CardBuyDialog as A}from"./card-pieces/CardBuyButton.js";import{BundleCardStateProvider as N,useWheelCardState as P,WheelCardStateProvider as D}from"./card-pieces/ProductCardState.js";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as F,cardIndexCss as k}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as $}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as j}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as U,cardRowsGap as z,cardRowsGridStyle as W}from"./WheelCardFrame.js";function he(e){return F.map(({value:r})=>r==="off"?"":k(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function ge(e){return e.className.includes(j)?{className:`${e.className} ${U} ${$}`,style:{...e.style,...W(z(e))}}:e}const B={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},_e={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},H={kindLabel:null,brand:!1,process:!0},M=[],C={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:E({},"ProductGrid"),imageSizes:G,fieldUsage:O,reserveEyebrow:!1,editing:!1,eyebrow:H,fit:null,colours:M,rules:B},w=v(C);function u(){return y(w)}function ve({value:e,children:r}){const t=R(()=>({...C,...Y(e)}),[e]);return o(w.Provider,{value:t,children:r})}const Y=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function q(e){return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:""}}const S=e=>`/bundles/${e.slug}`;function K(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:S(e)}}const V="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)]",X="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",J="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",Q="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",Z="relative flex flex-1 flex-col";function b({copy:e,href:r,label:t,wide:a=!1,kit:s=!1,probes:i,arm:n}){const{editing:l}=u(),c=s?X:V,d=n?{onPointerEnter:n,onTouchStart:n,onFocusCapture:n}:{};return f(T,{as:"article",className:a?`${c} ${J}`:c,...d,children:[i,!l&&r?o(_,{href:r,"aria-label":t,className:"absolute inset-0 z-[1]"}):null,o("div",{className:l?Z:Q,children:o(I,{children:e})})]})}function ee({copy:e}){const{wheel:r,sel:t,isSet:a}=P(),{rules:s}=u();return f(p,{children:[o(b,{copy:e,href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:a,probes:t.probes,arm:s.armOnContact?t.arm:void 0}),o(A,{})]})}function re(e,r,t,a){const s=r.item;return o(D,{wheel:s,colours:t.colours,defaultFinish:a?.[r.index],editing:t.editing,children:o(x.Provider,{value:"catalog",children:o(ee,{copy:e})})})}function h({wheels:e,finishes:r,children:t}){const a=u(),{ownerId:s,ownerType:i,Template:n,editing:l}=a;return o(m,{ownerId:s,ownerType:i,Template:n,rows:e.map(q),items:e,fallback:l?o(g,{}):null,wrapCopy:(c,d)=>re(c,d,a,r),children:t})}function ye({items:e,isWheel:r,other:t}){const{Template:a}=u(),s=e.filter(r),i=n=>{let l=0;return e.map((c,d)=>r(c)?n[l++]??null:t(c,d))};return!a||(a.blockCount??0)<=0?f(p,{children:[e.map((n,l)=>r(n)?null:t(n,l)),s.length>0&&o(h,{wheels:s,children:n=>n})]}):o(h,{wheels:s,children:n=>i(n)})}function te(e,r){const t=r.item;return o(N,{bundle:t,children:o(x.Provider,{value:"catalog",children:o(b,{copy:e,href:S(t),label:t.name,kit:!0})})})}function Re({bundles:e,children:r}){const{ownerId:t,ownerType:a,Template:s,editing:i}=u();return o(m,{ownerId:t,ownerType:a,Template:s,rows:e.map(K),items:e,fallback:i?o(g,{}):null,wrapCopy:te,children:r})}function g(){return o("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:L("The card is empty. Add parts to its card template in Layers.")})}export{B as GRID_CARD_RULES,Re as GridBundleCards,ve as GridCardProvider,h as GridCards,ye as GridMixedCards,_e as LISTING_CARD_RULES,K as bundleCardRow,S as bundlePagePath,ge as cardRowsGrid,he as gridIndexCss,q as productCardRow,u as useGridCard};
1
+ "use client";import{jsx as t,jsxs as y,Fragment as g}from"react/jsx-runtime";import O from"next/link";import{createContext as A,useContext as G,useMemo as S}from"react";import{CardRowContext as D,CardTemplateRows as p,useCardRow as L}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as N}from"efficient-web-builder/render/components/SiteGutterFrame";import{HideTaker as k}from"efficient-web-builder/render/components/ViewHideRoot";import{cardHoverOf as F}from"efficient-web-builder/format/lib/animation/hover";import{pickHoverMedia as U}from"efficient-web-builder/format/lib/content/hover-media";import{PHOTO_HOST_ATTR as $}from"efficient-web-builder/format/lib/content/image-treatment";import H from"efficient-web-builder/render/components/HoverMediaLayer";import{NO_FIELD_ANSWERS as v}from"../lib/content/field-usage.js";import{CARD_IMAGE_SIZES as j}from"../lib/sections/card-image-sizes.js";import{productTone as W,productToneVaried as z,randomCardColour as b}from"../lib/sections/card-tone.js";import{CardLookContext as C}from"./card-pieces/card-row.js";import{CardBuyDialog as B}from"./card-pieces/CardBuyButton.js";import{BundleCardStateProvider as M,TyreCardStateProvider as V,useProductCardState as R,useWheelCardState as T,WheelCardStateProvider as Y,tyreCardProduct as q}from"./card-pieces/ProductCardState.js";import{tyrePagePath as K}from"../lib/tyres/tyre-page-path.js";import{say as X}from"efficient-web-builder/format/lib/editor-words";import{CARD_INDEX_OPTIONS as J,cardIndexCss as Q}from"efficient-web-builder/format/lib/sections/product-card-style";import{SHARED_ROWS_LIST_CLASS as Z}from"efficient-web-builder/render/lib/content/box-shared-columns";import{GAP_ZONE_CLASS as ee}from"efficient-web-builder/format/lib/content/container-gap";import{CARD_ROWS_GRID_CLASS as re,cardRowsGap as oe,cardRowsGridStyle as te}from"./WheelCardFrame.js";function Be(e){return J.map(({value:r})=>r==="off"?"":Q(e,r).replace(".sf-card-index::before",`.sf-card-index[data-format="${r}"]::before`)).join("")}function Me(e){return e.className.includes(ee)?{className:`${e.className} ${re} ${Z}`,style:{...e.style,...te(oe(e))}}:e}const ne={sale:!1,axleSets:!0,setTotal:!1,wasFollowsSize:!1,quoteSets:!0,showSingle:!1,armOnContact:!1},Ve={sale:!0,axleSets:!1,setTotal:!0,wasFollowsSize:!0,quoteSets:!1,showSingle:!0,armOnContact:!0},ae={kindLabel:null,brand:!1,process:!0,tyreBrand:!0},se=[],_={ownerId:"",ownerType:"ProductGrid",Template:void 0,hover:F({},"ProductGrid"),imageSizes:j,fieldUsage:v,tyreFieldUsage:v,reserveEyebrow:!1,editing:!1,eyebrow:ae,fit:null,colours:se,rules:ne},I=A(_);function f(){return G(I)}function Ye({value:e,children:r}){const o=S(()=>({..._,...ie(e)}),[e]);return t(I.Provider,{value:o,children:r})}const ie=e=>Object.fromEntries(Object.entries(e).filter(([,r])=>r!==void 0));function w(e,r){const o=e.designCode??e.slug??"";return{name:e.name??"",eyebrow:e.process??"",note:"",href:e.slug?`/wheels/${e.slug}`:"",colour:W(r),colourVaried:z(r,o),colourRandom:b(o)}}function le(e){const r=e.designCode||e.slug||"";return{name:e.name??"",eyebrow:e.brand??"",note:"",href:K(e.slug)??"",colour:"",colourVaried:"",colourRandom:b(r)}}const P=e=>`/bundles/${e.slug}`;function ce(e){return{name:e.name,eyebrow:"",note:e.subtitle??"",href:P(e),colour:"",colourVaried:"",colourRandom:""}}const de="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)]",ue="sf-card group relative flex flex-col border border-line bg-bg transition-colors hover:border-accent",me="col-span-2 max-view-wide:col-span-1 @max-[720px]:col-span-1 [&:has([data-set-picture=one])]:col-span-1",fe="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",pe="relative flex flex-1 flex-col";function x({copy:e,href:r,label:o,wide:n=!1,kit:a=!1,probes:i,arm:c,layer:u}){const{editing:l}=f(),s=a?ue:de,m=c?{onPointerEnter:c,onTouchStart:c,onFocusCapture:c}:{},d=u?{[$]:""}:{};return y(k,{as:"article",className:n?`${s} ${me}`:s,...d,...m,children:[i,!l&&r?t(O,{href:r,"aria-label":o,className:"absolute inset-0 z-[1]"}):null,t("div",{className:l?pe:fe,children:t(N,{children:e})}),u]})}const Ce="var(--card-bg)";function we(e,r=Ce){const{hover:o}=f(),n=R();if(o.kind!=="nextImage"||o.media?.cover!==e||n.kind!=="wheel")return null;const a=U(n.wheel,o.media,n.sel.finish?.name);return a?t(H,{media:a,name:n.wheel.name,cover:e,ground:r}):null}function xe({children:e}){const r=L(),{wheel:o,sel:n}=T(),a=n.finish?.color,i=S(()=>r?{...r,row:w(o,a)}:null,[r,o,a]);return i?t(D.Provider,{value:i,children:e}):t(g,{children:e})}function he({copy:e}){const{wheel:r,sel:o,isSet:n}=T(),{rules:a}=f(),i=we("card");return y(g,{children:[t(x,{copy:t(xe,{children:e}),href:r.slug?`/wheels/${r.slug}`:"",label:r.name,wide:n,probes:o.probes,arm:a.armOnContact?o.arm:void 0,layer:i}),t(B,{})]})}function E(e,r,o,n){const a=r.item;return t(Y,{wheel:a,colours:o.colours,defaultFinish:n?.[r.index],editing:o.editing,children:t(C.Provider,{value:"catalog",children:t(he,{copy:e})})})}function qe({wheels:e,finishes:r,children:o}){const n=f(),{ownerId:a,ownerType:i,Template:c,editing:u}=n;return t(p,{ownerId:a,ownerType:i,Template:c,rows:e.map(l=>w(l)),items:e,fallback:u?t(h,{}):null,wrapCopy:(l,s)=>E(l,s,n,r),children:o})}function Ke({items:e,tyreOf:r,tyreFit:o}){const n=f(),{ownerId:a,ownerType:i,Template:c,editing:u}=n,l=e.map(s=>r(s));return t(p,{ownerId:a,ownerType:i,Template:c,rows:e.map((s,m)=>{const d=l[m];return d?le(d):w(s)}),items:e,fallback:u?t(h,{}):null,wrapCopy:(s,m)=>{const d=l[m.index];return d?ge(s,q(d,o?.(d)??null),u):E(s,m,n)},children:s=>s})}function ye({copy:e}){const r=R();if(r.kind!=="tyre")throw new Error("A tyre card surface was drawn outside its tyre state.");return t(x,{copy:e,href:r.pagePath??"",label:r.tyre.name,arm:r.arm})}function ge(e,r,o){return t(V,{tyre:r,editing:o,children:t(C.Provider,{value:"catalog",children:t(ye,{copy:e})})})}function Se(e,r){const o=r.item;return t(M,{bundle:o,children:t(C.Provider,{value:"catalog",children:t(x,{copy:e,href:P(o),label:o.name,kit:!0})})})}function Xe({bundles:e,children:r}){const{ownerId:o,ownerType:n,Template:a,editing:i}=f();return t(p,{ownerId:o,ownerType:n,Template:a,rows:e.map(ce),items:e,fallback:i?t(h,{}):null,wrapCopy:Se,children:r})}function h(){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:X("The card is empty. Add parts to its card template in Layers.")})}export{ne as GRID_CARD_RULES,Xe as GridBundleCards,Ye as GridCardProvider,qe as GridCards,Ke as GridMixedCards,Ve as LISTING_CARD_RULES,ce as bundleCardRow,P as bundlePagePath,Me as cardRowsGrid,Be as gridIndexCss,w as productCardRow,le as tyreCardRow,we as useCardHoverLayer,f as useGridCard};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as f,Fragment as rt}from"react/jsx-runtime";import{useScopeClass as nt}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as u,useState as me}from"react";import{cardHoverOf as it}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as st}from"efficient-web-builder/format/lib/content/container-gap";import ot from"next/link";import{cardRowsGrid as at,GridCardProvider as lt,GridMixedCards as mt,gridIndexCss as dt}from"./GridCardTemplate.js";import{gridClassImageSizes as ct}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 pt,oneWheelScope as ge,pairScope as ut,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as gt,summarySetBuild as ft}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as ht}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as xt}from"./ProductCardEyebrow.js";import wt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as vt,centredCap as yt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as bt,SectionWheelsProvider as St}from"./ProductRef.js";import{useCurrency as Ct}from"./CurrencyContext.js";import{COLLECTION_ATTR as Mt,useCatalogFilter as Nt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as $t,useShopperMember as Et}from"./catalog/ShopperScope.js";import Tt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Pt,hasActivePlpFilters as Lt}from"../lib/wheels/plp-filters.js";import It from"./catalog/ClearAllButton.js";import{gridPagingOf as _t,gridShownOf as Ot}from"../lib/sections/product-grid-pages.js";import At from"./SectionBand.js";import{useInsideBox as Ht,useInsideSiteGutter as Bt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Rt}from"../lib/sections/product-grid-columns.js";import{renderGold as Y,renderHeadline as Gt}from"efficient-web-builder/render/components/goldPhrases";import{applyCatalogFilters as kt}from"../lib/wheels/catalog-filters.js";import{normalizeCatalogRows as Ft}from"../lib/wheels/wheel-summary-casing.js";import Wt from"./TyreSummaryCard.js";import{itemKind as J,plpKindNoun as xe}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as jt,gridKindsOf as we,gridRowsOf as Ut}from"../lib/wheels/grid-source.js";import{useUnifiedProductCatalog as Kt}from"./useProductCatalog.js";import{STICKY_UNDERHEADER_CLASS as Xt}from"efficient-web-builder/render/lib/document/header-clearance";import{finishFamiliesOf as Dt}from"../lib/wheels/finish-defaults.js";import{lugCountsOf as Zt}from"../lib/wheels/lug-count.js";import{diametersOf as qt}from"../lib/wheels/size-range.js";import{say as Vt}from"efficient-web-builder/format/lib/editor-words";import{DEFAULT_TITLE_SIZE as Yt}from"../lib/sections/product-grid-title.js";const Jt=it({},"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 Qt(M){return(ve.find(h=>h.value===M)??ve.find(h=>h.value===Yt)).cls}function er({num:M,catalog:h,catalogTotal:ye,firstCountInChips:be=!1,kinds:E,title:A,titleSize:Se,padTop:Q,description:T,link:N,products:Ce,wheels:Me,source:p,columns:Ne,columnsPhone:$e,columnsTablet:Ee,limit:Te,moreProducts:ze,perPage:Pe,editing:x,contentCapped:Le=!1,hover:Ie,fieldUsage:w,ownerId:_e="",template:Oe,gap:Ae,gapPhone:He}){const H=u(()=>w?he(w,"alloy-wheel"):void 0,[w]),Be=u(()=>w?he(w,"tyre"):void 0,[w]),e=nt("pg"),{paged:v,per:y,limit:l,cap:$}=_t({moreProducts:ze,perPage:Pe,limit:Te}),m=Rt(Ne,$e,Ee),ee=Le,Re=Bt(),Ge=Ht(),ke=Re||Ge,B=Kt(x===!0&&!!p),o=u(()=>p?Ft(Ut(p,E,B??h??[])):null,[h,B,p,E]),R=Et("grid",o),a=o?R.scope:null,g=jt(p),b=g!==null&&!a,{filters:z,reportCount:G,reportLugs:k,reportSizes:F,reportFinishes:W,reportCategories:j,vehicle:te}=Nt(),{currency:S}=Ct(),U=b&&!!z.process&&z.process!==g,K=a?.state,n=u(()=>o?K?Pt(o,K,S):b?kt(o,z,S,te.fit):o:null,[o,K,b,z,S,te.fit]),[Fe,We]=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:Fe)),{reportShown:D}=R,re=a!==null;$t(()=>{if(!re||!n)return D(null);D(Ot(n.length,{paged:v,per:y,cap:$},C))},[re,n,D,v,C,y,$]);const je=r=>a?a.update({page:r}):We(r),s=u(()=>v&&n?n.slice((C-1)*y,C*y):n,[v,n,C,y]);O(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),O(()=>{if(b)return G(e,U?0:n?.length??0),()=>G(e,0)},[b,U,n,G,e]);const P=u(()=>({lugs:Zt(o??[]),sizes:qt(o??[]),finishes:Dt(o??[])}),[o]);O(()=>(k(e,P.lugs),F(e,P.sizes),W(e,P.finishes),()=>{k(e,[]),F(e,[]),W(e,[])}),[P,k,F,W,e]);const Z=st("ProductGrid",Ae,"both",He),Ue=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${m}`,ne=at(Z),Ke=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${m}`,Xe=ne.style,De=u(()=>{const r=(n??[]).filter(c=>J(c)!=="tyre");if(r.length===0)return!1;const d=r.some(c=>!!c.process);return r.some(c=>!!c.setWords)||xt({kind:!1,brand:!1,process:d},H??[])},[n,H]),Ze=s?s.length>0?t("div",{className:Ke,style:Xe,children:t(mt,{items:s,isWheel:r=>J(r)!=="tyre",other:(r,d)=>t(Wt,{item:r,currency:S,editing:x,fieldUsage:Be},`tyre:${r.slug}-${d}`)})}):a&&Lt(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,E)).many} match those filters`}),t(It,{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:Vt("No products in “{name}” yet",{name:p?.name??""})})}):null:t(Ce,{className:Ue,style:Z.style,minEmptyHeight:320}),qe=a?a.countInChips:be,L=n&&!qe?n===o&&!B?ye??n.length:n.length:null,ie=xe(we(p,E)),Ve=M||A||T||N?f("div",{className:`${Xt} 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 ${ee||ke?"":"-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:Y(M)}),A&&t("h2",{className:`${Qt(Se)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Gt(A,!1)})]}),(T||N||L!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[T&&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:Y(T)}),N&&f(ot,{href:N.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:[Y(N.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?ie.one:ie.many]})]})]}):null,Ye=typeof Q=="number"?{"--pg-pt":`${Q}px`}:{},I=u(()=>{if(!s)return null;const r=s.map(d=>J(d)!=="tyre"&&gt(ft(d))?2:1);return fe(r,l)?pe(m,r,l):null},[s,m,l]),[Je,Qe]=me("");O(()=>{if(s)return;const r=document.querySelector(`.${e}`);if(!r)return;const d=()=>{const c=[...r.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(pt)?2:1);Qe(fe(c,l)?ue(e,pe(m,c,l,!1),c.length):"")};d();const V=new MutationObserver(d);return V.observe(r,{childList:!0}),()=>V.disconnect()},[s,e,m,l]);const et=I?I[0].tracks:s?$?Math.min(s.length,l):s.length:void 0,_=I?ue(ut(e),I,s.length)+($?ce(ge(e),l+1):"")+de(ge(e),m,{limit:l,cards:s.length}):Je,se=_?"":de(e,m,{limit:l,cards:s?.length}),oe=dt(e),ae=f(rt,{children:[$&&!_&&t("style",{children:ce(e,l+1)}),_&&t("style",{children:_}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),Ve,Ze,v&&X>1&&t(Tt,{textSize:zt.labelSmall,page:C,pageCount:X,onPage:je}),t(wt,{editing:x})]});if(U)return null;const q=t(At,{rootRef:R.ref,attrs:b&&g!==null?{[Mt]: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:Ye,defaults:{"--pg-pt":"120px"},children:ee?t("div",{style:yt(vt),children:ae}):ae}),tt=o?q:x?t(bt,{currency:S,children:q}):t(St,{wheels:Me,currency:S,children:q});return t(lt,{value:{ownerId:_e,Template:Oe,hover:Ie??Jt,imageSizes:ct(m,et),fieldUsage:H??ht,reserveEyebrow:De,editing:x===!0},children:tt})}export{ve as TITLE_SIZES,er as default};
1
+ "use client";import{jsx as t,jsxs as f,Fragment as nt}from"react/jsx-runtime";import{useScopeClass as it}from"../lib/use-scope-class.js";import{useEffect as O,useMemo as p,useState as me}from"react";import{cardHoverOf as st}from"efficient-web-builder/format/lib/animation/hover";import{containerGapProps as ot}from"efficient-web-builder/format/lib/content/container-gap";import at from"next/link";import{cardRowsGrid as lt,GridCardProvider as mt,GridMixedCards as dt,gridIndexCss as ct}from"./GridCardTemplate.js";import{gridClassImageSizes as pt}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 ge,ONE_WHEEL_MARK as gt,oneWheelScope as ue,pairScope as ut,showsASetCard as fe}from"../lib/sections/grid-no-hole.js";import{setIsWide as ft,summarySetBuild as ht}from"../lib/wheels/set-mode.js";import{answersForKind as he,NO_FIELD_ANSWERS as xe}from"../lib/content/field-usage.js";import{wheelCardEyebrowShows as xt}from"./ProductCardEyebrow.js";import wt from"./NoCurrencyNote.js";import{SITE_WIDTH_CAP as vt,centredCap as yt}from"efficient-web-builder/format/lib/content/page-width";import{ProductCatalogProvider as bt,SectionWheelsProvider as St}from"./ProductRef.js";import{useCurrency as Ct}from"./CurrencyContext.js";import{COLLECTION_ATTR as Mt,useCatalogFilter as Nt}from"./catalog/CatalogFilterContext.js";import{useIsoLayoutEffect as Et,useShopperMember as $t}from"./catalog/ShopperScope.js";import Tt from"./wheels-plp/PlpPagination.js";import{CATALOG_TEXT_SIZE as zt}from"../lib/sections/catalog-text-size.js";import{applyShopperFilters as Pt,hasActivePlpFilters as Lt}from"../lib/wheels/plp-filters.js";import It from"./catalog/ClearAllButton.js";import{gridPagingOf as _t,gridShownOf as Ot}from"../lib/sections/product-grid-pages.js";import At from"./SectionBand.js";import{useInsideBox as Ht,useInsideSiteGutter as Bt}from"efficient-web-builder/render/components/SiteGutterFrame";import{productGridColumnsClass as Rt}from"../lib/sections/product-grid-columns.js";import{renderGold as Y,renderHeadline as Ft}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{itemKind as J,plpKindNoun as we}from"../lib/catalog/plp-item.js";import{filterBarCategoryOf as Wt,gridKindsOf as ve,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=st({},"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)]"},ye=[{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(S){return(ye.find(h=>h.value===S)??ye.find(h=>h.value===Vt)).cls}function Qt({num:S,catalog:h,catalogTotal:be,firstCountInChips:Se=!1,kinds:$,title:A,titleSize:Ce,padTop:Q,description:T,link:C,products:Me,wheels:Ne,source:c,columns:Ee,columnsPhone:$e,columnsTablet:Te,limit:ze,moreProducts:Pe,perPage:Le,editing:M,contentCapped:Ie=!1,hover:_e,fieldUsage:x,ownerId:Oe="",template:Ae,gap:He,gapPhone:Be}){const H=p(()=>x?he(x,"alloy-wheel"):void 0,[x]),Re=p(()=>x?he(x,"tyre"):void 0,[x]),e=it("pg"),{paged:w,per:v,limit:l,cap:N}=_t({moreProducts:Pe,perPage:Le,limit:ze}),m=Rt(Ee,$e,Te),ee=Ie,Fe=Bt(),Ge=Ht(),ke=Fe||Ge,B=Ut(M===!0&&!!c),o=p(()=>c?kt(jt(c,$,B??h??[])):null,[h,B,c,$]),R=$t("grid",o),a=o?R.scope:null,g=Wt(c),y=g!==null&&!a,{filters:z,reportCount:F,reportLugs:G,reportSizes:k,reportFinishes:W,reportCategories:j,vehicle:te}=Nt(),{currency:E}=Ct(),U=y&&!!z.process&&z.process!==g,K=a?.state,r=p(()=>o?K?Pt(o,K,E):y?Gt(o,z,E,te.fit):o:null,[o,K,y,z,E,te.fit]),[We,je]=me(1),X=w&&r?Math.max(1,Math.ceil(r.length/v)):1,b=Math.min(X,Math.max(1,a?a.state.page:We)),{reportShown:D}=R,re=a!==null;Et(()=>{if(!re||!r)return D(null);D(Ot(r.length,{paged:w,per:v,cap:N},b))},[re,r,D,w,b,v,N]);const Ue=n=>a?a.update({page:n}):je(n),s=p(()=>w&&r?r.slice((b-1)*v,b*v):r,[w,r,b,v]);O(()=>(j(e,g===null?[]:[g]),()=>j(e,[])),[g,j,e]),O(()=>{if(y)return F(e,U?0:r?.length??0),()=>F(e,0)},[y,U,r,F,e]);const P=p(()=>({lugs:Dt(o??[]),sizes:Zt(o??[]),finishes:Xt(o??[])}),[o]);O(()=>(G(e,P.lugs),k(e,P.sizes),W(e,P.finishes),()=>{G(e,[]),k(e,[]),W(e,[])}),[P,G,k,W,e]);const Z=ot("ProductGrid",He,"both",Be),Ke=`${e} grid${Z.className} bg-[var(--catalog-grid-bg)] ${m}`,ne=lt(Z),Xe=`${e} grid${ne.className} bg-[var(--catalog-grid-bg)] ${m}`,De=ne.style,Ze=p(()=>{const n=(r??[]).filter(d=>J(d)!=="tyre");if(n.length===0)return!1;const u=n.some(d=>!!d.process);return n.some(d=>!!d.setWords)||xt({kind:!1,brand:!1,process:u},H??[])},[r,H]),qe=s?s.length>0?t("div",{className:Xe,style:De,children:t(dt,{items:s,tyreOf:n=>J(n)==="tyre"?n:null})}):a&&Lt(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 ${we(ve(c,$)).many} match those filters`}),t(It,{onClick:a.clear})]}):M?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:c?.name??""})})}):null:t(Me,{className:Ke,style:Z.style,minEmptyHeight:320}),Ve=a?a.countInChips:Se,L=r&&!Ve?r===o&&!B?be??r.length:r.length:null,ie=we(ve(c,$)),Ye=S||A||T||C?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 ${ee||ke?"":"-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:[S&&t("span",{className:`font-mono ${i.labelLarge} leading-none uppercase tracking-[0.22em] text-fg-dim`,children:Y(S)}),A&&t("h2",{className:`${Jt(Ce)} leading-none text-fg max-view-wide:leading-[1] [&>span]:block`,children:Ft(A,!1)})]}),(T||C||L!==null)&&f("div",{className:"flex items-center gap-5 max-view-wide:gap-3 view-wide:grow view-wide:justify-end",children:[T&&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:Y(T)}),C&&f(at,{href:C.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:[Y(C.text),t("span",{"aria-hidden":!0,children:"→"})]}),L!==null&&f("span",{className:`whitespace-nowrap font-mono ${i.labelSmall} uppercase tracking-[0.2em] text-fg-dim`,children:[L," ",L===1?ie.one:ie.many]})]})]}):null,Je=typeof Q=="number"?{"--pg-pt":`${Q}px`}:{},I=p(()=>{if(!s)return null;const n=s.map(u=>J(u)!=="tyre"&&ft(ht(u))?2:1);return fe(n,l)?pe(m,n,l):null},[s,m,l]),[Qe,et]=me("");O(()=>{if(s)return;const n=document.querySelector(`.${e}`);if(!n)return;const u=()=>{const d=[...n.children].map(le=>le.classList.contains("col-span-2")&&!le.querySelector(gt)?2:1);et(fe(d,l)?ge(e,pe(m,d,l,!1),d.length):"")};u();const V=new MutationObserver(u);return V.observe(n,{childList:!0}),()=>V.disconnect()},[s,e,m,l]);const tt=I?I[0].tracks:s?N?Math.min(s.length,l):s.length:void 0,_=I?ge(ut(e),I,s.length)+(N?ce(ue(e),l+1):"")+de(ue(e),m,{limit:l,cards:s.length}):Qe,se=_?"":de(e,m,{limit:l,cards:s?.length}),oe=ct(e),ae=f(nt,{children:[N&&!_&&t("style",{children:ce(e,l+1)}),_&&t("style",{children:_}),se&&t("style",{children:se}),oe&&t("style",{children:oe}),Ye,qe,w&&X>1&&t(Tt,{textSize:zt.labelSmall,page:b,pageCount:X,onPage:Ue}),t(wt,{editing:M})]});if(U)return null;const q=t(At,{rootRef:R.ref,attrs:y&&g!==null?{[Mt]: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:Je,defaults:{"--pg-pt":"120px"},children:ee?t("div",{style:yt(vt),children:ae}):ae}),rt=o?q:M?t(bt,{currency:E,children:q}):t(St,{wheels:Ne,currency:E,children:q});return t(mt,{value:{ownerId:Oe,Template:Ae,hover:_e??Yt,imageSizes:pt(m,tt),fieldUsage:H??xe,tyreFieldUsage:Re??xe,reserveEyebrow:Ze,editing:M===!0},children:rt})}export{ye as TITLE_SIZES,Qt as default};
@@ -8,6 +8,7 @@ import type { SlotComponent } from "efficient-easel/blocks";
8
8
  export interface HeroPriceTemplateProps {
9
9
  nodeId?: string;
10
10
  priceTemplate?: SlotComponent;
11
+ optionTemplate?: SlotComponent;
11
12
  }
12
13
  interface Props extends HeroPriceTemplateProps {
13
14
  product: StoreProduct;
@@ -25,5 +26,5 @@ interface Props extends HeroPriceTemplateProps {
25
26
  imageFit?: HeroImageFit;
26
27
  trustBullets?: ReactNode;
27
28
  }
28
- export default function ProductHeroPanel({ product, selection, onLightbox, editing, pricePlacement, showVehicleFitment, heroLayout, imageRatio, textAlign, showSpecTable, showPriceQuote, galleryMode, imageFit, trustBullets, nodeId, priceTemplate, }: Props): import("react").JSX.Element;
29
+ export default function ProductHeroPanel({ product, selection, onLightbox, editing, pricePlacement, showVehicleFitment, heroLayout, imageRatio, textAlign, showSpecTable, showPriceQuote, galleryMode, imageFit, trustBullets, nodeId, priceTemplate, optionTemplate, }: Props): import("react").JSX.Element;
29
30
  export {};
@@ -1 +1 @@
1
- "use client";import{jsx as a,Fragment as h,jsxs as n}from"react/jsx-runtime";import Q from"next/link";import{BUY_ROW_CLASS as Se}from"./buy-row.js";import{useEffect as J,useRef as we,useState as Te}from"react";import{useCart as Re}from"./CartContext.js";import{useSiteTakesOrders as Ee}from"./SiteRecordContext.js";import _e from"./EmailCaptureForm.js";import{useEnglish as I}from"./EnglishVariant.js";import Ce from"./QuantityStepper.js";import{MarkedLabel as $,heroView as Le}from"./product-hero/hero-view.js";import Ae from"./ProductGallery.js";import{useRootIsDark as Oe}from"efficient-shell/theme";import{useWishlist as Ie}from"./WishlistContext.js";import{useStockAlertSignup as $e}from"./useStockAlertSignup.js";import{SPARE_WORDS as ze,productCartLine as je}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as Me}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Pe}from"../lib/catalog/product-options.js";import{trackViewItem as Fe}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as De,DEFAULT_HERO_RATIO as He,DEFAULT_HERO_TEXT_ALIGN as Be,parseHeroLayout as Ue,parseHeroRatio as Ve,parseHeroTextAlign as We}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Ge,DEFAULT_HERO_IMAGE_FIT as qe}from"../lib/sections/hero-gallery.js";import{MAX_SPARES as Ye,UNITS_PER_SET as Ke,formatPrice as Z}from"../lib/commerce.js";import{formatSelectionPrice as Xe,setPriceLabel as Qe}from"../lib/wheels/price-display.js";import{productIsDually as Je,productIsTwoObjects as Ze,setSuppressesRow as et}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as ee}from"../lib/sections/content-cap-gutter.js";import{CardTemplateRows as tt}from"efficient-web-builder/render/components/CardRowContext";import at from"./card-pieces/CardPrice.js";import nt from"./card-pieces/CardBuyButton.js";import{HeroStateProvider as te}from"./card-pieces/ProductCardState.js";const rt=4e3;function lt(t){return t?[t.year,t.make,t.model,t.modification].join("-"):""}const st=[{}],it=.72;function ot(t){const r=t.trim().split(/\s+/).filter(Boolean);if(r.length===0)return;const m=r.map((o,c)=>o.length+(r.length>1&&c===r.length-1?1:0));return`calc(100cqi / ${(Math.max(...m)*it).toFixed(2)})`}function ct({product:t,selection:r,onLightbox:m,editing:o=!1,pricePlacement:c="top",showVehicleFitment:l=!0,heroLayout:p=De,imageRatio:S=He,textAlign:ne=Be,showSpecTable:re=!0,showPriceQuote:w=!0,galleryMode:le=Ge,imageFit:se=qe,trustBullets:ie,nodeId:oe,priceTemplate:z}){const ce=I(),v=Ue(p),j=We(ne),y=Ve(S),me=v==="imageRight"?`${100-y}fr ${y}fr`:`${y}fr ${100-y}fr`,{picked:de,pick:M,qty:P,setQty:pe,choice:b,setChoice:N,angleIdx:ue,setAngleIdx:fe,showValidation:he,setShowValidation:T,manualMode:F,vehicle:R,rows:D,facts:be,part:g,outOfStock:H,offer:d,preOrder:E,canAddToCart:B,currency:k,price:f,set:U,msrpLabel:ge}=r,i=Le(t,r,o),_=Je(t),xe=Ze(t),C=l?i.vehicle:null,ve=l?i.vehicleMemory:null,L=!Oe({whenUnset:!0}),{warmCatalog:V}=Re(),x=Ee();J(()=>{!o&&x&&V(t.kind)},[o,x,t.kind,V]);const W=D.filter(e=>!E||e.values.length>0),G=W.filter(e=>e.role==="resolves"),A=W.filter(e=>e.role==="describes"&&!et(xe,e.key)),q=A.findIndex(e=>e.chosen===null),Y=(!C||!i.vehicleAnswersSpecs||r.fitmentSet)&&Pe(D,E)?q===-1?A:A.slice(0,q+1):[],ke=[...G,...Y];function ye(){return B?(T(!1),o?null:je(t,g,de,{choice:b,qty:P},{fitmentLabel:F?i.specCaption:R.appliedName?`For ${R.appliedName}`:"",fitmentKey:F?`manual|${i.specCaption}`:`vehicle|${lt(R.applied?.vehicle)}`})):(T(!0),window.setTimeout(()=>T(!1),rt),null)}const K={kind:"hero",msrpLabel:ge||null,amount:_?Qe(f,k):Xe(f,k),unitLabel:f.priced?i.unitLabel:null,packBadge:f.setTotal!=null?`${d.quantityLabel}: ${Z(U,k)}`:null,buy:{isSet:_,priced:f.priced,outOfStock:H,canAdd:B,totalLabel:f.setTotal!=null?Z(U,k):null,lineToAdd:ye}},O=a(te,{value:K,children:z?a(tt,{ownerId:oe??"",ownerType:"ProductHero",Template:z,rows:st,fallback:null,children:e=>e}):a(at,{})}),X=we(null);return J(()=>{o||X.current===t.slug||(X.current=t.slug,Fe({itemId:g?`${t.slug}|${g.id}`:t.slug,itemName:t.name,variant:i.metaValue,pricePerSet:f.setTotal??f.fromSetTotal??0,currency:k}))},[o,t.slug,t.name,i.metaValue,g,f,k]),n(h,{children:[a("nav",{className:`border-b border-line ${ee} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:L?void 0:{background:"var(--section-bg)"},children:t.crumbs.map((e,s)=>n("span",{children:[s>0&&n(h,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),e.href?a(Q,{href:e.href,className:"hover:text-fg",children:a($,{text:e.label})}):a("span",{className:"text-fg",children:a($,{text:e.label})})]},`${e.label}-${s}`))}),n("section",{"data-hero-layout":v,"data-hero-align":j,className:[`grid gap-10 ${ee} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8`,v==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].join(" "),style:{...L?{}:{background:"var(--section-bg)"},...v==="stacked"?{}:{"--hero-cols":me}},children:[a(Ae,{product:t,view:i,angleIdx:ue,onSelect:fe,isLight:L,onLightbox:m,galleryMode:le,imageFit:se,style:v==="imageRight"?{order:2}:void 0}),n("div",{className:["flex flex-col gap-7",j==="center"?"items-center text-center":""].filter(Boolean).join(" "),style:v==="imageRight"?{order:1}:void 0,children:[n("div",{className:"w-full [container-type:inline-size]",children:[n("div",{className:"mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent",children:[a("span",{children:a($,{text:t.eyebrow})}),t.badge&&n(h,{children:[a("span",{children:"·"}),a("span",{children:t.badge})]})]}),a("h1",{className:"font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]",style:{"--hero-name-fit":ot(i.heading)},children:(()=>{const e=i.heading.lastIndexOf(" ");if(e===-1)return i.heading;const s=i.heading.slice(0,e),u=i.heading.slice(e+1);return n(h,{children:[s," ",n("em",{className:"font-normal italic text-accent",children:[u,"."]})]})})()})]}),c!=="belowSpecs"&&w&&O,ve,G.map(e=>a(ae,{row:e,onPick:M},e.key)),E&&i.preOrder?n(h,{children:[c==="belowSpecs"&&w&&O,i.preOrder]}):n(h,{children:[C,Y.map(e=>a(ae,{row:e,onPick:M},e.key)),re&&a(mt,{facts:be}),(d.packs.length>0||x&&(d.extra||d.spareCounts.length>0))&&n("div",{className:"border-b border-line pb-[26px]",children:[d.packs.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),a("div",{className:"flex flex-wrap gap-1.5",children:d.packs.map(e=>n("button",{type:"button",onClick:()=>N(s=>({...s,unit:e.value})),"aria-pressed":b.unit===e.value,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",b.unit===e.value?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:b.unit===e.value?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[b.unit===e.value&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:e.label})]},e.value))})]}),x&&d.extra&&n("label",{className:`${d.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[a("input",{type:"checkbox",checked:b.spares>0,onChange:e=>N(s=>({...s,spares:e.target.checked?Ye:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),d.extra.label]}),x&&d.spareCounts.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:ze.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:d.spareCounts.map(e=>{const s=e.value-Ke,u=b.spares===s;return n("button",{type:"button",onClick:()=>N(Ne=>({...Ne,spares:s})),"aria-pressed":u,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",u?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:u?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[u&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),n("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:[e.value," · ",e.label]})]},e.value)})})]}),x&&d.spareSide&&n(h,{children:[a("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:d.spareSide.label}),a("div",{className:"flex flex-wrap gap-1.5",children:d.spareSide.options.map(e=>{const s=b.spareSide===e.value;return n("button",{type:"button",onClick:()=>N(u=>({...u,spareSide:e.value})),"aria-pressed":s,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",s?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:s?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[s&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:e.label})]},e.value)})})]})]}),c==="belowSpecs"&&w&&O,n("div",{className:Se,children:[x&&!(_&&!f.priced)&&a(Ce,{value:P,onChange:pe,size:"large"}),a(te,{value:K,children:a(nt,{})}),a(dt,{slug:t.slug,name:t.name})]}),H&&g&&a(pt,{partNumbers:g.components.map(e=>e.partNumber),productSlug:t.slug},g.id),he&&(()=>{const e=ke.filter(u=>u.chosen===null).map(u=>ce(u.prompt).replace(/^Select\s+/i,""));if(C&&i.vehicleAnswersSpecs&&!r.fitmentSet&&e.push("vehicle fitment"),e.length===0)return null;const s=e.length===1?e[0]:e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e.at(-1)}`;return n("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",s," first."]})})()]}),ie]})]})]})}function mt({facts:t}){const r=I();return t.length===0?null:a("div",{className:"border-b border-line pb-[26px]",children:a("dl",{className:"flex flex-col gap-2",children:t.map(m=>n("div",{className:"flex flex-wrap items-baseline gap-x-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.22em]",children:[n("dt",{className:"text-fg-dim",children:[r(m.label)," ·"]}),a("dd",{className:"font-semibold text-fg",children:m.value.label})]},m.key))})})}function ae({row:t,onPick:r}){const m=I();if(t.values.length===0&&!t.empty)return null;const o=t.values.find(l=>l.value===t.chosen),c=o&&[o.label,o.note].filter(Boolean).join(" · ");return n("div",{className:"border-b border-line pb-[26px]",[Me]:t.key,children:[n("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[m(t.label)," · ",a("span",{className:"text-accent",children:c??m(t.prompt)})]}),t.values.length===0?n("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[t.empty.text," ",a(Q,{href:t.empty.href,className:"text-accent hover:underline",children:t.empty.linkText})]}):t.display==="swatch"?a("div",{className:"flex flex-wrap gap-2",children:t.values.map(l=>{const p=l.value===t.chosen;return n("button",{type:"button",onClick:()=>r(t.key,l.value),"aria-pressed":p,className:["relative flex max-w-full items-center gap-3 border-2 px-3 py-3 text-left transition-colors",p?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block h-5 w-5 shrink-0 rounded-full border border-fg-dim",style:{background:l.swatch}}),a("span",{className:"block min-w-0 break-words font-mono text-[length:var(--size-label,12px)] font-bold uppercase tracking-[0.18em] text-fg",children:l.label})]},l.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:t.values.map(l=>{const p=l.value===t.chosen;return n("button",{type:"button",onClick:()=>r(t.key,l.value),"aria-pressed":p,className:["relative cursor-pointer border-2 px-4 py-3 text-left font-mono uppercase transition-colors",p?"border-accent text-fg outline outline-1 outline-accent -outline-offset-1":"border-fg-dim/50 text-fg hover:border-accent"].join(" "),style:p?{background:"color-mix(in oklab, var(--accent) 14%, transparent)"}:void 0,children:[p&&a("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),a("span",{className:"block text-[length:var(--size-label,14px)] tracking-[0.18em]",children:l.label}),l.note&&a("span",{className:"mt-1 block text-[length:var(--size-label,11px)] tracking-[0.12em] text-fg-dim",children:l.note})]},l.value)})})]})}function dt({slug:t,name:r}){const{has:m,toggle:o}=Ie(),c=m(t);return a("button",{type:"button",title:c?"Saved":"Save","aria-label":c?`Remove ${r} from wishlist`:`Save ${r} to wishlist`,"aria-pressed":c,onClick:()=>o(t),className:["h-12 w-12 cursor-pointer border-2 bg-transparent transition-colors",c?"border-accent text-accent":"border-fg-dim/50 text-fg hover:border-accent hover:text-accent"].join(" "),children:c?"♥":"♡"})}function pt({partNumbers:t,productSlug:r}){const[m,o]=Te(""),{status:c,submit:l,reset:p}=$e();function S(){l({partNumbers:t,email:m,productSlug:r})}return c==="sent"?a("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):a(_e,{className:"-mt-1",email:m,onEmailChange:o,status:c,onResetVerdict:p,onSubmit:S,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{ct as default};
1
+ "use client";import{jsx as a,Fragment as h,jsxs as n}from"react/jsx-runtime";import ee from"next/link";import{BUY_ROW_CLASS as _e}from"./buy-row.js";import{useEffect as te,useRef as Ee,useState as Oe}from"react";import{useCart as Le}from"./CartContext.js";import{useSiteTakesOrders as Ce}from"./SiteRecordContext.js";import Ae from"./EmailCaptureForm.js";import{useEnglish as M}from"./EnglishVariant.js";import Ie from"./QuantityStepper.js";import{MarkedLabel as P,heroView as $e}from"./product-hero/hero-view.js";import Me from"./ProductGallery.js";import{useRootIsDark as Pe}from"efficient-shell/theme";import{useWishlist as ze}from"./WishlistContext.js";import{useStockAlertSignup as He}from"./useStockAlertSignup.js";import{SPARE_WORDS as Fe,productCartLine as je}from"../lib/catalog/purchase.js";import{OPTION_ROW_ATTR as De}from"../lib/catalog/store-product.js";import{resolvingRowsAnswered as Be}from"../lib/catalog/product-options.js";import{trackViewItem as Ue}from"../lib/google-tag.js";import{DEFAULT_HERO_LAYOUT as Ve,DEFAULT_HERO_RATIO as We,DEFAULT_HERO_TEXT_ALIGN as Ge,parseHeroLayout as qe,parseHeroRatio as Ye,parseHeroTextAlign as Ke}from"../lib/sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as Xe,DEFAULT_HERO_IMAGE_FIT as Qe}from"../lib/sections/hero-gallery.js";import{MAX_SPARES as Je,UNITS_PER_SET as ae,formatPrice as ne}from"../lib/commerce.js";import{formatSelectionPrice as Ze,setPriceLabel as et}from"../lib/wheels/price-display.js";import{productIsDually as tt,productIsTwoObjects as at,setSuppressesRow as nt}from"../lib/wheels/set-mode.js";import{CONTENT_CAP_GUTTER as le}from"../lib/sections/content-cap-gutter.js";import{CardTemplateRows as re}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as lt}from"efficient-web-builder/render/components/SiteGutterFrame";import{cardRow as rt}from"efficient-web-builder/format/lib/content/card-template";import{optionCardRows as st}from"../lib/sections/filter-option-rows.js";import{HERO_OPTION_SLOT as it}from"../lib/content/hero-option-seed.js";import ot from"./card-pieces/CardPrice.js";import ct from"./card-pieces/CardBuyButton.js";import{HeroStateProvider as se}from"./card-pieces/ProductCardState.js";const mt=4e3;function pt(e){return e?[e.year,e.make,e.model,e.modification].join("-"):""}const dt=[{}],ft=.72;function ht(e){const l=e.trim().split(/\s+/).filter(Boolean);if(l.length===0)return;const o=l.map((i,s)=>i.length+(l.length>1&&s===l.length-1?1:0));return`calc(100cqi / ${(Math.max(...o)*ft).toFixed(2)})`}function ut({product:e,selection:l,onLightbox:o,editing:i=!1,pricePlacement:s="top",showVehicleFitment:d=!0,heroLayout:r=Ve,imageRatio:T=We,textAlign:oe=Ge,showSpecTable:ce=!0,showPriceQuote:R=!0,galleryMode:me=Xe,imageFit:pe=Qe,trustBullets:de,nodeId:z,priceTemplate:H,optionTemplate:fe}){const he=M(),b=qe(r),F=Ke(oe),S=Ye(T),ue=b==="imageRight"?`${100-S}fr ${S}fr`:`${S}fr ${100-S}fr`,{picked:ge,pick:j,qty:D,setQty:be,choice:v,setChoice:w,angleIdx:xe,setAngleIdx:ve,showValidation:ke,setShowValidation:_,manualMode:B,vehicle:E,rows:U,facts:Ne,part:u,outOfStock:V,offer:m,preOrder:O,canAddToCart:W,currency:x,price:f,set:G,msrpLabel:ye}=l,c=$e(e,l,i),L=tt(e),Se=at(e),C=d?c.vehicle:null,we=d?c.vehicleMemory:null,A=!Pe({whenUnset:!0}),{warmCatalog:q}=Le(),g=Ce();te(()=>{!i&&g&&q(e.kind)},[i,g,e.kind,q]);const Y=U.filter(t=>!O||t.values.length>0),K=Y.filter(t=>t.role==="resolves"),I=Y.filter(t=>t.role==="describes"&&!nt(Se,t.key)),X=I.findIndex(t=>t.chosen===null),Q=(!C||!c.vehicleAnswersSpecs||l.fitmentSet)&&Be(U,O)?X===-1?I:I.slice(0,X+1):[],Te=[...K,...Q];function Re(){return W?(_(!1),i?null:je(e,u,ge,{choice:v,qty:D},{fitmentLabel:B?c.specCaption:E.appliedName?`For ${E.appliedName}`:"",fitmentKey:B?`manual|${c.specCaption}`:`vehicle|${pt(E.applied?.vehicle)}`})):(_(!0),window.setTimeout(()=>_(!1),mt),null)}const J={kind:"hero",msrpLabel:ye||null,amount:L?et(f,x):Ze(f,x),unitLabel:f.priced?c.unitLabel:null,packBadge:f.setTotal!=null?`${m.quantityLabel}: ${ne(G,x)}`:null,buy:{isSet:L,priced:f.priced,outOfStock:V,canAdd:W,totalLabel:f.setTotal!=null?ne(G,x):null,lineToAdd:Re}},$=a(se,{value:J,children:H?a(re,{ownerId:z??"",ownerType:"ProductHero",Template:H,rows:dt,fallback:null,children:t=>t}):a(ot,{})}),k={nodeId:z??"",template:fe,editing:i},Z=Ee(null);return te(()=>{i||Z.current===e.slug||(Z.current=e.slug,Ue({itemId:u?`${e.slug}|${u.id}`:e.slug,itemName:e.name,variant:c.metaValue,pricePerSet:f.setTotal??f.fromSetTotal??0,currency:x}))},[i,e.slug,e.name,c.metaValue,u,f,x]),n(h,{children:[a("nav",{className:`border-b border-line ${le} pt-4 pb-4 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg-dim max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))]`,style:A?void 0:{background:"var(--section-bg)"},children:e.crumbs.map((t,p)=>n("span",{children:[p>0&&n(h,{children:[a("span",{className:"mx-3 text-accent",children:"/"}),a("wbr",{})]}),t.href?a(ee,{href:t.href,className:"hover:text-fg",children:a(P,{text:t.label})}):a("span",{className:"text-fg",children:a(P,{text:t.label})})]},`${t.label}-${p}`))}),n("section",{"data-hero-layout":b,"data-hero-align":F,className:[`grid gap-10 ${le} py-14 max-view-tablet:px-[min(20px,var(--sf-site-gutter,40px))] max-view-tablet:py-8`,b==="stacked"?"grid-cols-1":"[grid-template-columns:var(--hero-cols)] max-view-desktop:[grid-template-columns:minmax(0,1fr)]"].join(" "),style:{...A?{}:{background:"var(--section-bg)"},...b==="stacked"?{}:{"--hero-cols":ue}},children:[a(Me,{product:e,view:c,angleIdx:xe,onSelect:ve,isLight:A,onLightbox:o,galleryMode:me,imageFit:pe,style:b==="imageRight"?{order:2}:void 0}),n("div",{className:["flex flex-col gap-7",F==="center"?"items-center text-center":""].filter(Boolean).join(" "),style:b==="imageRight"?{order:1}:void 0,children:[n("div",{className:"w-full [container-type:inline-size]",children:[n("div",{className:"mb-2.5 flex items-center gap-2.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.2em] text-accent",children:[a("span",{children:a(P,{text:e.eyebrow})}),e.badge&&n(h,{children:[a("span",{children:"·"}),a("span",{children:e.badge})]})]}),a("h1",{className:"font-heading2 text-[length:min(min(var(--size-headingMedium,clamp(48px,5.5vw,84px)),var(--hero-name-fit,9999px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [text-transform:var(--sf-heading-case,uppercase)] leading-[0.92] tracking-[-0.035em]",style:{"--hero-name-fit":ht(c.heading)},children:(()=>{const t=c.heading.lastIndexOf(" ");if(t===-1)return c.heading;const p=c.heading.slice(0,t),N=c.heading.slice(t+1);return n(h,{children:[p," ",n("em",{className:"font-normal italic text-accent",children:[N,"."]})]})})()})]}),s!=="belowSpecs"&&R&&$,we,K.map(t=>a(ie,{row:t,onPick:j,options:k},t.key)),O&&c.preOrder?n(h,{children:[s==="belowSpecs"&&R&&$,c.preOrder]}):n(h,{children:[C,Q.map(t=>a(ie,{row:t,onPick:j,options:k},t.key)),ce&&a(gt,{facts:Ne}),(m.packs.length>0||g&&(m.extra||m.spareCounts.length>0))&&n("div",{className:"border-b border-line pb-[26px]",children:[m.packs.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:"How many"}),a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:k,values:m.packs,item:t=>({label:t.label}),picked:t=>v.unit===t.value,press:t=>()=>w(p=>({...p,unit:t.value}))})})]}),g&&m.extra&&n("label",{className:`${m.packs.length>0?"mt-3.5 ":""}flex cursor-pointer items-center gap-3 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-fg`,children:[a("input",{type:"checkbox",checked:v.spares>0,onChange:t=>w(p=>({...p,spares:t.target.checked?Je:0})),className:"h-4 w-4 cursor-pointer accent-[var(--accent)]"}),m.extra.label]}),g&&m.spareCounts.length>0&&n(h,{children:[a("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:Fe.howMany}),a("div",{className:"flex flex-col gap-1.5 sm:flex-row sm:flex-wrap",children:a(y,{hero:k,values:m.spareCounts,item:t=>({label:`${t.value} · ${t.label}`}),picked:t=>v.spares===t.value-ae,press:t=>()=>w(p=>({...p,spares:t.value-ae}))})})]}),g&&m.spareSide&&n(h,{children:[a("div",{className:"mb-3.5 mt-[26px] font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:m.spareSide.label}),a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:k,values:m.spareSide.options,item:t=>({label:t.label}),picked:t=>v.spareSide===t.value,press:t=>()=>w(p=>({...p,spareSide:t.value}))})})]})]}),s==="belowSpecs"&&R&&$,n("div",{className:_e,children:[g&&!(L&&!f.priced)&&a(Ie,{value:D,onChange:be,size:"large"}),a(se,{value:J,children:a(ct,{})}),a(bt,{slug:e.slug,name:e.name})]}),V&&u&&a(xt,{partNumbers:u.components.map(t=>t.partNumber),productSlug:e.slug},u.id),ke&&(()=>{const t=Te.filter(N=>N.chosen===null).map(N=>he(N.prompt).replace(/^Select\s+/i,""));if(C&&c.vehicleAnswersSpecs&&!l.fitmentSet&&t.push("vehicle fitment"),t.length===0)return null;const p=t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t.at(-1)}`;return n("p",{role:"alert",className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em]",style:{color:"var(--alert)"},children:["Please select ",p," first."]})})()]}),de]})]})]})}function gt({facts:e}){const l=M();return e.length===0?null:a("div",{className:"border-b border-line pb-[26px]",children:a("dl",{className:"flex flex-col gap-2",children:e.map(o=>n("div",{className:"flex flex-wrap items-baseline gap-x-2 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.22em]",children:[n("dt",{className:"text-fg-dim",children:[l(o.label)," ·"]}),a("dd",{className:"font-semibold text-fg",children:o.value.label})]},o.key))})})}function ie({row:e,onPick:l,options:o}){const i=M();if(e.values.length===0&&!e.empty)return null;const s=e.values.find(r=>r.value===e.chosen),d=s&&[s.label,s.note].filter(Boolean).join(" · ");return n("div",{className:"border-b border-line pb-[26px]",[De]:e.key,children:[n("div",{className:"mb-3.5 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.22em] text-fg",children:[i(e.label)," · ",a("span",{className:"text-accent",children:d??i(e.prompt)})]}),e.values.length===0?n("p",{className:"font-mono text-[length:var(--size-body,12px)] leading-relaxed tracking-[0.1em] text-fg-dim",children:[e.empty.text," ",a(ee,{href:e.empty.href,className:"text-accent hover:underline",children:e.empty.linkText})]}):e.display==="swatch"?a("div",{className:"flex flex-wrap gap-2 [&>*]:max-w-full",children:a(y,{hero:o,values:e.values,item:r=>({swatch:r.swatch??"",name:r.label}),picked:r=>r.value===e.chosen,press:r=>()=>l(e.key,r.value)})}):a("div",{className:"flex flex-wrap gap-1.5",children:a(y,{hero:o,values:e.values,item:r=>({label:r.label,note:r.note??""}),picked:r=>r.value===e.chosen,press:r=>()=>l(e.key,r.value)})})]})}function y({hero:e,values:l,item:o,picked:i,press:s}){const d=st(l,{item:o,selected:i,press:s});return a(lt,{children:a(re,{ownerId:e.nodeId,ownerType:"ProductHero",slot:it,Template:e.template,rows:d.items.map(rt),items:d.items,states:d.states,actions:e.editing?void 0:d.actions,fallback:null,children:r=>r})})}function bt({slug:e,name:l}){const{has:o,toggle:i}=ze(),s=o(e);return a("button",{type:"button",title:s?"Saved":"Save","aria-label":s?`Remove ${l} from wishlist`:`Save ${l} to wishlist`,"aria-pressed":s,onClick:()=>i(e),className:["h-12 w-12 cursor-pointer border-2 bg-transparent transition-colors",s?"border-accent text-accent":"border-fg-dim/50 text-fg hover:border-accent hover:text-accent"].join(" "),children:s?"♥":"♡"})}function xt({partNumbers:e,productSlug:l}){const[o,i]=Oe(""),{status:s,submit:d,reset:r}=He();function T(){d({partNumbers:e,email:o,productSlug:l})}return s==="sent"?a("p",{className:"-mt-1 font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-accent",children:"We'll email you when it's back."}):a(Ae,{className:"-mt-1",email:o,onEmailChange:i,status:s,onResetVerdict:r,onSubmit:T,inputAriaLabel:"Email for the back-in-stock alert",submitLabel:"Notify me when back",buttonClassName:"cursor-pointer whitespace-nowrap border-2 border-btn px-4 font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.22em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-btn",errorMessage:"Couldn't save that — please try again."})}export{ut as default};
@@ -1 +1 @@
1
- "use client";import{jsx as r}from"react/jsx-runtime";import{Render as u}from"efficient-easel/render";import{renderConfig as a}from"../lib/document/render-config.js";import{publishedChromeData as d}from"../lib/document/published-chrome-data.js";import{SITE_FOOTER_KIND as f}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as p}from"efficient-web-builder/render/components/PublishedFooterContext";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function c({footerBlock:l,rootProps:e,headerSettings:o,siteName:n,legalName:t,foundedYear:i,socialLinks:m}){const s=d({root:{props:{...e??{},kind:f}},content:[l],zones:{}});return r(p.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:n,legalName:t??null,foundedYear:i??null,socialLinks:m??I},children:r(u,{config:a(),data:s})})}export{c as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{Render as u}from"efficient-easel/render";import{renderConfig as a}from"../lib/document/render-config.js";import{SITE_FOOTER_KIND as d}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as f}from"efficient-web-builder/render/components/PublishedFooterContext";import{publishedChromeData as p}from"efficient-web-builder/render/lib/document/published-passes";import{EMPTY_SOCIAL_LINKS as I}from"efficient-web-builder/format/lib/content/social-links";function c({footerBlock:l,rootProps:e,headerSettings:o,siteName:n,legalName:t,foundedYear:i,socialLinks:m}){const s=p({root:{props:{...e??{},kind:d}},content:[l],zones:{}});return r(f.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:n,legalName:t??null,foundedYear:i??null,socialLinks:m??I},children:r(u,{config:a(),data:s})})}export{c as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e}from"react/jsx-runtime";import{Render as n}from"efficient-easel/render";import i from"./BoxHeaderBar.js";import{headerRenderConfig as p}from"../lib/document/render-config.js";import{publishedChromeData as s}from"../lib/document/published-chrome-data.js";import{chromeOwnWidth as a}from"efficient-web-builder/format/lib/content/section-width";function c({group:t}){const r=s({root:{props:{}},content:[t],zones:{}}),o=t.props??{};return e(i,{sticky:o.sticky,topTextColor:o.topTextColor,heightPx:o.heightPx,theme:o.sectionAccent,bandCapped:a(t.props??{}).background==="content",children:e(n,{config:p(),data:r})})}export{c as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{Render as a}from"efficient-easel/render";import i from"./BoxHeaderBar.js";import{headerRenderConfig as d}from"../lib/document/render-config.js";import{headerBarOf as n}from"../lib/document/published-header-bar.js";import{publishedChromeData as p}from"efficient-web-builder/render/lib/document/published-passes";function m({group:t}){const o=p({root:{props:{}},content:[t],zones:{}}),e=n(o);return r(i,{sticky:e.sticky,topTextColor:e.topTextColor,heightPx:e.heightPx,theme:e.theme,bandCapped:e.bandCapped,children:r(a,{config:d(),data:o})})}export{m as default};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as b}from"react/jsx-runtime";import E from"next/link";import{useEffect as h}from"react";import{useCart as A}from"../CartContext.js";import g from"../QuoteLink.js";import{NO_HIDE as R,useTakeViewHide as B,withViewHide as k}from"efficient-web-builder/render/components/ViewHideRoot";import{useSiteTakesOrders as x}from"../SiteRecordContext.js";import w from"../wheels-plp/PlpNotifyMeDialog.js";import{DEFAULT_PURCHASE_STATE as _}from"../../lib/catalog/purchase.js";import{ADD_TO_BASKET_ATTR as C}from"../../lib/commerce.js";import{STOCK_WORDS as L}from"../../lib/content/stock-words.js";import{tyreCartLine as z}from"../../lib/tyres/tyre-purchase.js";import{UNPRICED_LABEL as H,priceIn as $,resolveWheelPrice as P}from"../../lib/wheels/price-display.js";import{isOneWheelDesign as W,setLabel as V}from"../../lib/wheels/variants.js";import{splitWheelName as j}from"../../lib/wheels/wheel-name.js";import{CARD_TEXT_SIZE as S,CardButtonRow as y}from"./card-row.js";import{useHeroStateOrNull as q,useProductCardStateOrNull as I,useWheelCardState as F}from"./ProductCardState.js";const O="mt-3 flex flex-col gap-2",u=`cursor-pointer bg-btn px-4 py-3 font-mono ${S.labelSmall} font-bold uppercase tracking-[0.24em] text-btn-ink transition-colors hover:bg-fg`,G=`border border-btn px-4 py-3 text-center font-mono ${S.labelSmall} font-bold uppercase tracking-[0.24em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,K="View sizes & fitment",U="mt-3 block font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.18em] text-accent underline-offset-4 group-hover:underline";function M({wheel:e,sel:t,price:n,editing:r}){const{addAndOpen:i,warmCatalog:s}=A();h(()=>{r||s()},[r,s]);const{arm:c}=t;h(()=>{c()},[c]);function d(){const a=t.selectedVariant;!a||!t.canAdd||n.priced&&(r||i({id:`${e.slug}|${a.finishName}|${a.size}|quick`,slug:e.slug,name:j(e.name),process:e.process,positionNo:"01",config:[{label:a.size},{label:a.finishName,gold:!0},{label:V(a)}],finishName:a.finishName,size:a.size,components:a.components,qty:1}))}return o("button",{type:"button",onClick:d,[C]:"",disabled:!t.canAdd,className:t.canAdd?u:`${u} opacity-80`,children:"Add to basket"})}function X(e,t,n){return W(e)?t.outOfStock?"notify":t.unsellable||!n||t.detailState==="ready"&&!t.canAdd?"choose":"add":"choose"}function Q({state:e,buy:t,page:n}){const{wheel:r,sel:i,price:s,editing:c,setNotifyOpen:d}=e,a=x(),l=X(r,i,s.priced),f=t?l==="notify"?o("button",{type:"button",onClick:()=>d(!0),className:u,children:"Notify me when back"}):l==="add"?a?o(M,{wheel:r,sel:i,price:s,editing:c}):o(g,{className:u}):null:null,p=!n||f?null:b("span",{"aria-hidden":!0,className:U,children:[K," →"]});return o(y,{children:f||p?b("div",{className:O,children:[f,p]}):null})}function Y({state:e}){const{tyre:t,currency:n,pagePath:r,detail:i,variant:s,canAdd:c,detailReady:d,unsellable:a,editing:l}=e,{addAndOpen:f,warmCatalog:p}=A(),m=x();h(()=>{!l&&m&&p("tyre")},[l,m,p]);const N=P($(t.prices,n),null).priced;function D(){!i||!s||!c||l||f(z(i,s,_.choice,_.qty))}return o(y,{children:b("div",{className:O,children:[!a&&N&&!m&&o(g,{className:u}),!a&&N&&m&&o("button",{type:"button",onClick:D,[C]:"",disabled:d&&!c,className:c||!d?`${u}${c?"":" opacity-80"}`:`cursor-not-allowed border border-dashed border-accent/50 px-4 py-3 font-mono ${S.labelSmall} font-bold uppercase tracking-[0.24em] text-accent/70`,children:d&&!c?"Select a size":"Add to basket"}),r&&o(E,{href:r,className:G,children:"Open product page"})]})})}const Z="flex-1 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em]",J="flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40";function T(e,t){return!t||e.isSet&&!e.priced?"quote":e.priced?e.outOfStock?"outOfStock":"add":"unpriced"}function v({buy:e,takesOrders:t,add:n,take:r=R}){const i=T(e,t);return i==="quote"?o(g,{className:k("flex-1 cursor-pointer bg-btn px-6 py-4 text-center font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg",r.className)??"",attrs:r.attrs}):i!=="add"?o("button",{type:"button",disabled:!0,"aria-disabled":!0,className:k(J,r.className),...r.attrs,children:i==="outOfStock"?L.outOfStock:H}):b("button",{type:"button",[C]:"",onClick:()=>{const s=e.lineToAdd();s&&n(s)},"aria-disabled":!e.canAdd,className:k([`${Z} transition-colors`,e.canAdd?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),r.className),style:e.canAdd?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},...r.attrs,children:["Add to Cart",e.totalLabel!=null?` · ${e.totalLabel}`:""]})}const ee=()=>{};function te({buy:e,take:t}){const{addAndOpen:n}=A();return o(v,{buy:e,takesOrders:!0,add:r=>n(r),take:t})}function re({buy:e}){const t=x(),n=B();return n.scope(T(e,t)==="add"?o(te,{buy:e,take:n}):o(v,{buy:e,takesOrders:t,add:ee,take:n}))}function ne({buy:e=!0,page:t=!0}){const n=q(),r=I();if(n)return n.buy?o(re,{buy:n.buy}):null;if(!r)throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return r.kind==="bundle"?o(y,{}):r.kind==="tyre"?o(Y,{state:r}):o(Q,{state:r,buy:e,page:t})}function Ce(){const{wheel:e,sel:t,editing:n,notifyOpen:r,setNotifyOpen:i}=F();return r?o(w,{wheelName:e.name,productSlug:e.slug,finishName:t.confirmedFinishName,variants:t.outOfStockVariants,initialSize:t.selectedVariant?.size,onClose:()=>i(!1),editing:n}):null}export{K as CARD_PAGE_WORDS,Ce as CardBuyDialog,v as HeroBuyButton,ne as default};
1
+ "use client";import{jsx as n,jsxs as m}from"react/jsx-runtime";import D from"next/link";import{useEffect as h}from"react";import{useCart as A}from"../CartContext.js";import g from"../QuoteLink.js";import{NO_HIDE as R,useTakeViewHide as B,withViewHide as S}from"efficient-web-builder/render/components/ViewHideRoot";import{useSiteTakesOrders as k}from"../SiteRecordContext.js";import w from"../wheels-plp/PlpNotifyMeDialog.js";import{DEFAULT_PURCHASE_STATE as N}from"../../lib/catalog/purchase.js";import{ADD_TO_BASKET_ATTR as x}from"../../lib/commerce.js";import{STOCK_WORDS as L}from"../../lib/content/stock-words.js";import{tyreCartLine as z}from"../../lib/tyres/tyre-purchase.js";import{UNPRICED_LABEL as H,priceIn as P,resolveWheelPrice as $}from"../../lib/wheels/price-display.js";import{isOneWheelDesign as W,setLabel as I}from"../../lib/wheels/variants.js";import{splitWheelName as V}from"../../lib/wheels/wheel-name.js";import{CARD_TEXT_SIZE as C,CardButtonRow as y}from"./card-row.js";import{TYRE_BUY_CHIPS_CLASS as j,TyreSizeChips as q}from"./CardSizes.js";import{useHeroStateOrNull as F,useProductCardStateOrNull as U,useWheelCardState as G}from"./ProductCardState.js";const O="mt-3 flex flex-col gap-2",u=`cursor-pointer bg-btn px-4 py-3 font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-btn-ink transition-colors hover:bg-fg`,K=`border border-btn px-4 py-3 text-center font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-btn transition-colors hover:bg-btn hover:text-btn-ink`,Y="View sizes & fitment",M="mt-3 block font-mono text-[length:var(--size-label,11px)] font-bold uppercase tracking-[0.18em] text-accent underline-offset-4 group-hover:underline";function X({wheel:e,sel:t,price:o,editing:r}){const{addAndOpen:i,warmCatalog:s}=A();h(()=>{r||s()},[r,s]);const{arm:c}=t;h(()=>{c()},[c]);function d(){const a=t.selectedVariant;!a||!t.canAdd||o.priced&&(r||i({id:`${e.slug}|${a.finishName}|${a.size}|quick`,slug:e.slug,name:V(e.name),process:e.process,positionNo:"01",config:[{label:a.size},{label:a.finishName,gold:!0},{label:I(a)}],finishName:a.finishName,size:a.size,components:a.components,qty:1}))}return n("button",{type:"button",onClick:d,[x]:"",disabled:!t.canAdd,className:t.canAdd?u:`${u} opacity-80`,children:"Add to basket"})}function Q(e,t,o){return W(e)?t.outOfStock?"notify":t.unsellable||!o||t.detailState==="ready"&&!t.canAdd?"choose":"add":"choose"}function Z({state:e,buy:t,page:o}){const{wheel:r,sel:i,price:s,editing:c,setNotifyOpen:d}=e,a=k(),l=Q(r,i,s.priced),f=t?l==="notify"?n("button",{type:"button",onClick:()=>d(!0),className:u,children:"Notify me when back"}):l==="add"?a?n(X,{wheel:r,sel:i,price:s,editing:c}):n(g,{className:u}):null:null,p=!o||f?null:m("span",{"aria-hidden":!0,className:M,children:[Y," →"]});return n(y,{children:f||p?m("div",{className:O,children:[f,p]}):null})}function J({state:e}){const{tyre:t,currency:o,pagePath:r,detail:i,variant:s,canAdd:c,detailReady:d,unsellable:a,editing:l}=e,{addAndOpen:f,warmCatalog:p}=A(),b=k();h(()=>{!l&&b&&p("tyre")},[l,b,p]);const _=$(P(t.prices,o),null).priced;function E(){!i||!s||!c||l||f(z(i,s,N.choice,N.qty))}return m(y,{children:[n("div",{className:j,children:n(q,{state:e})}),m("div",{className:O,children:[!a&&_&&!b&&n(g,{className:u}),!a&&_&&b&&n("button",{type:"button",onClick:E,[x]:"",disabled:d&&!c,className:c||!d?`${u}${c?"":" opacity-80"}`:`cursor-not-allowed border border-dashed border-accent/50 px-4 py-3 font-mono ${C.labelSmall} font-bold uppercase tracking-[0.24em] text-accent/70`,children:d&&!c?"Select a size":"Add to basket"}),r&&n(D,{href:r,className:K,children:"Open product page"})]})]})}const ee="flex-1 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em]",te="flex-1 cursor-not-allowed border-2 border-dashed border-fg-dim/20 px-6 py-4 font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-fg-dim/40";function T(e,t){return!t||e.isSet&&!e.priced?"quote":e.priced?e.outOfStock?"outOfStock":"add":"unpriced"}function v({buy:e,takesOrders:t,add:o,take:r=R}){const i=T(e,t);return i==="quote"?n(g,{className:S("flex-1 cursor-pointer bg-btn px-6 py-4 text-center font-mono text-[length:var(--size-label,14px)] font-bold uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg",r.className)??"",attrs:r.attrs}):i!=="add"?n("button",{type:"button",disabled:!0,"aria-disabled":!0,className:S(te,r.className),...r.attrs,children:i==="outOfStock"?L.outOfStock:H}):m("button",{type:"button",[x]:"",onClick:()=>{const s=e.lineToAdd();s&&o(s)},"aria-disabled":!e.canAdd,className:S([`${ee} transition-colors`,e.canAdd?"cursor-pointer bg-btn text-btn-ink hover:bg-fg hover:text-bg":"cursor-pointer border-2 border-dashed border-accent/50 text-accent/80 hover:border-accent hover:text-accent"].join(" "),r.className),style:e.canAdd?void 0:{background:"color-mix(in oklab, var(--accent) 6%, transparent)"},...r.attrs,children:["Add to Cart",e.totalLabel!=null?` · ${e.totalLabel}`:""]})}const re=()=>{};function oe({buy:e,take:t}){const{addAndOpen:o}=A();return n(v,{buy:e,takesOrders:!0,add:r=>o(r),take:t})}function ne({buy:e}){const t=k(),o=B();return o.scope(T(e,t)==="add"?n(oe,{buy:e,take:o}):n(v,{buy:e,takesOrders:t,add:re,take:o}))}function ae({buy:e=!0,page:t=!0}){const o=F(),r=U();if(o)return o.buy?n(ne,{buy:o.buy}):null;if(!r)throw new Error("A product card piece was drawn outside a product card (no ProductCardState).");return r.kind==="bundle"?n(y,{}):r.kind==="tyre"?n(J,{state:r}):n(Z,{state:r,buy:e,page:t})}function _e(){const{wheel:e,sel:t,editing:o,notifyOpen:r,setNotifyOpen:i}=G();return r?n(w,{wheelName:e.name,productSlug:e.slug,finishName:t.confirmedFinishName,variants:t.outOfStockVariants,initialSize:t.selectedVariant?.size,onClose:()=>i(!1),editing:o}):null}export{Y as CARD_PAGE_WORDS,_e as CardBuyDialog,v as HeroBuyButton,ae as default};
@@ -1 +1 @@
1
- "use client";import{jsx as a}from"react/jsx-runtime";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{withRMark as l}from"efficient-web-builder/render/components/RMark";import{CARD_TEXT_SIZE as o,useCatalogCard as s}from"./card-row.js";import{useProductCardStateOrNull as c}from"./ProductCardState.js";import{RegionBridge as u,RegionWords as f,regionAttr as h}from"./card-text-region.js";function g({children:r,region:n,fixedHeight:d=!0}){const t=s(),e=c(),i=e?.kind==="wheel"?l(e.wheel.name):e?.kind==="bundle"?e.bundle.name:null;return r===void 0&&i===null&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty"),a(u,{region:n,sectionType:"ProductName",children:a(m,{...h(n,"name"),className:t&&!d?`font-heading3 ${o.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:t?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${o.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${o.headingSmall1} font-medium tracking-[-0.02em]`,children:a(f,{region:n,at:"name",children:r??i})})})}export{g as default};
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import{HideTaker as m}from"efficient-web-builder/render/components/ViewHideRoot";import{withRMark as l}from"efficient-web-builder/render/components/RMark";import{tyreModelLine as s}from"../../lib/tyres/tyre-brand-name.js";import{CARD_TEXT_SIZE as a,useCatalogCard as c}from"./card-row.js";import{useProductCardStateOrNull as u}from"./ProductCardState.js";import{RegionBridge as f,RegionWords as h,regionAttr as g}from"./card-text-region.js";function p({children:o,region:n,fixedHeight:d=!0}){const t=c(),e=u(),i=e?.kind==="wheel"?l(e.wheel.name):e?.kind==="bundle"?e.bundle.name:e?.kind==="tyre"?s(e.tyre.brand??"",e.tyre.name):null;return o===void 0&&i===null&&process.env.NODE_ENV!=="production"&&console.warn("[CardName] no name given and no wheel card state: the name block is empty"),r(f,{region:n,sectionType:"ProductName",children:r(m,{...g(n,"name"),className:t&&!d?`font-heading3 ${a.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:t?`mt-2 h-[60px] overflow-hidden break-words [.sf-card-rows_&]:h-auto [.sf-card-rows_&]:max-h-[60px] font-heading3 ${a.headingSmall2} font-medium uppercase leading-none tracking-[-0.02em]`:`mt-2 font-heading3 ${a.headingSmall1} font-medium tracking-[-0.02em]`,children:r(h,{region:n,at:"name",children:o??i})})})}export{p as default};
@@ -6,6 +6,9 @@ export interface CardProductPictureSettings {
6
6
  showBadge?: unknown;
7
7
  frame?: unknown;
8
8
  setPicture?: unknown;
9
+ swatch?: unknown;
10
+ shadow?: unknown;
11
+ shadowColor?: unknown;
9
12
  }
10
13
  export declare const PICTURE_FRAMES: readonly ["well", "full"];
11
14
  export type PictureFrame = (typeof PICTURE_FRAMES)[number];
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as m,Fragment as k}from"react/jsx-runtime";import v from"next/image";import{useState as Z}from"react";import{HideTaker as _}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as z,CARD_INDEX_CLASS as G,parseCardIndexFormat as q}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as B,cardImageBackgroundPaints as J,resolveCardImageBackground as D}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as N}from"efficient-web-builder/format/lib/content/card-image-shape";import{sayCount as Q}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as V,setSecondSrc as Y}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as ee,parseCoverIndex as re,resolvePaintedSrc as te}from"../../lib/wheels/cover-rendering.js";import ae from"../WheelPlaceholder.js";import{cardSpinOf as ne}from"../card-spin.js";import{useGridCard as R}from"../GridCardTemplate.js";import T from"./CardPicture.js";import A from"./CardProductBadge.js";import{useHeldCardPicture as le}from"./useHeldCardPicture.js";import{useProductCardState as se}from"./ProductCardState.js";const Ee=["well","full"],ie="well",L=r=>r==="full"?"full":ie;function oe({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function M({fill:r,badge:n,children:o}){const c=J(r);return m("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${c?"":" bg-surface"}`,style:c?{backgroundColor:r}:void 0,children:[o,n]})}function ce(r){const n=se();return n.kind==="bundle"?e(de,{state:n,...r}):n.kind!=="wheel"?null:e(me,{state:n,...r})}function de({state:r,imageBackground:n,cardImage:o,showBadge:c,frame:x}){const{bundle:s}=r,{imageSizes:p}=R(),f=L(x)==="full",i=s.components.length,t=s.image?f?e(v,{alt:s.name,src:s.image,fill:!0,sizes:p,className:"object-cover",draggable:!1}):e(v,{alt:s.name,src:s.image,width:1e3,height:1e3,sizes:p,className:"block h-full w-full object-cover",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:Q("{n} piece","{n} pieces",i,{})}),d=e(oe,{children:t}),g=D(n,B),u=c!==!1?e(A,{edge:f}):null;return e(_,{style:N(o),children:f?e(M,{fill:g,badge:u,children:d}):m(k,{children:[u,e(T,{image:d,imageBackgroundFill:g})]})})}function me({state:r,imageBackground:n,cardImage:o,coverIndex:c,indexBadge:x,showBadge:s,frame:p,setPicture:f}){const{wheel:i,sel:t,isSet:d}=r,{hover:g,imageSizes:u,fit:O,rules:S,setGridGap:U}=R(),C=ne(g),W=ee(i,re(c),t.finish?.name,t.shownSrc,O?.holes),[E,H]=Z(()=>new Set),y=a=>{t.pictureFailed(a),H(h=>h.has(a)?h:new Set(h).add(a))},I=te({overrideSrc:W,hookSrc:t.shownSrc,failed:E}),F=(a,h)=>e(v,{alt:h,src:a,width:1e3,height:1e3,sizes:u,className:`block h-full w-full object-contain ${C.className}`,style:C.style,draggable:!1,onError:()=>y(a)},a),X=t.finish?`${i.name} — ${t.finish.name}`:i.name,b=d&&V(f)==="pair",K=b?Y(i.finishes?.find(a=>a.name===t.finish?.name),I):null,l=le({src:I,second:K,alt:X,sizes:u,failed:E,onFailed:y,near:t.nearScreen,holdEmpty:t.awaitingProbe}),$=m(k,{children:[l.src?F(l.src,l.alt):e(ae,{imageLabel:i.name,spin:C}),l.trial]}),P=q(x),w=P!=="off",j=D(n,B);if(L(p)==="full"){const a=m(k,{children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets,edge:!0})]});return e(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:e(M,{fill:j,badge:a,children:m("div",{className:"flex h-full w-full items-center justify-center",children:[$,l.second?F(l.second,`${l.alt} — right`):null]})})})}return m(_,{style:N(o),"data-set-picture":d&&!b?"one":void 0,children:[w?e("span",{"aria-hidden":!0,"data-format":P,className:`${G} ${z}`}):null,e(A,{show:s!==!1,numbered:w,sale:S.sale,axleSets:S.axleSets}),e(T,{image:$,imageSecond:l.second?F(l.second,`${l.alt} — right`):void 0,wide:b,imageBackgroundFill:j,setGridGap:U})]})}export{ie as DEFAULT_PICTURE_FRAME,Ee as PICTURE_FRAMES,ce as default};
1
+ "use client";import{jsx as e,jsxs as c,Fragment as P}from"react/jsx-runtime";import A from"next/image";import{useState as re}from"react";import{HideTaker as k}from"efficient-web-builder/render/components/ViewHideRoot";import{CARD_INDEX_BADGE_CLASS as $,CARD_INDEX_CLASS as B,parseCardIndexFormat as U}from"efficient-web-builder/format/lib/sections/product-card-style";import{CARD_IMAGE_BG_OFF as te,cardImageBackgroundPaints as X,resolveCardImageBackground as ae}from"efficient-web-builder/format/lib/content/card-image-background";import{cardImageShapeTokens as v}from"efficient-web-builder/format/lib/content/card-image-shape";import{BOX_SWATCH_PROP as ne,boxSwatchFill as le}from"efficient-web-builder/format/lib/content/box-background";import{useCardRow as oe}from"efficient-web-builder/render/components/CardRowContext";import{pictureShadowFilter as ie}from"efficient-easel/screen/lib/document/shadow-values";import{sayCount as se}from"efficient-web-builder/format/lib/editor-words";import{parseSetPicture as ce,setSecondSrc as de}from"../../lib/wheels/set-mode.js";import{coverSrcForWheel as me,parseCoverIndex as fe,resolvePaintedSrc as ue}from"../../lib/wheels/cover-rendering.js";import he from"../WheelPlaceholder.js";import pe from"../BrandPlate.js";import ge from"../TyreImage.js";import{cardSpinOf as Se}from"../card-spin.js";import{useCardHoverLayer as be,useGridCard as E}from"../GridCardTemplate.js";import I from"./CardPicture.js";import z from"./CardProductBadge.js";import{useHeldCardPicture as we}from"./useHeldCardPicture.js";import{useProductCardState as Ce}from"./ProductCardState.js";const qe=["well","full"],Fe="well",j=r=>r==="full"?"full":Fe;function xe({children:r}){return e("div",{className:"h-full w-full transition-transform duration-500 motion-safe:group-hover:scale-[1.03]",children:r})}function R({fill:r,badge:t,children:i}){const d=X(r);return c("div",{className:`sf-card-image relative aspect-[4/3] overflow-hidden${d?"":" bg-surface"}`,style:d?{backgroundColor:r}:void 0,children:[i,t]})}function G(r,t){const i=oe();return le({[ne]:r},i?.row)??ae(t,te)}function ye(r){const t=Ce();return t.kind==="bundle"?e(Pe,{state:t,...r}):t.kind==="tyre"?e(ke,{state:t,...r}):t.kind!=="wheel"?null:e(ve,{state:t,...r})}function Pe({state:r,imageBackground:t,cardImage:i,showBadge:d,frame:S,swatch:f}){const{bundle:n}=r,{imageSizes:u}=E(),m=j(S)==="full",h=n.components.length,p=n.image?m?e(A,{alt:n.name,src:n.image,fill:!0,sizes:u,className:"object-cover",draggable:!1}):e(A,{alt:n.name,src:n.image,width:1e3,height:1e3,sizes:u,className:"block h-full w-full object-cover",draggable:!1}):e("div",{className:"flex h-full w-full items-center justify-center font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.3em] text-fg-dim",children:se("{n} piece","{n} pieces",h,{})}),l=e(xe,{children:p}),a=G(f,t),g=d!==!1?e(z,{edge:m}):null;return e(k,{style:v(i),children:m?e(R,{fill:a,badge:g,children:l}):c(P,{children:[g,e(I,{image:l,imageBackgroundFill:a})]})})}function ke({state:r,imageBackground:t,cardImage:i,indexBadge:d,frame:S,swatch:f}){const{tyre:n}=r,{imageSizes:u}=E(),m=G(f,t),h=U(d),p=h!=="off"?e("span",{"aria-hidden":!0,"data-format":h,className:`${B} ${$}`}):null,l=e(ge,{image:n.image,className:"h-full w-full",sizes:u,showBackground:!1}),a=e(pe,{brand:n.brand,logo:n.brandLogo});return e(k,{style:v(i),children:j(S)==="full"?c(R,{fill:m,badge:p,children:[l,a]}):c(P,{children:[p,e(I,{image:l,imageBackgroundFill:m,plate:a})]})})}function ve({state:r,imageBackground:t,cardImage:i,coverIndex:d,indexBadge:S,showBadge:f,frame:n,setPicture:u,swatch:m,shadow:h,shadowColor:p}){const{wheel:l,sel:a,isSet:g}=r,{hover:K,imageSizes:T,fit:Z,rules:w,setGridGap:q}=E(),C=Se(K),J=me(l,fe(d),a.finish?.name,a.shownSrc,Z?.holes),[D,Q]=re(()=>new Set),L=o=>{a.pictureFailed(o),Q(b=>b.has(o)?b:new Set(b).add(o))},H=ue({overrideSrc:J,hookSrc:a.shownSrc,failed:D}),O=l.rendersHaveAlpha===!0?ie(h,p):null,V=O?{...C.style,filter:O}:C.style,_=(o,b)=>e(A,{alt:b,src:o,width:1e3,height:1e3,sizes:T,className:`block h-full w-full object-contain ${C.className}`,style:V,draggable:!1,onError:()=>L(o)},o),Y=a.finish?`${l.name} — ${a.finish.name}`:l.name,F=g&&ce(u)==="pair",ee=F?de(l.finishes?.find(o=>o.name===a.finish?.name),H):null,s=we({src:H,second:ee,alt:Y,sizes:T,failed:D,onFailed:L,near:a.nearScreen,holdEmpty:a.awaitingProbe}),W=c(P,{children:[s.src?_(s.src,s.alt):e(he,{imageLabel:l.name,spin:C}),s.trial]}),N=U(S),x=N!=="off",y=G(m,t),M=be("picture",X(y)?y:void 0);if(j(n)==="full"){const o=c(P,{children:[x?e("span",{"aria-hidden":!0,"data-format":N,className:`${B} ${$}`}):null,e(z,{show:f!==!1,numbered:x,sale:w.sale,axleSets:w.axleSets,edge:!0})]});return e(k,{style:v(i),"data-set-picture":g&&!F?"one":void 0,children:c(R,{fill:y,badge:o,children:[c("div",{className:"flex h-full w-full items-center justify-center",children:[W,s.second?_(s.second,`${s.alt} — right`):null]}),M]})})}return c(k,{style:v(i),"data-set-picture":g&&!F?"one":void 0,children:[x?e("span",{"aria-hidden":!0,"data-format":N,className:`${B} ${$}`}):null,e(z,{show:f!==!1,numbered:x,sale:w.sale,axleSets:w.axleSets}),e(I,{image:W,imageSecond:s.second?_(s.second,`${s.alt} — right`):void 0,wide:F,imageBackgroundFill:y,setGridGap:q,plate:M})]})}export{Fe as DEFAULT_PICTURE_FRAME,qe as PICTURE_FRAMES,ye as default};