efficient-storefront-blocks 0.112.0 → 0.114.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 (61) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/chunks/{EditorPreviewCheckout-NBZP252D.js → EditorPreviewCheckout-KJ7WBAJJ.js} +4 -4
  3. package/dist/chunks/{SiteEditorProvider-6V6EJFTL.js → SiteEditorProvider-RH2SMNYG.js} +1 -1
  4. package/dist/chunks/chunk-H7576DO5.js +1 -0
  5. package/dist/chunks/chunk-P3DTJ3CI.js +1 -0
  6. package/dist/chunks/{chunk-7ZIXVUD7.js → chunk-WWVWTSGF.js} +2 -2
  7. package/dist/chunks/{fitment-data-7BV7JBDK.js → fitment-data-RALB36SU.js} +1 -1
  8. package/dist/contract.js +3 -3
  9. package/dist/editor/components/PostListStartsFromPage.d.ts +4 -0
  10. package/dist/editor/components/PostListStartsFromPage.js +1 -0
  11. package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
  12. package/dist/editor/lib/document/config.js +1 -1
  13. package/dist/editor/lib/storefront-editor-words.d.ts +2 -0
  14. package/dist/editor/lib/storefront-editor-words.js +1 -1
  15. package/dist/index.js +31 -29
  16. package/dist/links.js +1 -1
  17. package/dist/render/components/CartDrawer.js +1 -1
  18. package/dist/render/components/CartLineThumbnail.d.ts +3 -2
  19. package/dist/render/components/ConsentProvider.js +1 -1
  20. package/dist/render/components/DetailRows.d.ts +1 -0
  21. package/dist/render/components/DetailRows.js +1 -1
  22. package/dist/render/components/Events.d.ts +5 -2
  23. package/dist/render/components/Events.js +1 -1
  24. package/dist/render/components/OpeningHours.js +1 -1
  25. package/dist/render/components/PostListStartsProvider.d.ts +21 -0
  26. package/dist/render/components/PostListStartsProvider.js +1 -0
  27. package/dist/render/components/PublishedFooter.js +1 -1
  28. package/dist/render/components/PublishedHeader.js +1 -1
  29. package/dist/render/components/SignUpSection.js +1 -1
  30. package/dist/render/components/booking/BookingFormState.d.ts +4 -0
  31. package/dist/render/components/booking/BookingFormState.js +1 -1
  32. package/dist/render/components/booking/BookingRegions.js +1 -1
  33. package/dist/render/components/cart/drawer-parts.d.ts +3 -3
  34. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  35. package/dist/render/components/useTyreCatalog.d.ts +2 -1
  36. package/dist/render/components/useTyreCatalog.js +3 -1
  37. package/dist/render/lib/booking/appointment-time.d.ts +6 -2
  38. package/dist/render/lib/booking/appointment-time.js +1 -1
  39. package/dist/render/lib/checkout/hold-time.d.ts +1 -0
  40. package/dist/render/lib/checkout/hold-time.js +1 -0
  41. package/dist/render/lib/content/post-list-continue.d.ts +19 -0
  42. package/dist/render/lib/content/post-list-continue.js +1 -0
  43. package/dist/render/lib/document/blocks/service/Events/meta.js +1 -1
  44. package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
  45. package/dist/render/lib/document/current-record.d.ts +1 -0
  46. package/dist/render/lib/document/current-record.js +1 -1
  47. package/dist/render/lib/document/render-client.js +1 -1
  48. package/dist/render/lib/sections/opening-hours.d.ts +1 -1
  49. package/dist/render/lib/sections/opening-hours.js +1 -1
  50. package/dist/render/lib/sections/sign-up.d.ts +1 -1
  51. package/dist/render/lib/sections/sign-up.js +1 -1
  52. package/dist/render/lib/zone.d.ts +2 -0
  53. package/dist/render/lib/zone.js +1 -0
  54. package/dist/words.d.ts +2 -0
  55. package/dist/words.js +1 -1
  56. package/package.json +2 -2
  57. package/dist/chunks/chunk-IY3JZXIQ.js +0 -1
  58. package/dist/chunks/chunk-X6YHQFHP.js +0 -1
  59. /package/dist/chunks/{chunk-7UBABYIY.js → chunk-25XGYFU3.js} +0 -0
  60. /package/dist/chunks/{chunk-37WWMI27.js → chunk-ISCYSRBG.js} +0 -0
  61. /package/dist/chunks/{chunk-7ZIXVUD7.js.LEGAL.txt → chunk-WWVWTSGF.js.LEGAL.txt} +0 -0
