efficient-web-builder 0.8.1 → 0.10.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 (43) hide show
  1. package/CHANGELOG.md +109 -1
  2. package/README.md +24 -5
  3. package/dist/chunks/{EditorPreviewCheckout-RALICX2M.js → EditorPreviewCheckout-5KOAA2SK.js} +3 -3
  4. package/dist/chunks/PreviewFooter-H6XJUR5S.js +1 -0
  5. package/dist/chunks/SectionEditorShell-EEZR7KFE.js +1 -0
  6. package/dist/chunks/{SiteEditorProvider-4NZYBEVE.js → SiteEditorProvider-ECGZVKLG.js} +1 -1
  7. package/dist/chunks/StorefrontEditorChrome-4TFS62GY.js +1 -0
  8. package/dist/chunks/chunk-6CP4D6VJ.js +1 -0
  9. package/dist/chunks/chunk-7QXLVNFD.js +1 -0
  10. package/dist/chunks/chunk-BJOS4Y35.js +15 -0
  11. package/dist/chunks/chunk-EIXUXJQ5.js +153 -0
  12. package/dist/chunks/chunk-H7O6ZYX6.js +1 -0
  13. package/dist/chunks/chunk-IFRGL3GL.js +1 -0
  14. package/dist/chunks/chunk-ML2AR222.js +1 -0
  15. package/dist/chunks/chunk-RRHBLOH4.js +1 -0
  16. package/dist/chunks/chunk-S6SXIMIG.js +2 -0
  17. package/dist/chunks/chunk-SNH7IFTZ.js +1 -0
  18. package/dist/chunks/chunk-Y4CZD2YY.js +230 -0
  19. package/dist/chunks/{chunk-6VNEBJKI.js → chunk-YVQUISDX.js} +1 -1
  20. package/dist/chunks/fitment-data-6NXSKODX.js +1 -0
  21. package/dist/chunks/render-client-YGYDU3K2.js +1 -0
  22. package/dist/editor.css +1 -1
  23. package/dist/index.d.ts +184 -4
  24. package/dist/index.js +920 -648
  25. package/dist/links.js +1 -1
  26. package/package.json +2 -2
  27. package/dist/chunks/PreviewFooter-SNJQZ6JZ.js +0 -1
  28. package/dist/chunks/SectionEditorShell-U5FUJW2M.js +0 -1
  29. package/dist/chunks/StorefrontEditorChrome-6OQOFCL6.js +0 -1
  30. package/dist/chunks/chunk-4MT74TMP.js +0 -1
  31. package/dist/chunks/chunk-764WH3TY.js +0 -11
  32. package/dist/chunks/chunk-CZ46NWN5.js +0 -230
  33. package/dist/chunks/chunk-DN65SLZM.js +0 -1
  34. package/dist/chunks/chunk-KZIT3J33.js +0 -1
  35. package/dist/chunks/chunk-RTCXXI5U.js +0 -143
  36. package/dist/chunks/chunk-TX7ND7AF.js +0 -1
  37. package/dist/chunks/chunk-WQ7W4AXL.js +0 -15
  38. package/dist/chunks/chunk-XMRSKZIR.js +0 -2
  39. package/dist/chunks/fitment-data-6EHBA26C.js +0 -1
  40. package/dist/chunks/render-client-ISZ5CGAI.js +0 -1
  41. /package/dist/chunks/{chunk-WQ7W4AXL.js.LEGAL.txt → chunk-BJOS4Y35.js.LEGAL.txt} +0 -0
  42. /package/dist/chunks/{chunk-RTCXXI5U.js.LEGAL.txt → chunk-EIXUXJQ5.js.LEGAL.txt} +0 -0
  43. /package/dist/chunks/{chunk-UBYBQ3KR.js → chunk-HVOO2GNE.js} +0 -0
