efficient-storefront-blocks 0.121.1 → 0.121.3

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 (71) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/chunks/{EditorPreviewCheckout-XK73KDIQ.js → EditorPreviewCheckout-3AKBPV3S.js} +4 -4
  3. package/dist/chunks/{SiteEditorProvider-LHGHQTP7.js → SiteEditorProvider-LBBAOVOX.js} +1 -1
  4. package/dist/chunks/{chunk-ULJSH3R7.js → chunk-4SBIX3UP.js} +1 -1
  5. package/dist/chunks/chunk-NLHCY45M.js +1 -0
  6. package/dist/chunks/chunk-QCSZZWC5.js +96 -0
  7. package/dist/chunks/{chunk-4M5X72OG.js → chunk-RWUW3WUD.js} +1 -1
  8. package/dist/chunks/chunk-SPAC3RLP.js +1 -0
  9. package/dist/chunks/{fitment-data-SWQZTLG6.js → fitment-data-IVQMG7AL.js} +1 -1
  10. package/dist/editor/components/HeaderSettingsPanel.d.ts +1 -1
  11. package/dist/editor/components/HeaderSettingsPanel.js +1 -1
  12. package/dist/editor/components/MenuPicker.js +1 -1
  13. package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
  14. package/dist/editor/lib/document/blocks/commerce/FitmentPicker/fields.js +1 -1
  15. package/dist/editor/lib/document/blocks/commerce/shared-fields.js +1 -1
  16. package/dist/editor/lib/document/blocks/service/SignUp/fields.js +1 -1
  17. package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
  18. package/dist/editor/lib/document/box-header.js +1 -1
  19. package/dist/index.js +29 -29
  20. package/dist/links.js +1 -1
  21. package/dist/render/components/BoxHeaderBar.js +1 -1
  22. package/dist/render/components/Events.js +1 -1
  23. package/dist/render/components/FitmentTable.js +1 -1
  24. package/dist/render/components/GalleryShowcase.js +1 -1
  25. package/dist/render/components/Header.js +1 -1
  26. package/dist/render/components/HeaderToolBlocks.d.ts +2 -1
  27. package/dist/render/components/SignUpSection.d.ts +2 -1
  28. package/dist/render/components/card-pieces/CardBuyButton.js +1 -1
  29. package/dist/render/components/card-pieces/CardProductPicture.js +1 -1
  30. package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
  31. package/dist/render/components/fitment/FitmentPickerPart.d.ts +2 -1
  32. package/dist/render/components/pdp-dynamic/DynamicDetailRows.d.ts +2 -1
  33. package/dist/render/components/useTyreCatalog.js +3 -3
  34. package/dist/render/components/useTyreDetail.d.ts +1 -0
  35. package/dist/render/components/useTyreDetail.js +1 -1
  36. package/dist/render/lib/api/index.js +1 -1
  37. package/dist/render/lib/content/english-variant.d.ts +3 -1
  38. package/dist/render/lib/content/english-variant.js +1 -1
  39. package/dist/render/lib/content/header-bar.d.ts +26 -1
  40. package/dist/render/lib/content/header-bar.js +1 -1
  41. package/dist/render/lib/content/tab-strip.d.ts +5 -2
  42. package/dist/render/lib/content/tab-strip.js +1 -1
  43. package/dist/render/lib/content/title-look.js +1 -1
  44. package/dist/render/lib/document/blocks/commerce/DetailRows/meta.d.ts +8 -0
  45. package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
  46. package/dist/render/lib/document/blocks/commerce/DetailRows/render.js +1 -1
  47. package/dist/render/lib/document/blocks/commerce/FitmentPicker/meta.d.ts +8 -0
  48. package/dist/render/lib/document/blocks/commerce/FitmentPicker/meta.js +1 -1
  49. package/dist/render/lib/document/blocks/commerce/FitmentPicker/render.js +1 -1
  50. package/dist/render/lib/document/blocks/service/OpeningHours/render.js +1 -1
  51. package/dist/render/lib/document/blocks/service/SignUp/meta.d.ts +8 -0
  52. package/dist/render/lib/document/blocks/service/SignUp/meta.js +1 -1
  53. package/dist/render/lib/document/blocks/service/SignUp/render.js +1 -1
  54. package/dist/render/lib/document/card-templates.js +1 -1
  55. package/dist/render/lib/document/document-nodes.js +1 -1
  56. package/dist/render/lib/document/subscribe-content-type.js +1 -1
  57. package/dist/render/lib/sections/band-padding.d.ts +2 -0
  58. package/dist/render/lib/sections/band-padding.js +1 -1
  59. package/dist/render/lib/sections/gallery-frame.js +1 -1
  60. package/dist/render/lib/sections/hero-arrangement.d.ts +3 -1
  61. package/dist/render/lib/sections/hero-arrangement.js +1 -1
  62. package/dist/render/lib/sections/hero-gallery.js +1 -1
  63. package/dist/render/lib/sections/hero-price-placement.d.ts +2 -1
  64. package/dist/render/lib/sections/hero-price-placement.js +1 -1
  65. package/dist/render/lib/wheels/plp-filters.js +1 -1
  66. package/dist/render/lib/wheels/set-mode.js +1 -1
  67. package/package.json +1 -1
  68. package/dist/chunks/chunk-DRLNY2UU.js +0 -96
  69. package/dist/chunks/chunk-HPCPOXEL.js +0 -1
  70. package/dist/chunks/chunk-JGBM6X5G.js +0 -1
  71. /package/dist/chunks/{chunk-4M5X72OG.js.LEGAL.txt → chunk-RWUW3WUD.js.LEGAL.txt} +0 -0
@@ -1,4 +1,4 @@
1
- import{$ as wp,$a as mE,$c as U,$e as Ey,$h as gO,A as ni,Ab as PE,Ac as NE,Ad as bc,Ae as vy,Af as k_,Ag as Dn,Ah as _c,Ai as PO,Ba as q,Bb as pi,Bc as uy,Bd as Sc,Be as ky,Bf as Vp,C as mc,Ca as kp,Cb as sa,Cc as DE,Ce as n_,Cf as T_,Cg as Z_,D as yp,Db as _p,Dd as Tt,De as s_,Df as P_,Dg as J_,E as Br,Ec as ME,Ed as ut,Ee as zp,Ef as E_,Ei as EO,F as si,Fa as Mt,Fd as io,Fe as i_,Ff as Yp,G as so,Ga as cr,Gc as my,Gd as Dr,Ge as Ty,Gf as __,Gi as _O,H as ho,Ha as di,Hd as Mr,Hf as qp,I as ii,Ia as ZI,Ib as EE,Id as fr,Ie as l_,If as Ay,J as bp,Ja as aE,Jd as hi,Je as Gp,Jf as O_,K as $,Ka as JI,Kd as VE,Ke as c_,Kf as Ry,Ki as fe,L as He,La as QI,Lb as Op,Ld as Bp,Le as Py,Lf as A_,Lh as iO,M as M0,Md as YE,Me as d_,Mf as Xp,Mh as lO,N as H0,Nb as Ap,Nc as HE,Ne as f_,Nf as nt,Nh as au,Oc as WE,Oe as jp,Of as Ha,Oh as cO,Oi as Oc,P as W0,Pa as ey,Pc as hy,Pe as gi,Pf as R_,Pg as Q_,Ph as dO,Pi as RO,Q as Sp,Qa as nE,Qb as xo,Qd as Ln,Qe as Me,Qf as Zp,Qg as Ny,Qh as fO,R as $0,Ra as sE,Rb as _E,Rd as qE,Re as Ee,Rf as Ht,Rg as Qp,Rh as pO,Ri as gu,S as En,Sa as uo,Sb as OE,Sd as Np,Se as p_,Sf as wi,Sg as eO,Si as LO,T as U0,Ta as iE,Td as xi,Te as Ii,Tg as Dy,Th as uO,Ti as FO,U as z0,Ua as Tp,Ub as AE,Uc as j,Ud as wc,Ue as u_,Uf as L_,Ug as oO,Uh as mO,V as hc,Va as lE,Vc as ne,Vd as Cc,Ve as Kp,Vf as F_,Vg as tO,Vh as Ti,W as qI,Wa as cE,Wb as iy,Wc as xy,Wd as Sy,We as Bn,Wf as Ly,Wg as eu,Wh as hO,X as De,Xa as dE,Xc as N,Xe as m_,Xg as rO,Xh as nu,Y,Ya as fE,Yc as Zo,Yd as XE,Yg as ca,Yh as xO,Z as G0,Za as pE,Zc as ia,Zd as ZE,Zf as B_,_a as uE,_c as $E,_d as JE,_e as Ma,_f as Fy,_g as aO,a as ai,aa as Na,ab as hE,ad as Fp,ae as wy,ai as Wa,b as be,ba as li,bb as Pp,bd as pt,be as QE,bh as My,bi as IO,c as _o,ca as j0,cb as Ep,cd as UE,ch as da,ci as yO,d as ra,da as aa,db as xE,dc as ly,dd as dr,de as Cy,dg as N_,dh as Ci,di as bO,ea as XI,eb as gE,ed as Nr,eg as D_,eh as xt,f as kt,fa as ci,fc as RE,fd as gy,ff as h_,fg as M_,fh as ke,fi as su,g as uc,ga as K0,gb as IE,gd as Da,gf as x_,gg as H_,gh as ou,gi as $a,h as A0,ha as V0,hb as yE,hd as la,he as Dp,hf as _y,hh as nO,hi as iu,i as gp,ib as oy,id as zE,ie as Mp,if as vo,ig as Nn,ih as Tc,j as R0,ja as xc,jb as bE,je as e_,jf as g_,jg as W_,jh as Pt,k as L0,ka as Y0,kb as SE,kd as Ze,ke as Hp,kf as I_,kg as $_,kh as Pc,la as q0,lb as ty,ld as Rn,le as Wp,lf as yi,lh as tu,li as SO,ma as X0,mb as fi,mc as An,md as yc,me as o_,mf as ht,mg as Jp,mh as vi,mi as lu,n as F0,na as _n,nb as On,nd as ui,ne as t_,nf as y_,ng as U_,nh as Ec,ni as Pi,oa as Z0,ob as ry,oc as cy,od as GE,oe as $p,of as bi,og as z_,oh as sO,oi as wO,pb as ay,pc as dy,pd as Iy,pe as Up,pf as Si,pg as G_,ph as ki,pi as cu,qa as J0,qb as ny,qd as mi,qe as Fn,qg as j_,qh as ru,qi as CO,r as B0,ra as Cp,rb as wE,rc as Rp,rd as yy,re as r_,rg as K_,ri as Ua,sa as Q0,sb as CE,sc as fy,sf as b_,sg as V_,si as vO,t as eo,ta as vp,tb as vE,tc as LE,tf as S_,ti as kO,u as N0,ua as eE,ub as sy,uf as w_,ug as Hr,ui as TO,v as Ip,va as oE,vb as kE,vd as jE,ve as a_,vf as kc,vg as Y_,vi as Wt,w as D0,wa as tE,wb as Xo,wc as py,wd as KE,wf as C_,wg as q_,wi as du,xa as gc,xb as TE,xc as Lp,xf as v_,xg as By,xi as Jo,y as Ue,ya as na,yc as FE,yd as by,ye as mt,yf as Oy,yg as X_,yi as me,z as Oo,za as rE,zb as Ic,zc as BE,ze as vc,zg as Wr}from"./chunk-DRLNY2UU.js";import{c as OO,d as fu,e as pu,f as AO,i as uu,j as $t,k as mu,l as hu,m as xu,q as Hy}from"./chunk-JGBM6X5G.js";var NO="en",Iu=null,DO=NO,MO=null;function PPe(e,o,t){Iu=e??null,DO=o||NO,MO=t??null}function ce(){return MO}function Wy(){return DO}function HO(){return Iu}function BO(e,o){return o?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>He(o,r)?String($(o,r)):t):e}function c(e,o){let t=Iu?$(Iu,e):void 0;if(typeof t=="function"){try{let r=be(t(o??{}));if(r)return r}catch{}return BO(e,o)}return BO(be(t)??e,o)}function st(e,o,t,r){return c(t===1?e:o,{...r,n:t})}import{jsx as $y,Fragment as QV,jsxs as e7}from"react/jsx-runtime";import{createContext as o7,useContext as t7}from"react";var r7={mirrorHostStyles:!0,css:null,fontHrefs:[]},WO=o7(r7);function APe({value:e,children:o}){return $y(WO.Provider,{value:e,children:o})}function Ac(){return t7(WO)}function $O(){let{css:e,fontHrefs:o}=Ac();return e7(QV,{children:[o.map(t=>$y("link",{rel:"stylesheet",href:t},t)),e?$y("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as a7}from"react/jsx-runtime";import{createContext as n7,useContext as s7}from"react";var UO=n7(void 0);function BPe({metadata:e,children:o}){return a7(UO.Provider,{value:e,children:o})}var zO=()=>s7(UO);import{jsx as Bo,Fragment as FV,jsxs as mp}from"react/jsx-runtime";import{useCallback as cc,useEffect as oa,useRef as QTe,useState as OV}from"react";import{SettingsSwitch as ePe}from"efficient-easel/panel";import{PagesIcon as oPe,StylesIcon as tPe}from"efficient-easel/rail";import{PaletteIcon as rPe}from"efficient-shell/icons/efficient";import{Subtree as aPe,TreeRow as BV}from"efficient-easel/tree";import{useEasel as NV}from"efficient-easel/easel";import{toItemSelector as nPe}from"efficient-easel/node-ops";import{useEaselStrings as DV}from"efficient-easel/strings";import{createContext as i7,useContext as l7}from"react";var Uy=i7(!1),MPe=()=>l7(Uy);import{useMemo as c7,useRef as d7}from"react";import{useEaselApi as f7}from"efficient-easel/easel";import{useSectionOps as p7}from"efficient-easel/screen/lib/document/use-section-ops";function yu(){let e=f7(),o=p7(),t=d7(o);return t.current=o,c7(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as qoe}from"efficient-easel/draw";import{insertAt as Xoe,moveTo as Zoe,removeAt as Joe}from"efficient-easel/fields";import{useSyncExternalStore as Uoe}from"react";import{isNodeList as GO}from"efficient-easel/data";var jO="Flex";function Ei(e,o){return mt(e)?typeof e?.[kt]=="string"?zy(o?.[kt]):"":zy(e?.[kt])}var zy=e=>typeof e=="string"?e.trim():"",u7=e=>e.type===Oo&&Array.isArray(e.props?.[Cy])&&e.props[Cy].some(o=>zy(o?.[kt])!==""),m7=new Intl.NumberFormat("en-US");function h7(e){return/^\d+$/.test(e)?m7.format(Number(e)):e}function YPe(e,o){let t=o?o.find(r=>r.key===e)?.value:B0(uc).find(r=>r.key===e)?.value;return t===void 0?null:h7(t)}var x7={[kt]:"any"};function Gy(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Ei(t)!==""||o&&Ei(t,x7)!==""),a=o||u7(e),n=ho(e,i=>so(i,l=>{let d=Gy(l,a);return d.names&&(r=!0),d.node})).props;if(e.type!==jO)return{node:n===t?e:{...e,props:n},names:r};let s=eo(n);if(r&&!s&&(n={...n,[_o]:uc}),!r&&s===uc){let{[_o]:i,...l}=n;n=l}return{node:n===t?e:{...e,props:n},names:!1}}function KO(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of si(r??{})){let n=KO(a,o,r.type===jO?r:t);if(n!==void 0)return n}}}function qPe(e,o){if(!GO(e))return!0;let t=KO(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=eo(t.props);return!r||r===uc}function VO(e){let o=e?.content;if(!GO(o))return e;let t=o.map(r=>Gy(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function YO(e){return Gy(e).node}import{jsx as A,jsxs as ya,Fragment as Sa}from"react/jsx-runtime";var Mn=["image","video"],Hn={image:"imageFocal",image2:"imageFocal2"},Rc={HeroSingle:"image",HeroSlide:"video"};function XO(e,o){return Mn.includes(o)?o:Rc[e]}var ZO=["one","side","stacked"],g7="one",ZPe={one:"One",side:"Side by side",stacked:"Stacked"};function bu(e){return ZO.includes(e)?e:g7}function qO(e){return e==="one"?1:2}function jy(e,o){if(ZO.includes(e))return e;let t=bu(o);return t==="side"?"stacked":t}function Lc(e){let o=bu(e.mediaLayout);return Math.max(qO(o),qO(jy(e.mediaLayoutPhone,o)))}import{cloneElement as iw,createContext as eQ,useContext as DF,useEffect as oQ,useId as MF,useRef as dd,useState as fd}from"react";import{useEasel as Km,useSelectedHost as ss}from"efficient-easel/easel";import{PIN_LENGTH as zm,toDateKey as XFe,fromDateKey as ZFe}from"efficient-shell/format";function Vy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.src=="string"}function it(e){return typeof e=="string"?e:Vy(e)?e.src:""}function JO(e,o,t){return Ky(e,o.split("."),t)}function Ky(e,o,t){if(o.length===0)return t(e);let[r,...a]=o,n=r.endsWith("[]"),s=n?r.slice(0,-2):r;if(!e||typeof e!="object"||Array.isArray(e))return e;let i=e;if(!(s in i))return e;let l=i[s];if(n){if(!Array.isArray(l))return e;let f=!1,u=l.map(p=>{let m=Ky(p,a,t);return m!==p&&(f=!0),m});return f?{...i,[s]:u}:e}let d=Ky(l,a,t);return d===l?e:{...i,[s]:d}}var I7=["upload","youtube"],y7="upload",o0e={upload:"Upload",youtube:"YouTube"},b7=["background","click"],S7="background",t0e={background:"Background",click:"Click to play"};function e1(e){return I7.includes(e)?e:y7}function o1(e){return b7.includes(e)?e:S7}var QO=/^[A-Za-z0-9_-]{11}$/,w7=/^(?:www\.|m\.|music\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.be)$/;function t1(e){let o=typeof e=="string"?e.trim():"";if(!o)return null;if(QO.test(o))return o;let t;try{t=new URL(/^[a-z]+:\/\//i.test(o)?o:`https://${o}`)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:"||!w7.test(t.hostname))return null;let r=t.pathname.split("/").filter(Boolean),a=t.hostname.endsWith("youtu.be")?r[0]:r[0]==="watch"?t.searchParams.get("v"):r[0]==="embed"||r[0]==="shorts"||r[0]==="live"||r[0]==="v"?r[1]:null;return a&&QO.test(a)?a:null}function Yy(e,o){let t=o==="click"?"autoplay=1&playsinline=1&rel=0":`autoplay=1&mute=1&loop=1&playlist=${e}&controls=0&playsinline=1&rel=0&disablekb=1`;return`https://www.youtube-nocookie.com/embed/${e}?${t}`}function r1(e){return`https://i.ytimg.com/vi/${e}/maxresdefault.jpg`}function a1(e){return`https://i.ytimg.com/vi/${e}/hqdefault.jpg`}var qy="Play video";var Xy={frame:"Video frame",image:"Image"},r0e={any:[{field:"loadingShows",is:"image"},{all:[{not:{field:"loadingShows",set:!0}},{field:"poster",set:!0}]}]};function Fc(e){let o=e.loadingShows;return o==="image"?"image":o!=null&&o!==""?"frame":it(e.poster)?"image":"frame"}function a0e(e,o="desktop"){let[t,r]=o==="phone"?[e.posterPhone,e.videoFramePhone]:[e.poster,e.videoFrame],[a,n]=Fc(e)==="image"?[t,r]:[r,t];return it(a)||it(n)||void 0}function n1(e){if(it(e.mediaVideo)){if(Fc(e)==="frame")return it(e.videoFrame)?void 0:it(e.poster)?"frame-missing-image":"frame-missing-surface";if(!it(e.poster))return it(e.videoFrame)?"image-missing-frame":"image-missing-surface"}}var Su="videoFrames",Zy="videoFramesNotOwn";function s1(e,o,t){let r=it(e.mediaVideo);if(!r||!o||Fc(e)!=="frame"||it(e.videoFrame))return;let a=o[r],n=!!it(e.poster);if(a?.state==="ready")return null;if(n)return!a||a.state==="pending"?void 0:"image-no-frame";if(!a)return t?"save-makes-frame":void 0;switch(a.state){case"pending":return a.noted!=="save"&&t?"save-makes-frame":null;case"dark":return"starts-dark";case"outside":return"outside";case"unsupported":return"unsupported";case"failed":return"failed";default:return null}}function C7(e,o){let t=it(e),r=t&&o?o[t]:void 0;return r?.state==="ready"&&r.frame?r.frame:void 0}function n0e(e,o,t){let r=t?.[Zy];if(!(Array.isArray(r)&&r.includes(e)))return C7(o,t?.[Su])}import{useSyncExternalStore as v7}from"react";function wu(){let e=new Map,o=new Set,t=r=>(o.add(r),()=>{o.delete(r)});return{get:r=>e.get(r),has:r=>e.has(r),set(r,a){if(!(e.has(r)&&e.get(r)===a)){e.set(r,a);for(let n of o)n()}},use(r){let a=()=>r?e.get(r):void 0;return v7(t,a,a)}}}var Je="SiteHeader",ze="SiteFooter",Jy="sections",Cu=[Je,ze],_i=e=>e===Je||e===ze,i1=e=>`${e}:${Jy}`;function l1(e,o,t=[]){return{type:e,props:{id:o,[Jy]:t}}}var k7=new Set(["Footer",Je,ze]);function Oi(e){let o=new Set,t=!1,r=e.filter(a=>{let n=a?.type??"";return n==="Header"?(t=!0,!1):k7.has(n)?o.has(n)?(t=!0,!1):(o.add(n),!0):!0});return t?r:e}function vu(e,o){return e.some(t=>t?.type===o.type)?e:o.type===Je?[o,...e]:[...e,o]}var c1={[Je]:{max:3,takes:["Flex","Ticker"]},[ze]:{max:6,takes:["Flex","Prose","Logos","Divider"]}};function d1(e,o,t){if(!_i(e))return!0;let r=c1[e];return t<r.max&&r.takes.includes(o)}function f1(e,o){let t=o,r=t?.props?.id;if(r==null)return null;let a=e?.content;if(!Array.isArray(a))return null;for(let n of a){if(!_i(n?.type))continue;let s=n.props?.[Jy];if(!Array.isArray(s)||!s.some(l=>l?.props?.id===r))continue;let i=c1[n.type];return i.takes.includes(t?.type??"")?s.length>=i.max?{group:n.type,why:"full"}:null:{group:n.type,why:"type"}}return null}import{locateNode as T7}from"efficient-easel/draw";function Bc(e){if(!e)return null;let o=e.lastIndexOf(":");return o>0?{ownerId:e.slice(0,o),slot:e.slice(o+1)}:null}function ku(e,o,t){let r=Bc(t?.zone),a=r?T7(e,o,r.ownerId):null;return a&&r?{...a,slot:r.slot}:null}import{isNode as P7}from"efficient-easel/data";var p1="Footer",u1=[Je,p1,ze],Wn=e=>{let o=e?.content;return Array.isArray(o)?o:[]},za=e=>{let o=e?.zones;return o&&typeof o=="object"&&!Array.isArray(o)?o:null},Ai=e=>{let o=e?.props?.id;return typeof o=="string"?o:void 0},m1=e=>Bc(e)?.ownerId??"";function h1(e){let o=Oi(Wn(e)),t=o.some(r=>r?.type===ze);return o.filter(r=>r?.type===Je||r?.type===ze||r?.type===p1&&!t)}function Tu(e,o){let t=new Set,r=a=>{if(Array.isArray(a)){for(let n of a)r(n);return}if(!(!a||typeof a!="object")){if(P7(a)){let n=Ai(a);n&&t.add(n)}for(let n of Object.values(a))r(n)}};if(r(e),o){let a=!0,n=new Set;for(;a;){a=!1;for(let[s,i]of Object.entries(o))n.has(s)||!t.has(m1(s))||(n.add(s),r(i),a=!0)}}return t}function x1(e,o){let t=Wn(e).filter(r=>{let a=Ai(r);return typeof r?.type=="string"&&u1.includes(r.type)||a!==void 0&&o(a)});return t.length?Tu(t,za(e)):new Set}function Qy(e,o){let t={},r={};for(let[a,n]of Object.entries(e??{}))(o.has(m1(a))?t:r)[a]=n;return{owned:t,rest:r}}function g1(e,o){if(!o)return e;let t=h1(o);if(!t.length)return e;let r=t.filter(i=>i.type===Je),a=t.filter(i=>i.type!==Je),n={...e,content:[...r,...Wn(e),...a]},{owned:s}=Qy(za(o),Tu(t,za(o)));return Object.keys(s).length&&(n.zones={...za(e)??{},...s}),n}function eb(e,o){if(!o)return{page:e,chrome:null};let t=h1(o),r=new Set(t.map(Ai).filter(v=>!!v)),a=[],n=[];for(let v of Wn(e)){let b=Ai(v);b&&r.has(b)||_i(v?.type)?n.push(v):a.push(v)}let s=new Map(n.map(v=>[Ai(v),v])),i=new Set,l=Oi(Wn(o)).flatMap(v=>{let b=Ai(v);if(!b||!r.has(b))return[v];let y=s.get(b);return y?(i.add(y),[y]):[]});for(let v of n)i.has(v)||l.some(b=>b?.type===v.type)||(l=v.type===Je?[v,...l]:[...l,v]);l=Oi(l);let d=l.length===Wn(o).length&&l.every((v,b)=>v===Wn(o)[b]),f=za(e),u=Tu(l,f),{owned:p,rest:m}=Qy(f,u),h=Qy(za(o),Tu(t,za(o))).owned,I={...o,content:d?o.content:[...l]},w=za(o);if(w||Object.keys(p).length){let v={};for(let[b,y]of Object.entries(w??{}))b in h?b in p&&(v[b]=p[b]):v[b]=y;for(let[b,y]of Object.entries(p))b in v||(v[b]=y);I.zones=v,w&&E7(I.zones,w)&&(I.zones=w)}let S={...e,content:a};return f&&(Object.keys(m).length||!Object.keys(h).length?S.zones=m:delete S.zones),{page:S,chrome:I}}function E7(e,o){let t=Object.keys(e),r=Object.keys(o);return t.length===r.length&&t.every((a,n)=>a===r[n]&&e[a]===o[a])}function I1(e,o){return t=>e(t)||t!==void 0&&u1.includes(t)&&o()}var y1=null;function ob(e){y1=e}function pr(){return y1}var b1=null;function tb(e){b1=e}function Pu(){return b1}var rb=wu();function S1(e,o,t){if(!o)return;let r={...rb.get(e)};for(let[a,n]of Object.entries(o))r[a]={...n,noted:t};rb.set(e,r)}function w1(e,o){S1(e,o,"load")}function C1(e,o){S1(e,o,"save")}function Eu(e){return rb.use(e)}var ab=e=>!!pr()?.sectionOf(e);function v1(e,o=ab){return x1(e,o)}function k1(e,o,t,r=ab){if(t)return e&&v1(o,r).has(e)?void 0:t}function T1(e,o,t=ab){if(!e)return{};let r=[...v1(o,t)];return r.length?{[Su]:e,[Zy]:r}:{[Su]:e}}import{ScreenDocumentContext as tQ}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as tn,hidableText as rQ}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as HF,LINK_FIELD_MARKER as aQ,MEDIA_FIELD_MARKER as nQ,SCAFFOLD_FIELD_MARKER as sQ,TEXT_FIELD_MARKER as ba,foldMetaOf as Sr,textFieldIdentifier as nBe}from"efficient-easel/draw";import{jsx as B1}from"react/jsx-runtime";import{useCallback as L7}from"react";import{useEasel as F7}from"efficient-easel/easel";import{SettingsAction as B7}from"efficient-easel/panel";import{isLengthUnit as A7}from"efficient-easel/screen/lib/content/length-units";import{CORNER_SIDES as _u,hasCornerSubset as Nc,normalizeCornerSides as $r}from"efficient-easel/screen/lib/content/style-keys";import{isLengthUnit as _7}from"efficient-easel/screen/lib/content/length-units";var Dc={kind:"radius",unitKey:"sectionCornersUnit"};function nb(e){return typeof e=="number"&&Number.isFinite(e)}function P1(e,o,t){if(!nb(e))return;let r=_7(t)&&t!=="px"?wi(e,t):wi(Ht(e));if(Object.keys(r).length===0)return;let a=r[sb];if(typeof a!="string")return r;let n=Nc(o)?$n(a,$r(o)??[]):a;return{...r,[O7]:n}}var O7="--sf-section-radius",sb="--sf-card-radius";function $n(e,o){return _u.map(t=>o.includes(t)?e:"0").join(" ")}var E1=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];var Mc={kind:"radius",unitKey:"cardCornersUnit"},R7="--sf-card-box-radius";function ib(e){return typeof e=="number"&&Number.isFinite(e)}function _1(e,o,t){if(!ib(e))return;let r=(A7(t)&&t!=="px"?wi(e,t):wi(Ht(e)))[sb];if(typeof r!="string")return;let a=Nc(o)?$n(r,$r(o)??[]):r;return{[R7]:a}}function O1(e,o){let t=e.find(s=>s?.props?.id===o);if(!t)return[...e];let r=t.props?.cardCorners,a=t.props?.cardCornerSides,n=t.props?.[Mc.unitKey];return e.map(s=>s?.props?.id===o?s:{...s,props:{...s.props,cardCorners:r,cardCornerSides:a,[Mc.unitKey]:n}})}function A1(e,o,t){let r=ku(e,o,t),a=r?.slot??"",n=r&&Array.isArray(r.item.props[a])?r.item.props[a]:[],s=t?.index??-1,i=s>=0?n[s]:void 0,l=i?.props?.id?String(i.props.id):"",d=Math.max(n.length-1,0);return!r||!l?{can:!1,reason:"unreachable",others:0}:n.length<=1?{can:!1,reason:"alone",others:d}:ib(i?.props?.cardCorners)?{can:!0,others:d,zone:r.zone,index:r.index,data:{...r.item,props:{...r.item.props,[a]:O1(n,l)}}}:{can:!1,reason:"unset",others:d}}function R1(e){return e.can?st("Gives the other card this card's Corners.","Gives the other {n} cards this card's Corners.",e.others):e.reason==="alone"?c("This is the only card in the section."):e.reason==="unset"?c("Set this card's corners first."):c("This card is not in a section that can share corners.")}function L1(e){return st("Applied to {n} card","Applied to {n} cards",e)}function F1(e,o){e.can&&o(e.zone,e.index,e.data)}import{useSectionOps as N7}from"efficient-easel/screen/lib/document/use-section-ops";var D7="apply-corners-to-siblings",M7="Apply to all cards";function H7({plan:e,onPress:o}){return B1(B7,{id:D7,label:c(M7),note:R1(e),disabled:!e.can,doneLabel:L1(e.others),onPress:o})}function N1(){let{appState:e,config:o}=F7(n=>n),t=N7(),r=A1(o,e.data.content??[],e.ui.itemSelector),a=L7(()=>{F1(r,t.replaceComponent)},[r,t]);return B1(H7,{plan:r,onPress:a})}import{isShown as j1,lazyShowWhenContext as Z7}from"efficient-shell/format";var Ut="product",Ou="recordType",D1={key:Ut,label:"Product",fields:[]},W7=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,$7=/^[a-z][A-Za-z0-9]*$/,U7=["text","date","images"],lb=new Map,M1=0;function z7(e){if(typeof e.key!="string"||!W7.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===Ut)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);let o=new Set;for(let t of e.fields){if(typeof t.key!="string"||!$7.test(t.key)||o.has(t.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(t.key)}.`);if(!U7.includes(t.kind))throw new Error(`The field ${t.key} of ${e.key} has no kind ${JSON.stringify(t.kind)}.`);o.add(t.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(t=>({...t}))}}function U0e(e){let o=e.map(z7);for(let t of o)lb.set(t.key,t);o.length&&(M1+=1)}function cb(){return[D1,...lb.values()]}function db(e){return e===Ut?D1:lb.get(e)??null}function fb(){return M1}function Hc(e){let o=e?.[Ou];return typeof o!="string"?Ut:o.trim()||Ut}function pb(e){return Hc(e)===Ut}function ub(e,o){let t=db(e)?.fields??[];return o?t.filter(r=>o.includes(r.kind)):t}var Au="product",H1="tyre",G7=[Au,H1];function j0e(e){return G7.includes(e)}var j7="productType",K7={[Au]:"alloy-wheel",[H1]:"tyre"},V7=["alloy-wheel","tyre"];function W1(e,o){return pb(o)?$1(o)??K7[e]??null:null}function $1(e){if(!pb(e))return null;let o=e?.[j7];return typeof o=="string"&&V7.includes(o)?o:null}function K0e(e){let o=e?.root;return $1(o?.props)}var mb="Main Pages",Y7="Dynamic Pages",hb="dynamic",q7="dynamic";function Un(e){return e.kind===q7}var xb="lightbox";function U1(e){return e.kind===xb}function z1(e){let o=[],t=[];for(let r of e){if(Un(r)){t.push(r);continue}let a=r.groupKey??(r.group?`folder:${r.group}`:"top"),n=o[o.length-1];n&&n.key===a?n.rows.push(r):o.push({key:a,label:r.group??mb,rows:[r]})}if(t.length){let r=o.findIndex(a=>a.key.startsWith("system:"));o.splice(r===-1?o.length:r,0,{key:hb,label:Y7,rows:t})}return o}var Ru=null,G1=null;function X7(e,o){Ru=e,G1=o}function J0e(e){X7(e,null)}function Q0e(){return Ru}function Wc(){return Un({kind:G1})||Ru===Au}function eEe(e){return W1(Ru??"",e)??"alloy-wheel"}function oEe(e){return Wc()?Hc(e):null}function gb(e,o,t){let r=!1,a={};for(let[n,s]of Object.entries(e)){if(!j1(bc(s),o??{},t)){r=!0;continue}let i=J7(s,o?.[n],o??{},t);i!==s&&(r=!0),a[n]=i}return r?a:e}function J7(e,o,t,r){let a=e?.options;if(!Array.isArray(a))return e;let n=a.filter(s=>s?.value===o||!s?.showWhen||j1(s.showWhen,t,r));return n.length===a.length?e:{...e,options:n}}function K1(e,o,t,r){let a=ku(o,t,r);return{device:e,parentType:a?.item.type,parent:a?.item.props}}function Lu(e,o){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.context=="string"&&(t.context===o||t.context.startsWith(`${o}.`)))return!0;if("not"in t)return Lu(t.not,o);for(let r of[t.all,t.any])if(Array.isArray(r)&&r.some(a=>Lu(a,o)))return!0;return!1}function V1(e,o={}){return Z7({parentType:()=>e.parent?.type??void 0,parent:()=>e.parent?.props??void 0,dynamicPage:()=>Wc(),root:()=>e.appState?.data?.root?.props,...o})}import{isLengthUnit as Q7}from"efficient-easel/screen/lib/content/length-units";var Y1=1,eY="cardImageUnit",Ib={kind:"radius",unitKey:eY},q1={kind:"radius"};function oY(e){return Ht(e)}function X1(e,o){if(Q7(o)&&o!=="px"){let r=q(e);return r!==void 0&&r>=0?{"--sf-card-image-radius":Me(r,o)}:{}}let t=oY(e);return t===null?{}:{"--sf-card-image-radius":`${t}px`}}import{isLengthUnit as tY}from"efficient-easel/screen/lib/content/length-units";var Z1={kind:"radius",unitKey:"cornersUnit"},J1=1,Q1="Corners";function rY(e){return Ht(e)}function bEe(e,o,t){let r=tY(t)&&t!=="px"?q(e):void 0,a=r===void 0?rY(e):null;if(r===void 0&&a===null)return null;let n=r!==void 0?Me(Math.max(0,r),t):`${a}px`;return{borderRadius:Nc(o)?$n(n,$r(o)??[]):n}}var oA=12,Ri=6,aY=Xo,Fu={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]},twoThenThreesPhoto:{label:"Two, then threes \xB7 photo",across:3,acrossPhone:1,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],phone:[[6,1]],ratio:"landscape"}},tA=["phone","acrossPhone","leadPhone"];var nY=new Set(tA),$c=Object.fromEntries(Object.entries(Fu).map(([e,o])=>[e,Object.fromEntries(Object.entries(o).filter(([t])=>!nY.has(t)))])),yb=Object.keys(Fu),rA=[2,3,4,6];function bb(e,o){return yb.filter(t=>t===o||e===null||$c[t].across===e)}function aA(e){let o=e.layout;return typeof o=="string"&&He(Fu,o)?o:null}function Sb(e){let o=aA(e);return o?sY(o,e.layoutPhone):null}var Bu={oneAcross:{label:"One across",phone:[[Ri,2]],acrossPhone:1}};function nA(e){return typeof e=="string"&&He(Bu,e)?e:null}function eA(e,o){return o?Ri/e.acrossPhone:oA/e.across}function wb(e){return e.ratio?aO.find(o=>o.shape===e.ratio)?.ratio??null:null}function sA(e){return[...e.lead??[],...e.desktop]}function sY(e,o){let t=Fu[e],r=nA(o);if(!r)return t;let{phone:a,acrossPhone:n}=Bu[r],s=Object.fromEntries(tA.map(i=>[i,void 0]));return{...t,...s,phone:a,acrossPhone:n}}var iY="sf-wall--";function lY(e){let o=aA(e);if(!o)return"";let t=nA(e.layoutPhone);return`${iY}${o}${t?`--${t}`:""}`}function kEe(e){let o=Sb(e);if(!o)return"";let t=`.${lY(e)}`,r=[],a=(i,l,d)=>`${t}:has(> :nth-child(${i}n+${l+d}):last-child) > :nth-last-child(-n+${d})`,n=(i,l,d=[])=>{let f=[],u=i.length,p=d.length;d.forEach(([m,h],I)=>{f.push(`${t} > :nth-child(${I+1}){grid-column:span ${m};grid-row:span ${h}}`)}),i.forEach(([m,h],I)=>{f.push(`${t} > :nth-child(${u}n+${p+I+1}){grid-column:span ${m};grid-row:span ${h}}`)});for(let m=1;m<u;m+=1)f.push(`${a(u,p,m)}{grid-column:span ${l};grid-row:span 1}`);return f};r.push(`${t}{grid-template-columns:repeat(${oA},minmax(0,1fr))}`);let s=wb(o);if(s&&(r.push(`${t}${t}{grid-auto-rows:auto}`),r.push(`${t}${t} > *{aspect-ratio:${s[0]}/${s[1]};height:auto}`)),r.push(...n(o.desktop,eA(o,!1),o.lead)),r.push(`@media (max-width:${aY}px){`),r.push(`${t}{grid-template-columns:repeat(${Ri},minmax(0,1fr))}`),r.push(...n(o.phone,eA(o,!0),o.leadPhone)),o.phone.length===1&&!o.leadPhone?.length){let[i,l]=o.phone[0],d=o.lead?.length??0;for(let f=1;f<o.desktop.length;f+=1)r.push(`${a(o.desktop.length,d,f)}{grid-column:span ${i};grid-row:span ${l}}`)}return r.push("}"),r.join("")}var Nu=12,iA=1,cY=3;var dY=3;function Du(e,o,t){let r=typeof e=="number"?e:Number.parseInt(String(e??""),10);return Number.isFinite(r)?Math.min(t,Math.max(o,Math.trunc(r))):null}function fY(e){return Du(e,1,Nu)??dY}function EEe(e,o){return Du(e,iA,cY)??(fY(o)===4?2:iA)}function lA(e){return e==null||e===""?null:Du(e,1,Nu)}var cA="data-sf-span",Cb=4;function dA(e){return e==null||e===""?null:Du(e,1,Cb)}var fA="data-sf-row-span",Ga=["gridSpan","gridRowSpan"];function pA(e){if(!e)return!1;if(e.type==="Grid")return!0;if(e.type==="GalleryB"){if(Sb(e.props??{}))return!1;let o=e.props?.columns;return o!=null&&o!==""}return!1}import{jsx as pY}from"react/jsx-runtime";import*as uY from"efficient-easel/icons";function Mu(e){let o=e.replace(/(^|-)([a-z])/g,(r,a,n)=>n.toUpperCase()),t=uY[`${o}Icon`];return t?pY(t,{size:16}):null}import{jsx as ja,Fragment as xY,jsxs as bA}from"react/jsx-runtime";import{useContext as gY,useEffect as IY,useId as yY,useState as SA}from"react";import{SettingsField as bY,SettingsSwitch as SY}from"efficient-easel/panel";import{AnchorIcon as wY}from"efficient-easel/icons";import{ScreenDocumentContext as CY}from"efficient-easel/screen/components/ScreenDocumentContext";import{Snippet as vY}from"efficient-shell/ui";import{slugify as kY}from"efficient-shell/format";import{slugify as mY}from"efficient-shell/format";function Uc(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var zn=e=>mY(Uc(e));var Hu="homepage";import{slugify as hY}from"efficient-shell/format";var uA=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function mA(e){return e.offersCommerce&&e.offersService?uA:uA.filter(o=>!o.needs||(o.needs==="commerce"?e.offersCommerce:e.offersService))}var vb="#popup:";function hA(e){return`${vb}${e}`}function xA(e){return e.startsWith(vb)&&e.slice(vb.length).trim()||null}function zc(e){return e===Hu?"/":`/${e}`}function gA(e){return`/journal/${e}`}function MEe(e){return`/wheels/${e}`}function Wu(e,o){return`${zc(e)}#${o}`}function IA(...e){let o=new Set,t=[];for(let r of e)for(let a of r?.content??[]){let n=Uc(a?.props?.anchor);if(!n)continue;let s=hY(n);!s||o.has(s)||(o.add(s),t.push({slug:s,name:n}))}return t}function HEe(e){let o=e.indexOf("#"),t=o===-1?e:e.slice(0,o),r=t.indexOf("?");return r===-1?t:t.slice(0,r)}function yA(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}import{readHidable as TY}from"efficient-easel/draw";function wA({value:e,onChange:o,nameBox:t}){let r=TY(e).text,[a,n]=SA(!1),s=a||r.trim()!=="",i=yY();return bA(xY,{children:[ja(bY,{label:c("Add an anchor"),labelId:i,icon:ja(wY,{}),action:ja(SY,{checked:s,ariaLabelledBy:i,onChange:l=>{n(l),!l&&r!==""&&o("")}})}),s&&t(e,o),s&&ja(PY,{name:r})]})}function PY({name:e}){let o=gY(CY),t=o?.templateId?"":o?.currentSlug??"",[r,a]=SA("");IY(()=>a(fu()),[]);let n=kY(e);if(!n||!t)return null;let s=`${r}${Wu(t,n)}`,i=s.replace(/^https?:\/\//,""),l=i.lastIndexOf("#");return ja("div",{className:"sf-anchor-link",children:ja(vY,{value:s,label:c("link"),size:"sm",children:bA("span",{className:"sf-anchor-link-text",children:[ja("span",{className:"sf-anchor-link-path",children:i.slice(0,l)}),ja("span",{className:"sf-anchor-link-hash",children:i.slice(l)})]})})})}import{jsx as Ur,jsxs as EY}from"react/jsx-runtime";import{Fragment as _Y}from"react";import{Button as $u,Tooltip as OY}from"efficient-shell/ui";function CA({status:e,statusText:o,onRefresh:t,busy:r=!1,edit:a,hint:n,spaced:s=!0,compact:i=!1,oneLine:l=!1}){return i?Ur("div",{className:`sf-blogsource sf-blogsource--compact${l?" sf-blogsource--line":""}`,style:s?{marginTop:8}:void 0,children:Ur(OY,{content:n,className:l?"sf-name-tip":void 0,children:Ur("p",{className:"sf-blogsource-status","data-state":e,children:[o?Ur(_Y,{children:o},"status"):null,t?Ur($u,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:t,disabled:r,children:c("Refresh now")},"refresh"):null,a?Ur($u,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:a.onClick,children:a.label},"edit"):null].filter(Boolean).flatMap((d,f)=>f?[" \xB7 ",d]:[d])})})}):EY("div",{className:"sf-blogsource",style:s?{marginTop:9}:void 0,children:[Ur("p",{className:"sf-blogsource-status","data-state":e,children:o}),t?Ur($u,{variant:"secondary",className:"sf-blogsource-action",onClick:t,disabled:r,children:c("Refresh now")}):null,a?Ur($u,{variant:"secondary",className:"sf-blogsource-action",onClick:a.onClick,children:a.label}):null,Ur("p",{className:"es-field-hint",children:n})]})}import{AdjustIcon as iQ,EyeIcon as lQ,AnimationIcon as cQ,BackgroundIcon as kF,BorderAllIcon as dQ,BlockSectionIcon as fQ,ColumnWidthsIcon as lw,ColumnsIcon as WF,CornerIcon as $F,DirectionDownIcon as pQ,DirectionLeftIcon as uQ,DirectionRightIcon as mQ,DirectionUpIcon as hQ,EditIcon as xQ,GapIcon as gQ,GridIcon as UF,GroundIcon as aw,HashIcon as IQ,HeightIcon as cw,ImageIcon as yQ,ListIcon as bQ,LocationIcon as TF,PaddingBottomIcon as zF,PaddingLeftIcon as GF,PaddingRightIcon as jF,PaddingTopIcon as dw,PageIcon as SQ,StickyIcon as KF,SearchIcon as wQ,SquareIcon as CQ,TypeIcon as vQ,WidthIcon as kQ}from"efficient-easel/icons";import{jsx as oo,Fragment as Gn,jsxs as jn}from"react/jsx-runtime";import{CaptionIcon as AY,DateIcon as RY,FlagIcon as LY,TitleIcon as FY,ButtonIcon as BY,DollarIcon as NY,HashIcon as DY,LinkIcon as MY,NoteIcon as HY,TagIcon as WY,TextLinesIcon as $Y}from"efficient-easel/icons";var vA={body:$Y,button:BY,link:MY,label:WY,number:DY,price:NY,note:HY,name:LY,date:RY,caption:AY,title:FY},kA={eyebrow:jn(Gn,{children:[oo("path",{d:"M5 6.5h5"}),oo("path",{d:"M5 12.5h14"}),oo("path",{d:"M5 18h11"})]}),heading:jn(Gn,{children:[oo("path",{d:"M6.5 5v14"}),oo("path",{d:"M17.5 5v14"}),oo("path",{d:"M6.5 12h11"})]}),intro:jn(Gn,{children:[oo("path",{d:"M4 5.5v13"}),oo("path",{d:"M8 7.5h12"}),oo("path",{d:"M8 12h12"}),oo("path",{d:"M8 16.5h8"})]}),value:jn(Gn,{children:[oo("rect",{x:"2.5",y:"7",width:"19",height:"10",rx:"2"}),oo("path",{d:"M6.5 12h7"})]}),quote:jn(Gn,{children:[oo("path",{d:"M9.5 5.5C7 7.2 5.5 9.7 5.5 12.8h4v5.7h-5v-5.7"}),oo("path",{d:"M19.5 5.5c-2.5 1.7-4 4.2-4 7.3h4v5.7h-5v-5.7"})]}),tag:jn(Gn,{children:[oo("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),oo("path",{d:"M8 9.5h8"}),oo("path",{d:"M12 9.5v5"})]}),meta:jn(Gn,{children:[oo("path",{d:"M4 7h16"}),oo("path",{d:"M4 14h3.5"}),oo("path",{d:"M10.5 14h3"}),oo("path",{d:"M17 14h3"})]})};function kb({noun:e,size:o=14,strokeWidth:t=1.8,className:r,style:a}){let n=vA[e];return n?oo("span",{className:r,style:{display:"inline-flex",...a},"aria-hidden":"true",children:oo(n,{size:o})}):oo("svg",{className:r,style:a,width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:kA[e]})}var s_e=Object.keys(vA);var i_e=Object.keys(kA);import{parseHexColor as qY}from"efficient-shell/format";import{parseHexColor as OA}from"efficient-shell/format";import{COLOR_SLOTS as AA,FILL_COLOR_SLOTS as KY,colorRole as VY,fillColorRole as RA}from"efficient-shell/markup";import{parseHexColor as TA}from"efficient-shell/format";import{FILL_COLOR_SLOTS as UY}from"efficient-shell/markup";var Uu=e=>{let o=j_.find(t=>t.role===e);return o?`var(${o.token})`:""},zY=e=>Uu(e)?`var(--theme-${e})`:"",GY={main:{ink:_n.accent,page:_n.accent,key:"accent",label:()=>c("Main"),words:e=>c("Theme {n} main color",{n:e})},text:{ink:_n.text,page:_n.text,key:"text",label:()=>c("Text"),words:e=>c("Theme {n} text color",{n:e})},background:{ink:Uu("bg"),page:zY("bg"),key:"background",label:()=>c("Background"),words:e=>c("Theme {n} background",{n:e})},muted:{ink:_n.labels,page:_n.labels,key:"muted",label:()=>c("Muted"),words:e=>c("Theme {n} muted color",{n:e})},surface:{ink:Uu("surface"),page:Uu("surface"),key:"surface",label:()=>c("Surface"),words:e=>c("Theme {n} surface color",{n:e})}};function Ka(e){return $(GY,e)}var Tb="#9ca3af";function Li(e,o,t){let r=Ka(e);return r?{hex:TA(o[r.key]??"")??"",words:r.words(t)}:null}function PA(e,o){return UY.flatMap(t=>{let r=Li(t,e,o);return r&&Ka(t)?.ink?[{name:t,label:r.words,value:r.hex||Tb}]:[]})}var jY=["main","text","background"];function EA(e){let o=new Set,t=[];return vo(e).themes.forEach((r,a)=>{for(let n of jY){let s=Ka(n),i=s?r[s.key]:void 0,l=typeof i=="string"&&i?TA(i):null;!s||!l||o.has(l)||(o.add(l),t.push({value:l,label:s.words(a+1)}))}}),t}function fa(e){return Ka(e)?.ink??""}function zr(e){if(typeof e!="string")return null;let o=RA(e.trim());return o?.kind==="slot"&&fa(o.slot)?o.slot:null}var YY={accent:"main",labels:"muted"};function Et(e){return $(YY,e)??e}function Fi(e){if(!e)return"";if(e.startsWith("#"))return OA(e)===e.toLowerCase()?e:"";let o=VY(Et(e));return o?.kind==="slot"?fa(o.slot):""}function Bi(e,o=AA){return o.flatMap(t=>{let r=Ka(t);return r?.ink?[{name:t,label:r.label(),value:e?.[t]||Tb}]:[]})}function LA(e){let o=RA(Et(e));return o?.kind==="slot"?fa(o.slot):""}function Pb(e){let o=e?.trim();return o?KY.find(t=>fa(t)===o)??null:null}function zu(e){let o={},t=e.ownerDocument,r=t?.defaultView;if(!t||!r)return o;let a=r.getComputedStyle(e),n=t.createElement("canvas").getContext("2d");for(let s of AA){let i=fa(s);if(!i)continue;let l=i.replace(/^var\((--[\w-]+)\)$/,"$1"),d=a.getPropertyValue(l).trim();if(!d)continue;let f=_A(d);!f&&n&&(n.fillStyle="#000000",n.fillStyle=d,f=_A(String(n.fillStyle))),f&&(o[s]=f)}return o}function _A(e){let o=e.trim().toLowerCase();if(o.startsWith("#"))return OA(o);let t=o.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);return t?`#${t.slice(1,4).map(r=>Math.min(255,Number(r)).toString(16).padStart(2,"0")).join("")}`:null}var XY="#ffffff";function Eb(e){return FA(e)||(ZY(e)?e:XY)}function FA(e){let o=zr(e);return o?Ka(o)?.page??"":""}function ZY(e){return typeof e=="string"&&qY(e)===e.toLowerCase()||FA(e)!==""}function Gu(e){return{"--bg":Eb(e)}}import{parseHexColor as JY}from"efficient-shell/format";import{fillColorRole as QY}from"efficient-shell/markup";function Kn(e,o,t,r){let a=r??t??o,n=t!==null&&t!==o,s=a!==null&&a!==o;return{className:[n?e.tabletClass:"",s?e.phoneClass:""].filter(Boolean).join(" "),style:{...n?{[e.tabletVar]:t}:{},...s?{[e.phoneVar]:a}:{}}}}var _b=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}];var D_e="sf-card",M_e="[--sf-card-lift:none] [--sf-card-shadow-hover:var(--sf-card-shadow,none)]",Va={min:0,max:100,step:5,fallback:0,unit:"%"},e9="68%",W_e={desktop:20,phone:20,side:40,sidePhone:24},$_e="sf-box-sides";function Ab(e){return typeof e=="string"&&e.trim()!==""}function NA(e){return Ab(typeof e?.bgImage=="string"?e.bgImage:null)||ju(e)}function ju(e){return mt(e,Op)!==""}function jc(e,o){return o||!ju(e)?e:{...e,[Op]:""}}function U_e(e,o){return Ty(o,mt(e,Op))?.trim()||null}function BA(e,o){let t=typeof e=="number"?e:Number.parseFloat(String(e??""));if(!Number.isFinite(t)||t<=0)return null;let r=(Math.min(Va.max,Math.max(Va.min,t))/100).toFixed(2);return o!=="bottom"?{background:ca(Number(r))}:{background:`linear-gradient(0deg, ${ca(Number(r))} 0%, ${ca(0)} ${e9})`}}var Ku=[{label:"Flat",value:"",hint:"One colour from top to bottom"},{label:"Fade",value:"down",hint:"The colour fades into the page colour at the bottom"}],DA="fillFade",Ob=Ku[1].value,Vu=e=>e===Ob?Ob:Ku[0].value,o9=[{mix:"12%",at:"50%"},{mix:"19%",at:"70%"},{mix:"50%",at:"95%"}];function z_e(e){return Vu(e)!==Ob?null:{backgroundImage:`linear-gradient(to bottom, transparent, ${o9.map(o=>`color-mix(in srgb, var(--bg) ${o.mix}, transparent) ${o.at}`).join(", ")})`}}var Yu=e=>typeof e=="string"?JY(e.trim()):null,Gc=e=>{let o=Yu(e);if(o!==null||typeof e!="string")return o;let t=e.trim();return t&&!t.startsWith("#")&&LA(t)||null},qu=e=>{if(typeof e!="string")return null;let o=QY(Et(e.trim()));return o?.kind==="slot"?o.slot:null},Rb="swatch";function G_e(e,o){if(!o)return null;let t=Ty(o,mt(e,Rb)),r=zr(t);return Yu(t)??(r&&fa(r)||null)}var t9={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function j_e(e,o,t){return Kn(t9,Gc(e),Gc(o),Gc(t))}var r9={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function K_e(e){let o=BA(e.darken,e.darkenStyle);if(!o)return{className:"",style:{}};let t=(u,p)=>String(BA(u,p)?.background??"none"),r=u=>(typeof u=="number"||typeof u=="string"&&u.trim()!=="")&&Number.isFinite(Number(u))?u:void 0,a=u=>_b.some(p=>p.value===u)?u:void 0,[n,s,i,l]=[r(e.darkenTablet),a(e.darkenStyleTablet),r(e.darkenPhone),a(e.darkenStylePhone)],d=n??e.darken,f=s??e.darkenStyle;return Kn(r9,String(o.background),n!==void 0||s!==void 0?t(d,f):null,i!==void 0||l!==void 0?t(i??d,l??f):null)}function V_e(e,o){let t={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[r,a]=t[e]??t.center,[n,s]=o==="column"?[a,r]:[r,a];return RE(n,s)}function MA(e,o){let t=e?.content;if(!Array.isArray(t))return null;for(let r of t){if(!r||typeof r!="object")continue;let{type:a,props:n}=r;if(n?.id===o)return null;if(Lb(r,o,0))return{type:typeof a=="string"?a:"",props:n??{}}}return null}function Lb(e,o,t){if(t>12||!e||typeof e!="object")return!1;if(Array.isArray(e))return e.some(a=>Lb(a,o,t+1));let r=e.props;return r&&typeof r=="object"&&r.id===o?!0:Object.values(e).some(a=>Lb(a,o,t+1))}function HA(e,o){let t=e?.content;return Array.isArray(t)?Xu(t,o,0)??[]:[]}function Xu(e,o,t){if(t>12||!e||typeof e!="object")return null;if(Array.isArray(e)){for(let a of e){let n=Xu(a,o,t+1);if(n)return n}return null}let r=e.props;if(r&&typeof r=="object"){if(r.id===o)return[];for(let a of Object.values(r)){let n=Xu(a,o,t+1);if(n)return[r,...n]}return null}for(let a of Object.values(e)){let n=Xu(a,o,t+1);if(n)return n}return null}import{SettingsDefaultReset as et,SettingsDrill as TQ,SettingsField as wo,SettingsGroup as PQ,SettingsSegmented as EQ,SettingsBorder as _Q,SettingsSidesEach as OQ,SettingsSwitch as fw,borderSides as AQ,borderStartEach as RQ}from"efficient-easel/panel";import{ListField as LQ}from"efficient-easel/fields";import{DisplayChips as FQ}from"efficient-shell/ui";import{HIDDEN_KEY as a9,hiddenInEveryView as n9,hiddenInView as Fb,hiddenKeyOf as WA}from"efficient-easel/screen/lib/content/view-hide";var s9={"000":"",100:"view-desktop:hidden","010":"view-wide:max-view-desktop:hidden","001":"max-view-wide:hidden",110:"view-wide:hidden","011":"max-view-desktop:hidden",101:"view-desktop:hidden max-view-wide:hidden",111:"hidden"},i9={"000":"",100:"view-desktop:hidden","010":"view-tablet:max-view-desktop:hidden","001":"max-view-tablet:hidden",110:"view-tablet:hidden","011":"max-view-desktop:hidden",101:"view-desktop:hidden max-view-tablet:hidden",111:"hidden"},$A=e=>(e.desktop?"1":"0")+(e.tablet?"1":"0")+(e.mobile?"1":"0");function Zu(e,{atSectionLine:o=!1}={}){return(o?i9:s9)[$A(e)]}var Ni=[a9,WA("tablet"),WA("mobile")];function UA(e){return{desktop:Fb(e,"desktop"),tablet:Fb(e,"tablet"),mobile:Fb(e,"mobile")}}function pa(e){return n9(e)}function zA(e){let o=UA(e);return["desktop","tablet","mobile"].filter(t=>o[t]).join(" ")}var l9={"000":"",100:"view-desktop:hidden!","010":"view-wide:max-view-desktop:hidden!","001":"max-view-wide:hidden!",110:"view-wide:hidden!","011":"max-view-desktop:hidden!",101:"view-desktop:hidden! max-view-wide:hidden!",111:"hidden!"},c9={"000":"",100:"view-desktop:hidden!","010":"view-tablet:max-view-desktop:hidden!","001":"max-view-tablet:hidden!",110:"view-tablet:hidden!","011":"max-view-desktop:hidden!",101:"view-desktop:hidden! max-view-tablet:hidden!",111:"hidden!"};function Kc(e,{atSectionLine:o=!1}={}){return(o?c9:l9)[$A(UA(e))]}function Di(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let o={};for(let[t,r]of Object.entries(e))typeof r=="boolean"&&(o[t]=r);return o}function Ju(e,o){return Di(e)[o]!==!1}function Bb(e,o,t){let r=Di(o)[t];return typeof r=="boolean"?r:Ju(e,t)}function GA(e){return Object.values(Di(e)).some(o=>o===!1)}function jA(e){return Object.keys(Di(e)).length>0}function KA(e,o,t){let r={...Di(e)};return t?delete r[o]:r[o]=!1,Object.keys(r).length?r:void 0}function VA(e,o,t){return{...Di(e),[o]:t}}function Q_e(e,o,t,{atSectionLine:r=!0}={}){let a=!Ju(e,t);return Zu({desktop:a,tablet:a,mobile:!Bb(e,o,t)},{atSectionLine:r})}import{ColorSwatch as BQ,CornersInput as NQ,DatePicker as EBe,DateTimePicker as DQ,FOCAL_DEFAULT as _Be,IconPicker as VF,COLUMN_COUNT_MAX as PF,COLUMN_SHARE_MIN as MQ,COLUMN_SHARES_EQUAL as HQ,resolveColumnShares as YF,WidthsBar as WQ,useShellStrings as $Q,IconButton as qF,InputNumber as EF,Slider as UQ,Tooltip as pw}from"efficient-shell/ui";import{backendOf as d9}from"efficient-easel/screen/lib/session";var Ge=d9,Mi=e=>e.blocks;async function YA(e){let o=e.trim();if(!o)return null;let t=Ge().geocode;if(!t)throw new Error("geocode_unavailable");return t.locate(o)}var Nb="Lookup busy \u2014 try again in a moment.",Qu=e=>typeof e=="number"&&Number.isFinite(e);function sOe(e){return e.some(o=>{let t=o?.geocode;return t?t.pending||t.manual&&t.lat===void 0&&t.lng===void 0?!0:Qu(t.lat)&&t.lat!==o.lat||Qu(t.lng)&&t.lng!==o.lng:!1})}async function iOe(e,o,{geocode:t=YA,courtesyGapMs:r=1100}={}){let a=s=>new Promise(i=>setTimeout(i,s)),n=e.slice();if(e.some(s=>s?.geocode?.pending)){let s=[],i=!1;for(let l of e){if(!l?.geocode?.pending){s.push(l);continue}i&&r>0&&await a(r),i=!0;try{let d=await t(o(l));s.push(d?{...l,lat:d.lat,lng:d.lng,geocode:{...l.geocode,pending:!1,ok:!0,status:`Found \u2014 ${d.label.split(",").slice(0,3).join(",").trim()}`,lat:d.lat,lng:d.lng}}:{...l,geocode:{...l.geocode,pending:!1,ok:!1,status:"No match \u2014 check the address and try again."}})}catch{s.push({...l,geocode:{...l.geocode,pending:!1,ok:!1,status:Nb}})}}n=s}return n.map(s=>{let i=s?.geocode;if(!i)return s;if(i.manual&&i.lat===void 0&&i.lng===void 0)return{...s,geocode:{...i,lat:s.lat,lng:s.lng}};let l=Qu(i.lat)&&i.lat!==s.lat?i.lat:s.lat,d=Qu(i.lng)&&i.lng!==s.lng?i.lng:s.lng;return l!==s.lat||d!==s.lng?{...s,lat:l,lng:d}:s})}import{jsx as lt,jsxs as Mb}from"react/jsx-runtime";import{useRef as f9}from"react";import{ColorPicker as p9,ColorPickerPanel as u9,ColorSwatch as m9,HexInput as h9,Popover as x9,Tooltip as g9,colorFill as I9,colorSwatchClasses as y9,useShellStrings as b9}from"efficient-shell/ui";import{SettingsDefaultReset as S9,SettingsField as w9}from"efficient-easel/panel";import{typedHex as Db}from"efficient-easel/pick";var qA="Not set";function XA({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,ariaLabel:s,choices:i}){return lt(v9,{value:e,onChange:o,label:c(s??t),id:r,caption:a,inherited:n,choices:i})}function C9(){let{theme:e}=fe();return EA(e)}function v9({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,choices:s}){let i=C9(),l=e?null:Db(n??""),d=a!==void 0&&(!e||Db(a)!==Db(e))?a:null,f=u=>{u!==e&&o(u)};return Mb("div",{className:"sf-colour",children:[s?lt(k9,{id:r,value:e,onChange:o,label:t,presets:i,follows:l,choices:s}):lt(p9,{id:r,value:e,onChange:f,label:t,presets:i,fallback:l??void 0,size:"md",align:"start"}),d!==null?lt("span",{className:"sf-colour-caption",children:d}):lt("span",{className:"sf-colour-hexwrap",children:lt(h9,{value:e||l||"",onChange:f,label:c("{label} hex code",{label:t}),placeholder:e||l?void 0:c(qA),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function k9({value:e,onChange:o,label:t,id:r,presets:a,follows:n,choices:s}){let i=b9().color,l=e||n||"",d=s.findIndex(p=>p.selected),f=d>=0,u=f9(d);return f&&(u.current=d),lt(x9,{id:r,trigger:lt("span",{"aria-hidden":"true",className:"absolute inset-0",style:I9(l)}),triggerLabel:i.swatch(t,l.toUpperCase()||i.none),triggerClassName:y9({size:"md"}),"aria-label":i.panel(t),align:"start",children:Mb("div",{className:"sf-colour-window",children:[lt("div",{role:"group","aria-label":t,className:"sf-colour-choices",children:s.map(p=>lt(g9,{content:p.label,children:lt(m9,{color:p.color,"aria-label":p.label,selected:p.selected,onClick:()=>{p.selected||p.onPick()}})},p.label))}),lt(u9,{value:f?"":e,onChange:o,label:t,presets:a,fallback:(f?l:n)??void 0},u.current)]})})}function gt({label:e,icon:o,changed:t,hint:r,onReset:a,resetTo:n,children:s,...i}){return lt(w9,{label:e,icon:o,htmlFor:i.id,changed:t,hint:r,action:a?lt(S9,{words:ce()?.panel,label:e,changed:!!t,detail:n,onReset:a}):void 0,children:s?Mb("div",{className:"es-width-stack",children:[XA({...i,label:e}),s]}):XA({...i,label:e})})}function Vc({label:e,icon:o,value:t,inherited:r,resetTo:a,onChange:n,onReset:s,hint:i,choices:l,children:d}){let f=!!t;return lt(gt,{label:e,icon:o,value:t,inherited:f?void 0:r,onChange:n,changed:f,onReset:s,resetTo:a,hint:i,choices:l,children:d})}import{keptByRow as nw}from"efficient-easel/screen/lib/document/style-fields";import{jsx as T9}from"react/jsx-runtime";import{useEffect as P9,useState as E9}from"react";import{clearRangeOf as _9,markSelection as O9,useCaretEdit as A9}from"efficient-easel/copy";import{TextToolbar as R9}from"efficient-shell/ui";function L9(e,o,t){return O9(e,o,t,oE)}function ZA(e,o){let t=_9(o,e.length),r=rE(e,t.start,t.end);return r.text===e?null:r}function F9(e){let[o,t]=E9(null);return P9(()=>{let r=e.current?.ownerDocument??(typeof document>"u"?null:document);if(!r)return;let a=()=>{let n=e.current;if(!n||r.activeElement!==n)return;let s=n.selectionStart??n.value.length,i=n.selectionEnd??s;t(l=>l&&l.start===s&&l.end===i?l:{start:s,end:i})};return r.addEventListener("selectionchange",a),()=>r.removeEventListener("selectionchange",a)},[e]),[o,t]}function B9({target:e,value:o,onChange:t,disabled:r=!1,label:a="Formatting"}){let n=A9({target:e,onChange:t}),[s,i]=F9(e),l=p=>n(m=>{let h=L9(o,p,m);return i({start:h.selectionStart,end:h.selectionEnd}),h}),d=eE(),f={};if(s)for(let p of d)f[p.style]=tE(o,s.start,s.end,p.style);let u=r?null:ZA(o,s);return T9(R9,{offered:new Set(d.map(p=>p.style)),onMark:p=>l(p),pressed:f,disabled:r,"aria-label":c(a),className:"sf-markup-bar",clear:u?{onClear:()=>n(()=>{let p=e.current,m=p&&p.ownerDocument.activeElement===p?{start:p.selectionStart??0,end:p.selectionEnd??0}:null,h=ZA(o,m)??{text:o,selectionStart:m?.start??0,selectionEnd:m?.end??0};return i({start:h.selectionStart,end:h.selectionEnd}),h})}:void 0})}var Hb=B9;import{deviceField as Lt}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as zQ,NoControlMark as GQ,noControlField as XF}from"efficient-easel/screen/lib/document/panel-no-control-mark";var Wb="__ownBox";function JA(e){return!!e&&typeof e=="object"&&e[Wb]===!0}var $b="sfPanelOnly";function Hi(e){return!!e&&typeof e=="object"&&e[$b]===!0}function em(e,o,t){return typeof e=="number"?e:typeof o=="number"?o:t}var om=void 0;import{phoneKey as Zi,tabletKey as uw,viewKeyAt as mw}from"efficient-easel/draw";import{jsx as tm,Fragment as N9,jsxs as D9}from"react/jsx-runtime";import{useRef as M9}from"react";import{SettingsDefaultReset as H9}from"efficient-easel/panel";import{effectTiles as W9}from"efficient-easel/screen/lib/document/effect-tiles";import{VIEW_KEY_ACCESS as QA,describedAs as $9,onDesktopWords as U9,phoneTwinFields as eR}from"efficient-easel/screen/lib/document/box-fields";function z9({row:e,read:o,...t}){let r=o(So(),t.followsView??"desktop");return e({...t,follows:r})}function ua(e,o){return Object.fromEntries(xt.map(t=>{let r=ke(e,t);return[r,eR(e,o(t),QA)[r]]}))}function rm(e,o,t){let r=o.render,a={...o,render:n=>tm(z9,{...n,row:r,read:t})};return ua(e,n=>n==="desktop"?o:a)}function G9({spec:e,...o}){let t=e.values.includes(o.value),r="follows"in o,a=e.read(So(),o.followsView??"desktop"),n=t?o.value:a,s=M9(null),{preview:i}=e,l=W9({label:c(e.label),options:e.values.map(f=>({value:f,label:c(e.word(f)),picture:e.picture(f)})),fallback:e.fallback,onPreview:i?f=>s.current&&i(s.current,f):void 0}).render,d=l({value:n,onChange:f=>o.onChange(f??e.fallback)});return D9(N9,{children:[i?tm("div",{ref:s,style:{display:"contents"},children:d}):d,r&&t&&tm(H9,{words:ce()?.panel,label:c(e.tileWord),changed:!0,detail:U9(f=>c(f),c(e.word(a)),o.followsView),onReset:()=>o.onChange(void 0)})]})}function am(e,o){let t=$9({type:"custom",render:r=>tm(G9,{...r,spec:o})},{type:"select",label:o.label,options:o.values.map(r=>({value:r,label:o.word(r)}))});return eR(e,t,QA)}import{jsx as zb,Fragment as V9}from"react/jsx-runtime";import{createContext as Y9,useContext as q9}from"react";var nm={ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},sm={Events:["posts"],SubscribeBlogs:["posts"]};var j9=["anchor"],K9=/^href$|Href$|^url$|Url$|^link$|^mailto$|^tel$/;function Vn(e){return j9.includes(e)||K9.test(e)}var Ub={Gallery:{source:{verb:"snapshot",keep:[]}},ProductHero:{source:{verb:"snapshot",keep:[]}},SpecTable:{source:{verb:"snapshot",keep:[]},wheel:{verb:"reference"},finish:{verb:"reference"},size:{verb:"reference"}},CollectionCard:{collection:{verb:"snapshot",keep:[]}},FooterMenu:{menu:{verb:"snapshot",keep:[]}},MenuBlock:{menu:{verb:"snapshot",keep:[]}},ProductGrid:{design_codes:{verb:"reference"}},ProductRef:{code:{verb:"reference"},finish:{verb:"reference"}},FitmentTable:{wheel:{verb:"reference"}},GalleryItem:{fromProduct:{verb:"reference"}},Footprint:{"offices[].group":{verb:"groupKey"},"offices[].lat":{verb:"pii"},"offices[].lng":{verb:"pii"},"offices[].geocode":{verb:"pii"}}};Ub.ContactLocations={"locations[].lat":{verb:"pii"},"locations[].lng":{verb:"pii"},"locations[].mapsUrl":{verb:"pii"},"locations[].geocode":{verb:"pii"}};var $Oe=Object.fromEntries(Object.entries(nm).map(([e,o])=>[e,Object.keys(o)])),UOe=Object.fromEntries(Object.entries(sm).map(([e,o])=>[e,[...o]]));import{NoControlMark as X9}from"efficient-easel/screen/lib/document/panel-no-control-mark";var oR=Y9(!1);function tR({children:e}){return zb(oR.Provider,{value:!0,children:e})}function Z9(){return q9(oR)}function rR({name:e,children:o}){return!Z9()||!e||!J9(e)||Vn(e)?zb(V9,{children:o}):zb(X9,{})}function J9(e){return/^[A-Za-z0-9_$]+$/u.test(e)}var Gb="off",nR="none",jb=[{label:"None",value:"off"},{label:"1, 2, 3",value:"plain"},{label:"01, 02, 03",value:"padded"},{label:"N\xB001, N\xB002",value:"numero"}],sR=[{label:"None",value:"none"},{label:"Hairline",value:"hairline"}];function XOe(e){return xo(jb,Gb,e)}var aR="sf-card-index",Yc="sf-card-index",ZOe="pointer-events-none absolute left-[18px] top-[18px] z-10 border border-line bg-bg/70 px-2 py-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.16em] text-fg-dim",Q9={plain:`counter(${Yc})`,padded:`counter(${Yc}, decimal-leading-zero)`,numero:`"N\xB0" counter(${Yc}, decimal-leading-zero)`};function JOe(e,o){return o==="off"?"":`.${e}{counter-reset:${Yc}}.${e} .${aR}{counter-increment:${Yc}}.${e} .${aR}::before{content:${Q9[o]}}`}function QOe(e){return e==="hairline"?"border border-line hover:border-accent":""}var iR=[{value:"1",label:"1st rendering"},{value:"2",label:"2nd rendering"},{value:"3",label:"3rd rendering"},{value:"4",label:"4th rendering"},{value:"5",label:"5th rendering"}];import{SCALAR_TEXT_CONTROLS as jQ}from"efficient-easel/draw";import{jsx as It}from"react/jsx-runtime";import{SettingsDefaultReset as iq,SettingsField as Kb}from"efficient-easel/panel";import{useSelectedHost as lq}from"efficient-easel/easel";import{FOCAL_DEFAULT as cq}from"efficient-shell/format";import{ImageIcon as Vb,PlayIcon as cR}from"efficient-easel/icons";import{ImageFocusPoint as dq,MediaUploadField as fq}from"efficient-shell/ui";import{useContext as pq}from"react";import{ScreenDocumentContext as uq}from"efficient-easel/screen/components/ScreenDocumentContext";import{tabletKey as mq,viewKeyAt as hq}from"efficient-easel/draw";import{usePreviewDevice as xq}from"efficient-easel/draw/client";import{formatFocal as eq,parseFocal as oq}from"efficient-shell/format";var tq="sf-focus-phone",rq="--sf-focus-phone",aq="sf-focus-tablet",nq="--sf-focus-tablet",qc=e=>{if(typeof e!="string"||!/^\s*-?\d+(\.\d+)?%\s+-?\d+(\.\d+)?%\s*$/.test(e))return null;let{x:o,y:t}=oq(e);return eq(o,t)};function lR(e,o){return Kn(sq,null,qc(o),qc(e))}var sq={tabletClass:aq,tabletVar:nq,phoneClass:tq,phoneVar:rq};import{shownTier as Yb}from"efficient-easel/screen/lib/document/device-fields";import{onDesktopWords as gq}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as Iq}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as yq}from"efficient-easel/screen/lib/host";import{useEaselSession as bq}from"efficient-easel/screen/lib/session-context";function Sq(e,o,t,r=!0){let a=Yb(t),n=typeof e[o]=="string"&&e[o]?String(e[o]):cq;if(a==="desktop")return{ownView:!1,followed:n,followsView:"desktop",own:void 0,focus:n,key:o};let s=hq(o,a),i=qc(e[s])??void 0,l=a==="mobile"&&r?qc(e[mq(o)])??void 0:void 0,d=l??n;return{ownView:!0,followed:d,followsView:l?"tablet":"desktop",own:i,focus:i??d,key:s}}function wq(e,o,t){let r=lq();if(!o||!r)return null;let a=r.values??{};if(t&&!t(a,Yb(e)))return null;let n=Sq(a,o,e,t?t(a,"tablet"):!0),s=r.onChange;return{...n,set:i=>s(n.key,i),clear:()=>s(n.key,om)}}function dR({value:e,onChange:o,label:t,accept:r,placeholder:a,focusKey:n,focusWhen:s,frameKey:i,fieldKey:l}){let d=yq(),f=bq(),u=c(t),p=xq(),m=r.startsWith("video"),h=wq(p,m?void 0:n,s),I=!!n&&Yb(p)!=="desktop",w=pq(uq),S=ur(),v=i&&l?{video:l,frame:i}:null,b=O=>Iq(d,{accept:r,title:u,...O?{file:O}:{}}).then(D=>!D||!v?D?.url??null:(S({[v.video]:D.url,[v.frame]:D.posterUrl??""}),null)),y=v?O=>O?o(O):S({[v.video]:"",[v.frame]:""}):o,k=it(e);if(I&&(!h||!k))return null;if(w&&!w.capabilities.mediaEditing)return It(Kb,{label:u,icon:m?It(cR,{}):It(Vb,{}),children:It("div",{className:"sf-image-slot-inert",children:m?c("Templates don\u2019t store videos \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created."):c("Templates don\u2019t store images \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created.")})});let L=h?.ownView&&k?It(iq,{words:ce()?.panel,label:c("Image focus"),changed:!!h.own,detail:gq(O=>c(O),h.followed,h.followsView),onReset:h.clear}):void 0;return I&&h?It(Kb,{label:u,icon:It(Vb,{}),action:L,children:It("div",{style:{flex:"1 1 auto",minWidth:0},children:It(dq,{value:h.focus,onChange:h.set,label:c("Image focus"),image:k,hint:null})})}):It(Kb,{label:u,icon:m?It(cR,{}):It(Vb,{}),children:It("div",{style:{flex:"1 1 auto",minWidth:0},children:It(fq,{value:k,onChange:y,onPick:b,accept:m?"video/*":"image/*",kind:m?"video":"image",placeholder:a===void 0?void 0:c(a),maxSizeBytes:Ge(f).media.maxUploadBytes,...h?{focus:h.focus,onFocusChange:h.set}:{}})})})}import{jsx as fR}from"react/jsx-runtime";import{useId as Cq}from"react";import{FieldSelect as vq}from"efficient-easel/fields";import{SettingsField as kq}from"efficient-easel/panel";function Tq(e){return e.map(({value:o,label:t,note:r})=>({value:o,label:t,...r?{meta:r}:{}}))}function pR({label:e,options:o,value:t,onChange:r,emptyLabel:a,icon:n,hint:s}){let i=Cq(),l=`${i}-label`,d=`${i}-button`,f=Array.isArray(t)?t:[];return fR(kq,{label:c(e),labelId:l,icon:n,hint:s,children:fR(vq,{id:d,multiple:!0,value:f,options:Tq(o),onChange:r,placeholder:a===void 0?c("None"):c(a),ariaLabelledBy:`${l} ${d}`,inline:!0})})}import{jsx as ko,jsxs as qn,Fragment as oX}from"react/jsx-runtime";import{useCallback as kR,useContext as tX,useId as ER,useRef as TR,useState as PR}from"react";import{ThemeIcon as rX}from"efficient-easel/icons";import{Button as aX,useClickOutside as nX}from"efficient-shell/ui";import{SettingsField as sX}from"efficient-easel/panel";import{ScreenDocumentContext as iX}from"efficient-easel/screen/components/ScreenDocumentContext";import{jsx as he,jsxs as qa,Fragment as Bq}from"react/jsx-runtime";import{parseHexColor as Nq}from"efficient-shell/format";import{Button as Xb,IconButton as Dq,Tooltip as Mq}from"efficient-shell/ui";import{jsx as Ya,jsxs as Pq}from"react/jsx-runtime";import{AccentIcon as Eq}from"efficient-easel/icons";import{Button as _q,Tooltip as Oq}from"efficient-shell/ui";function qb(e){return ht(e).background}function Aq(e){let o=Ma(e.accent,qb(e));return o===null?null:{ratio:o,grade:Si(o)}}function Rq(e){let o=qb(e),t=Ma(e.accent,o);return t===null?[]:b_(e.accent).filter(r=>{let a=Ma(r,o);return a!==null&&a>t&&Si(a)==="good"})}var Lq={good:"Easy to read","large-only":bi["large-only"],hard:bi.hard};function uR({value:e,onChange:o}){let t=Aq(e),r=t?.grade,a=t&&t.grade!=="good"?Rq(e):[];return Ya(gt,{label:c("Main color"),icon:Ya(Eq,{}),hint:t?c(Lq[t.grade]):void 0,value:e.accent,onChange:n=>o({...e,accent:n}),children:a.length>0?Ya("div",{className:"w-full min-w-0",children:Pq("div",{className:"sf-readability",children:[Ya("p",{className:"sf-readability-advice",children:Fq(r,!0)}),Ya("div",{className:"sf-readability-suggestions",children:a.map(n=>{let s=Ma(n,qb(e));return Ya(Oq,{content:c("Use {colour}",{colour:n.toUpperCase()}),children:Ya(_q,{variant:"secondary",className:"sf-readability-suggestion",leftIcon:Ya("span",{className:"sf-readability-chip",style:{background:n},"aria-hidden":!0}),onClick:()=>o({...e,accent:n}),children:s?`${s.toFixed(1)}:1`:n.toUpperCase()})},n)})})]})}):null})}function Fq(e,o){return e?e==="good"?c("This color reads clearly on your pages."):o?c("This color is hard to read on this theme's page. The buttons below are the same hue, darkened."):c("This color is hard to read on your page background. Pick one further from it \u2014 lighter if your pages are dark, deeper if they are light."):c("Pick a color to see how it reads.")}import{ButtonIcon as Hq,ChevronDownIcon as hR,ChevronUpIcon as Wq,GroundIcon as $q,LayoutIcon as Uq,SquareIcon as zq,TextSmallIcon as Gq,TypeIcon as mR}from"efficient-easel/icons";var Xc=e=>c("Theme {n}",{n:e+1});function xR({colors:e}){let o=ht(e),t=kc(e)??o.accent;return qa("span",{className:"sf-theme-page",style:{background:o.background,color:o.text},"aria-hidden":!0,children:[he("span",{className:"sf-theme-eyebrow",style:{color:o.muted},children:c("label")}),qa("span",{className:"sf-theme-headline",children:[c("Heading")," ",he("span",{style:{color:o.accent},children:c("main")})]}),he("span",{className:"sf-theme-body",children:c("body text")}),qa("span",{className:"sf-theme-row",children:[he("span",{className:"sf-theme-btn",style:{background:t,color:Oy(e,o.accent)},children:c("button")}),he("span",{className:"sf-theme-mini",style:{background:o.surface,borderColor:o.line},children:c("card")})]})]})}var Zb={"Text color":he(mR,{}),"Label color":he(Gq,{}),Background:he($q,{}),"Panels & cards":he(Uq,{}),Borders:he(zq,{}),"Button color":he(Hq,{}),"Button text color":he(mR,{})};function jq({label:e,colorKey:o,value:t,onChange:r,idPrefix:a="sf-theme-ink"}){let n=`${a}-${o}`;return he(gt,{label:c(e),icon:Zb[e],id:n,value:t,onChange:s=>r(o,s)})}function Kq({value:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button`,n=e!==void 0&&Nq(e)===e.toLowerCase(),s=n?e:o;return he(gt,{label:c("Button color"),icon:Zb["Button color"],id:a,value:s,caption:n?s:c("Main"),onChange:t})}function Vq({colors:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button-ink`,n=v_(e),s=Oy(e,o),i=kc(e)??o,l=Si(Ma(s,i)??0);return he(gt,{label:c("Button text color"),icon:Zb["Button text color"],hint:n&&l!=="good"?c("{grade} on the button",{grade:c(bi[l])}):void 0,id:a,value:s,caption:n?s:c("Auto"),onChange:t})}var Yq=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Jb({colors:e,onChange:o,idPrefix:t}){let r=ht(e);return he(Bq,{children:Yq.map(a=>"colour"in a?he(uR,{value:e,onChange:o},"colour"):"moduleBreak"in a?he("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in a?he(Kq,{value:e.button,accent:r.accent,onChange:n=>o({...e,button:n}),idPrefix:t},"button"):"buttonInk"in a?he(Vq,{colors:e,accent:r.accent,onChange:n=>o({...e,buttonInk:n}),idPrefix:t},"buttonInk"):he(jq,{label:a.label,colorKey:a.key,value:r[a.key],onChange:(n,s)=>o({...e,[n]:s}),idPrefix:t},a.key))})}function im({index:e,colors:o,selected:t,role:r="radio",open:a,editable:n=!0,onPick:s,onEdit:i,onChangeColors:l}){let d=ht(o),f=Xc(e),u=e<_y.length&&!o.brandInk?_y[e]:null,p=Si(Ma(d.text,d.background)??0),m=u?JSON.stringify(o)!==JSON.stringify(u):!1,h=a!==void 0;return qa("div",{className:`sf-theme-card${t?" is-selected":""}`,children:[he("button",{type:"button",role:r,"aria-checked":r==="radio"?t:void 0,"aria-selected":r==="option"?t:void 0,"aria-label":f,className:"sf-theme-pick",onClick:s,children:he(xR,{colors:o})}),qa("div",{className:"sf-theme-foot",children:[he("span",{className:"sf-theme-name",children:f}),p!=="good"&&he("span",{className:"sf-theme-warn",children:c(bi[p])}),n&&i&&h&&he("span",{className:"sf-theme-edit",children:he(Mq,{content:a?c("Collapse"):c("Edit colors"),children:he(Dq,{size:"sm","aria-expanded":a,"aria-controls":`sf-theme-colours-${e}`,"aria-label":a?c("Collapse {name}",{name:f}):c("Edit colors for {name}",{name:f}),onClick:i,children:a?he(Wq,{size:14}):he(hR,{size:14})})})}),n&&i&&!h&&he(Xb,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:f}),onClick:i,children:c("Edit")})]}),a&&qa("div",{id:`sf-theme-colours-${e}`,className:"sf-theme-colours",children:[he(Jb,{colors:o,onChange:I=>l?.(I)}),u&&he(Xb,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!m,onClick:()=>l?.({...u}),children:m?c("Reset {name} to the preset",{name:f}):c("Not changed")})]})]})}function gR({colors:e,name:o,nameId:t,open:r,menuId:a,labelId:n,buttonRef:s,onClick:i,onKeyDown:l,onEdit:d}){return qa("div",{className:"sf-secttheme-btn",children:[he("button",{ref:s,type:"button",className:"sf-theme-pick","aria-expanded":r,"aria-controls":a,"aria-labelledby":`${n} ${t}`,onClick:i,onKeyDown:l,children:e?he(xR,{colors:e}):he("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),qa("div",{className:"sf-theme-foot",children:[he("span",{id:t,className:"sf-theme-name",children:o}),d&&he(Xb,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:o}),onClick:d,children:c("Edit")}),he("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:i,children:he(hR,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}import{useCallback as aS,useEffect as wR,useRef as fm}from"react";import{currentEaselSession as Zq}from"efficient-easel/screen/lib/session";import{useEaselSession as Jq}from"efficient-easel/screen/lib/session-context";import{useSyncExternalStore as qq}from"react";var yR,Qb=null,Yn=null,lm=0,eS=new Set;function oS(e){yR=e;for(let o of eS)o()}function tS(e){Qb=e,lm+=1,Yn&&clearTimeout(Yn),Yn=null,oS(void 0)}function cm(e){lm+=1,oS(e)}function ma(e=250){Qb&&(Yn&&clearTimeout(Yn),Yn=setTimeout(()=>{Yn=null;let o=Qb;if(!o)return;let t=++lm;o().then(r=>{t===lm&&oS(r)}).catch(()=>{})},e))}function IR(){return yR}function Xq(e){return eS.add(e),()=>{eS.delete(e)}}function dm(){return qq(Xq,IR,IR)}var rS=new Set;function bR(e){return rS.add(e),()=>{rS.delete(e)}}async function SR(){let e=(await Promise.allSettled([...rS].map(async o=>o()))).find(o=>o.status==="rejected");if(e)throw e.reason}import{WebsiteBackendError as Qq}from"efficient-easel/screen/lib/backend-error";function CR(e=Zq()){return(o,t,r)=>{let a=Ge(e).theme;return a?a.update(o,r?{siteId:r}:void 0):Promise.reject(new Qq("invalid","This backend stores no site theme."))}}function vR(e){return e.themeFromDocument?{status:"skipped",reason:"template"}:e.token?null:{status:"skipped",reason:"no-token"}}async function eX(e,o=CR()){let{themeFromDocument:t,token:r,siteId:a,patch:n}=e,s=vR({themeFromDocument:t,token:r});if(s)return s;if(Object.keys(n).length===0)return{status:"skipped",reason:"empty"};try{return await o(n,r,a??void 0),{status:"saved"}}catch(i){return{status:"failed",error:i}}}function Wi({themeFromDocument:e,tokenRef:o,siteId:t,onResult:r}){let a=fm(null),n=fm({}),s=Jq(),i=fm(r);i.current=r;let l=fm(null),d=aS(p=>{if(p.status==="skipped"){let m=`skipped:${p.reason}`;if(l.current===m)return;l.current=m}else l.current=null;i.current?.(p)},[]),f=aS(async()=>{a.current&&(clearTimeout(a.current),a.current=null);let p=n.current;n.current={};let m=await eX({themeFromDocument:e,token:o?.current,siteId:t,patch:p},CR(s));return d(m),m.status==="saved"&&ma(),m.status==="failed"&&(n.current={...p,...n.current}),m},[e,o,t,d,s]),u=aS((p,m=!1)=>{let h=vR({themeFromDocument:e,token:o?.current});if(h){d(h);return}n.current={...n.current,...p},a.current&&clearTimeout(a.current),m?f():a.current=setTimeout(()=>{f()},500)},[e,o,f,d]);return wR(()=>()=>{f()},[f]),wR(()=>bR(async()=>{if(!a.current&&Object.keys(n.current).length===0)return;let p=await f();if(p.status==="failed")throw p.error}),[f]),{persist:u,flush:f}}var nS="Follow the page",_R="Follow the slideshow",lX=e=>c("Editing {name} changes it everywhere.",{name:e});function cX({colors:e}){if(!e)return ko("span",{className:"sf-secttheme-chip sf-secttheme-chip--none","aria-hidden":"true"});let o=ht(e);return qn("span",{className:"sf-secttheme-chip","aria-hidden":"true",children:[ko("i",{style:{background:o.background}}),ko("i",{className:"sf-secttheme-chip-accent",style:{background:o.accent}})]})}function dX({themes:e,value:o,onPick:t,onEdit:r,menuId:a,followLabel:n}){return qn("div",{className:"sf-multi-menu sf-secttheme-menu",id:a,role:"listbox",children:[n!==void 0&&qn(oX,{children:[qn("button",{type:"button",role:"option","aria-selected":o===null,className:`sf-secttheme-item${o===null?" is-active":""}`,onClick:()=>t(Hr),children:[ko(cX,{}),ko("span",{className:"sf-secttheme-name",children:c(n)})]}),ko("div",{className:"sf-secttheme-sep",role:"presentation"})]}),o!==null&&e[o]&&ko("p",{className:"sf-secttheme-oncard",role:"presentation",children:c("{name} is on this section",{name:Xc(o)})}),e.map((s,i)=>i===o?null:ko(im,{role:"option",index:i,colors:s,selected:!1,onPick:()=>t(i),onEdit:()=>r(i)},i))]})}function fX({index:e,colors:o,onChange:t,onDone:r}){let a=Xc(e),n=ER();return qn("div",{className:"sf-secttheme-sheet",children:[qn("div",{className:"sf-secttheme-sheet-head",children:[ko("span",{children:a}),ko(aX,{variant:"secondary",className:"sf-secttheme-done",onClick:r,children:c("Done")})]}),ko("div",{className:"sf-secttheme-rows",children:ko(Jb,{colors:o,onChange:t,idPrefix:n})}),ko("p",{className:"sf-secttheme-warn",children:lX(a)})]})}function OR({value:e,onChange:o,followLabel:t,hint:r}){let{theme:a,setTheme:n}=fe(),s=vo(a),i=tX(iX),l=i?.tokenRef,d=i?.siteId??null,f=!i?.capabilities?.hasSiteTheme,{persist:u,flush:p}=Wi({themeFromDocument:f,tokenRef:l,siteId:d}),m=vo(s),h=m.themes,I=Wr(e),w=I!==null?h[I]:void 0,S=w??(h.length?yi(m):void 0),[v,b]=PR(!1),[y,k]=PR(null),L=TR(null),O=TR(null),D=ER(),T=kR(()=>{b(!1),k(null)},[]),F=kR(()=>{!v&&y===null||(p(),T())},[v,y,T,p]);nX(L,F);let C=P=>{o(P),T()},R=P=>{if(y===null)return;let _=h.map((G,Z)=>Z===y?P:G),W={...m,themes:_};n(W),u({selected_preset:W.selected,theme_presets:W.themes})};return qn("div",{className:"sf-secttheme",ref:L,children:[ko(sX,{label:c("Theme"),icon:ko(rX,{}),labelId:`${D}-label`,hint:r,children:ko(gR,{colors:S,onEdit:I!==null?()=>{k(I),b(!1)}:void 0,name:w?Xc(I):c(t??nS),nameId:`${D}-value`,labelId:`${D}-label`,open:v,menuId:D,buttonRef:O,onClick:()=>{k(null),b(P=>!P)},onKeyDown:P=>{P.key==="Escape"&&(v||y!==null)&&(P.preventDefault(),T())}})}),v&&y===null&&ko("div",{onKeyDown:P=>{P.key==="Escape"&&(P.preventDefault(),T(),O.current?.focus())},children:ko(dX,{themes:h,value:I,onPick:C,onEdit:P=>{k(P),b(!1)},menuId:D,followLabel:t})}),y!==null&&h[y]&&ko(fX,{index:y,colors:h[y],onChange:R,onDone:()=>{p(),T(),O.current?.focus()}})]})}import{jsx as AR}from"react/jsx-runtime";import{useId as pX}from"react";import{FieldSelect as uX}from"efficient-easel/fields";import{SettingsField as mX}from"efficient-easel/panel";function hX(e){return e.map(({value:o,label:t,group:r,thumb:a,meta:n})=>({value:o,label:t,...r!==void 0?{group:r}:{},...a!==void 0?{thumb:a}:{},...n!==void 0?{meta:n}:{}}))}function vAe({label:e,options:o,fallback:t,value:r,onChange:a,placeholder:n,bare:s=!1,icon:i}){let l=pX(),d=`${l}-label`,f=`${l}-button`,u=r??"",p=o.some(w=>w.value===u)?u:t,m=c(e),h=n===void 0?void 0:c(n),I=AR(uX,{id:f,value:p,options:hX(o),onChange:a,placeholder:h,searchPlaceholder:h,...s?{ariaLabel:m}:{ariaLabelledBy:`${d} ${f}`},searchable:!0,groupCount:!0,inline:!0});return s?I:AR(mX,{label:m,labelId:d,icon:i,children:I})}import{jsx as Zn,jsxs as YX}from"react/jsx-runtime";import{SettingsField as eL}from"efficient-easel/panel";import{LinkIcon as qX}from"efficient-easel/icons";import{LinkPicker as XX,TextLinkField as ZX}from"efficient-shell/ui";import{useEffect as QR,useMemo as xm,useRef as JX,useState as hm}from"react";import{currentEaselSession as xX}from"efficient-easel/screen/lib/session";function RR(){return xX().auth.token}import{currentEaselSession as QX}from"efficient-easel/screen/lib/session";import{useScreenDocument as eZ}from"efficient-easel/screen/components/ScreenDocumentContext";var gX=()=>({choosePage:c("Choose a page"),chooseSection:c("Choose a section"),noSections:c("No section anchors yet"),sectionHint:c("Jumps to a section on that page."),choosePost:c("Choose a post"),chooseProduct:c("Choose a product"),choosePopup:c("Choose a popup")});function LR(e,o,t){if(!e)return"page";if(xA(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(yA(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||o.includes(r))return"anchor"}return e==="/"||o.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function sS(e,o){let t=gX(),r=e.pages.map(f=>({value:zc(f.slug),label:f.title})),a=o?.pageOptions?o.pageOptions(r):r,n=a.map(f=>f.value),s=e.pages.map(f=>({label:f.title,options:IA(...f.docs).map(u=>({value:Wu(f.slug,u.slug),label:u.name}))})).filter(f=>f.options.length>0),i=f=>{switch(f){case"page":return{type:"select",options:a,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:s,placeholder:s.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:gA(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:hA(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=mA(e.offers).map(f=>({value:f.value,label:c(f.label),target:i(f.value),...f.value==="anchor"?{hint:t.sectionHint}:{},...f.value==="blog"||f.value==="product"||f.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!o)return{kinds:l,rules:{kindOf:f=>LR(f,n),targetOf:f=>f,readFilter:()=>null,withFilter:f=>f}};let d=f=>{let u=o.withFilter(f,null);return o.listingPaths.includes(u)?u:f};return{kinds:l,rules:{kindOf:f=>LR(f,n,{listingPaths:o.listingPaths,targetOf:d}),targetOf:d,readFilter:o.readFilter,withFilter:o.withFilter},filtersFor:f=>o.listingPaths.includes(f)?o.filtersFor(f):null}}import{useEaselSession as oZ}from"efficient-easel/screen/lib/session-context";function Mo(e,o){if(typeof e=="string")return e||o;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return be(t)??o}return o}function FR(e,o){return q(e)??o}function ha(e,o){return typeof e=="boolean"?e:o}function pm(e,o){if(!Array.isArray(e))return o;let t=e.map(r=>typeof r=="string"?r:Mo(r?.text,"")).map(r=>r.trim()).filter(Boolean);return t.length?t:o}var NR=["delay","scroll","exit"],DR=["all","chosen","except"],MR=["visit","days","never","once"],IX=["all","desktop","phone"],yX=["stop","continue"],HR={min:0,max:60},WR={min:10,max:90},$R={min:1,max:90},mr={autoOpen:!1,trigger:"delay",autoOpenDelaySec:15,scrollPercent:50,showOn:"all",showOnPages:[],devices:"all",hideAfter:"days",hideDays:7,afterSubmit:"stop",startDate:null,endDate:null};function _t(e,o,t){return typeof o=="string"&&e.includes(o)?o:t}function $i(e,o,t){let r=FR(e,t);return Math.min(o.max,Math.max(o.min,Math.round(r)))}function bX(e){return typeof e.hideAfter=="string"?_t(MR,e.hideAfter,mr.hideAfter):e.oncePerSession===!0?"visit":e.oncePerSession===!1?"never":mr.hideAfter}function SX(e){return Array.isArray(e)?e.map(o=>typeof o=="string"?o.trim():"").filter(Boolean).map(o=>o.startsWith("/")?o:`/${o}`):[]}function BR(e){if(typeof e!="string")return null;let o=e.trim();return/^\d{4}-\d{2}-\d{2}$/.test(o)?o:null}function UR(e){let o=e??{},t=mr;return{autoOpen:ha(o.autoOpen,t.autoOpen),trigger:_t(NR,o.trigger,t.trigger),autoOpenDelaySec:$i(o.autoOpenDelaySec,HR,t.autoOpenDelaySec),scrollPercent:$i(o.scrollPercent,WR,t.scrollPercent),showOn:_t(DR,o.showOn,t.showOn),showOnPages:SX(o.showOnPages),devices:_t(IX,o.devices,t.devices),hideAfter:bX(o),hideDays:$i(o.hideDays,$R,t.hideDays),afterSubmit:_t(yX,o.afterSubmit,t.afterSubmit),startDate:BR(o.startDate),endDate:BR(o.endDate)}}import{parseHexColor as wX}from"efficient-shell/format";var hr="#000000";var iS="popup",CX=J_,vX=["auto","full"],kX=["inside","outside","none"],TX={min:240,max:1440},PX={min:0,max:100},Zc={placement:"center",fullWidth:!1,width:720,height:"auto",tintColor:hr,tintOpacity:60,outsideClick:!0,closeButton:"inside"};function EX(e,o){let t=typeof e=="string"?e.trim():"";return t&&wX(t)===t.toLowerCase()?t:o}function lS(e,o=Zc){let t=e??{},r=o;return{placement:_t(CX,t.placement,r.placement),fullWidth:ha(t.fullWidth,r.fullWidth),width:$i(t.width,TX,r.width),height:_t(vX,t.height,r.height),tintColor:EX(t.tintColor,r.tintColor),tintOpacity:$i(t.tintOpacity,PX,r.tintOpacity),outsideClick:ha(t.outsideClick,r.outsideClick),closeButton:_t(kX,t.closeButton,r.closeButton)}}var zR="cart-drawer",KAe="cart-drawer",_X={kickerBadge:"",kickerText:"Your order",titleLead:"Your",titleAccent:"cart.",subtitleEmpty:"Empty for now.",subtitleOne:"One set in your cart.",subtitleMany:"{count} sets in your cart.",leadTimeValue:"",shipsToFallback:"",promises:[],emptyKicker:"No wheels yet",emptyBody:"Your cart is empty. Pick a wheel to get started."};function VAe(e,o){return o===0?e.subtitleEmpty:o===1?e.subtitleOne:e.subtitleMany.replace("{count}",String(o))}function YAe(e){let o=e??{},t=_X;return{kickerBadge:Mo(o.kickerBadge,t.kickerBadge),kickerText:Mo(o.kickerText,t.kickerText),titleLead:Mo(o.titleLead,t.titleLead),titleAccent:Mo(o.titleAccent,t.titleAccent),subtitleEmpty:Mo(o.subtitleEmpty,t.subtitleEmpty),subtitleOne:Mo(o.subtitleOne,t.subtitleOne),subtitleMany:Mo(o.subtitleMany,t.subtitleMany),leadTimeValue:Mo(o.leadTimeValue,t.leadTimeValue),shipsToFallback:Mo(o.shipsToFallback,t.shipsToFallback),promises:pm(o.promises,t.promises),emptyKicker:Mo(o.emptyKicker,t.emptyKicker),emptyBody:Mo(o.emptyBody,t.emptyBody)}}var OX=["right","left"],AX={...Zc,width:520,tintOpacity:68};function qAe(e){let o=e??{};return{...lS(o,AX),placement:_t(OX,o.placement,"right"),height:"full",fullWidth:!1,autoOpen:ha(o.autoOpen,!0)}}var jR="consent-banner",QAe="consent-banner";var RX=[{value:"bar",label:"Bar"},{value:"card",label:"Card"}],eRe="Layout",GR={layout:"bar"},LX=e=>RX.some(o=>o.value===e);function oRe(e){let o=Mo((e??{}).layout,GR.layout);return{layout:LX(o)?o:GR.layout}}var tRe={...Zc,placement:"bottom-center",fullWidth:!0,width:440,tintOpacity:0,outsideClick:!1,closeButton:"none"};var FX="consentWords",BX=["eyebrow","notice","accept","reject","choose"];function cS(e){let o=(e??{})[FX];return typeof o=="string"&&BX.includes(o)?o:null}function dS(e){let o=e?.props;return o?cS(o)!==null?!0:Object.values(o).some(t=>Array.isArray(t)&&t.some(r=>r&&typeof r=="object"&&"props"in r&&dS(r))):!1}var NX=["meta","eyebrow","heading","body","statName","statValue","formEyebrow","formHeading","formIntro","fieldLabel","option","finePrint","dismiss","doneHeading","doneBody"],nRe={meta:"Meta line",eyebrow:"Eyebrow",heading:"Heading",body:"Body",statName:"Stat name",statValue:"Stat value",formEyebrow:"Form eyebrow",formHeading:"Form heading",formIntro:"Form intro",fieldLabel:"Field label",option:"Option",finePrint:"Fine print",dismiss:"Dismiss link",doneHeading:"Success heading",doneBody:"Success message"},DX={meta:"styleMeta",eyebrow:"styleEyebrow",heading:"styleHeading",body:"styleBody",statName:"styleStatName",statValue:"styleStatValue",formEyebrow:"styleFormEyebrow",formHeading:"styleFormHeading",formIntro:"styleFormIntro",fieldLabel:"styleFieldLabel",option:"styleOption",finePrint:"styleFinePrint",dismiss:"styleDismiss",doneHeading:"styleDoneHeading",doneBody:"styleDoneBody"},sRe={meta:{font:"--pp-meta-font",size:"--pp-meta-size"},eyebrow:{font:"--pp-eyebrow-font",size:"--pp-eyebrow-size"},heading:{font:"--pp-heading-font",size:"--pp-heading-size"},body:{font:"--pp-body-font",size:"--pp-body-size"},statName:{font:"--pp-statname-font",size:"--pp-statname-size"},statValue:{font:"--pp-statvalue-font",size:"--pp-statvalue-size"},formEyebrow:{font:"--pp-formeyebrow-font",size:"--pp-formeyebrow-size"},formHeading:{font:"--pp-formheading-font",size:"--pp-formheading-size"},formIntro:{font:"--pp-formintro-font",size:"--pp-formintro-size"},fieldLabel:{font:"--pp-fieldlabel-font",size:"--pp-fieldlabel-size"},option:{font:"--pp-option-font",size:"--pp-option-size"},finePrint:{font:"--pp-fineprint-font",size:"--pp-fineprint-size"},dismiss:{font:"--pp-dismiss-font",size:"--pp-dismiss-size"},doneHeading:{font:"--pp-doneheading-font",size:"--pp-doneheading-size"},doneBody:{font:"--pp-donebody-font",size:"--pp-donebody-size"}};function KR(e){let o={};for(let t of NX){let r=aa(e[DX[t]]);r&&(o[t]=r)}return o}var VR={heading:"Join our email list",placeholder:"Email address",buttonLabel:"Subscribe"},MX={lead:"We accept"},mm={...MX,methods:[],size:"sm",align:"start",dataSource:gp},xr="site-footer";var cRe=xr,dRe={desktop:!0,tablet:!0,mobile:!0},fRe={desktop:!1,tablet:!1,mobile:!1},fS=1,YR=6,pRe=Array.from({length:YR-fS+1},(e,o)=>fS+o),um={desktop:6,tablet:3,mobile:2},HX={2:{desktop:2,tablet:2,mobile:1},3:{desktop:3,tablet:3,mobile:1},4:{desktop:4,tablet:2,mobile:2},5:{desktop:5,tablet:3,mobile:2},6:{desktop:6,tablet:3,mobile:2}},Xn=e=>Math.min(Math.max(Math.round(e),fS),YR);function uRe(e){if(typeof e=="number")return HX[Xn(e)]??{desktop:Xn(e),tablet:Xn(e),mobile:Xn(e)};if(e&&typeof e=="object"){let o=e;return{desktop:Xn(o.desktop??um.desktop),tablet:Xn(o.tablet??um.tablet),mobile:Xn(o.mobile??um.mobile)}}return{...um}}var pS="subscribe-popup",SRe="subscribe-popup",WX=[pS,xr,zR,jR];function XR(e){return WX.includes(e)}var $X=["right","left"],UX={metaLabel:"Meta label",issueLabel:"Label",issueNumber:"00",kicker:"Kicker",heading:`Main heading
1
+ import{$ as wp,$a as mE,$c as Fp,$d as wy,$h as gO,A as ni,Ab as PE,Ac as uy,Ad as Sc,Ae as ky,Af as k_,Ag as Dn,Ah as _c,Ai as PO,Ba as q,Bb as pi,Bc as DE,Be as n_,Bf as Vp,C as mc,Ca as kp,Cb as sa,Cd as Tt,Ce as s_,Cf as T_,Cg as Z_,D as yp,Db as _p,Dc as ME,Dd as ut,De as zp,Df as P_,Dg as J_,E as Br,Ed as io,Ee as i_,Ef as E_,Ei as EO,F as si,Fa as Mt,Fc as my,Fd as Dr,Fe as Ty,Ff as Yp,G as so,Ga as cr,Gd as Mr,Gf as __,Gi as _O,H as ho,Ha as di,Hd as fr,He as l_,Hf as qp,I as ii,Ia as ZI,Ib as EE,Id as hi,Ie as Gp,If as Ay,J as bp,Ja as aE,Jd as VE,Je as c_,Jf as O_,K as $,Ka as JI,Kd as Bp,Ke as Py,Kf as Ry,Ki as fe,L as He,La as QI,Lb as Op,Ld as YE,Le as d_,Lf as A_,Lh as iO,M as M0,Mc as HE,Me as f_,Mf as Xp,Mh as lO,N as H0,Nb as Ap,Nc as WE,Ne as jp,Nf as nt,Nh as au,Oc as hy,Oe as gi,Of as Ha,Oh as cO,Oi as Oc,P as W0,Pa as ey,Pd as Ln,Pe as Me,Pf as R_,Pg as Q_,Ph as dO,Pi as RO,Q as Sp,Qa as nE,Qb as _E,Qd as qE,Qe as Ee,Qf as Zp,Qg as Ny,Qh as fO,R as $0,Ra as sE,Rb as OE,Rd as Np,Re as p_,Rf as Ht,Rg as Qp,Rh as pO,Ri as gu,S as En,Sa as uo,Sd as xi,Se as Ii,Sf as wi,Sg as eO,Si as LO,T as U0,Ta as iE,Tb as AE,Tc as j,Td as wc,Te as u_,Tg as Dy,Th as uO,Ti as FO,U as z0,Ua as Tp,Uc as ne,Ud as Cc,Ue as Kp,Uf as L_,Ug as oO,Uh as mO,V as hc,Va as lE,Vb as iy,Vc as xy,Vd as Sy,Ve as Bn,Vf as F_,Vg as tO,Vh as Ti,W as qI,Wa as cE,Wc as N,We as m_,Wf as Ly,Wg as eu,Wh as hO,X as De,Xa as dE,Xc as Zo,Xd as XE,Xg as rO,Xh as nu,Y,Ya as fE,Yc as ia,Yd as ZE,Yg as ca,Yh as xO,Z as G0,Za as pE,Zc as $E,Zd as JE,Ze as Ma,Zf as B_,_a as uE,_c as U,_e as Ey,_f as Fy,_g as aO,a as ai,aa as Na,ab as hE,ad as pt,ae as QE,ai as Wa,b as be,ba as li,bb as Pp,bd as UE,bh as My,bi as IO,c as _o,ca as j0,cb as Ep,cc as ly,cd as dr,ce as Cy,ch as da,ci as yO,d as ra,da as aa,db as xE,dd as Nr,dg as N_,dh as Ci,di as bO,ea as XI,eb as gE,ec as RE,ed as gy,ef as h_,eg as D_,eh as xt,f as kt,fa as ci,fd as Da,ff as x_,fg as M_,fh as ke,fi as su,g as uc,ga as K0,gb as IE,gd as la,ge as Dp,gf as _y,gg as H_,gh as ou,gi as $a,h as A0,ha as V0,hb as yE,hd as zE,he as Mp,hf as vo,hh as nO,hi as iu,i as gp,ib as oy,ie as e_,if as g_,ig as Nn,ih as Tc,j as R0,ja as xc,jb as bE,jd as Ze,je as Hp,jf as I_,jg as W_,jh as Pt,k as L0,ka as Y0,kb as SE,kd as Rn,ke as Wp,kf as yi,kg as $_,kh as Pc,la as q0,lb as ty,lc as An,ld as yc,le as o_,lf as ht,lh as tu,li as SO,ma as X0,mb as fi,md as ui,me as t_,mg as Jp,mh as vi,mi as lu,n as F0,na as _n,nb as On,nc as cy,nd as GE,ne as $p,nf as y_,ng as U_,nh as Ec,ni as Pi,oa as Z0,ob as ry,oc as dy,od as Iy,oe as Up,of as bi,og as z_,oh as sO,oi as wO,pb as ay,pd as mi,pe as Fn,pf as Si,pg as G_,ph as ki,pi as cu,qa as J0,qb as ny,qc as Rp,qd as yy,qe as r_,qg as j_,qh as ru,qi as CO,r as B0,ra as Cp,rb as wE,rc as fy,rg as K_,ri as Ua,sa as Q0,sb as CE,sc as LE,sf as b_,sg as V_,si as vO,t as eo,ta as vp,tb as vE,tf as S_,ti as kO,u as N0,ua as eE,ub as sy,ud as jE,ue as a_,uf as w_,ug as Hr,ui as TO,v as Ip,va as oE,vb as kE,vc as py,vd as KE,vf as kc,vg as Y_,vi as Wt,w as D0,wa as tE,wb as Xo,wc as Lp,wf as C_,wg as q_,wi as du,xa as gc,xb as TE,xc as FE,xd as by,xe as mt,xf as v_,xg as By,xi as Jo,y as Ue,ya as na,yc as BE,ye as vc,yf as Oy,yg as X_,yi as me,z as Oo,za as rE,zb as Ic,zc as NE,zd as bc,ze as vy,zg as Wr}from"./chunk-QCSZZWC5.js";import{a as xo,d as OO,e as fu,f as pu,g as AO,j as uu,k as $t,l as mu,m as hu,n as xu,r as Hy}from"./chunk-SPAC3RLP.js";var NO="en",Iu=null,DO=NO,MO=null;function PPe(e,o,t){Iu=e??null,DO=o||NO,MO=t??null}function ce(){return MO}function Wy(){return DO}function HO(){return Iu}function BO(e,o){return o?e.replace(/\{([A-Za-z][A-Za-z0-9_]*)\}/g,(t,r)=>He(o,r)?String($(o,r)):t):e}function c(e,o){let t=Iu?$(Iu,e):void 0;if(typeof t=="function"){try{let r=be(t(o??{}));if(r)return r}catch{}return BO(e,o)}return BO(be(t)??e,o)}function st(e,o,t,r){return c(t===1?e:o,{...r,n:t})}import{jsx as $y,Fragment as QV,jsxs as e7}from"react/jsx-runtime";import{createContext as o7,useContext as t7}from"react";var r7={mirrorHostStyles:!0,css:null,fontHrefs:[]},WO=o7(r7);function APe({value:e,children:o}){return $y(WO.Provider,{value:e,children:o})}function Ac(){return t7(WO)}function $O(){let{css:e,fontHrefs:o}=Ac();return e7(QV,{children:[o.map(t=>$y("link",{rel:"stylesheet",href:t},t)),e?$y("style",{"data-sf-canvas-css":"",children:e}):null]})}import{jsx as a7}from"react/jsx-runtime";import{createContext as n7,useContext as s7}from"react";var UO=n7(void 0);function BPe({metadata:e,children:o}){return a7(UO.Provider,{value:e,children:o})}var zO=()=>s7(UO);import{jsx as Bo,Fragment as FV,jsxs as mp}from"react/jsx-runtime";import{useCallback as cc,useEffect as oa,useRef as QTe,useState as OV}from"react";import{SettingsSwitch as ePe}from"efficient-easel/panel";import{PagesIcon as oPe,StylesIcon as tPe}from"efficient-easel/rail";import{PaletteIcon as rPe}from"efficient-shell/icons/efficient";import{Subtree as aPe,TreeRow as BV}from"efficient-easel/tree";import{useEasel as NV}from"efficient-easel/easel";import{toItemSelector as nPe}from"efficient-easel/node-ops";import{useEaselStrings as DV}from"efficient-easel/strings";import{createContext as i7,useContext as l7}from"react";var Uy=i7(!1),MPe=()=>l7(Uy);import{useMemo as c7,useRef as d7}from"react";import{useEaselApi as f7}from"efficient-easel/easel";import{useSectionOps as p7}from"efficient-easel/screen/lib/document/use-section-ops";function yu(){let e=f7(),o=p7(),t=d7(o);return t.current=o,c7(()=>({getItemById:r=>e.getState().getItemById(r),getSelectorForId:r=>e.getState().getSelectorForId(r),get components(){return e.getState().config.components},replace:(r,a,n)=>t.current.replaceComponent(r,a,n)}),[e])}import{encodePartId as qoe}from"efficient-easel/draw";import{insertAt as Xoe,moveTo as Zoe,removeAt as Joe}from"efficient-easel/fields";import{useSyncExternalStore as Uoe}from"react";import{isNodeList as GO}from"efficient-easel/data";var jO="Flex";function Ei(e,o){return mt(e)?typeof e?.[kt]=="string"?zy(o?.[kt]):"":zy(e?.[kt])}var zy=e=>typeof e=="string"?e.trim():"",u7=e=>e.type===Oo&&Array.isArray(e.props?.[Cy])&&e.props[Cy].some(o=>zy(o?.[kt])!==""),m7=new Intl.NumberFormat("en-US");function h7(e){return/^\d+$/.test(e)?m7.format(Number(e)):e}function YPe(e,o){let t=o?o.find(r=>r.key===e)?.value:B0(uc).find(r=>r.key===e)?.value;return t===void 0?null:h7(t)}var x7={[kt]:"any"};function Gy(e,o=!1){let t=e.props;if(!t)return{node:e,names:!1};let r=e.type==="Text"&&(Ei(t)!==""||o&&Ei(t,x7)!==""),a=o||u7(e),n=ho(e,i=>so(i,l=>{let d=Gy(l,a);return d.names&&(r=!0),d.node})).props;if(e.type!==jO)return{node:n===t?e:{...e,props:n},names:r};let s=eo(n);if(r&&!s&&(n={...n,[_o]:uc}),!r&&s===uc){let{[_o]:i,...l}=n;n=l}return{node:n===t?e:{...e,props:n},names:!1}}function KO(e,o,t){for(let r of e){if(r?.props?.id===o)return t;for(let a of si(r??{})){let n=KO(a,o,r.type===jO?r:t);if(n!==void 0)return n}}}function qPe(e,o){if(!GO(e))return!0;let t=KO(e,o,null);if(t===void 0)return!0;if(t===null)return!1;let r=eo(t.props);return!r||r===uc}function VO(e){let o=e?.content;if(!GO(o))return e;let t=o.map(r=>Gy(r));return t.every((r,a)=>r.node===o[a])?e:{...e,content:t.map(r=>r.node)}}function YO(e){return Gy(e).node}import{jsx as A,jsxs as ya,Fragment as Sa}from"react/jsx-runtime";var Mn=["image","video"],Hn={image:"imageFocal",image2:"imageFocal2"},Rc={HeroSingle:"image",HeroSlide:"video"};function XO(e,o){return Mn.includes(o)?o:Rc[e]}var ZO=["one","side","stacked"],g7="one",ZPe={one:"One",side:"Side by side",stacked:"Stacked"};function bu(e){return ZO.includes(e)?e:g7}function qO(e){return e==="one"?1:2}function jy(e,o){if(ZO.includes(e))return e;let t=bu(o);return t==="side"?"stacked":t}function Lc(e){let o=bu(e.mediaLayout);return Math.max(qO(o),qO(jy(e.mediaLayoutPhone,o)))}import{cloneElement as iw,createContext as eQ,useContext as DF,useEffect as oQ,useId as MF,useRef as dd,useState as fd}from"react";import{useEasel as Km,useSelectedHost as ss}from"efficient-easel/easel";import{PIN_LENGTH as zm,toDateKey as XFe,fromDateKey as ZFe}from"efficient-shell/format";function Vy(e){return!!e&&typeof e=="object"&&!Array.isArray(e)&&typeof e.src=="string"}function it(e){return typeof e=="string"?e:Vy(e)?e.src:""}function JO(e,o,t){return Ky(e,o.split("."),t)}function Ky(e,o,t){if(o.length===0)return t(e);let[r,...a]=o,n=r.endsWith("[]"),s=n?r.slice(0,-2):r;if(!e||typeof e!="object"||Array.isArray(e))return e;let i=e;if(!(s in i))return e;let l=i[s];if(n){if(!Array.isArray(l))return e;let f=!1,u=l.map(p=>{let m=Ky(p,a,t);return m!==p&&(f=!0),m});return f?{...i,[s]:u}:e}let d=Ky(l,a,t);return d===l?e:{...i,[s]:d}}var I7=["upload","youtube"],y7="upload",o0e={upload:"Upload",youtube:"YouTube"},b7=["background","click"],S7="background",t0e={background:"Background",click:"Click to play"};function e1(e){return I7.includes(e)?e:y7}function o1(e){return b7.includes(e)?e:S7}var QO=/^[A-Za-z0-9_-]{11}$/,w7=/^(?:www\.|m\.|music\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.be)$/;function t1(e){let o=typeof e=="string"?e.trim():"";if(!o)return null;if(QO.test(o))return o;let t;try{t=new URL(/^[a-z]+:\/\//i.test(o)?o:`https://${o}`)}catch{return null}if(t.protocol!=="https:"&&t.protocol!=="http:"||!w7.test(t.hostname))return null;let r=t.pathname.split("/").filter(Boolean),a=t.hostname.endsWith("youtu.be")?r[0]:r[0]==="watch"?t.searchParams.get("v"):r[0]==="embed"||r[0]==="shorts"||r[0]==="live"||r[0]==="v"?r[1]:null;return a&&QO.test(a)?a:null}function Yy(e,o){let t=o==="click"?"autoplay=1&playsinline=1&rel=0":`autoplay=1&mute=1&loop=1&playlist=${e}&controls=0&playsinline=1&rel=0&disablekb=1`;return`https://www.youtube-nocookie.com/embed/${e}?${t}`}function r1(e){return`https://i.ytimg.com/vi/${e}/maxresdefault.jpg`}function a1(e){return`https://i.ytimg.com/vi/${e}/hqdefault.jpg`}var qy="Play video";var Xy={frame:"Video frame",image:"Image"},r0e={any:[{field:"loadingShows",is:"image"},{all:[{not:{field:"loadingShows",set:!0}},{field:"poster",set:!0}]}]};function Fc(e){let o=e.loadingShows;return o==="image"?"image":o!=null&&o!==""?"frame":it(e.poster)?"image":"frame"}function a0e(e,o="desktop"){let[t,r]=o==="phone"?[e.posterPhone,e.videoFramePhone]:[e.poster,e.videoFrame],[a,n]=Fc(e)==="image"?[t,r]:[r,t];return it(a)||it(n)||void 0}function n1(e){if(it(e.mediaVideo)){if(Fc(e)==="frame")return it(e.videoFrame)?void 0:it(e.poster)?"frame-missing-image":"frame-missing-surface";if(!it(e.poster))return it(e.videoFrame)?"image-missing-frame":"image-missing-surface"}}var Su="videoFrames",Zy="videoFramesNotOwn";function s1(e,o,t){let r=it(e.mediaVideo);if(!r||!o||Fc(e)!=="frame"||it(e.videoFrame))return;let a=o[r],n=!!it(e.poster);if(a?.state==="ready")return null;if(n)return!a||a.state==="pending"?void 0:"image-no-frame";if(!a)return t?"save-makes-frame":void 0;switch(a.state){case"pending":return a.noted!=="save"&&t?"save-makes-frame":null;case"dark":return"starts-dark";case"outside":return"outside";case"unsupported":return"unsupported";case"failed":return"failed";default:return null}}function C7(e,o){let t=it(e),r=t&&o?o[t]:void 0;return r?.state==="ready"&&r.frame?r.frame:void 0}function n0e(e,o,t){let r=t?.[Zy];if(!(Array.isArray(r)&&r.includes(e)))return C7(o,t?.[Su])}import{useSyncExternalStore as v7}from"react";function wu(){let e=new Map,o=new Set,t=r=>(o.add(r),()=>{o.delete(r)});return{get:r=>e.get(r),has:r=>e.has(r),set(r,a){if(!(e.has(r)&&e.get(r)===a)){e.set(r,a);for(let n of o)n()}},use(r){let a=()=>r?e.get(r):void 0;return v7(t,a,a)}}}var Je="SiteHeader",ze="SiteFooter",Jy="sections",Cu=[Je,ze],_i=e=>e===Je||e===ze,i1=e=>`${e}:${Jy}`;function l1(e,o,t=[]){return{type:e,props:{id:o,[Jy]:t}}}var k7=new Set(["Footer",Je,ze]);function Oi(e){let o=new Set,t=!1,r=e.filter(a=>{let n=a?.type??"";return n==="Header"?(t=!0,!1):k7.has(n)?o.has(n)?(t=!0,!1):(o.add(n),!0):!0});return t?r:e}function vu(e,o){return e.some(t=>t?.type===o.type)?e:o.type===Je?[o,...e]:[...e,o]}var c1={[Je]:{max:3,takes:["Flex","Ticker"]},[ze]:{max:6,takes:["Flex","Prose","Logos","Divider"]}};function d1(e,o,t){if(!_i(e))return!0;let r=c1[e];return t<r.max&&r.takes.includes(o)}function f1(e,o){let t=o,r=t?.props?.id;if(r==null)return null;let a=e?.content;if(!Array.isArray(a))return null;for(let n of a){if(!_i(n?.type))continue;let s=n.props?.[Jy];if(!Array.isArray(s)||!s.some(l=>l?.props?.id===r))continue;let i=c1[n.type];return i.takes.includes(t?.type??"")?s.length>=i.max?{group:n.type,why:"full"}:null:{group:n.type,why:"type"}}return null}import{locateNode as T7}from"efficient-easel/draw";function Bc(e){if(!e)return null;let o=e.lastIndexOf(":");return o>0?{ownerId:e.slice(0,o),slot:e.slice(o+1)}:null}function ku(e,o,t){let r=Bc(t?.zone),a=r?T7(e,o,r.ownerId):null;return a&&r?{...a,slot:r.slot}:null}import{isNode as P7}from"efficient-easel/data";var p1="Footer",u1=[Je,p1,ze],Wn=e=>{let o=e?.content;return Array.isArray(o)?o:[]},za=e=>{let o=e?.zones;return o&&typeof o=="object"&&!Array.isArray(o)?o:null},Ai=e=>{let o=e?.props?.id;return typeof o=="string"?o:void 0},m1=e=>Bc(e)?.ownerId??"";function h1(e){let o=Oi(Wn(e)),t=o.some(r=>r?.type===ze);return o.filter(r=>r?.type===Je||r?.type===ze||r?.type===p1&&!t)}function Tu(e,o){let t=new Set,r=a=>{if(Array.isArray(a)){for(let n of a)r(n);return}if(!(!a||typeof a!="object")){if(P7(a)){let n=Ai(a);n&&t.add(n)}for(let n of Object.values(a))r(n)}};if(r(e),o){let a=!0,n=new Set;for(;a;){a=!1;for(let[s,i]of Object.entries(o))n.has(s)||!t.has(m1(s))||(n.add(s),r(i),a=!0)}}return t}function x1(e,o){let t=Wn(e).filter(r=>{let a=Ai(r);return typeof r?.type=="string"&&u1.includes(r.type)||a!==void 0&&o(a)});return t.length?Tu(t,za(e)):new Set}function Qy(e,o){let t={},r={};for(let[a,n]of Object.entries(e??{}))(o.has(m1(a))?t:r)[a]=n;return{owned:t,rest:r}}function g1(e,o){if(!o)return e;let t=h1(o);if(!t.length)return e;let r=t.filter(i=>i.type===Je),a=t.filter(i=>i.type!==Je),n={...e,content:[...r,...Wn(e),...a]},{owned:s}=Qy(za(o),Tu(t,za(o)));return Object.keys(s).length&&(n.zones={...za(e)??{},...s}),n}function eb(e,o){if(!o)return{page:e,chrome:null};let t=h1(o),r=new Set(t.map(Ai).filter(v=>!!v)),a=[],n=[];for(let v of Wn(e)){let b=Ai(v);b&&r.has(b)||_i(v?.type)?n.push(v):a.push(v)}let s=new Map(n.map(v=>[Ai(v),v])),i=new Set,l=Oi(Wn(o)).flatMap(v=>{let b=Ai(v);if(!b||!r.has(b))return[v];let y=s.get(b);return y?(i.add(y),[y]):[]});for(let v of n)i.has(v)||l.some(b=>b?.type===v.type)||(l=v.type===Je?[v,...l]:[...l,v]);l=Oi(l);let d=l.length===Wn(o).length&&l.every((v,b)=>v===Wn(o)[b]),f=za(e),u=Tu(l,f),{owned:p,rest:m}=Qy(f,u),h=Qy(za(o),Tu(t,za(o))).owned,I={...o,content:d?o.content:[...l]},w=za(o);if(w||Object.keys(p).length){let v={};for(let[b,y]of Object.entries(w??{}))b in h?b in p&&(v[b]=p[b]):v[b]=y;for(let[b,y]of Object.entries(p))b in v||(v[b]=y);I.zones=v,w&&E7(I.zones,w)&&(I.zones=w)}let S={...e,content:a};return f&&(Object.keys(m).length||!Object.keys(h).length?S.zones=m:delete S.zones),{page:S,chrome:I}}function E7(e,o){let t=Object.keys(e),r=Object.keys(o);return t.length===r.length&&t.every((a,n)=>a===r[n]&&e[a]===o[a])}function I1(e,o){return t=>e(t)||t!==void 0&&u1.includes(t)&&o()}var y1=null;function ob(e){y1=e}function pr(){return y1}var b1=null;function tb(e){b1=e}function Pu(){return b1}var rb=wu();function S1(e,o,t){if(!o)return;let r={...rb.get(e)};for(let[a,n]of Object.entries(o))r[a]={...n,noted:t};rb.set(e,r)}function w1(e,o){S1(e,o,"load")}function C1(e,o){S1(e,o,"save")}function Eu(e){return rb.use(e)}var ab=e=>!!pr()?.sectionOf(e);function v1(e,o=ab){return x1(e,o)}function k1(e,o,t,r=ab){if(t)return e&&v1(o,r).has(e)?void 0:t}function T1(e,o,t=ab){if(!e)return{};let r=[...v1(o,t)];return r.length?{[Su]:e,[Zy]:r}:{[Su]:e}}import{ScreenDocumentContext as tQ}from"efficient-easel/screen/components/ScreenDocumentContext";import{readHidable as tn,hidableText as rQ}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as HF,LINK_FIELD_MARKER as aQ,MEDIA_FIELD_MARKER as nQ,SCAFFOLD_FIELD_MARKER as sQ,TEXT_FIELD_MARKER as ba,foldMetaOf as Sr,textFieldIdentifier as nBe}from"efficient-easel/draw";import{jsx as B1}from"react/jsx-runtime";import{useCallback as L7}from"react";import{useEasel as F7}from"efficient-easel/easel";import{SettingsAction as B7}from"efficient-easel/panel";import{isLengthUnit as A7}from"efficient-easel/screen/lib/content/length-units";import{CORNER_SIDES as _u,hasCornerSubset as Nc,normalizeCornerSides as $r}from"efficient-easel/screen/lib/content/style-keys";import{isLengthUnit as _7}from"efficient-easel/screen/lib/content/length-units";var Dc={kind:"radius",unitKey:"sectionCornersUnit"};function nb(e){return typeof e=="number"&&Number.isFinite(e)}function P1(e,o,t){if(!nb(e))return;let r=_7(t)&&t!=="px"?wi(e,t):wi(Ht(e));if(Object.keys(r).length===0)return;let a=r[sb];if(typeof a!="string")return r;let n=Nc(o)?$n(a,$r(o)??[]):a;return{...r,[O7]:n}}var O7="--sf-section-radius",sb="--sf-card-radius";function $n(e,o){return _u.map(t=>o.includes(t)?e:"0").join(" ")}var E1=[{value:"tl",label:"Top left"},{value:"tr",label:"Top right"},{value:"bl",label:"Bottom left"},{value:"br",label:"Bottom right"}];var Mc={kind:"radius",unitKey:"cardCornersUnit"},R7="--sf-card-box-radius";function ib(e){return typeof e=="number"&&Number.isFinite(e)}function _1(e,o,t){if(!ib(e))return;let r=(A7(t)&&t!=="px"?wi(e,t):wi(Ht(e)))[sb];if(typeof r!="string")return;let a=Nc(o)?$n(r,$r(o)??[]):r;return{[R7]:a}}function O1(e,o){let t=e.find(s=>s?.props?.id===o);if(!t)return[...e];let r=t.props?.cardCorners,a=t.props?.cardCornerSides,n=t.props?.[Mc.unitKey];return e.map(s=>s?.props?.id===o?s:{...s,props:{...s.props,cardCorners:r,cardCornerSides:a,[Mc.unitKey]:n}})}function A1(e,o,t){let r=ku(e,o,t),a=r?.slot??"",n=r&&Array.isArray(r.item.props[a])?r.item.props[a]:[],s=t?.index??-1,i=s>=0?n[s]:void 0,l=i?.props?.id?String(i.props.id):"",d=Math.max(n.length-1,0);return!r||!l?{can:!1,reason:"unreachable",others:0}:n.length<=1?{can:!1,reason:"alone",others:d}:ib(i?.props?.cardCorners)?{can:!0,others:d,zone:r.zone,index:r.index,data:{...r.item,props:{...r.item.props,[a]:O1(n,l)}}}:{can:!1,reason:"unset",others:d}}function R1(e){return e.can?st("Gives the other card this card's Corners.","Gives the other {n} cards this card's Corners.",e.others):e.reason==="alone"?c("This is the only card in the section."):e.reason==="unset"?c("Set this card's corners first."):c("This card is not in a section that can share corners.")}function L1(e){return st("Applied to {n} card","Applied to {n} cards",e)}function F1(e,o){e.can&&o(e.zone,e.index,e.data)}import{useSectionOps as N7}from"efficient-easel/screen/lib/document/use-section-ops";var D7="apply-corners-to-siblings",M7="Apply to all cards";function H7({plan:e,onPress:o}){return B1(B7,{id:D7,label:c(M7),note:R1(e),disabled:!e.can,doneLabel:L1(e.others),onPress:o})}function N1(){let{appState:e,config:o}=F7(n=>n),t=N7(),r=A1(o,e.data.content??[],e.ui.itemSelector),a=L7(()=>{F1(r,t.replaceComponent)},[r,t]);return B1(H7,{plan:r,onPress:a})}import{isShown as j1,lazyShowWhenContext as Z7}from"efficient-shell/format";var Ut="product",Ou="recordType",D1={key:Ut,label:"Product",fields:[]},W7=/^[a-z][a-z0-9]*(-[a-z0-9]+)*$/,$7=/^[a-z][A-Za-z0-9]*$/,U7=["text","date","images"],lb=new Map,M1=0;function z7(e){if(typeof e.key!="string"||!W7.test(e.key))throw new Error(`A record type key is lower-case words joined by hyphens, not ${JSON.stringify(e.key)}.`);if(e.key===Ut)throw new Error("The product record type is the builder's own and is not declared by a host.");if(typeof e.label!="string"||!e.label.trim())throw new Error(`The record type ${e.key} has no label.`);let o=new Set;for(let t of e.fields){if(typeof t.key!="string"||!$7.test(t.key)||o.has(t.key))throw new Error(`The record type ${e.key} has a field key it cannot use: ${JSON.stringify(t.key)}.`);if(!U7.includes(t.kind))throw new Error(`The field ${t.key} of ${e.key} has no kind ${JSON.stringify(t.kind)}.`);o.add(t.key)}return{key:e.key,label:e.label.trim(),fields:e.fields.map(t=>({...t}))}}function U0e(e){let o=e.map(z7);for(let t of o)lb.set(t.key,t);o.length&&(M1+=1)}function cb(){return[D1,...lb.values()]}function db(e){return e===Ut?D1:lb.get(e)??null}function fb(){return M1}function Hc(e){let o=e?.[Ou];return typeof o!="string"?Ut:o.trim()||Ut}function pb(e){return Hc(e)===Ut}function ub(e,o){let t=db(e)?.fields??[];return o?t.filter(r=>o.includes(r.kind)):t}var Au="product",H1="tyre",G7=[Au,H1];function j0e(e){return G7.includes(e)}var j7="productType",K7={[Au]:"alloy-wheel",[H1]:"tyre"},V7=["alloy-wheel","tyre"];function W1(e,o){return pb(o)?$1(o)??K7[e]??null:null}function $1(e){if(!pb(e))return null;let o=e?.[j7];return typeof o=="string"&&V7.includes(o)?o:null}function K0e(e){let o=e?.root;return $1(o?.props)}var mb="Main Pages",Y7="Dynamic Pages",hb="dynamic",q7="dynamic";function Un(e){return e.kind===q7}var xb="lightbox";function U1(e){return e.kind===xb}function z1(e){let o=[],t=[];for(let r of e){if(Un(r)){t.push(r);continue}let a=r.groupKey??(r.group?`folder:${r.group}`:"top"),n=o[o.length-1];n&&n.key===a?n.rows.push(r):o.push({key:a,label:r.group??mb,rows:[r]})}if(t.length){let r=o.findIndex(a=>a.key.startsWith("system:"));o.splice(r===-1?o.length:r,0,{key:hb,label:Y7,rows:t})}return o}var Ru=null,G1=null;function X7(e,o){Ru=e,G1=o}function J0e(e){X7(e,null)}function Q0e(){return Ru}function Wc(){return Un({kind:G1})||Ru===Au}function eEe(e){return W1(Ru??"",e)??"alloy-wheel"}function oEe(e){return Wc()?Hc(e):null}function gb(e,o,t){let r=!1,a={};for(let[n,s]of Object.entries(e)){if(!j1(bc(s),o??{},t)){r=!0;continue}let i=J7(s,o?.[n],o??{},t);i!==s&&(r=!0),a[n]=i}return r?a:e}function J7(e,o,t,r){let a=e?.options;if(!Array.isArray(a))return e;let n=a.filter(s=>s?.value===o||!s?.showWhen||j1(s.showWhen,t,r));return n.length===a.length?e:{...e,options:n}}function K1(e,o,t,r){let a=ku(o,t,r);return{device:e,parentType:a?.item.type,parent:a?.item.props}}function Lu(e,o){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.context=="string"&&(t.context===o||t.context.startsWith(`${o}.`)))return!0;if("not"in t)return Lu(t.not,o);for(let r of[t.all,t.any])if(Array.isArray(r)&&r.some(a=>Lu(a,o)))return!0;return!1}function V1(e,o={}){return Z7({parentType:()=>e.parent?.type??void 0,parent:()=>e.parent?.props??void 0,dynamicPage:()=>Wc(),root:()=>e.appState?.data?.root?.props,...o})}import{isLengthUnit as Q7}from"efficient-easel/screen/lib/content/length-units";var Y1=1,eY="cardImageUnit",Ib={kind:"radius",unitKey:eY},q1={kind:"radius"};function oY(e){return Ht(e)}function X1(e,o){if(Q7(o)&&o!=="px"){let r=q(e);return r!==void 0&&r>=0?{"--sf-card-image-radius":Me(r,o)}:{}}let t=oY(e);return t===null?{}:{"--sf-card-image-radius":`${t}px`}}import{isLengthUnit as tY}from"efficient-easel/screen/lib/content/length-units";var Z1={kind:"radius",unitKey:"cornersUnit"},J1=1,Q1="Corners";function rY(e){return Ht(e)}function bEe(e,o,t){let r=tY(t)&&t!=="px"?q(e):void 0,a=r===void 0?rY(e):null;if(r===void 0&&a===null)return null;let n=r!==void 0?Me(Math.max(0,r),t):`${a}px`;return{borderRadius:Nc(o)?$n(n,$r(o)??[]):n}}var oA=12,Ri=6,aY=Xo,Fu={twoAcross:{label:"Two across",across:2,acrossPhone:2,desktop:[[6,1],[6,1]],phone:[[3,1],[3,1]]},zigzag:{label:"Zigzag",across:2,acrossPhone:2,desktop:[[8,1],[4,1],[4,1],[8,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},brick:{label:"Brick",across:2,acrossPhone:2,desktop:[[5,1],[7,1],[7,1],[5,1]],phone:[[2,1],[4,1],[4,1],[2,1]]},twoTall:{label:"Two tall",across:2,acrossPhone:2,desktop:[[6,2],[6,2]],phone:[[3,2],[3,2]]},offsetTall:{label:"Offset tall",across:2,acrossPhone:2,desktop:[[5,2],[7,1],[3,1],[4,1]],phone:[[3,2],[3,1],[3,1]]},ladder:{label:"Ladder",across:2,acrossPhone:2,desktop:[[3,2],[9,1],[5,1],[4,1]],phone:[[2,2],[4,1],[2,1],[2,1]]},threeAcross:{label:"Three across",across:3,acrossPhone:3,desktop:[[4,1],[4,1],[4,1]],phone:[[2,1],[2,1],[2,1]]},bigLeft:{label:"Big left",across:3,acrossPhone:3,desktop:[[6,1],[3,1],[3,1]],phone:[[4,1],[1,1],[1,1]]},bigRight:{label:"Big right",across:3,acrossPhone:3,desktop:[[3,1],[3,1],[6,1]],phone:[[1,1],[1,1],[4,1]]},threeStagger:{label:"Three stagger",across:3,acrossPhone:3,desktop:[[5,1],[4,1],[3,1],[3,1],[4,1],[5,1]],phone:[[3,1],[2,1],[1,1],[1,1],[2,1],[3,1]]},threeLadder:{label:"Three ladder",across:3,acrossPhone:3,desktop:[[3,1],[4,1],[5,1],[5,1],[4,1],[3,1]],phone:[[1,1],[2,1],[3,1],[3,1],[2,1],[1,1]]},tallMiddle:{label:"Tall middle",across:3,acrossPhone:3,desktop:[[4,1],[4,2],[4,1],[4,1],[4,1]],phone:[[2,1],[2,2],[2,1],[2,1],[2,1]]},fourAcross:{label:"Four across",across:4,acrossPhone:2,desktop:[[3,1],[3,1],[3,1],[3,1]],phone:[[3,1],[3,1]]},bigFirst:{label:"Big first",across:4,acrossPhone:2,desktop:[[6,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},fourStagger:{label:"Four stagger",across:4,acrossPhone:2,desktop:[[4,1],[3,1],[2,1],[3,1],[2,1],[3,1],[4,1],[3,1]],phone:[[4,1],[2,1],[2,1],[4,1]]},tallFirst:{label:"Tall first",across:4,acrossPhone:2,desktop:[[3,2],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1]],phone:[[3,2],[3,1],[3,1]]},oneThenFour:{label:"One then four",across:4,acrossPhone:2,desktop:[[12,1],[3,1],[3,1],[3,1],[3,1]],phone:[[6,1],[3,1],[3,1]]},sixAcross:{label:"Six across",across:6,acrossPhone:3,desktop:[[2,1],[2,1],[2,1],[2,1],[2,1],[2,1]],phone:[[2,1],[2,1],[2,1]]},sixStagger:{label:"Six stagger",across:6,acrossPhone:6,desktop:[[3,1],[2,1],[1,1],[2,1],[1,1],[3,1],[1,1],[3,1],[2,1],[2,1],[1,1],[3,1]],phone:[[1,1],[1,1],[1,1],[1,1],[1,1],[1,1]]},twoThenThrees:{label:"Two, then threes",across:3,acrossPhone:3,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],leadPhone:[[3,1],[3,1]],phone:[[2,1],[2,1],[2,1]]},twoThenThreesPhoto:{label:"Two, then threes \xB7 photo",across:3,acrossPhone:1,lead:[[6,1],[6,1]],desktop:[[4,1],[4,1],[4,1]],phone:[[6,1]],ratio:"landscape"}},tA=["phone","acrossPhone","leadPhone"];var nY=new Set(tA),$c=Object.fromEntries(Object.entries(Fu).map(([e,o])=>[e,Object.fromEntries(Object.entries(o).filter(([t])=>!nY.has(t)))])),yb=Object.keys(Fu),rA=[2,3,4,6];function bb(e,o){return yb.filter(t=>t===o||e===null||$c[t].across===e)}function aA(e){let o=e.layout;return typeof o=="string"&&He(Fu,o)?o:null}function Sb(e){let o=aA(e);return o?sY(o,e.layoutPhone):null}var Bu={oneAcross:{label:"One across",phone:[[Ri,2]],acrossPhone:1}};function nA(e){return typeof e=="string"&&He(Bu,e)?e:null}function eA(e,o){return o?Ri/e.acrossPhone:oA/e.across}function wb(e){return e.ratio?aO.find(o=>o.shape===e.ratio)?.ratio??null:null}function sA(e){return[...e.lead??[],...e.desktop]}function sY(e,o){let t=Fu[e],r=nA(o);if(!r)return t;let{phone:a,acrossPhone:n}=Bu[r],s=Object.fromEntries(tA.map(i=>[i,void 0]));return{...t,...s,phone:a,acrossPhone:n}}var iY="sf-wall--";function lY(e){let o=aA(e);if(!o)return"";let t=nA(e.layoutPhone);return`${iY}${o}${t?`--${t}`:""}`}function kEe(e){let o=Sb(e);if(!o)return"";let t=`.${lY(e)}`,r=[],a=(i,l,d)=>`${t}:has(> :nth-child(${i}n+${l+d}):last-child) > :nth-last-child(-n+${d})`,n=(i,l,d=[])=>{let f=[],u=i.length,p=d.length;d.forEach(([m,h],I)=>{f.push(`${t} > :nth-child(${I+1}){grid-column:span ${m};grid-row:span ${h}}`)}),i.forEach(([m,h],I)=>{f.push(`${t} > :nth-child(${u}n+${p+I+1}){grid-column:span ${m};grid-row:span ${h}}`)});for(let m=1;m<u;m+=1)f.push(`${a(u,p,m)}{grid-column:span ${l};grid-row:span 1}`);return f};r.push(`${t}{grid-template-columns:repeat(${oA},minmax(0,1fr))}`);let s=wb(o);if(s&&(r.push(`${t}${t}{grid-auto-rows:auto}`),r.push(`${t}${t} > *{aspect-ratio:${s[0]}/${s[1]};height:auto}`)),r.push(...n(o.desktop,eA(o,!1),o.lead)),r.push(`@media (max-width:${aY}px){`),r.push(`${t}{grid-template-columns:repeat(${Ri},minmax(0,1fr))}`),r.push(...n(o.phone,eA(o,!0),o.leadPhone)),o.phone.length===1&&!o.leadPhone?.length){let[i,l]=o.phone[0],d=o.lead?.length??0;for(let f=1;f<o.desktop.length;f+=1)r.push(`${a(o.desktop.length,d,f)}{grid-column:span ${i};grid-row:span ${l}}`)}return r.push("}"),r.join("")}var Nu=12,iA=1,cY=3;var dY=3;function Du(e,o,t){let r=typeof e=="number"?e:Number.parseInt(String(e??""),10);return Number.isFinite(r)?Math.min(t,Math.max(o,Math.trunc(r))):null}function fY(e){return Du(e,1,Nu)??dY}function EEe(e,o){return Du(e,iA,cY)??(fY(o)===4?2:iA)}function lA(e){return e==null||e===""?null:Du(e,1,Nu)}var cA="data-sf-span",Cb=4;function dA(e){return e==null||e===""?null:Du(e,1,Cb)}var fA="data-sf-row-span",Ga=["gridSpan","gridRowSpan"];function pA(e){if(!e)return!1;if(e.type==="Grid")return!0;if(e.type==="GalleryB"){if(Sb(e.props??{}))return!1;let o=e.props?.columns;return o!=null&&o!==""}return!1}import{jsx as pY}from"react/jsx-runtime";import*as uY from"efficient-easel/icons";function Mu(e){let o=e.replace(/(^|-)([a-z])/g,(r,a,n)=>n.toUpperCase()),t=uY[`${o}Icon`];return t?pY(t,{size:16}):null}import{jsx as ja,Fragment as xY,jsxs as bA}from"react/jsx-runtime";import{useContext as gY,useEffect as IY,useId as yY,useState as SA}from"react";import{SettingsField as bY,SettingsSwitch as SY}from"efficient-easel/panel";import{AnchorIcon as wY}from"efficient-easel/icons";import{ScreenDocumentContext as CY}from"efficient-easel/screen/components/ScreenDocumentContext";import{Snippet as vY}from"efficient-shell/ui";import{slugify as kY}from"efficient-shell/format";import{slugify as mY}from"efficient-shell/format";function Uc(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}var zn=e=>mY(Uc(e));var Hu="homepage";import{slugify as hY}from"efficient-shell/format";var uA=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function mA(e){return e.offersCommerce&&e.offersService?uA:uA.filter(o=>!o.needs||(o.needs==="commerce"?e.offersCommerce:e.offersService))}var vb="#popup:";function hA(e){return`${vb}${e}`}function xA(e){return e.startsWith(vb)&&e.slice(vb.length).trim()||null}function zc(e){return e===Hu?"/":`/${e}`}function gA(e){return`/journal/${e}`}function MEe(e){return`/wheels/${e}`}function Wu(e,o){return`${zc(e)}#${o}`}function IA(...e){let o=new Set,t=[];for(let r of e)for(let a of r?.content??[]){let n=Uc(a?.props?.anchor);if(!n)continue;let s=hY(n);!s||o.has(s)||(o.add(s),t.push({slug:s,name:n}))}return t}function HEe(e){let o=e.indexOf("#"),t=o===-1?e:e.slice(0,o),r=t.indexOf("?");return r===-1?t:t.slice(0,r)}function yA(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}import{readHidable as TY}from"efficient-easel/draw";function wA({value:e,onChange:o,nameBox:t}){let r=TY(e).text,[a,n]=SA(!1),s=a||r.trim()!=="",i=yY();return bA(xY,{children:[ja(bY,{label:c("Add an anchor"),labelId:i,icon:ja(wY,{}),action:ja(SY,{checked:s,ariaLabelledBy:i,onChange:l=>{n(l),!l&&r!==""&&o("")}})}),s&&t(e,o),s&&ja(PY,{name:r})]})}function PY({name:e}){let o=gY(CY),t=o?.templateId?"":o?.currentSlug??"",[r,a]=SA("");IY(()=>a(fu()),[]);let n=kY(e);if(!n||!t)return null;let s=`${r}${Wu(t,n)}`,i=s.replace(/^https?:\/\//,""),l=i.lastIndexOf("#");return ja("div",{className:"sf-anchor-link",children:ja(vY,{value:s,label:c("link"),size:"sm",children:bA("span",{className:"sf-anchor-link-text",children:[ja("span",{className:"sf-anchor-link-path",children:i.slice(0,l)}),ja("span",{className:"sf-anchor-link-hash",children:i.slice(l)})]})})})}import{jsx as Ur,jsxs as EY}from"react/jsx-runtime";import{Fragment as _Y}from"react";import{Button as $u,Tooltip as OY}from"efficient-shell/ui";function CA({status:e,statusText:o,onRefresh:t,busy:r=!1,edit:a,hint:n,spaced:s=!0,compact:i=!1,oneLine:l=!1}){return i?Ur("div",{className:`sf-blogsource sf-blogsource--compact${l?" sf-blogsource--line":""}`,style:s?{marginTop:8}:void 0,children:Ur(OY,{content:n,className:l?"sf-name-tip":void 0,children:Ur("p",{className:"sf-blogsource-status","data-state":e,children:[o?Ur(_Y,{children:o},"status"):null,t?Ur($u,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:t,disabled:r,children:c("Refresh now")},"refresh"):null,a?Ur($u,{variant:"link",size:"sm",className:"sf-blogsource-link",onClick:a.onClick,children:a.label},"edit"):null].filter(Boolean).flatMap((d,f)=>f?[" \xB7 ",d]:[d])})})}):EY("div",{className:"sf-blogsource",style:s?{marginTop:9}:void 0,children:[Ur("p",{className:"sf-blogsource-status","data-state":e,children:o}),t?Ur($u,{variant:"secondary",className:"sf-blogsource-action",onClick:t,disabled:r,children:c("Refresh now")}):null,a?Ur($u,{variant:"secondary",className:"sf-blogsource-action",onClick:a.onClick,children:a.label}):null,Ur("p",{className:"es-field-hint",children:n})]})}import{AdjustIcon as iQ,EyeIcon as lQ,AnimationIcon as cQ,BackgroundIcon as kF,BorderAllIcon as dQ,BlockSectionIcon as fQ,ColumnWidthsIcon as lw,ColumnsIcon as WF,CornerIcon as $F,DirectionDownIcon as pQ,DirectionLeftIcon as uQ,DirectionRightIcon as mQ,DirectionUpIcon as hQ,EditIcon as xQ,GapIcon as gQ,GridIcon as UF,GroundIcon as aw,HashIcon as IQ,HeightIcon as cw,ImageIcon as yQ,ListIcon as bQ,LocationIcon as TF,PaddingBottomIcon as zF,PaddingLeftIcon as GF,PaddingRightIcon as jF,PaddingTopIcon as dw,PageIcon as SQ,StickyIcon as KF,SearchIcon as wQ,SquareIcon as CQ,TypeIcon as vQ,WidthIcon as kQ}from"efficient-easel/icons";import{jsx as oo,Fragment as Gn,jsxs as jn}from"react/jsx-runtime";import{CaptionIcon as AY,DateIcon as RY,FlagIcon as LY,TitleIcon as FY,ButtonIcon as BY,DollarIcon as NY,HashIcon as DY,LinkIcon as MY,NoteIcon as HY,TagIcon as WY,TextLinesIcon as $Y}from"efficient-easel/icons";var vA={body:$Y,button:BY,link:MY,label:WY,number:DY,price:NY,note:HY,name:LY,date:RY,caption:AY,title:FY},kA={eyebrow:jn(Gn,{children:[oo("path",{d:"M5 6.5h5"}),oo("path",{d:"M5 12.5h14"}),oo("path",{d:"M5 18h11"})]}),heading:jn(Gn,{children:[oo("path",{d:"M6.5 5v14"}),oo("path",{d:"M17.5 5v14"}),oo("path",{d:"M6.5 12h11"})]}),intro:jn(Gn,{children:[oo("path",{d:"M4 5.5v13"}),oo("path",{d:"M8 7.5h12"}),oo("path",{d:"M8 12h12"}),oo("path",{d:"M8 16.5h8"})]}),value:jn(Gn,{children:[oo("rect",{x:"2.5",y:"7",width:"19",height:"10",rx:"2"}),oo("path",{d:"M6.5 12h7"})]}),quote:jn(Gn,{children:[oo("path",{d:"M9.5 5.5C7 7.2 5.5 9.7 5.5 12.8h4v5.7h-5v-5.7"}),oo("path",{d:"M19.5 5.5c-2.5 1.7-4 4.2-4 7.3h4v5.7h-5v-5.7"})]}),tag:jn(Gn,{children:[oo("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),oo("path",{d:"M8 9.5h8"}),oo("path",{d:"M12 9.5v5"})]}),meta:jn(Gn,{children:[oo("path",{d:"M4 7h16"}),oo("path",{d:"M4 14h3.5"}),oo("path",{d:"M10.5 14h3"}),oo("path",{d:"M17 14h3"})]})};function kb({noun:e,size:o=14,strokeWidth:t=1.8,className:r,style:a}){let n=vA[e];return n?oo("span",{className:r,style:{display:"inline-flex",...a},"aria-hidden":"true",children:oo(n,{size:o})}):oo("svg",{className:r,style:a,width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:kA[e]})}var s_e=Object.keys(vA);var i_e=Object.keys(kA);import{parseHexColor as qY}from"efficient-shell/format";import{parseHexColor as OA}from"efficient-shell/format";import{COLOR_SLOTS as AA,FILL_COLOR_SLOTS as KY,colorRole as VY,fillColorRole as RA}from"efficient-shell/markup";import{parseHexColor as TA}from"efficient-shell/format";import{FILL_COLOR_SLOTS as UY}from"efficient-shell/markup";var Uu=e=>{let o=j_.find(t=>t.role===e);return o?`var(${o.token})`:""},zY=e=>Uu(e)?`var(--theme-${e})`:"",GY={main:{ink:_n.accent,page:_n.accent,key:"accent",label:()=>c("Main"),words:e=>c("Theme {n} main color",{n:e})},text:{ink:_n.text,page:_n.text,key:"text",label:()=>c("Text"),words:e=>c("Theme {n} text color",{n:e})},background:{ink:Uu("bg"),page:zY("bg"),key:"background",label:()=>c("Background"),words:e=>c("Theme {n} background",{n:e})},muted:{ink:_n.labels,page:_n.labels,key:"muted",label:()=>c("Muted"),words:e=>c("Theme {n} muted color",{n:e})},surface:{ink:Uu("surface"),page:Uu("surface"),key:"surface",label:()=>c("Surface"),words:e=>c("Theme {n} surface color",{n:e})}};function Ka(e){return $(GY,e)}var Tb="#9ca3af";function Li(e,o,t){let r=Ka(e);return r?{hex:TA(o[r.key]??"")??"",words:r.words(t)}:null}function PA(e,o){return UY.flatMap(t=>{let r=Li(t,e,o);return r&&Ka(t)?.ink?[{name:t,label:r.words,value:r.hex||Tb}]:[]})}var jY=["main","text","background"];function EA(e){let o=new Set,t=[];return vo(e).themes.forEach((r,a)=>{for(let n of jY){let s=Ka(n),i=s?r[s.key]:void 0,l=typeof i=="string"&&i?TA(i):null;!s||!l||o.has(l)||(o.add(l),t.push({value:l,label:s.words(a+1)}))}}),t}function fa(e){return Ka(e)?.ink??""}function zr(e){if(typeof e!="string")return null;let o=RA(e.trim());return o?.kind==="slot"&&fa(o.slot)?o.slot:null}var YY={accent:"main",labels:"muted"};function Et(e){return $(YY,e)??e}function Fi(e){if(!e)return"";if(e.startsWith("#"))return OA(e)===e.toLowerCase()?e:"";let o=VY(Et(e));return o?.kind==="slot"?fa(o.slot):""}function Bi(e,o=AA){return o.flatMap(t=>{let r=Ka(t);return r?.ink?[{name:t,label:r.label(),value:e?.[t]||Tb}]:[]})}function LA(e){let o=RA(Et(e));return o?.kind==="slot"?fa(o.slot):""}function Pb(e){let o=e?.trim();return o?KY.find(t=>fa(t)===o)??null:null}function zu(e){let o={},t=e.ownerDocument,r=t?.defaultView;if(!t||!r)return o;let a=r.getComputedStyle(e),n=t.createElement("canvas").getContext("2d");for(let s of AA){let i=fa(s);if(!i)continue;let l=i.replace(/^var\((--[\w-]+)\)$/,"$1"),d=a.getPropertyValue(l).trim();if(!d)continue;let f=_A(d);!f&&n&&(n.fillStyle="#000000",n.fillStyle=d,f=_A(String(n.fillStyle))),f&&(o[s]=f)}return o}function _A(e){let o=e.trim().toLowerCase();if(o.startsWith("#"))return OA(o);let t=o.match(/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)/);return t?`#${t.slice(1,4).map(r=>Math.min(255,Number(r)).toString(16).padStart(2,"0")).join("")}`:null}var XY="#ffffff";function Eb(e){return FA(e)||(ZY(e)?e:XY)}function FA(e){let o=zr(e);return o?Ka(o)?.page??"":""}function ZY(e){return typeof e=="string"&&qY(e)===e.toLowerCase()||FA(e)!==""}function Gu(e){return{"--bg":Eb(e)}}import{parseHexColor as JY}from"efficient-shell/format";import{fillColorRole as QY}from"efficient-shell/markup";function Kn(e,o,t,r){let a=r??t??o,n=t!==null&&t!==o,s=a!==null&&a!==o;return{className:[n?e.tabletClass:"",s?e.phoneClass:""].filter(Boolean).join(" "),style:{...n?{[e.tabletVar]:t}:{},...s?{[e.phoneVar]:a}:{}}}}var _b=[{label:"Even",value:"even"},{label:"From the bottom",value:"bottom"}];var D_e="sf-card",M_e="[--sf-card-lift:none] [--sf-card-shadow-hover:var(--sf-card-shadow,none)]",Va={min:0,max:100,step:5,fallback:0,unit:"%"},e9="68%",W_e={desktop:20,phone:20,side:40,sidePhone:24},$_e="sf-box-sides";function Ab(e){return typeof e=="string"&&e.trim()!==""}function NA(e){return Ab(typeof e?.bgImage=="string"?e.bgImage:null)||ju(e)}function ju(e){return mt(e,Op)!==""}function jc(e,o){return o||!ju(e)?e:{...e,[Op]:""}}function U_e(e,o){return Ty(o,mt(e,Op))?.trim()||null}function BA(e,o){let t=typeof e=="number"?e:Number.parseFloat(String(e??""));if(!Number.isFinite(t)||t<=0)return null;let r=(Math.min(Va.max,Math.max(Va.min,t))/100).toFixed(2);return o!=="bottom"?{background:ca(Number(r))}:{background:`linear-gradient(0deg, ${ca(Number(r))} 0%, ${ca(0)} ${e9})`}}var Ku=[{label:"Flat",value:"",hint:"One colour from top to bottom"},{label:"Fade",value:"down",hint:"The colour fades into the page colour at the bottom"}],DA="fillFade",Ob=Ku[1].value,Vu=e=>e===Ob?Ob:Ku[0].value,o9=[{mix:"12%",at:"50%"},{mix:"19%",at:"70%"},{mix:"50%",at:"95%"}];function z_e(e){return Vu(e)!==Ob?null:{backgroundImage:`linear-gradient(to bottom, transparent, ${o9.map(o=>`color-mix(in srgb, var(--bg) ${o.mix}, transparent) ${o.at}`).join(", ")})`}}var Yu=e=>typeof e=="string"?JY(e.trim()):null,Gc=e=>{let o=Yu(e);if(o!==null||typeof e!="string")return o;let t=e.trim();return t&&!t.startsWith("#")&&LA(t)||null},qu=e=>{if(typeof e!="string")return null;let o=QY(Et(e.trim()));return o?.kind==="slot"?o.slot:null},Rb="swatch";function G_e(e,o){if(!o)return null;let t=Ty(o,mt(e,Rb)),r=zr(t);return Yu(t)??(r&&fa(r)||null)}var t9={tabletClass:"sf-fill-tablet",tabletVar:"--sf-fill-tablet",phoneClass:"sf-fill-phone",phoneVar:"--sf-fill-phone"};function j_e(e,o,t){return Kn(t9,Gc(e),Gc(o),Gc(t))}var r9={tabletClass:"sf-wash-tablet",tabletVar:"--sf-wash-tablet",phoneClass:"sf-wash-phone",phoneVar:"--sf-wash-phone"};function K_e(e){let o=BA(e.darken,e.darkenStyle);if(!o)return{className:"",style:{}};let t=(u,p)=>String(BA(u,p)?.background??"none"),r=u=>(typeof u=="number"||typeof u=="string"&&u.trim()!=="")&&Number.isFinite(Number(u))?u:void 0,a=u=>_b.some(p=>p.value===u)?u:void 0,[n,s,i,l]=[r(e.darkenTablet),a(e.darkenStyleTablet),r(e.darkenPhone),a(e.darkenStylePhone)],d=n??e.darken,f=s??e.darkenStyle;return Kn(r9,String(o.background),n!==void 0||s!==void 0?t(d,f):null,i!==void 0||l!==void 0?t(i??d,l??f):null)}function V_e(e,o){let t={"top-left":["start","start"],"top-center":["center","start"],"top-right":["end","start"],left:["start","center"],center:["center","center"],right:["end","center"],"bottom-left":["start","end"],"bottom-center":["center","end"],"bottom-right":["end","end"]},[r,a]=t[e]??t.center,[n,s]=o==="column"?[a,r]:[r,a];return RE(n,s)}function MA(e,o){let t=e?.content;if(!Array.isArray(t))return null;for(let r of t){if(!r||typeof r!="object")continue;let{type:a,props:n}=r;if(n?.id===o)return null;if(Lb(r,o,0))return{type:typeof a=="string"?a:"",props:n??{}}}return null}function Lb(e,o,t){if(t>12||!e||typeof e!="object")return!1;if(Array.isArray(e))return e.some(a=>Lb(a,o,t+1));let r=e.props;return r&&typeof r=="object"&&r.id===o?!0:Object.values(e).some(a=>Lb(a,o,t+1))}function HA(e,o){let t=e?.content;return Array.isArray(t)?Xu(t,o,0)??[]:[]}function Xu(e,o,t){if(t>12||!e||typeof e!="object")return null;if(Array.isArray(e)){for(let a of e){let n=Xu(a,o,t+1);if(n)return n}return null}let r=e.props;if(r&&typeof r=="object"){if(r.id===o)return[];for(let a of Object.values(r)){let n=Xu(a,o,t+1);if(n)return[r,...n]}return null}for(let a of Object.values(e)){let n=Xu(a,o,t+1);if(n)return n}return null}import{SettingsDefaultReset as et,SettingsDrill as TQ,SettingsField as wo,SettingsGroup as PQ,SettingsSegmented as EQ,SettingsBorder as _Q,SettingsSidesEach as OQ,SettingsSwitch as fw,borderSides as AQ,borderStartEach as RQ}from"efficient-easel/panel";import{ListField as LQ}from"efficient-easel/fields";import{DisplayChips as FQ}from"efficient-shell/ui";import{HIDDEN_KEY as a9,hiddenInEveryView as n9,hiddenInView as Fb,hiddenKeyOf as WA}from"efficient-easel/screen/lib/content/view-hide";var s9={"000":"",100:"view-desktop:hidden","010":"view-wide:max-view-desktop:hidden","001":"max-view-wide:hidden",110:"view-wide:hidden","011":"max-view-desktop:hidden",101:"view-desktop:hidden max-view-wide:hidden",111:"hidden"},i9={"000":"",100:"view-desktop:hidden","010":"view-tablet:max-view-desktop:hidden","001":"max-view-tablet:hidden",110:"view-tablet:hidden","011":"max-view-desktop:hidden",101:"view-desktop:hidden max-view-tablet:hidden",111:"hidden"},$A=e=>(e.desktop?"1":"0")+(e.tablet?"1":"0")+(e.mobile?"1":"0");function Zu(e,{atSectionLine:o=!1}={}){return(o?i9:s9)[$A(e)]}var Ni=[a9,WA("tablet"),WA("mobile")];function UA(e){return{desktop:Fb(e,"desktop"),tablet:Fb(e,"tablet"),mobile:Fb(e,"mobile")}}function pa(e){return n9(e)}function zA(e){let o=UA(e);return["desktop","tablet","mobile"].filter(t=>o[t]).join(" ")}var l9={"000":"",100:"view-desktop:hidden!","010":"view-wide:max-view-desktop:hidden!","001":"max-view-wide:hidden!",110:"view-wide:hidden!","011":"max-view-desktop:hidden!",101:"view-desktop:hidden! max-view-wide:hidden!",111:"hidden!"},c9={"000":"",100:"view-desktop:hidden!","010":"view-tablet:max-view-desktop:hidden!","001":"max-view-tablet:hidden!",110:"view-tablet:hidden!","011":"max-view-desktop:hidden!",101:"view-desktop:hidden! max-view-tablet:hidden!",111:"hidden!"};function Kc(e,{atSectionLine:o=!1}={}){return(o?c9:l9)[$A(UA(e))]}function Di(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let o={};for(let[t,r]of Object.entries(e))typeof r=="boolean"&&(o[t]=r);return o}function Ju(e,o){return Di(e)[o]!==!1}function Bb(e,o,t){let r=Di(o)[t];return typeof r=="boolean"?r:Ju(e,t)}function GA(e){return Object.values(Di(e)).some(o=>o===!1)}function jA(e){return Object.keys(Di(e)).length>0}function KA(e,o,t){let r={...Di(e)};return t?delete r[o]:r[o]=!1,Object.keys(r).length?r:void 0}function VA(e,o,t){return{...Di(e),[o]:t}}function Q_e(e,o,t,{atSectionLine:r=!0}={}){let a=!Ju(e,t);return Zu({desktop:a,tablet:a,mobile:!Bb(e,o,t)},{atSectionLine:r})}import{ColorSwatch as BQ,CornersInput as NQ,DatePicker as EBe,DateTimePicker as DQ,FOCAL_DEFAULT as _Be,IconPicker as VF,COLUMN_COUNT_MAX as PF,COLUMN_SHARE_MIN as MQ,COLUMN_SHARES_EQUAL as HQ,resolveColumnShares as YF,WidthsBar as WQ,useShellStrings as $Q,IconButton as qF,InputNumber as EF,Slider as UQ,Tooltip as pw}from"efficient-shell/ui";import{backendOf as d9}from"efficient-easel/screen/lib/session";var Ge=d9,Mi=e=>e.blocks;async function YA(e){let o=e.trim();if(!o)return null;let t=Ge().geocode;if(!t)throw new Error("geocode_unavailable");return t.locate(o)}var Nb="Lookup busy \u2014 try again in a moment.",Qu=e=>typeof e=="number"&&Number.isFinite(e);function sOe(e){return e.some(o=>{let t=o?.geocode;return t?t.pending||t.manual&&t.lat===void 0&&t.lng===void 0?!0:Qu(t.lat)&&t.lat!==o.lat||Qu(t.lng)&&t.lng!==o.lng:!1})}async function iOe(e,o,{geocode:t=YA,courtesyGapMs:r=1100}={}){let a=s=>new Promise(i=>setTimeout(i,s)),n=e.slice();if(e.some(s=>s?.geocode?.pending)){let s=[],i=!1;for(let l of e){if(!l?.geocode?.pending){s.push(l);continue}i&&r>0&&await a(r),i=!0;try{let d=await t(o(l));s.push(d?{...l,lat:d.lat,lng:d.lng,geocode:{...l.geocode,pending:!1,ok:!0,status:`Found \u2014 ${d.label.split(",").slice(0,3).join(",").trim()}`,lat:d.lat,lng:d.lng}}:{...l,geocode:{...l.geocode,pending:!1,ok:!1,status:"No match \u2014 check the address and try again."}})}catch{s.push({...l,geocode:{...l.geocode,pending:!1,ok:!1,status:Nb}})}}n=s}return n.map(s=>{let i=s?.geocode;if(!i)return s;if(i.manual&&i.lat===void 0&&i.lng===void 0)return{...s,geocode:{...i,lat:s.lat,lng:s.lng}};let l=Qu(i.lat)&&i.lat!==s.lat?i.lat:s.lat,d=Qu(i.lng)&&i.lng!==s.lng?i.lng:s.lng;return l!==s.lat||d!==s.lng?{...s,lat:l,lng:d}:s})}import{jsx as lt,jsxs as Mb}from"react/jsx-runtime";import{useRef as f9}from"react";import{ColorPicker as p9,ColorPickerPanel as u9,ColorSwatch as m9,HexInput as h9,Popover as x9,Tooltip as g9,colorFill as I9,colorSwatchClasses as y9,useShellStrings as b9}from"efficient-shell/ui";import{SettingsDefaultReset as S9,SettingsField as w9}from"efficient-easel/panel";import{typedHex as Db}from"efficient-easel/pick";var qA="Not set";function XA({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,ariaLabel:s,choices:i}){return lt(v9,{value:e,onChange:o,label:c(s??t),id:r,caption:a,inherited:n,choices:i})}function C9(){let{theme:e}=fe();return EA(e)}function v9({value:e,onChange:o,label:t,id:r,caption:a,inherited:n,choices:s}){let i=C9(),l=e?null:Db(n??""),d=a!==void 0&&(!e||Db(a)!==Db(e))?a:null,f=u=>{u!==e&&o(u)};return Mb("div",{className:"sf-colour",children:[s?lt(k9,{id:r,value:e,onChange:o,label:t,presets:i,follows:l,choices:s}):lt(p9,{id:r,value:e,onChange:f,label:t,presets:i,fallback:l??void 0,size:"md",align:"start"}),d!==null?lt("span",{className:"sf-colour-caption",children:d}):lt("span",{className:"sf-colour-hexwrap",children:lt(h9,{value:e||l||"",onChange:f,label:c("{label} hex code",{label:t}),placeholder:e||l?void 0:c(qA),className:l?"sf-colour-hex is-inherited":"sf-colour-hex",size:"md"})})]})}function k9({value:e,onChange:o,label:t,id:r,presets:a,follows:n,choices:s}){let i=b9().color,l=e||n||"",d=s.findIndex(p=>p.selected),f=d>=0,u=f9(d);return f&&(u.current=d),lt(x9,{id:r,trigger:lt("span",{"aria-hidden":"true",className:"absolute inset-0",style:I9(l)}),triggerLabel:i.swatch(t,l.toUpperCase()||i.none),triggerClassName:y9({size:"md"}),"aria-label":i.panel(t),align:"start",children:Mb("div",{className:"sf-colour-window",children:[lt("div",{role:"group","aria-label":t,className:"sf-colour-choices",children:s.map(p=>lt(g9,{content:p.label,children:lt(m9,{color:p.color,"aria-label":p.label,selected:p.selected,onClick:()=>{p.selected||p.onPick()}})},p.label))}),lt(u9,{value:f?"":e,onChange:o,label:t,presets:a,fallback:(f?l:n)??void 0},u.current)]})})}function gt({label:e,icon:o,changed:t,hint:r,onReset:a,resetTo:n,children:s,...i}){return lt(w9,{label:e,icon:o,htmlFor:i.id,changed:t,hint:r,action:a?lt(S9,{words:ce()?.panel,label:e,changed:!!t,detail:n,onReset:a}):void 0,children:s?Mb("div",{className:"es-width-stack",children:[XA({...i,label:e}),s]}):XA({...i,label:e})})}function Vc({label:e,icon:o,value:t,inherited:r,resetTo:a,onChange:n,onReset:s,hint:i,choices:l,children:d}){let f=!!t;return lt(gt,{label:e,icon:o,value:t,inherited:f?void 0:r,onChange:n,changed:f,onReset:s,resetTo:a,hint:i,choices:l,children:d})}import{keptByRow as nw}from"efficient-easel/screen/lib/document/style-fields";import{jsx as T9}from"react/jsx-runtime";import{useEffect as P9,useState as E9}from"react";import{clearRangeOf as _9,markSelection as O9,useCaretEdit as A9}from"efficient-easel/copy";import{TextToolbar as R9}from"efficient-shell/ui";function L9(e,o,t){return O9(e,o,t,oE)}function ZA(e,o){let t=_9(o,e.length),r=rE(e,t.start,t.end);return r.text===e?null:r}function F9(e){let[o,t]=E9(null);return P9(()=>{let r=e.current?.ownerDocument??(typeof document>"u"?null:document);if(!r)return;let a=()=>{let n=e.current;if(!n||r.activeElement!==n)return;let s=n.selectionStart??n.value.length,i=n.selectionEnd??s;t(l=>l&&l.start===s&&l.end===i?l:{start:s,end:i})};return r.addEventListener("selectionchange",a),()=>r.removeEventListener("selectionchange",a)},[e]),[o,t]}function B9({target:e,value:o,onChange:t,disabled:r=!1,label:a="Formatting"}){let n=A9({target:e,onChange:t}),[s,i]=F9(e),l=p=>n(m=>{let h=L9(o,p,m);return i({start:h.selectionStart,end:h.selectionEnd}),h}),d=eE(),f={};if(s)for(let p of d)f[p.style]=tE(o,s.start,s.end,p.style);let u=r?null:ZA(o,s);return T9(R9,{offered:new Set(d.map(p=>p.style)),onMark:p=>l(p),pressed:f,disabled:r,"aria-label":c(a),className:"sf-markup-bar",clear:u?{onClear:()=>n(()=>{let p=e.current,m=p&&p.ownerDocument.activeElement===p?{start:p.selectionStart??0,end:p.selectionEnd??0}:null,h=ZA(o,m)??{text:o,selectionStart:m?.start??0,selectionEnd:m?.end??0};return i({start:h.selectionStart,end:h.selectionEnd}),h})}:void 0})}var Hb=B9;import{deviceField as Lt}from"efficient-easel/screen/lib/document/device-fields";import{NO_CONTROL_FIELD as zQ,NoControlMark as GQ,noControlField as XF}from"efficient-easel/screen/lib/document/panel-no-control-mark";var Wb="__ownBox";function JA(e){return!!e&&typeof e=="object"&&e[Wb]===!0}var $b="sfPanelOnly";function Hi(e){return!!e&&typeof e=="object"&&e[$b]===!0}function em(e,o,t){return typeof e=="number"?e:typeof o=="number"?o:t}var om=void 0;import{phoneKey as Zi,tabletKey as uw,viewKeyAt as mw}from"efficient-easel/draw";import{jsx as tm,Fragment as N9,jsxs as D9}from"react/jsx-runtime";import{useRef as M9}from"react";import{SettingsDefaultReset as H9}from"efficient-easel/panel";import{effectTiles as W9}from"efficient-easel/screen/lib/document/effect-tiles";import{VIEW_KEY_ACCESS as QA,describedAs as $9,onDesktopWords as U9,phoneTwinFields as eR}from"efficient-easel/screen/lib/document/box-fields";function z9({row:e,read:o,...t}){let r=o(So(),t.followsView??"desktop");return e({...t,follows:r})}function ua(e,o){return Object.fromEntries(xt.map(t=>{let r=ke(e,t);return[r,eR(e,o(t),QA)[r]]}))}function rm(e,o,t){let r=o.render,a={...o,render:n=>tm(z9,{...n,row:r,read:t})};return ua(e,n=>n==="desktop"?o:a)}function G9({spec:e,...o}){let t=e.values.includes(o.value),r="follows"in o,a=e.read(So(),o.followsView??"desktop"),n=t?o.value:a,s=M9(null),{preview:i}=e,l=W9({label:c(e.label),options:e.values.map(f=>({value:f,label:c(e.word(f)),picture:e.picture(f)})),fallback:e.fallback,onPreview:i?f=>s.current&&i(s.current,f):void 0}).render,d=l({value:n,onChange:f=>o.onChange(f??e.fallback)});return D9(N9,{children:[i?tm("div",{ref:s,style:{display:"contents"},children:d}):d,r&&t&&tm(H9,{words:ce()?.panel,label:c(e.tileWord),changed:!0,detail:U9(f=>c(f),c(e.word(a)),o.followsView),onReset:()=>o.onChange(void 0)})]})}function am(e,o){let t=$9({type:"custom",render:r=>tm(G9,{...r,spec:o})},{type:"select",label:o.label,options:o.values.map(r=>({value:r,label:o.word(r)}))});return eR(e,t,QA)}import{jsx as zb,Fragment as V9}from"react/jsx-runtime";import{createContext as Y9,useContext as q9}from"react";var nm={ProductGrid:{source:{keep:["slug"]}},GalleryItem:{product:{keep:["code","finish"]}},FeaturedCover:{source:{keep:["slug"]}},LongRead:{source:{keep:["slug"]}}},sm={Events:["posts"],SubscribeBlogs:["posts"]};var j9=["anchor"],K9=/^href$|Href$|^url$|Url$|^link$|^mailto$|^tel$/;function Vn(e){return j9.includes(e)||K9.test(e)}var Ub={Gallery:{source:{verb:"snapshot",keep:[]}},ProductHero:{source:{verb:"snapshot",keep:[]}},SpecTable:{source:{verb:"snapshot",keep:[]},wheel:{verb:"reference"},finish:{verb:"reference"},size:{verb:"reference"}},CollectionCard:{collection:{verb:"snapshot",keep:[]}},FooterMenu:{menu:{verb:"snapshot",keep:[]}},MenuBlock:{menu:{verb:"snapshot",keep:[]}},ProductGrid:{design_codes:{verb:"reference"}},ProductRef:{code:{verb:"reference"},finish:{verb:"reference"}},FitmentTable:{wheel:{verb:"reference"}},GalleryItem:{fromProduct:{verb:"reference"}},Footprint:{"offices[].group":{verb:"groupKey"},"offices[].lat":{verb:"pii"},"offices[].lng":{verb:"pii"},"offices[].geocode":{verb:"pii"}}};Ub.ContactLocations={"locations[].lat":{verb:"pii"},"locations[].lng":{verb:"pii"},"locations[].mapsUrl":{verb:"pii"},"locations[].geocode":{verb:"pii"}};var $Oe=Object.fromEntries(Object.entries(nm).map(([e,o])=>[e,Object.keys(o)])),UOe=Object.fromEntries(Object.entries(sm).map(([e,o])=>[e,[...o]]));import{NoControlMark as X9}from"efficient-easel/screen/lib/document/panel-no-control-mark";var oR=Y9(!1);function tR({children:e}){return zb(oR.Provider,{value:!0,children:e})}function Z9(){return q9(oR)}function rR({name:e,children:o}){return!Z9()||!e||!J9(e)||Vn(e)?zb(V9,{children:o}):zb(X9,{})}function J9(e){return/^[A-Za-z0-9_$]+$/u.test(e)}var Gb="off",nR="none",jb=[{label:"None",value:"off"},{label:"1, 2, 3",value:"plain"},{label:"01, 02, 03",value:"padded"},{label:"N\xB001, N\xB002",value:"numero"}],sR=[{label:"None",value:"none"},{label:"Hairline",value:"hairline"}];function XOe(e){return xo(jb,Gb,e)}var aR="sf-card-index",Yc="sf-card-index",ZOe="pointer-events-none absolute left-[18px] top-[18px] z-10 border border-line bg-bg/70 px-2 py-1 font-mono text-[length:var(--size-label,10px)] uppercase tracking-[0.16em] text-fg-dim",Q9={plain:`counter(${Yc})`,padded:`counter(${Yc}, decimal-leading-zero)`,numero:`"N\xB0" counter(${Yc}, decimal-leading-zero)`};function JOe(e,o){return o==="off"?"":`.${e}{counter-reset:${Yc}}.${e} .${aR}{counter-increment:${Yc}}.${e} .${aR}::before{content:${Q9[o]}}`}function QOe(e){return e==="hairline"?"border border-line hover:border-accent":""}var iR=[{value:"1",label:"1st rendering"},{value:"2",label:"2nd rendering"},{value:"3",label:"3rd rendering"},{value:"4",label:"4th rendering"},{value:"5",label:"5th rendering"}];import{SCALAR_TEXT_CONTROLS as jQ}from"efficient-easel/draw";import{jsx as It}from"react/jsx-runtime";import{SettingsDefaultReset as iq,SettingsField as Kb}from"efficient-easel/panel";import{useSelectedHost as lq}from"efficient-easel/easel";import{FOCAL_DEFAULT as cq}from"efficient-shell/format";import{ImageIcon as Vb,PlayIcon as cR}from"efficient-easel/icons";import{ImageFocusPoint as dq,MediaUploadField as fq}from"efficient-shell/ui";import{useContext as pq}from"react";import{ScreenDocumentContext as uq}from"efficient-easel/screen/components/ScreenDocumentContext";import{tabletKey as mq,viewKeyAt as hq}from"efficient-easel/draw";import{usePreviewDevice as xq}from"efficient-easel/draw/client";import{formatFocal as eq,parseFocal as oq}from"efficient-shell/format";var tq="sf-focus-phone",rq="--sf-focus-phone",aq="sf-focus-tablet",nq="--sf-focus-tablet",qc=e=>{if(typeof e!="string"||!/^\s*-?\d+(\.\d+)?%\s+-?\d+(\.\d+)?%\s*$/.test(e))return null;let{x:o,y:t}=oq(e);return eq(o,t)};function lR(e,o){return Kn(sq,null,qc(o),qc(e))}var sq={tabletClass:aq,tabletVar:nq,phoneClass:tq,phoneVar:rq};import{shownTier as Yb}from"efficient-easel/screen/lib/document/device-fields";import{onDesktopWords as gq}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as Iq}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as yq}from"efficient-easel/screen/lib/host";import{useEaselSession as bq}from"efficient-easel/screen/lib/session-context";function Sq(e,o,t,r=!0){let a=Yb(t),n=typeof e[o]=="string"&&e[o]?String(e[o]):cq;if(a==="desktop")return{ownView:!1,followed:n,followsView:"desktop",own:void 0,focus:n,key:o};let s=hq(o,a),i=qc(e[s])??void 0,l=a==="mobile"&&r?qc(e[mq(o)])??void 0:void 0,d=l??n;return{ownView:!0,followed:d,followsView:l?"tablet":"desktop",own:i,focus:i??d,key:s}}function wq(e,o,t){let r=lq();if(!o||!r)return null;let a=r.values??{};if(t&&!t(a,Yb(e)))return null;let n=Sq(a,o,e,t?t(a,"tablet"):!0),s=r.onChange;return{...n,set:i=>s(n.key,i),clear:()=>s(n.key,om)}}function dR({value:e,onChange:o,label:t,accept:r,placeholder:a,focusKey:n,focusWhen:s,frameKey:i,fieldKey:l}){let d=yq(),f=bq(),u=c(t),p=xq(),m=r.startsWith("video"),h=wq(p,m?void 0:n,s),I=!!n&&Yb(p)!=="desktop",w=pq(uq),S=ur(),v=i&&l?{video:l,frame:i}:null,b=O=>Iq(d,{accept:r,title:u,...O?{file:O}:{}}).then(D=>!D||!v?D?.url??null:(S({[v.video]:D.url,[v.frame]:D.posterUrl??""}),null)),y=v?O=>O?o(O):S({[v.video]:"",[v.frame]:""}):o,k=it(e);if(I&&(!h||!k))return null;if(w&&!w.capabilities.mediaEditing)return It(Kb,{label:u,icon:m?It(cR,{}):It(Vb,{}),children:It("div",{className:"sf-image-slot-inert",children:m?c("Templates don\u2019t store videos \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created."):c("Templates don\u2019t store images \u2014 this slot stays a placeholder. Each website picks its own after it\u2019s created.")})});let L=h?.ownView&&k?It(iq,{words:ce()?.panel,label:c("Image focus"),changed:!!h.own,detail:gq(O=>c(O),h.followed,h.followsView),onReset:h.clear}):void 0;return I&&h?It(Kb,{label:u,icon:It(Vb,{}),action:L,children:It("div",{style:{flex:"1 1 auto",minWidth:0},children:It(dq,{value:h.focus,onChange:h.set,label:c("Image focus"),image:k,hint:null})})}):It(Kb,{label:u,icon:m?It(cR,{}):It(Vb,{}),children:It("div",{style:{flex:"1 1 auto",minWidth:0},children:It(fq,{value:k,onChange:y,onPick:b,accept:m?"video/*":"image/*",kind:m?"video":"image",placeholder:a===void 0?void 0:c(a),maxSizeBytes:Ge(f).media.maxUploadBytes,...h?{focus:h.focus,onFocusChange:h.set}:{}})})})}import{jsx as fR}from"react/jsx-runtime";import{useId as Cq}from"react";import{FieldSelect as vq}from"efficient-easel/fields";import{SettingsField as kq}from"efficient-easel/panel";function Tq(e){return e.map(({value:o,label:t,note:r})=>({value:o,label:t,...r?{meta:r}:{}}))}function pR({label:e,options:o,value:t,onChange:r,emptyLabel:a,icon:n,hint:s}){let i=Cq(),l=`${i}-label`,d=`${i}-button`,f=Array.isArray(t)?t:[];return fR(kq,{label:c(e),labelId:l,icon:n,hint:s,children:fR(vq,{id:d,multiple:!0,value:f,options:Tq(o),onChange:r,placeholder:a===void 0?c("None"):c(a),ariaLabelledBy:`${l} ${d}`,inline:!0})})}import{jsx as ko,jsxs as qn,Fragment as oX}from"react/jsx-runtime";import{useCallback as kR,useContext as tX,useId as ER,useRef as TR,useState as PR}from"react";import{ThemeIcon as rX}from"efficient-easel/icons";import{Button as aX,useClickOutside as nX}from"efficient-shell/ui";import{SettingsField as sX}from"efficient-easel/panel";import{ScreenDocumentContext as iX}from"efficient-easel/screen/components/ScreenDocumentContext";import{jsx as he,jsxs as qa,Fragment as Bq}from"react/jsx-runtime";import{parseHexColor as Nq}from"efficient-shell/format";import{Button as Xb,IconButton as Dq,Tooltip as Mq}from"efficient-shell/ui";import{jsx as Ya,jsxs as Pq}from"react/jsx-runtime";import{AccentIcon as Eq}from"efficient-easel/icons";import{Button as _q,Tooltip as Oq}from"efficient-shell/ui";function qb(e){return ht(e).background}function Aq(e){let o=Ma(e.accent,qb(e));return o===null?null:{ratio:o,grade:Si(o)}}function Rq(e){let o=qb(e),t=Ma(e.accent,o);return t===null?[]:b_(e.accent).filter(r=>{let a=Ma(r,o);return a!==null&&a>t&&Si(a)==="good"})}var Lq={good:"Easy to read","large-only":bi["large-only"],hard:bi.hard};function uR({value:e,onChange:o}){let t=Aq(e),r=t?.grade,a=t&&t.grade!=="good"?Rq(e):[];return Ya(gt,{label:c("Main color"),icon:Ya(Eq,{}),hint:t?c(Lq[t.grade]):void 0,value:e.accent,onChange:n=>o({...e,accent:n}),children:a.length>0?Ya("div",{className:"w-full min-w-0",children:Pq("div",{className:"sf-readability",children:[Ya("p",{className:"sf-readability-advice",children:Fq(r,!0)}),Ya("div",{className:"sf-readability-suggestions",children:a.map(n=>{let s=Ma(n,qb(e));return Ya(Oq,{content:c("Use {colour}",{colour:n.toUpperCase()}),children:Ya(_q,{variant:"secondary",className:"sf-readability-suggestion",leftIcon:Ya("span",{className:"sf-readability-chip",style:{background:n},"aria-hidden":!0}),onClick:()=>o({...e,accent:n}),children:s?`${s.toFixed(1)}:1`:n.toUpperCase()})},n)})})]})}):null})}function Fq(e,o){return e?e==="good"?c("This color reads clearly on your pages."):o?c("This color is hard to read on this theme's page. The buttons below are the same hue, darkened."):c("This color is hard to read on your page background. Pick one further from it \u2014 lighter if your pages are dark, deeper if they are light."):c("Pick a color to see how it reads.")}import{ButtonIcon as Hq,ChevronDownIcon as hR,ChevronUpIcon as Wq,GroundIcon as $q,LayoutIcon as Uq,SquareIcon as zq,TextSmallIcon as Gq,TypeIcon as mR}from"efficient-easel/icons";var Xc=e=>c("Theme {n}",{n:e+1});function xR({colors:e}){let o=ht(e),t=kc(e)??o.accent;return qa("span",{className:"sf-theme-page",style:{background:o.background,color:o.text},"aria-hidden":!0,children:[he("span",{className:"sf-theme-eyebrow",style:{color:o.muted},children:c("label")}),qa("span",{className:"sf-theme-headline",children:[c("Heading")," ",he("span",{style:{color:o.accent},children:c("main")})]}),he("span",{className:"sf-theme-body",children:c("body text")}),qa("span",{className:"sf-theme-row",children:[he("span",{className:"sf-theme-btn",style:{background:t,color:Oy(e,o.accent)},children:c("button")}),he("span",{className:"sf-theme-mini",style:{background:o.surface,borderColor:o.line},children:c("card")})]})]})}var Zb={"Text color":he(mR,{}),"Label color":he(Gq,{}),Background:he($q,{}),"Panels & cards":he(Uq,{}),Borders:he(zq,{}),"Button color":he(Hq,{}),"Button text color":he(mR,{})};function jq({label:e,colorKey:o,value:t,onChange:r,idPrefix:a="sf-theme-ink"}){let n=`${a}-${o}`;return he(gt,{label:c(e),icon:Zb[e],id:n,value:t,onChange:s=>r(o,s)})}function Kq({value:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button`,n=e!==void 0&&Nq(e)===e.toLowerCase(),s=n?e:o;return he(gt,{label:c("Button color"),icon:Zb["Button color"],id:a,value:s,caption:n?s:c("Main"),onChange:t})}function Vq({colors:e,accent:o,onChange:t,idPrefix:r="sf-theme-ink"}){let a=`${r}-button-ink`,n=v_(e),s=Oy(e,o),i=kc(e)??o,l=Si(Ma(s,i)??0);return he(gt,{label:c("Button text color"),icon:Zb["Button text color"],hint:n&&l!=="good"?c("{grade} on the button",{grade:c(bi[l])}):void 0,id:a,value:s,caption:n?s:c("Auto"),onChange:t})}var Yq=[{colour:!0},{label:"Text color",key:"text"},{label:"Label color",key:"muted"},{button:!0},{buttonInk:!0},{moduleBreak:!0},{label:"Background",key:"background"},{label:"Panels & cards",key:"surface"},{label:"Borders",key:"line"}];function Jb({colors:e,onChange:o,idPrefix:t}){let r=ht(e);return he(Bq,{children:Yq.map(a=>"colour"in a?he(uR,{value:e,onChange:o},"colour"):"moduleBreak"in a?he("div",{className:"sf-theme-module-break","aria-hidden":"true"},"module-break"):"button"in a?he(Kq,{value:e.button,accent:r.accent,onChange:n=>o({...e,button:n}),idPrefix:t},"button"):"buttonInk"in a?he(Vq,{colors:e,accent:r.accent,onChange:n=>o({...e,buttonInk:n}),idPrefix:t},"buttonInk"):he(jq,{label:a.label,colorKey:a.key,value:r[a.key],onChange:(n,s)=>o({...e,[n]:s}),idPrefix:t},a.key))})}function im({index:e,colors:o,selected:t,role:r="radio",open:a,editable:n=!0,onPick:s,onEdit:i,onChangeColors:l}){let d=ht(o),f=Xc(e),u=e<_y.length&&!o.brandInk?_y[e]:null,p=Si(Ma(d.text,d.background)??0),m=u?JSON.stringify(o)!==JSON.stringify(u):!1,h=a!==void 0;return qa("div",{className:`sf-theme-card${t?" is-selected":""}`,children:[he("button",{type:"button",role:r,"aria-checked":r==="radio"?t:void 0,"aria-selected":r==="option"?t:void 0,"aria-label":f,className:"sf-theme-pick",onClick:s,children:he(xR,{colors:o})}),qa("div",{className:"sf-theme-foot",children:[he("span",{className:"sf-theme-name",children:f}),p!=="good"&&he("span",{className:"sf-theme-warn",children:c(bi[p])}),n&&i&&h&&he("span",{className:"sf-theme-edit",children:he(Mq,{content:a?c("Collapse"):c("Edit colors"),children:he(Dq,{size:"sm","aria-expanded":a,"aria-controls":`sf-theme-colours-${e}`,"aria-label":a?c("Collapse {name}",{name:f}):c("Edit colors for {name}",{name:f}),onClick:i,children:a?he(Wq,{size:14}):he(hR,{size:14})})})}),n&&i&&!h&&he(Xb,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:f}),onClick:i,children:c("Edit")})]}),a&&qa("div",{id:`sf-theme-colours-${e}`,className:"sf-theme-colours",children:[he(Jb,{colors:o,onChange:I=>l?.(I)}),u&&he(Xb,{variant:"link",size:"sm",className:"sf-theme-reset",disabled:!m,onClick:()=>l?.({...u}),children:m?c("Reset {name} to the preset",{name:f}):c("Not changed")})]})]})}function gR({colors:e,name:o,nameId:t,open:r,menuId:a,labelId:n,buttonRef:s,onClick:i,onKeyDown:l,onEdit:d}){return qa("div",{className:"sf-secttheme-btn",children:[he("button",{ref:s,type:"button",className:"sf-theme-pick","aria-expanded":r,"aria-controls":a,"aria-labelledby":`${n} ${t}`,onClick:i,onKeyDown:l,children:e?he(xR,{colors:e}):he("span",{className:"sf-secttheme-nopreview","aria-hidden":"true"})}),qa("div",{className:"sf-theme-foot",children:[he("span",{id:t,className:"sf-theme-name",children:o}),d&&he(Xb,{variant:"secondary",size:"sm",className:"sf-theme-edit","aria-label":c("Edit {name}",{name:o}),onClick:d,children:c("Edit")}),he("button",{type:"button",className:"sf-secttheme-caret","aria-hidden":"true",tabIndex:-1,onClick:i,children:he(hR,{size:12,className:"sf-multi-caret","aria-hidden":"true"})})]})]})}import{useCallback as aS,useEffect as wR,useRef as fm}from"react";import{currentEaselSession as Zq}from"efficient-easel/screen/lib/session";import{useEaselSession as Jq}from"efficient-easel/screen/lib/session-context";import{useSyncExternalStore as qq}from"react";var yR,Qb=null,Yn=null,lm=0,eS=new Set;function oS(e){yR=e;for(let o of eS)o()}function tS(e){Qb=e,lm+=1,Yn&&clearTimeout(Yn),Yn=null,oS(void 0)}function cm(e){lm+=1,oS(e)}function ma(e=250){Qb&&(Yn&&clearTimeout(Yn),Yn=setTimeout(()=>{Yn=null;let o=Qb;if(!o)return;let t=++lm;o().then(r=>{t===lm&&oS(r)}).catch(()=>{})},e))}function IR(){return yR}function Xq(e){return eS.add(e),()=>{eS.delete(e)}}function dm(){return qq(Xq,IR,IR)}var rS=new Set;function bR(e){return rS.add(e),()=>{rS.delete(e)}}async function SR(){let e=(await Promise.allSettled([...rS].map(async o=>o()))).find(o=>o.status==="rejected");if(e)throw e.reason}import{WebsiteBackendError as Qq}from"efficient-easel/screen/lib/backend-error";function CR(e=Zq()){return(o,t,r)=>{let a=Ge(e).theme;return a?a.update(o,r?{siteId:r}:void 0):Promise.reject(new Qq("invalid","This backend stores no site theme."))}}function vR(e){return e.themeFromDocument?{status:"skipped",reason:"template"}:e.token?null:{status:"skipped",reason:"no-token"}}async function eX(e,o=CR()){let{themeFromDocument:t,token:r,siteId:a,patch:n}=e,s=vR({themeFromDocument:t,token:r});if(s)return s;if(Object.keys(n).length===0)return{status:"skipped",reason:"empty"};try{return await o(n,r,a??void 0),{status:"saved"}}catch(i){return{status:"failed",error:i}}}function Wi({themeFromDocument:e,tokenRef:o,siteId:t,onResult:r}){let a=fm(null),n=fm({}),s=Jq(),i=fm(r);i.current=r;let l=fm(null),d=aS(p=>{if(p.status==="skipped"){let m=`skipped:${p.reason}`;if(l.current===m)return;l.current=m}else l.current=null;i.current?.(p)},[]),f=aS(async()=>{a.current&&(clearTimeout(a.current),a.current=null);let p=n.current;n.current={};let m=await eX({themeFromDocument:e,token:o?.current,siteId:t,patch:p},CR(s));return d(m),m.status==="saved"&&ma(),m.status==="failed"&&(n.current={...p,...n.current}),m},[e,o,t,d,s]),u=aS((p,m=!1)=>{let h=vR({themeFromDocument:e,token:o?.current});if(h){d(h);return}n.current={...n.current,...p},a.current&&clearTimeout(a.current),m?f():a.current=setTimeout(()=>{f()},500)},[e,o,f,d]);return wR(()=>()=>{f()},[f]),wR(()=>bR(async()=>{if(!a.current&&Object.keys(n.current).length===0)return;let p=await f();if(p.status==="failed")throw p.error}),[f]),{persist:u,flush:f}}var nS="Follow the page",_R="Follow the slideshow",lX=e=>c("Editing {name} changes it everywhere.",{name:e});function cX({colors:e}){if(!e)return ko("span",{className:"sf-secttheme-chip sf-secttheme-chip--none","aria-hidden":"true"});let o=ht(e);return qn("span",{className:"sf-secttheme-chip","aria-hidden":"true",children:[ko("i",{style:{background:o.background}}),ko("i",{className:"sf-secttheme-chip-accent",style:{background:o.accent}})]})}function dX({themes:e,value:o,onPick:t,onEdit:r,menuId:a,followLabel:n}){return qn("div",{className:"sf-multi-menu sf-secttheme-menu",id:a,role:"listbox",children:[n!==void 0&&qn(oX,{children:[qn("button",{type:"button",role:"option","aria-selected":o===null,className:`sf-secttheme-item${o===null?" is-active":""}`,onClick:()=>t(Hr),children:[ko(cX,{}),ko("span",{className:"sf-secttheme-name",children:c(n)})]}),ko("div",{className:"sf-secttheme-sep",role:"presentation"})]}),o!==null&&e[o]&&ko("p",{className:"sf-secttheme-oncard",role:"presentation",children:c("{name} is on this section",{name:Xc(o)})}),e.map((s,i)=>i===o?null:ko(im,{role:"option",index:i,colors:s,selected:!1,onPick:()=>t(i),onEdit:()=>r(i)},i))]})}function fX({index:e,colors:o,onChange:t,onDone:r}){let a=Xc(e),n=ER();return qn("div",{className:"sf-secttheme-sheet",children:[qn("div",{className:"sf-secttheme-sheet-head",children:[ko("span",{children:a}),ko(aX,{variant:"secondary",className:"sf-secttheme-done",onClick:r,children:c("Done")})]}),ko("div",{className:"sf-secttheme-rows",children:ko(Jb,{colors:o,onChange:t,idPrefix:n})}),ko("p",{className:"sf-secttheme-warn",children:lX(a)})]})}function OR({value:e,onChange:o,followLabel:t,hint:r}){let{theme:a,setTheme:n}=fe(),s=vo(a),i=tX(iX),l=i?.tokenRef,d=i?.siteId??null,f=!i?.capabilities?.hasSiteTheme,{persist:u,flush:p}=Wi({themeFromDocument:f,tokenRef:l,siteId:d}),m=vo(s),h=m.themes,I=Wr(e),w=I!==null?h[I]:void 0,S=w??(h.length?yi(m):void 0),[v,b]=PR(!1),[y,k]=PR(null),L=TR(null),O=TR(null),D=ER(),T=kR(()=>{b(!1),k(null)},[]),F=kR(()=>{!v&&y===null||(p(),T())},[v,y,T,p]);nX(L,F);let C=P=>{o(P),T()},R=P=>{if(y===null)return;let _=h.map((G,Z)=>Z===y?P:G),W={...m,themes:_};n(W),u({selected_preset:W.selected,theme_presets:W.themes})};return qn("div",{className:"sf-secttheme",ref:L,children:[ko(sX,{label:c("Theme"),icon:ko(rX,{}),labelId:`${D}-label`,hint:r,children:ko(gR,{colors:S,onEdit:I!==null?()=>{k(I),b(!1)}:void 0,name:w?Xc(I):c(t??nS),nameId:`${D}-value`,labelId:`${D}-label`,open:v,menuId:D,buttonRef:O,onClick:()=>{k(null),b(P=>!P)},onKeyDown:P=>{P.key==="Escape"&&(v||y!==null)&&(P.preventDefault(),T())}})}),v&&y===null&&ko("div",{onKeyDown:P=>{P.key==="Escape"&&(P.preventDefault(),T(),O.current?.focus())},children:ko(dX,{themes:h,value:I,onPick:C,onEdit:P=>{k(P),b(!1)},menuId:D,followLabel:t})}),y!==null&&h[y]&&ko(fX,{index:y,colors:h[y],onChange:R,onDone:()=>{p(),T(),O.current?.focus()}})]})}import{jsx as AR}from"react/jsx-runtime";import{useId as pX}from"react";import{FieldSelect as uX}from"efficient-easel/fields";import{SettingsField as mX}from"efficient-easel/panel";function hX(e){return e.map(({value:o,label:t,group:r,thumb:a,meta:n})=>({value:o,label:t,...r!==void 0?{group:r}:{},...a!==void 0?{thumb:a}:{},...n!==void 0?{meta:n}:{}}))}function vAe({label:e,options:o,fallback:t,value:r,onChange:a,placeholder:n,bare:s=!1,icon:i}){let l=pX(),d=`${l}-label`,f=`${l}-button`,u=r??"",p=o.some(w=>w.value===u)?u:t,m=c(e),h=n===void 0?void 0:c(n),I=AR(uX,{id:f,value:p,options:hX(o),onChange:a,placeholder:h,searchPlaceholder:h,...s?{ariaLabel:m}:{ariaLabelledBy:`${d} ${f}`},searchable:!0,groupCount:!0,inline:!0});return s?I:AR(mX,{label:m,labelId:d,icon:i,children:I})}import{jsx as Zn,jsxs as YX}from"react/jsx-runtime";import{SettingsField as eL}from"efficient-easel/panel";import{LinkIcon as qX}from"efficient-easel/icons";import{LinkPicker as XX,TextLinkField as ZX}from"efficient-shell/ui";import{useEffect as QR,useMemo as xm,useRef as JX,useState as hm}from"react";import{currentEaselSession as xX}from"efficient-easel/screen/lib/session";function RR(){return xX().auth.token}import{currentEaselSession as QX}from"efficient-easel/screen/lib/session";import{useScreenDocument as eZ}from"efficient-easel/screen/components/ScreenDocumentContext";var gX=()=>({choosePage:c("Choose a page"),chooseSection:c("Choose a section"),noSections:c("No section anchors yet"),sectionHint:c("Jumps to a section on that page."),choosePost:c("Choose a post"),chooseProduct:c("Choose a product"),choosePopup:c("Choose a popup")});function LR(e,o,t){if(!e)return"page";if(xA(e))return"popup";if(e.startsWith("/journal/"))return"blog";if(yA(e))return"product";if(e.includes("#")){let r=e.slice(0,e.indexOf("#"));if(r===""||r==="/"||o.includes(r))return"anchor"}return e==="/"||o.includes(e)||t&&t.listingPaths.includes(t.targetOf(e))?"page":"custom"}function sS(e,o){let t=gX(),r=e.pages.map(f=>({value:zc(f.slug),label:f.title})),a=o?.pageOptions?o.pageOptions(r):r,n=a.map(f=>f.value),s=e.pages.map(f=>({label:f.title,options:IA(...f.docs).map(u=>({value:Wu(f.slug,u.slug),label:u.name}))})).filter(f=>f.options.length>0),i=f=>{switch(f){case"page":return{type:"select",options:a,placeholder:t.choosePage};case"anchor":return{type:"groups",groups:s,placeholder:s.length?t.chooseSection:t.noSections};case"blog":return{type:"select",options:e.posts.map(u=>({value:gA(u.slug),label:u.title||u.slug})),placeholder:t.choosePost};case"product":return{type:"select",options:e.products.map(u=>({value:u.href,label:u.name||u.href})),placeholder:t.chooseProduct};case"popup":return{type:"select",options:(e.popups??[]).map(u=>({value:hA(u.slug),label:u.title||u.slug})),placeholder:t.choosePopup};case"custom":return{type:"text"}}},l=mA(e.offers).map(f=>({value:f.value,label:c(f.label),target:i(f.value),...f.value==="anchor"?{hint:t.sectionHint}:{},...f.value==="blog"||f.value==="product"||f.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!o)return{kinds:l,rules:{kindOf:f=>LR(f,n),targetOf:f=>f,readFilter:()=>null,withFilter:f=>f}};let d=f=>{let u=o.withFilter(f,null);return o.listingPaths.includes(u)?u:f};return{kinds:l,rules:{kindOf:f=>LR(f,n,{listingPaths:o.listingPaths,targetOf:d}),targetOf:d,readFilter:o.readFilter,withFilter:o.withFilter},filtersFor:f=>o.listingPaths.includes(f)?o.filtersFor(f):null}}import{useEaselSession as oZ}from"efficient-easel/screen/lib/session-context";function Mo(e,o){if(typeof e=="string")return e||o;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return be(t)??o}return o}function FR(e,o){return q(e)??o}function ha(e,o){return typeof e=="boolean"?e:o}function pm(e,o){if(!Array.isArray(e))return o;let t=e.map(r=>typeof r=="string"?r:Mo(r?.text,"")).map(r=>r.trim()).filter(Boolean);return t.length?t:o}var NR=["delay","scroll","exit"],DR=["all","chosen","except"],MR=["visit","days","never","once"],IX=["all","desktop","phone"],yX=["stop","continue"],HR={min:0,max:60},WR={min:10,max:90},$R={min:1,max:90},mr={autoOpen:!1,trigger:"delay",autoOpenDelaySec:15,scrollPercent:50,showOn:"all",showOnPages:[],devices:"all",hideAfter:"days",hideDays:7,afterSubmit:"stop",startDate:null,endDate:null};function _t(e,o,t){return typeof o=="string"&&e.includes(o)?o:t}function $i(e,o,t){let r=FR(e,t);return Math.min(o.max,Math.max(o.min,Math.round(r)))}function bX(e){return typeof e.hideAfter=="string"?_t(MR,e.hideAfter,mr.hideAfter):e.oncePerSession===!0?"visit":e.oncePerSession===!1?"never":mr.hideAfter}function SX(e){return Array.isArray(e)?e.map(o=>typeof o=="string"?o.trim():"").filter(Boolean).map(o=>o.startsWith("/")?o:`/${o}`):[]}function BR(e){if(typeof e!="string")return null;let o=e.trim();return/^\d{4}-\d{2}-\d{2}$/.test(o)?o:null}function UR(e){let o=e??{},t=mr;return{autoOpen:ha(o.autoOpen,t.autoOpen),trigger:_t(NR,o.trigger,t.trigger),autoOpenDelaySec:$i(o.autoOpenDelaySec,HR,t.autoOpenDelaySec),scrollPercent:$i(o.scrollPercent,WR,t.scrollPercent),showOn:_t(DR,o.showOn,t.showOn),showOnPages:SX(o.showOnPages),devices:_t(IX,o.devices,t.devices),hideAfter:bX(o),hideDays:$i(o.hideDays,$R,t.hideDays),afterSubmit:_t(yX,o.afterSubmit,t.afterSubmit),startDate:BR(o.startDate),endDate:BR(o.endDate)}}import{parseHexColor as wX}from"efficient-shell/format";var hr="#000000";var iS="popup",CX=J_,vX=["auto","full"],kX=["inside","outside","none"],TX={min:240,max:1440},PX={min:0,max:100},Zc={placement:"center",fullWidth:!1,width:720,height:"auto",tintColor:hr,tintOpacity:60,outsideClick:!0,closeButton:"inside"};function EX(e,o){let t=typeof e=="string"?e.trim():"";return t&&wX(t)===t.toLowerCase()?t:o}function lS(e,o=Zc){let t=e??{},r=o;return{placement:_t(CX,t.placement,r.placement),fullWidth:ha(t.fullWidth,r.fullWidth),width:$i(t.width,TX,r.width),height:_t(vX,t.height,r.height),tintColor:EX(t.tintColor,r.tintColor),tintOpacity:$i(t.tintOpacity,PX,r.tintOpacity),outsideClick:ha(t.outsideClick,r.outsideClick),closeButton:_t(kX,t.closeButton,r.closeButton)}}var zR="cart-drawer",KAe="cart-drawer",_X={kickerBadge:"",kickerText:"Your order",titleLead:"Your",titleAccent:"cart.",subtitleEmpty:"Empty for now.",subtitleOne:"One set in your cart.",subtitleMany:"{count} sets in your cart.",leadTimeValue:"",shipsToFallback:"",promises:[],emptyKicker:"No wheels yet",emptyBody:"Your cart is empty. Pick a wheel to get started."};function VAe(e,o){return o===0?e.subtitleEmpty:o===1?e.subtitleOne:e.subtitleMany.replace("{count}",String(o))}function YAe(e){let o=e??{},t=_X;return{kickerBadge:Mo(o.kickerBadge,t.kickerBadge),kickerText:Mo(o.kickerText,t.kickerText),titleLead:Mo(o.titleLead,t.titleLead),titleAccent:Mo(o.titleAccent,t.titleAccent),subtitleEmpty:Mo(o.subtitleEmpty,t.subtitleEmpty),subtitleOne:Mo(o.subtitleOne,t.subtitleOne),subtitleMany:Mo(o.subtitleMany,t.subtitleMany),leadTimeValue:Mo(o.leadTimeValue,t.leadTimeValue),shipsToFallback:Mo(o.shipsToFallback,t.shipsToFallback),promises:pm(o.promises,t.promises),emptyKicker:Mo(o.emptyKicker,t.emptyKicker),emptyBody:Mo(o.emptyBody,t.emptyBody)}}var OX=["right","left"],AX={...Zc,width:520,tintOpacity:68};function qAe(e){let o=e??{};return{...lS(o,AX),placement:_t(OX,o.placement,"right"),height:"full",fullWidth:!1,autoOpen:ha(o.autoOpen,!0)}}var jR="consent-banner",QAe="consent-banner";var RX=[{value:"bar",label:"Bar"},{value:"card",label:"Card"}],eRe="Layout",GR={layout:"bar"},LX=e=>RX.some(o=>o.value===e);function oRe(e){let o=Mo((e??{}).layout,GR.layout);return{layout:LX(o)?o:GR.layout}}var tRe={...Zc,placement:"bottom-center",fullWidth:!0,width:440,tintOpacity:0,outsideClick:!1,closeButton:"none"};var FX="consentWords",BX=["eyebrow","notice","accept","reject","choose"];function cS(e){let o=(e??{})[FX];return typeof o=="string"&&BX.includes(o)?o:null}function dS(e){let o=e?.props;return o?cS(o)!==null?!0:Object.values(o).some(t=>Array.isArray(t)&&t.some(r=>r&&typeof r=="object"&&"props"in r&&dS(r))):!1}var NX=["meta","eyebrow","heading","body","statName","statValue","formEyebrow","formHeading","formIntro","fieldLabel","option","finePrint","dismiss","doneHeading","doneBody"],nRe={meta:"Meta line",eyebrow:"Eyebrow",heading:"Heading",body:"Body",statName:"Stat name",statValue:"Stat value",formEyebrow:"Form eyebrow",formHeading:"Form heading",formIntro:"Form intro",fieldLabel:"Field label",option:"Option",finePrint:"Fine print",dismiss:"Dismiss link",doneHeading:"Success heading",doneBody:"Success message"},DX={meta:"styleMeta",eyebrow:"styleEyebrow",heading:"styleHeading",body:"styleBody",statName:"styleStatName",statValue:"styleStatValue",formEyebrow:"styleFormEyebrow",formHeading:"styleFormHeading",formIntro:"styleFormIntro",fieldLabel:"styleFieldLabel",option:"styleOption",finePrint:"styleFinePrint",dismiss:"styleDismiss",doneHeading:"styleDoneHeading",doneBody:"styleDoneBody"},sRe={meta:{font:"--pp-meta-font",size:"--pp-meta-size"},eyebrow:{font:"--pp-eyebrow-font",size:"--pp-eyebrow-size"},heading:{font:"--pp-heading-font",size:"--pp-heading-size"},body:{font:"--pp-body-font",size:"--pp-body-size"},statName:{font:"--pp-statname-font",size:"--pp-statname-size"},statValue:{font:"--pp-statvalue-font",size:"--pp-statvalue-size"},formEyebrow:{font:"--pp-formeyebrow-font",size:"--pp-formeyebrow-size"},formHeading:{font:"--pp-formheading-font",size:"--pp-formheading-size"},formIntro:{font:"--pp-formintro-font",size:"--pp-formintro-size"},fieldLabel:{font:"--pp-fieldlabel-font",size:"--pp-fieldlabel-size"},option:{font:"--pp-option-font",size:"--pp-option-size"},finePrint:{font:"--pp-fineprint-font",size:"--pp-fineprint-size"},dismiss:{font:"--pp-dismiss-font",size:"--pp-dismiss-size"},doneHeading:{font:"--pp-doneheading-font",size:"--pp-doneheading-size"},doneBody:{font:"--pp-donebody-font",size:"--pp-donebody-size"}};function KR(e){let o={};for(let t of NX){let r=aa(e[DX[t]]);r&&(o[t]=r)}return o}var VR={heading:"Join our email list",placeholder:"Email address",buttonLabel:"Subscribe"},MX={lead:"We accept"},mm={...MX,methods:[],size:"sm",align:"start",dataSource:gp},xr="site-footer";var cRe=xr,dRe={desktop:!0,tablet:!0,mobile:!0},fRe={desktop:!1,tablet:!1,mobile:!1},fS=1,YR=6,pRe=Array.from({length:YR-fS+1},(e,o)=>fS+o),um={desktop:6,tablet:3,mobile:2},HX={2:{desktop:2,tablet:2,mobile:1},3:{desktop:3,tablet:3,mobile:1},4:{desktop:4,tablet:2,mobile:2},5:{desktop:5,tablet:3,mobile:2},6:{desktop:6,tablet:3,mobile:2}},Xn=e=>Math.min(Math.max(Math.round(e),fS),YR);function uRe(e){if(typeof e=="number")return HX[Xn(e)]??{desktop:Xn(e),tablet:Xn(e),mobile:Xn(e)};if(e&&typeof e=="object"){let o=e;return{desktop:Xn(o.desktop??um.desktop),tablet:Xn(o.tablet??um.tablet),mobile:Xn(o.mobile??um.mobile)}}return{...um}}var pS="subscribe-popup",SRe="subscribe-popup",WX=[pS,xr,zR,jR];function XR(e){return WX.includes(e)}var $X=["right","left"],UX={metaLabel:"Meta label",issueLabel:"Label",issueNumber:"00",kicker:"Kicker",heading:`Main heading
2
2
  *Highlight line*`,deck:"Add a sentence or two of supporting copy.",stats:[{label:"Label",value:"Value"},{label:"Label",value:"Value"},{label:"Label",value:"Value"},{label:"Label",value:"Value"}],formLabel:"Section label",formHeading:"Main heading *highlight*",formIntro:"Add a sentence or two of supporting copy.",firstNameLabel:"Field label",firstNamePlaceholder:"Placeholder",emailLabel:"Field label",emailPlaceholder:"Placeholder",interestsLabel:"Field label",interests:["Option one","Option two","Option three"],frequencyLabel:"Field label",frequencies:["Option one","Option two","Option three"],submitText:"Button label",finePrint:"Fine print",dismissText:"Dismiss link",emailInvalidText:"Enter a valid email address.",submitErrorText:"Could not subscribe right now. Please try again.",successHeading:"Main heading *highlight*",successBody:"Add a sentence or two of supporting copy \u2014 the {email} and {issue} tokens are substituted here.",keepBrowsingText:"Button label",autoOpen:mr.autoOpen,autoOpenDelaySec:mr.autoOpenDelaySec,formSlug:"",trigger:mr.trigger,scrollPercent:mr.scrollPercent,showOn:mr.showOn,showOnPages:[],hideAfter:mr.hideAfter,hideDays:mr.hideDays,formSide:"right",valuePanelOnPhone:!1,sectionAccent:void 0,sectionCorners:void 0,sectionCornerSides:void 0,textStyles:{}},lo=Mo,zX=ha,ZR=pm;function qR(e,o){if(e==null)return o;let t=r=>r.trim()?r:"";if(typeof e=="string")return t(e);if(typeof e=="object"&&"text"in e){let r=e.text;return typeof r=="string"?t(r):""}return o}function GX(e,o){return Array.isArray(e)?ZR(e,[]):o}function jX(e,o){return Array.isArray(e)?e.map(t=>{let r=t??{};return{label:lo(r.label,""),value:lo(r.value,"")}}).filter(t=>t.label||t.value):o}function CRe(e){let o=e??{},t=UX,r=UR(o);return{metaLabel:lo(o.metaLabel,t.metaLabel),issueLabel:qR(o.issueLabel,t.issueLabel),issueNumber:qR(o.issueNumber,t.issueNumber),kicker:lo(o.kicker,t.kicker),heading:lo(o.heading,t.heading),deck:lo(o.deck,t.deck),stats:jX(o.stats,t.stats),formLabel:lo(o.formLabel,t.formLabel),formHeading:lo(o.formHeading,t.formHeading),formIntro:lo(o.formIntro,t.formIntro),firstNameLabel:lo(o.firstNameLabel,t.firstNameLabel),firstNamePlaceholder:lo(o.firstNamePlaceholder,t.firstNamePlaceholder),emailLabel:lo(o.emailLabel,t.emailLabel),emailPlaceholder:lo(o.emailPlaceholder,t.emailPlaceholder),interestsLabel:lo(o.interestsLabel,t.interestsLabel),interests:ZR(o.interests,t.interests),frequencyLabel:lo(o.frequencyLabel,t.frequencyLabel),frequencies:GX(o.frequencies,t.frequencies),submitText:lo(o.submitText,t.submitText),finePrint:lo(o.finePrint,t.finePrint),dismissText:lo(o.dismissText,t.dismissText),emailInvalidText:lo(o.emailInvalidText,t.emailInvalidText),submitErrorText:lo(o.submitErrorText,t.submitErrorText),successHeading:lo(o.successHeading,t.successHeading),successBody:lo(o.successBody,t.successBody),keepBrowsingText:lo(o.keepBrowsingText,t.keepBrowsingText),formSlug:typeof o.formSlug=="string"?o.formSlug.trim():t.formSlug,autoOpen:r.autoOpen,autoOpenDelaySec:r.autoOpenDelaySec,trigger:r.trigger,scrollPercent:r.scrollPercent,showOn:r.showOn,showOnPages:r.showOnPages,hideAfter:r.hideAfter,hideDays:r.hideDays,formSide:_t($X,o.formSide,t.formSide),valuePanelOnPhone:zX(o.valuePanelOnPhone,t.valuePanelOnPhone),sectionAccent:o.sectionAccent,sectionCorners:o.sectionCorners,sectionCornerSides:o.sectionCornerSides,textStyles:KR(o)}}function KX(e,o=Math.random){for(;;){let t=`popup-${Math.floor(o()*2176782336).toString(36).padStart(6,"0")}`;if(!e.has(t))return t}}function VX(e){return{root:{props:{title:e,kind:iS}},content:[],zones:{}}}function JR(e,o,t){return{slug:KX(o,t),title:e,kind:xb,layout:VX(e)}}function Jc(e){return e?.root?.props?.kind===iS}function oL(e){let o=new Map;return(t="")=>{let r=RR(),a=o.get(t);if(!a||a.token===null&&r!==null){let n=r||!QX().usesBridgedToken?e(r??"",t).catch(()=>[]):Promise.resolve([]);return o.set(t,{promise:n,token:r}),n}return a.promise}}var tZ=oL(async(e,o)=>{let t=o?{siteId:o}:void 0,{pages:r}=Ge();return r.linkTargets?r.linkTargets(t):(await r.list(t)).map(a=>({id:a.id,slug:a.slug,label:a.label,layout:null}))}),rZ=oL(async(e,o)=>await Ge().blog?.posts(o?{siteId:o}:void 0)??[]);function aZ({value:e,onChange:o,label:t="Link",data:r,filters:a}){let n=xm(()=>sS(r,a),[r,a]),s=c(t);return Zn(eL,{label:s,icon:Zn(qX,{}),children:Zn(XX,{value:e,onChange:i=>o(i),kinds:n.kinds,rules:n.rules,filtersFor:n.filtersFor,label:s})})}function tL(){let{siteId:e,capabilities:o}=eZ(),{offersCommerce:t,hasBlog:r}=o,[a,n]=hm([]),[s,i]=hm([]),[l,d]=hm([]),[f,u]=hm(null),p=oZ().chrome,m=p?.products?.list,h=p?.linkFilters,I=h?void 0:p?.linkRow,w=JX(!0);QR(()=>(w.current=!0,()=>{w.current=!1}),[]),QR(()=>{let b=!0;return tZ(e??void 0).then(y=>b&&w.current&&n(y)),r&&rZ(e??void 0).then(y=>b&&w.current&&i(y)),t&&m?.().then(y=>b&&w.current&&d(y)),t&&h?h.load(e).catch(()=>null).then(y=>b&&w.current&&u(()=>y)):u(null),()=>{b=!1}},[e,t,r,m,h]);let S=xm(()=>({pages:a.filter(b=>!XR(b.slug)&&!Jc(b.layout)).map(b=>({slug:b.slug,title:b.label,docs:[b.layout]})),popups:a.filter(b=>b.slug===pS||Jc(b.layout)).map(b=>({slug:b.slug,title:b.label})),posts:r?s.map(b=>({slug:b.slug,title:b.title})):[],products:t?l.map(b=>({href:b.href,name:b.name})):[],offers:{offersCommerce:t,offersService:r}}),[a,s,l,t,r]),v=xm(()=>f?f(S.pages):null,[f,S]);return{data:S,filters:v,pages:a,offersCommerce:t,HostLinkRow:I}}function zRe({label:e,icon:o,text:t,onTextChange:r,link:a,onLinkChange:n}){let{data:s,filters:i}=tL(),l=xm(()=>sS(s,i),[s,i]),d=c(e);return Zn(eL,{label:d,icon:o,children:Zn(ZX,{label:d,text:t,onTextChange:r,link:a,onLinkChange:f=>n(f),kinds:l.kinds,rules:l.rules,filtersFor:l.filtersFor})})}function rL({value:e,onChange:o,label:t="Link"}){let r=typeof e=="string"?e:"",{data:a,filters:n,pages:s,offersCommerce:i,HostLinkRow:l}=tL(),d=a.pages.map(u=>zc(u.slug)),f=i&&l&&(r==="/"||d.includes(r))?l:void 0;return YX("div",{children:[Zn(aZ,{value:r,onChange:o,label:t,data:a,filters:n}),f&&Zn(f,{value:r,onChange:o,pages:s})]})}import{UiIcon as _F}from"efficient-easel/draw/client";import{phoneKey as yL,resolveViewValue as hZ,tabletKey as bL,viewKeyAt as Jn}from"efficient-easel/draw";import{SECTION_PAD_UNIT_KEY as wL,SITE_SIDE as xZ,convertLength as gZ,isLengthUnit as IZ,isSiteSide as CL,sideLengthAt as yZ,sideValueAt as bZ,withLength as IS}from"efficient-easel/screen/lib/content/length-units";import{convertLength as nZ}from"efficient-easel/screen/lib/content/length-units";var je={min:1e3,max:2e3,step:50,default:1600};function Ui(e){return{maxWidth:e,marginInline:"auto",width:"100%"}}var uS="--sf-site-width",Ho=`var(${uS},${je.default}px)`,Qc="100vw",VRe=`max-w-[${Ho}]`,YRe=`max-w-[${je.default}px]`;function iL(e){return typeof e!="number"||!Number.isFinite(e)?je.default:Math.round(Math.min(Math.max(e,je.min),je.max))}function lL(e,o){let t=Bn(e,o,"size",je);if(t!==null)return{[uS]:t};let r=iL(e);return r===je.default?{}:{[uS]:`${r}px`}}var ct={min:0,max:80,step:4,default:40},mS="--sf-site-gutter",gr={min:0,max:24,step:4},aL="--sf-site-gutter-phone",sZ="max-view-tablet:[--sf-site-gutter:var(--sf-site-gutter-phone)]!",iZ="max-view-wide:[&_[data-sf-line~=edge]:not([data-sf-line~=edge]_*)]:[--sf-site-gutter:var(--sf-site-gutter-phone)]",Ot=`var(${mS},${ct.default}px)`,lZ=`px-[${Ot}]`;var Gr={md:`min(24px,${Ot})`,sm:`min(20px,${Ot})`,frame:`min(24px,${Ot})`,tabs:`min(16px,${Ot})`},qRe=[[`max-view-desktop:px-[${Gr.md}]`,"max-view-desktop:px-6"],[`max-view-desktop:px-[${Gr.tabs}]`,"max-view-desktop:px-4"],[`max-[960px]:px-[${Gr.frame}]`,"max-[960px]:px-6"],[`max-[900px]:px-[${Gr.md}]`,"max-[900px]:px-6"],[`max-view-wide:px-[${Gr.md}]`,"max-view-wide:px-6"],[`max-view-tablet:px-[${Gr.sm}]`,"max-view-tablet:px-5"],[`max-view-wide:px-[${Gr.sm}]`,"max-view-wide:px-5"],[`max-[640px]:px-[${Gr.sm}]`,"max-[640px]:px-5"],[`view-wide:px-[${Ot}]`,"view-wide:px-10"],[`max-view-tablet:px-[min(24px,${Ot})]`,"max-view-tablet:px-6"],[`max-view-wide:-mx-[min(20px,${Ot})]`,"max-view-wide:-mx-5"],[`max-view-tablet:-mx-[min(20px,${Ot})]`,"max-view-tablet:-mx-5"],[`-mx-[${Ot}]`,"-mx-10"],[lZ,"px-10"]];var cL="max-view-wide:px-[min(20px,var(--sf-site-gutter,40px))]";function Xa(e){return cZ[e??"box"]}var nL="var(--sf-pad-site,var(--sf-box-g,var(--sf-site-gutter,40px)))",sL="[--sf-edge-g:var(--sf-pad-site)]",cZ={box:{className:"[--sf-pad-site:var(--sf-box-g,var(--sf-site-gutter,40px))] max-[960px]:[--sf-pad-site:min(24px,var(--sf-box-g,var(--sf-site-gutter,40px)))]",value:nL,edge:sL,frame:"max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]"},site:{className:"[--sf-pad-site:var(--sf-box-g,var(--sf-site-gutter,40px))] max-view-wide:[--sf-pad-site:min(20px,var(--sf-box-g,var(--sf-site-gutter,40px)))]",value:nL,edge:sL,frame:cL}},XRe=`mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] ${cL}`,dL="[--sf-box-g:var(--sf-site-gutter,40px)] [&>*]:[--sf-site-gutter:0px]";var fL="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-view-desktop:px-[min(24px,var(--sf-site-gutter,40px))]";function gm(e){return typeof e!="number"||!Number.isFinite(e)?ct.default:Math.round(Math.min(Math.max(e,ct.min),ct.max))}function pL(e,o){let t=Bn(e,o,"spacing",ct);if(t!==null)return{[mS]:t};let r=gm(e);return r===ct.default?{}:{[mS]:`${r}px`}}function Im(e){return typeof e!="number"||!Number.isFinite(e)?null:Math.round(Math.min(Math.max(e,gr.min),gr.max))}function uL(e){return typeof e=="number"&&Number.isFinite(e)?iL(e):null}function mL(e,o){let t=Bn(e,o,"spacing",gr);if(t!==null)return{[aL]:t};let r=Im(e);return r===null?{}:{[aL]:`${r}px`}}function hL(e){return Im(e)===null?"":`${sZ} ${iZ}`}function ym(e,o){let t=Kp(e,o,"spacing",ct),r=t===null?gm(e):nZ(t,Ee(o),"px","mobile",gr);return Math.min(gr.max,r)}var xL=Ho,ZRe=`max-w-[${xL}]`,JRe=`max-w-[min(var(--sf-page-cap,${je.default}px),${je.default}px)]`,bm="--sf-hero-cap",dZ=`var(${bm},none)`,QRe=`max-w-[${dZ}]`,fZ="--sf-hero-bleed-m",pZ="--sf-hero-bleed-w",hS="--sf-hero-chrome-x",xS="--sf-hero-chrome-cap";function Sm(e){return e===!0?{[bm]:xL,[fZ]:"auto",[pZ]:"100%",[hS]:"24px",[xS]:"none"}:{}}var gS=`calc(${Ho} - ${Ot}*2)`,eLe=`max-w-[${gS.replace(/ /g,"_")}]`;var uZ="--sf-chrome-cap",mZ=`var(${uZ},${gS})`,gL="data-page-width";function IL(e){return e==="full"?"full":null}function oLe(e){return e==="full"?null:Ui(e==="content"?gS:mZ)}function tLe(e){if(e==="full")return"full";if(e==="content")return"content"}var zt={min:10,max:200,step:10};function SZ(e,o,t,r=0){let a=q(e),n=q(o);if(a===void 0&&n===void 0)return;let s=wm(t),i=l=>l===void 0?void 0:s==="px"?l:IS(l,s,r);return{paddingTop:i(a),paddingBottom:i(n)}}var wm=e=>Ee(e),wZ="sf-pad-top-phone",CZ="sf-pad-bottom-phone",vZ="--sf-pad-t-phone",kZ="--sf-pad-b-phone",TZ="sf-pad-left-phone",PZ="sf-pad-right-phone",EZ="--sf-pad-l-phone",_Z="--sf-pad-r-phone",OZ="sf-pad-top-tablet",AZ="sf-pad-bottom-tablet",RZ="sf-pad-left-tablet",LZ="sf-pad-right-tablet",FZ="--sf-pad-t-tablet",BZ="--sf-pad-b-tablet",NZ="--sf-pad-l-tablet",DZ="--sf-pad-r-tablet",vL="sf-section-pad";function ed(e){let o={desktop:e.unit,tablet:e.unitTablet,phone:e.unitPhone},t=SZ(e.top,e.bottom,e.unit,e.frame),r=od({left:e.left,right:e.right},{top:e.topPhone,bottom:e.bottomPhone,left:e.leftPhone,right:e.rightPhone},{top:e.topTablet,bottom:e.bottomTablet,left:e.leftTablet,right:e.rightTablet},{top:e.top,bottom:e.bottom,left:e.left,right:e.right},o,e.frame,e.sideSpace);return t===void 0&&!r.classes.length&&!Object.keys(r.style).length?null:{className:[vL,...r.classes].join(" "),style:{...t,...r.style}}}var MZ=e=>CL(e)?e:q(e),HZ=[["top","paddingTop",[OZ,FZ],[wZ,vZ]],["bottom","paddingBottom",[AZ,BZ],[CZ,kZ]],["left","paddingLeft",[RZ,NZ],[TZ,EZ]],["right","paddingRight",[LZ,DZ],[PZ,_Z]]];function SL(e,o,t){return!IZ(o)||o==="px"?e:gZ(e,"px",o,t,{min:0,max:zt.max,step:1})}function WZ(e,o,t,r={},a=0){let n=(m,h)=>{if(h==="px")return`${m}px`;let I=IS(m,h,a);return typeof I=="number"?`${I}px`:I},s={n:e,[bL("n")]:o,[yL("n")]:t,u:r.desktop,[bL("u")]:r.tablet,[yL("u")]:r.phone},i=hZ("spacing",q(e),q(o),q(t),pi()),l=(m,h,I)=>{if(bZ(s,{side:"n"},m,"side",["side"])?.value===xZ)return Xa().value;let w=yZ(s,{side:"n"},"u",m,"side");if(!w)return;let S=h!==null&&!I&&w.unit==="px"&&typeof i[h]=="number";return n(S?i[h]:w.value,w.unit)},d=l("desktop",null,!0),f={},u=l("tablet","tablet",o!==void 0);u!==void 0&&(o!==void 0||u!==d)&&(f.tablet=u);let p=l("mobile","phone",t!==void 0);return p!==void 0&&(t!==void 0||p!==d)&&(f.phone=p),f}function od(e,o,t={},r=e,a={},n=0,s="box"){let i={},l={},d=[],f=Xa(s),u=!1;for(let[p,m,...h]of HZ){let I=p==="left"||p==="right"?MZ:q,w=I(e[p]),S=p==="top"||p==="bottom"?n:0;CL(w)?(i[m]=f.value,u=!0):w!==void 0&&(i[m]=wm(a.desktop)==="px"?w:IS(w,wm(a.desktop),S));let v=WZ(I(r[p]),I(t[p]),I(o[p]),a,S);for(let[b,[y,k]]of[["tablet",h[0]],["phone",h[1]]]){let L=v[b];L!==void 0&&(d.push(y),l[k]=L,L===f.value&&(u=!0))}}return u&&d.push(...f.className.split(" ")),{classes:d,style:{...i,...l}}}var jr={top:"padTop",bottom:"padBottom",left:"padLeft",right:"padRight"},Qn="padUnit";function td(e,o){let t=e[Qn],r=(a,n,s)=>{let i=q(a)??(s===void 0?void 0:SL(s,t,"desktop")),l=q(n);return l===void 0?i:(i??0)+SL(l,t,"desktop")};return{top:r(e.padTop,e.sectionPaddingTop,o.top),bottom:r(e.padBottom,e.sectionPaddingBottom,o.bottom)}}function kL(e,o,t={}){let r=td(e,o),a={...bS(e,jr,!0,Qn),top:r.top,bottom:r.bottom};t.noTop&&Object.assign(a,{top:0,topTablet:void 0,topPhone:void 0});let n=ed(a),s=n?n.className.split(" ").filter(i=>i!==vL):[];return{...s.length?{className:s.join(" ")}:{},style:n?.style??{}}}var xa={top:"sectionPaddingTop",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft",right:"sectionPaddingRight"},yS=[...["top","bottom","left","right"].map(e=>[jr[e],xa[e]]),[Qn,wL]].flatMap(([e,o])=>[[e,o],...["tablet","mobile"].map(t=>[Jn(e,t),Jn(o,t)])]);function bS(e,o=xa,t=!0,r=o===xa?wL:void 0){let a={};if(r){e[r]!==void 0&&(a.unit=e[r]);for(let n of["tablet","mobile"])e[Jn(r,n)]!==void 0&&(a[Jn("unit",n)]=e[Jn(r,n)])}for(let n of t?["top","bottom","left","right"]:["top","bottom"]){a[n]=e[o[n]];for(let s of["tablet","mobile"])a[Jn(n,s)]=e[Jn(o[n],s)]}return a}function TL(e){return ed(e)}function PL(e,o){let t=(r,a)=>typeof r!="number"?void 0:wm(a)==="px"?r+o:r;return ed({...e,frame:o,top:t(e.top,e.unit),bottom:t(e.bottom,e.unit),topTablet:t(e.topTablet,e.unitTablet),bottomTablet:t(e.bottomTablet,e.unitTablet),topPhone:t(e.topPhone,e.unitPhone),bottomPhone:t(e.bottomPhone,e.unitPhone)})}import{BUTTON_PAD_KEYS as Cm,buttonBorderOf as $Z,buttonFillOpacityOf as UZ,buttonPadSidesOf as zZ,viewKeyAt as GZ}from"efficient-easel/draw";import{BUTTON_PAD_UNIT_KEY as SS,lengthOf as jZ}from"efficient-easel/screen/lib/content/length-units";var KZ="px-6 py-4",VZ=4,vm=e=>{let o=new RegExp(`\\bp${e}-(?:\\[(\\d+)px\\]|(\\d+))`).exec(KZ);if(!o)throw new Error(`BUTTON_PAD_CLASSES has no p${e}`);return o[1]!==void 0?Number(o[1]):Number(o[2])*VZ},ILe={top:vm("y"),right:vm("x"),bottom:vm("y"),left:vm("x")},_L="var(--btn)";function YZ(e){let o=e.variant==="ghost",t=UZ(e.buttonFillOpacity),r=$Z(e.buttonBorder),a=be(e.buttonColor);return{fillOpacity:t??(o?0:100),border:{width:r?.width??1,color:r?.color??a??(o?"currentColor":_L)},changed:t!==void 0||r!==void 0}}function yLe(e){let o=YZ(e);if(!o.changed)return null;let t=be(e.buttonColor)??_L;return{background:o.fillOpacity===0?"transparent":o.fillOpacity===100?t:`color-mix(in srgb, ${t} ${o.fillOpacity}%, transparent)`,borderWidth:jZ(o.border.width,Ee(e.buttonBorderUnit)),borderStyle:"solid",borderColor:o.border.color}}var qZ="var(--sf-button-radius, 0)";function bLe(e){let o=q(e.buttonCorners),t=$r(e.buttonCornerSides);if(o===void 0&&t===null)return null;let r=o===void 0?qZ:Me(Math.max(0,o),e.buttonCornersUnit);return{borderRadius:t===null?r:$n(r,t)}}function SLe(e){let o=(s,i)=>e[GZ(s,i)],t=s=>zZ({top:o(Cm.top,s),right:o(Cm.right,s),bottom:o(Cm.bottom,s),left:o(Cm.left,s)})??{},r={desktop:o(SS,"desktop"),tablet:o(SS,"tablet"),phone:o(SS,"mobile")},{classes:a,style:n}=od(t("desktop"),t("mobile"),t("tablet"),void 0,r);return Object.keys(n).length?{className:a.join(" "),style:n}:null}var EL="upper";function OL(e,o,t){let r=e&&typeof e=="object"?e:{},a=be(r.textStyle),n=a?be(o?.find(f=>f?.id===a)?.name):void 0,s=a?/^(heading|body)-(\d+)$/.exec(a):null,i=a?n||(s?t.styleName({kind:s[1],n:Number(s[2])}):a):t.noStyle,{cases:l}=t,d=be(r.case)??EL;return`${i} \xB7 ${l[d]??l[EL]}`}import{usePreviewParts as KQ}from"efficient-easel/draw/client";import{encodePartId as VQ}from"efficient-easel/draw";import{DEFAULT_EASEL_STRINGS as YQ,useEaselStrings as qQ}from"efficient-easel/strings";import{PIN_STICK_VAR as XZ,PIN_TRACK_POSITION_VAR as ZZ,pinAttrs as AL,pinStickVars as JZ,readPin as vS}from"efficient-shell/format";var PLe="Stick to top",Gt={min:0,max:200,step:4,fallback:0},rd={kind:"position",unitKey:"stickTopDistanceUnit"},RL=Ii(rd),[QZ,eJ,oJ]=RL,kS="Pin while scrolling",LL="Scroll",Ir={distance:"--sf-pin-distance",position:"--sf-pin-position",on:"--sf-pin-on",length:"--sf-pin-length",stick:"--sf-pin-stick",trackPosition:"--sf-pin-track-position",header:"--sf-pin-header"},yr="stickTopScreens",TS=[yr,"stickTopScreensTablet","stickTopScreensPhone"],PS="Screens",es="stickTopStop",Za="screen",FL="Pin stops at",BL=[{value:"header",label:"Under the header"},{value:Za,label:"Screen top"}],NL="header",DL="Under the header: the section stops below the site header. Screen top: it stops at the top edge of the screen, under a see-through header.";function ES(e){return e===Za?Za:"header"}function ML(e){return e===Za?Za:void 0}var Ja="stickAbove",HL="Stays above",WL="On: the pinned box stays on top, and the sections after it scroll under it.";function tJ(e){return e.stickAbove===!0}var $L=["stickTop","stickTopDistance","stickTopTablet","stickTopDistanceTablet","stickTopPhone","stickTopDistancePhone",...RL,...TS,es,Ja],_S=new Set(["IntroBleed"]),UL=new Set(["CategoryBar","DocTabs","Contents"]);function rJ(e){return typeof e.stickTop=="boolean"?e.stickTop:e.sticky!==!1}var wS=e=>vS(!0,e).length,zi={any:["stickTop","stickTopTablet","stickTopPhone"].map(e=>({field:e,is:!0}))},km={all:[{not:{field:"stickTop",in:[!0,!1]}},{not:{field:"sticky",is:!1}}]};function CS(e,o="px"){let t=q(e)??Gt.fallback;return o!=="px"?Math.max(Gt.min,t):Math.min(Gt.max,Math.max(Gt.min,Math.round(t)))}function OS(e){return typeof e.stickTopTablet=="boolean"}function AS(e){return typeof e.stickTopPhone=="boolean"}function Gi(e,o={}){let t=o.intro?rJ(e):e.stickTop===!0,r=e,a=Ee(r[QZ]),n=CS(e.stickTopDistance,a),s=wS(e.stickTopScreens),i=OS(e),l=i?e.stickTopTablet===!0:t,d=i?Ee(r[eJ]):a,f=i?CS(e.stickTopDistanceTablet,d):n,u=i?wS(e.stickTopScreensTablet):s,p=AS(e),m=p?e.stickTopPhone===!0:l,h=p?Ee(r[oJ]):d,I=p?CS(e.stickTopDistancePhone,h):f,w=p?wS(e.stickTopScreensPhone):u;return{desktop:t,desktopDistance:n,desktopUnit:a,desktopScreens:s,tablet:l,tabletDistance:f,tabletUnit:d,tabletScreens:u,ownTablet:i,phone:m,phoneDistance:I,phoneUnit:h,phoneScreens:w,ownPhone:p}}function RS(e,o={}){let t=Gi(e,{intro:o.atScreenTop});if(!t.desktop&&!t.tablet&&!t.phone)return null;let r=o.atScreenTop===!0&&typeof e.stickTop!="boolean",a=t.desktop&&t.desktopScreens>0||t.tablet&&t.tabletScreens>0||t.phone&&t.phoneScreens>0,n=o.above===!0&&tJ(e),s=o.track===!0&&!r&&a&&!n,i=(u,p,m,h)=>Kn({tabletClass:"",tabletVar:`${u}-tablet`,phoneClass:"",phoneVar:`${u}-phone`},p,m,h).style,l={...o.atScreenTop||ES(e.stickTopStop)===Za?{[Ir.header]:"0px"}:{},[Ir.distance]:Me(t.desktopDistance,t.desktopUnit),...i(Ir.distance,Me(t.desktopDistance,t.desktopUnit),Me(t.tabletDistance,t.tabletUnit),Me(t.phoneDistance,t.phoneUnit))};if(s){let u=m=>m?"1":"0",p={...l,...t.desktop?{}:{[Ir.on]:"0"},...i(Ir.on,u(t.desktop),u(t.tablet),u(t.phone)),[Ir.length]:String(t.desktopScreens),...i(Ir.length,String(t.desktopScreens),String(t.tabletScreens),String(t.phoneScreens)),...aJ(t.desktop&&t.desktopScreens===0,t.tablet&&t.tabletScreens===0,t.phone&&t.phoneScreens===0,i)};return{attrs:AL(vS(!0),"track").attrs,style:p}}let d=u=>u?"sticky":"static",f={...l,...t.desktop?{}:{[Ir.position]:"static"},...i(Ir.position,d(t.desktop),d(t.tablet),d(t.phone))};return{attrs:AL(vS(!0),"stick",n?{above:n}:{}).attrs,style:f}}function aJ(e,o,t,r){let a=[[Ir.stick,XZ],[Ir.trackPosition,ZZ]],[n,s,i]=[e,o,t].map(JZ);return Object.fromEntries(a.flatMap(([l,d])=>[...e?[[l,n[d]]]:[],...Object.entries(r(l,n[d],s[d],i[d]))]))}var nJ=["column","row","tabs","accordion"];var sJ={column:"Stacked",row:"One row",tabs:"Tabs",accordion:"Accordion"},zL={Flex:nJ,HeroGroup:["column","row"]},iJ={Flex:"row",HeroGroup:"column"},lJ={column:"flex-col",row:"flex-row",tabs:"flex-col",accordion:"flex-col"};function Kr(e,o){return zL[e].includes(o)?o:iJ[e]}function _Le(e,o){return lJ[Kr(e,o)]}function GL(e){return zL[e].map(o=>({label:sJ[o],value:o}))}import{viewKeyAt as LS}from"efficient-easel/screen/lib/content/view-tiers";var Pm=20,cJ=["solid","dashed","dotted"],Em=["top","right","bottom","left"],_m="sf-section-border",KL="sf-section-border-self",dJ=/^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,fJ=e=>typeof e=="number"&&Number.isFinite(e)?`${Math.min(Pm,Math.max(0,Math.round(e)))}px`:void 0,ad={kind:"border",unitKey:"sectionBorderUnit"},VL=Ii(ad);function YL(e){let o=ad.unitKey;return{desktop:e[LS(o,"desktop")],tablet:e[LS(o,"tablet")],phone:e[LS(o,"mobile")]}}var jL=(e,o)=>o==="px"?fJ(e):typeof e=="number"&&Number.isFinite(e)?Me(Math.max(0,e),o):void 0;function Tm(e,{phone:o=!1,tablet:t=!1,unit:r}={}){if(!e||typeof e!="object")return;let a=o?"-phone":t?"-tablet":"",n={},s=Ee(r);for(let i of Em){let l=jL(e[i],s)??jL(e.width,s);l!==void 0&&(n[`--sf-border-${i}-width${a}`]=l)}return typeof e.style=="string"&&cJ.includes(e.style)&&(n[`--sf-border-style${a}`]=e.style),typeof e.color=="string"&&dJ.test(e.color)&&(n[`--sf-border-color${a}`]=e.color.toLowerCase()),Object.keys(n).length?n:void 0}function FS(e){let{width:o,...t}=e;return typeof o!="number"?e:{...t,...Object.fromEntries(Em.map(r=>[r,t[r]??o]))}}function qL(e,o,t,r={}){let a=Tm(e,{unit:r.desktop}),n=Tm(t,{tablet:!0,unit:r.tablet}),s=Tm(t,{phone:!0,unit:r.tablet}),i=Tm(o,{phone:!0,unit:r.phone}),l=s||i?{...s,...i}:void 0;return a||n||l?{...a,...n,...l}:void 0}var Om="sf.gapContainer",ga={min:-32,max:64,step:2},tF={Grid:{sm:12,md:24,lg:40},Flex:{sm:12,md:24,lg:40},FooterGroup:{sm:8,md:16,lg:32},HeroGroup:null,Events:null,GalleryB:null,ProductGrid:null},ji={Grid:24,Flex:24,FooterGroup:16,HeroGroup:0,Events:24,GalleryB:8,ProductGrid:2},pJ=new Set(["Events","GalleryB"]);function os(e,o,t){if(typeof o=="number"&&Number.isFinite(o)&&o>=ga.min)return o;if(typeof o=="string"){let r=tF[e]?.[o];if(typeof r=="number")return r}return typeof t=="number"&&Number.isFinite(t)?t:ji[e]}var uJ="sf-gap-overlap",mJ="--sf-gap-overlap",BS="--sf-block-gap",XL="--sf-block-gap-rem",jt={min:0,max:ga.max,step:ga.step};function nd(e){if(typeof e!="number"||!Number.isFinite(e))return null;let o=Math.min(Math.max(Math.round(e),jt.min),jt.max);return o-o%jt.step}function rF(e,o){let t=Bn(e,o,"gap",jt);if(t!==null)return{[BS]:t,[XL]:t};let r=nd(e);return r===null?{}:{[BS]:`${r}px`,[XL]:`${r/16}rem`}}var ZL="--sf-block-gap-phone",JL="--sf-block-gap-phone-rem",hJ="--sf-block-gap-on-phone",xJ="max-view-tablet:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]",gJ="max-view-wide:[&_[data-sf-line~=edge]:not([data-sf-line~=edge]_*)]:[--sf-block-gap-on-phone:var(--sf-block-gap-phone)]";function aF(e,o){let t=Bn(e,o,"gap",jt);if(t!==null)return{[ZL]:t,[JL]:t};let r=nd(e);return r===null?{}:{[ZL]:`${r}px`,[JL]:`${r/16}rem`}}function nF(e){return nd(e)===null?"":`${xJ} ${gJ}`}var QL="sf-gap-zone",eF="--sf-gap-len";function Am(e,o){return typeof o=="number"&&Number.isFinite(o)&&o>=ga.min?!0:typeof o=="string"&&typeof tF[e]?.[o]=="number"}var oF="--sf-gap-len-phone",IJ="--sf-gap-len-tablet",sd={min:0,max:ga.max,step:ga.step};function Qa(e){return typeof e=="number"&&Number.isFinite(e)&&e>=sd.min}function NS(e){return e/2}function DS(e,o,t){return Qa(t)&&!Am(e,o)}function MS(e,o,t,r,a){return Qa(o)?o:DS(e,t,a)?a:NS(os(e,t,r))}var yJ={block:"sf-gap-overlap-block",inline:"sf-gap-overlap-inline",both:"sf-gap-overlap-both"};function BLe(e,o,t,r,a){let n={...Qa(r)?{[oF]:`${r}px`}:null,...Qa(a)?{[IJ]:`${a}px`}:null};if(!Am(e,o)){let i=`${ji[e]}px`,l=pJ.has(e)?`var(--sf-card-gap, ${i})`:i;return{className:` ${QL}`,style:{[eF]:`var(${BS}, ${l})`,[oF]:`var(${hJ})`,...n}}}let s=os(e,o);return s>=0?{className:` ${QL}`,style:{[eF]:`${s}px`,...n}}:{className:` ${uJ} ${yJ[t]}`,style:{gap:"0px",[mJ]:`${-s/2}px`}}}import{parseHexColor as bJ}from"efficient-shell/format";var Qo="var(--section-bg)",id="inherit";function Vr(e,o){return e===id?Qo:e===void 0?o:Rm(e)}var SJ=/var\(\s*--(surface-2|surface|line)\s*(?=[,)])/g;function Rm(e){let o=zr(e);return o?fa(o):e.replace(SJ,"var(--site-$1")}var wJ={"var(--section-bg)":"band","var(--site-surface)":"surface","var(--site-surface-2)":"surface2"};function HS(e,o,t){let r=Vr(e,o);if(!r||r==="transparent")return t.background.toLowerCase();let a=r.trim(),n=a.startsWith("#")?bJ(a):null;if(n)return n.toLowerCase();let s=wJ[a.replace(/\s+/g,"")];return(s?t[s]:t.background).toLowerCase()}var WS="transparent";function sF(e,o){let t=Vr(e,o);return!t||t===WS?"none":t===Qo?"band":null}function iF(e,o,t=o){let r=n=>!n||n==="transparent",a=Vr(e,o);return a===t||r(a)&&r(t)}var lF=["transparent","var(--wheel-stage)","var(--surface)","var(--surface-2)"],cF={transparent:"No fill","var(--wheel-stage)":"Image stage","var(--surface)":"Panels and cards","var(--surface-2)":"Second surface"},Ki="var(--wheel-stage)",Lm="transparent",ld="inherit";function $Le(e,o){return Rm($S(e,o))}function $S(e,o){return e===ld?Ki:e==null?o:e===!0?Ki:e===!1?Lm:e}function ULe(e){return typeof e=="string"&&e!==ld?Rm(e):Ki}function zLe(e){return e!==Lm&&e!=="none"&&e!==""}function dF(e,o){return e===ld||e===!0?!0:e==null?o===Ki:!1}var ts="inherit",Fm="fixed",fF=e=>typeof e!="number"&&e!==Fm,CJ="var(--sf-heading-max, 9999px)";function KLe(e,o,t,r,a){if(typeof e=="number")return Me(e,a);if(e===Fm)return o;let n=r?`var(--size-${r}, ${o})`:o;return t==="heading"?`min(${n}, ${CJ})`:n}var US={kind:"fontSize",unitKey:"titleSizeUnit"},zS={kind:"fontSize",unitKey:"bodySizeUnit"},vJ=["desktop","mobile"],pF=[US,zS].flatMap(e=>Ii(e,vJ));function GS(e){let o=(t,r)=>p_(e,t,r);return{titleDesktop:o(US,"desktop"),titleMobile:o(US,"mobile"),bodyDesktop:o(zS,"desktop"),bodyMobile:o(zS,"mobile")}}var kJ=["page","full"],uF=["full","page"],rs={full:"Full",page:"Content"},jS="inherit",TJ=e=>typeof e=="string"&&kJ.includes(e),PJ=e=>e===jS;function Bm(e,o){return PJ(e.widthMode)?{mode:"full",inherited:!0}:TJ(e.widthMode)?{mode:e.widthMode,inherited:!1}:{mode:o,inherited:o==="full"}}function ZLe(e){return Bm(e,"page").mode==="full"}var Yi={CustomHTML:"rawMarkup",Hero:"hero",HeroSingle:"hero",IntroBleed:"scrollOver",SpecStrip:"background",Timeline:"background",Footprint:"background",Prose:"background",ParagraphsA:"background",Cards:"background",KeyFeatures:"background",Chart:"background",Mockup:"background",Testimonials:"background",TitleWithButtons:"background",Countdown:"background",DocMasthead:"background",DocBody:"background",DocMetaCards:"background",Gallery:"background",GalleryB:"background",Reviews:"background",ReviewForm:"background",Form:"background",AppointmentBooking:"background",FAQ:"background",Events:"background",Split:"both",Breadcrumb:"both",Collections:"both",CatalogFilterBar:"both",AlloyWheelsListing:"both",Banner:"contained",Stats:"contained",Logos:"contained",Divider:"contained",OrderSummary:"contained",DeliveryOptions:"contained",PaymentBadges:"contained",CheckoutCTA:"contained",Flex:"contained",Grid:"contained",ContactCards:"contained",MessagingCards:"contained",OpeningHours:"contained",RateTable:"contained",Manifesto:"contentColumn",SectionHeader:"contentFull",ProductHero:"contentFull",ProductGrid:"productGrid",TimelineTrack:"capped",DetailRows:"capped",FitmentTable:"capped",TyreSizes:"capped",TyreFitment:"capped",EuTyreLabel:"capped",BundleOffer:"capped",CompatibleTyres:"capped",RelatedProducts:"capped",ProcessSteps:"capped",StatsParagraph:"capped",Masthead:"capped",FeaturedCover:"capped",LongRead:"capped",Series:"capped",ContactLocations:"capped",FitmentFinder:"capped",SpecTable:"capped",Subscribe:"capped",SubscribeBlogs:"capped",ContactRouting:"capped",SubmitBuild:"capped"};function Nm(e){return He(Yi,e)}var Fe={background:"sectionBackgroundWidth",content:"sectionContentWidth",contentMax:"sectionContentMax",contentMaxUnit:"sectionContentMaxUnit"},KS={kind:"size",unitKey:Fe.contentMaxUnit};function as(e){let o=e[Fe.contentMaxUnit],t=Ee(o),r=e[Fe.contentMax],a=t==="px"?uL(r):typeof r=="number"&&Number.isFinite(r)&&r>0?r:null,n=Vi(e[Fe.content])??(a===null?null:"content");return{background:Vi(e[Fe.background]),content:n,contentMax:n==="content"?a:null,contentMaxUnit:t}}function mF(e){let o=as(e);return o.content===null&&e.fullWidth===!0?{...o,content:"full"}:o}function hF(e){return e.background!==null||e.content!==null}var xF=e=>({[Fe.background]:e}),gF=e=>e==="full"?{[Fe.content]:e,[Fe.contentMax]:void 0,[Fe.contentMaxUnit]:void 0}:{[Fe.content]:e},IF=e=>({[Fe.content]:"content",[Fe.contentMax]:e}),VS=e=>e==="background"?{[Fe.background]:void 0}:{[Fe.content]:void 0,[Fe.contentMax]:void 0,[Fe.contentMaxUnit]:void 0},yF="siteWidths",EJ=e=>e==="full"||e==="content";function Vi(e){return EJ(e)?e:null}function bF(e,o){return{[yF]:{background:Vi(e),content:Vi(o)}}}function Dm(e){let o=e.editor?.metadata?.[yF];return{background:Vi(o?.background),content:Vi(o?.content)}}import{useEaselSession as XQ}from"efficient-easel/screen/lib/session-context";import{BOX_GAP as ZQ,describedAs as on,group as wr,iconOf as Ji,sharedStyleKinds as md}from"efficient-easel/screen/lib/document/box-fields";import{VIEW_KEY_ACCESS as ZF,onDesktopWords as is,phoneTwinFields as sw,saidAlignmentGrid as JQ,useLengthUnit as QQ}from"efficient-easel/screen/lib/document/box-fields";import{createElement as Kt}from"react";import{SettingsDefaultReset as _J,SettingsField as OJ}from"efficient-easel/panel";import{boxFieldBuilders as AJ,describedAs as RJ,iconOf as LJ,onDesktopWords as FJ}from"efficient-easel/screen/lib/document/box-fields";import{LENGTH_KIND_UNITS as BJ}from"efficient-easel/screen/lib/content/length-units";import{IconPicker as NJ,Tooltip as DJ,useShellStrings as MJ}from"efficient-shell/ui";import{RotateIcon as HJ}from"efficient-easel/icons";var Mm=e=>c(e),Ia=BJ,Ao=AJ(Mm,{lengthUnits:Ia}),Wo=Ao.slider,At=Ao.select,cd=Ao.Segmented,qi=Ao.segmented,iFe=Ao.alignmentField,lFe=Ao.alignmentFields,cFe=Ao.blockAlignmentField,dFe=Ao.blockAlignmentFields,fFe=Ao.boxJustifyField,pFe=Ao.boxAlignField,uFe=Ao.boxWrapField,SF=Ao.directionField,Hm=Ao.gapField,mFe=Ao.placementField,hFe=Ao.PlacementGridView,xFe=Ao.positionFields,Xi=Ao.sidesPaddingFields,ns=Ao.lengthUnitFields;function wF(e,o){return Wo("Angle",Kt(HJ),kp.min,kp.max,kp.step,e,"\xB0",o)}var YS=Symbol("efficient-web-builder.picture-picker-row"),WJ={width:"3.5rem",height:"2.75rem",words:!0};function qS({value:e}){return MJ().iconNames[e]??e}function XS(e,o,t){return Kt(DJ,{content:t,className:"sf-pick-tip",children:Kt("span",{className:"sf-pick"},Kt("span",{className:"sf-pick-pic"},e),Kt("span",{className:"sf-pick-cap"},o))})}function $J(e){let o=t=>t.label===void 0?Kt(qS,{value:t.value}):c(t.label);return e.map(t=>({value:t.value,...t.label===void 0?{}:{label:c(t.hint??t.label)},icon:XS(t.picture,o(t),t.hint===void 0?o(t):c(t.hint))}))}function CF(e,o){return Kt("span",{className:"sf-pick"},Kt("span",{className:"sf-pick-pic"},e),Kt("span",{className:"sf-pick-cap sf-pick-cap-closed"},o))}function ZS(e,o,t,r,a={}){let n=l=>t.some(d=>d.value===l),s=l=>a.resolve?a.resolve(l):n(l)?l:void 0,i=t.map(l=>({value:l.value,...l.label===void 0?{}:{label:l.label},...l.showWhen?{showWhen:l.showWhen}:{}}));return{type:"custom",[YS]:!0,...RJ({},{type:"radio",label:e,options:i}),options:i,render:l=>{let{value:d,onChange:f,field:u}=l,p=u?.options,m=$J(t.filter(y=>!p||p.some(k=>k.value===y.value))),h="follows"in l,I=h?s(a.phoneRest?a.phoneRest(l.follows):l.follows)??r:void 0,w=u?.currentValue,S=s(d)??I??s(w)??r,v=d!=null&&d!=="",b=I===void 0?void 0:t.find(y=>y.value===I);return Kt(OJ,{label:c(e),icon:LJ(o),action:h?Kt(_J,{words:ce()?.panel,label:c(e),changed:v,detail:b?.label!==void 0?FJ(Mm,c(b.label),l.followsView):void 0,disabled:l.readOnly===!0,onReset:()=>f(void 0)}):void 0},Kt(NJ,{label:c(e),value:S,options:m,onChange:f,columns:a.columns,cell:a.cell??WJ,tooltips:!1,disabled:l.readOnly===!0}))}}}import{VIEW_ABOVE as ew}from"efficient-easel/screen/lib/content/length-units";import{jsx as E,jsxs as Se}from"react/jsx-runtime";import{NoSymbolIcon as XJ}from"efficient-easel/icons";import{useId as ZJ}from"react";var UJ="line",zJ=[{label:"None",value:"none"},{label:"Line",value:"line"},{label:"Stripes \xB7 fine",value:"stripes-fine"},{label:"Stripes \xB7 medium",value:"stripes-medium"},{label:"Stripes \xB7 bold",value:"stripes-bold"}],JS={"stripes-fine":{ink:4,period:12},"stripes-medium":{ink:8,period:18},"stripes-bold":{ink:14,period:28}},yFe=28,GJ="-45deg",jJ="color-mix(in oklab, var(--accent) 50%, var(--bg))";function KJ(e){return e!=="line"&&e!=="none"}var VJ={sm:24,md:48,lg:80},YJ="md",qJ=Object.keys(VJ);function bFe(e){return xo(qJ,YJ,e)}function SFe(e){return xo(zJ,UJ,e)}function wFe(e){if(!KJ(e))return null;let{ink:o,period:t}=JS[e];return`repeating-linear-gradient(${GJ}, ${jJ} 0 ${o}px, transparent ${o}px ${t}px)`}var CFe={kind:"border",unitKey:"thicknessUnit"},vFe={kind:"size",base:"%",unitKey:"lengthPctUnit"};var Wm=44,$m=28;function xe({children:e}){return E("svg",{width:Wm,height:$m,viewBox:`0 0 ${Wm} ${$m}`,"aria-hidden":"true",fill:"currentColor",stroke:"currentColor",strokeWidth:1.25,children:e})}var M=({x:e,y:o,w:t,t:r=2,faint:a=!1})=>E("rect",{x:e,y:o,width:t,height:r,rx:r/2,stroke:"none",opacity:a?.45:1}),Te=({x:e,y:o,w:t,h:r})=>E("rect",{x:e,y:o,width:t,height:r,rx:2,fill:"none"}),Rt=({x:e,y:o})=>E("circle",{cx:e,cy:o,r:1.75,stroke:"none"}),$o=({x1:e,y1:o,x2:t,y2:r})=>E("line",{x1:e,y1:o,x2:t,y2:r});function QS(e){let o=20/Ri,t=5,r=1,a=[],n=0,s=0,i=0;for(let[f,u]of e)n+f>Ri&&(s+=i*(t+r),n=0,i=0),a.push({x:12+n*o,y:s,w:f*o-r,h:u*t+(u-1)*r}),n+=f,i=Math.max(i,u);let l=s+i*(t+r)-r,d=($m-l)/2;return E(xe,{children:a.map((f,u)=>E("rect",{x:f.x,y:d+f.y,width:f.w,height:f.h,rx:1,stroke:"none",opacity:.6},u))})}var AFe={bars:Se(xe,{children:[E(M,{x:8,y:14,w:5,t:10}),E(M,{x:16,y:8,w:5,t:16}),E(M,{x:24,y:18,w:5,t:6}),E(M,{x:32,y:11,w:5,t:13})]}),line:Se(xe,{children:[E("polyline",{points:"6,22 14,15 22,18 30,8 38,11",fill:"none",strokeWidth:1.75,strokeLinejoin:"round"}),E($o,{x1:6,y1:25,x2:38,y2:25})]}),donut:Se(xe,{children:[E("circle",{cx:22,cy:14,r:9,fill:"none",strokeWidth:5,opacity:.45}),E("circle",{cx:22,cy:14,r:9,fill:"none",strokeWidth:5,strokeDasharray:"34 57",transform:"rotate(-90 22 14)"})]})};function RFe(e){if(e==="none")return E("span",{style:{display:"flex",width:Wm,height:$m,alignItems:"center",justifyContent:"center"},children:E(XJ,{size:20})});if(e==="line")return E(xe,{children:E($o,{x1:4,y1:14,x2:40,y2:14})});let{ink:o,period:t}=JS[e],r=.4,a=[];for(let n=-12;n<Wm;n+=t*r)a.push(E("polygon",{points:`${n},22 ${n+o*r},22 ${n+o*r+10},6 ${n+10},6`,stroke:"none"},n));return E(JJ,{children:a})}function JJ({children:e}){let o=`sf-div-${ZJ().replace(/[^\w-]/g,"")}`;return Se(xe,{children:[E("clipPath",{id:o,children:E("rect",{x:4,y:6,width:36,height:16,rx:2})}),E("g",{clipPath:`url(#${o})`,children:e})]})}var Um=({x:e,y:o,w:t,h:r})=>E("rect",{x:e,y:o,width:t,height:r,rx:2,stroke:"none",opacity:.3}),LFe={tabs:Se(xe,{children:[E(M,{x:5,y:10,w:9}),E(M,{x:18,y:10,w:9,faint:!0}),E(M,{x:31,y:10,w:9,faint:!0}),E($o,{x1:4,y1:17,x2:40,y2:17}),E(M,{x:4,y:16,w:11,t:2})]}),largeTabs:Se(xe,{children:[E($o,{x1:4,y1:5,x2:40,y2:5}),E(Rt,{x:7,y:10}),E(M,{x:11,y:9,w:16}),E(M,{x:31,y:9,w:9,faint:!0}),E($o,{x1:4,y1:14,x2:40,y2:14}),E(Rt,{x:7,y:19}),E(M,{x:11,y:18,w:13,faint:!0}),E(M,{x:31,y:18,w:9,faint:!0}),E($o,{x1:4,y1:23,x2:40,y2:23})]})},FFe={card:Se(xe,{children:[E(Te,{x:10,y:3,w:24,h:22}),E(Um,{x:12,y:5,w:20,h:10}),E(M,{x:13,y:18,w:16}),E(M,{x:13,y:21,w:11,t:1.5,faint:!0})]}),cover:Se(xe,{children:[E(Um,{x:10,y:3,w:24,h:22}),E(Te,{x:10,y:3,w:24,h:22}),E(M,{x:13,y:17,w:16}),E(M,{x:13,y:21,w:11,t:1.5})]})},BFe={cards:Se(xe,{children:[E(Te,{x:3,y:5,w:11,h:18}),E(Te,{x:17,y:5,w:11,h:18}),E(Te,{x:31,y:5,w:11,h:18}),E(M,{x:5,y:9,w:7}),E(M,{x:19,y:9,w:7}),E(M,{x:33,y:9,w:7}),E(M,{x:5,y:13,w:5,t:1.5,faint:!0}),E(M,{x:19,y:13,w:5,t:1.5,faint:!0}),E(M,{x:33,y:13,w:5,t:1.5,faint:!0})]}),"label-only":Se(xe,{children:[E("path",{d:"M8.5 7l3 3-3 3-3-3zM22.5 7l3 3-3 3-3-3zM36.5 7l3 3-3 3-3-3z",stroke:"none"}),E(M,{x:5,y:18,w:7}),E(M,{x:19,y:18,w:7}),E(M,{x:33,y:18,w:7})]})},NFe={table:Se(xe,{children:[E(Te,{x:3,y:5,w:38,h:18}),E($o,{x1:15.7,y1:5,x2:15.7,y2:23}),E($o,{x1:28.3,y1:5,x2:28.3,y2:23}),E("path",{d:"M15.7 5v18M28.3 5v18",fill:"none",strokeWidth:2.5}),E(M,{x:6,y:9,w:6,t:3}),E(M,{x:19,y:9,w:6,t:3}),E(M,{x:31,y:9,w:6,t:3}),E(M,{x:6,y:18,w:7,t:1.5,faint:!0}),E(M,{x:19,y:18,w:7,t:1.5,faint:!0}),E(M,{x:31,y:18,w:7,t:1.5,faint:!0})]}),list:Se(xe,{children:[E($o,{x1:3,y1:7,x2:13,y2:7}),E($o,{x1:17,y1:7,x2:27,y2:7}),E($o,{x1:31,y1:7,x2:41,y2:7}),E(M,{x:3,y:11,w:6,t:3}),E(M,{x:17,y:11,w:6,t:3}),E(M,{x:31,y:11,w:6,t:3}),E(M,{x:3,y:17,w:8,t:1.5,faint:!0}),E(M,{x:17,y:17,w:8,t:1.5,faint:!0}),E(M,{x:31,y:17,w:8,t:1.5,faint:!0})]})},DFe={plain:Se(xe,{children:[E(M,{x:5,y:12,w:9,t:4}),E(M,{x:18,y:12,w:9,t:4}),E(M,{x:31,y:12,w:9,t:4})]}),cards:Se(xe,{children:[E(Te,{x:3,y:7,w:11,h:14}),E(Te,{x:17,y:7,w:11,h:14}),E(Te,{x:31,y:7,w:11,h:14}),E(M,{x:5,y:13,w:7}),E(M,{x:19,y:13,w:7}),E(M,{x:33,y:13,w:7})]}),marks:Se(xe,{children:[E(M,{x:8,y:12,w:6,t:4}),E(M,{x:17,y:12,w:6,t:4}),E(M,{x:26,y:12,w:6,t:4}),E(M,{x:35,y:12,w:3,t:4})]}),chips:Se(xe,{children:[E(Te,{x:3,y:9,w:18,h:10}),E(Te,{x:23,y:9,w:18,h:10}),E(Rt,{x:7,y:14}),E(M,{x:10,y:13,w:8}),E(Rt,{x:27,y:14}),E(M,{x:30,y:13,w:8})]})},MFe={overlay:Se(xe,{children:[E(Um,{x:4,y:3,w:36,h:22}),E(Te,{x:4,y:3,w:36,h:22}),E(M,{x:8,y:15,w:18,t:3}),E(M,{x:8,y:20,w:12})]}),stacked:Se(xe,{children:[E(M,{x:4,y:3,w:18,t:3}),E(M,{x:4,y:8,w:12}),E(Um,{x:4,y:13,w:36,h:12}),E(Te,{x:4,y:13,w:36,h:12})]})},HFe={split:Se(xe,{children:[E(M,{x:4,y:6,w:12,t:3}),E(M,{x:4,y:11,w:9,faint:!0}),E($o,{x1:20,y1:4,x2:20,y2:24}),E(M,{x:24,y:6,w:16}),E(M,{x:24,y:10,w:11,faint:!0}),E(M,{x:24,y:17,w:16}),E(M,{x:24,y:21,w:11,faint:!0})]}),spine:Se(xe,{children:[E($o,{x1:9,y1:4,x2:9,y2:24}),E(Rt,{x:9,y:8}),E(M,{x:14,y:7,w:24}),E(Rt,{x:9,y:14}),E(M,{x:14,y:13,w:20}),E(Rt,{x:9,y:20}),E(M,{x:14,y:19,w:24})]}),alternating:Se(xe,{children:[E($o,{x1:22,y1:4,x2:22,y2:24}),E(Rt,{x:22,y:8}),E(M,{x:4,y:7,w:14}),E(Rt,{x:22,y:14}),E(M,{x:26,y:13,w:14}),E(Rt,{x:22,y:20}),E(M,{x:4,y:19,w:14})]}),track:Se(xe,{children:[E($o,{x1:4,y1:12,x2:40,y2:12}),E(Rt,{x:8,y:12}),E(Rt,{x:22,y:12}),E(Rt,{x:36,y:12}),E(M,{x:4,y:17,w:8}),E(M,{x:18,y:17,w:8}),E(M,{x:32,y:17,w:8}),E(M,{x:4,y:21,w:6,faint:!0}),E(M,{x:18,y:21,w:6,faint:!0}),E(M,{x:32,y:21,w:6,faint:!0})]})},WFe={standard:Se(xe,{children:[E(M,{x:4,y:5,w:10,t:1.5,faint:!0}),E(M,{x:4,y:10,w:28,t:4}),E(M,{x:4,y:18,w:34,faint:!0}),E(M,{x:4,y:22,w:24,faint:!0})]}),editorial:Se(xe,{children:[E(M,{x:4,y:5,w:5,t:1.5,faint:!0}),E(M,{x:4,y:10,w:20,t:5}),E(M,{x:28,y:11,w:12,faint:!0}),E(M,{x:28,y:15,w:9,faint:!0}),E($o,{x1:4,y1:22,x2:40,y2:22})]}),simple:Se(xe,{children:[E(M,{x:4,y:8,w:10,t:1.5,faint:!0}),E(M,{x:4,y:13,w:26,t:4})]}),statement:Se(xe,{children:[E(M,{x:4,y:6,w:36,t:7}),E(M,{x:4,y:16,w:24,t:7})]}),natural:Se(xe,{children:[E(M,{x:4,y:8,w:22,t:3}),E(M,{x:4,y:15,w:34,faint:!0}),E(M,{x:4,y:19,w:28,faint:!0})]}),essay:Se(xe,{children:[E(M,{x:4,y:5,w:24,t:4}),E(M,{x:4,y:13,w:36,faint:!0}),E(M,{x:4,y:17,w:36,faint:!0}),E(M,{x:4,y:21,w:30,faint:!0})]})},$Fe={"spec-card":Se(xe,{children:[E(Te,{x:4,y:3,w:36,h:22}),E(M,{x:8,y:7,w:14}),E(Te,{x:8,y:12,w:8,h:9}),E(Te,{x:18,y:12,w:8,h:9}),E(Te,{x:28,y:12,w:8,h:9})]}),fitment:Se(xe,{children:[E(Te,{x:4,y:4,w:10,h:5}),E(Te,{x:16,y:4,w:10,h:5}),E(Te,{x:28,y:4,w:10,h:5}),E(M,{x:4,y:14,w:34,faint:!0}),E(M,{x:4,y:18,w:34,faint:!0}),E(M,{x:4,y:22,w:34,faint:!0})]}),portal:Se(xe,{children:[E(Te,{x:4,y:3,w:36,h:22}),E(M,{x:8,y:7,w:10,t:4}),E(M,{x:8,y:14,w:16,faint:!0}),E(M,{x:26,y:18,w:10,t:4})]}),kanban:Se(xe,{children:[E(Te,{x:4,y:3,w:10,h:22}),E(Te,{x:17,y:3,w:10,h:22}),E(Te,{x:30,y:3,w:10,h:22}),E(M,{x:6,y:6,w:6,t:4}),E(M,{x:6,y:12,w:6,t:4}),E(M,{x:19,y:6,w:6,t:4}),E(M,{x:32,y:6,w:6,t:4}),E(M,{x:32,y:12,w:6,t:4})]}),claims:Se(xe,{children:[E(M,{x:4,y:5,w:12,faint:!0}),E(M,{x:20,y:4,w:18,t:4}),E(M,{x:4,y:12,w:12,faint:!0}),E(M,{x:20,y:11,w:10,t:4}),E(M,{x:4,y:19,w:12,faint:!0}),E(M,{x:20,y:18,w:14,t:4})]}),browser:Se(xe,{children:[E(Te,{x:4,y:3,w:36,h:22}),E($o,{x1:4,y1:8,x2:40,y2:8}),E(M,{x:8,y:11,w:28,t:5,faint:!0}),E(Te,{x:8,y:18,w:8,h:4}),E(Te,{x:18,y:18,w:8,h:4}),E(Te,{x:28,y:18,w:8,h:4})]}),terminal:Se(xe,{children:[E(Te,{x:4,y:3,w:36,h:22}),E("polyline",{points:"8,9 11,11 8,13",fill:"none"}),E(M,{x:13,y:10,w:14}),E(M,{x:8,y:16,w:22,faint:!0}),E(M,{x:8,y:20,w:16,faint:!0})]})},vF={width:"5.75rem",height:"3.75rem",words:!0},UFe={width:"8.5rem",height:"3.75rem",words:!0},zFe={columns:Se(xe,{children:[E(Te,{x:3,y:4,w:11,h:8}),E(Te,{x:17,y:4,w:11,h:8}),E(Te,{x:31,y:4,w:11,h:8}),E(M,{x:3,y:16,w:9}),E(M,{x:17,y:16,w:9}),E(M,{x:31,y:16,w:9}),E(M,{x:3,y:20,w:7,t:1.5,faint:!0}),E(M,{x:17,y:20,w:7,t:1.5,faint:!0}),E(M,{x:31,y:20,w:7,t:1.5,faint:!0})]}),"rows-left":Se(xe,{children:[E(Te,{x:6,y:3,w:14,h:9}),E(M,{x:24,y:5,w:14}),E(M,{x:24,y:9,w:10,t:1.5,faint:!0}),E(Te,{x:24,y:16,w:14,h:9}),E(M,{x:6,y:18,w:14}),E(M,{x:6,y:22,w:10,t:1.5,faint:!0})]}),"rows-right":Se(xe,{children:[E(Te,{x:24,y:3,w:14,h:9}),E(M,{x:6,y:5,w:14}),E(M,{x:6,y:9,w:10,t:1.5,faint:!0}),E(Te,{x:6,y:16,w:14,h:9}),E(M,{x:24,y:18,w:14}),E(M,{x:24,y:22,w:10,t:1.5,faint:!0})]})};import{TEXT_CONTROL_KINDS as NNe,SCALAR_TEXT_CONTROLS as DNe}from"efficient-easel/draw";function ls(e,o){return c("{value} from {from}",{value:e,from:o})}function eee(){let{blockGap:e}=fe();return e===null?c("this container's own spacing"):ls(`${e}px`,c("Styles"))}function oee({inherited:e,onReset:o,label:t}){return A(et,{words:ce()?.panel,label:c(t),changed:!e,detail:eee(),onReset:o})}function tee(e){return Hm({...ZQ,builtIn:ji[e],resolve:(o,t)=>os(e,o,t?.siteGap),action:(o,t)=>A(oee,{inherited:!Am(e,o),onReset:()=>t(void 0),label:"Gap"}),mark:{[Om]:e}})}function ree(e){return io(Lt("mobile",{[Om]:e,type:"custom",render:o=>A(see,{container:e,...o})}),JF)}function aee(e){return io(Lt("tablet",{[Om]:e,type:"custom",render:o=>A(nee,{container:e,...o})}),JF)}var JF={not:{field:"gap",in:Array.from({length:-ga.min},(e,o)=>ga.min+o)}};function ENe(e){return{gap:Lt("desktop",tee(e)),[uw("gap")]:aee(e),[Zi("gap")]:ree(e)}}function nee({container:e,...o}){let[t]=br("gap"),{siteGap:r}=o.field??{},a=Math.max(sd.min,os(e,t,r));return Hm({...sd,builtIn:a,resolve:n=>Qa(n)?n:a,action:(n,s)=>A(et,{words:ce()?.panel,label:c("Gap"),changed:Qa(n),detail:is(i=>c(i),`${a}px`),onReset:()=>s(void 0)})}).render(o)}function see({container:e,...o}){let[t]=br("gap"),{siteGap:r,siteGapPhone:a}=o.field??{},n=MS(e,void 0,t,r,a);return Hm({...sd,builtIn:n,resolve:s=>MS(e,s,t,r,a),action:(s,i)=>A(et,{words:ce()?.panel,label:c("Gap"),changed:Qa(s),detail:ls(`${n}px`,DS(e,t,a)?c("Styles"):c("Desktop")),onReset:()=>i(void 0)})}).render(o)}function _Ne(e){return SF({offered:GL(e),fallback:Kr(e,void 0),resolve:o=>Kr(e,o)})}function ONe(e,o){return Q_(o?tO(e,o):[],o)}function iee({inherited:e,onReset:o,label:t}){return A(et,{words:ce()?.panel,label:c(t),changed:!e,detail:ls(c("Full"),c("the page")),onReset:o})}function cs({value:e,onChange:o,label:t,placeholder:r,hint:a,multiline:n,hideable:s=!0,markup:i=!0}){let{text:l,hidden:d}=tn(e),f=dd(null),u=dd(null),p=v=>o(s?{text:v,hidden:d}:v),m=()=>o({text:l,hidden:!d}),h=s&&d,I=MF(),w=a?pee(a)?A("span",{className:"sf-hint-while-typing",children:c(a)}):c(a):void 0,S=d?c("Show {label} on the slide",{label:c(t)}):c("Hide {label} on the slide",{label:c(t)});return A(wo,{label:c(t),icon:A(vQ,{}),htmlFor:I,className:h?"is-hidden":void 0,hint:w,action:s?A(pw,{content:S,children:A(qF,{"aria-pressed":d,"aria-label":S,onClick:m,children:d?A(_F,{name:"eye-off",size:14}):A(_F,{name:"eye",size:14})})}):void 0,children:ya("div",{className:"sf-copybox",children:[i&&A(Hb,{target:n?u:f,value:l,onChange:p}),n?A("textarea",{id:I,ref:u,value:l,placeholder:r===void 0?void 0:c(r),onChange:v=>p(v.target.value)}):A("input",{id:I,ref:f,type:"text",value:l,placeholder:r===void 0?void 0:c(r),onChange:v=>p(v.target.value)})]})})}function ANe(e,o){return{...e,[sQ]:o}}function RNe(e){let o=e[ba];if(!o)throw new Error("withOffPage: the field holds no authored text");return{...e,[ba]:{...o,offPage:!0}}}function Vm(e){return!e||typeof e!="object"?!1:e[ba]?.offPage===!0}function LNe(e){if(!e[ba])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[$b]:!0}}function QF(e){return Hi(e)}function FNe(e){let o=e[ba];if(!o)throw new Error("withIdentifier: the field holds no authored text");return{...e,[ba]:{...o,identifier:!0}}}function MNe(e,o){if(!e[ba])throw new Error("inOwnBox: the field holds no authored text");let{[zQ]:t,...r}=e;return{...r,[Wb]:!0,render:o}}var lee=new Set(jQ),jm={type:"radio",options:[{value:!0},{value:!1}]},eB={text:{type:"object",objectFields:{text:{type:"text"},hidden:jm}},textarea:{type:"object",objectFields:{text:{type:"textarea"},hidden:jm}},plainText:{type:"text"},copyText:{type:"text"},plainTextarea:{type:"textarea"},textList:{type:"array",arrayFields:{text:{type:"text"}}}},ds=(e,o)=>{let t=on({...o,[ba]:e},{...eB[e.control],label:e.label});if(!lee.has(e.control))return t;let r=o.render;return{...XF(t,"authored-copy"),render:a=>A(rR,{name:a.name,children:r(a)})}},HNe="Everything else on this block comes from the linked post. Unlink it to edit by hand.",cee={field:"source.slug",set:!0},WNe={not:cee},dee="Select a word, then press the highlighter.",fee=new Set([dee]),pee=e=>fee.has(e);function $Ne(e,o,t){return ds({control:"text",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:e,placeholder:o,hint:t})})}function UNe(e,o,t){return ds({control:"textarea",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:e,placeholder:o,hint:t,multiline:!0})})}function zNe(e,o,t){return ds({control:"plainText",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:e,placeholder:o,hint:t,hideable:!1,markup:!1})})}function GNe(e,o,t){return ds({control:"copyText",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:e,placeholder:o,hint:t,hideable:!1})})}function jNe(e){return{type:"custom",[aQ]:{label:e},...on({},{type:"text",label:e}),render:({value:o,onChange:t})=>A(rL,{value:rQ(o),onChange:t,label:e})}}function KNe(e,o,t){return ds({control:"plainTextarea",label:e,placeholder:o,hint:t},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:e,placeholder:o,hint:t,multiline:!0,hideable:!1})})}var oB={Design:iQ,Animation:cQ};function VNe(e,o){return{type:"custom",render:()=>A(uee,{text:e,values:o})}}function uee({text:e,values:o}){return A("p",{className:"sf-note",children:c(e,o)})}function tB(e){return Sr(e)!==null&&e?.tabs!==void 0}var OF=new Map;function Ym(e,o){let t=`${e}\0${o?o.join(""):""}`,r=OF.get(t)??{type:"custom",tabs:o,[HF]:{label:e,level:1},bucket:e,marker:!0,render:()=>A(Sa,{})};return OF.set(t,r),r}var AF=new Map;function hw(e){let o=AF.get(e)??{type:"custom",[HF]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>A(Sa,{})};return AF.set(e,o),o}function mee(e){let o=e;return o?.marker===!0&&typeof o.fold=="string"?o.fold:null}function rB(e,o){return mee(e)===o?e:{...e,marker:!0,fold:o,render:()=>A(Sa,{})}}function aB(e){let o=e;if(o.marker===!0&&o.fold===void 0)return e;let{fold:t,...r}=e;return{...r,marker:!0,render:()=>A(Sa,{})}}function xw({title:e,children:o}){let[t,r]=fd(()=>!ow.has(e));return A(PQ,{title:e,open:t,onToggle:a=>{r(a),a?ow.delete(e):ow.add(e)},children:o})}var ow=new Set;function hee({swatches:e,current:o,onPick:t,names:r}){let a=e.find(i=>i.toLowerCase()===o.toLowerCase()),n=a?r?.[a]:void 0,s=n?c(n):o;return ya("div",{className:"sf-swatches",children:[e.map(i=>{let l=r?.[i]?c(r[i]):i;return A(pw,{content:l,children:A(BQ,{color:i,selected:o.toLowerCase()===i.toLowerCase(),onClick:()=>t(i),"aria-label":l})},i)}),A("span",{className:"sf-swatch-hex",children:s})]})}function YNe(e,o,t=!1){return{type:"custom",render:({value:r,onChange:a})=>A(xee,{label:e,builtIn:o,followsBand:t,value:r,onChange:a})}}function xee({label:e,builtIn:o,followsBand:t,value:r,onChange:a}){let n=typeof r=="string"?r:void 0,{colors:s,n:i}=Sw(),l={background:s.background,surface:s.surface,surface2:Vp(s),band:T_(s)},d=t?Qo:o,f=iF(n,o,d),u=HS(void 0,d,l),p=t?id:void 0,m=d===Qo?c("the theme's section background"):c("Theme {n} background",{n:i}),h=gee(n,o,s,i,l,a),I=ls(u.toUpperCase(),m),w=zr(n),S=w?Li(w,s,i):null;return S?A(gt,{label:c(e),icon:A(kF,{}),value:S.hex,caption:S.words,onChange:a,changed:!0,onReset:()=>a(p),resetTo:I,choices:h}):A(Vc,{label:c(e),icon:A(kF,{}),value:f?"":HS(n,o,l),inherited:u,resetTo:I,onChange:a,onReset:()=>a(p),choices:h})}function gee(e,o,t,r,a,n){let s=sF(e,o);return[{label:c("No fill"),color:"",selected:s==="none",onPick:()=>n(WS)},{label:`${c("Section band")} \xB7 ${a.band.toUpperCase()}`,color:a.band,selected:s==="band",onPick:()=>n(Qo)},...bw(zr(e)??"",t,r,n)]}function Iee(e,o){return{type:"custom",render:({value:t,onChange:r})=>{let a=t,n=dF(a,o);return A(wo,{label:c(e),icon:A(aw,{}),changed:!n,action:A(et,{words:ce()?.panel,label:c(e),changed:!n,detail:c("the theme's image stage"),onReset:()=>r(ld)}),children:hee({swatches:lF,current:n?Ki:$S(a,o),onPick:r,names:cF})})}}}function Qi(e=t=>t,o){return md({_gSectionTheme:wr(Y_),sectionAccent:{type:"custom",render:({value:t,onChange:r})=>A(OR,{value:e(t),onChange:r,followLabel:o})}})}function el(e){let o=So(),t=da(e?.view),r=s=>mw(e.valueKey,s),a=e.numbersIn??(s=>q(o[r(s)])!==void 0),n=e.followsView??Lee(t,a);return QQ({props:{value:void 0,onChange:()=>{},field:{}},row:e.valueKey?e.row:void 0,table:Ia,label:c(e.label),grid:e.grid,hasOwn:a(t),view:{tier:t,numbersIn:a,followsView:n},convertTo:e.convertTo??(s=>{let i=q(o[r(t)]);return i===void 0?{}:{[r(t)]:s(i)}})})}function yt({min:e,max:o,step:t,value:r,onChange:a,suffix:n="",readout:s=!0,notch:i,ariaLabel:l,disabled:d=!1,placeholder:f,placeholderWord:u,onClear:p,units:m}){let h=i!==void 0&&Number.isFinite(i)&&i>=e&&i<=o;return A("div",{className:h?"sf-slider has-notch":"sf-slider",style:h?{"--sf-notch":(i-e)/(o-e)}:void 0,children:A(UQ,{min:e,max:o,step:t,value:r,...r===null&&f!==void 0?{placeholderValue:f}:{},...u?{emptyLabel:c(u)}:{},suffix:n||void 0,...m?{units:m}:{},showInput:s,label:l===void 0?void 0:c(l),disabled:d,size:"sm",boxSize:"md",className:"sf-slider-track",onChange:I=>{I===null?p?.():I!==r&&a(I)}})})}function yee(e,o){let{min:t,max:r,step:a=1,unsetLabel:n,hint:s,restTrack:i,unsetMark:l,icon:d,unit:f="px"}=o;return{type:"custom",render:({value:u,onChange:p})=>{let m=typeof u=="number"?u:null,h=m===null;return A(wo,{label:c(e),icon:d?Ji(d):void 0,value:h?l||n===void 0?void 0:c(n):`${m}${f}`,changed:!h,action:l?iw(l,{changed:!h,onReset:()=>p(null)}):A(et,{words:ce()?.panel,label:c(e),changed:!h,onReset:()=>p(null)}),hint:typeof s=="string"?c(s):s,children:i?i({min:t,max:r,step:a,px:m,label:e,onChange:p}):yt({min:t,max:r,step:a,value:m??t,readout:!1,ariaLabel:e,onChange:p})})}}}var pd="Corners",bee={kind:"radius"};function gw(e){return{type:"custom",render:o=>{let{value:t,onChange:r}=o,a=typeof t=="number"&&Number.isFinite(t)?t:null,n=a!==null;return A(wo,{label:c(pd),icon:A($F,{}),changed:n,action:iw(e.mark,{changed:n,onReset:()=>r(null)}),hint:e.hint,children:A(See,{tier:e,px:a,name:o.name,onRadius:r})})}}}function br(e){let o=ss();return[o?.values?.[e],t=>o?.onChange(e,t)]}function hd(){return XF({type:"custom",render:()=>A(GQ,{})},"always")}function ur(){let e=ss();return o=>e?.onChangeMany(o)}function See({tier:e,px:o,name:t,onRadius:r}){let a=e.useFollowed(),[n,s]=br(e.sidesKey),i=ur(),l=el({row:e.row??bee,label:pd,grid:{min:nt,max:Ha,step:e.step??1},valueKey:t??"",view:"desktop"}),d=$r(n)??[..._u];return A(NQ,{label:c(pd),value:d,corners:E1,onChange:f=>{let u=$r(f)??[];s(u.length===_u.length?null:u)},radius:o,onRadiusChange:l&&t?f=>i({[t]:f,...l.unitPatch(f===null)}):r,radiusMin:l?.grid.min??nt,radiusMax:l?.grid.max??Ha,radiusStep:l?.grid.step??e.step??1,radiusPlaceholder:l&&l.unit!=="px"?"\u2013":String(a),...l?{radiusUnit:l.unit,units:l.units}:{}})}function nB(e,o){return ns(e,o)}function sB(){return hd()}function wee({label:e,changed:o=!1,onReset:t=()=>{}}){let{cornerRadiusPx:r}=fe(),a=typeof r=="number"?`${r}px`:c("not set");return A(et,{words:ce()?.panel,label:c(e),changed:o,detail:r==null?c("the built-in corners"):ls(a,c("Styles")),onReset:t})}function Cee(){let{cornerRadiusPx:e}=fe();return typeof e=="number"?e:nt}function vee(){return gw({sidesKey:"sectionCornerSides",row:Dc,useFollowed:Cee,mark:A(wee,{label:pd}),hint:kee})}var kee="Follows Styles \u25B8 Basics \u25B8 Corners until you set a number here.";function ol(){return md({_gShape:wr("Shape"),sectionCorners:vee(),...nB(Dc,"sectionCorners"),sectionCornerSides:sB(),...ua("sectionBorder",Ree),...ns(ad,"sectionBorder",{tablet:!0,phone:!0})})}var Tee=()=>({width:c("Border width"),sides:{top:c("Border top"),right:c("Border right"),bottom:c("Border bottom"),left:c("Border left")},style:c("Border style"),styles:{solid:c("Solid"),dashed:c("Dashed"),dotted:c("Dotted")},color:c("Border color"),unit:"px"});function Pee(e){let o=Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null&&t!==""));return Object.keys(o).length?o:void 0}function Eee(){let e;try{let o=vo(fe().theme);e=o.themes[o.selected]?.line}catch{e=void 0}return e||x_.line}function _ee({value:e,onChange:o,placeholder:t,presets:r,sides:a=!0,styles:n=!0,above:s={},length:i}){let l=e&&typeof e=="object"?e:{},[d,f]=fd(()=>a?RQ(l,s):!1),u=Tee(),p=m=>Pee(a&&n?m:{width:m.width,color:m.color,...n?{style:m.style}:{}});return A(wo,{label:c("Border"),icon:A(dQ,{}),action:a?A(OQ,{each:d,label:c("Each side"),onChange:f}):void 0,children:A(_Q,{label:c("Border"),value:l,each:d,onChange:m=>o(p(m)),placeholder:t,presets:r,words:i?{...u,unit:i.unit}:u,styles:n,max:i?.grid.max??Pm,...i?{step:i.grid.step,units:i.units}:{}})})}function Oee({value:e,onChange:o,view:t}){let[r]=br("sectionBorder"),[a]=br(uw("sectionBorder")),n=Eee(),s=p=>p&&typeof p=="object"?p:{},i=t==="phone"?{...FS(s(r)),...FS(s(a))}:t==="tablet"?s(r):{},l=So(),d=ur(),f=ke("sectionBorder",t),u=el({row:ad,label:"Border",grid:{min:0,max:Pm,step:1},valueKey:"sectionBorder",view:t,numbersIn:p=>tw(l[mw("sectionBorder",p)]),convertTo:p=>{let m=s(l[f]);return tw(m)?{[f]:Aee(m,p)}:{}}});return A(_ee,{value:e,length:u,onChange:u?p=>d({[f]:p,...u.unitPatch(!tw(p))}):o,placeholder:{sides:AQ(i),style:i.style??"solid",color:i.color||n},presets:[n],above:i})}var iB=["width",...Em];function tw(e){if(!e||typeof e!="object")return!1;let o=e;return iB.some(t=>q(o[t])!==void 0)}function Aee(e,o){let t={...e};for(let r of iB){let a=q(t[r]);a!==void 0&&(t[r]=o(a))}return t}function Ree(e){return{type:"custom",render:({value:o,onChange:t})=>A(Oee,{value:o,onChange:t,view:e})}}function Lee(e,o){let t=ew[e];for(;t&&ew[t]!==null&&!o(t);)t=ew[t];return t??e}function qNe(e){return{type:"custom",render:()=>A(Fee,{partKey:e})}}function Fee({partKey:e}){let[o]=br("id"),[t]=br("_partStyles"),{textStyles:r}=fe(),a=qQ(),n=null;try{n=KQ().select}catch{n=null}let s=t&&typeof t=="object"?t[e]:void 0,i=Array.isArray(r)?r:null;return A(TQ,{name:c("Text"),preview:OL(s,i,{noStyle:c("No style"),styleName:a.textStyles.styleName,cases:(a.copy.panel??YQ.copy.panel).cases}),onOpen:()=>{n&&typeof o=="string"&&n(VQ(o,e))}})}function lB(e){let{cornerRadiusPx:o}=fe(),t=typeof o=="number"?o:e,r=null;try{let{appState:n,selectedItem:s}=Km(l=>l),i=s?.props?.id?String(s.props.id):void 0;r=i?MA(n?.data,i)?.props??null:null}catch{r=null}if(!r)return t;let a=r.sectionCorners;return nb(a)?a:t}function Bee({label:e,changed:o=!1,onReset:t=()=>{}}){let r=lB(nt);return A(et,{words:ce()?.panel,label:c(e),changed:o,detail:ls(`${r}px`,c("the section")),onReset:t})}function Nee(){return A(Sa,{children:c("Follows the section's Corners until you set a number here.")})}function Dee(){return gw({sidesKey:"cardCornerSides",row:Mc,useFollowed:()=>lB(nt),mark:A(Bee,{label:pd}),hint:A(Nee,{})})}function Mee(){return{type:"custom",render:()=>A(N1,{})}}function cB(){return{_gShape:wr("Shape"),cardCorners:Dee(),...nB(Mc,"cardCorners"),cardCornerSides:sB(),cardCornersApplyAll:Mee()}}function Hee(){return on({type:"custom",[YS]:!0,render:e=>A($ee,{...e})},{type:"select",label:An,options:[{value:"content",label:"Fit content"},{value:"equal",label:"Equal"},{value:[50],label:"Custom: the width of each block in %, the last block left out"}]})}function Wee(e,o){let t=dy(e);if(t!=="custom")return c(cy.find(a=>a.value===t)?.label??"");let r=YF(Rp(e,o),o);return r?[...r,100-r.reduce((a,n)=>a+n,0)].join(" / "):c("Custom")}function $ee(e){let{value:o,onChange:t}=e,[r]=br("content"),a=Array.isArray(r)?r.length:0,n="follows"in e,s=o!=null,i=s?o:n?e.follows:void 0,l=dy(i),d=a>=2&&a<=PF,f=()=>[...HQ[a]??[]],u=dd(null),p=S=>{let v=u.current;v&&JSON.stringify(S)===JSON.stringify(v.shares)?t(v.value):S&&t(S)},m=S=>{S===l||S==="custom"&&!d||t(S==="custom"?f():S)},h=c("The width bar works for 2 to {count} blocks.",{count:PF}),I=s&&(n||o!=="content"),w=$Q().widths.hint(a,MQ);return A(wo,{label:c(An),icon:A(lw,{}),changed:I,hint:l!=="custom"?void 0:d?w:h,action:A(et,{words:ce()?.panel,label:c(An),changed:I,disabled:e.readOnly===!0,detail:n?is(S=>c(S),Wee(e.follows,a),e.followsView):c("Fit content"),onReset:()=>t(void 0)}),children:ya("div",{className:"sf-share-row",children:[A("div",{className:"sf-share-pick",children:A(VF,{label:c(An),value:l,options:cy.map(S=>({value:S.value,label:S.value==="custom"&&!d?h:c(S.label),icon:XS(A("span",{className:"sf-gallery-pic sf-share-pic",children:dB(S.weights).map((v,b)=>A("i",{style:{gridColumn:`span ${v}`}},b))}),c(S.label),S.value==="custom"&&!d?h:c(S.label))})),onChange:m,columns:3,cell:fB,tooltips:!1,disabled:e.readOnly===!0})}),l==="custom"&&d?A("div",{onFocus:()=>{u.current={value:o,shares:YF(Rp(i,a),a)}},onBlur:()=>{u.current=null},children:A(WQ,{label:c(An),count:a,value:Rp(i,a),onChange:p,readOnly:e.readOnly===!0})}):null]})})}function dB(e){if(!e)return[3,4];let o=e.reduce((t,r)=>t+r,0);return e.map(t=>Math.round(t/o*12))}function XNe(){return At(WE,A(gQ,{}),hy,hy[0].value)}function ZNe(){return Lt("mobile",ZS(An,A(lw,{}),BE.map(e=>({label:e.label,value:e.value,picture:A("span",{className:"sf-gallery-pic sf-share-pic",children:dB(e.weights).map((o,t)=>A("i",{style:{gridColumn:`span ${o}`}},t))})})),NE,{columns:2,cell:fB}))}var fB={width:"5.75rem",height:"3.25rem",words:!0};function JNe(){return sw("share",Hee(),ZF)[uw("share")]}function Uee(){return Lt("mobile",Wo(py,A(WF,{}),Lp,FE,1,Lp,"",{clear:{phoneFollows:!1,hint:Lp}}))}var RF={read:e=>e.phoneRow,write:(e,o,t)=>({phoneRow:t}),fieldKey:()=>"phoneRow",ownField:!0};function QNe(){let e=Wo(py,A(WF,{}),uy,DE,1,uy,"",{clear:{emptyLabel:"Auto"}}),o=sw("columns",e,{...RF,tablet:ZF.tablet}),t=sw("columns",e,RF,{phoneRow:Uee()});return{...o,phoneRow:t.phoneRow}}function eDe(e,o,t,r,a,n,s){return{type:"custom",render:({value:i,onChange:l,name:d})=>A(zee,{label:e,min:o,max:t,step:r,fallback:a,role:n,value:i,onChange:l,name:d??"",length:s})}}function zee({label:e,min:o,max:t,step:r,fallback:a,role:n,value:s,onChange:i,name:l,length:d}){let f=So(),u=ur(),p=da(d?.view),m=el({row:d?.row??{kind:"fontSize"},label:e,grid:{min:o,max:t,step:r},valueKey:d?l:"",view:d?.view??"desktop",numbersIn:I=>I===p&&typeof f[l]=="number",followsView:p,convertTo:I=>typeof f[l]=="number"?{[l]:I(f[l])}:{}}),h=I=>m?u({[l]:I,...m.unitPatch(typeof I!="number")}):i(I);return A(wo,{label:c(e),icon:A(kb,{noun:n}),action:A(et,{words:ce()?.panel,label:c(e),changed:!fF(s),detail:c("the Text style in Styles"),onReset:()=>h(ts),defaultAction:{onPress:()=>h(Fm),title:c("Keep this section's own built-in size"),icon:A(fQ,{})}}),children:yt({min:m?.grid.min??o,max:m?.grid.max??t,step:m?.grid.step??r,value:typeof s=="number"?s:a,...m?{suffix:m.unit,units:m.units}:{suffix:"px"},ariaLabel:e,onChange:h})})}function LF(e,o,t){return[{label:"Auto",value:""},...Array.from({length:e},(r,a)=>({label:a===0?`1 ${o}`:`${a+1} ${t}`,value:String(a+1)}))]}function pB(){return{_gCellWidth:wr("Cell size"),gridSpan:At("Positions",A(lw,{}),LF(Nu,"position","positions"),""),gridRowSpan:At("Rows tall",A(cw,{}),LF(Cb,"row","rows"),"")}}function So(){let e=null,o=null;try{e=DF(Iw),o=Km(t=>t).selectedItem}catch{o=null}return e??o?.props??{}}var Iw=eQ(null);function Gee({min:e,max:o,step:t,px:r,label:a,onChange:n,desktopKey:s,fallback:i}){let l=So()[s],d=em(void 0,l,i);return A(Sa,{children:yt({min:e,max:o,step:t,value:em(r,l,i),readout:!1,ariaLabel:a,notch:d,onChange:n})})}function jee({label:e,desktopKey:o,fallback:t,unit:r="px",changed:a=!1,onReset:n=()=>{}}){let s=So()[o],i=em(void 0,s,t);return A(et,{words:ce()?.panel,label:c(e),changed:a,detail:is(l=>c(l),`${i}${r}`),onReset:n})}function Kee(e){return yee(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unit:e.unit,unsetLabel:"Follows Desktop",unsetMark:A(jee,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback,unit:e.unit}),restTrack:o=>A(Gee,{...o,desktopKey:e.desktopKey,fallback:e.fallback})})}var Vee={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Yee={Top:dw,Bottom:zF,Left:GF,Right:jF},qee=e=>{let o=Yee[e];return A(o,{})};function uB(e={}){let o=e.keys?.top??"sectionPaddingTop",t=e.keys?.bottom??"sectionPaddingBottom",r=e.group!==!1,a=w=>Vee[w],n=w=>Wo(a("Top"),A(dw,{}),zt.min,zt.max,zt.step,w,"px"),s=(w,S,v,b=zt)=>Lt("mobile",Kee({label:a(w),icon:qee(w),desktopKey:S,min:b.min,max:b.max,step:b.step,fallback:v})),i=e.top??zt.min,l=e.bottom??zt.min,d="sectionPaddingLeft",f="sectionPaddingRight",u=e.sideBounds??zt,p=e.side??u.min,m=e.sidePhone??p,h=e.phone===!0,I=w=>h?Lt("desktop",w):w;return md({...r?{_gSpacing:wr("Padding")}:{},[o]:I(n(i)),...h?{[Zi(o)]:s("Top",o,i)}:{},...e.only==="top"?{}:{[t]:I(Wo(a("Bottom"),A(zF,{}),zt.min,zt.max,zt.step,l,"px")),...h?{[Zi(t)]:s("Bottom",t,l)}:{}},...e.sides?{[d]:I(Wo(a("Left"),A(GF,{}),u.min,u.max,u.step,p,"px")),...h?{[Zi(d)]:s("Left",d,m,u)}:{},[f]:I(Wo(a("Right"),A(jF,{}),u.min,u.max,u.step,p,"px")),...h?{[Zi(f)]:s("Right",f,m,u)}:{}}:{}})}function oDe(e,o){let t=Object.fromEntries(Object.entries(o).map(([n,s])=>[n,n in e&&Sr(s)?e[n]:s])),r={},a=!1;for(let[n,s]of Object.entries(e)){if(n in o){a||Object.assign(r,t),a=!0;continue}r[n]=s}return a||Object.assign(r,t),r}var en="Width";function tl(e,o=uF,t=!0){let r=o.map(a=>({label:rs[a],value:a}));return md({...t?{_gWidth:wr(en)}:{},widthMode:{type:"custom",render:({onChange:a,field:n})=>A(wo,{label:c(en),icon:A(kQ,{}),action:t?A(iee,{inherited:n?.inherited??!1,onReset:()=>a(jS),label:en}):void 0,children:cd({options:r,value:n?.currentValue||e,onChange:a,ariaLabel:en})})}})}function rl({fill:e=!1}={}){let o=(a,n)=>({type:"custom",render:({value:s,onChange:i})=>A(Xee,{value:s,onChange:i,view:a,badge:n,fill:e})}),t=()=>nw("sectionHeightMode"),r=()=>nw("sectionHeightMode");return md({_gHeight:wr(Ti),...ua("sectionHeightMode",a=>a==="desktop"?o(a):o(a,n=>A(eoe,{view:a,onClear:()=>n(void 0)}))),...ua("sectionHeightValue",t),...ua("sectionHeightUnit",r)})}function Xee({value:e,onChange:o,view:t,badge:r,fill:a=!1}){let n=So(),{mode:s,number:i,unit:l}=Zee(t,n,e);return A(wo,{label:Ti,icon:Ji(A(cw,{})),action:r?r(o):void 0,children:ya("div",{className:"es-width-stack",children:[cd({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"},...a?[{label:"Fill",value:"fill"}]:[]],value:s,onChange:o,ariaLabel:Ti}),i?A(Qee,{view:t,mode:s,menu:l}):null]})})}function mB(e,o){return e==="phone"&&nu(o)?xO(o):uO(o)}function qm(e,o){return e==="desktop"||(e==="tablet"?nu(o):hO(o))?null:mB(e,o)}function Zee(e,o,t){let r=(a=>dO.includes(a))(t)?t:qm(e,o)?.mode??"auto";return{mode:r,number:r!=="auto"&&r!=="fill",unit:r==="fixed"}}function Jee(e,o,t,r){let a=qm(e,o);return!a||e==="desktop"?null:r===void 0?{}:{[ke("sectionHeightMode",e)]:a.mode,...a.mode==="fixed"?{[ke("sectionHeightUnit",e)]:a.unit}:{},...t==="sectionHeightUnit"?{[ke("sectionHeightValue",e)]:a.value}:{},[ke(t,e)]:r}}function FF(e,o,t){let r=ss(),a=qm(e,So());return!r||!a?{followed:null,write:t}:{followed:a,write:n=>r.onChangeMany(s=>{let i=Jee(e,s,o,n);return i===null?{[ke(o,e)]:n}:Object.keys(i).length?i:null})}}function Qee({view:e,mode:o,menu:t}){let r=ss(),a=So(),n=ke("sectionHeightValue",e),s=ke("sectionHeightUnit",e),i=w=>S=>r?.onChangeMany(()=>({[w]:S})),{followed:l,write:d}=FF(e,"sectionHeightValue",i(n)),{write:f}=FF(e,"sectionHeightUnit",i(s)),u=o==="screen"?"%":a[s],p=(l?l.unit:u)==="%"?"%":"px",m=p==="%"?pO:fO,h=a[n],I=t?{options:["px","%"],label:c("Unit"),onChange:w=>f(w)}:void 0;return yt({min:m.min,max:m.max,step:m.step,value:l?null:typeof h=="number"?h:m.fallback,...l?{placeholder:l.value}:{},suffix:p,...I?{units:I}:{},ariaLabel:Ti,onChange:d})}function eoe({view:e,onClear:o}){let t=So(),r=qm(e,t)===null,a=e==="phone"&&nu(t),n=mB(e,t),s=is(i=>c(i),n.mode==="auto"?c("Auto"):`${n.value}${n.unit}`,a?"tablet":"desktop");return A(et,{words:ce()?.panel,label:c(Ti),changed:r,detail:s,onReset:o})}function xd(e={}){let o=e.intro===!0,t=n=>({type:"custom",render:({value:s,onChange:i,id:l,name:d})=>A(ioe,{value:s,onChange:i,labelId:`${l??d??"stickTop"}-label`,view:n,intro:o})}),r=n=>({type:"custom",render:({value:s,onChange:i})=>A(aoe,{value:s,onChange:i,view:n,intro:o})}),a=n=>({type:"custom",render:({value:s,onChange:i})=>A(noe,{value:s,onChange:i,view:n,intro:o})});return{_gStick:wr(LL,{dot:o?roe:zi}),...ua("stickTop",t),...ua("stickTopDistance",r),...ns(rd,"stickTopDistance",{tablet:!0,phone:!0}),...e.screens?ua(yr,a):{},...o?{}:{[es]:ooe()},...o||e.above===!1?{}:{[Ja]:toe()}}}function ooe(){let e=At(FL,A(dw,{}),BL,NL);return Lt("desktop",{...e,render:o=>{let t=e.render({...o,value:ES(o.value),onChange:r=>o.onChange(ML(r))});return iw(t,{hint:c(DL)})}})}function toe(){let e=xB(HL,!1,A(KF,{}),WL);return Lt("desktop",{...e,render:o=>e.render({...o,onChange:t=>o.onChange(t===!0?!0:void 0)})})}var roe={any:[zi,km]};function hB(e,o,t,r,a){let n=ss(),s=So(),i=e==="desktop"||ud(e,s)?null:yw(e,Gi(s,{intro:r}));return{followed:i,write:(i||a)&&n?l=>n.onChangeMany(d=>{let f=soe(e,d,l,o,r),u=f===null?{[ke(o,e)]:l}:f;return Object.keys(u).length?{...u,...a?.(l)??{}}:null}):t}}function aoe({value:e,onChange:o,view:t,intro:r}){let a=So(),n=Gi(a,{intro:r}),s=f=>{let u=Ci(f);return u==="desktop"||ud(u,a)},i=el({row:rd,label:"Distance from top",grid:{min:Gt.min,max:Gt.max,step:Gt.step},valueKey:"stickTopDistance",view:t,numbersIn:f=>s(f)&&q(a[mw("stickTopDistance",f)])!==void 0,followsView:t==="phone"&&n.ownTablet?"tablet":"desktop"}),{followed:l,write:d}=hB(t,"stickTopDistance",o,r,i?f=>i.unitPatch(f===void 0):void 0);return A("div",{className:"sf-field",children:yt({min:i?.grid.min??Gt.min,max:i?.grid.max??Gt.max,step:i?.grid.step??Gt.step,value:l?null:typeof e=="number"?e:Gt.fallback,...l?{placeholder:l.distance}:{},...i?{suffix:i.unit,units:i.units}:{suffix:"px"},ariaLabel:c("Distance from top"),onChange:d})})}function noe({value:e,onChange:o,view:t,intro:r}){let{followed:a,write:n}=hB(t,yr,o,r);return A(wo,{label:c(PS),icon:Ji(A(cw,{})),children:yt({min:zm.min,max:zm.max,step:zm.step,value:a?null:q(e)??zm.default,...a?{placeholder:a.screens}:{},ariaLabel:c(PS),onChange:n})})}function ud(e,o){return e==="tablet"?OS(o):AS(o)}function yw(e,o){return e==="phone"?{on:o.tablet,distance:o.tabletDistance,unit:o.tabletUnit,screens:o.tabletScreens}:{on:o.desktop,distance:o.desktopDistance,unit:o.desktopUnit,screens:o.desktopScreens}}function soe(e,o,t,r="stickTopDistance",a=!1){if(e==="desktop"||ud(e,o))return null;if(t===void 0)return{};let n=yw(e,Gi(o,{intro:a})),s=e==="phone"&&ud("tablet",o)?f=>ke(f,"tablet"):f=>f,i=(f,u)=>o[s(f)]==null?{}:{[ke(f,e)]:u},l=rd.unitKey,d=o[s(l)]==null?{}:{[ke(l,e)]:n.unit};return{[ke("stickTop",e)]:!0,...i("stickTopDistance",n.distance),...d,...i(yr,n.screens),[ke(r,e)]:t}}function ioe({value:e,onChange:o,labelId:t,view:r,intro:a}){let n=So(),s=Gi(n,{intro:a}),i=r==="phone"?s.phone:r==="tablet"?s.tablet:a?s.desktop:e===!0,l=r==="phone"&&s.ownTablet,d=r==="desktop"?null:yw(r,s),f=d?.on?Me(d.distance,d.unit):c("Off");return A(wo,{label:c(kS),labelId:t,icon:Ji(A(KF,{})),action:ya(Sa,{children:[r!=="desktop"?A(et,{words:ce()?.panel,label:c(kS),changed:ud(r,n),detail:is(u=>c(u),f,l?"tablet":"desktop"),onReset:()=>o(void 0)}):null,A(fw,{checked:i,onChange:o,ariaLabelledBy:t})]})})}var BF="e.g. about";function al(){return{_gAnchor:wr("Anchor"),anchor:ds({control:"plainText",label:"Name",placeholder:BF},{type:"custom",render:({value:e,onChange:o})=>A(wA,{value:e,onChange:o,nameBox:(t,r)=>A(cs,{value:t,onChange:r,label:"Name",placeholder:BF,hideable:!1,markup:!1})})})}}function tDe(e,o,t){return{type:"custom",render:({value:r,onChange:a,id:n,name:s})=>{let i=`${n??s??e}-datetime`,l=Date.parse(typeof r=="string"?r:"");return A(wo,{label:c(e),icon:o,htmlFor:i,hint:t===void 0?void 0:c(t),children:A(DQ,{id:i,value:Number.isFinite(l)?new Date(l):null,onChange:d=>a(d?d.toISOString():"")})})}}}function xB(e,o,t,r){return{type:"custom",...on({},{...jm,label:e}),render:a=>{let{value:n,onChange:s,id:i,name:l}=a,d="follows"in a,f=a,u=typeof n=="boolean",p=typeof f.follows=="boolean"?f.follows:o,m=u?n:d?p:o,h=`${i??l??e}-label`,I=f.readOnly===!0,w=A(fw,{checked:m,onChange:s,disabled:I,ariaLabelledBy:h});return A(wo,{label:c(e),labelId:h,icon:t,hint:r===void 0?void 0:c(r),action:d?ya(Sa,{children:[A(et,{words:ce()?.panel,label:c(e),changed:u,detail:f.followsNoView?c(p?"On":"Off"):is(S=>c(S),c(p?"On":"Off"),f.followsView),disabled:I,onReset:()=>s(void 0)}),w]}):w})}}}function gB(){return{type:"custom",render:({value:e,onChange:o,id:t,name:r})=>{let a=`${String(t??r??"pageBackground")}-colour`;return A(loe,{label:"Background",icon:A(SQ,{}),id:a,value:e,shown:Eb(e),onChange:o})}}}function rDe(e,o,t){return{type:"custom",render:({value:r,onChange:a})=>A(gt,{label:c(e),icon:t,value:r||o,onChange:a})}}function loe({label:e,icon:o,id:t,value:r,shown:a,onChange:n}){let{colors:s,n:i}=Sw(),l=zr(r),d=l?Li(l,s,i):null;return A(gt,{label:c(e),icon:o,id:t,value:d?d.hex:a,caption:d?.words,onChange:n,choices:bw(l??"",s,i,n)})}function aDe(){return{type:"custom",render:e=>{let{value:o,onChange:t}=e,r=e;return A(coe,{value:typeof o=="string"?o:"",onChange:t,twin:"follows"in e?{follows:r.follows,view:r.followsView}:void 0})}}}function bw(e,o,t,r){let a=qu(e);return PA(o,t).map(n=>({label:n.label,color:n.value,selected:a===n.name,onPick:()=>r(n.name)}))}function coe({value:e,onChange:o,twin:t}){let{colors:r,n:a}=Sw(),n=r.background,s=ls(n.toUpperCase(),c("Theme {n} background",{n:a})),[i,l]=br(DA),[d]=br(Rb),f=typeof d=="string"&&d.trim()!=="",u=Vu(i),p=y=>l(Vu(y)||void 0),m=qu(e),h=m?Li(m,r,a):null,I=bw(e,r,a,o),w=t?()=>o(void 0):()=>o(""),S=n,v=s;if(t){let y=qu(t.follows),k=Yu(t.follows),L=y?Li(y,r,a):k?{hex:k,words:k.toUpperCase()}:null;S=L?.hex??n,v=is(O=>c(O),L?L.words:s,t.view)}let b=!t&&(Gc(e)||f)?A(doe,{value:u,onChange:p}):null;return h?A(gt,{label:c("Fill"),icon:A(aw,{}),value:h.hex,caption:h.words,onChange:o,changed:!0,onReset:w,resetTo:v,choices:I,children:b}):A(Vc,{label:c("Fill"),icon:A(aw,{}),value:e,inherited:S,resetTo:v,onChange:o,onReset:w,choices:I,children:b})}function doe({value:e,onChange:o}){return cd({options:Ku.map(t=>({label:t.label,value:t.value,hint:t.hint})),value:e,onChange:o,ariaLabel:c("Fill")})}function foe(e,o,t){if((e?.content??[]).some(n=>n?.props?.id===o))return Wr(t);let r=HA(e,o);if(r.length===0)return null;let a=Wr(Dn(t));if(a!==null)return a;for(let n=r.length-1;n>0;n-=1){let s=Wr(Dn(r[n].sectionAccent));if(s!==null)return s}return Wr(r[0].sectionAccent)}function Sw(){let e=vo(fe().theme),[o]=br("sectionAccent"),t=null;try{let{appState:a,selectedItem:n}=Km(i=>i),s=n?.props?.id?String(n.props.id):void 0;t=s?foe(a?.data,s,o):null}catch{t=null}let r=t!==null&&e.themes[t]?t:e.selected;return{colors:ht(e.themes[r]),n:r+1}}function nDe(){return hd()}var IB={top:A(hQ,{}),right:A(mQ,{}),bottom:A(pQ,{}),left:A(uQ,{})};function yB(e,o,t,r,a,n,s){let i=u=>o.find(p=>p.value===u),l=u=>({value:u,label:"",disabled:!0,title:r}),d=u=>{let p=o.find(h=>h.cell===u);if(!p)return l(`missing-${u}`);let m=n?.[u];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},f=[l("corner-top-left"),d("top"),l("corner-top-right"),d("left"),l("centre"),d("right"),l("corner-bottom-left"),d("bottom"),l("corner-bottom-right")];return{type:"custom",render:({value:u,onChange:p})=>{let m=o.some(h=>h.value===u)?u:t;return A(wo,{label:c(e),icon:a,value:i(m)?.label?c(i(m).label):s?c(s):"",children:JQ(c,{label:e,value:m,onChange:p,points:f})})}}}function sDe(e,o,t){return{type:"custom",options:o,render:({value:r,onChange:a,field:n})=>A(pR,{label:e,options:(n.options??o).map(s=>({...s,label:c(s.label)})),value:Array.isArray(r)?r:[],onChange:a,...t?{emptyLabel:c(t)}:{}})}}function iDe(e,o={}){return{type:"custom",render:({value:t,onChange:r})=>{let a={value:t,onChange:r,...o};return A(e,{...a})}}}var poe={image:"Image",video:"Video"},lDe=Mn.map(e=>({label:poe[e],value:e}));function cDe(e,o,t){let r=Object.keys(Xy).map(a=>({label:Xy[a],value:a,picture:t[a]}));return{type:"custom",...on({},{type:"radio",label:e,options:r.map(a=>({value:a.value,label:a.label}))}),render:({onChange:a})=>A(moe,{label:e,icon:o,options:r,onChange:a})}}function uoe(e,o,t){let r=s1(e,o,t);if(r!==void 0)return r==="save-makes-frame"?c("A frame is made from this video when you save the page."):r==="starts-dark"?c("This video starts dark, so no frame was made. The slide shows its background colour while the video loads. Choose Image to show a picture."):r==="outside"?c("This video is on another website, so no frame can be made. The slide shows its background colour while the video loads. Choose Image to show a picture."):r==="unsupported"?c("This video's file type gives no frame. The slide shows its background colour while the video loads. Choose Image to show a picture."):r==="failed"?c("No frame could be made from this video. It is tried again the next time you save the page. The slide shows its background colour while the video loads."):r==="image-no-frame"?c("The slide shows your Image while the video loads, because this video has no frame."):void 0;let a=n1(e);return a==="frame-missing-image"?c("This video has no frame yet. The slide shows its image until one is made."):a==="frame-missing-surface"?c("This video has no frame yet. The slide shows its background colour until one is made."):a==="image-missing-frame"?c("No image yet. The slide shows the video's frame until you choose one."):a==="image-missing-surface"?c("No image yet. The slide shows its background colour until you choose one."):void 0}function moe({label:e,icon:o,options:t,onChange:r}){let a=ss(),n=a?.values??{},s=Fc(n),i=DF(tQ),l=Eu(i?.docId??null),d=null;try{d=Km(u=>u.appState.data)}catch{d=null}let f=k1(a?.id,d,l);return A(wo,{label:c(e),icon:Ji(o),hint:uoe(n,f,i?.hasUnsavedEdits??!1),children:cd({options:t,value:s,onChange:r,ariaLabel:e})})}function dDe(e,o,t,r={}){let a={type:"custom",[nQ]:!0,render:({value:n,onChange:s,name:i})=>A(dR,{value:n||"",onChange:s,fieldKey:i,label:e,accept:o,placeholder:t,focusKey:r.focus,focusWhen:r.focusWhen,frameKey:r.frame}),...r.focus?{focusKey:r.focus}:{},...r.focusWhen?{focusWhen:r.focusWhen}:{}};return r.focus?Lt("each",a):a}var fDe={HeroSingle:[Hn.image],HeroSlide:["videoFrame","videoFramePhone"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function hoe(e){let o=c(e.status??"");return e.ok&&typeof e.lat=="number"&&typeof e.lng=="number"?`${o} \xB7 ${e.lat.toFixed(4)}, ${e.lng.toFixed(4)}`:o}function pDe({value:e,onChange:o,label:t}){let r=e||{},a=ss(),n=a?a.values!==a.node.props:!0,s=!!r.pending&&n,i=!!r.pending&&!n,l=!!Ge(XQ()).geocode,d=MF(),f=(u,p)=>o({...r,[u]:p??void 0});return ya(Sa,{children:[A(wo,{label:c(t),icon:A(TF,{}),action:l?A(pw,{content:c("Find from the address (OpenStreetMap)"),children:A(qF,{"aria-label":c("Find from the address"),"aria-busy":s||void 0,disabled:s,onClick:()=>o({...r,pending:!0,ok:!1,status:"Finding\u2026"}),children:A(wQ,{})})}):void 0,children:l&&r.status?A(CA,{compact:!0,oneLine:!0,spaced:!1,status:s?"busy":r.ok&&!i?"found":"notfound",statusText:s?c("Finding\u2026"):i?c(Nb):c(r.status),hint:hoe(r)}):null}),A(wo,{label:c("Enter by hand"),labelId:d,icon:A(xQ,{}),action:A(fw,{checked:!!r.manual,onChange:u=>o({...r,manual:u}),ariaLabelledBy:d})}),r.manual&&A(wo,{label:c("Latitude, longitude"),icon:A(TF,{}),children:ya("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,width:"100%",minWidth:0},children:[A(EF,{value:typeof r.lat=="number"?r.lat:null,onChange:u=>f("lat",u),min:-90,max:90,step:1e-4,placeholder:c("Latitude")}),A(EF,{value:typeof r.lng=="number"?r.lng:null,onChange:u=>f("lng",u),min:-180,max:180,step:1e-4,placeholder:c("Longitude")})]})})]})}function xoe(e,o){return o===null||o<0||o>=e.length?"":e[o]?.text??""}function goe(e,o,t){let r=e.map(a=>({text:a?.text??""}));return o===null||o<0||o>=e.length?r:r.map((a,n)=>n===o?{text:t}:a)}function Ioe(e,o,t){if(t===null||t>=o.length)return null;for(let r=0;r<t;r+=1)if(e[r]!==o[r])return null;return e[t]!==o[t]&&o.includes(e[t])||e[t]!==o[t]&&o.length!==e.length?null:t}var ww={label:"Ticker items",icon:A(bQ,{})};function uDe(e,o,t,r){return{type:"custom",[ba]:{control:"textList",label:e,placeholder:t,itemKey:"text",rendering:r},...on({},{...eB.textList,label:e}),render:({value:a,onChange:n})=>A(Cw,{label:e,icon:Ji(o),items:Array.isArray(a)?a:[],placeholder:t,onChange:n,markup:r==="markup"})}}function Cw({label:e,icon:o,items:t,placeholder:r,onChange:a,markup:n=!1}){let s=dd(null),[i,l]=fd(null),d=u=>u.map(p=>({text:p?.text??""})),f=u=>{let p=Ioe(t,u,i);p===null&&(s.current=null),l(p),a(d(u))};return A(LQ,{label:c(e),icon:o,noun:c("item"),items:t,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:n?A(Hb,{target:s,value:xoe(t,i),onChange:u=>a(goe(t,i??-1,u)),disabled:i===null,label:i===null?c("Formatting \u2014 click a row first"):c("Formatting \u2014 row {n}",{n:i+1})}):void 0,renderRow:(u,p,m)=>A("input",{type:"text",className:n&&i===p?"sf-list-marking":void 0,value:u?.text??"",placeholder:c(r),"aria-label":c("{label} {n}",{label:c(e),n:p+1}),onChange:h=>m({text:h.target.value}),onFocus:h=>{s.current=h.currentTarget,l(p)}})})}function bB(e,o){let t=`${e.label} \u2014 row ${o+1}`;return ds({control:"plainText",label:t,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:r,onChange:a})=>A(cs,{value:r,onChange:a,label:c("{label} \u2014 row {n}",{label:c(e.label),n:o+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function SB(e){return{_gCards:wr("Cards"),coverIndex:At("Cover image",A(yQ,{}),iR,String(1),e?.coverHint??"A card's opening picture \u2014 a card pinned to a finish keeps its own."),imageBackground:Iee("Image background",Lm),cardImage:CB()}}function mDe(){return{outline:At("Card outline",A(CQ,{}),sR,nR),indexBadge:At("Card number",A(IQ,{}),jb,Gb),showBadge:xB("Product badge",!0,A(kb,{noun:"tag"}))}}function wB(e){let o=e?.defaults??{showCardSizes:!0,showCardBuy:!0,showCardPage:!0},t=a=>({...jm,label:Gm.find(n=>n.id===a).label}),r=a=>on(nw(rw),t(a));return{_gShowOnCard:wr("Show on a card"),[rw]:on({type:"custom",render:()=>A(yoe,{rest:{showCardPrice:!0,showCardFinishes:!0,...o}})},t(rw)),showCardFinishes:r("showCardFinishes"),showCardSizes:r("showCardSizes"),showCardBuy:r("showCardBuy"),showCardPage:r("showCardPage")}}var rw="showCardPrice",Gm=[{id:"showCardPrice",label:"Price"},{id:"showCardFinishes",label:"Finish swatches"},{id:"showCardSizes",label:"Sizes"},{id:"showCardBuy",label:"Buy button"},{id:"showCardPage",label:"Page button"}];function yoe({rest:e}){let o=So(),t=ur(),r=s=>typeof o[s]=="boolean"?o[s]:void 0,a=s=>r(s)??e[s],n=Gm.some(({id:s})=>r(s)!==void 0&&r(s)!==e[s]);return A(nl,{parts:Gm,changed:n,shown:a,onPress:(s,i)=>t({[s]:i}),onReset:()=>t(Object.fromEntries(Gm.map(({id:s})=>[s,void 0])))})}function hDe(e,o="display"){let t=Zi(o);return{[o]:Lt("desktop",{type:"custom",render:({value:r,onChange:a})=>A(nl,{parts:e,changed:GA(r),shown:n=>Ju(r,n),onPress:(n,s)=>a(KA(r,n,s)),onReset:()=>a(void 0)})}),[t]:Lt("mobile",{type:"custom",render:({value:r,onChange:a})=>A(boe,{parts:e,desktopKey:o,value:r,onChange:a})})}}function nl({parts:e,changed:o,shown:t,onPress:r,onReset:a,detail:n,disabledReason:s}){let i=c("Display");return A(wo,{label:i,icon:A(lQ,{}),changed:o,action:A(et,{words:ce()?.panel,label:i,changed:o,detail:n,onReset:a}),children:A(FQ,{label:i,items:e.map(l=>({id:l.id,label:c(l.label),shown:t(l.id),...s?{disabled:!0,disabledReason:c(s)}:{}})),onChange:r})})}function boe({parts:e,desktopKey:o,value:t,onChange:r}){let a=So()[o];return A(nl,{parts:e,changed:jA(t),shown:n=>Bb(a,t,n),onPress:(n,s)=>r(VA(t,n,s)),onReset:()=>r(om),detail:c("the same as Desktop")})}function CB(e=q1){return Wo("Card image",A($F,{}),nt,Ha,Y1,nt,e,{clear:{hint:nt},hint:"Rounds the picture. The card's own corner is in Styles."})}function Soe(){return ns(Ib,"cardImage")}function xDe(){return{cardImage:CB(Ib),...Soe()}}function gDe(){return gw({sidesKey:"cornerSides",row:Z1,step:J1,useFollowed:()=>nt,mark:A(woe,{label:Q1}),hint:c("Rounds the picture. Left alone it stays square.")})}function woe({label:e,changed:o=!1,onReset:t=()=>{}}){return A(et,{words:ce()?.panel,label:c(e),changed:o,onReset:t})}function IDe(){return{type:"custom",render:({value:e,onChange:o})=>A(Toe,{value:typeof e=="string"?e:"",onChange:o})}}var NF="own";function yDe(){let e=[{value:NF,label:"Layout's own",picture:QS(Array.from({length:8},()=>[3,1]))},...Object.entries(Bu).map(([o,t])=>({value:o,label:t.label,picture:QS([...t.phone,...t.phone])}))];return Lt("mobile",ZS("Layout",A(UF,{}),e,NF,{columns:2,cell:vF}))}function Coe({layout:e,width:o}){let t=wb(e),r=t?`${t[0]}/${t[1]}`:void 0;return A("span",{"aria-hidden":"true",style:{display:"grid",width:o,gridTemplateColumns:"repeat(12, minmax(0, 1fr))",gridAutoRows:r?"auto":6,gridAutoFlow:"row dense",gap:2},children:sA(e).map(([a,n],s)=>A("i",{className:"block rounded-xs bg-current opacity-60",style:{gridColumn:`span ${a}`,gridRow:`span ${n}`,aspectRatio:r}},s))})}var voe={width:"3.5rem",height:"2.5rem",words:!1},koe=200;function Toe({value:e,onChange:o}){let[t,r]=fd(null),[a,n]=fd(4),s=dd(null);oQ(()=>{let m=s.current;if(!m||typeof ResizeObserver!="function")return;let h=()=>n(m.getBoundingClientRect().width>=koe?4:3);h();let I=new ResizeObserver(h);return I.observe(m),()=>I.disconnect()},[]);let i=e?$($c,e):void 0,l=i?e:"",d=bb(t,l),f=bb(t,"").length,u=Mu("no-symbol"),p=[{value:"",label:c("Not chosen"),icon:CF(u,c("Not chosen"))},...d.map(m=>({value:m,label:c($c[m].label),icon:A(Coe,{layout:$c[m],width:40})}))];return A(wo,{label:c("Layout"),icon:A(UF,{}),value:i?c(i.label):void 0,children:A("div",{ref:s,style:{flex:"1 1 auto",minWidth:0},children:A(VF,{label:c("Layout"),value:l,options:p,onChange:o,columns:a,cell:voe,header:ya("div",{className:"mb-2 flex flex-col gap-1",style:{minWidth:"11rem"},children:[A("span",{className:"text-2xs text-ink-faint",children:c("Photos in a row")}),A(EQ,{options:[{id:"all",label:c("All")},...rA.map(m=>({id:String(m),label:String(m)}))],value:t===null?"all":String(t),ariaLabel:c("Photos in a row"),onChange:m=>r(m==="all"?null:Number(m))}),A("span",{className:"text-2xs text-ink-faint",children:c("{n} of {total} layouts",{n:f,total:yb.length})})]})})})})}import{decodePartId as zoe}from"efficient-easel/draw";import{decodePartId as Id,encodePartId as qr}from"efficient-easel/draw";import{LINK_FIELD_MARKER as LB,SCAFFOLD_FIELD_MARKER as AB,TEXT_FIELD_MARKER as eh}from"efficient-easel/draw";import{readHidable as FB}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as Loe}from"efficient-easel/draw";import{TEXT_FIELD_MARKER as Roe}from"efficient-easel/draw";import{TEXT_FIELD_MARKER as vB}from"efficient-easel/draw";import{readHidable as kB}from"efficient-easel/draw";import{SCALAR_TEXT_CONTROLS as Poe}from"efficient-easel/draw";var Eoe=Poe,_oe=["text","textarea"],Ooe=["textarea","plainTextarea"];function Aoe(e){return!e||typeof e!="object"?null:e[vB]?.control??null}function sl(e){let o=Aoe(e);return o&&Eoe.includes(o)?o:null}function Xm(e){return Ooe.includes(e)}function TB(e){return!e||typeof e!="object"?void 0:e[vB]?.placeholder}function Zm(e){return kB(e).text}function vw(e,o,t){return _oe.includes(e)?{text:t,hidden:kB(o).hidden}:t}function PB(e,o,t,r){return Zm(e[o])===r?null:{...e,[o]:vw(t,e[o],r)}}function Yr(e,o){return o?`${e}[${o.index}].${o.rowKey}`:e}function Cr(e){let o=/^([A-Za-z0-9_$]+)\[(\d+)\]\.([A-Za-z0-9_$]+)$/u.exec(e);return o?{key:o[1],row:{index:Number(o[2]),rowKey:o[3]}}:{key:e,row:null}}function Jm(e){if(!(!e||typeof e!="object"))return e[Roe]}function kw(e){if(!e||typeof e!="object")return null;let o=e.arrayFields;return o&&typeof o=="object"?o:null}function EB(e,o){if(!Array.isArray(o))return[];let t=Jm(e),r=[];if(t?.control==="textList"){let n=t.itemKey??"text";return o.forEach((s,i)=>{let l=be(s?.[n]);l&&r.push({row:{index:i,rowKey:n},text:l})}),r}let a=kw(e);return a?(o.forEach((n,s)=>{for(let[i,l]of Object.entries(a)){if(!sl(l))continue;let d=Zm(n?.[i])||Jm(l)?.placeholder||"";d&&r.push({row:{index:s,rowKey:i},text:d})}}),r):[]}function gd(e,o){if(Array.isArray(e))return e[o.index]?.[o.rowKey]}function Tw(e,o,t,r){let a=e[o];return!Array.isArray(a)||t.index<0||t.index>=a.length?null:{...e,[o]:a.map((n,s)=>s===t.index?{...n,[t.rowKey]:r}:n)}}function _B(e,o,t,r,a){let n=gd(e[o],t);return Zm(n)===a?null:Tw(e,o,t,vw(r,n,a))}function OB(e,o){return o?`${e} \xB7 row ${o.index+1}`:e}var co="data-sf-part",an="data-sf-region-part",Pw="data-sf-part-row";function BB(e,o){return`${e}[${o}]`}var NB="data-sf-part-kind",Ew="data-sf-part-style-owner",yd="data-sf-part-style-kind";function bd(e){for(let o=e;o;o=o.parentElement){let t=o.getAttribute(Ew),r=o.getAttribute(yd);if(t&&r)return{owner:t,kind:r};if(o.getAttribute("data-easel-block"))return null}return null}var RB=2;function rn(e){return na(e).replace(/\s+/gu,"")}function Qm(e,o,t){let r=e[eh];if(r){if(r.control==="textList"){let n=r.itemKey??"text";if(!Array.isArray(o))return;for(let s of o){let i=s?.[n];typeof i=="string"&&t.push(i)}return}let{text:a}=FB(o);a?t.push(a):r.placeholder&&t.push(r.placeholder);return}if(!e[LB]){if(e.type==="text"||e.type==="textarea"){let a=be(o);a&&t.push(a);return}if(e.arrayFields&&Array.isArray(o)){for(let a of o)for(let[n,s]of Object.entries(e.arrayFields))Qm(s,a?.[n],t);return}if(e.objectFields&&o&&typeof o=="object")for(let[a,n]of Object.entries(e.objectFields))Qm(n,o[a],t)}}function _w(e){if(!e||typeof e!="object")return!1;let o=e;return o[LB]?!1:!!o[eh]||o.type==="text"||o.type==="textarea"}function oh(e,o){let t=e[eh];return t?.label?t.label:typeof e.label=="string"?e.label:o}function Sd(e){let o=e.indexOf(" (");return(o>0?e.slice(0,o):e).trim()}function DB(e,o,t){if(!e)return[];let r=[];for(let[a,n]of Object.entries(e)){if(!n||typeof n!="object"||Vn(a))continue;let s=n,i=[];Qm(s,o?.[a],i),!i.length&&s[AB]!==void 0&&Qm(s,s[AB],i);let l=oh(s,a);if(t?.(a)&&_w(s)){i.length&&r.push({key:a,label:l,texts:[],keyed:!0});continue}let d=new Set;for(let{row:p,text:m}of EB(s,o?.[a])){let h=rn(m);h.length<RB||(d.add(h),r.push({key:a,label:l,texts:[h],row:p}))}let f=new Set(d),u=[];for(let p of i){let m=rn(p);m.length<RB||f.has(m)||(f.add(m),u.push(m))}u.length&&r.push({key:a,label:l,texts:u})}return r}function Ow(e){return!e.offPage&&!e.hidden&&e.panelOnly!==!0}var Foe=Loe;function MB(e,o){if(!o||typeof o!="object"||Vn(e)||JA(o))return null;let t=o[eh];return!t||!Foe.includes(t.control)?null:t}function Aw(e,o){let t=MB(e,o);return t!==null&&t.identifier!==!0}function HB(e,o){if(!e)return[];let t=[];for(let[r,a]of Object.entries(e)){let n=MB(r,a);if(!n)continue;let{text:s,hidden:i}=FB(o?.[r]);if(Ow({offPage:n.offPage===!0,hidden:!!i,panelOnly:Hi(a)}))continue;let l=s||n.placeholder||"",d=na(l).replace(/\s+/gu," ").trim();t.push({key:r,label:Sd(oh(a,r)),preview:d,offPage:n.offPage===!0,identifier:n.identifier===!0,hidden:!!i})}return t}function il(e,o){let t=Jm(e);return t?.control==="textList"?o.rowKey===(t.itemKey??"text")?bB(t,o.index):null:kw(e)?.[o.rowKey]??null}function th(e,o,t){let r=e.node.props,{key:a,row:n}=Cr(e.propKey),s=n?_B(r,a,n,e.kind,o):PB(r,a,e.kind,o);return s?(t(e.zone,e.index,{...e.node,props:s}),!0):!1}import{readHidable as UB}from"efficient-easel/draw";var Rw=e=>String(e+1).padStart(2,"0"),YDe=[{label:"01 \xB7",value:"two-digit"},{label:"1.",value:"plain"}],Lw="two-digit",WB=e=>e==="plain"?"plain":Lw,rh=(e,o)=>e==="plain"?`${o+1}.`:Rw(o);var Nw="Contents",Fw="Flex",$B="Text",Boe="numberForm",Noe="_contentsEntries",Doe="_kickerNumber",zB="data-sf-kicker-number",Moe=e=>UB(e).text.trim(),GB=e=>zn(e?.anchor),Bw=e=>String(e.props?.id??""),Hoe=e=>!UB(e.props?.text).hidden&&!Ei(e.props)&&!mt(e.props),wd=e=>si(e);function jB(e){for(let o of wd(e))for(let t of o){if(pa(t.props??{}))continue;if(t.type===$B&&Hoe(t))return t;if(t.type===$B)continue;let r=jB(t);if(r)return r}}function KB(e){return wd(e).some(o=>o.some(t=>t&&!pa(t.props??{})&&(t.type===Nw||KB(t))))}var VB=e=>e.type===Fw&&Kr(Fw,e.props?.direction)==="row";function YB(e){return wd(e).some(o=>o.some(t=>t&&!pa(t.props??{})&&(t.type===Nw||!VB(t)&&YB(t))))}function Woe(e){let o=[],t=(r,a)=>{for(let n of r){if(!n||pa(n.props??{}))continue;if(n.type===Nw){a.open={contents:n,sections:a.waiting??[]},a.waiting=null,o.push(a.open);continue}if(VB(n)&&YB(n)){let i={inRow:!0,open:null,waiting:[]};for(let l of wd(n))t(l,i);a.inRow||(a.open=null);continue}let s=a.open?.sections??a.waiting;if(n.type===Fw&&GB(n.props)&&s&&!KB(n)){s.push({box:n,kicker:jB(n)});continue}for(let i of wd(n))t(i,a)}};return t(e,{inRow:!1,open:null,waiting:null}),o}function $oe(e){return e.map(o=>({label:o.kicker?na(Moe(o.kicker.props?.text)):"",anchor:GB(o.box.props)}))}function Dw(e){let o=e?.length?Woe(e):[];if(!o.length)return null;let t=new Map,r=new Map;for(let a of o){let n=Bw(a.contents);n&&t.set(n,$oe(a.sections));let s=WB(a.contents.props?.[Boe]);a.sections.forEach((i,l)=>{let d=i.kicker?Bw(i.kicker):"";d&&r.set(d,rh(s,l))})}return{entries:t,numbers:r}}var nMe=e=>e.endsWith(".")?`${e} `:`${e} \xB7 `;function qB(e){let o=e;if(!o?.content?.length)return e;let t=Dw(o.content);if(!t)return e;let{entries:r,numbers:a}=t,n=s=>{let i=ho(s,m=>so(m,n)),l=i.props??{},d=i!==s,f=Bw(s),u=f?r.get(f):void 0;u&&(l={...l,[Noe]:u},d=!0);let p=f?a.get(f):void 0;return p&&(l={...l,[Doe]:p},d=!0),d?{...s,props:l}:s};return{...o,content:o.content.map(n)}}var Goe=`[${zB}]`,joe=["bold","italic","underline","strike","link","sup","sub"],Koe=["bullet","number"];function Ww(e,o){return e?[...joe,...o?Koe:[]]:[]}function XB(e,o){let t=zoe(e);if(!t?.propKey)return null;let{nodeId:r,propKey:a}=t,n=o.getItemById(r),s=o.getSelectorForId(r);if(!n||!s)return null;let{key:i,row:l}=Cr(a),d=o.components[n.type]?.fields?.[i],f=l?il(d,l):d,u=sl(f);if(!u)return null;let p=n.props??{};if(cS(p)!==null||!l&&zp(n.type,p,i)||n.type==="Text"&&i==="text"&&Ei(p)||l&&!(Array.isArray(p[i])&&l.index<p[i].length))return null;let m=l?gd(p[i],l):p[i];return{node:n,selector:s,propKey:a,kind:u,stored:m,offPage:Vm(f),panelOnly:Hi(f)}}function ah(e,o){let t=XB(e,o);if(!t)return null;let{text:r,hidden:a}=tn(t.stored);if(!Ow({offPage:t.offPage,hidden:!!a,panelOnly:t.panelOnly}))return null;let n=Xm(t.kind);return{partId:e,value:r,rules:Cp,multiline:n,skip:Goe,offered:Ww(t.kind!=="plainText",n),write:s=>{let i=XB(e,o);i&&th({node:i.node,propKey:i.propKey,kind:i.kind,zone:i.selector.zone,index:i.selector.index},s,o.replace)}}}function $w(e,o,t){return e?.isConnected&&e.getAttribute(co)===t?e:o?.querySelector(`[${co}="${nh(t)}"]`)??null}function nh(e){return e.replace(/["\\]/g,"\\$&")}function ZB(e){let o=e.activeElement;return o?o.tagName==="IFRAME"||!!o.closest(".es-canvas"):!1}var Mw=null,Hw=new Set;function Voe(){return Mw}function Uw(e){if(e!==Mw){Mw=e;for(let o of Hw)o()}}function Yoe(e){return Hw.add(e),()=>{Hw.delete(e)}}function JB(){return Uoe(Yoe,Voe,()=>null)}function QB(e,o){if(e.outer)return null;let t=o.getItemById(e.ownerId);if(!t)return null;let r=o_(t.type);return!r||eo(t.props)?null:{node:t,rows:r}}function Qoe(e,o){let t=QB(e,o),r=o.getItemById(e.nodeId);if(!t||!r)return null;let a=i_(r.type,r.props,e.key);if(!a)return null;let n=t.node.props[t.rows];return!Array.isArray(n)||e.index<0||e.index>=n.length?null:qoe(e.ownerId,Yr(t.rows,{index:e.index,rowKey:a}))}function sh(e,o){let t=Qoe(e,o);return t?ah(t,o):null}function eN(e,o){return sh(e,o)?.value}function oN(e,o){let t=sh(e,o);return t?(t.write(e.text),!0):!1}function tN(e,o){let t=QB(e,o),r=t&&o.getSelectorForId(e.ownerId);if(!t||!r)return!1;let a=t.node.props,n=a[t.rows],s=e.index;if(!Array.isArray(n)||s<0||s>=n.length)return!1;let i;switch(e.action){case"addAfter":{let l=o.components[t.node.type]?.fields?.[t.rows];i=Xoe(n,s+1,{...l?.defaultItemProps??{}});break}case"moveEarlier":case"moveLater":{let l=e.action==="moveEarlier"?s-1:s+1;if(l<0||l>=n.length)return!1;i=Zoe(n,s,l);break}case"delete":i=Joe(n,s);break;default:return!1}return o.replace(r.zone,r.index,{...t.node,props:{...a,[t.rows]:i}}),!0}import{jsx as $e,Fragment as Sbe,jsxs as cI}from"react/jsx-runtime";import{Fragment as wbe,useEffect as JG,useMemo as QG,useRef as Cbe,useState as Ks}from"react";import{useScreenDocument as aj}from"efficient-easel/screen/components/ScreenDocumentContext";import{UiIcon as hP}from"efficient-easel/draw/client";import vbe from"efficient-easel/screen/components/SidePanelHead";import{jsx as Pe,Fragment as ml,jsxs as gs}from"react/jsx-runtime";import{useEasel as GD,useRootFields as Bae}from"efficient-easel/easel";import{Inspector as Nae}from"efficient-easel/fields";import{SettingsGroup as Dae}from"efficient-easel/panel";import{useEffect as Mae,useRef as Hae,useState as HC}from"react";import{jsx as fs,Fragment as rte,jsxs as ate}from"react/jsx-runtime";import{useState as sN}from"react";import{SettingsDefaultReset as nte,SettingsField as ste}from"efficient-easel/panel";import{useEaselStrings as ite}from"efficient-easel/strings";import{AddIcon as lte}from"efficient-easel/icons";import{Button as cte}from"efficient-shell/ui";import{iconOf as dte,noGlyph as fte}from"efficient-easel/screen/lib/document/box-fields";import{jsx as ih,Fragment as ete,jsxs as rN}from"react/jsx-runtime";import{Button as aN,Dialog as ote}from"efficient-shell/ui";function tte(e){return st("This site has {n} color theme of its own. Clearing takes them away and puts back the four the shop supplies.","This site has {n} color themes of its own. Clearing takes them away and puts back the four the shop supplies.",e)}function nN({count:e,onCancel:o,onConfirm:t}){return rN(ote,{open:!0,onClose:o,role:"alertdialog",size:"sm",title:c("Clear this site\u2019s colors?"),footer:rN(ete,{children:[ih(aN,{variant:"secondary",onClick:o,children:c("Cancel")}),ih(aN,{variant:"danger",onClick:t,children:c("Clear colors")})]}),children:[ih("p",{children:tte(e)}),ih("p",{className:"mt-2 font-medium",children:c("This cannot be undone.")})]})}var pte=fte("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"),ute="Reset color",mte={selected:0,themes:[]};function hte(e){e(mte)}function iN({value:e,onChange:o}){let t=e?.themes??[],r=t.length===0,a=vo(e),[n,s]=sN(!1),i=ite(),[l,d]=sN(null),f=(S,v)=>{o({...a,themes:a.themes.map((b,y)=>y===S?v:b)})},u=yi(a).accent,p=new Set(a.themes.map(S=>S.brandInk).filter(Boolean)),m=g_.filter(S=>!p.has(S)).map(S=>I_(u,S)),h=[...a.themes,...m],I=S=>{if(S<a.themes.length)return o({...a,selected:S});let v=[...a.themes,h[S]];o({...a,themes:v,selected:v.length-1})},w=()=>{let S=[...a.themes,{...ht(a.themes[a.selected])}];o({...a,themes:S,selected:S.length-1}),d(S.length-1)};return ate(rte,{children:[r?null:fs(ste,{label:c(ute),icon:dte(pte),labelId:"sf-theme-reset",action:fs(nte,{label:c("all theme colors"),words:i.panel,changed:!0,onReset:()=>s(!0)})}),n&&fs(nN,{count:t.length,onCancel:()=>s(!1),onConfirm:()=>{s(!1),hte(o)}}),fs("div",{className:"sf-theme-list",role:"radiogroup","aria-label":c("Theme"),children:h.map((S,v)=>fs(im,{index:v,colors:S,selected:v===a.selected,open:l===v&&v<a.themes.length,editable:v<a.themes.length,onPick:()=>I(v),onEdit:()=>d(b=>b===v?null:v),onChangeColors:b=>f(v,b)},v))}),fs(cte,{variant:"secondary",leftIcon:fs(lte,{}),onClick:w,className:"sf-theme-add",children:c("Add new theme")})]})}import{jsx as lh}from"react/jsx-runtime";import{SettingsDefaultReset as xte,SettingsField as gte}from"efficient-easel/panel";import{SquareIcon as Ite}from"efficient-easel/icons";var yte="Applies to panels, cards, inputs and buttons. Round things \u2014 color swatches, switches, status dots \u2014 stay round.",zw="Corners";function lN({value:e,onChange:o,length:t}){let r=e===null;return lh(gte,{label:c(zw),icon:lh(Ite,{}),changed:!r,action:lh(xte,{words:ce()?.panel,label:c(zw),changed:!r,detail:c("the built-in corners"),onReset:()=>o(null)}),hint:c(yte),children:lh(yt,{min:t?.grid.min??nt,max:t?.grid.max??Ha,step:t?.grid.step??1,value:e,...e===null?{}:{suffix:t?.unit??"px",...t?{units:t.units}:{}},placeholder:nt,placeholderWord:"Auto",onClear:()=>o(null),ariaLabel:c(zw),onChange:o})})}import{jsx as Cd}from"react/jsx-runtime";import{SettingsDefaultReset as bte,SettingsField as Ste}from"efficient-easel/panel";import{IconPicker as wte}from"efficient-shell/ui";import{ShadowIcon as Cte}from"efficient-easel/icons";import{SHADOW_PREVIEW as vte}from"efficient-easel/screen/lib/document/shadow-values";var Gw={none:"None",soft:"Soft",lifted:"Lifted"},kte="Applies to cards \u2014 products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.";function cN({value:e,onChange:o}){let t=e===null,r=e??Ly;return Cd(Ste,{label:c("Card shadow"),icon:Cd(Cte,{}),value:c(Gw[r]),changed:!t,action:Cd(bte,{words:ce()?.panel,label:c("Card shadow"),changed:!t,detail:c(Gw[Ly]),onReset:()=>o(null)}),hint:c(kte),children:Cd(wte,{label:c("Card shadow"),value:r,options:F_.map(a=>({value:a,label:c(Gw[a]),icon:Cd("span",{className:"sf-shadow-chip border border-line bg-surface",style:{boxShadow:vte[a]}})})),onChange:o})})}import{jsx as dN}from"react/jsx-runtime";import{ShadowIcon as Tte}from"efficient-easel/icons";import{DEFAULT_SHADOW_COLOR as fN}from"efficient-easel/screen/lib/document/shadow-values";var Pte="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 pN({value:e,onChange:o}){let t=e===null;return dN(Vc,{label:c("Shadow color"),icon:dN(Tte,{}),value:e??"",inherited:fN,resetTo:fN,onChange:o,onReset:()=>o(null),hint:c(Pte)})}import{jsx as dh}from"react/jsx-runtime";import{SettingsDefaultReset as Ete,SettingsField as _te}from"efficient-easel/panel";import{AlignSeparateIcon as Ote}from"efficient-easel/icons";function ch(e,o){return e==="tablet"?null:e==="mobile"?o.phone:o.desktop}var Ate="The space between the blocks inside a row, a grid or a box. Auto means each one keeps the spacing it already has.",Rte="The space between the blocks inside a row, a grid or a box, on a phone. Until you set it, a phone uses half the desktop gap.",jw="Block gap",uN=ji.Grid;function mN(e,o){return ch(e,{desktop:{key:"block_gap",value:o.gap,followsPx:null},phone:{key:"block_gap_phone",value:o.phone,followsPx:o.gap===null?null:NS(o.gap)}})}function hN({value:e,onChange:o,followsPx:t=null,length:r,followsUnit:a="px"}){let n=e===null,s=t===null?null:`${t}${a}`,i=a==="px"&&(r?.unit??"px")==="px",l=t===null?uN:i?nd(t)??uN:t;return dh(_te,{label:c(jw),labelId:"sf-block-gap",icon:dh(Ote,{}),changed:!n,action:dh(Ete,{words:ce()?.panel,label:c(jw),changed:!n,detail:s??c("each block's own spacing"),onReset:()=>o(null)}),hint:c(s===null?Ate:Rte),children:dh(yt,{min:(r?.grid??jt).min,max:(r?.grid??jt).max,step:(r?.grid??jt).step,value:e,...e===null&&t===null?{}:{suffix:r?.unit??"px",...r?{units:r.units}:{}},placeholder:l,...t===null?{placeholderWord:"Auto"}:i&&t===l?{}:{placeholderWord:String(t)},onClear:()=>o(null),ariaLabel:c(jw),onChange:o})})}import{jsx as fh}from"react/jsx-runtime";import{SettingsDefaultReset as Lte,SettingsField as Fte,SettingsSegmented as Bte}from"efficient-easel/panel";import{HoverIcon as Nte}from"efficient-easel/icons";var Kw={none:di.none,lift:di.lift,highlight:aE},Dte="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 xN({value:e,onChange:o}){let t=e===null,r=e??Fy;return fh(Fte,{label:c("Hover effect"),icon:fh(Nte,{}),value:c(Kw[r]),changed:!t,action:fh(Lte,{words:ce()?.panel,label:c("Hover effect"),changed:!t,detail:c(Kw[Fy]),onReset:()=>o(null)}),hint:c(Dte),children:fh(Bte,{options:B_.map(a=>({id:a,label:c(Kw[a])})),value:r,ariaLabel:c("Hover effect"),onChange:o})})}import{jsx as ph}from"react/jsx-runtime";import{SettingsDefaultReset as Mte,SettingsField as Hte,SettingsSegmented as Wte}from"efficient-easel/panel";import{DropIcon as $te}from"efficient-easel/icons";var Vw="Photography",gN={shot:"As shot",mono:"Black and white"},Yw=[{grayscale:!1,label:gN.shot},{grayscale:!0,label:gN.mono}],Ute="Black and white photographs return to color on hover. Wheels and tyres keep their real finish either way.";function IN({value:e,onChange:o}){let t=e===null,r=e??!1;return ph(Hte,{label:c(Vw),icon:ph($te,{}),value:c(Yw.find(a=>a.grayscale===r).label),changed:!t,action:ph(Mte,{words:ce()?.panel,label:c(Vw),changed:!t,detail:c(Yw.find(a=>!a.grayscale).label),onReset:()=>o(null)}),hint:c(Ute),children:ph(Wte,{options:Yw.map(a=>({id:a.grayscale,label:c(a.label)})),value:r,ariaLabel:c(Vw),onChange:o})})}import{jsx as qw}from"react/jsx-runtime";import{useId as zte}from"react";import{SettingsField as Gte,SettingsSwitch as jte}from"efficient-easel/panel";import{ShareIcon as Kte}from"efficient-easel/icons";var Vte="Share button",Yte="On every blog post.";function yN({value:e,onChange:o}){let t=zte();return qw(Gte,{label:c(Vte),labelId:t,icon:qw(Kte,{}),action:qw(jte,{checked:e===!0,onChange:o,ariaLabelledBy:t}),hint:c(Yte)})}import{usePreviewDevice as WC}from"efficient-easel/draw/client";import{jsx as uh}from"react/jsx-runtime";import{SettingsDefaultReset as qte,SettingsField as Xte}from"efficient-easel/panel";import{PaddingXIcon as Zte}from"efficient-easel/icons";var Xw="Side space",bN=ct.default,Jte="The room left at the left and right edge of every page.";function SN(e,o){return ch(e,{desktop:{key:"site_gutter",value:o.gutter,unsetPx:bN,bounds:ct},phone:{key:"site_gutter_phone",value:o.phone,unsetPx:ym(o.gutter,o.gutterUnit),bounds:gr}})}function wN({value:e,onChange:o,unsetPx:t=bN,bounds:r=ct,length:a,restsOn:n=t}){let s=e===null;return uh(Xte,{label:c(Xw),labelId:"sf-side-space",icon:uh(Zte,{}),changed:!s,action:uh(qte,{words:ce()?.panel,label:c(Xw),changed:!s,detail:`${t}px`,onReset:()=>o(null)}),hint:c(Jte),children:uh(yt,{min:(a?.grid??r).min,max:(a?.grid??r).max,step:(a?.grid??r).step,value:e,suffix:a?.unit??"px",...a?{units:a.units}:{},placeholder:n,onClear:()=>o(null),ariaLabel:c(Xw),onChange:o})})}import{jsx as Zw}from"react/jsx-runtime";import{BACKGROUND_WIDTHS as q2e,SettingsBackgroundWidth as Qte,SettingsContentWidth as ere}from"efficient-easel/panel";var ore="Background width",Jw="Content width";var mh=e=>c(rs[e==="content"?"page":"full"]),CN="The width of every section's background.",vN="The width of every section's content.";function hh({value:e,changed:o,detail:t,onChange:r,onReset:a,hint:n,labelId:s}){return Zw(Qte,{value:e,changed:o,detail:t,onChange:r,onReset:a,hint:n?c(n):void 0,labelId:s,words:{label:c(ore),full:mh("full"),content:mh("content")},resetWords:ce()?.panel})}function xh({mode:e,px:o,max:t=je.max,min:r=je.min,changed:a,detail:n,fullClosed:s,onMode:i,onPx:l,onReset:d,hint:f,labelId:u,length:p}){let m=c(Jw),h=p?.grid.min??r,I=p?.grid.max??t,w=e!=="full"?Zw(yt,{min:h,max:I,step:p?.grid.step??je.step,value:Math.min(Math.max(o,h),I),onChange:l,...p?{suffix:p.unit,units:p.units}:{suffix:"px"},ariaLabel:m}):null;return Zw(ere,{mode:e,onMode:i,number:w,changed:a,detail:n,fullClosed:s,onReset:d,hint:f?c(f):void 0,labelId:u,words:{label:m,full:mh("full"),content:mh("content")},resetWords:ce()?.panel})}import{jsx as yD}from"react/jsx-runtime";import{TextStyleItem as sae,TextStylesGroup as iae}from"efficient-easel/text-styles";import{jsx as eae}from"react/jsx-runtime";import{useState as oae}from"react";import{TextStylesList as tae}from"efficient-easel/text-styles";import{usePreviewDevice as rae}from"efficient-easel/draw/client";import{defaultTextStyles as tD,textStyleCaseCss as Yre}from"efficient-easel/text-styles/model";import{resolveViewValue as rD}from"efficient-easel/draw";import{VIEW_DESKTOP_MIN as kN,VIEW_TABLET_MIN as TN}from"efficient-easel/draw";var gh=.02,PN=`(min-width: ${Xo}px) and (max-width: ${kN-gh}px)`,vd=`(max-width: ${Xo-gh}px)`,Ih=`(min-width: ${TN}px) and (max-width: ${kN-gh}px)`,yh=`(max-width: ${TN-gh}px)`;import{textStyleCaseCss as tre,textStyleCaseOfCss as rre,viewKeyAt as FN}from"efficient-easel/draw";function ll(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function cl(e,o){return ll(e?.[o])??{}}function bh(e,o,t){let r=cl(e,o);return ll($(r,t))??{}}function Sh(e,o,t,r){let{[t]:a,...n}=cl(e,o),s=r?{...n,[t]:r}:n,{[o]:i,...l}=e;return Object.keys(s).length?{...l,[o]:s}:l}import{isLengthUnit as aC}from"efficient-easel/screen/lib/content/length-units";var Pd="_partStyles",nC="data-sf-part-styled",vr="data-sf-text-style",are=/^(heading|body)-[1-7]$/;function wa(e){return typeof e=="string"&&are.test(e)}var wh={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function nre(e){if(!e)return null;for(let[o,t]of Object.entries(wh))if(t===e)return o;return null}function sC(e){if(wa(e.textStyle))return e.textStyle;let o=aa(e.role);return o?wh[o]:void 0}var sre=[400,500,600,700],Td=["left","center","right","justify"],Qw=5,eC=1e3,ire=-5,lre=10,iC=0,lC=64,cC=2,EN={size:{min:Qw,max:eC,step:1},sizeTablet:{min:Qw,max:eC,step:1},sizePhone:{min:Qw,max:eC,step:1},padding:{min:iC,max:lC,step:cC}},cre=.05,dre=.01,fre=["line","letter"],pre=.5,ure=2.5,mre=-1,hre=1,xre=0,gre=400,Ire=[...new Set(Object.values(ci))];function BN(e){return[`${e} { transition: translate var(--page-motion-hover-duration) var(--page-ease-media) var(--page-motion-hover-delay) }`,`${e}:hover, ${e}:active { translate: 0 calc(-1 * var(--page-hover-lift)) }`]}function NN(e){return cl(e,Pd)}function ms(e,o){return bh(e,Pd,o)}function DN(e,o,t){return Sh(e,Pd,o,yre(t).length?t:null)}function yre(e){return Object.entries(e).filter(([,o])=>o!==void 0)}function bre(e){return fre.includes(e)}var kd=(e,o,t)=>Math.min(t,Math.max(o,e)),Sre=["sizeUnit","sizeUnitTablet","sizeUnitPhone"];function oC(e){let o=FN("sizeUnit",e),t=Sre.find(r=>r===o);if(!t)throw new Error(`a part stores no unit key ${o}`);return t}var Vt={size:oC("desktop"),sizeTablet:oC("tablet"),sizePhone:oC("mobile"),paragraphSpacing:"paragraphSpacingUnit",padding:"paddingUnit"},MN=Object.values(Vt);function Xr(e,o){return Ee(e[Vt[o]])}function wre(e,o,t={}){if(MN.includes(e))return aC(o)&&o!=="px"?o:null;if(He(Vt,e)&&Xr(t,e)!=="px"){let r=us(Number(o),2);return!Number.isFinite(r)||r<0||r===0&&e!=="padding"?null:r}if(bre(e)){let r=Math.round(Number(o));return!Number.isFinite(r)||r===0?null:kd(r,ire,lre)}if(e==="lineHeight"){let r=Number(o);return Number.isFinite(r)?us(kd(r,pre,ure),3):null}if(e==="letterSpacing"){let r=Number(o);return Number.isFinite(r)?us(kd(r,mre,hre),4):null}if(e==="paragraphSpacing"){let r=Math.round(Number(o));return!Number.isFinite(r)||r<=0?null:kd(r,xre,gre)}if(He(EN,e)){let{min:r,max:a}=EN[e],n=Math.round(Number(o));return Number.isFinite(n)?kd(n,r,a):null}return e==="italic"?typeof o=="boolean"?o:null:e==="role"||e==="fontRole"?aa(o)?o:null:e==="sizeToken"?dC(o)?o:null:e==="textStyle"?wa(o)?o:null:e==="alignPhone"||e==="alignTablet"?Td.includes(o)?o:null:o}var Cre=["weight","size","sizeTablet","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function dl(e){let o=null,t=r=>{o??={...e},delete o[r]};for(let r of Cre){let a=e[r];a!==void 0&&!(typeof a=="number"&&Number.isFinite(a))&&t(r)}e.align!==void 0&&!Td.includes(e.align)&&t("align"),e.alignTablet!==void 0&&!Td.includes(e.alignTablet)&&t("alignTablet"),e.alignPhone!==void 0&&!Td.includes(e.alignPhone)&&t("alignPhone"),e.textStyle!==void 0&&!wa(e.textStyle)&&t("textStyle"),e.sizeToken!==void 0&&!dC(e.sizeToken)&&t("sizeToken"),e.fontRole!==void 0&&!aa(e.fontRole)&&t("fontRole");for(let r of MN)e[r]!==void 0&&!aC(e[r])&&t(r);return o??e}function dC(e){if(!e||typeof e!="object")return!1;let{step:o,px:t,stepPhone:r,pxPhone:a,fluid:n}=e,s=l=>typeof l=="number"&&Number.isFinite(l)&&l>0,i=l=>typeof l=="string"&&Ire.includes(l);return i(o)&&s(t)&&(r===void 0||i(r))&&(a===void 0||s(a))&&(n===void 0||vre(n,t))}function vre(e,o){if(!e||typeof e!="object"||Array.isArray(e))return!1;let{minPx:t,vw:r,...a}=e;return Object.keys(a).length===0&&typeof t=="number"&&Number.isFinite(t)&&t>0&&t<o&&typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=100}function fC(e){return e?.pxPhone&&dC(e)?{step:e.stepPhone??e.step,px:e.pxPhone}:null}function HN({step:e,px:o,fluid:t}){let r=t?`clamp(${t.minPx}px, ${t.vw}vw, ${o}px)`:`${o}px`,a=`var(--size-${e}, ${r})`;return e.startsWith("heading")?`min(${a}, var(--sf-heading-max,9999px))`:a}var kre=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Tre(e){let o=[];for(let[t,r]of kre)t===e?o.push(r):r===e&&o.push(t);return o}function hs(e,o,t,r){let a={...ms(e,o)},n=r==null?null:wre(t,r,a);if(n===null)delete a[t];else{a[t]=n;for(let s of Tre(t))delete a[s]}return DN(e,o,a)}function WN(e,o){return DN(e,o,{})}function Pre(e){return rre(e)??"none"}function Ere(e){return tre(e)??""}var _N={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function _re(e,o){return aa(e.role)||(o?.blockDrawsStyle?null:nre(e.textStyle))}function Ed(e,o){return e==="Text"&&o==="text"}var Ore={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Are(e){let o=ci[e],t=$(Ore,o);return t?`var(--size-${o}, ${t})`:`var(--size-${o})`}function _d(e){let o={};return typeof e.lineHeight=="number"?o.lineHeight=e.lineHeight:e.line&&(o.lineHeight=us(Rre+e.line*cre,3)),typeof e.letterSpacing=="number"?o.letterSpacingEm=e.letterSpacing:e.letter&&(o.letterSpacingEm=us(e.letter*dre,4)),o}var Rre=1,ps="--sf-part-para";function Lre(e){e=dl(e);let o={};if(typeof e.sizePhone=="number"&&e.sizePhone>0)o.fontSize=Me(e.sizePhone,Xr(e,"sizePhone"));else{let r=fC(e.sizeToken);if(r)o.fontSize=HN(r);else{let a=vh(e);a!==void 0&&(o.fontSize=Me(a,Xr(e,"sizeTablet")))}}let t=e.alignPhone??Ch(e);return t&&(o.textAlign=t),o}function Ch(e){return e.alignTablet&&e.alignTablet!==e.align?e.alignTablet:void 0}function vh(e){let o=e.sizeTablet!==void 0&&Xr(e,"sizeTablet")!==Xr(e,"size")?e.sizeTablet:sa("textSize",e.size,e.sizeTablet,void 0).tablet;return o&&o>0?o:void 0}function Fre(e){let o=dl(e),t={},r=vh(o);r!==void 0&&(t.fontSize=Me(r,Xr(o,"sizeTablet")));let a=Ch(o);return a&&(t.textAlign=a),t}function $N(e,o){if(o==="desktop")return;let t=dl(e);return(o==="mobile"?Ch(t):void 0)??t.align}function Bre(e,o){if(o==="desktop")return e;let t=dl(e),r=vh(t),a=Ch(t);if(o==="tablet"){let i=e;return r!==void 0&&(i={...i,size:r,sizeUnit:t[Vt.sizeTablet]}),a&&(i={...i,align:a}),i}let n=e;if(typeof t.sizePhone=="number"&&t.sizePhone>0)n={...n,size:t.sizePhone,sizeUnit:t[Vt.sizePhone]};else{let i=fC(t.sizeToken);i?n={...n,size:void 0,sizeToken:i}:r!==void 0&&(n={...n,size:r,sizeUnit:t[Vt.sizeTablet]})}let s=t.alignPhone??a;return s&&(n={...n,align:s}),n}function pC(e,o,t){return mC(Bre(e,o),kh,t)}function uC(e){return FN("size",e)}function UN(e,o){if(o==="desktop")return null;let t=dl(e);if(o==="mobile"){if(fC(t.sizeToken))return null;let r=vh(t);if(r!==void 0)return{px:r,view:"tablet"}}return typeof t.size=="number"&&t.size>0?{px:t.size,view:"desktop"}:null}function zN(e,o){let t=uC(o);if(!He(e,t))return e;let r={...e};return delete r[t],r}function GN(e,o,t){let r=pC(zN(e,o),o,t);return{fontFamily:r.fontFamily,fontSize:r.fontSize}}function mC(e,o,t){e=dl(e);let r=_re(e,t),a=_d(e),n=e.size?Me(e.size,Xr(e,"size")):e.sizeToken?HN(e.sizeToken):r?Are(r):"";return{fontFamily:e.font?Hre(e.font):e.fontRole?`var(${_N[e.fontRole]})`:r?`var(${_N[r]})`:"",fontWeight:e.weight?String(e.weight):"",fontSize:n,minWidth:n?"0":"",overflowWrap:n?"break-word":"",lineHeight:a.lineHeight!==void 0?String(a.lineHeight):"",letterSpacing:a.letterSpacingEm!==void 0?`${a.letterSpacingEm}em`:"",[ps]:e.paragraphSpacing?Me(e.paragraphSpacing,Xr(e,"paragraphSpacing")):"",textTransform:Ere(e.case),textAlign:e.align??"",paddingTop:ON(e.padding,Xr(e,"padding")),paddingBottom:ON(e.padding,Xr(e,"padding")),color:Nre(e.color),fontStyle:e.italic===!0?"italic":e.italic===!1?"normal":""}}var Nre=e=>Fi(e),ON=(e,o)=>e===void 0?"":Me(e,o),us=(e,o)=>Number(e.toFixed(o));function jN(e,o){let t=Number.parseFloat(e.fontSize)||16,r=Number.parseFloat(e.lineHeight),a=Number.parseFloat(e.letterSpacing),n=Number.parseFloat(e.paddingTop);return{fontKey:o,sizePx:t,weight:Dre(Number.parseInt(e.fontWeight,10)),lineRatio:Number.isFinite(r)?us(r/t,3):1.2,letterEm:Number.isFinite(a)?us(a/t,4):0,align:Mre(e.textAlign),case:Pre(e.textTransform),paddingPx:Number.isFinite(n)?Math.round(n):0}}function Dre(e){return Number.isFinite(e)?sre.reduce((o,t)=>Math.abs(t-e)<Math.abs(o-e)?t:o):400}function Mre(e){for(let o of Td)if(o===e)return o;return e==="end"?"right":"left"}function KN(e,o){let t=AN(e);if(!t)return"";for(let r of Na)if(AN(o(r.cssVar))===t)return r.key;return""}var AN=e=>(e.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Hre(e){let o=li(e);return o?`var(${o.cssVar})`:""}function VN(e,o,t,r){return!o||Id(o)?.nodeId!==e?null:t.find(a=>r(a.getAttribute("class")))??t[0]??null}function hC(e,o){return ll($(e,o))??{}}function xC(e,o,t=()=>kh,r=i=>i,a=Ure,n="desktop",s=()=>!1){let i=0;for(let{element:l,partId:d}of e){let f=Id(d)?.propKey;if(!f)continue;let u=hC(o,r(f)),p=pC(u,n,{blockDrawsStyle:s(f)});wa(u.textStyle)?l.setAttribute?.(vr,u.textStyle):l.removeAttribute?.(vr);let m=tC.some(I=>l.style[I]),h=!1;for(let[I,w]of Object.entries(p))zre(l,I,w),w&&(h=!0);if(m||tC.some(I=>p[I]))for(let I of Wre(l,a))for(let w of tC)I.style[w]=p[w]??"";h&&(i+=1)}return i}function Wre(e,o){let t=rn(e.textContent??""),r=[],a=e;for(let n=0;n<$re&&o(a);n+=1){let s=a.parentElement;if(!s||rn(s.textContent??"")!==t)break;r.push(s),a=s}return r}var $re=8;function Ure(e){let o=e;return typeof window>"u"||!o?.ownerDocument?!1:window.getComputedStyle(o).display==="inline"}var kh={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function gC(e){if(!e||typeof e!="object")return null;let o={};wa(e.textStyle)&&(o.textStyle=e.textStyle),typeof e.size=="number"&&e.size>0&&(o.size=e.size),typeof e.sizeTablet=="number"&&e.sizeTablet>0&&(o.sizeTablet=e.sizeTablet),typeof e.sizePhone=="number"&&e.sizePhone>0&&(o.sizePhone=e.sizePhone);for(let t of["size","sizeTablet","sizePhone"]){let r=Vt[t];o[t]!==void 0&&aC(e[r])&&(o[r]=e[r])}return Object.keys(o).length?o:null}function IC(e,o){let t=gC(e);if(!t)return{};let r=pC(t,o);return{...r.fontFamily?{fontFamily:r.fontFamily}:{},...r.fontSize?{fontSize:r.fontSize}:{}}}function YN(e){return wa(e?.textStyle)||!!e?.role||typeof e?.size=="number"&&e.size>0}function qN(e,o,t){if(!e||typeof e!="object")return{};let r=Np(e.role,o,ci)??{},a=o.sized?IC(zN(e,t),t):{};return{...r,...a}}function XN(e,o,t){t.fontFamily&&e.fontFamily===t.fontFamily&&(e.fontFamily=o.fontFamily),t.fontSize&&e.fontSize===t.fontSize&&(e.fontSize=o.fontSize)}function zre(e,o,t){if(!o.startsWith("--")){e.style[o]=t;return}let r=e.style;typeof r.setProperty=="function"?t?r.setProperty(o,t):r.removeProperty?.(o):r[o]=t;let a=e;o===ps&&(t?a.setAttribute?.(RN,""):a.removeAttribute?.(RN))}var RN="data-sf-part-para",Th=Object.keys(mC({},kh)),rC=new Set(["color","overflowWrap",ps,"fontStyle"]),tC=Th.filter(e=>!rC.has(e));function ZN(e,o,t,r=i=>i,a=()=>!1,n=()=>null,s=[]){let i=new Map;for(let u of e){let p=Yr(u.key,u.row);for(let m of u.texts){let h=i.get(m);h?(h.keys.add(u.key),h.partKeys.add(p)):i.set(m,{keys:new Set([u.key]),partKeys:new Set([p])})}}let l=new Map;for(let u of new Set([...Object.keys(o),...s])){if(!Gre(u))continue;let p=LN(t,u,ll(o[u])??{},!1,n(u));p&&l.set(u,p)}let d=u=>{let p=r(u),m=n(p);if(!He(o,p)&&!m)return null;let h=ll(o[p])??{};return LN(t,u,h,a(u),m)},f=new Map;for(let[u,{keys:p,partKeys:m}]of i){let h=m.size===1?[...m][0]:p.size===1?[...p][0]:null;if(!h)continue;let I=d(h);I&&f.set(u,I)}for(let u of e){if(!u.keyed)continue;let p=d(Yr(u.key,u.row));p&&l.set(u.key,p)}return f.size||l.size?{rules:f,kindRules:l,drawn:new Set(i.keys())}:null}function LN(e,o,t,r,a){let n=mC(t,kh,{blockDrawsStyle:r}),s=Fre(t),i=Lre(t),l=wa(t.textStyle)?t.textStyle:void 0;return!Object.values(n).some(Boolean)&&!Object.keys(s).length&&!Object.keys(i).length&&!l&&!a?null:{stamp:jre(e,o),declarations:n,...Object.keys(s).length?{tablet:s}:{},...Object.keys(i).length?{phone:i}:{},...l?{textStyle:l}:{},...a?{motion:a}:{}}}function Gre(e){return e.startsWith("@")}function yC(e,o){return e?.kindRules.get(o)??null}function jre(e,o){let t=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${t(e)}~${t(o)}`}function bC(e){return e?{tablet:PN,phone:vd}:{tablet:Ih,phone:yh}}function JN(e,{inBox:o=!1}={}){let{tablet:t,phone:r}=bC(o),a=[],n=new Set,s=i=>{let{stamp:l,declarations:d}=i;if(n.has(l))return;n.add(l);let f=Object.entries(d).filter(([,S])=>S!==""),u=S=>S.map(([v,b])=>`${Kre(v)}: ${b}`).join("; "),p=`[${nC}="${l}"]`,m=f.filter(([S])=>!rC.has(S)),h=f.filter(([S])=>rC.has(S));m.length&&a.push(`${p}, *:has(> ${p}) { ${u(m)} }`),h.length&&a.push(`${p} { ${u(h)} }`),d[ps]&&(a.push(`*:has(> ${p}) { ${ps}: ${d[ps]} }`),a.push(...Ph(p,`*:has(> ${p})`)));let I=Object.entries(i.tablet??{}).filter(([,S])=>S!=="");I.length&&a.push(`@media ${t} { ${p}, *:has(> ${p}) { ${u(I)} } }`);let w=Object.entries(i.phone??{}).filter(([,S])=>S!=="");w.length&&a.push(`@media ${r} { ${p}, *:has(> ${p}) { ${u(w)} } }`)};for(let i of e.rules.values())s(i);for(let i of e.kindRules.values())s(i);return a.join(`
3
3
  `)}function Ph(e,o){let t=`var(${ps})`,r=":is([data-sf-bullet], [data-sf-number])";return[`${e} br:not(br + br) { display: block; content: ""; margin-top: ${t} }`,`${e} ${r}:not(:first-child) { margin-top: ${t} }`,`${e} ${r}:not(:last-child) { margin-bottom: ${t} }`,`:is(${o}) + :is(${o}) { margin-top: ${t} }`]}var Kre=e=>e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);function QN(e,o){if(!e)return null;let t=rn(o),r=e.rules.get(t);if(r)return r;if(t.length<Vre||e.drawn.has(t))return null;let a=null;for(let[n,s]of e.rules)if(n.includes(t)){if(a&&a.stamp!==s.stamp)return null;a=s}return a}var Vre=8;function eD(e){switch(e.id){case"heading-1":return"font-display";case"heading-2":return"font-heading2";case"heading-3":return"font-heading3";case"body-1":return"font-body";case"body-5":return"font-mono";default:return`font-${e.id}`}}var SC=e=>e==="sentence"?"none":void 0,aD=["font","color","size","sizeTablet","sizePhone","weight","italic","lineHeight","lineHeightTablet","lineHeightPhone","letterSpacing","letterSpacingTablet","letterSpacingPhone","paragraphSpacing","paragraphSpacingTablet","paragraphSpacingPhone","letterCase","largestSize","largestSizeTablet","largestSizePhone"],fl=["desktop","tablet","phone"],xs=(e,o)=>ke(e,o);function vC(e,o,t,r=pi()){return rD("textSize",o,e.sizeTablet,e.sizePhone,r)[t]}var qre=[["lineSpacing","lineHeight","line"],["letterSpacing","letterSpacing","letter"]];function wC(e){for(let[o,t,r]of qre)for(let a of fl)if(e===xs(o,a))return{key:ke(t,a),view:a,spacing:r};return{key:e,view:"desktop",spacing:null}}function Zr(e){let o={};for(let t of aD)e[t]!==void 0&&(o[t]=e[t]);return o}function kC(e,o){let{auto:t,...r}=e,a=new Set(o??[]),n=aD.filter(s=>a.has(s)&&e.values[s]===void 0);return n.length?{...r,auto:n}:r}function nD(e){let o=e.fonts,t=e.sizes,r=e.typography,a=$_(e.compression),n={"heading-1":{font:be(o.heading),size:q(t.headingLarge),weight:q(r.weight),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:SC(r.case),largestSize:q(r.maxPx)},"heading-2":{font:be(o.heading2),size:q(t.headingMedium),weight:q(r.weight2),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:SC(r.case2)},"heading-3":{font:be(o.heading3),size:q(t.headingSmall),weight:q(r.weight3),lineHeight:a.lineHeight,letterSpacing:a.letterSpacing,letterCase:SC(r.case3)},"body-1":{font:be(o.body),size:q(t.body)},"body-5":{font:be(o.label),size:q(t.label)}};return tD().map(({id:s,kind:i,name:l})=>({id:s,kind:i,name:l,values:Zr(n[s]??{})}))}function TC(e){return Array.isArray(e)&&e.every(o=>o&&typeof o=="object"&&typeof o.id=="string"&&(o.kind==="heading"||o.kind==="body")&&typeof o.name=="string")?e.map(o=>kC({...o,values:Zr(o.values??{})},Array.isArray(o.auto)?o.auto:void 0)):null}function sD(e){return TC(e)??[]}function iD(e){return TC(e)??tD().map(({id:o,kind:t,name:r})=>({id:o,kind:t,name:r,values:{}}))}function Ca(e,o){let t=nD(o),r=TC(e);return r?r.map(a=>{let n={...CC(t,a.id)};for(let s of a.auto??[])delete n[s];return{...a,values:Zr({...n,...a.values})}}):t}var CC=(e,o)=>e.find(t=>t.id===o)?.values??{},oD=["heading-1","heading-2","heading-3"];function lD({saved:e,old:o,cur:t,next:r,sizeOf:a,panelView:n="desktop"}){let s=nD(o),i=iD(e),l=Ca(i,o),d=[],f=r.map(p=>{let m=t.find(k=>k.id===p.id),h=i.find(k=>k.id===p.id);if(!m||!h){let k=Xre([p],a,n)[0],L=k.values.color;return L===void 0?k:{...k,values:{...k.values,color:Et(L)}}}let I={...h.values},w=new Set(h.auto??[]),S=p.values,v=m.values,b=[...new Set([...Object.keys(S),...Object.keys(v)])].filter(k=>JSON.stringify(S[k])!==JSON.stringify(v[k])),y=k=>wC(k).spacing==="letter";b.sort((k,L)=>Number(y(k))-Number(y(L)));for(let k of b){let{key:L,view:O,spacing:D}=wC(k),T=L,F=S[k];if(F===void 0){delete I[T],CC(s,p.id)[T]!==void 0&&(d.push([p.id,T]),w.add(T));continue}if(w.delete(T),D==="line")I[T]=pl(F/100,3);else if(D==="letter"){let C={...l.find(_=>_.id===p.id)?.values??{}};for(let _ of b)S[_]===void 0&&delete C[wC(_).key];let R=Zr({...C,...I}),P=vC(R,a({...p,values:R}),O);I[T]=P?pl(F/P,4):0}else I[T]=F}return kC({id:p.id,kind:p.kind,name:p.name,values:Zr(I)},w)}),u=o.compression;if(d.some(([p,m])=>(m==="lineHeight"||m==="letterSpacing")&&oD.includes(p))&&Nn(u)!=="normal"){for(let p of oD){let m=f.find(I=>I.id===p);if(!m)continue;let h={...m.values};for(let I of["lineHeight","letterSpacing"])d.some(([w,S])=>w===p&&S===I)||h[I]===void 0&&!(m.auto??[]).includes(I)&&(h[I]=CC(s,p)[I]);m.values=Zr(h)}u="normal"}return{saved:f,old:{...o,compression:u}}}function cD(e,o){let t={text_styles:e.saved};return e.old.compression!==o.compression&&(t.heading_compression=Nn(e.old.compression)),t}var pl=(e,o)=>Number(e.toFixed(o)),dD=(e,o)=>fl.indexOf(e)<fl.indexOf(o)?o:e;function fD(e,o,t="desktop"){return e.map(r=>{let a={...r.values},n=o(r);for(let s of fl){let i=ke("lineHeight",s),l=r.values[i],d=r.values[ke("letterSpacing",s)];delete a[i],l!==void 0&&(a[xs("lineSpacing",s)]=pl(l*100,1));let f=dD(s,t);d!==void 0&&(a[xs("letterSpacing",s)]=pl(d*vC(r.values,n,f),f===s?2:4))}return{id:r.id,kind:r.kind,name:r.name,values:a}})}function Xre(e,o,t="desktop"){return e.map(r=>{let a=r.values,n={...a};for(let d of fl)delete n[xs("lineSpacing",d)],delete n[xs("letterSpacing",d)];let s={id:r.id,kind:r.kind,name:r.name,values:Zr(n)},i={...s.values},l=o({...s,values:{...s.values}});for(let d of fl){let f=a[xs("lineSpacing",d)],u=a[xs("letterSpacing",d)];if(typeof f=="number"&&(i[ke("lineHeight",d)]=pl(f/100,3)),typeof u=="number"){let p=vC(s.values,l,dD(d,t));i[ke("letterSpacing",d)]=p?pl(u/p,4):0}}return{...s,values:Zr(i)}})}function RHe(e){let o={fonts:xc({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:Ry({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:Nn(e.heading_compression),typography:z_(e)},t=e.text_styles??null,r=Array.isArray(t)?PC(Ca(t,o),o):o;return{fonts:xc(r.fonts),sizes:Ry(r.sizes),compression:Nn(r.compression),typography:r.typography,textStyles:t}}function PC(e,o){let t=p=>e.find(m=>m.id===p)?.values??{},r=t("heading-1"),a=t("heading-2"),n=t("heading-3"),s=t("body-1"),i=t("body-5"),l=o.fonts,d=o.sizes,f=o.typography,u=p=>p==="none"?"sentence":"authored";return{fonts:{...l,heading:r.font??l.heading,heading2:a.font??r.font??l.heading2,heading3:n.font??r.font??l.heading3,body:s.font??l.body,label:i.font??l.label},sizes:{...d,headingLarge:r.size??null,headingMedium:a.size??null,headingSmall:n.size??null,body:s.size??null,label:i.size??null},compression:o.compression,typography:{...f,case:u(r.letterCase),weight:r.weight??null,maxPx:r.largestSize??null,weight2:a.weight??null,weight3:n.weight??null,case2:u(a.letterCase),case3:u(n.letterCase)}}}function pD(e){let o=[];for(let t of e){let r=t.values,a=`.${eD(t)}`,n=`[${vr}="${t.id}"]`,s=`${a}, ${n}`,i=[],l=r.font!==void 0?Na.find(p=>p.key===r.font)?.cssVar:void 0;if(l&&i.push(`font-family: var(${l})`),r.size!==void 0){let p=r.largestSize!==void 0?Math.min(r.size,r.largestSize):r.size;i.push(`font-size: ${p}px`)}let d=Fi(r.color);d&&i.push(`color: ${d}`),r.italic===!0&&i.push("font-style: italic"),r.weight!==void 0&&i.push(`font-weight: ${r.weight}`);let f=[];r.lineHeight!==void 0&&f.push(`line-height: ${r.lineHeight}`),r.letterSpacing!==void 0&&f.push(`letter-spacing: ${r.letterSpacing}em`),t.kind==="body"&&i.push(...f);let u=Yre(r.letterCase);u&&t.kind==="body"&&i.push(`text-transform: ${u}`),r.paragraphSpacing&&i.push(`--sf-part-para: ${r.paragraphSpacing}px`),i.length&&o.push(`${s} { ${i.join("; ")} }`),t.kind==="heading"&&f.length&&o.push(`${s}, ${a}:is(h1, h2, h3, h4), ${n}:is(h1, h2, h3, h4) { ${f.join("; ")} }`),t.kind==="heading"&&u&&o.push(`${n}, ${a}:is(h1, h2, h3, h4) { text-transform: ${u} }`),r.paragraphSpacing&&(o.push(`*:has(> ${n}) { --sf-part-para: ${r.paragraphSpacing}px }`),o.push(...Ph(`:is(${s})`,`*:has(> ${n})`))),o.push(...Zre(t,s,a,n))}return o.join(`
4
4
  `)}function Zre(e,o,t,r){let a=e.values,n=sa("textSize",a.size,a.sizeTablet,a.sizePhone),s=sa("textSize",a.largestSize,a.largestSizeTablet,a.largestSizePhone),i=sa("same",a.lineHeight,a.lineHeightTablet,a.lineHeightPhone),l=sa("same",a.letterSpacing,a.letterSpacingTablet,a.letterSpacingPhone),d=sa("spacing",a.paragraphSpacing,a.paragraphSpacingTablet,a.paragraphSpacingPhone),f=rD("textSize",a.size,a.sizeTablet,a.sizePhone,pi()),u=Jre[e.id],p=[];for(let[m,h]of[["tablet",Ih],["phone",yh]]){let I=[],w=[],S=f[m],v=s[m],b=n[m]===void 0&&v===void 0||S===void 0?void 0:v===void 0?S:Math.min(S,v);b!==void 0&&w.push(`font-size: ${b}px`);let y=[];i[m]!==void 0&&y.push(`line-height: ${i[m]}`),l[m]!==void 0&&y.push(`letter-spacing: ${l[m]}em`),e.kind==="body"&&w.push(...y),d[m]!==void 0&&w.push(`--sf-part-para: ${d[m]}px`),w.length&&I.push(`${o} { ${w.join("; ")} }`),e.kind==="heading"&&y.length&&I.push(`${o}, ${t}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${y.join("; ")} }`),d[m]!==void 0&&I.push(`*:has(> ${r}) { --sf-part-para: ${d[m]}px }`),d[m]!==void 0&&!a.paragraphSpacing&&I.push(...Ph(`:is(${o})`,`*:has(> ${r})`)),b!==void 0&&u&&I.push(`.sf-themed-content { --size-${u}: ${b}px !important }`),I.length&&p.push(`@media ${h} { ${I.join(" ")} }`)}return p}var Jre={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function uD(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function mD(e){return e?wh[e]:void 0}function EC(e){let o=_d(e);return Zr({font:e.font,color:e.color===void 0?void 0:Et(e.color),size:e.size,weight:e.weight,italic:e.italic,lineHeight:o.lineHeight,letterSpacing:o.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function hD(e){return Object.keys(EC(e)).length>0}function xD({saved:e,old:o,styleId:t,values:r}){let a=iD(e);return{saved:Qre(a,t,r),old:o}}function Qre(e,o,t){return e.map(r=>r.id===o?kC({...r,values:Zr({...r.values,...t})},r.auto):r)}var gD=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],aae=["size","lineSpacing","letterSpacing","letterCase"],nae=500,_C=Na.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function ID({saved:e,old:o,colours:t,colourNameOf:r,sizeOf:a,onChange:n,openId:s,onOpenChange:i,readOnly:l=!1,withoutSize:d=!1}){let f=rae(),[u,p]=oae(null),m=Ca(e,o),h=Ci(f),I=fD(m,a,h);return eae(tae,{styles:I,onChange:w=>n(lD({saved:e,old:o,cur:I,next:w,sizeOf:a,panelView:h})),fonts:_C,colours:t,colourNameOf:r,settings:d?gD.filter(w=>w!=="size"):gD,auto:aae,openId:s===void 0?u:s,onOpenChange:i??p,readOnly:l,device:h,fallback:w=>{let S=m.find(b=>b.id===(w.kind==="heading"?"heading-1":"body-1")),v={};return S?.values.font&&w.id!==S.id&&(v.font=S.values.font),w.kind==="heading"&&(v.weight=nae),v}})}var bD=["font","size","weight","emphasis"],lae=500;function cae({font:e,size:o,weight:t,italic:r}){let a={font:e};return o!==null&&(a.size=o),t!==null&&(a.weight=t),r!==null&&(a.italic=r),{id:"accent",kind:"heading",name:c("Emphasis"),values:a}}function dae(e,o){let t=[],r=e.values,a=o.values;return a.font!==r.font&&a.font!==void 0&&t.push({key:"font",value:a.font}),a.size!==r.size&&t.push({key:"size",value:a.size??null}),a.weight!==r.weight&&t.push({key:"weight",value:a.weight??null}),a.italic!==r.italic&&t.push({key:"italic",value:a.italic??null}),t}function SD(e){let{headingWeight:o,open:t,onOpenChange:r,onChange:a,withoutSize:n=!1}=e,s=cae(e);return yD(iae,{label:c("Emphasis"),children:yD(sae,{style:s,fonts:_C,settings:n?bD.filter(i=>i!=="size"):bD,auto:["size"],fallback:()=>({weight:o??lae}),open:t,onOpenChange:r,onChange:i=>dae(s,i).forEach(a)})})}import{viewKeyAt as TD}from"efficient-easel/draw";import{shownUnitAt as xae,unitKeyOnWrite as gae}from"efficient-easel/screen/lib/content/length-units";import{convertRowLength as fae,rowUnits as pae,unitPickPatch as uae}from"efficient-easel/screen/lib/content/length-units";import{viewKeyAt as mae}from"efficient-easel/draw";var hae=["cornerRadius","siteWidth","siteGutter","siteGutterPhone","blockGap","blockGapPhone"],Eh={cornerRadius:{number:"corner_radius_px",kind:"radius",grid:R_,tier:"desktop"},siteWidth:{number:"site_width",kind:"size",grid:je,tier:"desktop"},siteGutter:{number:"site_gutter",kind:"spacing",grid:ct,tier:"desktop"},siteGutterPhone:{number:"site_gutter_phone",kind:"spacing",grid:gr,tier:"mobile"},blockGap:{number:"block_gap",kind:"gap",grid:jt,tier:"desktop"},blockGapPhone:{number:"block_gap_phone",kind:"gap",grid:jt,tier:"mobile"}};function _h(e){return{number:Eh[e].number,unit:m_[`${e}Unit`]}}function wD(e,o,t){let r=Ee(t),{number:a,unit:n}=_h(e);return{[a]:o,[n]:o===null||r==="px"?null:r}}function Oh(e,o,t,r){let{kind:a,grid:n,tier:s}=Eh[e],i=Ee(t),l=Ee(r);return i===l?o:fae(o,i,l,s,{kind:a},n)}function CD(e,o,t,r){let{number:a,unit:n}=_h(e),s=uae({[a]:o},i=>Oh(e,i,t,r),n,Ee(r),"px");return{[a]:s[a],[n]:s[n]??null}}function vD(e,o){let{kind:t,grid:r}=Eh[e];return u_(t,Ee(o),r)}function kD(e){return pae({kind:Eh[e].kind},Ia)}function OC(e,o){let t=mae(e,o);if(!hae.includes(t))throw new Error(`no site length row ${t}`);return t}function Od(e,o,t,r,a){let{siteLengthUnits:n,setSiteLengthUnits:s}=fe(),i=`${e}Unit`,l=n[i],d=xae({n:a?.figure??null,u:a?.unit??null,[TD("n","mobile")]:o,[TD("u","mobile")]:l??null},{n:"n"},"u","mobile"),f=h=>s({[i]:h==="px"?null:h}),u=h=>{t(h);let I=gae(i,l,d,"px",h===null);i in I&&f(I[i]==null?null:Ee(I[i])),r(wD(e,h,d),h===null)},p=h=>{let I=Ee(h);if(I===d||(f(I),o===null))return;let w=CD(e,o,d,I);t(w[_h(e).number]),r(w,!0)},m=a?a.unit===d?a.figure:Oh(e,a.figure,a.unit,d):null;return{length:{unit:d,grid:vD(e,d),units:{options:kD(e),onChange:p,label:c("Unit")}},write:u,rest:m,shown:h=>Oh(e,h,"px",d)}}import{EmptyState as Wae,SliderGroup as $ae,Tabs as Uae,Tooltip as f5e,tabButtonId as zae,tabPanelId as Gae}from"efficient-shell/ui";import{ContrastIcon as jae,SettingsIcon as Kae,TypeIcon as Vae}from"efficient-easel/icons";function PD(e){switch(e.status){case"saved":return null;case"failed":return{msg:c("Not saved. Try again."),tone:"error"};case"skipped":switch(e.reason){case"empty":return null;case"no-token":return{msg:c("Not saved. Reload the page."),tone:"error"};case"template":return{msg:c("Templates keep their look. Press Done."),tone:"success"}}}}import{jsx as NC}from"react/jsx-runtime";import{ListIcon as Eae,PaddingTopIcon as _ae}from"efficient-easel/icons";import{jsx as Ah}from"react/jsx-runtime";import{SettingsDefaultReset as Iae,SettingsField as yae,SettingsSegmented as bae}from"efficient-easel/panel";import{WidthIcon as Sae}from"efficient-easel/icons";function ED({value:e,resolved:o,onChange:t,label:r="Width",labelId:a,followsLabel:n,hint:s}){let i=e===void 0,l=i?o:e,d=c(r);return Ah(yae,{label:d,labelId:a,icon:Ah(Sae,{}),value:i?n:void 0,changed:!i,action:Ah(Iae,{words:ce()?.panel,label:d,changed:!i,onReset:()=>t(void 0)}),hint:s,children:Ah(bae,{options:[{label:c(rs.full),id:"full"},{label:c(rs.page),id:"content"}],value:l,ariaLabel:d,onChange:t})})}import{HEADER_TYPE as AC,FOOTER_TYPE as wae}from"efficient-easel/draw";var Cae=new Set(["Hero","HeroSingle","IntroBleed"]),_D={min:56,max:140,default:88},g4e={min:0,max:120,step:2,default:32},I4e=`var(--sf-header-h, ${_D.default}px)`,vae="--sf-header-set-h",y4e="--sf-header-h",b4e=`var(${vae}, ${_D.default}px)`,OD="sf-header-clearance",AD="sf-sticky-underheader";function Ad(e){return e?.find(o=>o?.type&&o.type!==AC)??null}function RD(e){let o=Ad(e)?.type;return!o||!Cae.has(o)}function LD(e){return!RD(e)}function RC(e){return!!e?.some(o=>o?.type===AC)}function FD(e){return!e||e.length===0?!1:!e.some(o=>o?.type===AC||o?.type===wae)}var kae=["auto","shared","own"],LC="auto",Tae="topSpace",BD="data-top-space";function Pae(e){return kae.includes(e)?e:LC}function FC(e,o){let t=Pae(e?.props?.[Tae]);return t==="own"?!0:t==="shared"?!1:RD(o)}function ND(e,o){return FC(e,o)?"own":null}function Oae(){return{type:"custom",render:({value:e,onChange:o})=>NC(ED,{value:e==="full"?"full":e==="content"?"content":void 0,resolved:"content",label:"Page width",followsLabel:c("Follows the site"),hint:c("Whether this page sits on the site's content column, or runs edge to edge."),onChange:t=>o(t)})}}var Aae=[{label:"Auto",value:"auto"},{label:"Shared",value:"shared"},{label:"Its own",value:"own"}],A4e={pageBackground:gB(),topSpace:At("Top space",NC(_ae,{}),Aae,LC),widthChoice:Oae()},Rd=["pageBackground","topSpace","widthChoice"],Rae="Record type",BC=new Map,DD=-1;function Lae(e){DD!==fb()&&(BC.clear(),DD=fb());let o=cb(),t=o.some(a=>a.key===e)?"":e,r=BC.get(t);return r||(r=At(Rae,NC(Eae,{}),[...o.map(a=>({label:a.label,value:a.key})),...t?[{label:t,value:t}]:[]],Ut),BC.set(t,r)),r}var MD=new WeakMap;function R4e(e,o){if(!Wc()||cb().length<2||Ou in e)return e;let t=Lae(Hc(o)),r=MD.get(e);if(r&&r.row===t)return r.fields;let a={[Ou]:t,...e};return MD.set(e,{row:t,fields:a}),a}import{previewFrame as Yae}from"efficient-easel/screen/lib/document/preview-dom";var HD="background";function WD(e){let o=ht(yi(e));return Bi({main:o.accent,text:o.text,background:o.background,muted:o.muted}).map(t=>({key:t.name,name:t.label??t.name,value:t.value}))}function $D(e){return WD(e).filter(o=>o.key!==HD)}function UD(e){let o=WD(e).filter(t=>t.key===HD);return t=>{let r=Et(t);return o.find(a=>a.key===r)?.value??r}}import{useEasel as Fae}from"efficient-easel/easel";function Rh({themeFromDocument:e,persist:o}){let{appState:t,dispatch:r}=Fae(O=>O),{fonts:a,setFonts:n,sizes:s,setSizes:i,headingCompression:l,setHeadingCompression:d,headingTypography:f,setHeadingTypography:u,textStyles:p,setTextStyles:m}=fe(),h=t.data,I=h.root?.props??{},w=e?xc(I.fonts):a,S=e?O_:s,v=e?Nn(I.headingCompression):l,b=e?Jp(I.headingTypography):f,y={fonts:w,sizes:S,compression:v,typography:b},k=e?I.textStyles:p,L=O=>r({type:"replaceRoot",root:{...h.root,props:{...I,...O}},recordHistory:!0});return{fonts:w,sizes:S,compression:v,typography:b,old:y,saved:k,write:(O,D)=>{let T=PC(Ca(O.saved,O.old),O.old);e?L({textStyles:O.saved,fonts:T.fonts,headingCompression:T.compression,headingTypography:T.typography}):(m(O.saved),n(T.fonts),i(T.sizes),d(T.compression),u(T.typography)),o(cD(O,y),D)},writeRoot:L}}import{pictureShadowColor as qae}from"efficient-easel/screen/lib/document/shadow-values";var MC="sf-site-styles",Xae="sf-site-styles-tabpanel",jD="text",hl="basics",zD="this-page-group",ul=[{id:hl,label:"Basics",icon:Pe(Kae,{})},{id:"theme",label:"Theme",icon:Pe(jae,{})},{id:"text",label:"Text",icon:Pe(Vae,{})}];function Zae({themeFromDocument:e,persist:o}){let{appState:t,dispatch:r}=GD(d=>d),{theme:a,setTheme:n}=fe(),s=t.data,i=s.root?.props??{},l=d=>{if(e){let f={...i,theme:d};r({type:"replaceRoot",root:{...s.root,props:f},recordHistory:!0})}else n(d);o({selected_preset:d.selected,theme_presets:d.themes})};return Pe(iN,{value:e?i.theme:a,onChange:l})}function Jae({themeFromDocument:e,persist:o}){let[t,r]=HC(null),{theme:a,setFonts:n,setSizes:s,setHeadingTypography:i}=fe(),l=Rh({themeFromDocument:e,persist:o}),{old:d,saved:f,writeRoot:u}=l,p=l.fonts,m=l.sizes,h=l.typography,I=O=>O.values.size??tne(Qae[O.id]??"body")??ene[O.kind],w=O=>l.write(O),S=$D(a),v=UD(a),b=O=>{let D={...p,accent:O};e?u({fonts:D}):n(D),o({accent_font:O})},y=O=>{s({...m,accent:O}),o({accent_size_px:O})},k=O=>{let D={...h,weightStrong:O};e?u({headingTypography:D}):i(D),o({heading_weight_strong:O})},L=O=>{let D={...h,italicStrong:O};e?u({headingTypography:D}):i(D),o({accent_italic:O})};return gs(ml,{children:[Pe(ID,{saved:f,old:d,colours:S,colourNameOf:v,sizeOf:I,onChange:w,openId:t===DC?null:t,onOpenChange:r,withoutSize:e}),Pe(SD,{font:p.accent,size:m.accent,weight:h.weightStrong,italic:h.italicStrong,headingWeight:h.weight,open:t===DC,onOpenChange:O=>r(O?DC:null),onChange:O=>{O.key==="font"?b(O.value):O.key==="size"?y(O.value):O.key==="weight"?k(O.value):L(O.value)},withoutSize:e})]})}var DC="accent",Qae={"heading-1":"heading","heading-2":"heading2","heading-3":"heading3","body-1":"body","body-5":"label"},ene={heading:32,body:14},one={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 tne(e){if(typeof document>"u")return null;let o=(Yae()?.contentDocument??document).querySelector(one[e]);if(!o)return null;let t=parseFloat(getComputedStyle(o).fontSize);return Number.isFinite(t)?t:null}function rne({themeFromDocument:e,persist:o}){let{appState:t,dispatch:r}=GD(p=>p),{cornerRadiusPx:a,setCornerRadiusPx:n}=fe(),s=t.data,i=s.root?.props??{},l=i.cornerRadiusPx===void 0?Zp[Xp(i.cornerStyle)]:Ht(i.cornerRadiusPx),d=e?l:a,f=Od("cornerRadius",a,n,o),u=p=>r({type:"replaceRoot",root:{...s.root,props:{...i,...p}},recordHistory:!0});return Pe(lN,{value:d,onChange:p=>{e?(u({cornerRadiusPx:p}),o({corner_radius_px:p})):f.write(p)},...e?{}:{length:f.length}})}function ane({persist:e}){let{siteWidth:o,setSiteWidth:t,sectionBackgroundWidth:r,setSectionBackgroundWidth:a,sectionContentWidth:n,setSectionContentWidth:s}=fe(),i=WC(),l=Od("siteWidth",o??null,t,e);if(i!=="desktop")return null;let d=typeof o=="number"?o:l.shown(je.default),f=l.write,u=m=>{a(m),e({section_background_width:m},!0)},p=m=>{s(m),e({section_content_width:m},!0)};return gs(ml,{children:[Pe(hh,{value:r??"full",changed:r!==null,detail:c("Full width"),onChange:u,onReset:()=>u(null),hint:CN}),Pe(xh,{mode:n??"content",px:d,min:je.min,max:je.max,changed:typeof o=="number"||n!==null,detail:`${c("Content width")} ${je.default}px`,onMode:p,onPx:m=>f(m),onReset:()=>{p(null),f(null)},hint:vN,length:l.length})]})}function nne({persist:e}){let{siteGutter:o,siteGutterPhone:t,setSiteGutter:r,setSiteGutterPhone:a,siteLengthUnits:n}=fe(),s=SN(WC(),{gutter:o,phone:t,gutterUnit:n.siteGutterUnit}),i=s?.key==="site_gutter_phone",l=Od(OC("siteGutter",i?"mobile":"desktop"),s?.value??null,i?a:r,e);return s?Pe(wN,{value:s.value,onChange:l.write,unsetPx:s.unsetPx,restsOn:l.shown(s.unsetPx),bounds:s.bounds,length:l.length}):null}function sne({persist:e}){let{blockGap:o,blockGapPhone:t,setBlockGap:r,setBlockGapPhone:a,siteLengthUnits:n}=fe(),s=mN(WC(),{gap:o,phone:t}),i=s?.key==="block_gap_phone",l=s?.followsPx==null?null:{figure:s.followsPx,unit:Ee(n.blockGapUnit)},d=Od(OC("blockGap",i?"mobile":"desktop"),s?.value??null,i?a:r,e,l);return s?Pe(hN,{value:s.value,onChange:d.write,followsPx:d.rest,followsUnit:d.length.unit,length:d.length}):null}function ine({persist:e}){return gs(ml,{children:[Pe(ane,{persist:e}),Pe(nne,{persist:e}),Pe(sne,{persist:e})]})}function lne(e){return{card_shadow:e}}function cne(e){return e===null?{shadow_color:null}:{shadow_color:qae(e)}}function dne(e){return{hover_effect:e}}function fne({persist:e}){let{cardShadow:o,setCardShadow:t,shadowColor:r,setShadowColor:a,hoverEffect:n,setHoverEffect:s}=fe();return gs(ml,{children:[Pe(cN,{value:o,onChange:i=>{t(i),e(lne(i),!0)}}),Pe(pN,{value:r,onChange:i=>{a(i),e(cne(i),i===null)}}),Pe(xN,{value:n,onChange:i=>{s(i),e(dne(i),!0)}})]})}function pne(e){return{photography_grayscale:e}}function une({persist:e}){let{photographyGrayscale:o,setPhotographyGrayscale:t}=fe();return Pe(IN,{value:o,onChange:r=>{t(r),e(pne(r),!0)}})}function mne({persist:e}){return Pe(ml,{children:Pe(une,{persist:e})})}function hne(e){return{share_button_on_posts:e}}function xne({persist:e}){let{shareButtonOnPosts:o,setShareButtonOnPosts:t}=fe();return Pe(yN,{value:o,onChange:r=>{t(r),e(hne(r),!0)}})}function xl(){let{websiteName:e}=fe();return e?.trim()||RO}function Lh({themeFromDocument:e=!1,tokenRef:o,siteId:t,onNotify:r,tab:a,onTabChange:n,initialTab:s,revealPageGroup:i=!1,onPageGroupRevealed:l}){let{persist:d}=Wi({themeFromDocument:e,tokenRef:o,siteId:t,onResult:w=>{let S=PD(w);S&&r?.(S.msg,S.tone)}}),[f,u]=HC(s??ul[0].id),p=a!==void 0,m=p?a:f,h=p?n??(()=>{}):u,I=ul.find(w=>w.id===m)??ul[0];return gs($ae,{children:[Pe(yne,{activeId:I.id,onSelect:h}),gs("div",{id:Gae(MC,I.id),className:Xae,role:"tabpanel","aria-labelledby":zae(MC,I.id),children:[m===hl&&gs(ml,{children:[Pe(rne,{themeFromDocument:e,persist:d}),!e&&Pe(fne,{persist:d}),!e&&Pe(ine,{persist:d}),!e&&Pe(mne,{persist:d}),!e&&Pe(xne,{persist:d}),Pe(gne,{reveal:i,onRevealed:l})]}),m==="theme"&&Pe(Zae,{themeFromDocument:e,persist:d}),m==="text"&&Pe(Jae,{themeFromDocument:e,persist:d})]})]})}function gne({reveal:e,onRevealed:o}){let[t,r]=HC(!0),a=Hae(o);return a.current=o,Mae(()=>{if(!e)return;r(!0);let n=requestAnimationFrame(()=>{document.getElementById(zD)?.scrollIntoView({block:"start"}),a.current?.()});return()=>cancelAnimationFrame(n)},[e]),Pe(Dae,{title:c("This page"),open:t,onToggle:r,id:zD,children:Pe(Ine,{})})}function Ine(){let{fields:e,values:o,readOnly:t,onChange:r}=Bae(),a=Object.fromEntries(Rd.filter(n=>n in e).map(n=>[n,e[n]]));return Object.keys(a).length===0?Pe(Wae,{variant:"none",icon:!1,message:c("This page has no look of its own to set.")}):Pe(Nae,{fields:a,values:o,onChange:r,readOnly:t,tabs:!1,idPrefix:"this-page",ariaLabel:c("This page")})}function yne({activeId:e,onSelect:o}){return Pe("div",{className:"es-insp-tabs",children:Pe(Uae,{variant:"underline",block:!0,labelsFit:!0,"aria-label":c("Styles"),idPrefix:MC,value:e,onChange:o,items:ul.map(t=>{let r=c(t.label);return{id:t.id,icon:t.icon,label:r}})})})}import{InspectorIconButton as kbe}from"efficient-easel/chrome";import{Input as Tbe,PopupMenu as Pbe,PopupMenuItem as ej,toast as oj}from"efficient-shell/ui";import{LayersTree as Ebe,TreeGroupLabel as _be,TreeRow as tj,TreeRowAction as dI}from"efficient-easel/tree";import{AddIcon as Obe,DuplicateIcon as Abe,PageIcon as Rbe,SettingsIcon as Lbe}from"efficient-easel/icons";import{PagesIcon as Fbe}from"efficient-easel/rail";import{useEaselHost as Bbe}from"efficient-easel/screen/lib/host";import{useEaselSession as xP}from"efficient-easel/screen/lib/session-context";import{useCallback as Fh,useEffect as bne,useSyncExternalStore as Sne}from"react";import{useScreenDocument as qD}from"efficient-easel/screen/components/ScreenDocumentContext";var KD=new WeakMap;function Ld(e){let o=KD.get(e);return o||(o={rows:null,loading:null,listeners:new Set},KD.set(e,o)),o}function $C(e,o){e.rows=o;for(let t of e.listeners)t()}var Bh=new Set;function Nh(e,o){o?Bh.add(e):Bh.delete(e)}function VD(e){let o=Ld(e),t=e.listPages().then(r=>$C(o,Bh.size?r.filter(a=>!Bh.has(a.id)):r),()=>$C(o,[])).finally(()=>{o.loading===t&&(o.loading=null)});return o.loading=t,t}var YD=()=>null,wne=()=>()=>{};function Fd(){let{adapter:e,ready:o}=qD(),t=Fh(i=>{let{listeners:l}=Ld(e);return l.add(i),()=>l.delete(i)},[e]),r=Fh(()=>Ld(e).rows,[e]),a=Sne(o?t:wne,o?r:YD,YD);bne(()=>{if(!o)return;let i=Ld(e);i.rows===null&&!i.loading&&VD(e)},[e,o]);let n=Fh(()=>o?VD(e):Promise.resolve(),[e,o]),s=Fh(i=>$C(Ld(e),i),[e]);return{rows:a,reload:n,setRows:s,getRows:r}}function Cne(e,o){return e?.find(t=>t.slug===o)?.label?.trim()||`/${o}`}function XD(){let{currentSlug:e}=qD(),{rows:o}=Fd();return Cne(o,e)}import{canDuplicatePage as Nbe,DuplicatePageDialog as Dbe}from"efficient-easel/page-copy";import{jsx as Nt,jsxs as fP}from"react/jsx-runtime";import{useEffect as ibe,useMemo as lbe,useRef as cbe,useState as pP}from"react";import{useScreenDocument as dbe}from"efficient-easel/screen/components/ScreenDocumentContext";import{useEaselSession as fbe}from"efficient-easel/screen/lib/session-context";import{uniqueSlug as jG}from"efficient-easel/page-copy";import{AddIcon as pbe}from"efficient-easel/icons";import{Dialog as ube,EmptyState as mbe,Grid as hbe,SidebarActionButton as xbe,SidebarLayout as gbe,SidebarNavItem as uP,toast as KG}from"efficient-shell/ui";import{jsx as Pr,jsxs as b6}from"react/jsx-runtime";import{useMemo as wme,useState as Cme}from"react";import{CanvasFrame as vme}from"efficient-easel/easel";import{Button as kme,FitFrame as Tme}from"efficient-shell/ui";import{jsx as oM,Fragment as Bne,jsxs as Nne}from"react/jsx-runtime";import{useEffect as tM,useLayoutEffect as Dne}from"react";var Dh="data-theme",ZD="light";function vne(e){return e.getAttribute(Dh)===ZD?"light":"dark"}function kne(e,o){return vne(e)===o?!1:(o==="light"?e.setAttribute(Dh,ZD):e.removeAttribute(Dh),!0)}function Tne(e){return Hy(e).getItem(Ey)}function A5e(e,o){Hy(e).setItem(Ey,o)}function Pne(e,o,t=new Date().getHours()){return h_({mode:o.mode,override:Tne(e),switchShown:o.switchShown,hour:t})}function JD(e,o){let t=e.documentElement;if(!t)return()=>{};let r=()=>kne(t,Pne(e,o));r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[Dh]}),()=>n.disconnect()}var Ene="style";function _ne(e,o){let t=qp(o),r=!1;for(let a of __){let n=t[a]??"";e.style.getPropertyValue(a)!==n&&(n?e.style.setProperty(a,n):e.style.removeProperty(a),r=!0)}return r}function QD(e,o){let t=e.body;if(!t)return()=>{};let r=()=>_ne(t,o);r();let a=e.defaultView?.MutationObserver;if(!a)return()=>{};let n=new a(r);return n.observe(t,{attributes:!0,attributeFilter:[Ene]}),()=>n.disconnect()}import{VIEW_DESKTOP_MIN as One,VIEW_TABLET_MIN as Ane}from"efficient-easel/screen/lib/content/view-tiers";var va={fit:"data-fit",fitTablet:"data-fit-tablet",fitPhone:"data-fit-phone",min:"data-fit-min",minTablet:"data-fit-min-tablet",minPhone:"data-fit-min-phone",edge:"data-fit-edge"},Ft=va,Rne=e=>e.flatMap(o=>[`[${o}] p`,`[${o}] li`]).join(","),Lne=String.raw`(function (doc) {