package/dist/links.js CHANGED
@@ -1 +1 @@
1
- var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ie=["main","text","background","muted"],en=[...ie,"surface"];var nn={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var se=[{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 T=[{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}],le=["highlight","quiet"],tn=se.map(e=>e.style).filter(e=>T.some(n=>n.kind===e)).filter(e=>!le.includes(e)),rn=[...T,{open:"*",close:"*",kind:"accent"}],on=[...T,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function D(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 ae=["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 U(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 ae.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 ue(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],ce=["alloy-wheel"],F={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var ht=k.map(e=>({value:e,label:F[e]}));function pe(e){return e==null?[...ce]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...ce]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function $(e){return m(e).brand??""}function de(e){return m(e).prices??void 0}function fe(e){return m(e).inStock!==!1}function me(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function B(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function he(e){return B(e).map(n=>n.family)}function ge(e){if(f(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function ye(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function Pe(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function be(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function Se(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>U(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var W=e=>typeof e=="string"&&e?e:void 0;function H(e,n){return Object.hasOwn(e,n)?e[n]:void 0}function ke(e,n){return Object.hasOwn(e,n)}var xe=null;function Le(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>ke(n,r)?String(H(n,r)):t):e}function y(e,n){let t=xe?H(xe,e):void 0;if(typeof t=="function"){try{let r=W(t(n??{}));if(r)return r}catch{}return Le(e,n)}return Le(W(t)??e,n)}function Y(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var w=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),Lt=w(30,0,100,10),Tt=w(0,0,100,5),_t=w(100,0,100,5),Ft=w(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 _e="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 R(e){return e.offersCommerce&&e.offersService?A:A.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var G="#popup:";function Fe(e){return`${G}${e}`}function we(e){return e.startsWith(G)&&e.slice(G.length).trim()||null}function P(e){return e===_e?"/":`/${e}`}function E(e){return`/journal/${e}`}function O(e){return`/wheels/${e}`}function I(e,n){return`${P(e)}#${n}`}function N(...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=Y(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Ae(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 C(e,n,t){if(!e)return"page";if(we(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Ae(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 Re(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:N(...s.docs).map(u=>({value:I(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:E(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:Fe(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=R(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=>C(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=>C(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 Oe(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 Ie(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 Ne(e){return pn(e,"filter")}var cn="collection";function q(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)}function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ce(e,n){let t=e?.[n];return dn(t)?t:null}function ve(e,n,t,r){if(t==null&&r==null)return!0;let o=Ce(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function Ke(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"},pr=Object.keys(fn);var j=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Z={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 hn(e){if(e.length===0)return[];let n=j.filter(t=>e.every(r=>Z[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function gn(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Me={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function yn(e,n,t,r=null,o="fail"){let i=f(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":Z[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of j){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!ze(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=Ke(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!ve(de(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!fe(e))}var Pn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function ze(e,n){switch(n){case"tyreSizes":return[...new Set(Se(e).flatMap(ue))];case"brands":return $(e)?[$(e)]:[];case"finishes":return he(e);case"diameters":return me(e).map(String);case"collections":return ge(e);case"pcds":return ye(e);case"tyreTypes":return Pe(e);case"speedRatings":return be(e)}}function bn(e){let n=new Map;for(let t of e)for(let r of B(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function De(e,n,t,r=gn(e),o=Ee,i="fail"){let a=u=>kn(u,r,o),p=bn(e),c=(i==="pass"?j.filter(u=>r.some(S=>Z[u].includes(S))):hn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let S=n[u].map(String),oe=new Set,z=new Map,L=new Map;for(let d of e){let b=ze(d,u);for(let h of b)oe.add(h);for(let h of new Set(b))L.set(h,(L.get(h)??0)+1);if(yn(d,n,t,u,i))for(let h of new Set(b))z.set(h,(z.get(h)??0)+1)}let Je=[...oe].map(d=>({value:d,label:u==="diameters"?`${d}\u2033`:d,count:z.get(d)??0,checked:S.includes(d),swatch:u==="finishes"?p.get(d)??null:null})).sort((d,b)=>{if(u==="diameters")return Number(d.value)-Number(b.value);let h=(L.get(b.value)??0)-(L.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:u,label:Pn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let S=xn(u.key,r,o);S!==void 0&&s.push({fieldKey:u.key,filterOrder:S})}return[...Ie(c,u=>u.key,s,"filterOrder")]}var Sn=1;function Ue(e){return e.showCollection===!1?["collections"]:[]}function kn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ne(V(t,r))(q(e,r)))}function xn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Oe(V(t,o),"filter")(q(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var X={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},Q="type";var $e=e=>!!e&&typeof e=="object"&&!Array.isArray(e),v=e=>$e(e)&&typeof e.type=="string"&&$e(e.props),J=e=>Array.isArray(e)&&e.length>0&&e.every(v);function Be(e,n){let t=null;for(let[r,o]of Object.entries(e.props??{})){if(!J(o))continue;let i=n(o,r);i!==o&&((t??={...e.props})[r]=i)}return t?{...e,props:t}:e}var We="FilterBlock";var He="AlloyWheelsListing";function Ln(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 Tn(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)v(a)&&(n.push({node:a,order:n.length,lists:i}),Be(a,p=>(t(p,i),p)))};for(let r of Ln(e))t(r,[]);return n}function Ye(e){return Tn(e).map(n=>n.node)}function Ge(e){return D(e.trim())}var x="/wheels",K="Products";function Ve(e,n){return n>1?`${K} \xB7 ${e}`:K}function ee(...e){for(let n of[He,We])for(let t of e){let r=Ye({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function M(...e){return ee(...e)!==null}function qe(e,n){let t=e.filter(r=>M(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(x)?[...t,x]:t}var ne=[Q,...Object.entries(X).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function je(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(je(e).query);for(let t of ne){let r=n.get(t);if(r)return{param:t,value:r}}return null}function te(e,n){let{path:t,query:r,hash:o}=je(e),i=r.split("&").filter(a=>a&&!ne.includes(_n(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Xe(e,n){let t=te(e,null);return n.includes(t)?t:e}function Fn(e,n,t=[]){return C(e,n,{listingPaths:t,targetOf:r=>Xe(r,t)})}function wn(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 Qe="Product type",An="AUD";function re(e,n){let t=n.listing??{},r=pe(t.kinds),o=e.filter(l=>r.includes(f(l))),i=Ue(t),a=De(o,Me,An,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:X[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=>f(c)===l));return p.length>1&&a.unshift({param:Q,label:Qe,values:p.map(l=>({value:l,label:F[l]}))}),a}function Rn(e){return n=>{let t=qe(n,{fallback:e.offersCommerce}),r=n.filter(o=>M(...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&&M(...p.docs)?{...a,label:Ve(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===x)&&i.push({value:x,label:K}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return re(e.catalogue,{listing:i?ee(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:te}}}function En(e){let n=Rn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Re({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:O(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ge},filtersFor:t.filtersFor??(()=>null)}}function Cr(e,n){return re(e,n)}export{x as BUILT_IN_LISTING_PATH,A as LINK_KINDS,ne as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,Qe as PRODUCT_TYPE_FILTER_LABEL,I as anchorPath,wn as fieldUsageFromAdminRows,Fn as inferLinkKind,M as isProductListingPage,Ge as isSafeLink,R as linkKindsFor,En as linkPickerSetup,Cr as listingFilterFields,ee as listingNode,Ve as listingPageLabel,Xe as listingTarget,N as pageAnchors,P as pagePath,E as postPath,qe as productListingPaths,Ze as readListingFilter,O as wheelPath,te as withListingFilter};
1
+ var g={bold:{open:"**",close:"**",placeholder:"bold text"},italic:{open:"_",close:"_",placeholder:"italic text"},strike:{open:"~~",close:"~~",placeholder:"struck out"},code:{open:"`",close:"`",placeholder:"code"},highlight:{open:"==",close:"==",placeholder:"highlighted text"},quiet:{open:"^^",close:"^^",placeholder:"quiet text"},underline:{open:"[",close:"]{underline}",placeholder:"underlined text"},sup:{open:"[",close:"]{sup}",placeholder:"superscript"},sub:{open:"[",close:"]{sub}",placeholder:"subscript"}};var ie=["main","text","background","muted"],en=[...ie,"surface"];var nn={bold:g.bold.placeholder,italic:g.italic.placeholder,strike:g.strike.placeholder,code:g.code.placeholder,highlight:g.highlight.placeholder,quiet:g.quiet.placeholder,link:"link text",underline:g.underline.placeholder,sup:g.sup.placeholder,sub:g.sub.placeholder,color:"colored text",style:"styled text"};var se=[{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 T=[{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}],le=["highlight","quiet"],tn=se.map(e=>e.style).filter(e=>T.some(n=>n.kind===e)).filter(e=>!le.includes(e)),rn=[...T,{open:"*",close:"*",kind:"accent"}],on=[...T,{open:"*",close:"*",kind:"accent"},{open:"#",close:"#",kind:"bold",notBefore:"0123456789"},{open:"[",close:"]",kind:"italic",notBefore:"(",notBeforeBlock:!0}];var sn=["http","https","mailto","tel"];function D(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 ae=["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 U(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 ae.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 ue(e){return[_({width:e.width}),_({width:e.width,profile:e.profile}),_(e)]}var k=["alloy-wheel","tyre"],ce=["alloy-wheel"],F={"alloy-wheel":"Alloy wheels",tyre:"Tyres"};var ht=k.map(e=>({value:e,label:F[e]}));function pe(e){return e==null?[...ce]:Array.isArray(e)?k.filter(n=>e.includes(n)):[...ce]}var m=e=>e;function f(e){return m(e).kind==="tyre"?"tyre":"alloy-wheel"}function $(e){return m(e).brand??""}function de(e){return m(e).prices??void 0}function fe(e){return m(e).inStock!==!1}function me(e){let n=m(e),t=f(e)==="tyre"?n.rimDiameters:n.sizes;return Array.isArray(t)?t.filter(r=>typeof r=="number"&&Number.isFinite(r)):[]}function B(e){return f(e)==="tyre"?[]:(m(e).finishes??[]).filter(n=>typeof n?.family=="string").map(n=>({family:n.family,color:n.color??null}))}function he(e){return B(e).map(n=>n.family)}function ge(e){if(f(e)==="tyre")return[];let n=m(e);return Array.isArray(n.categories)?n.categories:n.process?[n.process]:[]}function ye(e){return f(e)==="tyre"?[]:m(e).spec?.pcds??[]}function Pe(e){return f(e)!=="tyre"?[]:m(e).tyreTypes??[]}function be(e){return f(e)!=="tyre"?[]:m(e).speedRatings??[]}function Se(e){if(f(e)!=="tyre")return[];let n=m(e).sizes;return Array.isArray(n)?n.map(t=>U(typeof t=="string"?t:null)).filter(t=>t!==null):[]}var W=e=>typeof e=="string"&&e?e:void 0;function H(e,n){return Object.hasOwn(e,n)?e[n]:void 0}function ke(e,n){return Object.hasOwn(e,n)}var xe=null;function Le(e,n){return n?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>ke(n,r)?String(H(n,r)):t):e}function y(e,n){let t=xe?H(xe,e):void 0;if(typeof t=="function"){try{let r=W(t(n??{}));if(r)return r}catch{}return Le(e,n)}return Le(W(t)??e,n)}function Y(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var w=(e,n,t,r)=>({default:e,min:n,max:t,step:r}),Lt=w(30,0,100,10),Tt=w(0,0,100,5),_t=w(100,0,100,5),Ft=w(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 _e="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 R(e){return e.offersCommerce&&e.offersService?A:A.filter(n=>!n.needs||(n.needs==="commerce"?e.offersCommerce:e.offersService))}var G="#popup:";function Fe(e){return`${G}${e}`}function we(e){return e.startsWith(G)&&e.slice(G.length).trim()||null}function P(e){return e===_e?"/":`/${e}`}function E(e){return`/journal/${e}`}function O(e){return`/wheels/${e}`}function I(e,n){return`${P(e)}#${n}`}function N(...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=Y(i);!a||n.has(a)||(n.add(a),t.push({slug:a,name:i}))}return t}function Ae(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 C(e,n,t){if(!e)return"page";if(we(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(Ae(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 Re(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:N(...s.docs).map(u=>({value:I(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:E(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:Fe(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=R(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=>C(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=>C(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 Oe(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 Ie(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 Ne(e){return pn(e,"filter")}var cn="collection";function q(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)}function dn(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ce(e,n){let t=e?.[n];return dn(t)?t:null}function ve(e,n,t,r){if(t==null&&r==null)return!0;let o=Ce(e,n);return!(o===null||t!=null&&o<t||r!=null&&o>r)}function Ke(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"},pr=Object.keys(fn);var j=["tyreSizes","brands","finishes","diameters","collections","pcds","tyreTypes","speedRatings"],Z={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 hn(e){if(e.length===0)return[];let n=j.filter(t=>e.every(r=>Z[t].includes(r)));return n.filter(t=>{let r=mn[t];return!r||!n.includes(r)})}function gn(e){let n=new Set;for(let t of e)n.add(f(t));return[...n]}var Me={tyreSizes:[],brands:[],finishes:[],diameters:[],collections:[],pcds:[],tyreTypes:[],speedRatings:[],priceMax:null,priceMin:null,inStockOnly:!1,kind:null,sort:"recommended",page:1};function yn(e,n,t,r=null,o="fail"){let i=f(e),a=p=>o==="fail"||(p==="lugs"?i==="alloy-wheel":Z[p].includes(i));if(r!=="kind"&&n.kind&&i!==n.kind)return!1;for(let p of j){if(r===p)continue;let l=n[p];if(l.length===0||!a(p))continue;let c=l.map(String);if(!ze(e,p).some(s=>c.includes(s)))return!1}if(r!=="lugs"&&n.lugs&&n.lugs.length>0&&a("lugs")){let p=Ke(e);if(p===null||!n.lugs.includes(p))return!1}return!(r!=="price"&&!ve(de(e),t,n.priceMin??null,n.priceMax)||r!=="inStock"&&n.inStockOnly&&!fe(e))}var Pn={tyreSizes:"Size",brands:"Brand",finishes:"Colour",diameters:"Size \xB7 diameter",collections:"Collection",pcds:"PCD \xB7 fitment",tyreTypes:"Tyre type",speedRatings:"Speed rating"};function ze(e,n){switch(n){case"tyreSizes":return[...new Set(Se(e).flatMap(ue))];case"brands":return $(e)?[$(e)]:[];case"finishes":return he(e);case"diameters":return me(e).map(String);case"collections":return ge(e);case"pcds":return ye(e);case"tyreTypes":return Pe(e);case"speedRatings":return be(e)}}function bn(e){let n=new Map;for(let t of e)for(let r of B(t))r.color&&!n.has(r.family)&&n.set(r.family,r.color);return n}function De(e,n,t,r=gn(e),o=Ee,i="fail"){let a=u=>kn(u,r,o),p=bn(e),c=(i==="pass"?j.filter(u=>r.some(S=>Z[u].includes(S))):hn(r)).filter(u=>u!=="tyreSizes").filter(a).map(u=>{let S=n[u].map(String),oe=new Set,z=new Map,L=new Map;for(let d of e){let b=ze(d,u);for(let h of b)oe.add(h);for(let h of new Set(b))L.set(h,(L.get(h)??0)+1);if(yn(d,n,t,u,i))for(let h of new Set(b))z.set(h,(z.get(h)??0)+1)}let Je=[...oe].map(d=>({value:d,label:u==="diameters"?`${d}\u2033`:d,count:z.get(d)??0,checked:S.includes(d),swatch:u==="finishes"?p.get(d)??null:null})).sort((d,b)=>{if(u==="diameters")return Number(d.value)-Number(b.value);let h=(L.get(b.value)??0)-(L.get(d.value)??0);return h!==0?h:d.value.localeCompare(b.value)});return{key:u,label:Pn[u],options:Je}}).filter(u=>u.options.length>Sn),s=[];for(let u of c){let S=xn(u.key,r,o);S!==void 0&&s.push({fieldKey:u.key,filterOrder:S})}return[...Ie(c,u=>u.key,s,"filterOrder")]}var Sn=1;function Ue(e){return e.showCollection===!1?["collections"]:[]}function kn(e,n,t){return n.length===0||t.length===0?!0:n.some(r=>Ne(V(t,r))(q(e,r)))}function xn(e,n,t){if(t.length===0)return;let r;for(let o of n){let i=Oe(V(t,o),"filter")(q(e,o));i!==void 0&&(r===void 0||i<r)&&(r=i)}return r}var X={tyreSizes:"tyreSize",brands:"brand",finishes:"colour",diameters:"size",collections:"collection",pcds:"pcd",tyreTypes:"tyreType",speedRatings:"speed"},Q="type";var $e=e=>!!e&&typeof e=="object"&&!Array.isArray(e),v=e=>$e(e)&&typeof e.type=="string"&&$e(e.props);var J=e=>Array.isArray(e)&&e.length>0&&e.every(v);function Be(e,n){let t=null;for(let[r,o]of Object.entries(e.props??{})){if(!J(o))continue;let i=n(o,r);i!==o&&((t??={...e.props})[r]=i)}return t?{...e,props:t}:e}var We="FilterBlock";var He="AlloyWheelsListing";function Ln(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 Tn(e){let n=[],t=(r,o)=>{let i=[r,...o];for(let a of r)v(a)&&(n.push({node:a,order:n.length,lists:i}),Be(a,p=>(t(p,i),p)))};for(let r of Ln(e))t(r,[]);return n}function Ye(e){return Tn(e).map(n=>n.node)}function Ge(e){return D(e.trim())}var x="/wheels",K="Products";function Ve(e,n){return n>1?`${K} \xB7 ${e}`:K}function ee(...e){for(let n of[He,We])for(let t of e){let r=Ye({content:t?.content}).find(o=>o.type===n);if(r)return r.props??{}}return null}function M(...e){return ee(...e)!==null}function qe(e,n){let t=e.filter(r=>M(...r.docs)).map(r=>P(r.slug));return n.fallback&&!t.includes(x)?[...t,x]:t}var ne=[Q,...Object.entries(X).filter(([e])=>e!=="tyreSizes").map(([,e])=>e)];function je(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(je(e).query);for(let t of ne){let r=n.get(t);if(r)return{param:t,value:r}}return null}function te(e,n){let{path:t,query:r,hash:o}=je(e),i=r.split("&").filter(a=>a&&!ne.includes(_n(a.split("=")[0])));return n?.value&&i.push(`${encodeURIComponent(n.param)}=${encodeURIComponent(n.value)}`),`${t}${i.length?`?${i.join("&")}`:""}${o}`}function Xe(e,n){let t=te(e,null);return n.includes(t)?t:e}function Fn(e,n,t=[]){return C(e,n,{listingPaths:t,targetOf:r=>Xe(r,t)})}function wn(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 Qe="Product type",An="AUD";function re(e,n){let t=n.listing??{},r=pe(t.kinds),o=e.filter(l=>r.includes(f(l))),i=Ue(t),a=De(o,Me,An,r,n.fieldUsage).filter(l=>!i.includes(l.key)).map(l=>({param:X[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=>f(c)===l));return p.length>1&&a.unshift({param:Q,label:Qe,values:p.map(l=>({value:l,label:F[l]}))}),a}function Rn(e){return n=>{let t=qe(n,{fallback:e.offersCommerce}),r=n.filter(o=>M(...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&&M(...p.docs)?{...a,label:Ve(p.title,r)}:a});return r===0&&e.offersCommerce&&!i.some(a=>a.value===x)&&i.push({value:x,label:K}),i},filtersFor:o=>{if(!t.includes(o))return null;let i=n.find(a=>P(a.slug)===o);return re(e.catalogue,{listing:i?ee(...i.docs):null,fieldUsage:e.fieldUsage})},readFilter:Ze,withFilter:te}}}function En(e){let n=Rn({catalogue:e.catalogue,fieldUsage:e.fieldUsage,offersCommerce:e.offers.offersCommerce})(e.pages),t=Re({pages:e.pages,posts:e.posts,products:e.products.map(r=>({href:O(r.slug),name:r.name||r.slug})),offers:e.offers},n);return{...t,rules:{...t.rules,isSafe:Ge},filtersFor:t.filtersFor??(()=>null)}}function vr(e,n){return re(e,n)}export{x as BUILT_IN_LISTING_PATH,A as LINK_KINDS,ne as LISTING_FILTER_PARAMS,K as LISTING_PAGE_LABEL,Qe as PRODUCT_TYPE_FILTER_LABEL,I as anchorPath,wn as fieldUsageFromAdminRows,Fn as inferLinkKind,M as isProductListingPage,Ge as isSafeLink,R as linkKindsFor,En as linkPickerSetup,vr as listingFilterFields,ee as listingNode,Ve as listingPageLabel,Xe as listingTarget,N as pageAnchors,P as pagePath,E as postPath,qe as productListingPaths,Ze as readListingFilter,O as wheelPath,te as withListingFilter};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as p,useRef as f}from"react";import{useCart as u}from"./CartContext.js";import{isTyreLine as C}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as d}from"./useTyreCatalog.js";import R from"./PopupFrame.js";import{CartActions as w,CartCouponRow as T,CartDrawerHeader as x,CartLines as O,CartStatusRail as _,CartTotals as v,CartTrustMarkers as y,CartUpsell as A}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as D,resolveCartDrawerLook as L}from"efficient-web-builder/format/lib/content/cart-drawer";const h=L(void 0);function j({content:e=D,look:o=h}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:t}=u(),s=f(null),m=d(c.some(C));return p(()=>{t(o.autoOpen)},[o.autoOpen,t]),a(R,{look:o,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:"Your cart",children:[r(x,{content:e,closeRef:s}),r(_,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(O,{content:e,tyres:m}),r(A,{}),r(T,{}),r(y,{content:e})]}),r(v,{}),r(w,{})]})}export{j as default};
1
+ "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import{useEffect as m,useRef as u}from"react";import{useCart as C}from"./CartContext.js";import{isTyreLine as d}from"../lib/tyres/tyre-purchase.js";import{useTyreCatalog as R}from"./useTyreCatalog.js";import w from"./PopupFrame.js";import{CartActions as T,CartCouponRow as x,CartDrawerHeader as O,CartLines as _,CartStatusRail as v,CartTotals as y,CartTrustMarkers as A,CartUpsell as D}from"./cart/drawer-parts.js";import{CART_DRAWER_DEFAULTS as L,resolveCartDrawerLook as h}from"efficient-web-builder/format/lib/content/cart-drawer";const j=h(void 0);function E({content:e=L,look:t=j}){const{isOpen:l,preview:n,close:i,items:c,setAutoOpen:o}=C(),s=u(null),p=R(c.filter(d).map(f=>f.slug));return m(()=>{o(t.autoOpen)},[t.autoOpen,o]),a(w,{look:t,drawer:{closeRef:s,lockScroll:!n},open:l,onClose:i,label:"Your cart",children:[r(O,{content:e,closeRef:s}),r(v,{content:e}),a("div",{className:"flex-1 overflow-y-auto [scrollbar-color:var(--site-line)_transparent] [scrollbar-width:thin]",children:[r(_,{content:e,tyres:p}),r(D,{}),r(x,{}),r(A,{content:e})]}),r(y,{}),r(T,{})]})}export{E as default};
@@ -1,8 +1,9 @@
1
1
  import type { CartLine } from "./CartContext.js";
2
- import type { TyreSummary, WheelSummary } from "../lib/api/index.js";
2
+ import type { TyreThumbnail } from "./useTyreCatalog.js";
3
+ import type { WheelSummary } from "../lib/api/index.js";
3
4
  export interface CartLineThumbnailProps {
4
5
  line: CartLine;
5
6
  catalog: WheelSummary[];
6
- tyre?: TyreSummary | null;
7
+ tyre?: TyreThumbnail | null;
7
8
  }
8
9
  export default function CartLineThumbnail({ line, catalog, tyre }: CartLineThumbnailProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as g}from"react/jsx-runtime";import{useCallback as m,useEffect as u,useMemo as h,useState as d}from"react";import{safeLocalStorage as w}from"efficient-web-builder/format/lib/safe-storage";import{bannerWords as O,CONSENT_RULES as N,visitorRegion as P}from"../lib/consent/rules.js";import{browserSendsGpc as x,NOT_ASKED as E,readStoredChoice as T,resolveConsent as H,setConsent as R,writeStoredChoice as _}from"../lib/consent/choice.js";import{COUNTRY_STORAGE_KEY as j,useActiveCountry as A}from"./CurrencyContext.js";import{ConsentBannerView as k}from"./ConsentBanner.js";import{ConsentPanelView as D,NoTrackingPanelView as G}from"./ConsentPanel.js";import{ConsentControlsContext as I,ConsentStateContext as V,PENDING as K}from"./ConsentContext.js";function L(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone??""}catch{return""}}function J({consent:e,children:f}){const[o,p]=d(e.enabled?K:E),[r,C]=d(!e.enabled),[i,t]=d(!1),v=A(),a=m(()=>{const c=P(L(),w.getItem(j));return H({asked:e.enabled,region:c,stored:T(),gpc:x()})},[e.enabled]);u(()=>{p(a()),C(!0)},[a,v]),u(()=>{R(o)},[o]);const l=m(c=>{_(c),p(a()),t(!1)},[a]),s=N[o.region],y=h(()=>({state:o,rule:s,ready:r,openPanel:()=>t(!0)}),[o,s,r]),b=e.enabled&&r&&o.model==="opt-in"&&!o.chosen,S=e.enabled&&r&&o.model==="opt-out"&&!o.chosen&&!o.gpc&&e.noticeOptOut;return n(V.Provider,{value:o,children:g(I.Provider,{value:y,children:[f,(b||S)&&!i&&n(k,{model:o.model,words:O(s,e.brand,e.tags),layout:e.layout,privacyHref:e.privacyHref,onAccept:()=>l({analytics:!0,ads:!0}),onReject:()=>l({analytics:!1,ads:!1}),onChoose:()=>t(!0)}),!e.enabled&&n(G,{open:i,privacyHref:e.privacyHref,onClose:()=>t(!1)}),e.enabled&&r&&n(D,{open:i,rule:s,analytics:o.analytics,ads:o.ads,gpc:o.gpc,privacyHref:e.privacyHref,onSave:l,onClose:()=>t(!1)})]})})}export{J as ConsentProvider};
1
+ "use client";import{jsx as n,jsxs as g}from"react/jsx-runtime";import{useCallback as f,useEffect as m,useMemo as h,useState as d}from"react";import{safeLocalStorage as w}from"efficient-web-builder/format/lib/safe-storage";import{bannerWords as N,CONSENT_RULES as O,visitorRegion as P}from"../lib/consent/rules.js";import{userZone as x}from"efficient-shell/format";import{browserSendsGpc as E,NOT_ASKED as H,readStoredChoice as R,resolveConsent as _,setConsent as j,writeStoredChoice as A}from"../lib/consent/choice.js";import{COUNTRY_STORAGE_KEY as T,useActiveCountry as k}from"./CurrencyContext.js";import{ConsentBannerView as G}from"./ConsentBanner.js";import{ConsentPanelView as V,NoTrackingPanelView as D}from"./ConsentPanel.js";import{ConsentControlsContext as I,ConsentStateContext as K,PENDING as L}from"./ConsentContext.js";function Q({consent:e,children:u}){const[o,p]=d(e.enabled?L:H),[r,C]=d(!e.enabled),[l,t]=d(!1),v=k(),a=f(()=>{const c=P(x()??"",w.getItem(T));return _({asked:e.enabled,region:c,stored:R(),gpc:E()})},[e.enabled]);m(()=>{p(a()),C(!0)},[a,v]),m(()=>{j(o)},[o]);const i=f(c=>{A(c),p(a()),t(!1)},[a]),s=O[o.region],y=h(()=>({state:o,rule:s,ready:r,openPanel:()=>t(!0)}),[o,s,r]),b=e.enabled&&r&&o.model==="opt-in"&&!o.chosen,S=e.enabled&&r&&o.model==="opt-out"&&!o.chosen&&!o.gpc&&e.noticeOptOut;return n(K.Provider,{value:o,children:g(I.Provider,{value:y,children:[u,(b||S)&&!l&&n(G,{model:o.model,words:N(s,e.brand,e.tags),layout:e.layout,privacyHref:e.privacyHref,onAccept:()=>i({analytics:!0,ads:!0}),onReject:()=>i({analytics:!1,ads:!1}),onChoose:()=>t(!0)}),!e.enabled&&n(D,{open:l,privacyHref:e.privacyHref,onClose:()=>t(!1)}),e.enabled&&r&&n(V,{open:l,rule:s,analytics:o.analytics,ads:o.ads,gpc:o.gpc,privacyHref:e.privacyHref,onSave:i,onClose:()=>t(!1)})]})})}export{Q as ConsentProvider};
@@ -3,6 +3,7 @@ import type { SourceRow } from "efficient-web-builder/format/lib/content/block-s
3
3
  export interface DetailSpec {
4
4
  label?: string;
5
5
  value?: string;
6
+ at?: string;
6
7
  }
7
8
  export interface DetailRow {
8
9
  image?: string;
@@ -1 +1 @@
1
- import{jsx as i,jsxs as o}from"react/jsx-runtime";import k from"./SectionBand.js";import R from"efficient-web-builder/render/components/Placeholder";import{withRMark as c}from"efficient-web-builder/render/components/RMark";import{renderGold as b}from"efficient-web-builder/render/components/goldPhrases";import{say as g}from"efficient-web-builder/format/lib/editor-words";import{stripMarkup as j}from"efficient-web-builder/format/lib/markup";import{bandPadAttrs as _}from"efficient-web-builder/render/lib/content/section-padding";import{DETAIL_ROWS_ROOM as z,withBandClasses as C}from"../lib/sections/band-padding.js";import{CardTemplateRows as S}from"efficient-web-builder/render/components/CardRowContext";const p={body:"text-[length:var(--size-body,15px)]",labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function T(t){return{eyebrow:t.eyebrow?.trim()?t.eyebrow:"",title:t.title?.trim()?t.title:"",copy:t.copy?.trim()?t.copy:"",image:t.image?.trim()?t.image:"",tag:t.tag?.trim()?t.tag:""}}function $(t){return t.every(r=>!r.media&&!(r.specs??[]).some(n=>(n?.label??"").trim()||(n?.value??"").trim()))}const O="[&:not(:first-child)]:border-t [&:not(:first-child)]:border-line";function D({rows:t,startLeft:r=!1,layout:n="even",pads:v,editing:u=!1,template:y,nodeId:w}){const a=n==="narrow",f=_(v??{},z),x=(t??[]).filter(e=>(e?.eyebrow??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.tag??"").trim()||(e?.image??"").trim()),m=x.length>0?x:u?[{tag:g("Row {n}",{n:1})},{tag:g("Row {n}",{n:2})},{tag:g("Row {n}",{n:3})}]:[];return m.length===0?null:i(k,{className:C("relative z-[2] border-b border-line bg-bg",f),style:f.style,children:i(S,{ownerId:w??"",ownerType:"DetailRows",Template:$(m)?y:void 0,rows:m.map(T),fallback:m.map((e,s)=>{const d=s%2===1!==r;return o("div",{className:["grid items-center py-[60px]",a?"grid-cols-[1fr_460px] gap-[72px]":"grid-cols-2 gap-12","max-view-desktop:grid-cols-1",d?"[direction:rtl] max-view-desktop:[direction:ltr]":"",s>0?"border-t border-line":""].join(" "),children:[o("div",{className:["[direction:ltr] flex flex-col gap-4",a?"max-w-[560px]":"",a&&!d?"ml-auto max-view-desktop:ml-0":""].join(" "),children:[e.eyebrow?.trim()&&i("div",{className:`font-mono ${p.labelLarge} uppercase tracking-[0.2em] text-accent`,children:c(e.eyebrow)}),e.title?.trim()&&i("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3vw,42px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[1.1] tracking-[-0.02em]",children:b(e.title,!0)}),e.copy?.trim()&&i("p",{className:`${p.body} leading-[1.6] text-fg-dim`,children:b(e.copy,!1)}),(()=>{const h=(e.specs??[]).filter(l=>(l?.label??"").trim()||(l?.value??"").trim());return h.length===0?null:i("dl",{className:`mt-2 border-t border-line pt-3 font-mono ${p.label} uppercase tracking-[0.1em] leading-[2.1]`,children:h.map((l,N)=>o("div",{className:"flex items-baseline justify-between gap-6",children:[i("dt",{className:"text-fg-dim",children:c(l.label??"")}),i("dd",{className:"text-fg",children:c(l.value??"")})]},N))})})()]}),o("div",{className:["[direction:ltr] flex flex-col gap-3",a?d?"items-end":"items-start":"",a?"max-view-desktop:items-start":""].join(" "),children:[e.media?i("div",{className:"w-full",children:e.media}):i("div",{className:["relative overflow-hidden max-w-full",a?e.imageShape==="wide"?"w-[460px] aspect-[16/9]":"w-[360px] aspect-square":"aspect-square"].join(" "),children:i(R,{label:e.tag?.trim()||e.title?.trim()||`row-${s+1}`,src:e.image||void 0,alt:j(e.title?.trim()||e.tag?.trim()||""),showBackground:!e.image,objectFit:"contain",sizes:a?"(max-width: 1100px) 100vw, 460px":"(max-width: 1100px) 100vw, 50vw"})}),e.tag?.trim()&&i("span",{className:`font-mono ${p.labelSmall} uppercase tracking-[0.2em] text-fg-dim ${d?"text-left":"text-right"}`,children:c(e.tag)})]})]},s)}),wrapCopy:e=>i("div",{className:O,children:e}),children:e=>e})})}export{D as default,T as detailCardRow,$ as templateCanDraw};
1
+ import{jsx as a,jsxs as o}from"react/jsx-runtime";import R from"./SectionBand.js";import j from"efficient-web-builder/render/components/Placeholder";import _ from"efficient-web-builder/render/components/PostDate";import{withRMark as d}from"efficient-web-builder/render/components/RMark";import{renderGold as h}from"efficient-web-builder/render/components/goldPhrases";import{say as p}from"efficient-web-builder/format/lib/editor-words";import{stripMarkup as z}from"efficient-web-builder/format/lib/markup";import{bandPadAttrs as S}from"efficient-web-builder/render/lib/content/section-padding";import{DETAIL_ROWS_ROOM as C,withBandClasses as T}from"../lib/sections/band-padding.js";import{CardTemplateRows as $}from"efficient-web-builder/render/components/CardRowContext";const c={body:"text-[length:var(--size-body,15px)]",labelSmall:"text-[length:var(--size-label,11px)]",label:"text-[length:var(--size-label,12px)]",labelLarge:"text-[length:var(--size-label,13px)]"};function D(t){return{eyebrow:t.eyebrow?.trim()?t.eyebrow:"",title:t.title?.trim()?t.title:"",copy:t.copy?.trim()?t.copy:"",image:t.image?.trim()?t.image:"",tag:t.tag?.trim()?t.tag:""}}function O(t){return t.every(l=>!l.media&&!(l.specs??[]).some(b))}const b=t=>!!((t?.label??"").trim()||(t?.value??"").trim()||(t?.at??"").trim()),B="[&:not(:first-child)]:border-t [&:not(:first-child)]:border-line";function L({rows:t,startLeft:l=!1,layout:v="even",pads:u,editing:y=!1,template:w,nodeId:N}){const i=v==="narrow",g=S(u??{},C),f=(t??[]).filter(e=>(e?.eyebrow??"").trim()||(e?.title??"").trim()||(e?.copy??"").trim()||(e?.tag??"").trim()||(e?.image??"").trim()),r=f.length>0?f:y?[{tag:p("Row {n}",{n:1})},{tag:p("Row {n}",{n:2})},{tag:p("Row {n}",{n:3})}]:[];return r.length===0?null:a(R,{className:T("relative z-[2] border-b border-line bg-bg",g),style:g.style,children:a($,{ownerId:N??"",ownerType:"DetailRows",Template:O(r)?w:void 0,rows:r.map(D),fallback:r.map((e,n)=>{const s=n%2===1!==l;return o("div",{className:["grid items-center py-[60px]",i?"grid-cols-[1fr_460px] gap-[72px]":"grid-cols-2 gap-12","max-view-desktop:grid-cols-1",s?"[direction:rtl] max-view-desktop:[direction:ltr]":"",n>0?"border-t border-line":""].join(" "),children:[o("div",{className:["[direction:ltr] flex flex-col gap-4",i?"max-w-[560px]":"",i&&!s?"ml-auto max-view-desktop:ml-0":""].join(" "),children:[e.eyebrow?.trim()&&a("div",{className:`font-mono ${c.labelLarge} uppercase tracking-[0.2em] text-accent`,children:d(e.eyebrow)}),e.title?.trim()&&a("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,clamp(28px,3vw,42px)),var(--sf-heading-max,9999px))] [font-weight:var(--sf-heading-weight,500)] [&_em]:[font-weight:var(--sf-heading-weight-strong,inherit)] leading-[1.1] tracking-[-0.02em]",children:h(e.title,!0)}),e.copy?.trim()&&a("p",{className:`${c.body} leading-[1.6] text-fg-dim`,children:h(e.copy,!1)}),(()=>{const x=(e.specs??[]).filter(b);return x.length===0?null:a("dl",{className:`mt-2 border-t border-line pt-3 font-mono ${c.label} uppercase tracking-[0.1em] leading-[2.1]`,children:x.map((m,k)=>o("div",{className:"flex items-baseline justify-between gap-6",children:[a("dt",{className:"text-fg-dim",children:d(m.label??"")}),a("dd",{className:"text-fg",children:m.at?a(_,{at:m.at}):d(m.value??"")})]},k))})})()]}),o("div",{className:["[direction:ltr] flex flex-col gap-3",i?s?"items-end":"items-start":"",i?"max-view-desktop:items-start":""].join(" "),children:[e.media?a("div",{className:"w-full",children:e.media}):a("div",{className:["relative overflow-hidden max-w-full",i?e.imageShape==="wide"?"w-[460px] aspect-[16/9]":"w-[360px] aspect-square":"aspect-square"].join(" "),children:a(j,{label:e.tag?.trim()||e.title?.trim()||`row-${n+1}`,src:e.image||void 0,alt:z(e.title?.trim()||e.tag?.trim()||""),showBackground:!e.image,objectFit:"contain",sizes:i?"(max-width: 1100px) 100vw, 460px":"(max-width: 1100px) 100vw, 50vw"})}),e.tag?.trim()&&a("span",{className:`font-mono ${c.labelSmall} uppercase tracking-[0.2em] text-fg-dim ${s?"text-left":"text-right"}`,children:d(e.tag)})]})]},n)}),wrapCopy:e=>a("div",{className:B,children:e}),children:e=>e})})}export{L as default,D as detailCardRow,O as templateCanDraw};
@@ -1,4 +1,7 @@
1
1
  import { type EventPost } from "efficient-web-builder/render/components/PostCard";
2
+ import { EVENTS_LAYOUT_COUNT } from "../lib/content/post-list-continue.js";
3
+ import { type ViewTier } from "efficient-easel/screen/lib/content/view-tiers";
4
+ export { EVENTS_LAYOUT_COUNT };
2
5
  export type { EventPost };
3
6
  export type EventCard = EventPost & {
4
7
  href?: string;
@@ -18,7 +21,6 @@ export declare const EVENTS_LAYOUT_FEATURED = "featured";
18
21
  export declare const EVENTS_LAYOUT_TABS = "tabs";
19
22
  export declare const EVENTS_LAYOUT_PORTRAIT = "portrait";
20
23
  export declare const EVENTS_LAYOUT_SPREAD = "spread";
21
- export declare const EVENTS_LAYOUT_COUNT = "count";
22
24
  export declare const EVENTS_LAYOUTS: readonly [{
23
25
  readonly label: "Even grid";
24
26
  readonly value: "even";
@@ -48,6 +50,7 @@ export declare const EVENTS_FEATURED_WIDTH: {
48
50
  readonly unit: "of 12";
49
51
  };
50
52
  export interface EventsProps {
53
+ viewHidden?: Readonly<Record<ViewTier, boolean>>;
51
54
  num?: string;
52
55
  title?: string;
53
56
  link?: {
@@ -75,4 +78,4 @@ export interface EventsProps {
75
78
  ownerId?: string;
76
79
  }
77
80
  export declare function matchesName(title: string, typed: string): boolean;
78
- export default function Events({ num, title, link, posts, servedCategory, columns, limit, showAll, editing, cardImage, gap: gapProp, gapPhone, layout, featuredWidth, listCover, featuredDarken, omitHead, sample, nameFilter, pads, template, ownerId, }: EventsProps): import("react").JSX.Element | null;
81
+ export default function Events(props: EventsProps): import("react").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as s,jsxs as c}from"react/jsx-runtime";import{Children as Re,useState as re}from"react";import{servedWords as ke}from"../lib/content/served-lists.js";import{TAB_PILLS as j}from"../lib/content/tab-strip.js";import{useScopeClass as Fe}from"../lib/use-scope-class.js";import{containerGapProps as Ie}from"efficient-web-builder/format/lib/content/container-gap";import Me from"efficient-web-builder/render/components/SectionHeader";import w from"efficient-web-builder/render/components/PostCard";import De from"efficient-web-builder/render/components/PostDate";import ze from"efficient-web-builder/render/components/Placeholder";import{SiteLink as O}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as N,renderHeadline as C}from"efficient-web-builder/render/components/goldPhrases";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as Ue}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as B}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as Pe}from"../lib/sections/fill-row.js";import{FRAME_120 as le,FRAME_ROOM_COUNT as Ye,FRAME_ROOM_OWN_BOX as Ve,FRAME_ROOM_Y as je,framedBandPad as W,headIsEmpty as Be,withBandClasses as K}from"../lib/sections/band-padding.js";import{HideTaker as G}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as We,useCardRow as Ke}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as Ge}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as oe}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as Xe,EVENTS_FEATURED_DARKEN_STYLE as He,EVENTS_FEATURED_PLACEMENT as Je}from"../lib/content/events-featured-look.js";const qe=4;function Qt(e){return ke(e,qe)}function Zt(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(n[t]=r.trim());else if(Array.isArray(r)){const l=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());l.length&&(n[t]=l)}}return Object.keys(n).length?n:void 0}function ie(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const Qe=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function Ze(e){const n=[],t=new Map;for(const r of e)for(const l of Object.keys(r.facets??{})){t.has(l)||(n.push(l),t.set(l,new Set));for(const d of ie(r,l))t.get(l).add(d)}return n.map(r=>({label:r,values:[...t.get(r)].sort(Qe.compare)}))}function et(e,n){return Object.entries(n).every(([t,r])=>r===""||ie(e,t).includes(r))}const ce=3,de="featured",fe="tabs",me="portrait",v="spread",pe="count",es=[{label:"Even grid",value:"even"},{label:"Featured first",value:de},{label:"Tabs",value:fe},{label:"Photo cards",value:me},{label:"Staggered spread",value:v},{label:"Count",value:pe}],tt=[me,v],ts="even",X={min:2,max:11,step:1,fallback:7,unit:"of 12"},st=Je,nt=Xe,at=He;function rt(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(X.max,Math.max(X.min,Math.round(n))):X.fallback;return`${t}fr ${12-t}fr`}const ge={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},lt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},ot={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function ue(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":oe(e.slug))}}function it(e,n){return{...ue(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const he=new WeakMap,ct={className:"hidden"},dt={className:Ge};function xe(e,n){const t=e.blockIds[0],r=e;function l(d){const b=Ke(),E=n&&b?.index===0;return s(r,{...d,cell:T=>T===t===E?dt:ct})}return Object.assign(l,{blockCount:1,blockIds:e.blockIds})}function ft(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=he.get(t);return r||(r={lead:xe(t,!0),rest:xe(t,!1)},he.set(t,r)),n?r.lead:r.rest}const mt="Find by name",pt="Nobody by that name.",gt="Nobody matches.",ut="Any",ht="No posts in this category yet.",xt="All posts",Nt=oe("").replace(/\/$/,"");function vt(e){return typeof e=="string"?e.trim():""}function bt(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:ht}),c(O,{href:Nt,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[xt," ",s("span",{className:"text-accent",children:"→"})]})]})}function Et(e,n){const t=l=>l.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(n);return r===""||t(e).includes(r)}function Ne({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:mt}),s("input",{type:"search",value:e,onChange:r=>n(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function ve({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function Tt({card:e,scaffold:n,lower:t=!1}){return c(O,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(ze,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:N(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:C(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(De,{at:e.publishedAt}):N(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(ve,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:N(e.excerpt)})]})]})}function yt({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:j.nav,children:s("ul",{className:j.list,children:e.map((t,r)=>{const l=!!t.meta;return s("li",{children:c(O,{href:t.href||"#","aria-current":l?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:j.tab(l),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:C(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${l?"opacity-80":"text-fg-dim"}`,children:N(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function _t({count:e,words:n,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(O,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const H="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",At="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",be=`relative z-[2] bg-bg ${je}`,Ee=`relative z-[2] bg-bg ${Ve}`,wt=`relative z-[2] bg-bg ${Ye}`,Ot={top:32,bottom:32};function Ct({num:e,title:n,link:t,posts:r,servedCategory:l,columns:d,limit:b,showAll:E=!1,editing:T=!1,cardImage:Te,gap:ye,gapPhone:_e,layout:g,featuredWidth:Ae,listCover:we=!0,featuredDarken:Oe,omitHead:u=!1,sample:$,nameFilter:Ce=!1,pads:S,template:J,ownerId:Le=""}){const[R,q]=re(""),[Q,$e]=re({}),y=Fe("ev"),Z=r??[],ee=E?Z.length:typeof b=="number"&&b>0?b:ce,k=Z.slice(0,ee),p=T&&k.length===0;if(k.length===0&&!T){if(!vt(l))return null;const a=W(S,le,{noTop:u,nonNegative:!0});return s(G,{as:"section",...a.attrs,className:K(u?Ee:be,a),style:a.style,children:s("div",{className:B,children:s(bt,{})})})}const te=E?ce:ee,f=p?$?.length?$.slice(0,E?$.length:te):Array.from({length:te},(a,i)=>({slug:`placeholder-${i}`,title:L("Blog post title"),excerpt:L("A short summary of the post appears here."),cover:"",meta:L("Journal"),dateLabel:L("Date")})):k,o=Ie("Events",ye,"both",_e),A=g===de&&f.length>1,se=rt(Ae),F=g===fe,I=g===pe,ne=tt.includes(g??""),M=Ce&&!F&&!I&&!A,D=M?Ze(f):[],x=M?f.filter(a=>Et(a.title,R)&&et(a,Q)):f,_=I?W(S,Ot,{nonNegative:!0}):W(S,le,{noTop:u,nonNegative:!0}),z=_.style,Se=!T&&Be(e,n,t?.text),U=(J?.blockCount??0)>0?ot:lt,P=g===v?U[3]:U[Math.min(4,Math.max(2,d??3))]??U[3],Y=ge[Math.min(4,Math.max(1,d??3))]??ge[3],ae=F||A||g===v?"":Pe(y,ne?P:Y,{cards:x.length}),V=(a,i,m)=>s(We,{ownerId:Le,ownerType:"Events",Template:ft(J,A),rows:a.map(h=>ue(h,p)),items:a.map(h=>it(h,p)),fallback:i,children:h=>m(Re.toArray(h))});return I?s(G,{as:"section",..._.attrs,className:K(wt,_),style:Object.keys(z).length?z:void 0,children:s("div",{className:B,children:s(_t,{count:f.length,words:u||n===void 0?void 0:C(n,!1),href:u?void 0:t?.href})})}):s(G,{as:"section",..._.attrs,className:K(u?Ee:be,_),style:{...Ue(Te),...z},children:c("div",{className:B,children:[u||Se?null:s(Me,{num:e!==void 0?N(e):void 0,title:n!==void 0?C(n,!1):void 0,link:t?{text:N(t.text),href:t.href}:void 0}),M&&c("div",{className:"mb-6 flex flex-col gap-2",children:[D.length===0?s(Ne,{typed:R,onType:q}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(Ne,{typed:R,onType:q,wide:!0}),D.map(({label:a,values:i})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:a}),c("select",{value:Q[a]??"",onChange:m=>$e(h=>({...h,[a]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:ut}),i.map(m=>s("option",{value:m,children:m},m))]})]},a))]}),x.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:D.length===0?pt:gt})]}),ae&&s("style",{children:ae}),F?s(yt,{cards:f,scaffold:p}):ne?V(x,s("div",{className:`${y} sf-card-grid grid${o.className} ${P}`,style:o.style,children:x.map((a,i)=>s(Tt,{card:a,scaffold:p,lower:g===v&&i%3===1},`${a.slug}-${i}`))}),a=>s("div",{className:`${y} sf-card-grid grid${o.className} ${P} ${H}`,style:o.style,children:g===v?a.map((i,m)=>s("div",{className:`${At}${m%3===1?" view-wide:mt-16":""}`,children:i},m)):a})):A?V(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${o.className}`,style:{...o.style,"--sf-events-split":se},children:[s(w,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:Oe??nt,darkenStyle:at,placement:st},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${o.className}`,style:o.style,children:f.slice(1).map((a,i)=>s(w,{post:a,href:a.href,scaffold:p,showCover:we},`${a.slug}-${i+1}`))})]}),a=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${o.className} ${H}`,style:{...o.style,"--sf-events-split":se},children:[a[0],s("div",{className:`grid auto-rows-min${o.className}`,style:o.style,children:a.slice(1)})]})):V(x,s("div",{className:`${y} sf-card-grid grid${o.className} ${Y}`,style:o.style,children:x.map((a,i)=>a.tags&&a.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(w,{post:a,href:a.href,scaffold:p}),s(ve,{tags:a.tags})]},`${a.slug}-${i}`):s(w,{post:a,href:a.href,scaffold:p},`${a.slug}-${i}`))}),a=>s("div",{className:`${y} sf-card-grid grid${o.className} ${Y} ${H}`,style:o.style,children:a}))]})})}export{X as EVENTS_FEATURED_WIDTH,es as EVENTS_LAYOUTS,pe as EVENTS_LAYOUT_COUNT,ts as EVENTS_LAYOUT_FALLBACK,de as EVENTS_LAYOUT_FEATURED,me as EVENTS_LAYOUT_PORTRAIT,v as EVENTS_LAYOUT_SPREAD,fe as EVENTS_LAYOUT_TABS,tt as EVENTS_PHOTO_LAYOUTS,qe as MAX_CARD_TAGS,Ct as default,Ze as facetChoices,et as matchesFacets,Et as matchesName,Zt as readFacets,Qt as readTags};
1
+ import{jsx as s,jsxs as c,Fragment as Me}from"react/jsx-runtime";import{Children as De,useContext as Pe,useState as ce}from"react";import{servedWords as Ue}from"../lib/content/served-lists.js";import{TAB_PILLS as B}from"../lib/content/tab-strip.js";import{useScopeClass as ze}from"../lib/use-scope-class.js";import{containerGapProps as Ve}from"efficient-web-builder/format/lib/content/container-gap";import Ye from"efficient-web-builder/render/components/SectionHeader";import A from"efficient-web-builder/render/components/PostCard";import je from"efficient-web-builder/render/components/PostDate";import Be from"efficient-web-builder/render/components/Placeholder";import{SiteLink as C}from"efficient-web-builder/render/lib/site-runtime";import{renderGold as b,renderHeadline as O}from"efficient-web-builder/render/components/goldPhrases";import{say as L}from"efficient-web-builder/format/lib/editor-words";import{cardImageShapeTokens as We}from"efficient-web-builder/format/lib/content/card-image-shape";import{SITE_COLUMN as W}from"efficient-web-builder/format/lib/content/page-width";import{fillRowCss as He}from"../lib/sections/fill-row.js";import{FRAME_120 as de,FRAME_ROOM_COUNT as Ke,FRAME_ROOM_OWN_BOX as Ge,FRAME_ROOM_Y as Xe,framedBandPad as H,headIsEmpty as Je,withBandClasses as K}from"../lib/sections/band-padding.js";import{HideTaker as G,ViewHideContext as qe,viewHideClaim as Qe}from"efficient-web-builder/render/components/ViewHideRoot";import{CardTemplateRows as Ze,useCardRow as et}from"efficient-web-builder/render/components/CardRowContext";import{SECTION_FILL_CLASS as tt}from"efficient-web-builder/format/lib/content/section-min-height";import{postPath as fe}from"efficient-web-builder/format/lib/links/page-link-rules";import{EVENTS_FEATURED_DARKEN as st,EVENTS_FEATURED_DARKEN_STYLE as nt,EVENTS_FEATURED_PLACEMENT as rt}from"../lib/content/events-featured-look.js";import{PostListStarts as at}from"./PostListStartsProvider.js";import{EVENTS_DEFAULT_LIMIT as ot,EVENTS_LAYOUT_COUNT as X,postCap as it}from"../lib/content/post-list-continue.js";import{VIEW_TIERS as J}from"efficient-easel/screen/lib/content/view-tiers";import{hiddenKeyOf as lt}from"efficient-easel/screen/lib/content/view-hide";import{nodeHiddenEverywhere as ct,nodeViewHideWords as dt,viewHideClass as me}from"efficient-web-builder/format/lib/content/view-hide-class";const ft=4;function bs(e){return Ue(e,ft)}function Es(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n={};for(const[t,r]of Object.entries(e))if(t.trim()){if(typeof r=="string")r.trim()&&(n[t]=r.trim());else if(Array.isArray(r)){const o=r.filter(d=>typeof d=="string"&&!!d.trim()).map(d=>d.trim());o.length&&(n[t]=o)}}return Object.keys(n).length?n:void 0}function pe(e,n){const t=e.facets?.[n];return t===void 0?[]:typeof t=="string"?[t]:t}const mt=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});function pt(e){const n=[],t=new Map;for(const r of e)for(const o of Object.keys(r.facets??{})){t.has(o)||(n.push(o),t.set(o,new Set));for(const d of pe(r,o))t.get(o).add(d)}return n.map(r=>({label:r,values:[...t.get(r)].sort(mt.compare)}))}function ut(e,n){return Object.entries(n).every(([t,r])=>r===""||pe(e,t).includes(r))}const ue="featured",ge="tabs",he="portrait",E="spread",Ts=[{label:"Even grid",value:"even"},{label:"Featured first",value:ue},{label:"Tabs",value:ge},{label:"Photo cards",value:he},{label:"Staggered spread",value:E},{label:"Count",value:X}],gt=[he,E],ys="even",q={min:2,max:11,step:1,fallback:7,unit:"of 12"},ht=rt,xt=st,vt=nt;function Nt(e){const n=typeof e=="number"?e:Number.parseFloat(String(e??"")),t=Number.isFinite(n)?Math.min(q.max,Math.max(q.min,Math.round(n))):q.fallback;return`${t}fr ${12-t}fr`}const xe={1:"grid-cols-1",2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-2 max-view-wide:grid-cols-1"},bt={2:"grid-cols-2",3:"grid-cols-3 max-view-wide:grid-cols-2",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-2"},Et={2:"grid-cols-2 max-view-wide:grid-cols-1",3:"grid-cols-3 max-view-wide:grid-cols-1",4:"grid-cols-4 max-view-desktop:grid-cols-3 max-view-wide:grid-cols-1"};function ve(e,n){return{key:e.slug,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta??"",dateLabel:e.dateLabel??"",href:e.href||(n?"#":fe(e.slug))}}function Tt(e,n){return{...ve(e,n),tags:(e.tags??[]).map(t=>({label:t}))}}const Ne=new WeakMap,yt={className:"hidden"},_t={className:tt};function be(e,n){const t=e.blockIds[0],r=e;function o(d){const h=et(),T=n&&h?.index===0;return s(r,{...d,cell:u=>u===t===T?_t:yt})}return Object.assign(o,{blockCount:1,blockIds:e.blockIds})}function wt(e,n){const t=e;if(typeof t!="function"||(t.blockCount??0)<2||!Array.isArray(t.blockIds))return e;let r=Ne.get(t);return r||(r={lead:be(t,!0),rest:be(t,!1)},Ne.set(t,r)),n?r.lead:r.rest}const At="Find by name",Ct="Nobody by that name.",Ot="Nobody matches.",Lt="Any",St="No posts in this category yet.",$t="All posts",Rt=fe("").replace(/\/$/,"");function kt(e){return typeof e=="string"?e.trim():""}function It(){return c("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-6 text-center font-mono text-[length:var(--size-label,14px)] uppercase text-fg-dim",children:[s("p",{role:"status",className:"tracking-[0.2em]",children:St}),c(C,{href:Rt,className:"inline-flex min-h-11 items-center tracking-[0.22em] hover:text-fg",children:[$t," ",s("span",{className:"text-accent",children:"→"})]})]})}function Ft(e,n){const t=o=>o.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase().trim(),r=t(n);return r===""||t(e).includes(r)}function Ee({typed:e,onType:n,wide:t=!1}){return c("label",{className:`flex max-w-[360px] flex-col gap-1.5${t?" w-full":""}`,children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:At}),s("input",{type:"search",value:e,onChange:r=>n(r.target.value),autoComplete:"off",className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent"})]})}function Te({tags:e}){return s("ul",{"aria-label":"Details",className:"flex gap-1.5 overflow-hidden",children:e.map((n,t)=>s("li",{className:"shrink-0 rounded-[var(--sf-button-radius,4px)] border border-line px-2 py-0.5 text-[length:var(--size-label,12px)] text-fg-dim",children:n},`${n}-${t}`))})}function Mt({card:e,scaffold:n,lower:t=!1}){return c(C,{href:e.href||"#",className:`sf-card group relative isolate flex aspect-[3/4] overflow-hidden bg-surface${t?" min-[801px]:mt-16":""}`,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,children:[s("div",{className:"absolute inset-0 transition-transform duration-700 group-hover:scale-[1.03] motion-reduce:transition-none motion-reduce:group-hover:scale-100",children:s(Be,{label:`card-${e.slug}`,src:e.cover||void 0,sizes:"(max-width: 800px) 50vw, 25vw"})}),s("div",{"aria-hidden":!0,className:"absolute inset-0 z-0",style:{background:"linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--bg) 88%, transparent) 100%)"}}),e.meta&&s("span",{className:"absolute left-3 top-3 z-[1] rounded-[var(--sf-button-radius,999px)] bg-bg/85 px-2.5 py-1 font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.16em] text-accent",children:b(e.meta)}),c("div",{className:"relative z-[1] mt-auto flex w-full flex-col gap-1 p-4 max-view-wide:p-3",children:[s("h3",{className:"font-heading3 text-[length:var(--size-headingSmall,24px)] leading-[1.1] tracking-[-0.01em] text-fg",children:O(e.title,!1)}),(e.publishedAt||e.dateLabel)&&s("p",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.16em] text-accent",children:e.publishedAt?s(je,{at:e.publishedAt}):b(e.dateLabel??"")}),e.tags&&e.tags.length>0&&s(Te,{tags:e.tags}),e.excerpt&&s("p",{className:"line-clamp-2 text-[length:var(--size-body,14px)] leading-[1.45] text-fg-dim",children:b(e.excerpt)})]})]})}function Dt({cards:e,scaffold:n}){return s("nav",{"aria-label":"Days",className:B.nav,children:s("ul",{className:B.list,children:e.map((t,r)=>{const o=!!t.meta;return s("li",{children:c(C,{href:t.href||"#","aria-current":o?"page":void 0,"aria-disabled":n||void 0,tabIndex:n?-1:void 0,className:B.tab(o),children:[s("span",{className:"font-heading3 text-[length:var(--size-body,15px)] leading-[1.2]",children:O(t.title,!1)}),t.excerpt&&s("span",{className:`font-mono text-[length:var(--size-label,11px)] uppercase tracking-[0.14em] ${o?"opacity-80":"text-fg-dim"}`,children:b(t.excerpt)})]})},`${t.slug}-${r}`)})})})}function Pt({count:e,words:n,href:t}){const r=c("span",{className:"inline-flex items-baseline gap-3",children:[s("span",{className:"font-heading text-[length:var(--size-headingLarge,64px)] leading-none text-accent",children:e}),n!==void 0&&s("span",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.2em] text-fg",children:n})]});return t?s(C,{href:t,className:"inline-flex hover:opacity-85",children:r}):r}const Q="[&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",Ut="[&>[data-sf-repeat]]:h-full [&>[data-sf-repeat]>*]:h-full [&>[data-sf-repeat]>*>*]:h-full",ye=`relative z-[2] bg-bg ${Xe}`,_e=`relative z-[2] bg-bg ${Ge}`,zt=`relative z-[2] bg-bg ${Ke}`,Vt={top:32,bottom:32};function Yt(e){const{starts:n,posts:t}=Pe(at),r=n[e.ownerId??""];if(!r)return s(Z,{...e,start:0});const o=t?.[e.ownerId??""]??e.posts,d=jt(r);return d.length===1?s(Z,{...e,posts:o,start:d[0].start}):s(Me,{children:d.map(({start:h,views:T})=>{const u=Bt(T,e.viewHidden);return ct(we(u))?null:s(qe.Provider,{value:Wt(u),children:s(Z,{...e,posts:o,start:h})},h)})})}function jt(e){const n=[];for(const t of J){const r=n.find(o=>o.start===e[t]);r?r.views.push(t):n.push({start:e[t],views:[t]})}return n}const Bt=(e,n)=>Object.fromEntries(J.map(t=>[t,!e.includes(t)||!!n?.[t]])),we=e=>Object.fromEntries(J.map(n=>[lt(n),e[n]])),Wt=e=>Qe(me(e),dt(we(e)),{sectionClassName:me(e,{atSectionLine:!0}),line:"section"});function Z({start:e,num:n,title:t,link:r,posts:o,servedCategory:d,columns:h,limit:T,showAll:u=!1,editing:S=!1,cardImage:Ae,gap:Ce,gapPhone:Oe,layout:g,featuredWidth:Le,listCover:Se=!0,featuredDarken:$e,omitHead:x=!1,sample:$,nameFilter:Re=!1,pads:R,template:ee,ownerId:ke=""}){const[k,te]=ce(""),[se,Ie]=ce({}),y=ze("ev"),ne=e>0?(o??[]).slice(e):o??[],re=u?ne.length:it({limit:T}),I=ne.slice(0,re),p=S&&I.length===0;if(I.length===0&&!S){if(!kt(d))return null;const a=H(R,de,{noTop:x,nonNegative:!0});return s(G,{as:"section",...a.attrs,className:K(x?_e:ye,a),style:a.style,children:s("div",{className:W,children:s(It,{})})})}const ae=u?ot:re,f=p?$?.length?$.slice(0,u?$.length:ae):Array.from({length:ae},(a,l)=>({slug:`placeholder-${l}`,title:L("Blog post title"),excerpt:L("A short summary of the post appears here."),cover:"",meta:L("Journal"),dateLabel:L("Date")})):I,i=Ve("Events",Ce,"both",Oe),w=g===ue&&f.length>1,oe=Nt(Le),F=g===ge,M=g===X,ie=gt.includes(g??""),D=Re&&!F&&!M&&!w,P=D?pt(f):[],N=D?f.filter(a=>Ft(a.title,k)&&ut(a,se)):f,_=M?H(R,Vt,{nonNegative:!0}):H(R,de,{noTop:x,nonNegative:!0}),U=_.style,Fe=!S&&Je(n,t,r?.text),z=(ee?.blockCount??0)>0?Et:bt,V=g===E?z[3]:z[Math.min(4,Math.max(2,h??3))]??z[3],Y=xe[Math.min(4,Math.max(1,h??3))]??xe[3],le=F||w||g===E?"":He(y,ie?V:Y,{cards:N.length}),j=(a,l,m)=>s(Ze,{ownerId:ke,ownerType:"Events",Template:wt(ee,w),rows:a.map(v=>ve(v,p)),items:a.map(v=>Tt(v,p)),fallback:l,children:v=>m(De.toArray(v))});return M?s(G,{as:"section",..._.attrs,className:K(zt,_),style:Object.keys(U).length?U:void 0,children:s("div",{className:W,children:s(Pt,{count:f.length,words:x||t===void 0?void 0:O(t,!1),href:x?void 0:r?.href})})}):s(G,{as:"section",..._.attrs,className:K(x?_e:ye,_),style:{...We(Ae),...U},children:c("div",{className:W,children:[x||Fe?null:s(Ye,{num:n!==void 0?b(n):void 0,title:t!==void 0?O(t,!1):void 0,link:r?{text:b(r.text),href:r.href}:void 0}),D&&c("div",{className:"mb-6 flex flex-col gap-2",children:[P.length===0?s(Ee,{typed:k,onType:te}):c("div",{className:"flex flex-wrap items-end gap-3",children:[s(Ee,{typed:k,onType:te,wide:!0}),P.map(({label:a,values:l})=>c("label",{className:"flex min-w-[140px] flex-col gap-1.5 max-view-wide:flex-1",children:[s("span",{className:"font-mono text-[length:var(--size-label,12px)] uppercase tracking-[0.18em] text-fg-dim",children:a}),c("select",{value:se[a]??"",onChange:m=>Ie(v=>({...v,[a]:m.target.value})),className:"rounded-[var(--sf-button-radius,6px)] border border-line bg-bg px-4 py-2.5 text-[length:var(--size-body,15px)] text-fg outline-none focus:border-accent",children:[s("option",{value:"",children:Lt}),l.map(m=>s("option",{value:m,children:m},m))]})]},a))]}),N.length===0&&s("p",{role:"status",className:"text-[length:var(--size-body,14px)] text-fg-dim",children:P.length===0?Ct:Ot})]}),le&&s("style",{children:le}),F?s(Dt,{cards:f,scaffold:p}):ie?j(N,s("div",{className:`${y} sf-card-grid grid${i.className} ${V}`,style:i.style,children:N.map((a,l)=>s(Mt,{card:a,scaffold:p,lower:g===E&&l%3===1},`${a.slug}-${l}`))}),a=>s("div",{className:`${y} sf-card-grid grid${i.className} ${V} ${Q}`,style:i.style,children:g===E?a.map((l,m)=>s("div",{className:`${Ut}${m%3===1?" view-wide:mt-16":""}`,children:l},m)):a})):w?j(f,c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className}`,style:{...i.style,"--sf-events-split":oe},children:[s(A,{post:f[0],href:f[0].href,scaffold:p,layout:"cover",darken:$e??xt,darkenStyle:vt,placement:ht},`${f[0].slug}-0`),s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:f.slice(1).map((a,l)=>s(A,{post:a,href:a.href,scaffold:p,showCover:Se},`${a.slug}-${l+1}`))})]}),a=>c("div",{className:`sf-card-grid grid grid-cols-[var(--sf-events-split)] max-view-wide:grid-cols-1${i.className} ${Q}`,style:{...i.style,"--sf-events-split":oe},children:[a[0],s("div",{className:`grid auto-rows-min${i.className}`,style:i.style,children:a.slice(1)})]})):j(N,s("div",{className:`${y} sf-card-grid grid${i.className} ${Y}`,style:i.style,children:N.map((a,l)=>a.tags&&a.tags.length>0?c("div",{className:"flex flex-col gap-2",children:[s(A,{post:a,href:a.href,scaffold:p}),s(Te,{tags:a.tags})]},`${a.slug}-${l}`):s(A,{post:a,href:a.href,scaffold:p},`${a.slug}-${l}`))}),a=>s("div",{className:`${y} sf-card-grid grid${i.className} ${Y} ${Q}`,style:i.style,children:a}))]})})}export{q as EVENTS_FEATURED_WIDTH,Ts as EVENTS_LAYOUTS,X as EVENTS_LAYOUT_COUNT,ys as EVENTS_LAYOUT_FALLBACK,ue as EVENTS_LAYOUT_FEATURED,he as EVENTS_LAYOUT_PORTRAIT,E as EVENTS_LAYOUT_SPREAD,ge as EVENTS_LAYOUT_TABS,gt as EVENTS_PHOTO_LAYOUTS,ft as MAX_CARD_TAGS,Yt as default,pt as facetChoices,ut as matchesFacets,Ft as matchesName,Es as readFacets,bs as readTags};
@@ -1 +1 @@
1
- "use client";import{jsx as n,jsxs as s}from"react/jsx-runtime";import{useEffect as x,useState as h}from"react";import f from"efficient-web-builder/render/components/BlockFrame";import{renderHeadline as g}from"efficient-web-builder/render/components/goldPhrases";import{OPENING_WORDS as c,badgeLabel as b,momentIn as k,openingStatus as N,weekLines as y}from"../lib/sections/opening-hours.js";const v=3e4;function I({show:t,title:r,row:a,contained:o,now:i}){const[d,u]=h(i??null),m=a?.zone??"",p=!!a?.week;if(x(()=>{if(i){u(i);return}if(!p)return;const e=()=>u(k(m,Date.now()));e();const l=setInterval(e,v);return()=>clearInterval(l)},[i,m,p]),!a)return null;if(t==="badge"){if(!a.week)return null;const e=d?N(a.week,d):null;return n(f,{contained:o,className:"py-6",children:n(_,{label:e?b(e):null,open:e?.open??!1})})}return!a.week&&!a.hours.length?null:n(f,{contained:o,className:"py-6",children:s("div",{className:"flex max-w-[560px] flex-col gap-4",children:[r&&n("h2",{className:"font-heading3 text-[length:min(var(--size-headingSmall,28px),var(--sf-heading-max,9999px))] font-medium leading-[1.1] tracking-[-0.02em]",children:g(r,!1)}),a.week?n("ul",{className:"flex flex-col text-[15px]",children:y(a.week).map(e=>{const l=d!==null&&d.day===e.day;return s("li",{"aria-current":l?"date":void 0,className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 rounded-sm border-b border-line px-3 py-2.5 last:border-b-0",style:l?{background:"color-mix(in oklab, var(--accent) 12%, transparent)"}:void 0,children:[s("span",{className:l?"font-medium":void 0,children:[e.name,l&&n("span",{className:"opacity-70",children:` · ${c.today}`})]}),n("span",{className:e.closed?"tabular-nums opacity-60":"tabular-nums",children:e.closed?c.closed:e.periods})]},e.day)})}):n("div",{className:"flex flex-col gap-1 text-[15px] leading-[1.6]",children:a.hours.map((e,l)=>n("p",{children:e},l))})]})})}function _({label:t,open:r}){return t===null?s("span",{"aria-hidden":!0,className:"invisible inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px]",children:[n("span",{className:"h-2 w-2 rounded-full"}),c.openNow]}):s("span",{className:"inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px] tabular-nums",style:{background:r?"color-mix(in oklab, var(--green) 16%, transparent)":"color-mix(in oklab, var(--fg) 8%, transparent)"},children:[n("span",{"aria-hidden":!0,className:r?"h-2 w-2 shrink-0 rounded-full bg-green":"h-2 w-2 shrink-0 rounded-full bg-current opacity-50"}),t]})}export{v as OPENING_TICK_MS,I as default};
1
+ "use client";import{jsx as n,jsxs as t}from"react/jsx-runtime";import{useEffect as h,useState as g}from"react";import x from"efficient-web-builder/render/components/BlockFrame";import{renderHeadline as b}from"efficient-web-builder/render/components/goldPhrases";import{firstReadableZone as k}from"../lib/zone.js";import{OPENING_WORDS as m,badgeLabel as N,momentIn as y,openingStatus as v,weekLines as I}from"../lib/sections/opening-hours.js";const _=3e4;function j({show:i,title:r,row:a,contained:p,now:s}){const[d,c]=g(s??null),o=a?.zone??"",f=!!a?.week,u=!!s||k(o)!=="";if(h(()=>{if(s){c(s);return}if(!f||!u){c(null);return}const e=()=>c(y(o,Date.now()));e();const l=setInterval(e,_);return()=>clearInterval(l)},[s,o,f,u]),!a)return null;if(i==="badge"){if(!a.week||!u)return null;const e=d?v(a.week,d):null;return n(x,{contained:p,className:"py-6",children:n(O,{label:e?N(e):null,open:e?.open??!1})})}return!a.week&&!a.hours.length?null:n(x,{contained:p,className:"py-6",children:t("div",{className:"flex max-w-[560px] flex-col gap-4",children:[r&&n("h2",{className:"font-heading3 text-[length:min(var(--size-headingSmall,28px),var(--sf-heading-max,9999px))] font-medium leading-[1.1] tracking-[-0.02em]",children:b(r,!1)}),a.week?n("ul",{className:"flex flex-col text-[15px]",children:I(a.week).map(e=>{const l=d!==null&&d.day===e.day;return t("li",{"aria-current":l?"date":void 0,className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 rounded-sm border-b border-line px-3 py-2.5 last:border-b-0",style:l?{background:"color-mix(in oklab, var(--accent) 12%, transparent)"}:void 0,children:[t("span",{className:l?"font-medium":void 0,children:[e.name,l&&n("span",{className:"opacity-70",children:` · ${m.today}`})]}),n("span",{className:e.closed?"tabular-nums opacity-60":"tabular-nums",children:e.closed?m.closed:e.periods})]},e.day)})}):n("div",{className:"flex flex-col gap-1 text-[15px] leading-[1.6]",children:a.hours.map((e,l)=>n("p",{children:e},l))})]})})}function O({label:i,open:r}){return i===null?t("span",{"aria-hidden":!0,className:"invisible inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px]",children:[n("span",{className:"h-2 w-2 rounded-full"}),m.openNow]}):t("span",{className:"inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-[14px] tabular-nums",style:{background:r?"color-mix(in oklab, var(--green) 16%, transparent)":"color-mix(in oklab, var(--fg) 8%, transparent)"},children:[n("span",{"aria-hidden":!0,className:r?"h-2 w-2 shrink-0 rounded-full bg-green":"h-2 w-2 shrink-0 rounded-full bg-current opacity-50"}),i]})}export{_ as OPENING_TICK_MS,j as default};
@@ -0,0 +1,21 @@
1
+ import { type ReactNode } from "react";
2
+ import type { PostListStart } from "../lib/content/post-list-continue.js";
3
+ export type PostListStartMap = Readonly<{
4
+ starts: Readonly<{
5
+ [sectionId: string]: PostListStart;
6
+ }>;
7
+ posts?: Readonly<{
8
+ [sectionId: string]: readonly unknown[];
9
+ }>;
10
+ }>;
11
+ export declare const PostListStarts: import("react").Context<Readonly<{
12
+ starts: Readonly<{
13
+ [sectionId: string]: PostListStart;
14
+ }>;
15
+ posts?: Readonly<{
16
+ [sectionId: string]: readonly unknown[];
17
+ }>;
18
+ }>>;
19
+ export default function PostListStartsProvider({ starts, posts, children, }: PostListStartMap & {
20
+ children: ReactNode;
21
+ }): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as o}from"react/jsx-runtime";import{createContext as s}from"react";const i=s({starts:{}});function a({starts:t,posts:r,children:e}){return o(i.Provider,{value:{starts:t,posts:r},children:e})}export{i as PostListStarts,a 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{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
+ "use client";import{jsx as r}from"react/jsx-runtime";import{Render as p}from"efficient-easel/render";import d from"./PostListStartsProvider.js";import{postListStartsOf as f}from"../lib/content/post-list-continue.js";import{renderConfig as u}from"../lib/document/render-config.js";import{SITE_FOOTER_KIND as c}from"efficient-web-builder/format/lib/content/footer";import{PublishedFooterContext as I}from"efficient-web-builder/render/components/PublishedFooterContext";import{publishedChromeData as g}from"efficient-web-builder/render/lib/document/published-passes";import{EMPTY_SOCIAL_LINKS as k}from"efficient-web-builder/format/lib/content/social-links";function P({footerBlock:l,rootProps:e,headerSettings:o,siteName:i,legalName:n,foundedYear:m,socialLinks:a}){const t=g({root:{props:{...e??{},kind:c}},content:[l],zones:{}}),s=f(t);return r(I.Provider,{value:{logoUrl:o?.logoUrl??null,logoReversed:o?.logoReversed??null,logoInkIsDark:o?.logoInkIsDark??null,siteName:i,legalName:n??null,foundedYear:m??null,socialLinks:a??k},children:r(d,{starts:s.starts,posts:s.posts,children:r(p,{config:u(),data:t})})})}export{P as default};
@@ -1 +1 @@
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
+ "use client";import{jsx as r}from"react/jsx-runtime";import{Render as i}from"efficient-easel/render";import a from"./PostListStartsProvider.js";import{postListStartsOf as p}from"../lib/content/post-list-continue.js";import m 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 f}from"efficient-web-builder/render/lib/document/published-passes";function h({group:s}){const o=f({root:{props:{}},content:[s],zones:{}}),t=n(o),e=p(o);return r(m,{sticky:t.sticky,topTextColor:t.topTextColor,heightPx:t.heightPx,theme:t.theme,bandCapped:t.bandCapped,children:r(a,{starts:e.starts,posts:e.posts,children:r(i,{config:d(),data:o})})})}export{h as default};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as x,Fragment as K}from"react/jsx-runtime";import le from"next/link";import{usePathname as ce}from"next/navigation";import{useEffect as P,useId as Z,useMemo as ee,useRef as oe,useState as m}from"react";import Q from"efficient-web-builder/render/components/BlockFrame";import{ApiError as ne,askToSignUp as ue,fetchSignUpAvailability as te,joinSignUpWaitingList as de}from"../lib/api/index.js";import me from"./SignUpFind.js";import fe from"./SignUpLink.js";import{BANNER as X,CARD as q,PRIMARY as re,QUIET as E,TITLE as z}from"../lib/sections/sign-up-look.js";import{ROW_INPUT_CLASS as he}from"../lib/field-input.js";import{COUNTRY_CURRENCY as pe}from"../lib/sections/sign-up-catalogue.js";import{CHECK_AFTER_MS as ge,EMPTY_DRAFT as be,SIGN_UP_WORDS as n,addressSuffix as ae,checkDraft as Ne,checkWaitingEmail as ye,countryChoices as xe,currencyChoices as ve,fill as D,linkEnds as $e,linkTokenOf as Se,normaliseSlug as ke,readSignUpRefusal as Ce,readWaitingRefusal as Ue,signUpBody as Re,slugCheckOf as Te,slugFromName as Ae}from"../lib/sections/sign-up.js";function Ee(t){return t.mode==="find"?e(Q,{contained:t.contained,className:"py-6",children:e(me,{product:t.product,productName:t.productName,startHref:"/start",inert:!!t.sample})}):e(Oe,{...t})}function Oe({product:t,productName:a,freeLine:l,zone:i,askCountry:o,termsHref:u,privacyHref:c,findHref:s,contained:y,sample:p}){const[g,f]=m(p??be),[U,R]=m(!1),[B,O]=m({}),[T,S]=m(null),[b,h]=m("form"),[G,H]=m(null),[F,L]=m(!1),[_,j]=m(!1),[A,W]=m(()=>ae(i,"")),r=Se(ce()),k=!!r&&!p,w=_e(t,g.slug,!!p||k);P(()=>{W(ae(i,window.location.hostname))},[i]),P(()=>{if(p||k)return;let d=!1;return te(t).then(N=>{d||(N.open||h("closed"),f(v=>({...v,country:v.country||N.country,currency:v.currency||N.currency})))}).catch(()=>{}),()=>{d=!0}},[t,p,k]);const C=d=>{f(N=>({...N,...d})),O(N=>{const v={...N};for(const se of Object.keys(d))delete v[se];return v}),S(null)},$=async d=>{L(!0),S(null);try{H(await ue(Re(g,t,o))),j(d),h("sent")}catch(N){const v=N instanceof ne?Ce(N.status,N.data):{fields:{},trouble:"failed"};v.trouble==="closed"?h("closed"):Object.keys(v.fields).length?(O(v.fields),h("form")):S(v.trouble)}finally{L(!1)}},I=d=>{if(d.preventDefault(),p||F)return;const N=Ne(g,w);O(N),!Object.keys(N).length&&$(!1)};return k?e(Q,{contained:y,className:"py-6",children:e(fe,{token:r,productName:a,suffix:A,startHref:"/start",findHref:s})}):e(Q,{contained:y,className:"py-6",children:e(we,{stage:b,product:t,onOpen:()=>h("form"),productName:a,freeLine:l,suffix:A,askCountry:o,termsHref:u,privacyHref:c,findHref:s,draft:g,wrong:B,slug:w,trouble:T,busy:F,sent:G,resent:_,onChange:C,onCompany:d=>C(U?{company:d}:{company:d,slug:Ae(d)}),onSlug:d=>{R(!0),C({slug:ke(d)})},onCountry:d=>C({country:d,currency:pe[d]??g.currency}),onSubmit:I,onAgain:()=>{$(!0)},onEdit:()=>{R(!0),S(null),h("form")}})})}function _e(t,a,l){const[i,o]=m({slug:"",found:{state:"empty"}}),u=oe("");return P(()=>{if(l||!a)return;u.current=a;const c=window.setTimeout(()=>{te(t,a).then(s=>{u.current===a&&o({slug:a,found:Te(s)})}).catch(()=>{u.current===a&&o({slug:a,found:{state:"unknown"}})})},ge);return()=>window.clearTimeout(c)},[t,a,l]),l?{state:"available"}:a?i.slug===a?i.found:{state:"checking"}:{state:"empty"}}const M="flex h-11 items-center rounded-[10px] border bg-bg px-3",J="h-full w-full bg-transparent text-[14px] text-fg outline-none focus-visible:outline-none! placeholder:text-fg-dim",ie="flex h-11 w-full cursor-pointer items-center justify-center rounded-[10px] border font-medium text-fg disabled:cursor-wait disabled:opacity-60";function we(t){const{stage:a,productName:l,findHref:i,trouble:o}=t,u=i?x("p",{className:`${E} mt-[10px] text-center`,children:[n.haveOne," ",e(le,{href:i,className:"text-accent",children:n.find})]}):null;return a==="closed"?e(De,{...t,children:u}):a==="sent"?e(Fe,{...t}):e(Be,{...t,trouble:o,children:u})}function Y({id:t,label:a,error:l,hint:i,children:o}){return x("div",{className:"min-w-0",children:[e("label",{htmlFor:t,className:"mb-1 mt-3 block text-[13px] font-medium",children:a}),o,l?e("p",{id:`${t}-said`,role:"alert",className:"mt-1 text-[13px] text-alert",children:l}):i&&e("p",{id:`${t}-said`,className:"mt-1 text-[13px]",children:i})]})}const V=t=>t?"border-alert":"border-line focus-within:border-accent";function Be({productName:t,freeLine:a,suffix:l,askCountry:i,termsHref:o,privacyHref:u,draft:c,wrong:s,slug:y,trouble:p,busy:g=!1,locale:f,onChange:U,onCompany:R,onSlug:B,onCountry:O,onSubmit:T,children:S}){const b=Z(),[h,G]=m(f!==void 0);P(()=>G(!0),[]);const H=r=>r?[{value:r,label:r}]:[],F=ee(()=>i?h?xe(c.country,f):H(c.country):[],[i,h,c.country,f]),L=ee(()=>i?h?ve(c.currency,f):H(c.currency):[],[i,h,c.currency,f]),_=(r,k,w,C,$)=>e(Y,{id:`${b}-${r}`,label:k,error:s[r],children:e("div",{className:`${M} ${V(s[r])}`,children:e("input",{id:`${b}-${r}`,name:r,type:w,autoComplete:C,maxLength:$,value:c[r],"aria-invalid":s[r]?!0:void 0,"aria-describedby":s[r]?`${b}-${r}-said`:void 0,onChange:I=>r==="company"?R?.(I.target.value):U?.({[r]:I.target.value}),className:J})})}),j=(r,k,w,C)=>e(Y,{id:`${b}-${r}`,label:k,error:s[r],children:e("div",{className:`${M} ${V(s[r])}`,children:e("select",{id:`${b}-${r}`,name:r,value:c[r],"aria-invalid":s[r]?!0:void 0,onChange:$=>C($.target.value),className:`${J} cursor-pointer`,children:w.map($=>e("option",{value:$.value,children:$.label},$.value))})})}),A=s.slug??(y.state==="problem"?n.slugProblem[y.problem]:void 0),W=y.state==="checking"?e("span",{className:"text-fg-dim",children:n.checking}):y.state==="available"?x("span",{className:"text-green",children:[e("span",{"aria-hidden":!0,children:"✓ "}),n.available]}):void 0;return x("form",{noValidate:!0,onSubmit:T,className:q,children:[e("h2",{className:z,children:D(n.title,{name:t})}),a&&e("p",{className:`${E} mt-1`,children:a}),x("div",{className:"grid grid-cols-2 gap-[10px]",children:[_("firstName",n.firstName,"text","given-name",150),_("lastName",n.lastName,"text","family-name",150)]}),_("email",n.email,"email","email",254),_("company",n.company,"text","organization",200),e(Y,{id:`${b}-slug`,label:n.address,error:A,hint:W,children:x("div",{className:`${M} gap-2 ${V(A)}`,children:[e("input",{id:`${b}-slug`,name:"slug",type:"text",autoComplete:"off",autoCapitalize:"none",spellCheck:!1,maxLength:30,value:c.slug,"aria-invalid":A?!0:void 0,"aria-describedby":A||W?`${b}-slug-said`:void 0,onChange:r=>B?.(r.target.value),className:`${he} h-full bg-transparent text-[14px] text-fg outline-none focus-visible:outline-none!`}),l&&e("span",{className:`${E} shrink-0`,children:l})]})}),i&&x(K,{children:[j("country",n.country,F,r=>O?.(r)),j("currency",n.currency,L,r=>U?.({currency:r})),e("p",{className:`${E} mt-[6px]`,children:n.countryHint})]}),p&&e("p",{role:"alert",className:X,children:n.trouble[p]}),e("button",{type:"submit",disabled:g,className:re,children:g?n.sending:n.submit}),e("p",{className:`${E} mt-3 text-center`,children:e(He,{termsHref:o,privacyHref:u})}),S]})}function De({product:t="",productName:a,children:l,onOpen:i}){const o=Z(),[u,c]=m(""),[s,y]=m(null),[p,g]=m(null),[f,U]=m(!1),[R,B]=m(!1);return x("form",{noValidate:!0,onSubmit:async T=>{if(T.preventDefault(),f)return;const S=ye(u);if(y(S),g(null),!S){U(!0);try{await de(t,u),B(!0)}catch(b){const h=b instanceof ne?Ue(b.status,b.data):{open:!1,email:null,trouble:"failed"};h.open&&i?.(),y(h.email),g(h.trouble)}finally{U(!1)}}},className:q,children:[e("h2",{className:z,children:n.closedTitle}),x("p",{className:"mt-[10px]",children:[D(n.closedBody,{name:a})," ",R?"":n.closedLeave]}),R?e("p",{role:"status",className:"mt-[10px] font-medium",children:D(n.waitingDone,{email:u.trim()})}):x(K,{children:[e(Y,{id:`${o}-email`,label:n.email,error:s??void 0,children:e("div",{className:`${M} ${V(s??void 0)}`,children:e("input",{id:`${o}-email`,name:"email",type:"email",autoComplete:"email",maxLength:254,value:u,"aria-invalid":s?!0:void 0,"aria-describedby":s?`${o}-email-said`:void 0,onChange:T=>{c(T.target.value),y(null),g(null)},className:J})})}),p&&e("p",{role:"alert",className:X,children:n.trouble[p]}),e("button",{type:"submit",disabled:f,className:re,children:f?n.sending:n.tellMe})]}),l]})}function He({termsHref:t,privacyHref:a}){const l=(c,s)=>c?e("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2",children:s}):s,[i,o,u]=n.agree.split(/\{terms\}|\{privacy\}/);return x(K,{children:[i,l(t,n.terms),o,l(a,n.privacy),u]})}function Fe({draft:t,sent:a,trouble:l,busy:i=!1,resent:o=!1,locale:u,timeZone:c,onAgain:s,onEdit:y}){const[p,g]=D(n.sentBody,{company:t.company.trim()}).split("{email}"),f=$e(a?.expiresAt??"",u,c);return x("div",{className:q,children:[e("h2",{className:z,children:n.sentTitle}),x("p",{className:"mt-[10px]",children:[p,e("span",{className:"font-medium",children:t.email.trim()}),g]}),f&&e("p",{className:`${E} mt-[10px]`,children:D(n.sentUntil,{when:f})}),l?e("p",{role:"alert",className:X,children:n.trouble[l]}):o&&!i&&e("p",{role:"status",className:`${E} mt-[10px]`,children:n.sentAgain}),e("button",{type:"button",disabled:i,onClick:s,className:`${ie} mt-[18px] border-line`,children:i?n.sendingAgain:n.sendAgain}),e("button",{type:"button",disabled:i,onClick:y,className:`${ie} mt-2 border-transparent`,children:n.change})]})}export{we as SignUpView,Ee as default};
1
+ "use client";import{jsx as e,jsxs as x,Fragment as K}from"react/jsx-runtime";import le from"next/link";import{usePathname as ce}from"next/navigation";import{useEffect as P,useId as J,useMemo as ee,useRef as oe,useState as m}from"react";import Q from"efficient-web-builder/render/components/BlockFrame";import{userZone as ue}from"efficient-shell/format";import{ApiError as ne,askToSignUp as de,fetchSignUpAvailability as te,joinSignUpWaitingList as me}from"../lib/api/index.js";import fe from"./SignUpFind.js";import he from"./SignUpLink.js";import{BANNER as X,CARD as Z,PRIMARY as re,QUIET as E,TITLE as q}from"../lib/sections/sign-up-look.js";import{ROW_INPUT_CLASS as pe}from"../lib/field-input.js";import{COUNTRY_CURRENCY as ge}from"../lib/sections/sign-up-catalogue.js";import{CHECK_AFTER_MS as be,EMPTY_DRAFT as Ne,SIGN_UP_WORDS as n,addressSuffix as ae,checkDraft as ye,checkWaitingEmail as xe,countryChoices as ve,currencyChoices as $e,fill as D,linkEnds as Se,linkTokenOf as ke,normaliseSlug as Ce,readSignUpRefusal as Ue,readWaitingRefusal as Re,signUpBody as Te,slugCheckOf as Ae,slugFromName as Ee}from"../lib/sections/sign-up.js";function Oe(t){return t.mode==="find"?e(Q,{contained:t.contained,className:"py-6",children:e(fe,{product:t.product,productName:t.productName,startHref:"/start",inert:!!t.sample})}):e(_e,{...t})}function _e({product:t,productName:a,freeLine:l,zone:i,askCountry:o,termsHref:u,privacyHref:c,findHref:s,contained:y,sample:p}){const[g,f]=m(p??Ne),[U,R]=m(!1),[B,O]=m({}),[T,S]=m(null),[b,h]=m("form"),[G,H]=m(null),[F,L]=m(!1),[_,j]=m(!1),[A,W]=m(()=>ae(i,"")),r=ke(ce()),k=!!r&&!p,w=we(t,g.slug,!!p||k);P(()=>{W(ae(i,window.location.hostname))},[i]),P(()=>{if(p||k)return;let d=!1;return te(t).then(N=>{d||(N.open||h("closed"),f(v=>({...v,country:v.country||N.country,currency:v.currency||N.currency})))}).catch(()=>{}),()=>{d=!0}},[t,p,k]);const C=d=>{f(N=>({...N,...d})),O(N=>{const v={...N};for(const se of Object.keys(d))delete v[se];return v}),S(null)},$=async d=>{L(!0),S(null);try{H(await de(Te(g,t,o))),j(d),h("sent")}catch(N){const v=N instanceof ne?Ue(N.status,N.data):{fields:{},trouble:"failed"};v.trouble==="closed"?h("closed"):Object.keys(v.fields).length?(O(v.fields),h("form")):S(v.trouble)}finally{L(!1)}},I=d=>{if(d.preventDefault(),p||F)return;const N=ye(g,w);O(N),!Object.keys(N).length&&$(!1)};return k?e(Q,{contained:y,className:"py-6",children:e(he,{token:r,productName:a,suffix:A,startHref:"/start",findHref:s})}):e(Q,{contained:y,className:"py-6",children:e(Be,{stage:b,product:t,onOpen:()=>h("form"),productName:a,freeLine:l,suffix:A,askCountry:o,termsHref:u,privacyHref:c,findHref:s,draft:g,wrong:B,slug:w,trouble:T,busy:F,sent:G,resent:_,onChange:C,onCompany:d=>C(U?{company:d}:{company:d,slug:Ee(d)}),onSlug:d=>{R(!0),C({slug:Ce(d)})},onCountry:d=>C({country:d,currency:ge[d]??g.currency}),onSubmit:I,onAgain:()=>{$(!0)},onEdit:()=>{R(!0),S(null),h("form")}})})}function we(t,a,l){const[i,o]=m({slug:"",found:{state:"empty"}}),u=oe("");return P(()=>{if(l||!a)return;u.current=a;const c=window.setTimeout(()=>{te(t,a).then(s=>{u.current===a&&o({slug:a,found:Ae(s)})}).catch(()=>{u.current===a&&o({slug:a,found:{state:"unknown"}})})},be);return()=>window.clearTimeout(c)},[t,a,l]),l?{state:"available"}:a?i.slug===a?i.found:{state:"checking"}:{state:"empty"}}const M="flex h-11 items-center rounded-[10px] border bg-bg px-3",z="h-full w-full bg-transparent text-[14px] text-fg outline-none focus-visible:outline-none! placeholder:text-fg-dim",ie="flex h-11 w-full cursor-pointer items-center justify-center rounded-[10px] border font-medium text-fg disabled:cursor-wait disabled:opacity-60";function Be(t){const{stage:a,productName:l,findHref:i,trouble:o}=t,u=i?x("p",{className:`${E} mt-[10px] text-center`,children:[n.haveOne," ",e(le,{href:i,className:"text-accent",children:n.find})]}):null;return a==="closed"?e(He,{...t,children:u}):a==="sent"?e(Le,{...t}):e(De,{...t,trouble:o,children:u})}function Y({id:t,label:a,error:l,hint:i,children:o}){return x("div",{className:"min-w-0",children:[e("label",{htmlFor:t,className:"mb-1 mt-3 block text-[13px] font-medium",children:a}),o,l?e("p",{id:`${t}-said`,role:"alert",className:"mt-1 text-[13px] text-alert",children:l}):i&&e("p",{id:`${t}-said`,className:"mt-1 text-[13px]",children:i})]})}const V=t=>t?"border-alert":"border-line focus-within:border-accent";function De({productName:t,freeLine:a,suffix:l,askCountry:i,termsHref:o,privacyHref:u,draft:c,wrong:s,slug:y,trouble:p,busy:g=!1,locale:f,onChange:U,onCompany:R,onSlug:B,onCountry:O,onSubmit:T,children:S}){const b=J(),[h,G]=m(f!==void 0);P(()=>G(!0),[]);const H=r=>r?[{value:r,label:r}]:[],F=ee(()=>i?h?ve(c.country,f):H(c.country):[],[i,h,c.country,f]),L=ee(()=>i?h?$e(c.currency,f):H(c.currency):[],[i,h,c.currency,f]),_=(r,k,w,C,$)=>e(Y,{id:`${b}-${r}`,label:k,error:s[r],children:e("div",{className:`${M} ${V(s[r])}`,children:e("input",{id:`${b}-${r}`,name:r,type:w,autoComplete:C,maxLength:$,value:c[r],"aria-invalid":s[r]?!0:void 0,"aria-describedby":s[r]?`${b}-${r}-said`:void 0,onChange:I=>r==="company"?R?.(I.target.value):U?.({[r]:I.target.value}),className:z})})}),j=(r,k,w,C)=>e(Y,{id:`${b}-${r}`,label:k,error:s[r],children:e("div",{className:`${M} ${V(s[r])}`,children:e("select",{id:`${b}-${r}`,name:r,value:c[r],"aria-invalid":s[r]?!0:void 0,onChange:$=>C($.target.value),className:`${z} cursor-pointer`,children:w.map($=>e("option",{value:$.value,children:$.label},$.value))})})}),A=s.slug??(y.state==="problem"?n.slugProblem[y.problem]:void 0),W=y.state==="checking"?e("span",{className:"text-fg-dim",children:n.checking}):y.state==="available"?x("span",{className:"text-green",children:[e("span",{"aria-hidden":!0,children:"✓ "}),n.available]}):void 0;return x("form",{noValidate:!0,onSubmit:T,className:Z,children:[e("h2",{className:q,children:D(n.title,{name:t})}),a&&e("p",{className:`${E} mt-1`,children:a}),x("div",{className:"grid grid-cols-2 gap-[10px]",children:[_("firstName",n.firstName,"text","given-name",150),_("lastName",n.lastName,"text","family-name",150)]}),_("email",n.email,"email","email",254),_("company",n.company,"text","organization",200),e(Y,{id:`${b}-slug`,label:n.address,error:A,hint:W,children:x("div",{className:`${M} gap-2 ${V(A)}`,children:[e("input",{id:`${b}-slug`,name:"slug",type:"text",autoComplete:"off",autoCapitalize:"none",spellCheck:!1,maxLength:30,value:c.slug,"aria-invalid":A?!0:void 0,"aria-describedby":A||W?`${b}-slug-said`:void 0,onChange:r=>B?.(r.target.value),className:`${pe} h-full bg-transparent text-[14px] text-fg outline-none focus-visible:outline-none!`}),l&&e("span",{className:`${E} shrink-0`,children:l})]})}),i&&x(K,{children:[j("country",n.country,F,r=>O?.(r)),j("currency",n.currency,L,r=>U?.({currency:r})),e("p",{className:`${E} mt-[6px]`,children:n.countryHint})]}),p&&e("p",{role:"alert",className:X,children:n.trouble[p]}),e("button",{type:"submit",disabled:g,className:re,children:g?n.sending:n.submit}),e("p",{className:`${E} mt-3 text-center`,children:e(Fe,{termsHref:o,privacyHref:u})}),S]})}function He({product:t="",productName:a,children:l,onOpen:i}){const o=J(),[u,c]=m(""),[s,y]=m(null),[p,g]=m(null),[f,U]=m(!1),[R,B]=m(!1);return x("form",{noValidate:!0,onSubmit:async T=>{if(T.preventDefault(),f)return;const S=xe(u);if(y(S),g(null),!S){U(!0);try{await me(t,u),B(!0)}catch(b){const h=b instanceof ne?Re(b.status,b.data):{open:!1,email:null,trouble:"failed"};h.open&&i?.(),y(h.email),g(h.trouble)}finally{U(!1)}}},className:Z,children:[e("h2",{className:q,children:n.closedTitle}),x("p",{className:"mt-[10px]",children:[D(n.closedBody,{name:a})," ",R?"":n.closedLeave]}),R?e("p",{role:"status",className:"mt-[10px] font-medium",children:D(n.waitingDone,{email:u.trim()})}):x(K,{children:[e(Y,{id:`${o}-email`,label:n.email,error:s??void 0,children:e("div",{className:`${M} ${V(s??void 0)}`,children:e("input",{id:`${o}-email`,name:"email",type:"email",autoComplete:"email",maxLength:254,value:u,"aria-invalid":s?!0:void 0,"aria-describedby":s?`${o}-email-said`:void 0,onChange:T=>{c(T.target.value),y(null),g(null)},className:z})})}),p&&e("p",{role:"alert",className:X,children:n.trouble[p]}),e("button",{type:"submit",disabled:f,className:re,children:f?n.sending:n.tellMe})]}),l]})}function Fe({termsHref:t,privacyHref:a}){const l=(c,s)=>c?e("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"underline underline-offset-2",children:s}):s,[i,o,u]=n.agree.split(/\{terms\}|\{privacy\}/);return x(K,{children:[i,l(t,n.terms),o,l(a,n.privacy),u]})}function Le({draft:t,sent:a,trouble:l,busy:i=!1,resent:o=!1,locale:u,timeZone:c,onAgain:s,onEdit:y}){const[p,g]=D(n.sentBody,{company:t.company.trim()}).split("{email}"),f=Se(a?.expiresAt??"",u,c??ue()??"");return x("div",{className:Z,children:[e("h2",{className:q,children:n.sentTitle}),x("p",{className:"mt-[10px]",children:[p,e("span",{className:"font-medium",children:t.email.trim()}),g]}),f&&e("p",{className:`${E} mt-[10px]`,children:D(n.sentUntil,{when:f})}),l?e("p",{role:"alert",className:X,children:n.trouble[l]}):o&&!i&&e("p",{role:"status",className:`${E} mt-[10px]`,children:n.sentAgain}),e("button",{type:"button",disabled:i,onClick:s,className:`${ie} mt-[18px] border-line`,children:i?n.sendingAgain:n.sendAgain}),e("button",{type:"button",disabled:i,onClick:y,className:`${ie} mt-2 border-transparent`,children:n.change})]})}export{Be as SignUpView,Oe as default};
@@ -37,12 +37,16 @@ export interface BookingFormValue {
37
37
  export declare const BookingFormContext: import("react").Context<BookingFormValue | null>;
38
38
  export declare function useBookingForm(): BookingFormValue;
39
39
  export declare const SAMPLE_SERVICES: BookingService[];
40
+ export declare function sampleAvailability(day: string, zone: string): BookingAvailability;
40
41
  export declare const SAMPLE_CONFIRMATION: BookingConfirmation;
42
+ export declare function sampleConfirmation(times: BookingAvailability | undefined): BookingConfirmation;
43
+ export declare function isSampleConfirmation(confirmation: BookingConfirmation): boolean;
41
44
  export declare function showsExample(editing: boolean, services: BookingService[] | undefined): boolean;
42
45
  export declare function bookingReady(form: {
43
46
  editing: boolean;
44
47
  submitting: boolean;
45
48
  hasService: boolean;
49
+ hasDay?: boolean;
46
50
  selectedStart: string;
47
51
  name: string;
48
52
  email: string;
@@ -1 +1 @@
1
- "use client";import{jsx as se}from"react/jsx-runtime";import{createContext as ae,useContext as re,useEffect as b,useId as le,useMemo as ce,useState as n}from"react";import{ApiError as N,bookings as h}from"../../lib/api/index.js";import{findFirstBookableDay as ue,isoDate as me}from"../../lib/booking-dates.js";import{startHasPassed as de}from"../../lib/booking/appointment-time.js";import{uuid as Z}from"../../lib/uuid.js";import{listRows as fe}from"../../lib/api/list-rows.js";const z=ae(null);function ke(){const e=re(z);if(!e)throw new Error("useBookingForm must be used inside <BookingFormProvider>");return e}const T=[{id:"example-1",name:"Example service",durationMinutes:45,price:"80.00",description:"What this appointment includes, in a sentence."},{id:"example-2",name:"Second example",durationMinutes:30,price:"0",description:""}];function pe(e){return{timezone:"UTC",slots:[`${e}T09:00:00.000Z`,`${e}T10:30:00.000Z`,`${e}T13:00:00.000Z`].map(a=>({start:a}))}}const ve={bookingNumber:"EXAMPLE-0000",service:"Example service",startAt:"2026-01-01T00:00:00.000Z",timezone:"UTC",customerTimezone:"",manageToken:"example"};function be(e,a){return e&&a?.length===0}function he(e,a){return!!(!e.editing&&!e.submitting&&e.hasService&&e.selectedStart&&!de(e.selectedStart,a)&&e.name.trim()&&e.email.trim()&&!e.requiresPayment)}function Ae({editing:e=!1,previewConfirmation:a=!1,children:$}){const L=le(),m=ce(()=>me(new Date),[]),[y,E]=n(),[R,W]=n(""),[s,P]=n(""),[r,k]=n(m),[j,q]=n(m),[d,O]=n(!1),[U,c]=n(null),[_,u]=n(),[S,f]=n(""),[g,K]=n(""),[x,H]=n(""),[A,V]=n(""),[D,X]=n(""),[Y,G]=n(()=>Z()),[J,Q]=n(null),[ee,p]=n(!1),[C,I]=n(!1),[te,v]=n(null),[w,ne]=n("");b(()=>{ne(Intl.DateTimeFormat().resolvedOptions().timeZone??"")},[]),b(()=>{let i=!1;return h.listServices().then(t=>{if(i)return;const F=fe(t);E(F),W(t.currency),P(oe=>oe||F[0]?.id||"")}).catch(()=>{i||E([])}),()=>{i=!0}},[]),b(()=>{if(d||!s)return;const i={aborted:!1};return f(""),u(void 0),v(null),c(null),p(!0),ue(s,m,{signal:i}).then(t=>{if(!i.aborted){if(t.outcome==="found"){k(t.date),q(t.date),u(t.availability);return}c(t.outcome==="noneInWindow"?`No times are available in the next ${t.days} days.`:"We couldn't load available times. Please try again.")}}).finally(()=>{i.aborted||p(!1)}),()=>{i.aborted=!0}},[d,s,m]),b(()=>{if(!d||!s||!r)return;let i=!1;return f(""),u(void 0),v(null),c(null),p(!0),h.getAvailability(s,r).then(t=>{i||(u(t),t.slots.length===0&&c("No times are available on this date."))}).catch(()=>{i||c("We couldn't load available times. Please try again.")}).finally(()=>{i||p(!1)}),()=>{i=!0}},[r,d,s]);const l=y?.find(i=>i.id===s),B=l?.depositAmountDue!=null,M=he({editing:e,submitting:C,hasService:!!l,selectedStart:S,name:g,email:x,requiresPayment:B},Date.now());async function ie(i){if(i.preventDefault(),!(!M||!l)){I(!0),v(null);try{const t=await h.create({serviceId:l.id,start:S,customer:{name:g.trim(),email:x.trim(),phone:A.trim()},notes:D.trim(),idempotencyKey:Y,customerTimezone:w});Q(t),G(Z())}catch(t){v(t instanceof N&&t.status===409?"That time was just booked. Choose another available time.":"Your appointment wasn't submitted. Please check your details and try again."),t instanceof N&&t.status===409&&(f(""),h.getAvailability(l.id,r).then(u).catch(()=>{}))}finally{I(!1)}}}const o=be(e,y);return se(z.Provider,{value:{fieldPrefix:L,editing:e,services:o?T:y,currency:o?"AUD":R,serviceId:o?T[0].id:s,setServiceId:P,service:o?T[0]:l,requiresPayment:o?!1:B,date:r,earliestDate:j,setDate:k,setDateTouched:O,availability:o?pe(r):_,loadingSlots:o?!1:ee,noSlotsMessage:U,selectedStart:o?`${r}T09:00:00.000Z`:S,setSelectedStart:f,customerTimezone:w,name:g,setName:K,email:x,setEmail:H,phone:A,setPhone:V,notes:D,setNotes:X,confirmation:J??(a?ve:null),submitting:C,error:te,canSubmit:o?!1:M,handleSubmit:ie,sample:!!o},children:$})}export{z as BookingFormContext,Ae as BookingFormProvider,ve as SAMPLE_CONFIRMATION,T as SAMPLE_SERVICES,he as bookingReady,be as showsExample,ke as useBookingForm};
1
+ "use client";import{jsx as ce}from"react/jsx-runtime";import{createContext as ue,useContext as me,useEffect as f,useId as de,useState as o,useSyncExternalStore as fe}from"react";import{ApiError as j,bookings as g}from"../../lib/api/index.js";import{findFirstBookableDay as pe}from"../../lib/booking-dates.js";import{startHasPassed as ye}from"../../lib/booking/appointment-time.js";import{instantOnDayKey as be,userToday as he,userZone as ve}from"efficient-shell/format";import{uuid as q}from"../../lib/uuid.js";import{listRows as Se}from"../../lib/api/list-rows.js";const K=ue(null);function Fe(){const e=me(K);if(!e)throw new Error("useBookingForm must be used inside <BookingFormProvider>");return e}const D=[{id:"example-1",name:"Example service",durationMinutes:45,price:"80.00",description:"What this appointment includes, in a sentence."},{id:"example-2",name:"Second example",durationMinutes:30,price:"0",description:""}],ge=[{hour:9,minute:0},{hour:10,minute:30},{hour:13,minute:0}];function O(e,i){return{timezone:"",slots:i?ge.flatMap(({hour:u,minute:s})=>be(e,{timeZone:i,hour:u,minute:s})??[]).map(u=>({start:u})):[]}}const C={bookingNumber:"EXAMPLE-0000",service:"Example service",startAt:"",timezone:"",customerTimezone:"",manageToken:"example"};function xe(e){const i=String(e?.slots[0]?.start??"");return i?{...C,startAt:i}:C}function Le(e){return e.bookingNumber===C.bookingNumber}function Ee(e,i){return e&&i?.length===0}function Pe(e,i){return!!(!e.editing&&!e.submitting&&e.hasService&&e.hasDay!==!1&&e.selectedStart&&!ye(e.selectedStart,i)&&e.name.trim()&&e.email.trim()&&!e.requiresPayment)}function ke(){return()=>{}}function Ae(){return null}function ze({editing:e=!1,previewConfirmation:i=!1,children:I}){const u=de(),s=fe(ke,he,Ae)??"",[x,M]=o(),[Z,H]=o(""),[r,T]=o(""),[l,E]=o(s),[U,B]=o(s),[p,V]=o(!1),[X,m]=o(null),[Y,d]=o(),[P,y]=o(""),[k,$]=o(""),[A,G]=o(""),[N,J]=o(""),[w,Q]=o(""),[ee,te]=o(()=>q()),[F,ne]=o(null),[oe,b]=o(!1),[L,z]=o(!1),[ie,h]=o(null),[v,se]=o("");f(()=>{se(ve()??"")},[]),f(()=>{let t=!1;return g.listServices().then(n=>{if(t)return;const _=Se(n);M(_),H(n.currency),T(le=>le||_[0]?.id||"")}).catch(()=>{t||M([])}),()=>{t=!0}},[]),f(()=>{s&&(E(t=>t||s),B(t=>t||s))},[s]),f(()=>{if(p||!r||!s)return;const t={aborted:!1};return y(""),d(void 0),h(null),m(null),b(!0),pe(r,s,{signal:t}).then(n=>{if(!t.aborted){if(n.outcome==="found"){E(n.date),B(n.date),d(n.availability);return}m(n.outcome==="noneInWindow"?`No times are available in the next ${n.days} days.`:"We couldn't load available times. Please try again.")}}).finally(()=>{t.aborted||b(!1)}),()=>{t.aborted=!0}},[p,r,s]),f(()=>{if(!p||!r||!l)return;let t=!1;return y(""),d(void 0),h(null),m(null),b(!0),g.getAvailability(r,l).then(n=>{t||(d(n),n.slots.length===0&&m("No times are available on this date."))}).catch(()=>{t||m("We couldn't load available times. Please try again.")}).finally(()=>{t||b(!1)}),()=>{t=!0}},[l,p,r]);const c=x?.find(t=>t.id===r),R=c?.depositAmountDue!=null,W=Pe({editing:e,submitting:L,hasService:!!c,hasDay:!!l,selectedStart:P,name:k,email:A,requiresPayment:R},Date.now());async function ae(t){if(t.preventDefault(),!(!W||!c)){z(!0),h(null);try{const n=await g.create({serviceId:c.id,start:P,customer:{name:k.trim(),email:A.trim(),phone:N.trim()},notes:w.trim(),idempotencyKey:ee,customerTimezone:v});ne(n),te(q())}catch(n){h(n instanceof j&&n.status===409?"That time was just booked. Choose another available time.":"Your appointment wasn't submitted. Please check your details and try again."),n instanceof j&&n.status===409&&(y(""),g.getAvailability(c.id,l).then(d).catch(()=>{}))}finally{z(!1)}}}const a=Ee(e,x),S=a?O(l,v):void 0,re=i&&!F?xe(S??O(l,v)):null;return ce(K.Provider,{value:{fieldPrefix:u,editing:e,services:a?D:x,currency:a?"AUD":Z,serviceId:a?D[0].id:r,setServiceId:T,service:a?D[0]:c,requiresPayment:a?!1:R,date:l,earliestDate:U,setDate:E,setDateTouched:V,availability:S??Y,loadingSlots:a?!1:oe,noSlotsMessage:X,selectedStart:S?S.slots[0]?.start??"":P,setSelectedStart:y,customerTimezone:v,name:k,setName:$,email:A,setEmail:G,phone:N,setPhone:J,notes:w,setNotes:Q,confirmation:F??re,submitting:L,error:ie,canSubmit:a?!1:W,handleSubmit:ae,sample:!!a},children:I})}export{K as BookingFormContext,ze as BookingFormProvider,C as SAMPLE_CONFIRMATION,D as SAMPLE_SERVICES,Pe as bookingReady,Le as isSampleConfirmation,O as sampleAvailability,xe as sampleConfirmation,Ee as showsExample,Fe as useBookingForm};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{SAMPLE_CONFIRMATION as O,useBookingForm as C}from"./BookingFormState.js";import $ from"efficient-web-builder/render/components/Btn";import{HideTaker as F}from"efficient-web-builder/render/components/ViewHideRoot";import c from"../WebFormField.js";import{CardTemplateRows as I}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as S}from"efficient-web-builder/render/components/SiteGutterFrame";import{groundCell as A}from"../card-ground-cell.js";import{PART_ROW_ATTR as D,encodePartRow as j}from"efficient-web-builder/render/lib/document/text-parts";import{BOOKING_SERVICE_SLOT as E,BOOKING_TIME_SLOT as P}from"../../lib/content/booking-card-seed.js";import{formatAppointment as _,formatAppointmentTime as B,startHasPassed as H}from"../../lib/booking/appointment-time.js";import{formatMoneyInCurrency as K}from"../../lib/commerce.js";import{FREE_PRICE as W}from"../../lib/wheels/price-display.js";const p="w-full border-2 border-line bg-bg px-4 py-4 font-[family-name:var(--bk-value-font,var(--font-display))] text-[length:var(--bk-value-size,17px)] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent";function G(r,t){const n=Number(r);if(n===0)return W;try{return K(n,t)}catch{return`${t} ${r}`}}const R={selected:!0};function M(r,t){return({index:n})=>t?{[D]:j(r,n)}:{}}const u="font-[family-name:var(--bk-name-font,var(--font-mono))] text-[length:var(--bk-name-size,12px)]";function w({number:r,children:t}){return o("div",{className:"mb-4 flex items-center gap-3",children:[e("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full border border-line font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,11px)] font-semibold text-fg-dim",children:r}),e("h3",{className:"font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,12px)] font-semibold uppercase tracking-[0.2em] text-fg",children:t})]})}function oe({eyebrow:r,heading:t,intro:n}){return o("div",{className:"mb-10 max-w-[760px]",children:[(r??"").trim()&&e("p",{className:"mb-4 font-mono text-[12px] font-semibold uppercase tracking-[0.24em] text-accent",children:r}),(t??"").trim()&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.98] tracking-[-0.025em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:t}),(n??"").trim()&&e("p",{className:"mt-5 max-w-[660px] font-display text-[17px] leading-[1.65] text-fg-dim",children:n})]})}function se({style:r,owner:t}){const{fieldPrefix:n,services:l,currency:h,serviceId:x,setServiceId:b,requiresPayment:v,date:k,earliestDate:y,setDate:N,setDateTouched:T,availability:i,loadingSlots:f,noSlotsMessage:g,selectedStart:s,setSelectedStart:q,customerTimezone:m,editing:d}=C();if(!l)return null;const L=Date.now(),z=(i?.slots??[]).map(a=>({start:a.start,time:B(a.start,m||i.timezone),businessTime:m&&m!==i.timezone?`${B(a.start,i.timezone)} business`:"",passed:!d&&H(a.start,L)}));return o(F,{className:"flex flex-col gap-10",style:r,children:[o("div",{children:[e(w,{number:"01",children:"Choose a service"}),e("div",{className:"grid gap-3 sm:grid-cols-2",children:e(I,{ownerId:t.id,ownerType:t.type,slot:E,Template:t.serviceTemplate,rows:l.map(a=>({name:a.name,meta:`${a.durationMinutes} min · ${G(a.price,h)}`,description:a.description??""})),states:l.map(a=>a.id===x?R:void 0),actions:d?void 0:l.map(a=>({press:()=>b(a.id),label:a.name})),copyAttrs:M(E,d),fallback:null,wrapCopy:A,children:a=>e(S,{children:a})})}),v&&e("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.14em] text-alert",role:"alert",children:"This service requires an upfront payment and cannot be booked through this form yet."})]}),o("div",{children:[e(w,{number:"02",children:"Choose a date and time"}),e(c,{separate:!0,htmlFor:`${n}-date`,label:"Date",required:!0,labelFace:u,children:e("input",{id:`${n}-date`,type:"date",min:y,value:k,onChange:a=>{T(!0),N(a.target.value)},className:p,required:!0})}),e("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 min-[1200px]:grid-cols-4",role:"group","aria-label":"Available appointment times",children:f?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",children:"Loading times…"}):i?.slots.length?e(I,{ownerId:t.id,ownerType:t.type,slot:P,Template:t.timeTemplate,rows:z.map(a=>({time:a.time,businessTime:a.businessTime})),states:z.map(a=>a.start===s&&!a.passed?R:void 0),actions:d?void 0:z.map(a=>({press:()=>q(a.start),label:a.time,disabled:a.passed})),copyAttrs:M(P,d),fallback:null,wrapCopy:A,children:a=>e(S,{children:a})}):g?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",role:"status",children:g}):null}),i?.timezone&&o("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,10px)] uppercase tracking-[0.16em] text-fg-dim",children:["Times shown in ",m||i.timezone,m&&m!==i.timezone?` · business timezone ${i.timezone}`:""]})]})]})}function le({buttonLabel:r,style:t}){const{fieldPrefix:n,editing:l,name:h,setName:x,email:b,setEmail:v,phone:k,setPhone:y,notes:N,setNotes:T,submitting:i,error:f,canSubmit:g}=C();return o(F,{className:"sf-card border border-line bg-bg p-5 min-[640px]:p-8",style:t,children:[e(w,{number:"03",children:"Your details"}),o("div",{className:"flex flex-col gap-4",children:[e(c,{separate:!0,htmlFor:`${n}-name`,label:"Name",required:!0,labelFace:u,children:e("input",{id:`${n}-name`,type:"text",autoComplete:"name",value:h,onChange:s=>x(s.target.value),className:p,required:!0})}),e(c,{separate:!0,htmlFor:`${n}-email`,label:"Email",required:!0,labelFace:u,children:e("input",{id:`${n}-email`,type:"email",inputMode:"email",autoComplete:"email",value:b,onChange:s=>v(s.target.value),className:p,required:!0})}),e(c,{separate:!0,htmlFor:`${n}-phone`,label:"Phone",labelFace:u,children:e("input",{id:`${n}-phone`,type:"tel",inputMode:"tel",autoComplete:"tel",value:k,onChange:s=>y(s.target.value),className:p})}),e(c,{separate:!0,htmlFor:`${n}-notes`,label:"What would you like to cover?",labelFace:u,children:e("textarea",{id:`${n}-notes`,rows:4,value:N,onChange:s=>T(s.target.value),className:`${p} resize-y`})})]}),f&&e("p",{className:"mt-4 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.16em] text-alert",role:"alert",children:f}),e($,{type:l?"button":"submit",disabled:!g,arrow:null,className:"mt-6 w-full disabled:cursor-not-allowed disabled:opacity-50",children:i?"Submitting…":(r??"").trim()||"Book appointment"})]})}function me({successMessage:r}){const{confirmation:t,customerTimezone:n}=C();return t?o("div",{className:"sf-card max-w-[760px] border border-line bg-bg p-6 min-[640px]:p-10",role:"status",children:[o("p",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-accent",children:["Request received · ",t.bookingNumber]}),e("h3",{className:"mt-4 font-display text-[28px] font-medium uppercase text-fg",children:t.service}),e("p",{className:"mt-2 font-display text-[17px] text-fg-dim",children:_(t.startAt,t.customerTimezone||n||t.timezone)}),t.customerTimezone&&t.timezone!==t.customerTimezone&&o("p",{className:"mt-1 font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:["Business time: ",_(t.startAt,t.timezone)]}),(r??"").trim()&&e("p",{className:"mt-5 max-w-[620px] font-serif text-[18px] italic leading-[1.6] text-fg-dim",children:r}),e($,{href:`/book/${encodeURIComponent(t.manageToken)}`,newTab:t!==O,variant:"ghost",className:"mt-8",children:"Manage booking"})]}):null}export{se as BookingChoose,me as BookingConfirmed,le as BookingDetails,oe as BookingHead};
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import{isSampleConfirmation as H,useBookingForm as F}from"./BookingFormState.js";import B from"efficient-web-builder/render/components/Btn";import{HideTaker as I}from"efficient-web-builder/render/components/ViewHideRoot";import u from"../WebFormField.js";import{CardTemplateRows as A}from"efficient-web-builder/render/components/CardRowContext";import{InsideSiteColumn as E}from"efficient-web-builder/render/components/SiteGutterFrame";import{groundCell as P}from"../card-ground-cell.js";import{PART_ROW_ATTR as K,encodePartRow as W}from"efficient-web-builder/render/lib/document/text-parts";import{BOOKING_SERVICE_SLOT as R,BOOKING_TIME_SLOT as _}from"../../lib/content/booking-card-seed.js";import{firstReadableZone as v}from"../../lib/zone.js";import{formatAppointment as q,formatAppointmentTime as D,startHasPassed as G}from"../../lib/booking/appointment-time.js";import{formatMoneyInCurrency as U}from"../../lib/commerce.js";import{FREE_PRICE as V}from"../../lib/wheels/price-display.js";const f="w-full border-2 border-line bg-bg px-4 py-4 font-[family-name:var(--bk-value-font,var(--font-display))] text-[length:var(--bk-value-size,17px)] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent";function Y(r,a){const n=Number(r);if(n===0)return V;try{return U(n,a)}catch{return`${a} ${r}`}}const L={selected:!0};function M(r,a){return({index:n})=>a?{[K]:W(r,n)}:{}}const h="font-[family-name:var(--bk-name-font,var(--font-mono))] text-[length:var(--bk-name-size,12px)]";function S({number:r,children:a}){return i("div",{className:"mb-4 flex items-center gap-3",children:[e("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full border border-line font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,11px)] font-semibold text-fg-dim",children:r}),e("h3",{className:"font-[family-name:var(--bk-step-font,var(--font-mono))] text-[length:var(--bk-step-size,12px)] font-semibold uppercase tracking-[0.2em] text-fg",children:a})]})}function de({eyebrow:r,heading:a,intro:n}){return i("div",{className:"mb-10 max-w-[760px]",children:[(r??"").trim()&&e("p",{className:"mb-4 font-mono text-[12px] font-semibold uppercase tracking-[0.24em] text-accent",children:r}),(a??"").trim()&&e("h2",{className:"font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-[0.98] tracking-[-0.025em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:a}),(n??"").trim()&&e("p",{className:"mt-5 max-w-[660px] font-display text-[17px] leading-[1.65] text-fg-dim",children:n})]})}function pe({style:r,owner:a}){const{fieldPrefix:n,services:o,currency:l,serviceId:c,setServiceId:k,requiresPayment:y,date:N,earliestDate:T,setDate:C,setDateTouched:w,availability:m,loadingSlots:d,noSlotsMessage:g,selectedStart:s,setSelectedStart:O,customerTimezone:Z,editing:p}=F();if(!o)return null;const j=Date.now(),x=v(Z,m?.timezone??""),z=v(m?.timezone??""),b=z&&z!==x?z:"",$=(m?.slots??[]).map(t=>({start:t.start,time:D(t.start,x),businessTime:b?`${D(t.start,b)} business`:"",passed:!p&&G(t.start,j)}));return i(I,{className:"flex flex-col gap-10",style:r,children:[i("div",{children:[e(S,{number:"01",children:"Choose a service"}),e("div",{className:"grid gap-3 sm:grid-cols-2",children:e(A,{ownerId:a.id,ownerType:a.type,slot:R,Template:a.serviceTemplate,rows:o.map(t=>({name:t.name,meta:`${t.durationMinutes} min · ${Y(t.price,l)}`,description:t.description??""})),states:o.map(t=>t.id===c?L:void 0),actions:p?void 0:o.map(t=>({press:()=>k(t.id),label:t.name})),copyAttrs:M(R,p),fallback:null,wrapCopy:P,children:t=>e(E,{children:t})})}),y&&e("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.14em] text-alert",role:"alert",children:"This service requires an upfront payment and cannot be booked through this form yet."})]}),i("div",{children:[e(S,{number:"02",children:"Choose a date and time"}),e(u,{separate:!0,htmlFor:`${n}-date`,label:"Date",required:!0,labelFace:h,children:e("input",{id:`${n}-date`,type:"date",min:T,value:N,onChange:t=>{w(!0),C(t.target.value)},className:f,required:!0})}),e("div",{className:"mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3 min-[1200px]:grid-cols-4",role:"group","aria-label":"Available appointment times",children:d?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",children:"Loading times…"}):m?.slots.length?e(A,{ownerId:a.id,ownerType:a.type,slot:_,Template:a.timeTemplate,rows:$.map(t=>({time:t.time,businessTime:t.businessTime})),states:$.map(t=>t.start===s&&!t.passed?L:void 0),actions:p?void 0:$.map(t=>({press:()=>O(t.start),label:t.time,disabled:t.passed})),copyAttrs:M(_,p),fallback:null,wrapCopy:P,children:t=>e(E,{children:t})}):g?e("p",{className:"col-span-full py-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.18em] text-fg-dim",role:"status",children:g}):null}),x&&!d&&!!m?.slots.length&&i("p",{className:"mt-3 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,10px)] uppercase tracking-[0.16em] text-fg-dim",children:["Times shown in ",x,b?` · business timezone ${b}`:""]})]})]})}function ue({buttonLabel:r,style:a}){const{fieldPrefix:n,editing:o,name:l,setName:c,email:k,setEmail:y,phone:N,setPhone:T,notes:C,setNotes:w,submitting:m,error:d,canSubmit:g}=F();return i(I,{className:"sf-card border border-line bg-bg p-5 min-[640px]:p-8",style:a,children:[e(S,{number:"03",children:"Your details"}),i("div",{className:"flex flex-col gap-4",children:[e(u,{separate:!0,htmlFor:`${n}-name`,label:"Name",required:!0,labelFace:h,children:e("input",{id:`${n}-name`,type:"text",autoComplete:"name",value:l,onChange:s=>c(s.target.value),className:f,required:!0})}),e(u,{separate:!0,htmlFor:`${n}-email`,label:"Email",required:!0,labelFace:h,children:e("input",{id:`${n}-email`,type:"email",inputMode:"email",autoComplete:"email",value:k,onChange:s=>y(s.target.value),className:f,required:!0})}),e(u,{separate:!0,htmlFor:`${n}-phone`,label:"Phone",labelFace:h,children:e("input",{id:`${n}-phone`,type:"tel",inputMode:"tel",autoComplete:"tel",value:N,onChange:s=>T(s.target.value),className:f})}),e(u,{separate:!0,htmlFor:`${n}-notes`,label:"What would you like to cover?",labelFace:h,children:e("textarea",{id:`${n}-notes`,rows:4,value:C,onChange:s=>w(s.target.value),className:`${f} resize-y`})})]}),d&&e("p",{className:"mt-4 font-[family-name:var(--bk-note-font,var(--font-mono))] text-[length:var(--bk-note-size,11px)] uppercase tracking-[0.16em] text-alert",role:"alert",children:d}),e(B,{type:o?"button":"submit",disabled:!g,arrow:null,className:"mt-6 w-full disabled:cursor-not-allowed disabled:opacity-50",children:m?"Submitting…":(r??"").trim()||"Book appointment"})]})}function fe({successMessage:r}){const{confirmation:a,customerTimezone:n}=F();if(!a)return null;const o=v(a.customerTimezone,n,a.timezone),l=v(a.timezone),c=l&&l!==o?l:"";return i("div",{className:"sf-card max-w-[760px] border border-line bg-bg p-6 min-[640px]:p-10",role:"status",children:[i("p",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.22em] text-accent",children:["Request received · ",a.bookingNumber]}),e("h3",{className:"mt-4 font-display text-[28px] font-medium uppercase text-fg",children:a.service}),e("p",{className:"mt-2 font-display text-[17px] text-fg-dim",children:q(a.startAt,o)}),c&&i("p",{className:"mt-1 font-mono text-[10px] uppercase tracking-[0.16em] text-fg-dim",children:["Business time: ",q(a.startAt,c)]}),(r??"").trim()&&e("p",{className:"mt-5 max-w-[620px] font-serif text-[18px] italic leading-[1.6] text-fg-dim",children:r}),e(B,{href:`/book/${encodeURIComponent(a.manageToken)}`,newTab:!H(a),variant:"ghost",className:"mt-8",children:"Manage booking"})]})}export{pe as BookingChoose,fe as BookingConfirmed,ue as BookingDetails,de as BookingHead};
@@ -1,6 +1,6 @@
1
1
  import type { RefObject } from "react";
2
2
  import { type CartLine } from "../CartContext.js";
3
- import type { TyreSummary } from "../../lib/api/index.js";
3
+ import type { TyreThumbnail } from "../useTyreCatalog.js";
4
4
  import { type CartDrawerContent } from "efficient-web-builder/format/lib/content/cart-drawer";
5
5
  export declare function CartDrawerHeader({ content, closeRef, }: {
6
6
  content: CartDrawerContent;
@@ -11,7 +11,7 @@ export declare function CartStatusRail({ content }: {
11
11
  }): import("react").JSX.Element;
12
12
  export declare function CartLines({ content, tyres, }: {
13
13
  content: CartDrawerContent;
14
- tyres: ReadonlyMap<string, TyreSummary>;
14
+ tyres: ReadonlyMap<string, TyreThumbnail>;
15
15
  }): import("react").JSX.Element;
16
16
  export declare function CartUpsell(): import("react").JSX.Element;
17
17
  export declare function CartCouponRow(): import("react").JSX.Element;
@@ -22,7 +22,7 @@ export declare function CartTotals(): import("react").JSX.Element;
22
22
  export declare function CartActions(): import("react").JSX.Element;
23
23
  export declare function CartLineRow({ line, tyre, onRemove, onQtyChange, }: {
24
24
  line: CartLine;
25
- tyre?: TyreSummary | null;
25
+ tyre?: TyreThumbnail | null;
26
26
  onRemove: () => void;
27
27
  onQtyChange: (q: number) => void;
28
28
  }): import("react").JSX.Element;