@@ -0,0 +1 @@
1
+ import{Aa as It,Ab as En,Ae as he,Bb as xn,Ca as ce,Da as Ft,Ga as Ht,Ia as Z,Ib as j,Kh as Vn,La as At,Ma as Ot,Mg as zn,Na as Lt,O as Ct,Oa as Bt,Ob as J,Pa as Dt,Pe as On,Qa as Wt,Qe as Ln,Qg as Mn,Ra as Gt,Re as Bn,Sa as zt,Ta as Mt,Td as Hn,Ue as Dn,Ya as Vt,Zb as We,Zf as Wn,ab as Ut,hb as $t,ib as Kt,jb as Xt,kb as Yt,lb as de,mb as qt,mf as G,nd as kn,ob as Le,od as Nn,pb as ue,pd as In,pe as Ge,qb as Zt,rb as jt,ua as kt,ud as Fn,vd as S,ze as An}from"./chunk-BJOS4Y35.js";import{b as _n}from"./chunk-HVOO2GNE.js";import{$ as Be,Aa as wn,B as Jt,Ba as Tn,C as Qt,Ca as vn,D as en,Da as Cn,E as tn,Ea as Pn,F as nn,Ha as Rn,La as F,Ma as Gn,U as on,V as an,W as sn,X as rn,_ as ln,aa as cn,ba as dn,ca as un,d as Pt,e as Rt,f as Et,fa as hn,g as xt,ga as pn,h as L,i as He,j as Ae,ja as mn,ka as fn,ma as gn,n as K,o as Oe,p as _t,qa as yn,r as Nt,va as De,wa as bn,ya as Sn}from"./chunk-IFRGL3GL.js";var ko=".sf-editor #preview-frame",X=()=>document.querySelector(ko);function mr(e){Nt()||requestAnimationFrame(()=>{X()?.contentDocument?.querySelector(`[data-puck-component="${CSS.escape(e)}"]`)?.scrollIntoView({behavior:"smooth",block:"start"})})}function fr(e,t){let n=X()?.contentWindow;if(!n)return;let o={id:e,index:t};n.dispatchEvent(new CustomEvent(Vn,{detail:o}))}function gr(){requestAnimationFrame(()=>{X()?.contentWindow?.scrollTo({top:0,behavior:"smooth"})})}function Un(e,{passes:t=[150,400],onPinned:n}={}){let o=0,r=!1,a=[],i=()=>{let l=X(),p=l?.contentWindow,h=l?.contentDocument;if(!p||!h)return!1;let C=e(p,h);if(C==null)return!1;if(p.scrollTo({left:p.scrollX,top:C,behavior:"instant"}),!r){r=!0,n?.();for(let T of t)a.push(setTimeout(i,T))}return!0},d=()=>{!i()&&o++<150&&a.push(setTimeout(d,32))};return d(),()=>a.forEach(clearTimeout)}function yr(e){return Un((t,n)=>{let o=n.querySelector(`[data-puck-component="${CSS.escape(e)}"]`);return o?t.scrollY+o.getBoundingClientRect().top:null})}function br(e){return Un((t,n)=>{if(!n.querySelector("[data-puck-component]"))return null;let o=Math.max(n.documentElement.scrollHeight,n.body?.scrollHeight??0);return o<=n.documentElement.clientHeight?null:o},{passes:[150,400,800,1300,2e3],onPinned:e})}import{useEasel as mt}from"efficient-easel/easel";import{useEffect as Ps,useRef as yo,useState as ke}from"react";import{useState as Kn}from"react";import{SettingsField as Io}from"efficient-easel/panel";import{jsx as Q,jsxs as ze}from"react/jsx-runtime";function No(e){return e===1?"1 color theme":`${e} color themes`}function $n({count:e,onCancel:t,onConfirm:n}){return Q("div",{className:"sf-cleardlg-veil",role:"dialog","aria-modal":"true","aria-labelledby":"sf-clear-colours-title",children:ze("div",{className:"sf-cleardlg",children:[Q("h2",{id:"sf-clear-colours-title",className:"sf-cleardlg-title",children:"Clear this site\u2019s colors?"}),ze("p",{className:"sf-cleardlg-body",children:["This site has ",No(e)," of its own. Clearing takes them away and puts back the four the shop supplies."]}),Q("p",{className:"sf-cleardlg-final",children:"This cannot be undone."}),ze("div",{className:"sf-cleardlg-btns",children:[Q("button",{type:"button",onClick:t,className:"sf-cleardlg-btn",children:"Cancel"}),Q("button",{type:"button",onClick:n,className:"sf-cleardlg-btn sf-cleardlg-btn--danger",children:"Clear colors"})]})]})})}import{Fragment as Lo,jsx as z,jsxs as Yn}from"react/jsx-runtime";var Fo=On("the row's whole content is an action; the gutter names a subject and this row has none \u2014 the button's label is the name GG, 2026-09-23");function Ho(){return z("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:z("path",{d:"M12 5v14M5 12h14"})})}var Xn="Reset color",Ao={selected:0,themes:[]};function Oo(e){e(Ao)}function Me({value:e,onChange:t}){let n=e?.themes??[],o=n.length===0,r=Jt(e),[a,i]=Kn(!1),[d,l]=Kn(null),p=(s,g)=>{t({...r,themes:r.themes.map((v,I)=>I===s?g:v)})},h=tn(r).accent,C=new Set(r.themes.map(s=>s.brandInk).filter(Boolean)),T=Qt.filter(s=>!C.has(s)).map(s=>en(h,s)),m=[...r.themes,...T],w=s=>{if(s<r.themes.length)return t({...r,selected:s});let g=[...r.themes,m[s]];t({...r,themes:g,selected:g.length-1})},R=()=>{let s=[...r.themes,{...nn(r.themes[r.selected])}];t({...r,themes:s,selected:s.length-1}),l(s.length-1)};return Yn(Lo,{children:[o?null:z(Io,{label:Xn,icon:Ln(Fo),labelId:"sf-theme-reset",action:z(S,{label:Xn,what:"change",onClear:()=>i(!0)})}),a&&z($n,{count:n.length,onCancel:()=>i(!1),onConfirm:()=>{i(!1),Oo(t)}}),z("div",{className:"sf-theme-list",role:"radiogroup","aria-label":"Theme",children:m.map((s,g)=>z(Nn,{index:g,colors:s,selected:g===r.selected,open:d===g&&g<r.themes.length,editable:g<r.themes.length,onPick:()=>w(g),onEdit:()=>l(v=>v===g?null:g),onChangeColors:v=>p(g,v)},g))}),Yn("button",{type:"button",onClick:R,className:"sf-theme-add",children:[z(Ho,{}),"Add new theme"]})]})}import{SettingsField as ga}from"efficient-easel/panel";import{SquareIcon as ya}from"efficient-easel/icons";import{useEffect as me,useId as Ko,useRef as $e,useState as Ke}from"react";import{FieldSelect as Xo,InspectorField as Yo}from"efficient-easel/fields";import{SettingsField as so,SettingsGroup as qo}from"efficient-easel/panel";import{StylesIcon as Zo,TextColorIcon as jo,TypeIcon as Jo}from"efficient-easel/icons";import{useEasel as Qo}from"efficient-easel/easel";import{ColourSwatchRow as Bo}from"efficient-easel/text-styles";import{jsx as qn}from"react/jsx-runtime";function Zn({value:e,label:t,colors:n,onChange:o}){let r=e===null,a=e||void 0,i=n.find(l=>l.key===a),d=i?i.value:a&&/^#[0-9a-f]{6}$/i.test(a)?a:void 0;return qn("div",{className:"sf-part-ink",children:qn(Bo,{value:a,hex:d,colours:n,label:t,followsWord:r?"Mixed":"Follows the style",anyWord:"Any color",onChange:l=>o(l===a&&i?null:l)})})}import{COPY_CELLS as pe,CopyBox as Do}from"efficient-easel/copy";import{PaddingYIcon as Wo,WidthIcon as Go}from"efficient-easel/icons";import{jsx as Ve,jsxs as Uo}from"react/jsx-runtime";var zo=["left","center","right","justify"],Mo=["bold","italic","underline","strike","link","sup","sub"],Vo=["bullet","number"];function jn({text:e,onTextChange:t,multiline:n,markup:o=!0,styled:r=!0,style:a,base:i,setValue:d,colors:l,placeholder:p,ariaLabel:h,head:C}){let T=jt(a),m=a.size??i.sizePx,w=[{...pe.fontSize,value:a.size,styleValue:Math.round(i.sizePx),onChange:s=>d({size:s??null})},{...pe.lineHeight,value:T.lineHeight,styleValue:i.lineRatio,onChange:s=>d(s===void 0?{lineHeight:null,line:null}:{lineHeight:s})},{...pe.letterSpacing,scale:m,value:T.letterSpacingEm,styleValue:i.letterEm,onChange:s=>d(s===void 0?{letterSpacing:null,letter:null}:{letterSpacing:s})},{...pe.paragraphSpacing,value:a.paragraphSpacing,styleValue:0,onChange:s=>d({paragraphSpacing:s??null})},{key:"padding",name:"Padding",icon:Ve(Wo,{}),unit:"px",step:Xt,shiftStep:10,min:$t,max:Kt,value:a.padding,styleValue:i.paddingPx,onChange:s=>d({padding:s??null})},{key:"width",name:"Width",icon:Ve(Go,{}),unit:"px",step:qt,shiftStep:100,min:Yt,max:de,value:a.width,styleValue:i.widthPx,onChange:s=>d({width:s??null})}],R=o?[...Mo,...n?Vo:[]]:[];return Uo("div",{className:"sf-part-textbox",children:[C,Ve(Do,{value:e,onChange:t,multiline:n,placeholder:p,ariaLabel:h,rules:Ft,tools:R,colors:o?l:[],align:r?{value:a.align??i.align,allow:zo,onChange:s=>d({align:s})}:void 0,letterCase:r?{value:a.case??"",onChange:s=>d({case:s||null})}:void 0,cells:r?w:void 0})]})}function Jn(e,t){let n=Dt(e);return n?.control==="textList"?t.rowKey===(n.itemKey??"text")?Wn(n,t.index):null:Wt(e)?.[t.rowKey]??null}function Qn(e,t,n){let o=e.node.props,{key:r,row:a}=ce(e.propKey),i=a?Mt(o,r,a,e.kind,t):Bt(o,r,e.kind,t);return i?(n(e.zone,e.index,{...e.node,props:i}),!0):!1}var $o={CollectionCard:"product",FooterMenu:"menu",Gallery:"product",GalleryItem:"product",ProductGrid:"product",ProductHero:"product",SpecTable:"product",Events:"blog",FeaturedCover:"blog",LongRead:"blog",SubscribeBlogs:"blog"},eo={product:"Synced from the product.",blog:"Synced from the blog post.",menu:"Synced from the site menu."},to="Open",no={product:{type:"storefront-editor:open-product",needsSlug:!0},blog:{type:"storefront-editor:open-post",needsSlug:!0},menu:{type:"storefront-editor:open-menus",needsSlug:!1}};function Ue(e){let n=e?.source?.slug;return typeof n=="string"&&n.length>0?n:void 0}function oo(e){return $o[e]??null}import{Fragment as ge,jsx as c,jsxs as y}from"react/jsx-runtime";var ea={400:"Regular",500:"Medium",600:"Semibold",700:"Bold"},ro=[{key:"font",label:"Font",group:"Style"},{key:"color",label:"Color",group:"Style"}],ta=[...new Set(ro.map(e=>e.group))],na={font:c(Jo,{}),color:c(jo,{})};function fe(e){return e.kind==="role"?Ae[e.role]:e.kind==="custom"?"Custom":null}var oa=e=>e.kind==="role"?`role:${e.role}`:e.kind;function aa(e){let t=e.role;return t&&He.includes(t)?{kind:"role",role:t}:null}function sa(e,t){if(!e)return{kind:"unread"};let{faceRole:n,base:o}=e;if(t[n]===o.fontKey)return{kind:"role",role:n};let r=Object.keys(t).filter(a=>t[a]===o.fontKey);return r.length===1?{kind:"role",role:r[0]}:{kind:"custom"}}function Xe(e,t,n,o){return aa(Le(e,t))??sa(n,o)}function Ei(e,t,n,o){return fe(Xe(e,t,n,o))}function Ye(e,t){if(!e.length)return null;let n=t(e[0]);return e.every(o=>t(o)===n)?n:null}function ra(e){return Object.values(e).filter(t=>t!==void 0).length}function ia(e,t){let n=e.style[t];return t==="color"?n??"":n!==void 0?String(n):e.base.fontKey}function io({face:e,base:t,onPick:n}){let[o,r]=Ke(!1),a=$e(null),i=$e(null),d=Ko();me(()=>{if(!o)return;let h=C=>{a.current&&!a.current.contains(C.target)&&r(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[o]);let l=e.kind==="role"?e.role:null,p=h=>{n(h),r(!1),i.current?.focus()};return y("div",{className:"sf-part-style-pick",ref:a,children:[y("button",{ref:i,type:"button",className:"sf-part-style-trigger","aria-expanded":o,"aria-controls":d,"aria-label":`Follows ${fe(e)??"no style"} \u2014 change`,onClick:()=>r(h=>!h),onKeyDown:h=>{h.key==="Escape"&&o&&(h.preventDefault(),r(!1))},children:[c("span",{className:"sf-part-style-name",style:{fontFamily:t?.fontKey?`var(${L(t.fontKey)?.cssVar})`:void 0,fontWeight:t?.weight},children:fe(e)}),c("span",{className:"sf-part-style-sign","aria-hidden":"true"})]}),o&&y("div",{className:"sf-multi-menu sf-part-style-menu",id:d,role:"listbox",onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),r(!1),i.current?.focus())},children:[y("button",{type:"button",role:"option","aria-selected":l===null,className:`sf-part-style-option${l===null?" is-on":""}`,onClick:()=>p(null),children:[c("span",{className:"sf-part-style-option-name",children:"No style"}),c("span",{className:"sf-note",children:"Section\u2019s own"})]}),He.map(h=>c("button",{type:"button",role:"option","aria-selected":l===h,className:`sf-part-style-option${l===h?" is-on":""}`,onClick:()=>p(h),children:c("span",{className:"sf-part-style-option-name",style:{fontFamily:`var(--font-role-${h})`},children:Ae[h]})},h))]})]})}function la({parts:e,onEditStyle:t,onClearAll:n,onFollowStyle:o,kindLabel:r}){let i=Ye(e,C=>oa(C.face))?e[0].face:null,d=i?fe(i):null,l=i&&i.kind!=="unread"?e[0].base:null,p=e.reduce((C,T)=>C+ra(T.style),0),h=l?L(l.fontKey)?.label:void 0;return y("div",{className:`sf-part-style${p?" has-overrides":""}`,children:[c("div",{className:"sf-part-style-caption",children:"Style"}),e.length>1&&y("div",{className:"sf-part-style-count",children:[e.length," selected"]}),e.length===1&&r&&y("div",{className:"sf-part-style-count",children:[r," \xB7 every row"]}),d&&l?y(ge,{children:[o&&i?c(io,{face:i,base:l,onPick:o}):c("div",{className:"sf-part-style-name",style:{fontFamily:h?`var(${L(l.fontKey)?.cssVar})`:void 0,fontWeight:l.weight},children:d}),c("div",{className:"sf-part-style-meta",children:[h,`${Math.round(l.sizePx)} px`,ea[l.weight]].filter(Boolean).join(" \xB7 ")})]}):c("div",{className:"sf-part-style-name",children:"Mixed styles"}),y("div",{className:"sf-part-style-top",children:[d?p?y(ge,{children:[y("span",{className:"sf-part-chip",children:[p," changed"]}),c("button",{type:"button",className:"sf-part-link",onClick:n,children:"Clear"})]}):c("span",{className:"sf-part-style-state",children:"This text follows the site style."}):c("span",{className:"sf-part-style-state",children:"Changes apply to all selected."}),c("span",{className:"sf-part-style-gap"}),d&&t&&c("button",{type:"button",className:"sf-part-link",onClick:t,children:"Edit"})]})]})}function ca({sectionName:e,onBack:t,textEditor:n,styleRow:o,children:r}){return y("div",{className:"sf-part-panel",children:[y("button",{type:"button",className:"sf-part-back",onClick:t,children:[c(ye,{}),y("span",{children:["All of ",e]})]}),n,o,r]})}function ye(){return c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c("path",{d:"M15 5 8 12l7 7"})})}function lo({source:e,slug:t}){let n=_n(),o=no[e],r=!o.needsSlug||!!t;return c("div",{className:"sf-note sf-note--source",children:y("p",{className:"sf-field-hint",children:[eo[e],r?y(ge,{children:[" ",c("button",{type:"button",className:"sf-source-open",onClick:()=>{o.type==="storefront-editor:open-menus"?n.send(o.type):t&&n.send(o.type,{slug:t})},children:to})]}):null]})})}var ao=4,da=120;function ua({region:e,sizePx:t,face:n,base:o,onFollowStyle:r,source:a,slug:i,onBack:d}){let l=e.follows;return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:e.label})}),y("p",{children:["Its size follows Site styles \u25B8 ",l,t?` \u2014 ${Math.round(t)}px right now`:"","."]}),r?y(ge,{children:[c(so,{label:"Style",icon:c(Zo,{}),children:c(io,{face:n,base:o,onPick:r})}),y("p",{className:"sf-field-hint",children:["Every ",e.label.toLowerCase()," in this section follows it. The face and the size change; the letter case is the section\u2019s own and stays as it is."]})]}):c("p",{className:"sf-field-hint",children:"Only the size follows a site style. This section sets its own font, weight and letter case."}),a?c(lo,{source:a,slug:i}):null,y("button",{type:"button",className:"sf-part-back",onClick:d,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function ha({onBack:e}){return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:"This part is no longer here."})}),c("p",{children:"The section it belonged to has been changed or removed."}),y("button",{type:"button",className:"sf-part-back",onClick:e,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function pa({onBack:e,partId:t,why:n}){return y("div",{className:"sf-note",children:[c("p",{children:c("strong",{children:"This part's settings did not open."})}),c("p",{children:"The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead."}),c("p",{className:"sf-note-detail",children:y("code",{children:[t," \u2014 ",n]})}),y("button",{type:"button",className:"sf-part-back",onClick:e,children:[c(ye,{}),c("span",{children:"Back to the page"})]})]})}function ma({nodeId:e,propKey:t,onBack:n,onEditStyle:o}){let{getItemById:r,getSelectorForId:a,config:i}=Qo(u=>u),d=Fn(),{partStyle:l}=It(),{fonts:p}=F(),[h,C]=Ke({}),T=$e(null),m=r(e),w=a(e),R=m?i.components[m.type]:void 0,{key:s,row:g}=ce(t),v=R?.fields?.[s],I=g?Jn(v,g):v,D=Vt(e,t),_=m?.props??{},W=At(I),gt=Dn(I),yt=Ut(I),oe=m?oo(m.type):null,E=g?Gt(_[s],g):_[s],M=!!g&&!(Array.isArray(_[s])&&g.index<_[s].length);me(()=>{T.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[D]);let[x,bt]=Ke(0);me(()=>bt(0),[D]);let Ne=!!m&&!M&&(!w||!I);me(()=>{if(!Ne||x>=ao)return;let u=setTimeout(()=>bt(P=>P+1),da);return()=>clearTimeout(u)},[Ne,x]);let wo=Ne&&x<ao;if(!m||M)return c(ha,{onBack:n});let ae=Mn(m.type),St=ae?zn(ae,t):null;if(ae&&St){let u=l?.partId===D?l:null,P=ae[St],N=P.writable===!0&&!!w,H=k=>{w&&d.replaceComponent(w.zone,w.index,{...m,props:ue(_,t,"role",k)})};return c(ua,{region:P,sizePx:u?.base.sizePx??null,face:Xe(_,t,u,p),base:u?.base??null,onFollowStyle:N?H:void 0,source:oe,slug:Ue(_),onBack:n})}if(!w||!I)return wo?c("div",{className:"sf-note","aria-busy":"true"}):c(pa,{onBack:n,partId:D,why:w?"no field":"no selector"});let se=u=>{d.replaceComponent(w.zone,w.index,{...m,props:u})},Ie=u=>{if(Z(u).hidden!==Z(E).hidden||!W){let N=g?zt(_,s,g,u):{..._,[s]:u};N&&se(N);return}Qn({node:m,propKey:t,kind:W,zone:w.zone,index:w.index},Z(u).text,d.replaceComponent)},To=E,re=xn(m?.type,t),vo=Le(_,re),ie=l?.partId===D?l:null,A=[{partKey:re,face:Xe(_,re,ie,p),sizeGroup:ie?.sizeGroup??null,base:ie?.base??fa,style:vo}],Co=Ye(A,u=>u.sizeGroup),wt=kt(ie?.inks),le=(u,P)=>{let N=_;for(let H of A)N=ue(N,H.partKey,u,P);se(N)},Po=u=>le("role",u),Ro=()=>{let u=_;for(let P of A)u=Zt(u,P.partKey);se(u)},Eo=u=>{let P=_;for(let N of A)for(let[H,k]of Object.entries(u))P=ue(P,N.partKey,H,k??null);se(P)},xo=(u,P)=>{let N=A.some(O=>O.style[u]!==void 0),H=Ye(A,O=>ia(O,u)),k=H===null,$=`sf-part-${e}-${t}-${u}`;return u==="color"?c(Zn,{value:k?null:String(H),label:P,colors:wt,onChange:O=>le("color",O)},u):c(so,{label:P,icon:na[u],className:"sf-part-field",changed:N,htmlFor:$,action:N?c(S,{label:P,onClear:()=>le(u,null)}):void 0,children:u==="font"?c(Xo,{id:$,ariaLabel:P,value:!k&&L(String(H))?String(H):void 0,placeholder:k?"Mixed":"Site style",options:Pt.map(O=>({label:O.label,value:O.key})),onChange:O=>le("font",O||null)}):null},u)},Tt=W==="text"||W==="textarea",{text:vt,hidden:V}=Z(E),U=I?.[Ht]?.label??t,_o=y("div",{className:"sf-field-head",children:[c(Bn,{}),c("span",{className:"sf-field-label sf-field-label--inline",children:U}),Tt&&c("button",{type:"button",className:"sf-field-eye","aria-pressed":V,"aria-label":V?`Show ${U} on the slide`:`Hide ${U} on the slide`,title:V?`Show ${U} on the slide`:`Hide ${U} on the slide`,onClick:()=>Ie({text:vt,hidden:!V}),children:V?c(Ge,{name:"eye-off",size:14}):c(Ge,{name:"eye",size:14})})]}),Fe=!gt&&yt;return y(ca,{sectionName:R?.label??m.type,onBack:n,textEditor:y("div",{ref:T,className:"sf-part-text",children:[W?c(jn,{text:vt,onTextChange:u=>Ie(Tt?{text:u,hidden:V}:u),multiline:Ot(W),markup:W!=="plainText",styled:Fe,style:A[0].style,base:A[0].base,setValue:Eo,colors:wt.map(u=>({name:u.key,label:u.name,value:u.value})),placeholder:Lt(I),ariaLabel:U,head:_o}):c(Yo,{field:I,name:t,value:To,onChange:Ie,id:`sf-part-${e}-${t}`}),Fe&&W&&Co===null&&c("p",{className:"sf-field-hint",children:"Fixed size \u2014 the site\u2019s Text setting doesn\u2019t resize this."})]}),children:[oe&&c(lo,{source:oe,slug:Ue(_)}),Fe&&ta.map(u=>{let P=ro.filter(k=>k.group===u),N=P.filter(k=>A.some($=>$.style[k.key]!==void 0)).length,H=`sf-part-g-${e}-${t}-${u.replace(/\W+/g,"-")}`;return y(qo,{id:H,title:u,open:h[u]!==!0,onToggle:k=>C($=>({...$,[u]:!k})),count:N,children:[c(la,{parts:A,onEditStyle:o,onClearAll:Ro,onFollowStyle:Po,kindLabel:En[re]}),P.map(k=>xo(k.key,k.label))]},u)})]})}var fa={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:de};import{jsx as be}from"react/jsx-runtime";var ba="Applies to panels, cards, inputs and buttons. Round things \u2014 color swatches, switches, status dots \u2014 stay round.",qe="Corners",Sa="Not set";function Ze({value:e,onChange:t,showHint:n=!0}){let o=e===null;return be(ga,{label:qe,icon:be(ya,{}),value:o?Sa:`${e}px`,changed:!o,action:o?null:be(S,{label:qe,what:"change",onClear:()=>t(null)}),hint:n?ba:void 0,children:be(G,{min:Be,max:cn,step:1,value:e??Be,readout:!1,ariaLabel:qe,onChange:t})})}import{SettingsField as wa,SettingsSegmented as Ta}from"efficient-easel/panel";import{ShadowIcon as va}from"efficient-easel/icons";var B="Not set";import{jsx as ee}from"react/jsx-runtime";var co={none:"None",soft:"Soft",lifted:"Lifted"},Ca="Applies to cards \u2014 products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.",Pa={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"},Ra={labelsPx:90.25,widestLabelPx:34.6};function je({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??pn;return ee(wa,{label:"Card shadow",icon:ee(va,{}),value:o?B:co[e],changed:!o,action:o?void 0:ee(S,{label:"Card shadow",what:"change",onClear:()=>t(null)}),hint:n?Ca:void 0,children:ee(Ta,{options:hn.map(a=>({id:a,label:co[a],icon:ee("span",{className:"sf-shadow-chip",style:{boxShadow:Pa[a]}})})),value:r,ariaLabel:"Card shadow",fit:Ra,onChange:t})})}import{SettingsField as Ea}from"efficient-easel/panel";import{ShadowIcon as xa}from"efficient-easel/icons";import{Fragment as ka,jsx as Je,jsxs as Na}from"react/jsx-runtime";var _a="Most useful on a dark theme, where a black shadow cannot be seen. Also used by the Lift hover, even with the card shadow off.";function Qe({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Je(Ea,{label:"Shadow color",icon:Je(xa,{}),changed:!o,action:Na(ka,{children:[kn({value:e??gn,onChange:t,label:"Shadow color",caption:o?B:void 0}),o?null:Je(S,{label:"Shadow color",what:"change",onClear:()=>t(null)})]}),hint:n?_a:void 0})}import{SettingsField as Ia}from"efficient-easel/panel";import{AlignSeparateIcon as Fa}from"efficient-easel/icons";import{jsx as Se}from"react/jsx-runtime";var Ha="The space between the blocks inside a row, a grid or a box. Not set means each one keeps the spacing it already has.",et="Block gap",Aa=An.Grid;function tt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Se(Ia,{label:et,labelId:"sf-block-gap",icon:Se(Fa,{}),value:o?"Not set":`${e}px`,changed:!o,action:o?void 0:Se(S,{label:et,what:"change",onClear:()=>t(null)}),hint:n?Ha:void 0,children:Se(G,{min:he.min,max:he.max,step:he.step,value:o?Aa:e,readout:!1,ariaLabel:et,onChange:t})})}import{SettingsField as Oa,SettingsSegmented as La}from"efficient-easel/panel";import{HoverIcon as Ba}from"efficient-easel/icons";import{jsx as we}from"react/jsx-runtime";var uo={none:"None",lift:"Lift",highlight:"Highlight"},Da="What a card does when a shopper points at it \u2014 or taps it, on a phone. Highlight is the effect your cards already use.";function nt({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??fn;return we(Oa,{label:"Hover effect",icon:we(Ba,{}),value:o?B:uo[e],changed:!o,action:o?void 0:we(S,{label:"Hover effect",what:"change",onClear:()=>t(null)}),hint:n?Da:void 0,children:we(La,{options:mn.map(a=>({id:a,label:uo[a]})),value:r,ariaLabel:"Hover effect",onChange:t})})}import{SettingsField as Wa,SettingsSegmented as Ga}from"efficient-easel/panel";import{ImageIcon as za}from"efficient-easel/icons";import{jsx as Te}from"react/jsx-runtime";var ot="Hero image",ho=[{followsWidth:!1,label:We.full},{followsWidth:!0,label:We.page}],Ma="Whether the big picture at the top of a page runs edge to edge, or sits inside the page width. The words follow the page width either way.";function at({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??!1;return Te(Wa,{label:ot,icon:Te(za,{}),value:o?B:ho.find(a=>a.followsWidth===e).label,changed:!o,action:o?void 0:Te(S,{label:ot,what:"change",onClear:()=>t(null)}),hint:n?Ma:void 0,children:Te(Ga,{options:ho.map(a=>({id:a.followsWidth,label:a.label})),value:r,ariaLabel:ot,onChange:t})})}import{SettingsField as Va,SettingsSegmented as Ua}from"efficient-easel/panel";import{DropIcon as $a}from"efficient-easel/icons";import{jsx as ve}from"react/jsx-runtime";var st="Photography",po=[{grayscale:!1,label:"As shot"},{grayscale:!0,label:"Black and white"}],Ka="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function rt({value:e,onChange:t,showHint:n=!0}){let o=e===null,r=e??!1;return ve(Va,{label:st,icon:ve($a,{}),value:o?B:po.find(a=>a.grayscale===e).label,changed:!o,action:o?void 0:ve(S,{label:st,what:"change",onClear:()=>t(null)}),hint:n?Ka:void 0,children:ve(Ua,{options:po.map(a=>({id:a.grayscale,label:a.label})),value:r,ariaLabel:st,onChange:t})})}import{SettingsField as Xa}from"efficient-easel/panel";import{PaddingXIcon as Ya}from"efficient-easel/icons";import{jsx as Ce}from"react/jsx-runtime";var it="Side space",qa="Not set",Za=J.default,ja="The room left at the left and right edge of every page.";function lt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Ce(Xa,{label:it,labelId:"sf-side-space",icon:Ce(Ya,{}),value:o?qa:`${e}px`,changed:!o,action:o?void 0:Ce(S,{label:it,what:"change",onClear:()=>t(null)}),hint:n?ja:void 0,children:Ce(G,{min:J.min,max:J.max,step:J.step,value:e??Za,readout:!1,ariaLabel:it,onChange:t})})}import{SettingsField as Ja}from"efficient-easel/panel";import{WidthIcon as Qa}from"efficient-easel/icons";import{jsx as Pe}from"react/jsx-runtime";var ct="Content width",es="Not set",ts=j.default,ns="The standard width every page on this site renders at.";function dt({value:e,onChange:t,showHint:n=!0}){let o=e===null;return Pe(Ja,{label:ct,labelId:"sf-site-width",icon:Pe(Qa,{}),value:o?es:`${e}px`,changed:!o,action:o?void 0:Pe(S,{label:ct,what:"change",onClear:()=>t(null)}),hint:n?ns:void 0,children:Pe(G,{min:j.min,max:j.max,step:j.step,value:e??ts,readout:!1,ariaLabel:ct,onChange:t})})}import{SettingsField as Ee}from"efficient-easel/panel";import{AccentIcon as os,CaseIcon as as,StylesIcon as ss,TextLinesIcon as fo,TextSizeIcon as te,TextSmallIcon as rs,TypeIcon as is,WeightIcon as ls}from"efficient-easel/icons";import{Fragment as ht,jsx as f,jsxs as Re}from"react/jsx-runtime";var cs=[{role:"heading",title:"Heading 1",group:"heading",step:"headingLarge",base:17,icon:f(te,{})},{role:"heading2",title:"Heading 2",group:"heading",step:"headingMedium",base:15,icon:f(te,{})},{role:"heading3",title:"Heading 3",group:"heading",step:"headingSmall",base:13,icon:f(te,{})},{role:"accent",title:"Accent",step:"accent",base:15,icon:f(os,{})},{role:"body",title:"Body",group:"body",step:"body",base:14,icon:f(fo,{})},{role:"label",title:"Labels",group:"label",step:"label",base:11,icon:f(rs,{})}];var ds=9,Y=500,us=100,hs=80,ps=4,ms=600,fs=700,gs=400,ys="0.18em";function bs({id:e,value:t,onChange:n}){return f("select",{id:e,className:"sf-select w-full min-w-0",value:t,onChange:o=>n(o.target.value),style:{fontFamily:`var(${L(t)?.cssVar??"--font-body"})`},children:Et().map(([o,r])=>f("optgroup",{label:Rt[o],children:r.map(a=>f("option",{value:a.key,children:a.label},a.key))},o))})}function Ss({label:e,icon:t,readout:n,min:o,max:r,step:a,value:i,onChange:d,action:l,hint:p}){return f(Ee,{label:e,icon:t,value:n,action:l,hint:p,children:f("input",{type:"range",min:o,max:r,step:a,value:i,onChange:h=>d(Number(h.target.value)),className:"h-1 w-full cursor-pointer","aria-label":e})})}function ut({label:e,icon:t,value:n,fallback:o,min:r,max:a,step:i,suffix:d="",hint:l,onChange:p}){let h=n===null;return f(Ss,{label:e,icon:t,readout:h?"Auto":`${n}${d}`,min:r,max:a,step:i,value:h?o:n,onChange:p,action:h?null:f(S,{label:e,what:"change",onClear:()=>p(null)}),hint:l})}function mo({label:e,icon:t,options:n,value:o,onChange:r,hint:a,action:i}){return f(Ee,{label:e,icon:t,value:n.find(d=>d.value===o)?.label,hint:a,action:i,children:f("div",{className:"sf-rungs",children:n.map(d=>f("button",{type:"button","aria-pressed":d.value===o,onClick:()=>r(d.value),className:`sf-rung${d.value===o?" is-active":""}`,children:d.label},d.value))})})}var ws=[{value:"authored",label:"As designed"},{value:"sentence",label:"As typed"}],Ts=[{value:"normal",label:"Normal"},{value:"tight",label:"Tight"},{value:"compressed",label:"Compressed"}];function vs({fontKey:e,weight:t,fallbackWeight:n,onWeight:o}){let a=(t??n)>=ms,i=xt(e),d=L(e)?.label??"This face";return f(Ee,{label:"Style",icon:f(ss,{}),value:a?"Bold":"Normal",hint:"Bold is the weight above \u2014 one value, two ways to set it.",children:Re("div",{className:"sf-rungs",children:[f("button",{type:"button","aria-pressed":a,"aria-label":"Bold",title:"Bold",onClick:()=>o(a?gs:fs),className:`sf-rung sf-rung--glyph${a?" is-active":""}`,style:{fontWeight:700},children:"B"}),f("button",{type:"button","aria-pressed":!1,"aria-label":"Italic",disabled:!0,title:i?"Italic is not saved yet \u2014 the theme row has no column for it (card 66162.b).":`${d} is loaded without an italic, so it cannot be set in italic. Slanting it would deform the letters rather than style them.`,className:"sf-rung sf-rung--glyph",style:{fontStyle:"italic"},children:"I"})]})})}function pt({fonts:e,compression:t,headingTypography:n,openRole:o,onOpenRole:r,onFontChange:a,sizes:i,onSizeChange:d,onCompressionChange:l,onHeadingTypographyChange:p,livePx:h,savedRole:C=null}){let T=s=>p({...n,...s}),m=s=>s==="accent"?"weightStrong":s==="heading2"?"weight2":s==="heading3"?"weight3":"weight",w=s=>s==="heading2"?"case2":s==="heading3"?"case3":"case",R=Sn(t);return f("div",{className:"sf-style-list",children:cs.map(s=>{let g=o===s.role;return f(Hn,{styleKey:s.role,label:s.title,icon:s.icon,value:L(e[s.role])?.label??e[s.role],sampleStyle:Cs(s,e,n,R),open:g,onToggle:()=>r(g?null:s.role),saved:C===s.role,children:g&&Re(ht,{children:[f(Ee,{label:"Font",icon:f(is,{}),htmlFor:`sf-font-${s.role}`,action:e[s.role]===Oe[s.role]?null:f(S,{label:"Font",what:"change",onClear:()=>a(s.role,Oe[s.role])}),children:f(bs,{id:`sf-font-${s.role}`,value:e[s.role],onChange:v=>a(s.role,v)})}),s.step&&d&&f(ut,{label:"Size",icon:f(te,{}),value:i[s.step],fallback:s.base*2,min:an,max:sn,step:rn,suffix:"px",hint:i[s.step]===null?"Auto = this style states no size, and text following it keeps the size its section drew.":"The size a text takes when you set it to follow this style. Sections keep their own sizes.",onChange:v=>d(s.step,v)}),(K(s.role)||s.role==="accent")&&Re(ht,{children:[f(ut,{label:"Weight",icon:f(ls,{}),value:n[m(s.role)],fallback:K(s.role)?Y:n.weight??Y,min:wn,max:Tn,step:us,hint:s.role==="accent"?"Auto = the accent phrase takes the heading's own weight.":void 0,onChange:v=>T({[m(s.role)]:v})}),f(vs,{fontKey:e[s.role],weight:n[m(s.role)],fallbackWeight:K(s.role)?Y:n.weight??Y,onWeight:v=>T({[m(s.role)]:v})})]}),K(s.role)&&Re(ht,{children:[f(mo,{label:"Line & text gap",icon:f(fo,{}),options:Ts,value:t,onChange:l,hint:R.lineHeight===void 0?"The built-in spacing.":`Line gap ${R.lineHeight} \xB7 text gap ${R.letterSpacing}em.`,action:t===De?null:f(S,{label:"Line & text gap",what:"change",onClear:()=>l(De)})}),f(mo,{label:"Capitals",icon:f(as,{}),options:ws,value:n[w(s.role)],onChange:v=>T({[w(s.role)]:v}),hint:"The only setting that changes a heading's capitals.",action:n[w(s.role)]==="authored"?null:f(S,{label:"Capitals",what:"change",onClear:()=>T({[w(s.role)]:"authored"})})}),f(ut,{label:"Largest size",icon:f(te,{}),value:n.maxPx,fallback:hs,min:vn,max:Cn,step:ps,suffix:"px",hint:"Caps the biggest heading on the site. Auto = each section's own.",onChange:v=>T({maxPx:v})})]})]})},s.role)})})}function Cs(e,t,n,o){let r=Math.max(ds,e.base),a={fontFamily:`var(${L(t[e.role])?.cssVar??"--font-body"})`,fontSize:`${r.toFixed(1)}px`,lineHeight:1.15};return K(e.role)?(a.fontWeight=n.weight??Y,a.textTransform=n.case==="sentence"?"none":"uppercase",o.letterSpacing!==void 0&&(a.letterSpacing=`${o.letterSpacing}em`)):e.role==="accent"?(a.fontWeight=n.weightStrong??n.weight??Y,o.letterSpacing!==void 0&&(a.letterSpacing=`${o.letterSpacing}em`)):e.role==="label"&&(a.textTransform="uppercase",a.letterSpacing=ys),a}import{SettingsTabs as Rs}from"efficient-easel/panel";import{ContrastIcon as Es,NoteIcon as xs,SettingsIcon as _s,TypeIcon as ks}from"efficient-easel/icons";function go(e){switch(e.status){case"saved":return null;case"failed":return{msg:"Not saved. Try again.",tone:"error"};case"skipped":switch(e.reason){case"empty":return null;case"no-token":return{msg:"Not saved. Reload the page.",tone:"error"};case"template":return{msg:"Templates keep their look. Press Save.",tone:"success"}}}}import{Fragment as ne,jsx as b,jsxs as q}from"react/jsx-runtime";var _e="sf-site-styles-tabpanel",Ns=!1,Is="Show hints";function Fs({shown:e,onChange:t}){return b("div",{className:"sf-hints",children:q("button",{type:"button","aria-pressed":e,onClick:()=>t(!e),className:`sf-rung sf-hints-toggle${e?" is-active":""}`,children:[b(xs,{size:13}),Is]})})}var wc="text",xe=[{id:"basics",label:"Basics",icon:b(_s,{}),htmlId:"sf-site-styles-tab-basics",panelId:_e},{id:"theme",label:"Theme",icon:b(Es,{}),htmlId:"sf-site-styles-tab-theme",panelId:_e},{id:"text",label:"Text",icon:b(ks,{}),htmlId:"sf-site-styles-tab-text",panelId:_e}];function Hs({themeFromDocument:e,persist:t}){let{appState:n,dispatch:o}=mt(p=>p),{theme:r,setTheme:a}=F(),i=n.data,d=i.root?.props??{},l=p=>{if(e){let h={...d,theme:p};o({type:"replaceRoot",root:{...i.root,props:h},recordHistory:!0})}else a(p);t({selected_preset:p.selected,theme_presets:p.themes})};return b(Me,{value:e?d.theme:r,onChange:l})}function As(e,t){let[n,o]=ke(null),r=yo(null),a=JSON.stringify(e),i=yo(t);return i.current=t,Ps(()=>{if(r.current===null){r.current=a;return}if(r.current===a)return;r.current=a;let d=window.setTimeout(()=>o(i.current),700),l=window.setTimeout(()=>o(null),2200);return()=>{window.clearTimeout(d),window.clearTimeout(l)}},[a]),n}function Os({themeFromDocument:e,persist:t}){let{appState:n,dispatch:o}=mt(E=>E),[r,a]=ke(null),{fonts:i,setFonts:d,sizes:l,setSizes:p,headingCompression:h,setHeadingCompression:C,headingTypography:T,setHeadingTypography:m}=F(),w=n.data,R=w.root?.props??{},s=e?_t(R.fonts):i,g=e?on:l,v=e?bn(R.headingCompression):h,I=e?Pn(R.headingTypography):T,D=E=>o({type:"replaceRoot",root:{...w.root,props:{...R,...E}},recordHistory:!0}),_=As({curFonts:s,curCompression:v,curTypography:I},r);return b(pt,{fonts:s,sizes:g,compression:v,headingTypography:I,openRole:r,onOpenRole:a,onFontChange:(E,M)=>{let x={...s,[E]:M};e?D({fonts:x}):d(x),t({heading_font:x.heading,body_font:x.body,accent_font:x.accent,label_font:x.label})},onSizeChange:e?void 0:(E,M)=>{let x={...g,[E]:M};p(x),t({heading_size_large_px:x.headingLarge,heading_size_medium_px:x.headingMedium,heading_size_small_px:x.headingSmall,accent_size_px:x.accent,body_size_px:x.body,label_size_px:x.label})},onCompressionChange:E=>{e?D({headingCompression:E}):C(E),t({heading_compression:E})},onHeadingTypographyChange:E=>{e?D({headingTypography:E}):m(E),t(Rn(E))},livePx:Bs,savedRole:_})}var Ls={heading:"main h1, main h2",heading2:"main h1, main h2",heading3:"main h1, main h2",accent:"main h1 em, main h2 em",body:"main p",label:"main .mono-eyebrow"};function Bs(e){if(typeof document>"u")return null;let n=(X()?.contentDocument??document).querySelector(Ls[e]);if(!n)return null;let o=parseFloat(getComputedStyle(n).fontSize);return Number.isFinite(o)?o:null}function Ds({themeFromDocument:e,persist:t,showHint:n}){let{appState:o,dispatch:r}=mt(m=>m),{cornerRadiusPx:a,setCornerRadiusPx:i}=F(),d=o.data,l=d.root?.props??{},p=l.cornerRadiusPx===void 0?dn[ln(l.cornerStyle)]:un(l.cornerRadiusPx),h=e?p:a,C=m=>r({type:"replaceRoot",root:{...d.root,props:{...l,...m}},recordHistory:!0});return b(Ze,{value:h,onChange:m=>{e?C({cornerRadiusPx:m}):i(m),t({corner_radius_px:m})},showHint:n})}function Ws(e){return{site_width:e}}function Gs({persist:e,showHint:t}){let{siteWidth:n,setSiteWidth:o}=F();return b(dt,{value:n,onChange:a=>{o(a),e(Ws(a),a===null)},showHint:t})}function zs(e){return{block_gap:e}}function Ms(e){return{site_gutter:e}}function Vs({persist:e,showHint:t}){let{siteGutter:n,setSiteGutter:o}=F();return b(lt,{value:n,onChange:a=>{o(a),e(Ms(a),a===null)},showHint:t})}function Us({persist:e,showHint:t}){let{blockGap:n,setBlockGap:o}=F();return b(tt,{value:n,onChange:a=>{o(a),e(zs(a),a===null)},showHint:t})}function $s({persist:e,showHint:t}){let{heroBackgroundFollowsWidth:n,setHeroBackgroundFollowsWidth:o}=F();return b(at,{value:n,onChange:a=>{o(a),e({hero_background_follows_width:a},!0)},showHint:t})}function Ks({persist:e,showHint:t=!0}){return q(ne,{children:[b(Gs,{persist:e,showHint:t}),b(Vs,{persist:e,showHint:t}),b(Us,{persist:e,showHint:t}),b($s,{persist:e,showHint:t})]})}function Xs(e){return{card_shadow:e}}function Ys(e){return e===null?{shadow_color:null}:{shadow_color:yn(e)}}function qs(e){return{hover_effect:e}}function Zs({persist:e,showHint:t=!0}){let{cardShadow:n,setCardShadow:o,shadowColor:r,setShadowColor:a,hoverEffect:i,setHoverEffect:d}=F();return q(ne,{children:[b(je,{value:n,onChange:l=>{o(l),e(Xs(l),!0)},showHint:t}),b(Qe,{value:r,onChange:l=>{a(l),e(Ys(l),l===null)},showHint:t}),b(nt,{value:i,onChange:l=>{d(l),e(qs(l),!0)},showHint:t})]})}function js(e){return{photography_grayscale:e}}function Js({persist:e,showHint:t}){let{photographyGrayscale:n,setPhotographyGrayscale:o}=F();return b(rt,{value:n,onChange:a=>{o(a),e(js(a),!0)},showHint:t})}function Qs({persist:e,showHint:t=!0}){return b(ne,{children:b(Js,{persist:e,showHint:t})})}function Tc(){let{websiteName:e}=F();return e?.trim()||Gn}function er({themeFromDocument:e=!1,tokenRef:t,siteId:n,onNotify:o,tab:r,onTabChange:a}){let{persist:i}=In({themeFromDocument:e,tokenRef:t,siteId:n,onResult:R=>{let s=go(R);s&&o?.(s.msg,s.tone)}}),[d,l]=ke(xe[0].id),p=r!==void 0,h=p?r:d,C=p?a??(()=>{}):l,T=xe.find(R=>R.id===h)??xe[0],[m,w]=ke(Ns);return q(ne,{children:[b(Rs,{items:xe,activeId:T.id,onSelect:C,ariaLabel:"Site styles"}),q("div",{id:_e,role:"tabpanel","aria-labelledby":T.htmlId,children:[h==="basics"&&q(ne,{children:[b(Ds,{themeFromDocument:e,persist:i,showHint:m}),!e&&b(Zs,{persist:i,showHint:m}),!e&&b(Ks,{persist:i,showHint:m}),!e&&b(Qs,{persist:i,showHint:m}),b(Fs,{shown:m,onChange:w})]}),h==="theme"&&b(Hs,{themeFromDocument:e,persist:i}),h==="text"&&b(Os,{themeFromDocument:e,persist:i})]})]})}function Rc(e){return{root:{props:{}},content:[e],zones:{}}}function Ec(e){return(e.content??[])[0]??null}function tr(e){return Array.isArray(e)&&e.length>0&&e.every(t=>!!t&&typeof t=="object"&&typeof t.type=="string"&&typeof t.props=="object")}function nr(e){let t={...e.props,id:Ct(e.type)};for(let[n,o]of Object.entries(t))tr(o)&&(t[n]=o.map(nr));return{type:e.type,props:t}}import{createContext as or,useContext as ar}from"react";import{Fragment as ir,jsx as ft,jsxs as lr}from"react/jsx-runtime";var sr={mirrorHostStyles:!0,css:null,fontHrefs:[]},bo=or(sr);function kc({value:e,children:t}){return ft(bo.Provider,{value:e,children:t})}function rr(){return ar(bo)}function Nc(){let{css:e,fontHrefs:t}=rr();return lr(ir,{children:[t.map(n=>ft("link",{rel:"stylesheet",href:n},n)),e?ft("style",{"data-sf-canvas-css":"",children:e}):null]})}import{createContext as cr,useContext as dr}from"react";import{jsx as ur}from"react/jsx-runtime";var So=cr(void 0);function Ac({metadata:e,children:t}){return ur(So.Provider,{value:e,children:t})}var Oc=()=>dr(So);export{Jn as a,Ue as b,oo as c,Ei as d,lo as e,ma as f,mr as g,fr as h,gr as i,yr as j,br as k,Ns as l,Fs as m,wc as n,xe as o,Tc as p,er as q,Rc as r,Ec as s,nr as t,kc as u,rr as v,Nc as w,Ac as x,Oc as y};
@@ -0,0 +1 @@
1
+ import{createContext as rn,useCallback as s,useContext as an,useMemo as ln,useState as Re}from"react";import{createContext as ue,useContext as L}from"react";import{createContext as gt}from"react";var se=gt(null);var ht=ue(null),I=ue({logo:null,placeholder:!1,wordmark:null});function En(){let e=L(se),t=L(ht),n=L(I),o=!e&&n.placeholder,r=e?e.logoUrl:n.logo?.logoUrl??t?.logoUrl??null;return{src:o?null:r,reversedSrc:e?e.logoReversed:n.logo?.logoReversed??t?.logoReversed??null,inkIsDark:e?e.logoInkIsDark:n.logo?.logoInkIsDark??t?.logoInkIsDark??null,wordmark:e?null:n.wordmark,siteName:e?.siteName??t?.siteName}}import{createContext as pt,useCallback as de,useContext as ft,useRef as mt,useState as St}from"react";var P=0;function ce(e){P+=1;try{return e()}finally{P-=1}}function Rn(){return P>0}import{jsx as bt}from"react/jsx-runtime";function F(){let e=mt(()=>{}),t=de((...o)=>ce(()=>e.current(...o)),[]),n=de(o=>{e.current=o},[]);return{select:t,setSelectHandler:n}}function vn(e){let t=`set${e.charAt(0).toUpperCase()}${e.slice(1)}`,n=(i,u,c,d)=>({[e]:i,[t]:u,select:c,setSelectHandler:d}),o=pt(n(null,()=>{},()=>{},()=>{}));function r({children:i}){let[u,c]=St(null),{select:d,setSelectHandler:h}=F();return bt(o.Provider,{value:n(u,c,d,h),children:i})}return{Provider:r,useSelection:()=>ft(o)}}var In="storefront-theme",Pn="sf:theme-mode",Fn="sf:theme-switch",On="hide",G="light";function yt(e){return e>=7&&e<18}function Mn(e){let{mode:t,override:n,switchShown:o,hour:r}=e;return o&&(n==="light"||n==="dark")?n:t==="auto"?yt(r)?"light":"dark":t==="light"?"light":"dark"}var m={background:"#0a0a0a",surface:"#131313",line:"#2a2a2a",muted:"#9a9388"},xt=[{text:"#2e2e2e",accent:"#2e2e2e",background:"#ffffff",surface:"#f7f7f7",line:"#e0e0e0",muted:"#5c5c5c"},{text:"#f7f7f7",accent:"#f7f7f7",background:"#0a0a0a",surface:"#1b1b1b",line:"#363636",muted:"#a3a3a3"},{text:"#ffffff",accent:"#ffffff",background:"#2e2e2e",surface:"#3d3d3d",line:"#545454",muted:"#b0b0b0"},{text:"#0a0a0a",accent:"#0a0a0a",background:"#f7f7f7",surface:"#ffffff",line:"#d9d9d9",muted:"#5c5c5c"}],H={selected:0,themes:xt};function ge(e){return!e||!Array.isArray(e.themes)||e.themes.length===0?{...H}:{selected:Math.min(Math.max(0,e.selected??0),e.themes.length-1),themes:e.themes}}function O(e,t,n){let o=R(e),r=R(t);if(o===null||r===null)return e;let l=i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0");return`#${o.map((i,u)=>l(i+(r[u]-i)*n)).join("")}`}var _t={light:"#ffffff",dark:"#0a0a0a"},Dn=["light","dark"];function Vn(e,t){let n=_t[t],o=t==="light"?"#ffffff":"#000000";return{text:n,accent:n,background:e,surface:O(e,o,.1),line:O(e,o,.22),muted:O(n,e,.35),brandInk:t}}function w(e){let t=ge(e);return t.themes[t.selected]}function he(e){return{text:e.text,accent:e.accent,background:e.background||m.background,surface:e.surface||m.surface,line:e.line||m.line,muted:e.muted||m.muted}}function R(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1].length===3?[...t[1]].map(i=>i+i).join(""):t[1],[o,r,l]=[0,2,4].map(i=>parseInt(n.slice(i,i+2),16));return[o,r,l]}function N(e){let t=R(e);if(t===null)return null;let[n,o,r]=t.map(l=>{let i=l/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n+.7152*o+.0722*r}var Tt=.4,Et=4.5,Ct=3;function Rt(e,t){let n=N(e),o=N(t);if(n===null||o===null)return null;let[r,l]=n>=o?[n,o]:[o,n];return(r+.05)/(l+.05)}var Nn={good:"Good","large-only":"Large text only",hard:"Hard to read"};function Gn(e){return e>=Et?"good":e>=Ct?"large-only":"hard"}var M=["#000000","#ffffff"];function A(e){let t=M[0],n=-1;for(let o of M){let r=Rt(e,o);if(r===null)return M[0];r>n&&(n=r,t=o)}return t}var Ht=[.25,.4,.55];function Un(e){let t=R(e);return t===null?[]:Ht.map(n=>"#"+t.map(o=>Math.round(o*(1-n)).toString(16).padStart(2,"0")).join(""))}function zn(e){let t=w(e),n={"--theme-fg":t.text},o=N(t.text);return(o===null||o>=Tt)&&(n["--overlay-fg"]=t.text),n}var wt=82;function U(e){return`color-mix(in srgb, ${e} ${wt}%, #000)`}function $n(e){let t=w(e);return{"--theme-accent":t.accent,"--theme-accent-2":U(t.accent),"--theme-accent-ink":A(t.accent)}}function pe(e){let t=e?.button;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Bn(e){let t=w(e),n=pe(t),o=fe(t);if(n===null&&o===null)return{};let r={};return n!==null&&(r["--theme-btn"]=n,r["--theme-btn-2"]=U(n)),r["--theme-btn-ink"]=o??A(n),r}function fe(e){let t=e?.buttonInk;return/^#[0-9a-fA-F]{6}$/.test(t??"")?t.toLowerCase():null}function Yn(e,t){return fe(e)??A(pe(e)??t)}function Wn(e){let t={};return ge(e).themes.forEach((n,o)=>{let r=he(n);t[`--theme-preset-${o}-accent`]=r.accent,t[`--theme-preset-${o}-accent-2`]=U(r.accent),t[`--theme-preset-${o}-accent-ink`]=A(r.accent),t[`--theme-preset-${o}-bg`]=r.background,t[`--theme-preset-${o}-fg`]=r.text,t[`--theme-preset-${o}-surface`]=r.surface,t[`--theme-preset-${o}-surface-2`]=`color-mix(in srgb, ${r.surface} 60%, ${r.line})`,t[`--theme-preset-${o}-line`]=r.line,t[`--theme-preset-${o}-muted`]=r.muted}),t}var Kn=["--theme-bg","--theme-surface","--theme-surface-2","--theme-line","--theme-muted"];function Xn(e){let t=he(w(e)),n=`color-mix(in srgb, ${t.surface} 60%, ${t.line})`,o={"--theme-bg":t.background,"--theme-surface":t.surface,"--theme-line":t.line,"--theme-muted":t.muted};return(t.surface!==m.surface||t.line!==m.line)&&(o["--theme-surface-2"]=n),o}var At=["heading","body","label"];function qn(e){if(!e)return null;for(let t of At)if(e.includes(`--size-${t}`))return t;return/--size-heading(Large|Medium|Small)/.test(e)?"heading":null}var me=["headingLarge","headingMedium","headingSmall","accent","body","label"];var z={headingLarge:null,headingMedium:null,headingSmall:null,accent:null,body:null,label:null},vt=8,kt=200,Zn=1;function Lt(e){if(typeof e!="number"||!Number.isFinite(e))return null;let t=Math.round(e);return t>=vt&&t<=kt?t:null}function It(e){let t={};for(let n of me)t[n]=Lt(e?.[n]);return t}function jn(e){let t=It(e),n={};for(let o of me){let r=t[o];r!==null&&(n[`--size-${o}`]=`${r}px`)}return n}var Pt=["square","small","large"],Ft="small";function Jn(e){return Pt.includes(e??"")?e:Ft}var Se=0,Ot=40,Qn={square:0,small:null,large:16},Mt={"--sf-card-radius":1,"--sf-button-radius":.5,"--radius":.5,"--radius-xs":.25,"--radius-sm":.5,"--radius-md":.75,"--radius-lg":1,"--radius-xl":1.25,"--radius-2xl":1.5,"--radius-3xl":2,"--radius-4xl":2.5};function be(e){if(e==null||typeof e=="string"&&e.trim()==="")return null;let t=typeof e=="string"?Number(e):e;return Number.isFinite(t)?Math.min(Ot,Math.max(Se,Math.round(t))):null}function Dt(e){let t=be(e);return t===null?{}:Object.fromEntries(Object.entries(Mt).map(([n,o])=>{let r=t*o/16;return[n,r===0?"0":`${r}rem`]}))}function eo(e){return Dt(be(e)??Se)}var Vt=["none","soft","lifted"],Nt="soft",ye="none",Gt=["tight","normal","roomy"],Ut="normal",v="normal",zt=["none","lift","highlight"],$t="lift",Bt="highlight",xe="#141416";function _e(e){return Vt.includes(e??"")?e:Nt}function Yt(e){return Gt.includes(e??"")?e:Ut}function Te(e){return zt.includes(e??"")?e:$t}function Wt(e){return/^#[0-9a-fA-F]{6}$/.test(e??"")?e.toLowerCase():xe}function to(e){let t=_e(e);return t===ye?void 0:t}function no(e){let t=Yt(e);return t===v?void 0:t}function oo(e){let t=Te(e);return t===Bt?void 0:t}function ro(e,t,n){let o=Wt(t);return o===xe?{}:_e(e)!==ye||Te(n)==="lift"?{"--sf-shadow-color":o}:{}}var Kt=["normal","tight","compressed"],T="normal";function Ee(e){return Kt.includes(e??"")?e:T}function ao(e){let t=Ee(e);return t===T?void 0:t}function io(e){switch(Ee(e)){case"tight":return{lineHeight:.95,letterSpacing:-.01};case"compressed":return{lineHeight:.86,letterSpacing:-.01};default:return{}}}var $={case:"authored",weight:null,weightStrong:null,maxPx:null,weight2:null,weight3:null,case2:"authored",case3:"authored"},D=100,V=900,Xt=24,qt=200;function C(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,t),n))}function B(e){let t=C(e?.weight,D,V),n=e?.case==="sentence"?"sentence":"authored",o=l=>l==null?t:C(l,D,V),r=l=>l==="sentence"?"sentence":l==="authored"?"authored":n;return{case:n,weight:t,weightStrong:C(e?.weightStrong,D,V),maxPx:C(e?.maxPx,Xt,qt),weight2:o(e?.weight2),weight3:o(e?.weight3),case2:r(e?.case2),case3:r(e?.case3)}}function lo(e){let t=B(e),n={};return t.case==="sentence"&&(n["--sf-heading-case"]="none"),t.weight!==null&&(n["--sf-heading-weight"]=String(t.weight)),t.weightStrong!==null&&(n["--sf-heading-weight-strong"]=String(t.weightStrong)),t.maxPx!==null&&(n["--sf-heading-max"]=`${t.maxPx}px`),t.weight2!==null&&t.weight2!==t.weight&&(n["--sf-heading-2-weight"]=String(t.weight2)),t.weight3!==null&&t.weight3!==t.weight&&(n["--sf-heading-3-weight"]=String(t.weight3)),t.case2!==t.case&&(n["--sf-heading-2-case"]=t.case2==="sentence"?"none":"uppercase"),t.case3!==t.case&&(n["--sf-heading-3-case"]=t.case3==="sentence"?"none":"uppercase"),n}function so(e){return B({case:e?.heading_case??void 0,weight:e?.heading_weight,weightStrong:e?.heading_weight_strong,maxPx:e?.heading_max_px,weight2:e?.heading_2_weight??void 0,weight3:e?.heading_3_weight??void 0,case2:e?.heading_2_case??void 0,case3:e?.heading_3_case??void 0})}function uo(e){let t=B(e);return{heading_case:t.case,heading_weight:t.weight,heading_weight_strong:t.weightStrong,heading_max_px:t.maxPx,heading_2_weight:t.weight2,heading_3_weight:t.weight3,heading_2_case:t.case2,heading_3_case:t.case3}}var Y=[{key:"space-grotesk",label:"Space Grotesk",cssVar:"--font-display",category:"sans",italic:!1,italicLoaded:!1},{key:"inter",label:"Inter",cssVar:"--font-body",category:"sans",italic:!0,italicLoaded:!0},{key:"poppins",label:"Poppins",cssVar:"--font-poppins",category:"sans",italic:!0,italicLoaded:!0},{key:"dm-sans",label:"DM Sans",cssVar:"--font-dm-sans",category:"sans",italic:!0,italicLoaded:!0},{key:"sora",label:"Sora",cssVar:"--font-sora",category:"sans",italic:!1,italicLoaded:!1},{key:"oswald",label:"Oswald",cssVar:"--font-oswald",category:"sans",italic:!1,italicLoaded:!1},{key:"archivo",label:"Archivo",cssVar:"--font-archivo",category:"sans",italic:!0,italicLoaded:!0},{key:"outfit",label:"Outfit",cssVar:"--font-outfit",category:"sans",italic:!1,italicLoaded:!1},{key:"manrope",label:"Manrope",cssVar:"--font-manrope",category:"sans",italic:!1,italicLoaded:!1},{key:"big-shoulders",label:"Big Shoulders",cssVar:"--font-big-shoulders",category:"sans",italic:!1,italicLoaded:!1},{key:"michroma",label:"Michroma",cssVar:"--font-michroma",category:"sans",italic:!1,italicLoaded:!1},{key:"fraunces",label:"Fraunces",cssVar:"--font-serif",category:"serif",italic:!0,italicLoaded:!0},{key:"playfair-display",label:"Playfair Display",cssVar:"--font-playfair",category:"serif",italic:!0,italicLoaded:!0},{key:"cormorant",label:"Cormorant",cssVar:"--font-cormorant",category:"serif",italic:!0,italicLoaded:!0},{key:"jetbrains-mono",label:"JetBrains Mono",cssVar:"--font-mono-loaded",category:"mono",italic:!0,italicLoaded:!0}],p=new Map(Y.map(e=>[e.key,e])),Zt={sans:"Sans",serif:"Serif",mono:"Mono"};function go(){return Object.keys(Zt).map(e=>[e,Y.filter(t=>t.category===e)]).filter(([,e])=>e.length>0)}function ho(e){return p.get(e)?.italicLoaded??!1}function po(e){return p.get(e)}var Ce=["heading","heading2","heading3","body","accent","label"],fo={heading:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",body:"Body",accent:"Accent",label:"Labels"},jt=[["font-heading2","heading2"],["font-heading3","heading3"],["font-display","heading"],["font-serif","accent"],["font-mono","label"],["font-body","body"]],Jt=/var\(--size-(headingLarge|headingMedium|headingSmall|accent|body|label)\s*,/,mo={heading:"headingLarge",heading2:"headingMedium",heading3:"headingSmall",accent:"accent",body:"body",label:"label"},Qt={headingLarge:"heading",headingMedium:"heading2",headingSmall:"heading3",accent:"accent",body:"body",label:"label"};function So(e){let t=e?Jt.exec(e):null;return t?Qt[t[1]]??null:en(e)}function en(e){if(!e)return null;let t=e.split(/\s+/).filter(n=>!n.slice(0,n.lastIndexOf(":")+1).includes("&")).map(n=>n.slice(n.lastIndexOf(":")+1));for(let[n,o]of jt)if(t.includes(n))return o;return null}var tn=["heading","heading2","heading3"];function bo(e){return tn.includes(e)}var f={heading:"space-grotesk",heading2:"space-grotesk",heading3:"space-grotesk",body:"inter",accent:"fraunces",label:"jetbrains-mono"};function nn(e){let t=n=>{let o=e?.[n];if(o&&p.has(o))return o;if(n==="heading2"||n==="heading3"){let r=e?.heading;return r&&p.has(r)?r:f.heading}return f[n]};return Object.fromEntries(Ce.map(n=>[n,t(n)]))}function on(e,t){return p.get(e[t])??p.get(f[t])}function S(e,t){return`var(${on(e,t).cssVar})`}var yo=[...new Set(Ce.map(e=>p.get(f[e]).cssVar))],xo=[...new Set(Y.map(e=>e.cssVar))];function _o(e){let t=nn(e);return{"--font-role-heading":S(t,"heading"),"--font-role-heading2":S(t,"heading2"),"--font-role-heading3":S(t,"heading3"),"--font-role-body":S(t,"body"),"--font-role-accent":S(t,"accent"),"--font-role-label":S(t,"label"),fontFamily:"var(--font-role-body)"}}import{jsx as He}from"react/jsx-runtime";var Ae=rn({settings:null,setSettings:()=>{},primeSettings:()=>{},websiteName:null,templateChrome:!1,templateName:null,chromePlaceholder:!1,themeMode:G,setThemeMode:()=>{},themeSwitchShown:!1,setThemeSwitchShown:()=>{},theme:H,setTheme:()=>{},fonts:f,setFonts:()=>{},sizes:z,setSizes:()=>{},cornerRadiusPx:null,setCornerRadiusPx:()=>{},cardShadow:null,setCardShadow:()=>{},shadowColor:null,setShadowColor:()=>{},cardGap:v,setCardGap:()=>{},hoverEffect:null,setHoverEffect:()=>{},headingCompression:T,setHeadingCompression:()=>{},siteWidth:null,setSiteWidth:()=>{},siteGutter:null,blockGap:null,setSiteGutter:()=>{},setBlockGap:()=>{},headingTypography:$,setHeadingTypography:()=>{},heroBackgroundFollowsWidth:null,setHeroBackgroundFollowsWidth:()=>{},photographyGrayscale:null,setPhotographyGrayscale:()=>{},themeFromDocument:!1,selected:!1,setSelected:()=>{},select:()=>{},setSelectHandler:()=>{}});function Ao({children:e,websiteName:t=null,templateChrome:n=!1,templateName:o=null,chromePlaceholder:r=!1,themeMode:l=G,onThemeModeChange:i,themeSwitchShown:u=!1,onThemeSwitchShownChange:c,theme:d=H,onThemeChange:h,fonts:b=f,onFontsChange:y,sizes:x=z,onSizesChange:g,cornerRadiusPx:k=null,onCornerRadiusPxChange:E,cardShadow:ke=null,onCardShadowChange:W,shadowColor:Le=null,onShadowColorChange:K,cardGap:Ie=v,onCardGapChange:X,hoverEffect:Pe=null,onHoverEffectChange:q,headingCompression:Fe=T,onHeadingCompressionChange:Z,siteWidth:Oe=null,onSiteWidthChange:j,siteGutter:Me=null,blockGap:De=null,onSiteGutterChange:J,onBlockGapChange:Q,headingTypography:Ve=$,onHeadingTypographyChange:ee,heroBackgroundFollowsWidth:Ne=null,onHeroBackgroundFollowsWidthChange:te,photographyGrayscale:Ge=null,onPhotographyGrayscaleChange:ne,themeFromDocument:Ue=!1}){let[_,oe]=Re(null),ze=s(a=>oe(dt=>dt??a),[]),[$e,Be]=Re(!1),Ye=s(a=>i?.(a),[i]),We=s(a=>c?.(a),[c]),Ke=s(a=>h?.(a),[h]),Xe=s(a=>y?.(a),[y]),qe=s(a=>g?.(a),[g]),Ze=s(a=>j?.(a),[j]),je=s(a=>J?.(a),[J]),Je=s(a=>Q?.(a),[Q]),Qe=s(a=>te?.(a),[te]),et=s(a=>ne?.(a),[ne]),tt=s(a=>E?.(a),[E]),nt=s(a=>W?.(a),[W]),ot=s(a=>K?.(a),[K]),rt=s(a=>X?.(a),[X]),at=s(a=>q?.(a),[q]),it=s(a=>Z?.(a),[Z]),lt=s(a=>ee?.(a),[ee]),{select:st,setSelectHandler:ut}=F(),re=_?.logoUrl,ae=_?.logoReversed,ie=_?.logoInkIsDark,le=_!==null,ct=ln(()=>({logo:le?{logoUrl:re,logoReversed:ae,logoInkIsDark:ie}:null,placeholder:n||r,wordmark:n?o:t}),[le,re,ae,ie,n,r,o,t]);return He(I.Provider,{value:ct,children:He(Ae.Provider,{value:{settings:_,setSettings:oe,primeSettings:ze,websiteName:t,templateChrome:n,templateName:o,chromePlaceholder:r,themeMode:l,setThemeMode:Ye,themeSwitchShown:u,setThemeSwitchShown:We,theme:d,setTheme:Ke,fonts:b,setFonts:Xe,sizes:x,setSizes:qe,cornerRadiusPx:k,setCornerRadiusPx:tt,cardShadow:ke,setCardShadow:nt,shadowColor:Le,setShadowColor:ot,cardGap:Ie,setCardGap:rt,hoverEffect:Pe,setHoverEffect:at,headingCompression:Fe,setHeadingCompression:it,siteWidth:Oe,setSiteWidth:Ze,siteGutter:Me,blockGap:De,setSiteGutter:je,setBlockGap:Je,headingTypography:Ve,setHeadingTypography:lt,heroBackgroundFollowsWidth:Ne,setHeroBackgroundFollowsWidth:Qe,photographyGrayscale:Ge,setPhotographyGrayscale:et,themeFromDocument:Ue,selected:$e,setSelected:Be,select:st,setSelectHandler:ut},children:e})})}var vo=()=>an(Ae);var sn="Storefront";function Io(e){return e?.trim()||sn}import{forwardRef as un}from"react";import{jsx as gn}from"react/jsx-runtime";var cn={position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,color:"transparent"},dn=un(function({src:t,width:n,height:o,fill:r,priority:l,loading:i,style:u,quality:c,placeholder:d,blurDataURL:h,unoptimized:b,loader:y,overrideSrc:x,...g},k){let E=x??(typeof t=="string"?t:t.src);return gn("img",{ref:k,src:E,width:r?void 0:n,height:r?void 0:o,loading:l?"eager":i??"lazy",fetchPriority:l?"high":void 0,decoding:"async",style:r?{...cn,...u}:{color:"transparent",...u},...g})}),Oo=dn;function Mo(e){return{props:{src:e.overrideSrc??(typeof e.src=="string"?e.src:e.src.src),sizes:e.sizes}}}import{forwardRef as hn}from"react";import{jsx as mn}from"react/jsx-runtime";function pn(e){if(typeof e=="string")return e;let t=e.query?`?${new URLSearchParams(e.query).toString()}`:"",n=e.hash?e.hash.startsWith("#")?e.hash:`#${e.hash}`:"";return`${e.pathname??""}${t}${n}`}var fn=hn(function({href:t,prefetch:n,replace:o,scroll:r,shallow:l,legacyBehavior:i,passHref:u,locale:c,onClick:d,children:h,...b},y){let x=g=>{d?.(g),!(g.defaultPrevented||b.target==="_blank")&&g.preventDefault()};return mn("a",{ref:y,href:pn(t),onClick:x,...b,children:h})}),Go=fn;var ve=["instagram","facebook","tiktok","youtube","x","linkedin","pinterest","whatsapp"],Sn={instagram:"Instagram",facebook:"Facebook",tiktok:"TikTok",youtube:"YouTube",x:"X",linkedin:"LinkedIn",pinterest:"Pinterest",whatsapp:"WhatsApp"},bn={};function $o(e){if(!e||typeof e!="object")return bn;let t={};for(let n of ve){let o=e[n];if(typeof o!="string")continue;let r=o.trim();!r||!/^https?:\/\//i.test(r)||(t[n]=r)}return t}function Bo(e){return ve.flatMap(t=>{let n=e[t];return n?[{platform:t,href:n,label:Sn[t]}]:[]})}var Yo=e=>`${e}_url`;export{Oo as a,Mo as b,Go as c,Y as d,Zt as e,go as f,ho as g,po as h,Ce as i,fo as j,mo as k,So as l,en as m,bo as n,f as o,nn as p,_o as q,Rn as r,F as s,vn as t,In as u,Pn as v,Fn as w,On as x,G as y,Mn as z,xt as A,ge as B,Dn as C,Vn as D,w as E,he as F,Rt as G,Nn as H,Gn as I,Un as J,zn as K,$n as L,pe as M,Bn as N,fe as O,Yn as P,Wn as Q,Kn as R,Xn as S,qn as T,z as U,vt as V,kt as W,Zn as X,It as Y,jn as Z,Jn as _,Se as $,Ot as aa,Qn as ba,be as ca,Dt as da,eo as ea,Vt as fa,Nt as ga,ye as ha,v as ia,zt as ja,$t as ka,Bt as la,xe as ma,_e as na,Yt as oa,Te as pa,Wt as qa,to as ra,no as sa,oo as ta,ro as ua,T as va,Ee as wa,ao as xa,io as ya,$ as za,D as Aa,V as Ba,Xt as Ca,qt as Da,B as Ea,lo as Fa,so as Ga,uo as Ha,se as Ia,En as Ja,Ao as Ka,vo as La,sn as Ma,Io as Na,ve as Oa,Sn as Pa,bn as Qa,$o as Ra,Bo as Sa,Yo as Ta};
@@ -0,0 +1 @@
1
+ import{Gc as l}from"./chunk-BJOS4Y35.js";import{d as s}from"./chunk-6CP4D6VJ.js";var n=()=>Promise.reject(new l("unavailable","This editor's backend keeps no section templates.")),a={list:()=>Promise.resolve([]),get:()=>Promise.resolve(null),ensure:n,save:n,update:n,rename:n,remove:n},o=()=>s().sectionTemplates??a,p={list:()=>o().list(),get:t=>o().get(t),ensure:(t,e,r)=>o().ensure(t,e,r),save:(t,e)=>o().save(t,e),update:(t,e)=>o().update(t,e),rename:(t,e)=>o().rename(t,e),remove:t=>o().remove(t)};var i=new Map;async function c(t,e){try{return(await s().site.get({siteId:e})).slug?.trim()||null}catch(r){return console.warn("[editor-site-slug] could not resolve the site slug",r),null}}function f(t,e){let r=i.get(e);return r||(r=c(t,e),i.set(e,r),r.catch(()=>{i.get(e)===r&&i.delete(e)})),r}export{p as a,f as b};
@@ -0,0 +1 @@
1
+ var t={siteSlug:null,shopOrigin:""},i=t;function e(n){i={siteSlug:n.siteSlug?.trim()||null,shopOrigin:(n.shopOrigin??"").trim().replace(/\/+$/,"")}}function u(){return i.siteSlug}function r(){return i.shopOrigin}export{e as a,u as b,r as c};
@@ -0,0 +1,2 @@
1
+ import{ta as u}from"./chunk-BJOS4Y35.js";import{t as x}from"./chunk-IFRGL3GL.js";var F="inline",O=[{label:"In this section",value:"inline"},{label:"In its own box",value:"own-box"}];var N={ProductGrid:{num:"num",title:"title",description:"description",headRows:["num","title","titleSize","description","linkText","linkHref"],renderer:"ProductGridSection",padKey:"padTop",linkProp:"link"},TyreSizes:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreSizes"},FitmentFinder:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentFinder"},TyreFitment:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicTyreFitment"},BundleOffer:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicBundleOffer"},CompatibleTyres:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},RelatedProducts:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"DynamicRelatedProducts"},SpecTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"SpecTable"},FAQ:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"FAQ"},GalleryB:{num:"num",title:"title",headRows:["num","title","linkText","linkHref"],renderer:"GalleryGrid"},FitmentTable:{num:"num",title:"title",description:"description",headRows:["num","title","description"],renderer:"FitmentTable"},Events:{num:"num",title:"title",linkProp:"link",headRows:["num","title","linkText","linkHref"],renderer:"Events"},ProcessSteps:{num:"num",title:"title",description:"description",headRows:["num","title","description"],headStyle:"editorial",renderer:"ProcessSteps",padKey:"padTop"},LongRead:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"LongRead"},Series:{num:"headNum",title:"headTitle",description:"headDesc",headRows:["headNum","headTitle","headDesc"],headStyle:"editorial",renderer:"Series"},TimelineTrack:{num:"eyebrow",title:"title",description:"intro",headRows:["eyebrow","title","intro"],headStyle:"editorial",renderer:"TimelineTrack",padKey:"padTop"},StatsParagraph:{num:"eyebrow",title:"title",description:"desc",headRows:["eyebrow","title","desc"],headStyle:"editorial",renderer:"StatsParagraph"},Footprint:{num:"sectionNumber",title:"heading",description:"tagline",headRows:["sectionNumber","heading","tagline"],headStyle:"editorial",renderer:"Footprint",padKey:"padTop"},Collections:{num:"eyebrow",title:"heading",headRows:["eyebrow","heading"],renderer:"Collections"},Cards:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Cards"},Testimonials:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Testimonials"},Reviews:{num:"eyebrow",title:"title",headRows:["eyebrow","eyebrowLook","title"],headStyle:"simple",renderer:"Reviews"},Prose:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"essay",renderer:"Prose"},ReviewForm:{num:"eyebrow",title:"title",headRows:["eyebrow","title"],headStyle:"simple",renderer:"ReviewForm"},DeliveryOptions:{num:"eyebrow",title:"title",description:"body",headRows:["eyebrow","title","body"],headStyle:"natural",headRowGap:"gap-3",headDescriptionSize:"text-[15px]",renderer:"DeliveryOptions"}},ye="SectionHeader";function ge(e){return e in N}function _(e){return u(O,F,e)}var B=new Set(["Flex"]);function G(e){return!!e?.type&&B.has(e.type)}function be(e,t,o){if(!G(t))return e;let n={};for(let[r,i]of Object.entries(e))o.includes(r)||(n[r]=i);return n}function we(e,t,o){if(_(t)!=="own-box")return e;let n={};for(let[r,i]of Object.entries(e))o.includes(r)||(n[r]=i);return n}import{createContext as I,useCallback as A,useContext as D,useState as m}from"react";import{jsx as H}from"react/jsx-runtime";var k=I({footerBlock:null,setFooterBlock:()=>{},headerGroup:null,setHeaderGroup:()=>{},refreshToken:0,refreshFooter:()=>{}});function ke({children:e,editFooter:t}){let[o,n]=m(null),[r,i]=m(null),[l,s]=m(0),a=A(()=>s(c=>c+1),[]);return H(k.Provider,{value:{footerBlock:o,setFooterBlock:n,headerGroup:r,setHeaderGroup:i,editFooter:t,refreshToken:l,refreshFooter:a},children:e})}var Se=()=>D(k);import{createContext as K,useContext as M,useMemo as U,useState as Y}from"react";import{jsx as W}from"react/jsx-runtime";var S=K(null);function Te({children:e}){let[t,o]=Y(null),n=U(()=>({surface:t,setSurface:o}),[t]);return W(S.Provider,{value:n,children:e})}function ve(){return M(S)??{surface:null,setSurface:()=>{}}}var{Provider:Oe,useSelection:Ne}=x("selectedLocationPartId");function _e(e,t,o){return`${e}::${t}::${o}`}function Be(e){if(!e)return null;let t=e.split("::");if(t.length<3)return null;let o=t[t.length-1];if(o!=="image"&&o!=="map")return null;let n=Number(t[t.length-2]);if(!Number.isInteger(n)||n<0)return null;let r=t.slice(0,-2).join("::");return r?{nodeId:r,index:n,part:o}:null}var $="plain",C=[{label:"Plain",value:"plain"},{label:"Filled",value:"filled"},{label:"Line",value:"line"}],z="line",Q={KeyFeatures:"filled"};function j(e){return Q[e]??$}function Ae(e,t){return u(C,j(t),e)}function De(e){return u(C,z,e)}import{createContext as q,useContext as V}from"react";var Z=q(!1),Me=()=>V(Z);import{useSyncExternalStore as J}from"react";var f=null,y=new Set;function We(e){if(f!==e){f=e;for(let t of y)t()}}function X(e){return y.add(e),()=>{y.delete(e)}}function $e(){return J(X,()=>f,()=>null)}function ze(e){if(!e)return null;let t=e.lastIndexOf(":");return t>0?e.slice(0,t):null}import{jsx as te,jsxs as ne}from"react/jsx-runtime";function ee({label:e,blocked:t,onAdd:o,small:n=!1}){return ne("button",{type:"button",className:"sf-add-card",disabled:t!==null,title:t??void 0,onClick:o,children:[te("span",{className:n?"sf-plus sf-plus--sm":"sf-plus",children:"+"}),e]})}import{useSyncExternalStore as oe}from"react";var re={level:"groups"},P=re,g=new Set;function Ze(e){P=e;for(let t of g)t()}function ie(e){return g.add(e),()=>{g.delete(e)}}var L=()=>P;function Je(){return oe(ie,L,L)}function T(e,t,o){let n=[];return e.forEach((r,i)=>{let l=t(r),s=n.find(a=>a.key===l);s||(s={key:l,name:o(r),items:[]},n.push(s)),s.items.push({item:r,index:i})}),n}function et(e){if(e<=1)return"grid-cols-1";if(e===2)return"grid-cols-2";if(e===3)return"grid-cols-3";if(e===4)return"grid-cols-4";let t=o=>e%o||o;return t(4)>=t(3)?"grid-cols-4":"grid-cols-3"}var w=e=>String(e?.group??""),b=new WeakMap,se=0;function le(e){let t=b.get(e);return t||(t=`loc${++se}`,b.set(e,t)),t}var ot=(e,t)=>t||e||"Ungrouped",v={photo:"",group:"",groupName:"",name:"City name",state:"State",country:"Country",timezone:"GMT \xB7 UTC +0",address:`Address line one
2
+ Address line two`,phone:"+00 000 0000",hours:"Mon\u2013Fri 9:00\u201318:00",lat:0,lng:0,mapsUrl:""};function d(e){return T(e,w,t=>String(t?.groupName??"")).map(t=>({key:t.key,name:t.name,cards:t.items.map(o=>o.item)}))}var h=e=>e.flatMap(t=>t.cards),R=(e,t,o)=>Math.min(Math.max(e,t),o);function ae(e,t,o){let n=0;for(let r=0;r<e.length;r++)if(w(e[r])===t){if(n===o)return r;n++}return-1}function rt(e,t,o){let n=d(e);if(t<0||t>=n.length)return e;let[r]=n.splice(t,1),i=R(t<o?o-1:o,0,n.length);return n.splice(i,0,r),h(n)}function it(e,t,o,n,r){let i=d(e),l=i.find(p=>p.key===t),s=i.find(p=>p.key===n);if(!l||!s||o<0||o>=l.cards.length)return e;let[a]=l.cards.splice(o,1),c=t===n?a:{...a,group:s.key,groupName:s.name};c!==a&&b.set(c,le(a));let E=R(l===s&&o<r?r-1:r,0,s.cards.length);return s.cards.splice(E,0,c),h(i)}function st(e,t){let o=d(e),n=o.find(i=>i.key===t),r={...v,group:t,groupName:n?.name??""};return n?(n.cards.push(r),h(o)):[...e,r]}function lt(e){let t=new Set(d(e).map(r=>r.key)),o=t.size+1,n=`Group ${o}`;for(;t.has(n);)n=`Group ${++o}`;return{cards:[...e,{...v,group:n,groupName:""}],key:n}}function at(e,t){return e.filter(o=>w(o)!==t)}function ct(e,t,o){let n=ae(e,t,o);return n<0?e:e.filter((r,i)=>i!==n)}var ce="Main Pages",ue="Dynamic Pages",de="dynamic",pe="dynamic";function me(e){return e.kind===pe}function dt(e){let t=[],o=[];for(let n of e){if(me(n)){o.push(n);continue}let r=n.groupKey??(n.group?`folder:${n.group}`:"top"),i=t[t.length-1];i&&i.key===r?i.rows.push(n):t.push({key:r,label:n.group??ce,rows:[n]})}if(o.length){let n=t.findIndex(r=>r.key.startsWith("system:"));t.splice(n===-1?t.length:n,0,{key:de,label:ue,rows:o})}return t}export{N as a,ye as b,ge as c,_ as d,G as e,be as f,we as g,ke as h,Se as i,Te as j,ve as k,Oe as l,Ne as m,_e as n,Be as o,$ as p,C as q,z as r,j as s,Ae as t,De as u,Z as v,Me as w,me as x,dt as y,We as z,$e as A,ze as B,ee as C,Ze as D,Je as E,T as F,et as G,w as H,le as I,ot as J,v as K,d as L,ae as M,rt as N,it as O,st as P,lt as Q,at as R,ct as S};
@@ -0,0 +1 @@
1
+ import{f as et,i as me,p as tt,r as nt,t as q}from"./chunk-7QXLVNFD.js";import{c as Ze}from"./chunk-RRHBLOH4.js";import{Ma as de,Na as Qe,Qa as ke,Ra as Je}from"./chunk-IFRGL3GL.js";import{l as je,u as re}from"./chunk-6CP4D6VJ.js";import{createContext as Vt,useContext as Gt,useEffect as Xt,useMemo as pe,useState as it}from"react";function rt(e,t){return e.map(n=>({partNumber:n.partNumber,quantity:n.wheels*t}))}function oe(e,t){if(e.length===0)return null;let n=0;for(let r of e){let o=r.prices?.[t];if(typeof o!="number"||!Number.isFinite(o)||o<=0)return null;n+=o*r.wheels}return n}var Ae=4,Jn=1,Zn={unit:"set",spares:0,spareSide:"left"};function ot(e){return e.unit==="single"?1:Ae+e.spares}function er(e,t){return[{partNumber:e.partNumber,wheels:ot(t),prices:e.prices}]}function tr(e,t){let n=ot(t)-Ae;if(n<=0||e.length===0)return e;let r=Bt(e),o=r?r[t.spareSide]:0;return e.map((i,s)=>s===o?{...i,wheels:i.wheels+n}:i)}function Bt(e){let t,n;for(let r=0;r<e.length;r+=1){let o=e[r].hand;if(o!=="left"&&o!=="right")continue;if((o==="left"?t:n)!==void 0)return null;o==="left"?t=r:n=r}return t!==void 0&&n!==void 0?{left:t,right:n}:null}function zt(e,t){return t.spares>0?`${e} + spare`:e}function nr(e){return e.unit==="single"?"Single":zt(`Set of ${Ae}`,e)}var rr="data-add-to-basket",Ne=9,Re="en";function fe(e,t,n=0){return new Intl.NumberFormat(Re,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:n}).format(e)}import{jsx as Qt}from"react/jsx-runtime";var st="storefront-country",at=Vt(null);function Yt(e){return lt(e,"catalogue")}function jt(e){return lt(e,"money")}function lt(e,t){let n=new Map(e.map(o=>[o.code,o.decimalPlaces])),r=new Map;return(o,i)=>{if(!i)return"";let s=r.get(i);if(!s){let l=n.get(i)??0;s=new Intl.NumberFormat(Re,{style:"currency",currency:i,minimumFractionDigits:t==="money"?l:0,maximumFractionDigits:l}),r.set(i,s)}return s.format(o)}}function lr({children:e,currencies:t,countries:n,defaultCurrency:r,defaultCountry:o}){let i=pe(()=>t??[],[t]),s=pe(()=>n??[],[n]),l=pe(()=>r||i.find(C=>C.isDefault)?.code||i[0]?.code||"",[r,i]),c=pe(()=>o||s.find(C=>C.isDefault)?.code||s[0]?.code||"",[o,s]),[u,m]=it(c),[f,P]=it(!1);Xt(()=>{let C=re.getItem(st);C&&s.some(L=>L.code===C)&&m(C),P(!0)},[s]);function w(C){m(C),re.setItem(st,C)}let h=pe(()=>{let C=s.find(I=>I.code===u)??null,L=C?.currency,_=L&&i.some(I=>I.code===L)?L:l,M=Yt(i),x=jt(i);return{country:u,currency:_,setCountry:w,currencies:i,countries:s,activeCountry:C,formatPrice:(I,S)=>M(I,S??_),formatMoney:(I,S)=>x(I,S??_),ready:f}},[u,i,s,l,f]);return Qt(at.Provider,{value:h,children:e})}function ut(){let e=Gt(at);if(!e)throw new Error("useCurrency must be used within a CurrencyProvider");return e}import{createContext as cn,useCallback as A,useContext as dn,useEffect as B,useMemo as Ct,useRef as ie,useState as N}from"react";function dt(e,t){return e.valid?!1:e.reason==="firstOrderOnly"?!0:e.reason==="notEligible"&&!t}var mt="We'll confirm this discount when you place your order.",mr="Confirmed at checkout";function fr(e){return e&&(e.valid||e.deferred)?e.code:void 0}var ct="coupon_code: ";function pr(e){return!(e instanceof me)||e.status!==400||!e.message.startsWith(ct)?null:e.message.slice(ct.length)}function ft(e,t){return e.map(n=>({qty:n.qty,slug:n.slug,name:`${n.name.lead}${n.name.accent}`.trim(),finish:n.finishName,size:n.size,kind:n.kind,sku:n.sku,pack:n.pack,priceLabel:t(n)}))}var Ee="Price on request",Zt="Request a quote";function Me(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function De(e,t){let n=e?.[t];return Me(n)?n:null}function hr(e,t,n,r){let o=De(e,n),i=De(t,n);return o===null&&i===null?0:o===null?1:i===null?-1:r==="asc"?o-i:i-o}function Cr(e,t,n,r){if(n==null&&r==null)return!0;let o=De(e,t);return!(o===null||n!=null&&o<n||r!=null&&o>r)}var en={priced:!1,unit:null,was:null,onSale:!1,setTotal:null};function tn(e,t,n){if(!Me(e))return en;let r=Me(t)&&t>e?t:null;return{priced:!0,unit:e,was:r,onSale:r!==null,setTotal:n!=null?e*n:null}}function xr(e,t,n=""){return!e.priced||e.unit==null?Ee:`${n}${fe(e.unit,t)}`}function Sr(e,t){return e.was==null?null:fe(e.was,t)}function nn(e,t,n=1){let r=oe(e,t);if(r===null)return{priced:!1,unit:null,isFrom:!1,setTotal:null};let o=e.reduce((s,l)=>s+l.wheels,0),i=Math.min(...e.map(s=>s.prices[t]));return{priced:!0,unit:i,isFrom:i*o!==r,setTotal:r*n}}var rn={priced:!1,unit:null,isFrom:!1,was:null,onSale:!1,setTotal:null};function vr(e,t,n,r=1){let o=tn(e.prices[n],e.msrpPrices?.[n],4),i=o.setTotal==null?null:o.setTotal*r;if(!t)return{priced:o.priced,unit:o.unit,isFrom:!0,was:o.was,onSale:o.onSale,setTotal:null,fromSetTotal:i};let s=nn(t.components,n,r);return s.priced?{priced:!0,unit:s.unit,isFrom:s.isFrom,was:null,onSale:!1,setTotal:s.setTotal,fromSetTotal:i}:{...rn,fromSetTotal:i}}function on(e,t){return!e.priced||e.unit==null?Ee:`${e.isFrom?"from ":""}${fe(e.unit,t)}`}function Er(e,t){return e.was==null?null:fe(e.was,t)}function Pr(e,t){return!e.priced||e.unit==null?Zt:on(e,t)}var sn=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;function pt(e){return sn.test(e.trim())}var gt="sf:ga-purchases",an=20;function bt(){return typeof window>"u"||window.parent!==window}function ge(...e){try{if(bt()||typeof window.gtag!="function")return;window.gtag(...e)}catch{}}function ln(e,t){let n=e.config.find(r=>r.gold)?.label;return{item_id:`${e.slug}|${e.finishName}|${e.size}`,item_name:`${e.name.lead}${e.name.accent}`.trim(),...n?{item_variant:n}:{},price:oe(e.components,t)??0,quantity:e.qty}}function Oe(e,t){return e.filter(Pe).map(n=>ln(n,t))}function kr(e){ge("event","view_item",{currency:e.currency,value:e.pricePerSet,items:[{item_id:e.itemId,item_name:e.itemName,...e.variant?{item_variant:e.variant}:{},price:e.pricePerSet,quantity:1}]})}function ht(e,t){let n=Oe([e],t);n.length!==0&&ge("event","add_to_cart",{currency:t,value:n[0].price*n[0].quantity,items:n})}function Ar(e){let t=Oe(e.lines,e.currency);t.length!==0&&ge("event","begin_checkout",{currency:e.currency,value:e.value,...e.coupon?{coupon:e.coupon}:{},items:t})}var yt=new Set;function un(e){if(yt.has(e))return!1;yt.add(e);try{let t=JSON.parse(re.getItem(gt)??"[]");if(t.includes(e))return!1;re.setItem(gt,JSON.stringify([...t,e].slice(-an)))}catch{}return!0}function Nr(e){let t=e.confirmation;if(bt()||!un(t.orderNumber))return;let n=t.currency,r=Number(t.grandTotal);ge("event","purchase",{transaction_id:t.orderNumber,currency:n,value:r,shipping:Number(t.freightCharge),...t.couponCode?{coupon:t.couponCode}:{},items:Oe(e.lines,n)}),e.adsSendTo&&ge("event","conversion",{send_to:e.adsSendTo,transaction_id:t.orderNumber,currency:n,value:r})}import{jsx as gn}from"react/jsx-runtime";var mn=400,fn=400,pn=1500;function Pe(e){return(e.components?.length??0)>0}function xt(e,t){return{code:e,valid:t.valid,deferred:dt(t,t.askedAsShopper),message:t.message||void 0,effects:t.effects??void 0}}function vt(e,t){return oe(e.components,t)}function Fe(e,t){let n=vt(e,t);return n===null?null:n*e.qty}function St(e){return e!=="tyre"}var Et=cn(null);function Wr({children:e,preview:t=!1}){let{currency:n,country:r,formatMoney:o}=ut(),[i,s]=N(t),[l,c]=N([]),[u,m]=N([]),[f,P]=N([]),[w,h]=N(!1),[C,L]=N(!1),[_,M]=N(!1),[x,I]=N(!1),[S,H]=N(null),[W,j]=N(void 0),b=ie(r),v=ie("");b.current=b.current||r;let[d,K]=N(null),[Q,V]=N(!1),[R,J]=N(null),Z=ie(void 0),D=A(()=>s(!0),[]),he=A(()=>s(!1),[]),O=A(()=>s(a=>!a),[]);B(()=>{t||typeof window>"u"||new URLSearchParams(window.location.search).get("cart")==="open"&&D()},[D,t]);let Ce=A(a=>{I(!0),St(a)&&M(!0)},[]),ee=_||l.some(a=>St(a.kind)),ae=x||l.length>0;B(()=>{if(t||!ee||w)return;let a=!0;return q.listWheels().then(p=>{a&&(m(p),h(!0))}),()=>{a=!1}},[t,ee,w]),B(()=>{if(t||!ae||C)return;let a=!0;return q.listBundles().then(p=>{a&&(P(p),L(!0))}),()=>{a=!1}},[t,ae,C]);let U=S?.deliveryOptions??[];B(()=>{U.length!==0&&J(a=>a&&U.some(p=>p.id===a)?a:U[0]?.id??null)},[S]);let G=A(()=>l.filter(Pe).flatMap(a=>rt(a.components,a.qty)),[l]),le=A(async(a,p)=>{let y=a.trim().toUpperCase();if(!y)return;let g=G();if(g.length===0){K({code:y,valid:!1,message:"Add a wheel to the cart first."});return}V(!0),Z.current=p;try{let T=await q.validateCoupon({code:y,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:p});K(xt(y,T))}catch{K({code:y,valid:!1,message:"Could not check that code. Please try again."})}finally{V(!1)}},[G,n,R]),te=A(()=>{K(null),Z.current=void 0},[]),xe=A(a=>{if(!d)return;let{code:p}=d;K(y=>y&&y.code===p?{code:p,valid:!1,refused:!0,message:a}:y)},[d]);B(()=>{if(!d||d.refused)return;let a=d.code,p=g=>g!==null&&g.code===a&&!g.refused,y=setTimeout(async()=>{let g=G();if(g.length===0){K(T=>p(T)?{code:a,valid:!1,message:"Add a wheel to the cart first."}:T);return}V(!0);try{let T=await q.validateCoupon({code:a,items:g,currency:n,shippingMethodId:R??void 0,customerEmail:Z.current});K(ce=>p(ce)?xt(a,T):ce)}catch{}finally{V(!1)}},mn);return()=>clearTimeout(y)},[l,n,R]);let Se=d&&!d.refused?d.code:void 0;B(()=>{if(t)return;let a=!0,p=setTimeout(async()=>{let y=G();if(y.length===0){H(null),j(void 0);return}try{let g=await q.quoteCart({items:y,currency:n,shippingMethodId:R??void 0,couponCode:Se,customerEmail:Z.current||void 0,country:b.current||void 0,subdivision:v.current||void 0});if(!a)return;H(g)}catch{if(!a)return}j(Se)},fn);return()=>{a=!1,clearTimeout(p)}},[l,n,R,Se,r]),B(()=>{if(t||!i)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[i,t]);let E=A(a=>{c(p=>{let y=p.findIndex(g=>g.id===a.id);return y===-1?[...p,a]:p.map((g,T)=>T===y?{...g,qty:Math.min(Ne,g.qty+a.qty)}:g)}),ht(a,n)},[n]),F=A(a=>{c(p=>p.filter(y=>y.id!==a))},[]),X=A((a,p)=>{let y=Math.max(1,Math.min(Ne,p));c(g=>g.map(T=>T.id===a?{...T,qty:y}:T))},[]),We=A(a=>{c(a)},[]),[ue,Ft]=N(null),Be=ie(null);Be.current=ue;let $=ie(null),Te=ie(""),ze=A((a,p)=>{let y=a.trim().toLowerCase();pt(y)&&Ft(g=>g&&g.email===y&&g.firstName===(p??"")?g:{email:y,firstName:p??""})},[]);B(()=>{if(t||!ue)return;let a=ft(l.filter(Pe),g=>Fe(g,n)===null?Ee:o(Fe(g,n),n)),p={email:ue.email,firstName:ue.firstName,currency:n,items:a},y=JSON.stringify(p);if(y!==Te.current)return $.current&&clearTimeout($.current),$.current=setTimeout(()=>{$.current=null,Te.current=y,q.captureCart(p).catch(g=>{})},pn),()=>{$.current&&(clearTimeout($.current),$.current=null)}},[l,ue,n,t]);let Ve=A(()=>{$.current&&(clearTimeout($.current),$.current=null);let a=Be.current;a&&(Te.current="",q.captureCart({email:a.email,firstName:a.firstName,currency:n,items:[]}).catch(p=>{}))},[n]),Ge=Ct(()=>{let a=l.reduce((k,ne)=>{let ve=Fe(ne,n);return ve===null?k:k+ve},0),p=l.some(k=>vt(k,n)===null),y=l.reduce((k,ne)=>k+ne.qty,0),g=d?.valid?d.effects:void 0,T=g?Math.min(a,Number(g.discountAmount)):0,ce=S?.bundleDiscount??0,$t=S?.appliedBundles??[],Xe=!!g?.freeShipping,qt=U.find(k=>k.id===R),Ye=Xe?0:S?.shipping??qt?.amount??0,_e={};for(let k of g?.freeUnits??[])_e[k.partNumber]=(_e[k.partNumber]??0)+k.quantity;let Ht=S?.tax??null,Kt=S?S.grandTotal:a-T-ce+Ye;return{sets:y,units:l.reduce((k,ne)=>k+(ne.components??[]).reduce((ve,Wt)=>ve+Wt.wheels*ne.qty,0),0),subtotal:a,hasUnpricedLine:p,discount:T,bundleDiscount:ce,appliedBundles:$t,shipping:Ye,freeShipping:Xe,freeUnitsByPartNumber:_e,tax:Ht,grand:Kt,repricing:!!d?.refused&&S!==null&&W===d?.code,currency:n}},[l,n,d,U,R,S,W]),Ut=Ct(()=>({isOpen:i,open:D,close:he,toggle:O,items:l,catalog:u,bundles:f,warmCatalog:Ce,add:E,remove:F,setQty:X,replaceItems:We,identify:ze,clearCapturedCart:Ve,coupon:d,applyCoupon:le,removeCoupon:te,refuseCoupon:xe,couponBusy:Q,deliveryOptions:U,shippingMethodId:R,setShippingMethodId:J,totals:Ge}),[i,D,he,O,l,u,f,Ce,E,F,X,We,ze,Ve,d,le,te,xe,Q,U,R,Ge]);return gn(Et.Provider,{value:Ut,children:e})}function Pt(){let e=dn(Et);if(!e)throw new Error("useCart() must be called inside <CartProvider>. Mount the provider in app/layout.tsx.");return e}import{cache as In}from"react";function Lt(e,t,n,r){for(;e.size>=t;){let o,i;for(let[l,c]of e){if(c.expiresAt<=r){o=l;break}i===void 0&&n(l)&&(i=l)}let s=o??i??e.keys().next().value;if(s===void 0)return;e.delete(s)}}var yn=6e4,bn=5e3,hn=500,Ue=new Map;async function Cn(e){let{host:t,matchesRequestHost:n}=await tt();if(!t)return"";let r=await nt();return r?`${e}|slug:${encodeURIComponent(t)}/${encodeURIComponent(r)}`:n?`${e}|host:${t}`:`${e}|xhost:${t}`}var xn=e=>e.includes("|slug:")||e.includes("|xhost:");async function It(e,t){let n=await Cn(e);if(!n)return t();let r=Date.now(),o=Ue.get(n);if(o&&o.expiresAt>r)return o.load;let i=await t(),s=i.outcome.state==="failed"?bn:yn;return Lt(Ue,hn,xn,r),Ue.set(n,{load:i,expiresAt:r+s}),i}var Sn=404;function vn(e){if(e instanceof me&&e.status===Sn)return{state:"absent"};let t=e instanceof me?e.status:-1,n=e instanceof Error?e.message:String(e);return{state:"failed",status:t,detail:n}}var En="[storefront:chrome-load-failed]";function Pn(e,t){console.error(`${En} ${e} status=${t.status} \u2014 serving fallback chrome`,t.detail)}async function wt(e,t,n,r){try{let o=await t();return r?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){let i=vn(o);return i.state==="failed"&&Pn(e,i),{value:n,outcome:i}}}function Ln(e){return e==="production"?"silent":"banner"}var Qr=Ln("production");function wn(e,t){return e?.trim()||t}function io({legalName:e,foundedYear:t,siteName:n},r=new Date().getFullYear()){let o=wn(e,n);return`\xA9 ${t&&t<r?`${t}\u2013${r}`:`${r}`} ${o}`}var Tn={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[],defaultCurrency:null,countries:[],defaultCountry:null,commerceEnabled:!0,cardPayments:!1,paymentMethods:[],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:ke},so=In(async()=>It("site",()=>wt("site",async()=>{let e=await q.getSite();return{name:Qe(e.name),legalName:e.legalName?.trim()||null,foundedYear:e.foundedYear??null,faviconUrl:e.faviconUrl??null,currencies:e.currencies??[],defaultCurrency:e.defaultCurrency??null,countries:e.countries??[],defaultCountry:e.defaultCountry??null,commerceEnabled:e.commerceEnabled??!0,cardPayments:e.cardPayments??!1,paymentMethods:e.paymentMethods??(e.cardPayments?["card"]:[]),paypalClientId:e.paypalClientId??null,paypalEnvironment:e.paypalEnvironment??null,squareApplicationId:e.squareApplicationId??null,squareLocationId:e.squareLocationId??null,squareEnvironment:e.squareEnvironment??null,ga4MeasurementId:e.ga4MeasurementId??null,googleAdsId:e.googleAdsId??null,googleAdsConversionLabel:(e.googleAdsId?e.googleAdsConversionLabel:null)??null,metaPixelId:e.metaPixelId??null,mapsApiKey:e.mapsApiKey??null,mapsMapId:e.mapsMapId??null,socialLinks:Je(e.socialLinks)}},Tn)));var ao={name:de,legalName:null,foundedYear:null,faviconUrl:null,currencies:[{code:"USD",symbol:"$",decimalPlaces:2,isDefault:!0}],defaultCurrency:"USD",countries:[{code:"US",name:"United States",currency:"USD",url:"",isDefault:!0,chargeTax:!1,taxDisplay:"none",taxName:"",taxRate:null,postalLabel:"Zip Code"}],defaultCountry:"US",commerceEnabled:!0,cardPayments:!0,paymentMethods:["card"],paypalClientId:null,paypalEnvironment:null,squareApplicationId:null,squareLocationId:null,squareEnvironment:null,ga4MeasurementId:null,googleAdsId:null,googleAdsConversionLabel:null,metaPixelId:null,mapsApiKey:null,mapsMapId:null,socialLinks:ke};import{useEffect as Le,useRef as _t,useState as Ie}from"react";var ye=new Map,_n=64;async function kn(e){if(!je())return null;try{let t=await fetch(`${Ze()}/logo-analysis.json?url=${encodeURIComponent(e)}`);if(!t.ok)return null;let n=await t.json();if(!n||typeof n!="object")return null;let{reversed:r,inkIsDark:o}=n;return typeof r!="string"?null:{reversed:r,inkIsDark:typeof o=="boolean"?o:null}}catch{return null}}function Tt(e){let t=ye.get(e);if(t)return t;let n=kn(e);if(ye.set(e,n),ye.size>_n){let r=ye.keys().next();r.done||ye.delete(r.value)}return n}import{jsx as kt,jsxs as At}from"react/jsx-runtime";var An={small:54,medium:66,large:84},Nn=44,Rn=202/22,bo=16,ho=140,Mn=.88,Co=16,Dn="invert(1)";function On({variant:e="header",scrolled:t=!0,src:n,reverse:r=!1,onLightSurface:o,reversedSrc:i,inkIsDark:s,size:l="medium",sizePx:c,wordmark:u,siteName:m=de,fitToContainer:f=!1,fitWordmarkToContainer:P=!1,fitFloorPx:w}){let h=u&&u.trim()?u.trim():m,[C,L]=Ie(!1),_=_t(null),M=E=>{_.current=E};Le(()=>{let E=_.current?.ownerDocument??document,F=()=>{L(E.documentElement.getAttribute("data-theme")==="light")};F();let X=new MutationObserver(F);return X.observe(E.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>X.disconnect()},[]);let x=n&&n.trim()?n.trim():null,I=!!x&&et(x),S=o??(C&&t),H=r&&I&&x&&i!=null?{reversed:i,inkIsDark:s??null}:null,W=H!==null,[j,b]=Ie(null);Le(()=>{if(!r||!x||!I||W){b(null);return}let E=!1;return b(null),Tt(x).then(F=>{E||b(F)}),()=>{E=!0}},[r,x,I,W]);let v=H??j,d=!!v&&v.inkIsDark!==null&&(S?!v.inkIsDark:v.inkIsDark),K=r&&!!x&&!I&&!S,Q=d&&v?v.reversed:x,V=Q?[Q]:[],[R,J]=Ie(0);Le(()=>{J(0)},[x,d]);let Z=e==="footer"?Nn:An[l],D=c&&c>0?c:Z,he=Math.round(D*Rn),O=R<V.length?V[R]:null,[Ce,ee]=Ie(Q),ae=O!==null&&O===Ce,U=_t(null);Le(()=>{let E=U.current;if(!E||!E.complete)return;if(E.naturalWidth>0||E.naturalHeight>0){ee(O);return}let F=!1;return E.decode().then(()=>!F&&ee(O),()=>!F&&J(X=>X+1)),()=>{F=!0}},[O]);let G=f||P,le=`calc(100cqi / ${((h.length+1)*Mn).toFixed(2)})`,te=G&&w&&w>0?Math.min(w,D):null,xe=G?te===null?`min(${D}px, ${le})`:`clamp(${te}px, ${le}, ${D}px)`:`${D}px`;return At("span",{ref:M,className:"inline-flex items-center",children:[!ae&&At("span",{className:`font-display font-bold tracking-[0.18em] ${te===null?"whitespace-nowrap":"whitespace-normal"}`,style:{fontSize:xe,lineHeight:1},"aria-label":h,children:[h,kt("span",{className:"text-accent",children:"."})]}),O&&kt("img",{ref:U,src:O,alt:h,width:he,height:D,className:"shrink-0 object-contain",style:{...ae?{height:`${D}px`,width:"auto",...f?{maxWidth:"100cqi"}:{}}:{display:"none"},...K?{filter:Dn}:{}},onLoad:()=>ee(O),onError:()=>J(E=>E+1)},O)]})}import{Children as Un,isValidElement as $n,useEffect as Rt,useId as qn,useLayoutEffect as Hn,useRef as Y,useState as Mt}from"react";var we=(e,t)=>!!e[t]&&!e[t].disabled;function $e(e,t,n){let r=e.length;for(let o=1;o<=r;o++){let i=((t+n*o)%r+r)%r;if(we(e,i))return i}return t}function qe(e,t){return $e(e,t===1?-1:e.length,t)}function He(e,t){return we(e,t)?t:Math.max(qe(e,1),0)}function Nt(e,t,n){let{open:r,focus:o}=e,i=s=>({...e,...s});if(t.length===1&&/\S/.test(t)){let s=e.typed+t.toLowerCase(),l=n.findIndex((c,u)=>we(n,u)&&c.label.toLowerCase().startsWith(s));return{state:i({open:!0,typed:s,focus:l>=0?l:o}),handled:!0}}if(!r)return t==="ArrowDown"||t==="ArrowUp"||t==="Enter"||t===" "?{state:i({open:!0,typed:""}),handled:!0}:{state:e,handled:!1};switch(t){case"ArrowDown":return{state:i({focus:$e(n,o,1)}),handled:!0};case"ArrowUp":return{state:i({focus:$e(n,o,-1)}),handled:!0};case"Home":return{state:i({focus:qe(n,1)}),handled:!0};case"End":return{state:i({focus:qe(n,-1)}),handled:!0};case"Enter":case" ":return we(n,o)?{state:i({open:!1,typed:""}),commit:o,refocus:!0,handled:!0}:{state:e,handled:!0};case"Escape":return{state:i({open:!1,typed:""}),refocus:!0,handled:!0};case"Tab":return{state:i({open:!1,typed:""}),handled:!1};default:return{state:e,handled:!1}}}import{Fragment as Vn,jsx as z,jsxs as Dt}from"react/jsx-runtime";function Kn({items:e,value:t,onPick:n,open:r,onOpen:o,onClose:i}){let[s,l]=Mt(!1),c=r!==void 0,u=c?r:s,[m,f]=Mt(0),P=Y({text:"",timer:0}),w=Y(null),h=Y(null),C=Y(null),L=qn(),_=Y(null),M=e.findIndex(b=>b.value===t),x=b=>{b!==u&&(c||l(b),b?o?.():i?.())},I=b=>{let v=e[b];!v||v.disabled||(n(v.value),x(!1),h.current?.focus())},S=b=>{let v={open:u,focus:u?m:He(e,M),typed:P.current.text},d=Nt(v,b,e);return!d.handled&&d.state.open===u?!1:(d.state.typed!==v.typed&&(P.current.text=d.state.typed,window.clearTimeout(P.current.timer),P.current.timer=window.setTimeout(()=>{P.current.text=""},500)),f(d.state.focus),d.commit!==void 0?I(d.commit):x(d.state.open),d.refocus&&h.current?.focus(),d.handled)},H=Y(S);H.current=S;let W=Y(()=>x(!1));W.current=()=>x(!1);let j=b=>{u||(_.current=b.nativeEvent,H.current(b.key)&&b.preventDefault())};return Rt(()=>{if(!u)return;let b=d=>{w.current?.contains(d.target)||W.current()},v=d=>{d!==_.current&&H.current(d.key)&&d.preventDefault()};return document.addEventListener("mousedown",b),document.addEventListener("keydown",v),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",v)}},[u]),Rt(()=>{u&&(P.current.text||f(He(e,M)))},[u]),Hn(()=>{if(!u||!C.current)return;C.current.children.item(m)?.scrollIntoView({block:"nearest"})},[m,u]),{open:u,toggle:()=>x(!u),close:()=>x(!1),focusIdx:m,setFocusIdx:f,pick:b=>I(e.findIndex(v=>v.value===b)),wrapRef:w,triggerRef:h,listRef:C,listId:L,onTriggerKeyDown:j,activeId:u?`${L}-${m}`:void 0}}var Wn={select:{list:"absolute left-0 top-full z-50 mt-1 max-h-[280px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:(e,t,n)=>["px-3 py-2.5 font-mono text-[13px] font-semibold uppercase tracking-[0.1em] transition-colors whitespace-nowrap",n?"cursor-not-allowed opacity-40":"cursor-pointer",e&&!n?"bg-accent text-bg":"bg-bg text-fg"].join(" ")},cell:{list:"absolute left-0 top-full z-50 mt-1 max-h-[320px] w-max min-w-full overflow-y-auto border-2 border-accent bg-bg shadow-xl",item:e=>["cursor-pointer whitespace-nowrap px-6 py-3 font-mono text-[length:var(--size-label,13px)] font-semibold uppercase tracking-[0.1em] transition-colors",e?"bg-accent text-bg":"bg-bg text-fg"].join(" "),pickerMarker:!0},hairline:{list:"absolute left-0 top-full z-50 max-h-[320px] w-full overflow-y-auto border border-line bg-bg shadow-[0_6px_20px_rgba(0,0,0,0.10)]",item:(e,t)=>["flex cursor-pointer items-center justify-between gap-4 border-b border-line px-4 py-3 text-left text-[length:var(--size-body,14px)] transition-colors last:border-b-0",t?"border-fg font-medium text-fg":e?"border-fg text-fg":"text-fg-dim"].join(" "),pickerMarker:!0},region:{list:"absolute right-0 top-full z-[200] mt-2 flex min-w-[240px] flex-col border border-line bg-surface text-fg",item:(e,t,n,r)=>["flex w-full cursor-pointer items-center gap-3 px-3.5 py-3 text-left transition-colors","font-mono text-[13px] uppercase tracking-[0.18em]",e?"bg-surface-2 text-fg":"",r?"":"border-b border-line",t?"text-accent":""].join(" "),itemStyle:e=>e?void 0:{color:"color-mix(in oklab, currentColor 80%, transparent)"}}};function Bn({id:e,tone:t,items:n,value:r,focusIdx:o,onFocus:i,onPick:s,listRef:l,ariaLabel:c}){let u=Wn[t];return z("ul",{ref:l,id:e,role:"listbox","aria-label":c,...u.pickerMarker?{"data-picker-menu":""}:{},className:u.list,children:n.map((m,f)=>{let P=m.value===r;return z("li",{id:`${e}-${f}`,role:"option","aria-selected":P,"aria-disabled":m.disabled||void 0,onMouseEnter:()=>!m.disabled&&i(f),onMouseDown:w=>{w.preventDefault(),m.disabled||s(m.value)},className:u.item(f===o,P&&m.value!=="",!!m.disabled,f===n.length-1),style:u.itemStyle?.(P),children:m.meta===void 0?m.label:Dt(Vn,{children:[z("span",{className:"flex-1 whitespace-nowrap",children:m.label}),z("span",{className:"ml-auto text-[12px] opacity-50",children:m.meta})]})},`${m.value}_${f}`)})})}function zn({value:e,onChange:t,disabled:n,children:r,className:o,style:i,name:s,id:l,"aria-label":c}){let u=Un.toArray(r).flatMap(h=>{if(!$n(h))return[];if(h.type!=="option")return[];let L=h.props,_=L.value!==void 0?String(L.value):"",M=L.children,x=typeof M=="string"||typeof M=="number"?String(M):_;return[{value:_,label:x,disabled:!!L.disabled}]}),m=e??"",f=Kn({items:u,value:m,onPick:h=>t?.({target:{value:h}})}),w=u.find(h=>h.value===m)?.label??u[0]?.label??"";return Dt("div",{ref:f.wrapRef,className:"relative",children:[s&&z("input",{type:"hidden",name:s,value:m}),z("button",{ref:h=>{f.triggerRef.current=h},type:"button",disabled:n,"aria-haspopup":"listbox","aria-expanded":f.open,"aria-controls":f.open?f.listId:void 0,"aria-activedescendant":f.activeId,"aria-label":c,id:l,onClick:()=>!n&&f.toggle(),onKeyDown:h=>!n&&f.onTriggerKeyDown(h),className:`block w-full ${o??""}`,style:i,children:z("span",{className:"block w-full truncate text-left",children:w})}),f.open&&z(Bn,{id:f.listId,tone:"select",items:u,value:m,focusIdx:f.focusIdx,onFocus:f.setFocusIdx,onPick:f.pick,listRef:f.listRef})]})}var _o="#c9a461",Ot=[{f:"black",label:"Black",hex:"#171717"},{f:"silver",label:"Silver",hex:"#cccccc"},{f:"bronze",label:"Bronze",hex:"#8a6438"},{f:"graphite",label:"Graphite",hex:"#3a3c3f"},{f:"red",label:"Candy Red",hex:"#7a0f14"}],ko={name:"",color:"var(--fg)",family:"silver",src:""};function Gn(e,t){let n=r=>{let o=Ot.findIndex(i=>i.f===r);return o===-1?Ot.length:o};return n(e)-n(t)||e.localeCompare(t)}function Ao(e){let t=new Set;for(let n of e)for(let r of n.finishes??[])r?.family&&t.add(r.family);return[...t].sort(Gn)}import{jsx as be,jsxs as Yn}from"react/jsx-runtime";function Xn({spokes:e,mesh:t=!1,className:n}){let s=c=>Math.round(c*1e3)/1e3,l=[];for(let c=0;c<e;c++){let u=c/e*Math.PI*2-Math.PI/2;if(l.push({x1:s(100+Math.cos(u)*22),y1:s(100+Math.sin(u)*22),x2:s(100+Math.cos(u)*86),y2:s(100+Math.sin(u)*86),main:!0}),t){let m=u+Math.PI/e;l.push({x1:s(100+Math.cos(m)*22*1.4),y1:s(100+Math.sin(m)*22*1.4),x2:s(100+Math.cos(m)*78),y2:s(100+Math.sin(m)*78),main:!1})}}return Yn("svg",{viewBox:"0 0 200 200",fill:"none",stroke:"currentColor",className:n??"block h-[70%] w-[70%] transition-transform duration-700 [transition-timing-function:cubic-bezier(.2,.6,.2,1)]",children:[be("circle",{cx:100,cy:100,r:92,strokeWidth:2}),be("circle",{cx:100,cy:100,r:84,strokeWidth:1,opacity:.4}),be("circle",{cx:100,cy:100,r:22,strokeWidth:2}),be("circle",{cx:100,cy:100,r:6,fill:"currentColor"}),l.map((c,u)=>be("line",{x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:"currentColor",strokeWidth:c.main?6:3,strokeLinecap:"round",opacity:c.main?1:.5},u))]})}import{useState as jn}from"react";import{jsx as se,jsxs as Ke}from"react/jsx-runtime";function Qn({customerEmail:e}){let{coupon:t,applyCoupon:n,removeCoupon:r,couponBusy:o}=Pt(),[i,s]=jn("");async function l(){o||!i.trim()||(await n(i,e),s(""))}return Ke("div",{className:"flex flex-col gap-2",children:[t===null?Ke("div",{className:"flex border border-line",children:[se("input",{type:"text",value:i,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),l())},placeholder:"Coupon code","aria-label":"Coupon code",className:"flex-1 bg-transparent px-3.5 py-3.5 font-mono text-[11px] uppercase tracking-[0.18em] text-fg outline-none placeholder:text-fg-dim"}),se("button",{type:"button",onClick:()=>{l()},disabled:o,className:"border-l border-line px-4 font-mono text-[10px] uppercase tracking-[0.26em] text-btn transition-colors hover:bg-btn hover:text-btn-ink disabled:cursor-wait disabled:opacity-60",children:o?"\u2026":"Apply"})]}):Ke("div",{className:["flex items-center justify-between gap-3 border px-3.5 py-3",t.valid?"border-accent":"border-line"].join(" "),style:t.valid?{background:"color-mix(in oklab, var(--accent) 8%, transparent)"}:void 0,children:[se("span",{className:["font-mono text-[11px] uppercase tracking-[0.22em]",t.valid?"text-accent":t.deferred?"text-fg":"text-fg-dim line-through"].join(" "),children:t.code}),se("button",{type:"button",onClick:r,"aria-label":`Remove coupon ${t.code}`,className:"font-mono text-[12px] text-fg-dim transition-colors hover:text-fg",children:"\u2715"})]}),t?.deferred?se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-fg-dim",children:mt}):t&&!t.valid&&t.message&&se("p",{className:"font-mono text-[10px] uppercase tracking-[0.18em] text-alert",children:t.message})]})}function qo(){let e=typeof crypto<"u"?crypto:void 0;if(typeof e?.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(typeof e?.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<t.length;r++)t[r]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}export{mr as a,fr as b,pr as c,rt as d,Ae as e,Jn as f,Zn as g,er as h,tr as i,Bt as j,zt as k,nr as l,rr as m,Ne as n,Re as o,fe as p,Ee as q,Zt as r,De as s,hr as t,Cr as u,tn as v,xr as w,Sr as x,nn as y,vr as z,on as A,Er as B,Pr as C,pt as D,kr as E,Ar as F,Nr as G,lr as H,ut as I,Pe as J,Fe as K,Wr as L,Pt as M,io as N,Tn as O,ao as P,An as Q,Nn as R,bo as S,ho as T,Co as U,On as V,Kn as W,Bn as X,zn as Y,_o as Z,Ot as _,ko as $,Gn as aa,Ao as ba,Xn as ca,Qn as da,qo as ea};
@@ -0,0 +1,230 @@
1
+ import{a as lt,b as dt,c as ct,d as pt,e as ut,f as ft,l as gt,m as bt,p as yt,q as wt,t as kt,v as Pt,w as It,y as Tt}from"./chunk-H7O6ZYX6.js";import{Aa as ze,Ca as De,Dg as at,Fc as V,H as Me,Jc as Ve,Jh as ht,Kd as Ze,Nh as vt,Oe as Je,P as He,Q as R,R as ce,Ua as Ke,Va as pe,Wa as N,Wf as tt,Xf as me,Ya as $,Za as $e,Zh as St,_a as qe,_h as Et,bb as Ue,bf as Qe,cb as Ge,cf as et,ed as fe,eg as nt,fb as Ye,jf as J,ld as Z,ma as K,og as ot,pe as je,ph as mt,qa as Be,sa as We,ud as j,vg as rt,ya as _,yg as he,zg as ge}from"./chunk-BJOS4Y35.js";import{b as ue}from"./chunk-HVOO2GNE.js";import{B as Xe,La as X,Oa as it,Pa as st}from"./chunk-IFRGL3GL.js";import{d as de}from"./chunk-6CP4D6VJ.js";import{InspectorHead as cn,InspectorIconButton as Nt}from"efficient-easel/chrome";import{jsx as Rt,jsxs as dn}from"react/jsx-runtime";function Q({side:e}){return dn("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,children:[Rt("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),Rt("path",{d:e==="left"?"M9 4v16":"M15 4v16"})]})}import{Fragment as Ct,jsx as P,jsxs as xt}from"react/jsx-runtime";function pn({icon:e,title:t,context:n,actions:o,side:s="left",onHide:r}){return P(cn,{icon:e,name:t,kind:n,actions:o||r?xt(Ct,{children:[o,r?P(ee,{side:s,onHide:r,divider:!!o}):null]}):void 0})}function ee({side:e,onHide:t,divider:n=!1}){return xt(Ct,{children:[n?P("span",{className:"sf-head-divider","aria-hidden":"true"}):null,P(Nt,{label:`Hide the ${e} panel`,title:"Hide panel",onClick:t,children:P(Q,{side:e})})]})}function _o({side:e,onShow:t}){return P("div",{className:`es-sidepanel es-sidepanel--${e} sf-panel-strip`,children:P(Nt,{label:`Show the ${e} panel`,title:"Show panel",onClick:t,children:P(Q,{side:e})})})}function Mo({label:e,onClick:t,description:n}){return P("button",{type:"button",className:"es-btn-ghost sf-head-textbtn",onClick:t,title:n,children:e})}var te="Flex",un={FooterMenu:"MenuBlock",FooterEmailSignup:"EmailFormBlock",FooterSocial:"SocialLogosBlock"},fn=e=>{let{id:t,...n}=e;return n},Ot=e=>typeof e=="string"?e:"";function Lt(e,t){let n=e.props??{},o=un[e.type];if(o)return[t(o,fn(n))];switch(e.type){case"FooterLogo":{let s=t("LogoBlock",n.reverse?{reverse:n.reverse}:{}),r=Ot(n.tagline).trim();return r?[s,t("Text",{text:r,tone:"dim",align:n.align==="center"?"center":"left"})]:[s]}case"FooterText":return[t("Text",{text:Ot(n.text),tone:typeof n.tone=="string"?n.tone:"default"})];case"FooterDivider":return[t("Divider")];case"FooterGroup":{let s=Array.isArray(n.blocks)?n.blocks:[];return[t(te,{direction:n.direction==="horizontal"?"row":"column",content:s.flatMap(r=>Lt(r,t))})]}default:return[]}}function At(e,t,n){let s=(e&&Array.isArray(e.props?.blocks)?e.props.blocks:[]).flatMap(p=>{let d=Lt(p,t);return d.length<=1?d:[t(te,{direction:"column",content:d})]}),r=t(te,{direction:"row",wrap:!0,share:"equal",content:s}),l=t(te,{direction:"column",content:[t("LegalLineBlock")]});return Be(K,n,[r,l])}import{MediaPanelHead as mn,mediaPickKind as hn}from"efficient-easel/chrome";import{Fragment as bn,jsx as be,jsxs as yn}from"react/jsx-runtime";function gn({panel:e,pick:t,onHide:n}){let o=yt();return yn(bn,{children:[be(mn,{context:o,pick:t?{kind:hn(t.accept),field:t.title||void 0}:null,onCancel:()=>t&&fe(t.requestId,null),onHide:n}),be("div",{className:"sf-media-panel",children:be(e,{pick:t,onPick:s=>t&&fe(t.requestId,s)})})]})}import{DEFAULT_PANEL_W as wn,clampPanelWidth as vn}from"efficient-easel/chrome";import{MAX_PANEL_W as Jo,MIN_PANEL_W as Qo,panelWidthVars as er}from"efficient-easel/chrome";var Yo="sf-editor-panel-widths",Xo={...wn},Vo=e=>vn(e);import{useState as so}from"react";import{useEasel as ao}from"efficient-easel/easel";import{InspectorHead as lo,InspectorIconButton as qt}from"efficient-easel/chrome";import{DuplicateIcon as co,TrashIcon as po}from"efficient-easel/icons";function Ft(e,t){if(!t)return null;let n=e.components?.[t.type],o=n?.fields??null;if(!o||typeof n?.resolveFields!="function")return o;try{let s=n.resolveFields({type:t.type,props:t.props},{fields:o,lastFields:o,lastData:null,changed:{},parent:null,appState:{}});return!s||typeof s.then=="function"?o:s}catch{return o}}import{useEffect as kn,useId as Sn,useState as En}from"react";import{SettingsField as Pn,SettingsSwitch as In}from"efficient-easel/panel";import{TypeIcon as Tn}from"efficient-easel/icons";import{Fragment as xn,jsx as v,jsxs as _t}from"react/jsx-runtime";var Rn="Chat with us",Nn="We usually reply within a few minutes",Cn="Hi! Ask us anything \u2014 about a wheel, an order, or fitment. Leave your details and we\u2019ll reply.";function ye({label:e,value:t,placeholder:n,onCommit:o,multiline:s=!1}){let[r,l]=En(t);kn(()=>l(t),[t]);let p=()=>{r!==t&&o(r)};return v(Pn,{label:e,icon:v(Tn,{}),children:s?v("textarea",{value:r,placeholder:n,rows:3,onChange:d=>l(d.target.value),onBlur:p,"aria-label":e}):v("input",{type:"text",value:r,placeholder:n,onChange:d=>l(d.target.value),onBlur:p,onKeyDown:d=>{d.key==="Enter"&&d.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function we(){let{chat:e,setChat:t}=rt(),n=Sn();return _t(xn,{children:[_t("div",{className:"sf-field sf-field--row",children:[v("span",{id:n,className:"sf-field-label sf-field-label--inline",children:"Show the chat bubble"}),v(In,{checked:e.enabled,onChange:o=>t({enabled:o}),ariaLabelledBy:n})]}),v("p",{className:"sf-field-hint",children:e.enabled?"The floating chat bubble shows in the corner of every page.":"The chat bubble is hidden across the whole site."}),v(J,{label:"Wording"}),v(ye,{label:"Title",value:e.title,placeholder:Rn,onCommit:o=>t({title:o})}),v(ye,{label:"Subtitle",value:e.subtitle,placeholder:Nn,onCommit:o=>t({subtitle:o})}),v(ye,{label:"Greeting message",value:e.greeting,placeholder:Cn,onCommit:o=>t({greeting:o}),multiline:!0}),v("p",{className:"sf-field-hint",children:"Leave a field blank to use the built-in wording."})]})}import{useEffect as On,useId as Mt,useState as Ht}from"react";import{SettingsField as Ln}from"efficient-easel/panel";import{Fragment as ve,jsx as x,jsxs as Bt}from"react/jsx-runtime";var An={instagram:"instagram.com/yourshop",facebook:"facebook.com/yourshop",tiktok:"tiktok.com/@yourshop",youtube:"youtube.com/@yourshop",x:"x.com/yourshop",linkedin:"linkedin.com/company/yourshop",pinterest:"pinterest.com/yourshop",whatsapp:"wa.me/61400000000"};function Fn({platform:e}){let{rows:t,saveLink:n}=he(),{value:o,error:s}=t[e],[r,l]=Ht(o),[p,d]=Ht(!1),h=Mt(),i=Mt();On(()=>l(o),[o]);let f=async()=>{if(r.trim()===o){r!==o&&l(o);return}d(!0),await n(e,r),d(!1)},b=st[e];return Bt(ve,{children:[x(Ln,{label:b,htmlFor:h,icon:x(vt,{platform:e,iconStyle:"outline",size:18}),children:x("input",{id:h,type:"text",inputMode:"url",value:r,placeholder:An[e],onChange:g=>l(g.target.value),onBlur:()=>{f()},onKeyDown:g=>{g.key==="Enter"&&g.currentTarget.blur(),g.key==="Escape"&&(l(o),g.currentTarget.blur())},"aria-invalid":s?!0:void 0,"aria-describedby":s?i:void 0,"aria-busy":p||void 0,autoComplete:"off",spellCheck:!1})}),s&&x("p",{id:i,className:"sf-note sf-note--error",role:"alert",children:s})]})}function ke({unavailable:e}){let{canSave:t}=he();return!t&&e?x(ve,{children:e}):Bt(ve,{children:[x("p",{className:"sf-field-hint",children:"Paste a link to each profile. A platform left empty shows nothing on the site."}),it.map(n=>x(Fn,{platform:n},n))]})}import{useId as _n,useMemo as Mn}from"react";import{useEasel as Hn}from"efficient-easel/easel";import{SettingsField as Bn,SettingsSwitch as Wn}from"efficient-easel/panel";import{jsx as M,jsxs as Wt}from"react/jsx-runtime";var zn="root:default-zone";function Se({heroId:e}){let{appState:t,dispatch:n}=Hn(i=>i),o=t.data.content??[],s=o.findIndex(i=>i.props.id===e),r=s>=0?o[s]:null,l=r?r.props.showTicker??!0:!0,p=Mn(()=>{let i=r?.props.tickerItems;return Array.isArray(i)?i:ht.map(f=>({text:f}))},[r]),d=_n();if(!r)return M("div",{className:"sf-field",style:{color:"var(--sf-muted)",fontSize:12},children:"This ticker\u2019s hero is no longer on the page."});let h=i=>n({type:"replace",destinationZone:zn,destinationIndex:s,data:{...r,props:{...r.props,...i}}});return Wt("div",{children:[M(J,{label:"Ticker"}),Wt("div",{className:"sf-field sf-field--row",children:[M("span",{id:d,className:"sf-field-label sf-field-label--inline",children:"Show ticker"}),M(Wn,{checked:l,onChange:i=>h({showTicker:i}),ariaLabelledBy:d})]}),M(Bn,{label:me.label,icon:me.icon,children:M(tt,{items:p,placeholder:"item",onChange:i=>h({tickerItems:i}),markup:!0})})]})}import{useCallback as Dn,useEffect as Kn,useRef as $n,useState as H}from"react";import{createPortal as qn}from"react-dom";import{InspectorIconButton as Un}from"efficient-easel/chrome";import{CopyToPageIcon as Gn}from"efficient-easel/icons";import{Fragment as zt,jsx as S,jsxs as ne}from"react/jsx-runtime";function Ee({node:e,currentSlug:t,siteId:n,tokenRef:o,runAuthed:s,onNotify:r}){let[l,p]=H(!1),[d,h]=H(null),i=V(),[f,b]=H(!1),[g,y]=H(null),O=$n(null),[T,re]=H(null),[a,U]=H(null),ie=Dn(async()=>{if(i.usesBridgedToken&&!o.current){b(!0);return}try{h(await de(i).pages.list(n?{siteId:n}:void 0))}catch{b(!0)}},[o,n,i]),E=()=>{if(l){p(!1);return}let u=O.current?.getBoundingClientRect();u&&re({top:u.bottom+6,right:Math.max(8,window.innerWidth-u.right)}),U(O.current?.closest(".sf-editor")??document.body),h(null),b(!1),ie(),p(!0)};Kn(()=>{if(!l)return;let u=m=>{m.key==="Escape"&&p(!1)};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[l]);let G=(d??[]).filter(u=>u.slug!==t),se=async u=>{if(g)return;y(u.slug);let m=kt(e),w=i.documentHooks?.storedNode?.(m)??m,W=de(i).pages,z=await s(async()=>{let L=await W.load({id:u.id});if(!L)throw new Error(`Page "${u.slug}" no longer exists.`);let A=L.layout??{},F=Array.isArray(A.content)?[...A.content]:[],Y=F.findIndex(ae=>ae?.type===R);F.splice(Y===-1?F.length:Y,0,w),await W.save(u.id,{layout:{root:{},zones:{},...A,content:F}},{version:L.version,clientId:""})});y(null),p(!1),r?.(z?`Duplicated to \u201C${u.label}\u201D`:"Couldn\u2019t duplicate the section \u2014 please retry",z?"success":"error")};return ne(zt,{children:[S(Un,{buttonRef:O,label:"Duplicate to another page",hasPopup:"menu",expanded:l,onClick:E,children:S(Gn,{size:15})}),l&&T&&a&&qn(ne(zt,{children:[S("div",{className:"sf-dupmenu-backdrop",onClick:()=>p(!1)}),ne("div",{className:"sf-dupmenu",role:"menu",style:{top:T.top,right:T.right},children:[S("div",{className:"sf-dupmenu-head",children:"Duplicate to page\u2026"}),f?S("div",{className:"sf-dupmenu-empty",children:"Couldn\u2019t load pages"}):d===null?S("div",{className:"sf-dupmenu-empty",children:"Loading\u2026"}):G.length===0?S("div",{className:"sf-dupmenu-empty",children:"No other pages"}):G.map(u=>ne("button",{type:"button",role:"menuitem",className:"sf-dupmenu-item",disabled:g!==null,onClick:()=>se(u),children:[S("span",{className:"sf-dupmenu-name",children:u.label}),g===u.slug?S("span",{className:"sf-note",children:"Copying\u2026"}):u.draft&&S("span",{className:"sf-note",children:"draft"})]},u.id))]})]}),a)]})}import{SettingsDrill as Yn}from"efficient-easel/panel";import{jsx as q,jsxs as Zn}from"react/jsx-runtime";var Xn="Not shown on the page";function Vn({part:e,onOpen:t}){return q(Yn,{name:e.label,preview:e.offPage?Xn:e.preview||"Empty",offPage:e.offPage,status:e.hidden?q("span",{className:"sf-entry-eye",role:"img","aria-label":"Hidden on the page",children:q(je,{name:"eye-off",size:14})}):void 0,onOpen:()=>t(e.key)})}function Dt({parts:e,onOpen:t}){let n=e.filter(o=>!o.identifier);return n.length?Zn("div",{className:"sf-entries",children:[q("h3",{className:"sf-entries-head",children:"Text"}),n.map(o=>q(Vn,{part:o,onOpen:t},o.key))]}):null}import{useState as jn}from"react";import{createNode as Jn,newId as Qn}from"efficient-easel/data";import{useEasel as eo}from"efficient-easel/easel";import{jsx as oe,jsxs as Kt}from"react/jsx-runtime";function Pe(){let{appState:e,dispatch:t,config:n}=eo(i=>i),{readOnly:o}=Z(),[s,r]=jn(!1),l=e.data.content;if(o||l.some(i=>i.type===K))return null;let p=l.find(i=>i.type===R)??null,d=(i,f)=>Jn(n,i,f);return Kt("div",{className:"sf-box-footer-switch",children:[oe("p",{className:"sf-box-footer-switch-text",children:"Build this footer out of Boxes and blocks, like a page: the same menus, signup, social links and logo, with the copyright as a Legal Line. Your current footer is kept."}),s?Kt("div",{className:"sf-box-footer-switch-row",children:[oe("button",{type:"button",className:"es-btn-primary",onClick:()=>{let i=At(p,d,Qn(K));t({type:"setData",data:f=>({...f,content:[...We(f.content,i)]}),recordHistory:!0}),r(!1)},children:"Switch now"}),oe("button",{type:"button",className:"es-btn-ghost",onClick:()=>r(!1),children:"Cancel"})]}):oe("button",{type:"button",className:"es-btn-ghost",onClick:()=>r(!0),children:"Switch to Box footer"})]})}import{useState as to}from"react";import{useSelectedFields as no}from"efficient-easel/easel";import{Inspector as oo,planFields as ro}from"efficient-easel/fields";import{jsx as $t}from"react/jsx-runtime";var Ie=new Map,io=Object.fromEntries(nt.map(e=>{let t=Qe[e];return[e,$t(t,{},e)]}));function Te({entries:e}){let{id:t,fields:n,values:o,readOnly:s,onChange:r}=no(),[l,p]=to(()=>Ie.get(t)),d=Ie.get(t),h=ro(n).buckets,i=d&&h.includes(d)?d:l&&h.includes(l)?l:h[0],f=i===void 0||et(h,i)!==!0;return $t(oo,{fields:n,values:o,onChange:r,readOnly:s,tab:i,onTab:b=>{Ie.set(t,b),p(b)},tabIcons:io,idPrefix:t,ariaLabel:"Section settings",children:f?e:null})}import{SettingsSwitch as uo}from"efficient-easel/panel";import{Fragment as Re,jsx as c,jsxs as I}from"react/jsx-runtime";var Ne={kind:"puck"},Fi={kind:"header"},_i={kind:"website"},Mi={kind:"chat"},Hi={kind:"social"},B="Part";function fo(e,t,n){let o=e.describeNode(t);return{name:n,kindLabel:o?`${B} of ${o.label}`:B}}function Ut({what:e}){return I("div",{className:"sf-note",children:[c("p",{children:I("strong",{children:[e," settings belong to a website."]})}),I("p",{children:["A template is a blueprint \u2014 it has no website of its own, so there is nothing here to change. Each website created from this template sets its own ",e.toLowerCase()," afterwards."]})]})}var mo={header:{name:"Header",kindLabel:"Site settings",icon:"header",render:(e,t)=>{let n=t.hostPanels?.header;return n?c(n,{placeholderMode:t.capabilities.placeholderFrames,tokenRef:t.tokenRef,siteId:t.siteId,websiteName:t.websiteName,onOpenWebsiteSettings:t.onOpenWebsiteSettings,onAuthExpired:()=>t.notifyParent("storefront-editor:auth-expired")}):null}},website:{name:"Appearance",kindLabel:"Site settings",icon:"website",render:(e,t)=>c(wt,{themeFromDocument:!t.capabilities.hasSiteTheme,tokenRef:t.tokenRef,siteId:t.siteId,onNotify:t.onNotify})},chat:{name:"Live chat",kindLabel:"Site settings",icon:"chat",render:()=>c(we,{})},social:{name:"Social links",kindLabel:"Site settings",icon:"social",render:()=>c(ke,{unavailable:c(Ut,{what:"Social link"})})},ticker:{name:ge,kindLabel:B,icon:"ticker",head:(e,t)=>e.kind==="ticker"?fo(t,e.heroId,ge):null,render:e=>c(Se,{heroId:e.kind==="ticker"?e.heroId:""})},part:{name:B,kindLabel:B,icon:"Text",head:(e,t)=>{if(e.kind!=="part")return null;let n=t.describeNode(e.nodeId);if(!n)return null;let{key:o,row:s}=De(e.propKey),r=s?lt(n.fields[o],s):n.fields[o],l=Ke(Ge(Ue(r??{},o)),s);return{name:t.styleNameOfPart(e.nodeId,e.propKey)??l,kindLabel:`${B} of ${n.label}`}},render:(e,t)=>e.kind==="part"?c(ft,{nodeId:e.nodeId,propKey:e.propKey,onBack:()=>t.onSelectNode(e.nodeId),onEditStyle:t.onOpenSiteStyles}):null}},ho=new Set(["header","website","chat"]);function go(e,t){if(e==="puck")return null;let n=mo[e];return ho.has(e)&&!t.hasSiteSettings?{...n,kindLabel:"Not part of a template",render:()=>c(Ut,{what:n.name})}:n}function bo({mode:e,onOpenWebsiteSettings:t,onOpenSiteStyles:n,onSelectNode:o,hideNodeActions:s=!1,onNotify:r,onHidePanel:l}){let{capabilities:p,tokenRef:d,notifyParent:h,currentSlug:i,siteId:f,runAuthed:b}=Z(),{websiteName:g,fonts:y}=X(),{partStyle:O}=ze(),T=j(),{select:re}=_(),{selectedItem:a,getItemById:U,getSelectorForId:ie,config:E,appState:G}=ao(k=>k),se=Ft(E,a?{type:a.type,props:a.props}:null),u=k=>E.components[k]?.label??k,m=a?ie(a.props.id):void 0,w=go(e.kind,p),W=V(),z=W.chrome?.panels?.chromePage,L={capabilities:p,tokenRef:d,hostPanels:W.chrome?.panels,describeNode:k=>{let C=U(k);if(!C)return null;let D=E.components[C.type];return{type:C.type,label:D?.label??C.type,fields:D?.fields??{}}},styleNameOfPart:(k,C)=>{let D=U(k);if(!D)return null;let an=$(k,C),ln=O?.partId===an?O:null;return pt(D.props,C,ln,y)},siteId:f,websiteName:g??null,notifyParent:h,onNotify:r,onOpenWebsiteSettings:t,onOpenSiteStyles:n,onSelectNode:o},A=w?.head?.(e,L)??null,F=A?.name??(w?w.name:a?u(a.type):"Page settings"),Y=A?.kindLabel??(w?w.kindLabel:a?m&&m.zone!==ce?"Block":"Section":"Page"),ae=w?w.icon:a?a.type:"page",Oe=w?null:a?E.components[a.type]?.fields??null:E.root?.fields??null,Qt=Oe?ot(Oe):2,Le=e.kind==="puck"&&a?ct(a.type):null,en=!!a&&!!m&&m.zone===ce&&a.type!==R&&a.type!==He,le=Me(G?.data,a),tn=()=>{le||m&&T.duplicateComponent(m.zone,m.index)},nn=()=>{m&&(T.removeComponent(m.zone,m.index),T.select(null))},on=a?E.components[a.type]?.defaultProps?.previewHover:void 0,Ae=e.kind==="puck"&&!!a&&!!m&&on!==void 0,Fe=Ae&&a.props.previewHover===!0,rn=()=>{!a||!m||T.replaceComponent(m.zone,m.index,{...a,props:{...a.props,previewHover:!Fe}})},[_e,sn]=so(gt);return I("div",{className:`es-sidepanel es-sidepanel--right sf-panel sf-panel--right${_e?"":" sf-hints-folded"}`,children:[c(lo,{icon:c(at,{type:ae,size:15}),name:F,kind:Y,actions:!s&&e.kind==="puck"&&a&&a.type!==R?I(Re,{children:[c(qt,{label:"Duplicate section",title:le??void 0,disabled:le!==null,onClick:tn,children:c(co,{size:15})}),en&&p.hasSiteSettings&&c(Ee,{node:a,currentSlug:i,siteId:f??void 0,tokenRef:d,runAuthed:b,onNotify:r}),c(qt,{label:"Remove section",danger:!0,onClick:nn,children:c(po,{size:15})}),l?c(ee,{side:"right",onHide:l,divider:!0}):null]}):l?c(ee,{side:"right",onHide:l}):void 0}),Ae&&I("div",{className:"sf-preview-pin",children:[I("div",{className:"sf-preview-pin-text",children:[c("span",{className:"sf-preview-pin-label",children:"Preview hover state"}),c("span",{className:"sf-preview-pin-hint",children:"not shown live"})]}),c(uo,{checked:Fe,onChange:rn,ariaLabel:"Preview hover state"})]}),c(Je,{tier:Qt,children:c("div",{className:"sf-insp-body sf-scroll",children:w?w.render(e,L):a?I(Re,{children:[c(Ze,{children:c(Te,{entries:c(Dt,{parts:Ye(se??E.components[a.type]?.fields,a.props),onOpen:k=>re($(a.props.id,k))})})}),a.type===R&&p.hasSiteSettings&&c(Pe,{}),Le&&c(ut,{source:Le,slug:dt(a?.props)}),c(bt,{shown:_e,onChange:sn})]}):I(Re,{children:[c(Te,{}),i===Ve&&p.hasSiteSettings&&z&&c(z,{})]})})})]})}import{useCallback as Gt,useEffect as Yt}from"react";import{useEasel as yo}from"efficient-easel/easel";function Gi({mode:e,setMode:t,onOpenPart:n}){let{getSelectorForId:o}=yo(i=>i),s=j(),{setSelectedPartId:r,setSelectHandler:l}=_(),p=Gt(i=>{let f=$e(i);if(!f)return;let{nodeId:b,propKey:g}=f;if(!g){t(y=>y.kind==="part"?Ne:y);return}t(y=>y.kind==="part"&&y.nodeId===b&&y.propKey===g?y:{kind:"part",nodeId:b,propKey:g}),n?.(b)},[t,n]);Yt(()=>{l(p)},[l,p]);let d=e.kind==="part"?$(e.nodeId,e.propKey):null;return Yt(()=>{r(d)},[d,r]),{selectNode:Gt(i=>{t(()=>Ne);let f=o(i);f&&s.select(f)},[t,o,s]),openPartId:d}}import{useEffect as Xt,useState as wo}from"react";import{bindUndoKeys as vo,useEaselApi as ko}from"efficient-easel/easel";function So(e){let t=ue(),[n,o]=wo(null);return Xt(()=>o(e.current),[e]),t.ownsDocument?typeof document>"u"?null:document:n}function ji(e){let t=ue(),n=ko(),o=So(e);Xt(()=>{if(!(t.ownsDocument||!o))return vo(o,n)},[t,n,o])}import{EaselCanvas as Co}from"efficient-easel/easel";import{useEffect as Zt,useLayoutEffect as Io}from"react";var Eo=String.raw`(function (doc) {
2
+ if (doc.__sfFitWords) return;
3
+ var win = doc.defaultView;
4
+ var SELECTOR = "h1,h2,h3,h4,h5,h6,[class*='font-heading'],[class*='font-display']";
5
+ var MIN_SCALE = 0.3, MIN_PX = 16, SLACK = 1;
6
+
7
+ function measure(el) {
8
+ var widest = 0, current = 0, last = null, split = false, lastBlock = null;
9
+ function blockOf(n) {
10
+ for (var p = n.parentElement; p && p !== el; p = p.parentElement) {
11
+ var d = win.getComputedStyle(p).display;
12
+ if (d.indexOf("inline") !== 0 && d !== "contents") return p;
13
+ }
14
+ return el;
15
+ }
16
+ function close() { if (current > widest) widest = current; current = 0; last = null; }
17
+ var walker = doc.createTreeWalker(el, 5), range = doc.createRange(), node;
18
+ while ((node = walker.nextNode())) {
19
+ if (node.nodeType === 1) {
20
+ if (node.tagName === "BR" || node.tagName === "WBR") close();
21
+ continue;
22
+ }
23
+ var block = blockOf(node);
24
+ if (block !== lastBlock) close();
25
+ lastBlock = block;
26
+ var re = /(\S+)|(\s+)/g, m;
27
+ while ((m = re.exec(node.data))) {
28
+ if (m[2]) { close(); continue; }
29
+ range.setStart(node, m.index);
30
+ range.setEnd(node, m.index + m[0].length);
31
+ var rects = range.getClientRects();
32
+ for (var i = 0; i < rects.length; i++) {
33
+ var r = rects[i];
34
+ if (r.width <= 0) continue;
35
+ current += r.width;
36
+ if (last && r.top > last.top + last.height / 2) split = true;
37
+ last = r;
38
+ }
39
+ }
40
+ }
41
+ close();
42
+ return { widest: widest, split: split };
43
+ }
44
+
45
+ function lineWidth(el) {
46
+ var cs = win.getComputedStyle(el);
47
+ return el.getBoundingClientRect().width - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight)
48
+ - parseFloat(cs.borderLeftWidth) - parseFloat(cs.borderRightWidth);
49
+ }
50
+
51
+ // ⚠️ THE HEADING ELEMENT IS NEVER TOUCHED — no style="", no data-*. This
52
+ // runs before React hydrates, and React 19 in development reports ANY
53
+ // attribute that differs from what it rendered ("a tree hydrated but some
54
+ // attributes didn't match"): first our inline font-size on the hero (which
55
+ // React owns via --heading-size), then, when that moved to a data-sf-fit
56
+ // attribute, the attribute itself. So the fitted size lives only in this
57
+ // script's own stylesheet, in <head>, addressed to each heading by its
58
+ // POSITION (":root>*:nth-child(2)>…"). A position goes stale when the page's
59
+ // structure changes, so the rules are rewritten in the MutationObserver
60
+ // callback, which runs before the next paint. !important so the size also
61
+ // beats a part's own inline size.
62
+ var head = doc.head || doc.documentElement;
63
+ var fitEl = doc.createElement("style");
64
+ fitEl.id = "storefront-fit-words-sizes";
65
+ head.appendChild(fitEl);
66
+ var fitted = new Map(); // heading -> fitted size, e.g. "43.8px"
67
+
68
+ function pathOf(el) {
69
+ var parts = [];
70
+ for (var e = el; e && e.parentElement; e = e.parentElement) {
71
+ var i = 1, s = e;
72
+ while ((s = s.previousElementSibling)) i++;
73
+ parts.unshift("*:nth-child(" + i + ")");
74
+ }
75
+ return ":root>" + parts.join(">");
76
+ }
77
+ function writeRules() {
78
+ var css = "";
79
+ fitted.forEach(function (size, el) {
80
+ if (!el.isConnected) { fitted.delete(el); return; }
81
+ css += pathOf(el) + "{font-size:" + size + " !important}";
82
+ });
83
+ if (fitEl.textContent !== css) fitEl.textContent = css;
84
+ }
85
+
86
+ function unfit(el) {
87
+ if (fitted.delete(el)) writeRules();
88
+ }
89
+
90
+ function fits(el) {
91
+ var m = measure(el);
92
+ return !m.split && m.widest <= lineWidth(el) + SLACK;
93
+ }
94
+
95
+ function fit(el) {
96
+ unfit(el);
97
+ if (lineWidth(el) <= 0) return; // hidden, or not laid out yet
98
+ if (fits(el)) return;
99
+ var set = parseFloat(win.getComputedStyle(el).fontSize);
100
+ if (!set) return;
101
+ var floor = Math.max(set * MIN_SCALE, MIN_PX);
102
+ if (floor >= set) return;
103
+ function size(px) { return Math.floor(px * 10) / 10 + "px"; }
104
+ // The SEARCH tries sizes on the element's own style and then puts that
105
+ // attribute back byte for byte (or removes it, if it had none), so nothing
106
+ // is left for React to see. A trial in a stylesheet instead restyles the
107
+ // whole page per step: a full pass on the Hartes home took 75–160ms at 4x
108
+ // CPU that way.
109
+ var hadStyle = el.hasAttribute("style"), origStyle = el.getAttribute("style");
110
+ function attempt(px) { el.style.setProperty("font-size", size(px), "important"); }
111
+ function done() { if (hadStyle) el.setAttribute("style", origStyle); else el.removeAttribute("style"); }
112
+ attempt(floor);
113
+ if (!fits(el)) { done(); return; } // even the floor does not fit: leave it as set
114
+ var lo = floor, hi = set;
115
+ for (var i = 0; i < 8; i++) {
116
+ var mid = (lo + hi) / 2;
117
+ attempt(mid);
118
+ if (fits(el)) lo = mid; else hi = mid;
119
+ }
120
+ done();
121
+ fitted.set(el, size(lo));
122
+ writeRules();
123
+ }
124
+
125
+ // What each heading measured right after we last fitted it, so the
126
+ // ResizeObserver below can tell a real change (a font swap, a rotate, a
127
+ // container that moved) from the size change our own write just caused.
128
+ var seen = new WeakMap();
129
+ function remember(el) {
130
+ var b = el.getBoundingClientRect();
131
+ seen.set(el, b.width + "x" + b.height);
132
+ }
133
+ function fitAndRemember(el) { fit(el); remember(el); }
134
+
135
+ // ⚠️ A ResizeObserver, NOT fonts.ready or a resize event, and the reason is
136
+ // WHEN it runs: after layout, BEFORE paint. The web font arriving re-wraps a
137
+ // fitted heading, and fonts.ready resolves only after that frame is painted —
138
+ // measured on the Hartes hero: a 42px jump in 2 of 3 loads. A size change
139
+ // reported here is fitted in the same frame, so the broken state is never
140
+ // drawn. It also covers a container that resizes.
141
+ var ro = new win.ResizeObserver(function (entries) {
142
+ for (var i = 0; i < entries.length; i++) {
143
+ var el = entries[i].target;
144
+ var b = el.getBoundingClientRect();
145
+ if (seen.get(el) === b.width + "x" + b.height) continue; // our own write
146
+ fitAndRemember(el);
147
+ }
148
+ });
149
+ function watch(el) { if (!seen.has(el)) { remember(el); ro.observe(el); } }
150
+
151
+ function fitAll() {
152
+ var els = doc.querySelectorAll(SELECTOR);
153
+ for (var i = 0; i < els.length; i++) { fitAndRemember(els[i]); watch(els[i]); }
154
+ }
155
+
156
+ var queued = 0, all = false, touched = new Set();
157
+ function run() {
158
+ queued = 0;
159
+ if (all) { all = false; touched.clear(); fitAll(); return; }
160
+ var els = Array.from(touched);
161
+ touched.clear();
162
+ for (var i = 0; i < els.length; i++) if (els[i].isConnected) { fitAndRemember(els[i]); watch(els[i]); }
163
+ }
164
+ function schedule() { if (!queued) queued = win.requestAnimationFrame(run); }
165
+ function scheduleAll() { all = true; schedule(); }
166
+
167
+ fitAll();
168
+ // A backstop only: a font that changes widths without changing any
169
+ // heading's box is not seen by the ResizeObserver.
170
+ if (doc.fonts && doc.fonts.ready) doc.fonts.ready.then(scheduleAll, function () {});
171
+
172
+ // …and the viewport WIDTH, which the ResizeObserver cannot stand in for: a
173
+ // heading sized to its own text (fit-content, a flex item) keeps the SAME box
174
+ // when the phone turns to 844, so nothing reports a change and it would stay
175
+ // shrunk. The probe's rotate check caught exactly that.
176
+ var lastWidth = win.innerWidth;
177
+ function onResize() {
178
+ if (win.innerWidth === lastWidth) return; // a phone's toolbar changing HEIGHT is not our business
179
+ lastWidth = win.innerWidth;
180
+ scheduleAll();
181
+ }
182
+ win.addEventListener("resize", onResize);
183
+
184
+ var mo = new win.MutationObserver(function (records) {
185
+ // Positions first: a node added or removed anywhere can shift the
186
+ // nth-child path of a fitted heading, and this callback runs before paint.
187
+ if (fitted.size) {
188
+ for (var q = 0; q < records.length; q++) if (records[q].type === "childList") { writeRules(); break; }
189
+ }
190
+ for (var i = 0; i < records.length; i++) {
191
+ var r = records[i];
192
+ var target = r.target.nodeType === 1 ? r.target : r.target.parentElement;
193
+ var own = target && target.closest(SELECTOR);
194
+ if (own) touched.add(own);
195
+ for (var j = 0; j < r.addedNodes.length; j++) {
196
+ var n = r.addedNodes[j];
197
+ if (n.nodeType !== 1) continue;
198
+ if (n.matches(SELECTOR)) touched.add(n);
199
+ var inner = n.querySelectorAll(SELECTOR);
200
+ for (var k = 0; k < inner.length; k++) touched.add(inner[k]);
201
+ }
202
+ }
203
+ if (touched.size) schedule();
204
+ });
205
+ mo.observe(doc.body, { childList: true, subtree: true, characterData: true });
206
+
207
+ doc.__sfFitWords = function stop() {
208
+ win.removeEventListener("resize", onResize);
209
+ ro.disconnect();
210
+ mo.disconnect();
211
+ if (queued) win.cancelAnimationFrame(queued);
212
+ fitted.clear();
213
+ fitEl.remove();
214
+ delete doc.__sfFitWords;
215
+ };
216
+ // For the probe and for debugging: which headings are fitted, at what size,
217
+ // and the sheet that holds it (disable it to read a heading's set size).
218
+ doc.__sfFitWords.fitted = fitted;
219
+ doc.__sfFitWords.sheet = fitEl;
220
+ })(document);`,Po="storefront-fit-words";function Vt(e){let t=e.createElement("script");return t.id=Po,t.textContent=Eo,(e.head??e.documentElement).appendChild(t),()=>{e.__sfFitWords?.(),t.remove()}}import{Fragment as Ro,jsx as jt,jsxs as No}from"react/jsx-runtime";var To=`
221
+ [${pe}][${pe}] { cursor: text; }
222
+ [${N}][${N}][${N}] {
223
+ outline: 1px solid ${mt.accent};
224
+ outline-offset: 2px;
225
+ }
226
+ [${N}][${N}]:has([${N}]),
227
+ [data-puck-overlay-portal][data-puck-overlay-portal]:has([${N}]) {
228
+ outline: none;
229
+ }
230
+ `;function Ce({children:e,document:t}){let{theme:n,themeMode:o,themeSwitchShown:s}=X(),r=Xe(n);return Zt(()=>{if(t)return St(t,{mode:o,switchShown:s})},[t,o,s]),Zt(()=>{if(t)return Et(t,r)},[t,r]),Io(()=>{if(t)return Vt(t)},[t]),No(Ro,{children:[jt(It,{}),jt("style",{children:To}),e]})}import{Fragment as Jt,jsx as xe}from"react/jsx-runtime";function xo({children:e,componentId:t}){let{selectedPartId:n}=_();return qe(n,t)?xe(Jt,{}):xe(Jt,{children:e})}function gs(e){let{mirrorHostStyles:t}=Pt(),n=Tt();return xe(Co,{...e,metadata:e.metadata??n,height:"fill",mirrorStyles:t,frameWrapper:Ce,overlay:xo})}export{pn as a,_o as b,Mo as c,At as d,gn as e,Yo as f,Xo as g,Vo as h,Jo as i,Qo as j,er as k,Ft as l,Ne as m,Fi as n,_i as o,Mi as p,Hi as q,bo as r,Gi as s,So as t,ji as u,gs as v};
@@ -1 +1 @@
1
- import{Ai as p,yi as l}from"./chunk-WQ7W4AXL.js";import{Fragment as r,useState as d}from"react";import{Fragment as b,jsx as s,jsxs as o}from"react/jsx-runtime";function g({choices:m,onPick:c,open:i,onToggle:u}){let[f,a]=d(!1),n=i??f;return o(b,{children:[o("button",{type:"button",className:"sf-add-card","aria-expanded":n,onClick:u??(()=>a(e=>!e)),children:[s("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]}),n&&s("div",{className:"sf-blockmenu",role:"menu",children:p(m).map(e=>o(r,{children:[e.group&&o("div",{className:"sf-menugroup-head",role:"presentation",children:[s("span",{className:"sf-menugroup-title",children:e.group}),s("span",{className:"sf-menugroup-count",children:e.items.length})]}),e.items.map(t=>o("button",{type:"button",className:"sf-blockmenu-item",role:"menuitem",onClick:()=>{a(!1),c(t.type)},children:[s("span",{className:"sf-chip",children:s(l,{type:t.type,size:13})}),s("span",{className:"sf-row-name",children:t.label})]},t.type))]},e.group??"all"))})]})}export{g as a};
1
+ import{Dg as l,Fg as p}from"./chunk-BJOS4Y35.js";import{Fragment as r,useState as d}from"react";import{Fragment as b,jsx as s,jsxs as o}from"react/jsx-runtime";function g({choices:m,onPick:c,open:i,onToggle:u}){let[f,a]=d(!1),n=i??f;return o(b,{children:[o("button",{type:"button",className:"sf-add-card","aria-expanded":n,onClick:u??(()=>a(e=>!e)),children:[s("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add block"]}),n&&s("div",{className:"sf-blockmenu",role:"menu",children:p(m).map(e=>o(r,{children:[e.group&&o("div",{className:"sf-menugroup-head",role:"presentation",children:[s("span",{className:"sf-menugroup-title",children:e.group}),s("span",{className:"sf-menugroup-count",children:e.items.length})]}),e.items.map(t=>o("button",{type:"button",className:"sf-blockmenu-item",role:"menuitem",onClick:()=>{a(!1),c(t.type)},children:[s("span",{className:"sf-chip",children:s(l,{type:t.type,size:13})}),s("span",{className:"sf-row-name",children:t.label})]},t.type))]},e.group??"all"))})]})}export{g as a};