@usethrottle/builder-react 0.5.2 → 0.5.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.
@@ -56,6 +56,18 @@ function faqJsonLd(items) {
56
56
  }))
57
57
  };
58
58
  }
59
+ function videoJsonLd(input) {
60
+ return {
61
+ "@context": CONTEXT,
62
+ "@type": "VideoObject",
63
+ name: input.name,
64
+ ...input.description === void 0 || input.description === "" ? {} : { description: input.description },
65
+ thumbnailUrl: [input.thumbnailUrl],
66
+ uploadDate: input.uploadDate,
67
+ ...isHttp(input.embedUrl) ? { embedUrl: input.embedUrl } : {},
68
+ ...isHttp(input.contentUrl) ? { contentUrl: input.contentUrl } : {}
69
+ };
70
+ }
59
71
  function localBusinessJsonLd(input) {
60
72
  const hours = (_nullishCoalesce(input.openingHours, () => ( []))).filter((line) => line !== "");
61
73
  return {
@@ -585,13 +597,29 @@ function Announcement({ props, mediaOrigin, editMode }) {
585
597
 
586
598
  var STYLES = ["primary", "secondary", "outline", "link"];
587
599
  var SIZES = ["s", "m", "l"];
600
+ var REL = {
601
+ nofollow: ["nofollow"],
602
+ sponsored: ["sponsored"],
603
+ ugc: ["ugc"],
604
+ "nofollow-sponsored": ["nofollow", "sponsored"],
605
+ "nofollow-ugc": ["nofollow", "ugc"],
606
+ "sponsored-ugc": ["sponsored", "ugc"],
607
+ "nofollow-sponsored-ugc": ["nofollow", "sponsored", "ugc"]
608
+ };
588
609
  function Button({ props, mediaOrigin, inlineEdit }) {
589
610
  const href = hrefOf(props.link, mediaOrigin);
590
611
  const className = `tb-b-button tb-b-button--${oneOf(props.style, STYLES, "primary")} tb-b-button--${oneOf(props.size, SIZES, "m")}`;
591
- const label = _nullishCoalesce(_nullishCoalesce(_optionalChain([inlineEdit, 'optionalCall', _16 => _16("label")]), () => ( str(props.label))), () => ( ""));
612
+ const label2 = _nullishCoalesce(_nullishCoalesce(_optionalChain([inlineEdit, 'optionalCall', _16 => _16("label")]), () => ( str(props.label))), () => ( ""));
613
+ const tokens = [];
614
+ if (href !== null) {
615
+ const rel = typeof props.rel === "string" && Object.hasOwn(REL, props.rel) ? REL[props.rel] : void 0;
616
+ if (rel !== void 0) tokens.push(...rel);
617
+ if (props.newTab === true) tokens.push("noopener");
618
+ }
619
+ const linkAttrs = href === null ? {} : { href, ...props.newTab === true ? { target: "_blank" } : {}, ...tokens.length === 0 ? {} : { rel: tokens.join(" ") } };
592
620
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
593
621
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
594
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-button-wrap", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className, ...href === null ? {} : { href }, children: label }) })
622
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-button-wrap", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className, ...linkAttrs, children: label2 }) })
595
623
  ] });
596
624
  }
597
625
 
@@ -800,7 +828,7 @@ function startRuntime() {
800
828
  document.addEventListener("keydown", onKey);
801
829
  window.addEventListener("hashchange", onHash);
802
830
  let beat = 0;
803
- const clock = window.setInterval(() => {
831
+ const clock2 = window.setInterval(() => {
804
832
  const minute = ++beat % 60 === 0;
805
833
  all("[data-b-cd]:not([data-b-ended])").forEach((el) => tick(el, minute));
806
834
  }, 1e3);
@@ -818,7 +846,7 @@ function startRuntime() {
818
846
  document.removeEventListener("click", onClick);
819
847
  document.removeEventListener("keydown", onKey);
820
848
  window.removeEventListener("hashchange", onHash);
821
- window.clearInterval(clock);
849
+ window.clearInterval(clock2);
822
850
  watcher.disconnect();
823
851
  autoplay.forEach((id) => window.clearInterval(id));
824
852
  autoplay.clear();
@@ -1024,16 +1052,19 @@ function isFrozenAsset(value) {
1024
1052
  const v = value;
1025
1053
  return typeof v.url === "string" && typeof v.width === "number" && typeof v.height === "number" && Array.isArray(v.variants);
1026
1054
  }
1055
+ function assetSrcSet(asset, mediaOrigin) {
1056
+ return asset.variants.flatMap((variant) => {
1057
+ const url = _builderschema.safeUrl.call(void 0, variant.url, "src", { mediaOrigin });
1058
+ return url === null || url.includes(",") ? [] : [`${url} ${String(variant.width)}w`];
1059
+ }).join(", ");
1060
+ }
1027
1061
  function AssetImage(props) {
1028
- const { asset, alt, sizes, className, loading = "lazy", style, mediaOrigin } = props;
1062
+ const { asset, alt, sizes, className, loading = "lazy", fetchPriority, reserveSpace = true, style, mediaOrigin } = props;
1029
1063
  const href = (url) => _builderschema.safeUrl.call(void 0, url, "src", { mediaOrigin });
1030
1064
  if (!isFrozenAsset(asset)) return null;
1031
1065
  const src = href(asset.url);
1032
1066
  if (src === null) return null;
1033
- const srcSet = asset.variants.flatMap((variant) => {
1034
- const url = href(variant.url);
1035
- return url === null || url.includes(",") ? [] : [`${url} ${String(variant.width)}w`];
1036
- }).join(", ");
1067
+ const srcSet = assetSrcSet(asset, mediaOrigin);
1037
1068
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1038
1069
  "img",
1039
1070
  {
@@ -1043,9 +1074,10 @@ function AssetImage(props) {
1043
1074
  height: asset.height,
1044
1075
  alt,
1045
1076
  loading,
1077
+ ...fetchPriority === void 0 ? {} : { fetchPriority },
1046
1078
  decoding: "async",
1047
1079
  ...className === void 0 ? {} : { className },
1048
- style: { aspectRatio: `${String(asset.width)} / ${String(asset.height)}`, ...style }
1080
+ style: { ...reserveSpace ? { aspectRatio: `${String(asset.width)} / ${String(asset.height)}` } : {}, ...style }
1049
1081
  }
1050
1082
  );
1051
1083
  }
@@ -1056,16 +1088,42 @@ var RULES2 = [
1056
1088
  { key: "radius", property: "--bx-radius", values: { none: "0", s: "4px", m: "8px", l: "16px", full: "9999px" } },
1057
1089
  { key: "fit", property: "--bx-fit", values: { cover: "cover", contain: "contain" } }
1058
1090
  ];
1091
+ var NODE_ID = /^[a-z0-9]{8,24}(-[a-z0-9]{8,24})?$/;
1092
+ var RATIOS = { "1:1": "1 / 1", "4:3": "4 / 3", "3:4": "3 / 4", "16:9": "16 / 9" };
1059
1093
  function Image({ node, props, mediaOrigin, editMode }) {
1060
1094
  const href = hrefOf(props.link, mediaOrigin);
1061
1095
  const decorative = props.decorative === true;
1062
1096
  const alt = decorative ? "" : typeof props.alt === "string" ? props.alt : "";
1063
1097
  const asset = isFrozenAsset(props.image) ? props.image : void 0;
1064
- const image = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset, mediaOrigin, alt, className: "tb-b-img", sizes: "(max-width: 767px) 100vw, 50vw" });
1098
+ const priority = props.priority === true;
1099
+ const ratio = typeof props.ratio === "string" && Object.hasOwn(RATIOS, props.ratio) ? RATIOS[props.ratio] : void 0;
1100
+ const sizes = "(max-width: 767px) 100vw, 50vw";
1101
+ const mobile = isFrozenAsset(props.mobileImage) ? props.mobileImage : void 0;
1102
+ const mobileSrc = mobile === void 0 ? null : _builderschema.safeUrl.call(void 0, mobile.url, "src", { mediaOrigin });
1103
+ const directed = mobile !== void 0 && mobileSrc !== null && asset !== void 0;
1104
+ const perBreakpoint = directed && ratio === void 0;
1105
+ const raw = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1106
+ AssetImage,
1107
+ {
1108
+ asset,
1109
+ mediaOrigin,
1110
+ alt,
1111
+ className: "tb-b-img",
1112
+ sizes,
1113
+ reserveSpace: !perBreakpoint,
1114
+ ...priority ? { loading: "eager", fetchPriority: "high" } : {},
1115
+ ...ratio === void 0 ? {} : { style: { aspectRatio: ratio } }
1116
+ }
1117
+ );
1118
+ const reserve = perBreakpoint && asset !== void 0 && mobile !== void 0 && NODE_ID.test(node.id) && [asset.width, asset.height, mobile.width, mobile.height].every((n) => Number.isInteger(n) && n > 0) ? `[data-b-id="${node.id}"] .tb-b-img{aspect-ratio:${String(asset.width)} / ${String(asset.height)}}@media (max-width:767px){[data-b-id="${node.id}"] .tb-b-img{aspect-ratio:${String(mobile.width)} / ${String(mobile.height)}}}` : "";
1119
+ const image = directed ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "picture", { children: [
1120
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "source", { media: "(max-width:767px)", srcSet: assetSrcSet(mobile, mediaOrigin) || mobileSrc, sizes: "100vw", width: mobile.width, height: mobile.height }),
1121
+ raw
1122
+ ] }) : raw;
1065
1123
  const shown2 = asset !== void 0 && _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin }) !== null;
1066
1124
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1067
1125
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
1068
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyle, { css: enumCss(node, RULES2) }),
1126
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyle, { css: enumCss(node, RULES2) + reserve }),
1069
1127
  shown2 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-image", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-image-box", children: href === null ? image : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href, children: image }) }) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: asset === void 0 ? "Choose an image" : "Image unavailable" })
1070
1128
  ] });
1071
1129
  }
@@ -1128,7 +1186,7 @@ function Menu({ props, mediaOrigin, editMode }) {
1128
1186
  const menus = _optionalChain([design, 'optionalAccess', _61 => _61.menus]);
1129
1187
  const items = menus !== void 0 && Object.hasOwn(menus, name) ? menus[name] : void 0;
1130
1188
  const strings = _optionalChain([design, 'optionalAccess', _62 => _62.strings]);
1131
- const label = _nullishCoalesce((strings !== void 0 && Object.hasOwn(strings, "nav.menu") ? str(strings["nav.menu"]) : void 0), () => ( _builderschema.SITE_STRING_DEFAULTS["nav.menu"]));
1189
+ const label2 = _nullishCoalesce((strings !== void 0 && Object.hasOwn(strings, "nav.menu") ? str(strings["nav.menu"]) : void 0), () => ( _builderschema.SITE_STRING_DEFAULTS["nav.menu"]));
1132
1190
  if (items === void 0 || items.length === 0) {
1133
1191
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1134
1192
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
@@ -1148,7 +1206,7 @@ function Menu({ props, mediaOrigin, editMode }) {
1148
1206
  "nav",
1149
1207
  {
1150
1208
  className: `tb-b-menu tb-b-menu--${layout}${layout === "vertical" ? "" : " tb-b-menu--h"}`,
1151
- "aria-label": label,
1209
+ "aria-label": label2,
1152
1210
  "data-open": drawer ? String(open) : void 0,
1153
1211
  onKeyDown: drawer ? onKeyDown : void 0,
1154
1212
  children: [
@@ -1161,7 +1219,7 @@ function Menu({ props, mediaOrigin, editMode }) {
1161
1219
  "aria-expanded": open,
1162
1220
  "aria-controls": listId,
1163
1221
  onClick: () => setOpen2((value) => !value),
1164
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: open ? "close" : "menu", size: 24, label })
1222
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: open ? "close" : "menu", size: 24, label: label2 })
1165
1223
  }
1166
1224
  ),
1167
1225
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, List, { items, mediaOrigin, id: listId, ...drawer ? { onNavigate: () => setOpen2(false) } : {} })
@@ -1397,9 +1455,12 @@ function Text({ props, mediaOrigin, editMode, inlineEdit }) {
1397
1455
 
1398
1456
 
1399
1457
 
1458
+
1400
1459
  var RULES3 = [
1401
1460
  { key: "ratio", property: "--bx-ratio", values: { "16:9": "16 / 9", "4:3": "4 / 3", "1:1": "1 / 1", "9:16": "9 / 16" } }
1402
1461
  ];
1462
+ var POSTER_STYLE = { position: "absolute", inset: 0, inlineSize: "100%", blockSize: "100%", objectFit: "cover" };
1463
+ var ISO_DATE = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2}))?$/;
1403
1464
  var YOUTUBE_ID = /^[A-Za-z0-9_-]{11}$/;
1404
1465
  var VIMEO_ID = /^\d{5,12}$/;
1405
1466
  var YOUTUBE_HOSTS = /* @__PURE__ */ new Set(["youtube.com", "www.youtube.com", "m.youtube.com", "youtube-nocookie.com", "www.youtube-nocookie.com"]);
@@ -1435,22 +1496,62 @@ function parseVideoUrl(input) {
1435
1496
  function embedSrc(video, muted) {
1436
1497
  return video.provider === "youtube" ? `https://www.youtube-nocookie.com/embed/${video.id}?autoplay=1&rel=0&playsinline=1${muted ? "&mute=1" : ""}` : `https://player.vimeo.com/video/${video.id}?autoplay=1&dnt=1${muted ? "&muted=1" : ""}`;
1437
1498
  }
1438
- function Video({ node, props, editMode }) {
1499
+ function Video({ node, props, mediaOrigin, editMode }) {
1439
1500
  const [loaded, setLoaded] = _react.useState.call(void 0, false);
1440
1501
  const video = parseVideoUrl(_nullishCoalesce(str(props.url), () => ( "")));
1502
+ const title = str(props.title);
1503
+ const poster = isFrozenAsset(props.poster) ? props.poster : void 0;
1504
+ const posterSrc = poster === void 0 ? null : _builderschema.safeUrl.call(void 0, poster.url, "src", { mediaOrigin });
1505
+ const priority = props.priority === true;
1506
+ const uploadDate = str(props.uploadDate);
1507
+ const jsonLd = video !== null && title !== void 0 && posterSrc !== null && uploadDate !== void 0 && ISO_DATE.test(uploadDate) && !Number.isNaN(Date.parse(uploadDate)) ? jsonLdString(
1508
+ videoJsonLd({
1509
+ name: title,
1510
+ thumbnailUrl: posterSrc,
1511
+ uploadDate,
1512
+ description: str(props.description),
1513
+ embedUrl: embedSrc(video, false).split("?")[0]
1514
+ })
1515
+ ) : null;
1441
1516
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1442
1517
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
1443
1518
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyle, { css: enumCss(node, RULES3) }),
1444
- video === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Paste a YouTube or Vimeo link" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-video", "data-provider": video.provider, children: loaded && !editMode ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1445
- "iframe",
1446
- {
1447
- src: embedSrc(video, props.autoplayMuted === true),
1448
- title: "Video",
1449
- allow: "autoplay; encrypted-media; picture-in-picture; fullscreen",
1450
- referrerPolicy: "strict-origin-when-cross-origin",
1451
- sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups"
1452
- }
1453
- ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-play", "aria-label": "Play video", onClick: () => setLoaded(true), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: "play", size: 28 }) }) }) })
1519
+ video === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Paste a YouTube or Vimeo link" }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-video", "data-provider": video.provider, children: [
1520
+ loaded && !editMode ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1521
+ "iframe",
1522
+ {
1523
+ src: embedSrc(video, props.autoplayMuted === true),
1524
+ title: _nullishCoalesce(title, () => ( "Video")),
1525
+ allow: "autoplay; encrypted-media; picture-in-picture; fullscreen",
1526
+ referrerPolicy: "strict-origin-when-cross-origin",
1527
+ sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups"
1528
+ }
1529
+ ) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
1530
+ posterSrc !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1531
+ AssetImage,
1532
+ {
1533
+ asset: poster,
1534
+ mediaOrigin,
1535
+ alt: "",
1536
+ className: "tb-b-video-poster",
1537
+ style: POSTER_STYLE,
1538
+ sizes: "(max-width: 767px) 100vw, 50vw",
1539
+ ...priority ? { loading: "eager", fetchPriority: "high" } : {}
1540
+ }
1541
+ ),
1542
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1543
+ "button",
1544
+ {
1545
+ type: "button",
1546
+ className: "tb-b-play",
1547
+ "aria-label": title === void 0 ? "Play video" : `Play video: ${title}`,
1548
+ onClick: () => setLoaded(true),
1549
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: "play", size: 28 }) })
1550
+ }
1551
+ )
1552
+ ] }),
1553
+ jsonLd !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { type: "application/ld+json", children: jsonLd })
1554
+ ] })
1454
1555
  ] });
1455
1556
  }
1456
1557
 
@@ -1597,8 +1698,8 @@ function setDrawer(nav, open) {
1597
1698
  if (open) {
1598
1699
  list2.setAttribute("role", "dialog");
1599
1700
  list2.setAttribute("aria-modal", "true");
1600
- const label = nav.getAttribute("aria-label");
1601
- if (label !== null) list2.setAttribute("aria-label", label);
1701
+ const label2 = nav.getAttribute("aria-label");
1702
+ if (label2 !== null) list2.setAttribute("aria-label", label2);
1602
1703
  _optionalChain([focusablesOf, 'call', _96 => _96(list2), 'access', _97 => _97[0], 'optionalAccess', _98 => _98.focus, 'call', _99 => _99()]);
1603
1704
  } else {
1604
1705
  list2.removeAttribute("role");
@@ -1978,12 +2079,12 @@ var Boundary = class extends BoundaryBase {
1978
2079
  }
1979
2080
  };
1980
2081
  function PartBoundary({
1981
- label,
2082
+ label: label2,
1982
2083
  resetKey,
1983
2084
  children
1984
2085
  }) {
1985
2086
  const builder = useBuilder();
1986
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Boundary, { label, resetKeys: [_optionalChain([builder, 'optionalAccess', _122 => _122.site]), resetKey], onError: _optionalChain([builder, 'optionalAccess', _123 => _123.onError]), children });
2087
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Boundary, { label: label2, resetKeys: [_optionalChain([builder, 'optionalAccess', _122 => _122.site]), resetKey], onError: _optionalChain([builder, 'optionalAccess', _123 => _123.onError]), children });
1987
2088
  }
1988
2089
 
1989
2090
  // src/custom/template-widget.tsx
@@ -2002,9 +2103,9 @@ function compileTemplate(snapshot, registry) {
2002
2103
  return result;
2003
2104
  }
2004
2105
  function compile(snapshot, registry) {
2005
- const label = `${snapshot.type}@${String(snapshot.v)}`;
2106
+ const label2 = `${snapshot.type}@${String(snapshot.v)}`;
2006
2107
  const refuse = (why) => {
2007
- warnOnce(`template:${label}`, `${label} was refused (${why}); rendering nothing for it`);
2108
+ warnOnce(`template:${label2}`, `${label2} was refused (${why}); rendering nothing for it`);
2008
2109
  return null;
2009
2110
  };
2010
2111
  if (snapshot.kind !== "template") return refuse("not a template widget");
@@ -2150,10 +2251,10 @@ function check(raw, registry) {
2150
2251
  }
2151
2252
  function verify(raw, registry) {
2152
2253
  const snapshot = raw;
2153
- const label = `${String(snapshot.type)}@${String(snapshot.v)}`;
2254
+ const label2 = `${String(snapshot.type)}@${String(snapshot.v)}`;
2154
2255
  if (snapshot.disabled === true) return { status: "disabled" };
2155
2256
  const refuse = (why) => {
2156
- warnOnce(`code:${label}`, `Code widget ${label} was refused (${why}); rendering nothing for it`);
2257
+ warnOnce(`code:${label2}`, `Code widget ${label2} was refused (${why}); rendering nothing for it`);
2157
2258
  return { status: "invalid" };
2158
2259
  };
2159
2260
  if (snapshot.kind !== "code") return refuse("not a code widget");
@@ -2204,7 +2305,7 @@ function CodeWidget(props) {
2204
2305
  const src = runs(props, result.snapshot.jsHash);
2205
2306
  if (src !== null) markCodeEmitted();
2206
2307
  const env = newEnv({ settings: props.props, data: props.data, locale: props.locale, mediaOrigin: props.mediaOrigin, budget: new RenderBudget() });
2207
- const label = `${node.type}@${String(node.v)}`;
2308
+ const label2 = `${node.type}@${String(node.v)}`;
2208
2309
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
2209
2310
  NodeWrapper,
2210
2311
  {
@@ -2219,27 +2320,27 @@ function CodeWidget(props) {
2219
2320
  entrance,
2220
2321
  attributes: src === null ? { "data-b-code-inert": "" } : { "data-b-code": result.snapshot.jsHash },
2221
2322
  children: [
2222
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PartBoundary, { label, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Suspense, { fallback: null, children: [
2323
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PartBoundary, { label: label2, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _react.Suspense, { fallback: null, children: [
2223
2324
  template.css === "" ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CustomCss, { css: template.css }),
2224
2325
  renderTemplate(template.ast, env)
2225
2326
  ] }) }),
2226
2327
  src === null && (edit !== void 0 || _optionalChain([props, 'access', _132 => _132.code, 'optionalAccess', _133 => _133.preview]) === true) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "data-b-code-badge": "", style: BADGE, children: "Runs on your store" }) : null,
2227
- src === null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CodeInput, { props: props.props, data: props.data, label }),
2328
+ src === null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CodeInput, { props: props.props, data: props.data, label: label2 }),
2228
2329
  src === null ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { async: true, src })
2229
2330
  ]
2230
2331
  }
2231
2332
  );
2232
2333
  }
2233
- function CodeInput({ props, data, label }) {
2334
+ function CodeInput({ props, data, label: label2 }) {
2234
2335
  let json = "";
2235
2336
  try {
2236
2337
  json = jsonForScript({ props, data });
2237
2338
  if (json.length > MAX_INPUT_CHARS) {
2238
- warnOnce(`code-input:${label}`, `The data of ${label} is too large for its code input; it gets its props only`);
2339
+ warnOnce(`code-input:${label2}`, `The data of ${label2} is too large for its code input; it gets its props only`);
2239
2340
  json = jsonForScript({ props, data: {} });
2240
2341
  }
2241
2342
  } catch (e8) {
2242
- warnOnce(`code-input:${label}`, `The input of ${label} cannot be written as JSON; it gets none`);
2343
+ warnOnce(`code-input:${label2}`, `The input of ${label2} cannot be written as JSON; it gets none`);
2243
2344
  json = jsonForScript({ props: {}, data: {} });
2244
2345
  }
2245
2346
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { type: "application/json", "data-b-code-input": "", children: json });
@@ -2353,16 +2454,22 @@ function widgetDecls(node, device, registry) {
2353
2454
  var ALIGN_ITEMS = { top: "flex-start", center: "center", bottom: "flex-end", stretch: "stretch" };
2354
2455
  var BG_POSITION = /* @__PURE__ */ new Set(["center", "top", "bottom", "left", "right", "top left", "top right", "bottom left", "bottom right"]);
2355
2456
  var BG_SIZE = /* @__PURE__ */ new Set(["cover", "contain", "auto"]);
2356
- function backgroundDecls(out, bg, assets, mediaOrigin) {
2457
+ function backgroundDecls(out, bg, assets, mediaOrigin, device) {
2357
2458
  if (bg === void 0) return;
2358
2459
  put(out, "--tb-bg", bg.color === void 0 ? null : colour(bg.color));
2359
2460
  put(out, "--tb-overlay", bg.overlay === void 0 ? null : colour(bg.overlay));
2360
2461
  if (bg.position !== void 0 && BG_POSITION.has(bg.position)) put(out, "--tb-bgpos", bg.position);
2361
2462
  if (bg.size !== void 0 && BG_SIZE.has(bg.size)) put(out, "--tb-bgsize", bg.size);
2362
- const asset = bg.image === void 0 || assets === void 0 || !Object.hasOwn(assets, bg.image) ? void 0 : assets[bg.image];
2363
- if (asset !== void 0 && _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin }) !== null && URL_QUOTE_SAFE.test(asset.url)) {
2364
- out.set("--tb-bgimg", `url("${asset.url}")`);
2365
- }
2463
+ const asset = backgroundAsset(bg, device, assets, mediaOrigin);
2464
+ if (asset !== void 0) out.set("--tb-bgimg", `url("${asset.url}")`);
2465
+ }
2466
+ function backgroundAsset(bg, device, assets, mediaOrigin) {
2467
+ if (bg === void 0 || assets === void 0) return void 0;
2468
+ const usable = (id) => {
2469
+ const found = id === void 0 || !Object.hasOwn(assets, id) ? void 0 : assets[id];
2470
+ return found !== void 0 && _builderschema.safeUrl.call(void 0, found.url, "src", { mediaOrigin }) !== null && URL_QUOTE_SAFE.test(found.url) ? found : void 0;
2471
+ };
2472
+ return _nullishCoalesce((device === "phone" ? usable(bg.mobileImage) : void 0), () => ( usable(bg.image)));
2366
2473
  }
2367
2474
  function sectionDecls(section, device, assets, mediaOrigin) {
2368
2475
  const out = /* @__PURE__ */ new Map();
@@ -2375,7 +2482,7 @@ function sectionDecls(section, device, assets, mediaOrigin) {
2375
2482
  put(out, "--tb-padx", p.paddingX === void 0 ? null : spacing(p.paddingX));
2376
2483
  if (typeof p.minHeight === "number" && p.minHeight > 0 && p.minHeight <= 2e3) put(out, "--tb-minh", px(p.minHeight));
2377
2484
  if (typeof p.verticalAlign === "string" && Object.hasOwn(ALIGN_ITEMS, p.verticalAlign)) put(out, "--tb-valign", ALIGN_ITEMS[p.verticalAlign]);
2378
- backgroundDecls(out, p.background, assets, mediaOrigin);
2485
+ backgroundDecls(out, p.background, assets, mediaOrigin, device);
2379
2486
  const widths = _builderschema.resolveColumnWidths.call(void 0, section, device);
2380
2487
  const rows = _builderschema.wrapColumnRows.call(void 0, widths);
2381
2488
  const stacked = rows.every((row) => row.length === 1);
@@ -2400,7 +2507,7 @@ function columnDecls(section, index, device, assets, mediaOrigin, widths) {
2400
2507
  if (p.hidden === true) put(out, "--tb-hide", "none");
2401
2508
  if (typeof p.verticalAlign === "string" && Object.hasOwn(ALIGN_ITEMS, p.verticalAlign)) put(out, "--tb-self", ALIGN_ITEMS[p.verticalAlign]);
2402
2509
  put(out, "--tb-pad", p.padding === void 0 ? null : spacing(p.padding));
2403
- backgroundDecls(out, p.background, assets, mediaOrigin);
2510
+ backgroundDecls(out, p.background, assets, mediaOrigin, device);
2404
2511
  return out;
2405
2512
  }
2406
2513
  function collect(doc, registry, assets, mediaOrigin) {
@@ -2631,11 +2738,11 @@ function DrawerRuntime() {
2631
2738
  return null;
2632
2739
  }
2633
2740
  function Collapse(props) {
2634
- const { sectionId, id, px: px2, label, children } = props;
2741
+ const { sectionId, id, px: px2, label: label2, children } = props;
2635
2742
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
2636
2743
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { href: `tb-fr-${sectionId}`, precedence: "throttle", children: collapseCss(sectionId, px2) }),
2637
2744
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-fr", "data-tb-collapse": "", children: [
2638
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-fr-open", "data-tb-drawer-open": "", "aria-expanded": "false", "aria-controls": id, children: label }),
2745
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-fr-open", "data-tb-drawer-open": "", "aria-expanded": "false", "aria-controls": id, children: label2 }),
2639
2746
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { id, className: "tb-fr-body", children: [
2640
2747
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-fr-close", "data-tb-drawer-close": "", "aria-label": "Close", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: "\xD7" }) }),
2641
2748
  children
@@ -3121,7 +3228,34 @@ function renderSection(section, ctx, registry, nested = false) {
3121
3228
  variant.devices.join("-")
3122
3229
  );
3123
3230
  });
3124
- return gated(section, ctx, marker === null ? copies : [marker, ...copies]);
3231
+ const preloads = backgroundPreloads(section, ctx);
3232
+ return gated(section, ctx, marker === null && preloads.length === 0 ? copies : [...marker === null ? [] : [marker], ...preloads, ...copies]);
3233
+ }
3234
+ function backgroundPreloads(section, ctx) {
3235
+ if (ctx.edit !== void 0) return [];
3236
+ const on = (device) => _builderschema.resolveResponsive.call(void 0, section.props, section.responsive, device);
3237
+ const desktopBg = on("desktop").background;
3238
+ const phoneBg = on("phone").background;
3239
+ if (_optionalChain([desktopBg, 'optionalAccess', _157 => _157.priority]) !== true && _optionalChain([phoneBg, 'optionalAccess', _158 => _158.priority]) !== true) return [];
3240
+ const main = _nullishCoalesce(backgroundAsset(desktopBg, "desktop", ctx.assets, ctx.mediaOrigin), () => ( null));
3241
+ const mobile = _nullishCoalesce(backgroundAsset(phoneBg, "phone", ctx.assets, ctx.mediaOrigin), () => ( null));
3242
+ const link = (key, asset, media) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
3243
+ "link",
3244
+ {
3245
+ rel: "preload",
3246
+ as: "image",
3247
+ href: asset.url,
3248
+ fetchPriority: "high",
3249
+ ...media === void 0 ? {} : { media }
3250
+ },
3251
+ key
3252
+ );
3253
+ if (main === null && mobile === null) return [];
3254
+ if (main !== null && mobile !== null && main.url === mobile.url) return [link(`bgp-${section.id}`, main, void 0)];
3255
+ return [
3256
+ ...main === null ? [] : [link(`bgp-${section.id}`, main, "(min-width:768px)")],
3257
+ ...mobile === null ? [] : [link(`bgpm-${section.id}`, mobile, "(max-width:767px)")]
3258
+ ];
3125
3259
  }
3126
3260
  function needsRuntime(doc) {
3127
3261
  let found = false;
@@ -3150,7 +3284,7 @@ function BuilderRenderer(props) {
3150
3284
  const { doc } = _builderschema.upgradeNodes.call(void 0, source, registry);
3151
3285
  const mediaOrigin = _nullishCoalesce(props.mediaOrigin, () => ( ""));
3152
3286
  const interactive = props.interactive !== false;
3153
- const ctx = { registry, data, locale, assets, mediaOrigin, resolveLink, code, edit: editMode, interactive, vpath: _nullishCoalesce(_optionalChain([props, 'access', _157 => _157.idScope, 'optionalAccess', _158 => _158.vpath]), () => ( "")), dupe: _nullishCoalesce(_optionalChain([props, 'access', _159 => _159.idScope, 'optionalAccess', _160 => _160.dupe]), () => ( false)), snapshots: source.customWidgets };
3287
+ const ctx = { registry, data, locale, assets, mediaOrigin, resolveLink, code, edit: editMode, interactive, vpath: _nullishCoalesce(_optionalChain([props, 'access', _159 => _159.idScope, 'optionalAccess', _160 => _160.vpath]), () => ( "")), dupe: _nullishCoalesce(_optionalChain([props, 'access', _161 => _161.idScope, 'optionalAccess', _162 => _162.dupe]), () => ( false)), snapshots: source.customWidgets };
3154
3288
  const css = compileResponsiveCss(doc, registry, assets, mediaOrigin);
3155
3289
  const upgraded = new Map(doc.sections.map((section) => [section.id, section]));
3156
3290
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-root", "data-throttle-part": "builder-root", ...props.scopeCustomCss === true ? { "data-b-root": "" } : {}, children: [
@@ -3160,10 +3294,10 @@ function BuilderRenderer(props) {
3160
3294
  (_nullishCoalesce(expansion.roots, () => ( doc.sections.map((section) => ({ kind: "section", id: section.id }))))).map((root) => {
3161
3295
  if (root.kind === "section") {
3162
3296
  const section2 = upgraded.get(root.id);
3163
- return _optionalChain([section2, 'optionalAccess', _161 => _161.type]) === "section" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: renderSection(section2, ctx, registry) }, root.id) : null;
3297
+ return _optionalChain([section2, 'optionalAccess', _163 => _163.type]) === "section" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: renderSection(section2, ctx, registry) }, root.id) : null;
3164
3298
  }
3165
3299
  const section = root.sectionId === null ? void 0 : upgraded.get(root.sectionId);
3166
- if (_optionalChain([section, 'optionalAccess', _162 => _162.type]) === "section") {
3300
+ if (_optionalChain([section, 'optionalAccess', _164 => _164.type]) === "section") {
3167
3301
  return root.ref.props.hidden === true && ctx.edit === void 0 ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: renderSection(section, ctx, registry) }, root.ref.id);
3168
3302
  }
3169
3303
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MissingSavedSection, { node: root.ref }, root.ref.id);
@@ -3189,8 +3323,8 @@ function localized(value, locale) {
3189
3323
  return Object.values(value).map(str).find((s) => s !== void 0);
3190
3324
  }
3191
3325
  function makeLink(builder, own, mediaOrigin) {
3192
- const targets = _optionalChain([builder, 'optionalAccess', _163 => _163.linkTargets]);
3193
- const fallback = _nullishCoalesce(own, () => ( _optionalChain([builder, 'optionalAccess', _164 => _164.resolveLink])));
3326
+ const targets = _optionalChain([builder, 'optionalAccess', _165 => _165.linkTargets]);
3327
+ const fallback = _nullishCoalesce(own, () => ( _optionalChain([builder, 'optionalAccess', _166 => _166.resolveLink])));
3194
3328
  return (target2) => {
3195
3329
  if (target2.kind === "url") return _builderschema.safeUrl.call(void 0, target2.href, "href", { mediaOrigin });
3196
3330
  if (targets !== void 0 && typeof target2.id === "string") {
@@ -3200,7 +3334,7 @@ function makeLink(builder, own, mediaOrigin) {
3200
3334
  return typeof known === "string" ? _builderschema.safeUrl.call(void 0, known, "href", { mediaOrigin }) : null;
3201
3335
  }
3202
3336
  }
3203
- const raw = _nullishCoalesce(_optionalChain([fallback, 'optionalCall', _165 => _165(target2)]), () => ( null));
3337
+ const raw = _nullishCoalesce(_optionalChain([fallback, 'optionalCall', _167 => _167(target2)]), () => ( null));
3204
3338
  return raw === null ? null : _builderschema.safeUrl.call(void 0, raw, "href", { mediaOrigin });
3205
3339
  };
3206
3340
  }
@@ -3221,11 +3355,11 @@ function build(raw, level, b) {
3221
3355
  raw.forEach((entry, index) => {
3222
3356
  if (!isRecord(entry) || !isRecord(entry.target)) return;
3223
3357
  const target2 = entry.target;
3224
- const label = localized(entry.label, b.r.locale);
3225
- if (label === void 0) return;
3358
+ const label2 = localized(entry.label, b.r.locale);
3359
+ if (label2 === void 0) return;
3226
3360
  out.push({
3227
3361
  key: typeof entry.id === "string" ? entry.id : String(index),
3228
- label,
3362
+ label: label2,
3229
3363
  href: target2.kind === "category" && typeof entry.url === "string" ? _builderschema.safeUrl.call(void 0, entry.url, "href", { mediaOrigin: b.r.mediaOrigin }) : b.r.link(target2),
3230
3364
  newTab: entry.newTab === true,
3231
3365
  classes: Array.isArray(entry.cssClass) ? entry.cssClass.filter((c) => typeof c === "string" && CLASS_RE.test(c)) : [],
@@ -3259,9 +3393,9 @@ var Extras = ({ item, describe }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void
3259
3393
  item.badge === void 0 ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-mm-badge", children: item.badge }),
3260
3394
  describe && item.description !== void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-mm-desc", children: item.description }) : null
3261
3395
  ] });
3262
- function FeaturedPanel({ featured, label, ctx }) {
3396
+ function FeaturedPanel({ featured, label: label2, ctx }) {
3263
3397
  const { builder, props } = ctx;
3264
- const site = _optionalChain([builder, 'optionalAccess', _166 => _166.site]);
3398
+ const site = _optionalChain([builder, 'optionalAccess', _168 => _168.site]);
3265
3399
  if (builder === null || site === void 0 || site.status !== "ok") return null;
3266
3400
  const parts = [site.header, site.footer];
3267
3401
  if (featured.kind === "section") {
@@ -3293,7 +3427,7 @@ function FeaturedPanel({ featured, label, ctx }) {
3293
3427
  }
3294
3428
  if (!isFrozenAsset(asset)) return null;
3295
3429
  const href = featured.link === null ? null : makeLink(builder, props.resolveLink, props.mediaOrigin)(featured.link);
3296
- const image = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset, mediaOrigin: props.mediaOrigin, alt: href === null ? featured.caption : featured.caption || label });
3430
+ const image = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset, mediaOrigin: props.mediaOrigin, alt: href === null ? featured.caption : featured.caption || label2 });
3297
3431
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "tb-mm-feat", children: [
3298
3432
  href === null ? image : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href, children: image }),
3299
3433
  featured.caption === "" ? null : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { children: featured.caption })
@@ -3348,11 +3482,11 @@ var part = (key, extra) => ({
3348
3482
  className: [`tsf-${key}`, extra].filter(Boolean).join(" "),
3349
3483
  "data-throttle-part": key
3350
3484
  });
3351
- function StorefrontNav({ items, label, listId, ctx, className, menu }) {
3485
+ function StorefrontNav({ items, label: label2, listId, ctx, className, menu }) {
3352
3486
  const categories = items.some((item) => item.handle !== void 0);
3353
3487
  const handle = (item, parent) => item.handle === void 0 ? {} : { "data-category-handle": item.handle, ...categories ? { "data-category-parent": parent } : {} };
3354
3488
  const link = (item) => item.href === null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { ...part("category-nav-link", "tb-mm-text"), children: item.label }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { ...part("category-nav-link"), href: item.href, ...item.newTab ? { target: "_blank", rel: "noopener noreferrer" } : {}, children: item.label });
3355
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "nav", { ...part("category-nav", className), "aria-label": label, ...categories ? {} : { "data-menu": menu }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { ...part("category-nav-list"), children: items.map((item) => {
3489
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "nav", { ...part("category-nav", className), "aria-label": label2, ...categories ? {} : { "data-menu": menu }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { ...part("category-nav-list"), children: items.map((item) => {
3356
3490
  const sub = item.children.length > 0;
3357
3491
  const panelId = `${listId}-${item.key.replace(/[^A-Za-z0-9_-]/g, "_")}`;
3358
3492
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { ...part("category-nav-item", item.classes.join(" ")), "data-nav-top": "", ...sub ? { "data-tb-i": "" } : {}, ...handle(item, ""), children: [
@@ -3373,11 +3507,11 @@ function StorefrontNav({ items, label, listId, ctx, className, menu }) {
3373
3507
  ] }, item.key);
3374
3508
  }) }) });
3375
3509
  }
3376
- function Nav({ items, label, listId, ctx, className, menu }) {
3377
- if (ctx.variant === "storefront") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StorefrontNav, { items, label, listId, ctx, menu, ...className === void 0 ? {} : { className } });
3510
+ function Nav({ items, label: label2, listId, ctx, className, menu }) {
3511
+ if (ctx.variant === "storefront") return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StorefrontNav, { items, label: label2, listId, ctx, menu, ...className === void 0 ? {} : { className } });
3378
3512
  const full = { ...ctx, listId };
3379
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: `tb-mm tb-mm--${ctx.mode}${className === void 0 ? "" : ` ${className}`}`, "aria-label": label, children: [
3380
- ctx.mode === "drawer" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-mm-drawer", "data-tb-drawer": "", "aria-expanded": "false", "aria-controls": listId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: "menu", size: 24, label }) }),
3513
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: `tb-mm tb-mm--${ctx.mode}${className === void 0 ? "" : ` ${className}`}`, "aria-label": label2, children: [
3514
+ ctx.mode === "drawer" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-mm-drawer", "data-tb-drawer": "", "aria-expanded": "false", "aria-controls": listId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: "menu", size: 24, label: label2 }) }),
3381
3515
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, List2, { items, top: { id: listId }, ctx: full })
3382
3516
  ] });
3383
3517
  }
@@ -3394,21 +3528,21 @@ function MenuV2(props) {
3394
3528
  const forMenu = (menu, raw) => build(_builderschema.expandMenu.call(void 0, Array.isArray(raw) ? raw : [], categories).menu, 1, { r, menu, mega: mode === "mega" });
3395
3529
  let items = [];
3396
3530
  let mobile = [];
3397
- const site = _optionalChain([builder, 'optionalAccess', _167 => _167.site]);
3398
- const menus = _optionalChain([site, 'optionalAccess', _168 => _168.status]) === "ok" && isRecord(site.settings.menus) ? site.settings.menus : void 0;
3531
+ const site = _optionalChain([builder, 'optionalAccess', _169 => _169.site]);
3532
+ const menus = _optionalChain([site, 'optionalAccess', _170 => _170.status]) === "ok" && isRecord(site.settings.menus) ? site.settings.menus : void 0;
3399
3533
  if (menus !== void 0) {
3400
3534
  items = Object.hasOwn(menus, name) ? forMenu(name, menus[name]) : [];
3401
3535
  if (name === "header" && Object.hasOwn(menus, "mobile")) mobile = forMenu("mobile", menus.mobile);
3402
- } else if (_optionalChain([design, 'optionalAccess', _169 => _169.menus]) !== void 0 && Object.hasOwn(design.menus, name)) {
3536
+ } else if (_optionalChain([design, 'optionalAccess', _171 => _171.menus]) !== void 0 && Object.hasOwn(design.menus, name)) {
3403
3537
  items = fromDesign(_nullishCoalesce(design.menus[name], () => ( [])), 1, r);
3404
3538
  }
3405
3539
  const word = (key, fallback) => {
3406
- for (const strings of [_optionalChain([site, 'optionalAccess', _170 => _170.status]) === "ok" ? site.settings.strings : void 0, _optionalChain([design, 'optionalAccess', _171 => _171.strings])]) {
3540
+ for (const strings of [_optionalChain([site, 'optionalAccess', _172 => _172.status]) === "ok" ? site.settings.strings : void 0, _optionalChain([design, 'optionalAccess', _173 => _173.strings])]) {
3407
3541
  if (isRecord(strings) && Object.hasOwn(strings, key) && str(strings[key]) !== void 0) return strings[key];
3408
3542
  }
3409
3543
  return fallback;
3410
3544
  };
3411
- const label = word("nav.menu", _builderschema.SITE_STRING_DEFAULTS["nav.menu"]);
3545
+ const label2 = word("nav.menu", _builderschema.SITE_STRING_DEFAULTS["nav.menu"]);
3412
3546
  if (items.length === 0 && mobile.length === 0) {
3413
3547
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3414
3548
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
@@ -3416,7 +3550,7 @@ function MenuV2(props) {
3416
3550
  ] });
3417
3551
  }
3418
3552
  const ctx = { builder, props, mode, variant: oneOf(settings.variant, ["default", "storefront"], "default"), submenu: word("nav.submenu", frameSubmenu(word("frame.nav.submenu", ""))) };
3419
- const nameOf = (menu) => menu === "header" ? label : `${label} (${menu})`;
3553
+ const nameOf = (menu) => menu === "header" ? label2 : `${label2} (${menu})`;
3420
3554
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
3421
3555
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
3422
3556
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { href: "tb-menu-v2", precedence: "throttle", children: MENU_V2_CSS }),
@@ -3513,7 +3647,7 @@ function writeDismissed(id) {
3513
3647
  } catch (e10) {
3514
3648
  }
3515
3649
  }
3516
- var matches = (query) => _optionalChain([window, 'access', _172 => _172.matchMedia, 'optionalCall', _173 => _173(query), 'access', _174 => _174.matches]) === true;
3650
+ var matches = (query) => _optionalChain([window, 'access', _174 => _174.matchMedia, 'optionalCall', _175 => _175(query), 'access', _176 => _176.matches]) === true;
3517
3651
  function deviceNow() {
3518
3652
  return matches("(max-width:767.98px)") ? "phone" : matches("(max-width:1024.98px)") ? "tablet" : "desktop";
3519
3653
  }
@@ -3541,13 +3675,13 @@ function MessageText({ message, locale, mediaOrigin, href }) {
3541
3675
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-an-text", children: inline(tree.children) });
3542
3676
  }
3543
3677
  function pageOf2(builder) {
3544
- const given = _optionalChain([builder, 'optionalAccess', _175 => _175.page]);
3678
+ const given = _optionalChain([builder, 'optionalAccess', _177 => _177.page]);
3545
3679
  if (given !== void 0) return given;
3546
- return { home: _optionalChain([builder, 'optionalAccess', _176 => _176.pathname]) === "/" };
3680
+ return { home: _optionalChain([builder, 'optionalAccess', _178 => _178.pathname]) === "/" };
3547
3681
  }
3548
3682
  function audienceOf(ready, viewer) {
3549
- if (!ready || viewer === null || _optionalChain([viewer, 'optionalAccess', _177 => _177.signedIn]) === null) return "all";
3550
- return _optionalChain([viewer, 'optionalAccess', _178 => _178.signedIn]) === true ? "signed-in" : "guest";
3683
+ if (!ready || viewer === null || _optionalChain([viewer, 'optionalAccess', _179 => _179.signedIn]) === null) return "all";
3684
+ return _optionalChain([viewer, 'optionalAccess', _180 => _180.signedIn]) === true ? "signed-in" : "guest";
3551
3685
  }
3552
3686
  function Bar({ raw, props, builder }) {
3553
3687
  const { props: settings, mediaOrigin, locale, editMode } = props;
@@ -3562,8 +3696,8 @@ function Bar({ raw, props, builder }) {
3562
3696
  const [hover, setHover] = _react.useState.call(void 0, false);
3563
3697
  const [focus, setFocus] = _react.useState.call(void 0, false);
3564
3698
  const [reduced2, setReduced] = _react.useState.call(void 0, false);
3565
- const site = _optionalChain([builder, 'optionalAccess', _179 => _179.site]);
3566
- const loadedAt = _optionalChain([site, 'optionalAccess', _180 => _180.status]) === "ok" && site.loadedAt !== void 0 ? Date.parse(site.loadedAt) : Number.NaN;
3699
+ const site = _optionalChain([builder, 'optionalAccess', _181 => _181.site]);
3700
+ const loadedAt = _optionalChain([site, 'optionalAccess', _182 => _182.status]) === "ok" && site.loadedAt !== void 0 ? Date.parse(site.loadedAt) : Number.NaN;
3567
3701
  const now = ready || Number.isNaN(loadedAt) ? Date.now() : loadedAt;
3568
3702
  const page = pageOf2(builder);
3569
3703
  const eligible = eligibleOnAnyDevice(all2, now, audienceOf(ready, viewer), page);
@@ -3583,12 +3717,12 @@ function Bar({ raw, props, builder }) {
3583
3717
  setDismissed(new Set(readDismissed(all2.map((m) => m.id))));
3584
3718
  }, [all2]);
3585
3719
  _react.useEffect.call(void 0, () => {
3586
- const query = _optionalChain([window, 'access', _181 => _181.matchMedia, 'optionalCall', _182 => _182(REDUCED)]);
3720
+ const query = _optionalChain([window, 'access', _183 => _183.matchMedia, 'optionalCall', _184 => _184(REDUCED)]);
3587
3721
  if (query === void 0) return void 0;
3588
3722
  const sync = () => setReduced(query.matches);
3589
3723
  sync();
3590
- _optionalChain([query, 'access', _183 => _183.addEventListener, 'optionalCall', _184 => _184("change", sync)]);
3591
- return () => _optionalChain([query, 'access', _185 => _185.removeEventListener, 'optionalCall', _186 => _186("change", sync)]);
3724
+ _optionalChain([query, 'access', _185 => _185.addEventListener, 'optionalCall', _186 => _186("change", sync)]);
3725
+ return () => _optionalChain([query, 'access', _187 => _187.removeEventListener, 'optionalCall', _188 => _188("change", sync)]);
3592
3726
  }, []);
3593
3727
  const step2 = (direction) => setAt((from) => {
3594
3728
  const list2 = shownRef.current;
@@ -3614,7 +3748,7 @@ function Bar({ raw, props, builder }) {
3614
3748
  if (shown2.length === 0 && !reserve) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "No announcement is showing now" });
3615
3749
  const link = makeLink(builder, props.resolveLink, mediaOrigin);
3616
3750
  const word = (key, fallback) => {
3617
- for (const strings of [_optionalChain([site, 'optionalAccess', _187 => _187.status]) === "ok" ? site.settings.strings : void 0, _optionalChain([design, 'optionalAccess', _188 => _188.strings])]) {
3751
+ for (const strings of [_optionalChain([site, 'optionalAccess', _189 => _189.status]) === "ok" ? site.settings.strings : void 0, _optionalChain([design, 'optionalAccess', _190 => _190.strings])]) {
3618
3752
  if (isRecord(strings) && Object.hasOwn(strings, key) && str(strings[key]) !== void 0) return strings[key];
3619
3753
  }
3620
3754
  return fallback;
@@ -3683,8 +3817,8 @@ function Bar({ raw, props, builder }) {
3683
3817
  }
3684
3818
  function AnnouncementV2(props) {
3685
3819
  const builder = useBuilder();
3686
- const site = _optionalChain([builder, 'optionalAccess', _189 => _189.site]);
3687
- const raw = _optionalChain([site, 'optionalAccess', _190 => _190.status]) === "ok" && isRecord(site.settings.announcement) ? site.settings.announcement : null;
3820
+ const site = _optionalChain([builder, 'optionalAccess', _191 => _191.site]);
3821
+ const raw = _optionalChain([site, 'optionalAccess', _192 => _192.status]) === "ok" && isRecord(site.settings.announcement) ? site.settings.announcement : null;
3688
3822
  if (raw === null || !Array.isArray(raw.messages)) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Announcement, { ...props });
3689
3823
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Bar, { raw, props, builder });
3690
3824
  }
@@ -3746,8 +3880,8 @@ function Breadcrumbs({ props, data, mediaOrigin, resolveLink, editMode }) {
3746
3880
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "The trail appears on a product page" })
3747
3881
  ] });
3748
3882
  }
3749
- const href = (target2) => _builderschema.safeUrl.call(void 0, _optionalChain([resolveLink, 'optionalCall', _191 => _191(target2)]), "href", { mediaOrigin });
3750
- const trail = [{ name: _nullishCoalesce(str(_optionalChain([design, 'optionalAccess', _192 => _192.brand, 'optionalAccess', _193 => _193.storeName, 'optionalAccess', _194 => _194.trim, 'call', _195 => _195()])), () => ( "Home")), href: "/" }];
3883
+ const href = (target2) => _builderschema.safeUrl.call(void 0, _optionalChain([resolveLink, 'optionalCall', _193 => _193(target2)]), "href", { mediaOrigin });
3884
+ const trail = [{ name: _nullishCoalesce(str(_optionalChain([design, 'optionalAccess', _194 => _194.brand, 'optionalAccess', _195 => _195.storeName, 'optionalAccess', _196 => _196.trim, 'call', _197 => _197()])), () => ( "Home")), href: "/" }];
3751
3885
  for (const step2 of Array.isArray(product.breadcrumbs) ? product.breadcrumbs : []) {
3752
3886
  if (!isRecord(step2) || str(step2.name) === void 0) continue;
3753
3887
  const handle2 = str(step2.handle);
@@ -3934,7 +4068,7 @@ function checkUrls(tag, props, mediaOrigin) {
3934
4068
  function renderMarkup(nodes, options = {}) {
3935
4069
  return nodes.map((node, index) => {
3936
4070
  if (typeof node === "string") return node;
3937
- const props = { ...propsOf(node, index), ..._nullishCoalesce(_optionalChain([options, 'access', _196 => _196.extra, 'optionalCall', _197 => _197(node)]), () => ( {})) };
4071
+ const props = { ...propsOf(node, index), ..._nullishCoalesce(_optionalChain([options, 'access', _198 => _198.extra, 'optionalCall', _199 => _199(node)]), () => ( {})) };
3938
4072
  if (!checkUrls(node.tag, props, _nullishCoalesce(options.mediaOrigin, () => ( "")))) return null;
3939
4073
  if (VOID2.has(node.tag)) return _react.createElement.call(void 0, node.tag, props);
3940
4074
  return _react.createElement.call(void 0, node.tag, props, ...renderMarkup(node.children, options));
@@ -3951,7 +4085,7 @@ function svgElement(svg) {
3951
4085
  async function readSvg(response, mediaOrigin) {
3952
4086
  if (!response.ok || _builderschema.safeUrl.call(void 0, response.url, "src", { mediaOrigin }) === null) return null;
3953
4087
  if (!/^image\/svg\+xml(?:\s*;|$)/iu.test(_nullishCoalesce(response.headers.get("content-type"), () => ( "")))) return null;
3954
- const reader = _optionalChain([response, 'access', _198 => _198.body, 'optionalAccess', _199 => _199.getReader, 'call', _200 => _200()]);
4088
+ const reader = _optionalChain([response, 'access', _200 => _200.body, 'optionalAccess', _201 => _201.getReader, 'call', _202 => _202()]);
3955
4089
  if (reader === void 0) {
3956
4090
  const text3 = await response.text();
3957
4091
  return new TextEncoder().encode(text3).length > _builderschema.SVG_MAX_BYTES ? null : text3;
@@ -3970,7 +4104,7 @@ async function readSvg(response, mediaOrigin) {
3970
4104
  text2 += decoder.decode(value, { stream: true });
3971
4105
  }
3972
4106
  }
3973
- function SvgFromAsset({ asset, mediaOrigin, label }) {
4107
+ function SvgFromAsset({ asset, mediaOrigin, label: label2 }) {
3974
4108
  const src = isFrozenAsset(asset) ? _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin }) : null;
3975
4109
  const [source, setSource] = _react.useState.call(void 0, null);
3976
4110
  _react.useEffect.call(void 0, () => {
@@ -3984,7 +4118,7 @@ function SvgFromAsset({ asset, mediaOrigin, label }) {
3984
4118
  if (src === null) return null;
3985
4119
  const inline2 = source === null ? null : svgElement(source);
3986
4120
  if (inline2 !== null) return inline2;
3987
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset, mediaOrigin, alt: _nullishCoalesce(label, () => ( "")), loading: "eager" });
4121
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset, mediaOrigin, alt: _nullishCoalesce(label2, () => ( "")), loading: "eager" });
3988
4122
  }
3989
4123
 
3990
4124
  // src/basics/v2/faq.tsx
@@ -4020,7 +4154,7 @@ function Faq({ props, mediaOrigin, editMode }) {
4020
4154
  const jsonLd = builder !== null && builder.site.status === "ok" && faqJsonLdOn(builder.site.settings) ? jsonLdString(faqJsonLd(items.map((item, index) => ({ question: item.question, answer: textOf2(_nullishCoalesce(answers[index], () => ( []))).trim() })))) : null;
4021
4155
  const toggleAll = () => {
4022
4156
  const next = !all2;
4023
- for (const details of _nullishCoalesce(_optionalChain([root, 'access', _201 => _201.current, 'optionalAccess', _202 => _202.querySelectorAll, 'call', _203 => _203("details")]), () => ( []))) details.open = next;
4157
+ for (const details of _nullishCoalesce(_optionalChain([root, 'access', _203 => _203.current, 'optionalAccess', _204 => _204.querySelectorAll, 'call', _205 => _205("details")]), () => ( []))) details.open = next;
4024
4158
  setAll(next);
4025
4159
  };
4026
4160
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
@@ -4084,7 +4218,7 @@ function mergeV2Widgets(v1, v2) {
4084
4218
  // src/basics/v2/quote.tsx
4085
4219
 
4086
4220
  function Quote({ props, mediaOrigin, editMode, inlineEdit }) {
4087
- const quote = _nullishCoalesce(_optionalChain([inlineEdit, 'optionalCall', _204 => _204("quote")]), () => ( str(props.quote)));
4221
+ const quote = _nullishCoalesce(_optionalChain([inlineEdit, 'optionalCall', _206 => _206("quote")]), () => ( str(props.quote)));
4088
4222
  if (quote === void 0) {
4089
4223
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4090
4224
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicV2Styles, {}),
@@ -4120,9 +4254,9 @@ function headings(nodes, nodeId) {
4120
4254
  for (const node of list2) {
4121
4255
  if (typeof node === "string") continue;
4122
4256
  if (node.tag === "h2" || node.tag === "h3") {
4123
- const label = textOf2(node.children).replace(/\s+/gu, " ").trim();
4257
+ const label2 = textOf2(node.children).replace(/\s+/gu, " ").trim();
4124
4258
  const n = found.size + 1;
4125
- found.set(node, { id: `${nodeId}-${String(n)}${slug(label) === "" ? "" : `-${slug(label)}`}`, level: node.tag === "h2" ? 2 : 3, label });
4259
+ found.set(node, { id: `${nodeId}-${String(n)}${slug(label2) === "" ? "" : `-${slug(label2)}`}`, level: node.tag === "h2" ? 2 : 3, label: label2 });
4126
4260
  }
4127
4261
  visit(node.children);
4128
4262
  }
@@ -4164,7 +4298,7 @@ var richContentWidgets = [{ ...mbDefinition("basic.rich-content"), Component: Ri
4164
4298
 
4165
4299
  function Svg({ props, mediaOrigin, editMode }) {
4166
4300
  const pasted = str(props.svg);
4167
- const label = str(props.label);
4301
+ const label2 = str(props.label);
4168
4302
  const inline2 = pasted === void 0 ? null : svgElement(pasted);
4169
4303
  const asset = pasted === void 0 && props.asset !== null && props.asset !== void 0 ? props.asset : null;
4170
4304
  if (inline2 === null && asset === null) {
@@ -4174,14 +4308,1375 @@ function Svg({ props, mediaOrigin, editMode }) {
4174
4308
  ] });
4175
4309
  }
4176
4310
  const decorative = props.decorative !== false;
4177
- const access = decorative ? { "aria-hidden": true } : label === void 0 ? {} : { role: "img", "aria-label": label };
4311
+ const access = decorative ? { "aria-hidden": true } : label2 === void 0 ? {} : { role: "img", "aria-label": label2 };
4178
4312
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4179
4313
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicV2Styles, {}),
4180
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-svg", ...access, children: _nullishCoalesce(inline2, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SvgFromAsset, { asset, mediaOrigin, ...label === void 0 || decorative ? {} : { label } }))) })
4314
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-svg", ...access, children: _nullishCoalesce(inline2, () => ( /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SvgFromAsset, { asset, mediaOrigin, ...label2 === void 0 || decorative ? {} : { label: label2 } }))) })
4181
4315
  ] });
4182
4316
  }
4183
4317
  var svgWidgets = [{ ...mbDefinition("basic.svg"), Component: Svg }];
4184
4318
 
4319
+ // src/basics/r23/feature-grid.tsx
4320
+
4321
+
4322
+
4323
+
4324
+ // src/basics/r23/shared.tsx
4325
+
4326
+
4327
+ function r23Definition(type) {
4328
+ const found = _builderschema.BASIC_WIDGET_DEFINITIONS.filter((d) => d.type === type).sort((a, b) => b.v - a.v)[0];
4329
+ if (found === void 0) throw new Error(`No R2.3 definition of ${type}`);
4330
+ return found;
4331
+ }
4332
+ var rowsOf = (value) => Array.isArray(value) ? value.flatMap((row) => isRecord(row) ? [row] : []) : [];
4333
+ var fill = (template, vars) => template.replace(/\{([a-z]+)\}/gu, (whole, name) => Object.hasOwn(vars, name) ? vars[name] : whole);
4334
+ var textOf3 = (value) => typeof value === "string" ? value : "";
4335
+ function usableAsset(value, mediaOrigin) {
4336
+ return isFrozenAsset(value) && _builderschema.safeUrl.call(void 0, value.url, "src", { mediaOrigin }) !== null ? value : null;
4337
+ }
4338
+ var srcSetOf = (asset, mediaOrigin) => asset.variants.flatMap((variant) => {
4339
+ const url = _builderschema.safeUrl.call(void 0, variant.url, "src", { mediaOrigin });
4340
+ return url === null || url.includes(",") ? [] : [`${url} ${String(variant.width)}w`];
4341
+ }).join(", ");
4342
+ function PictureImage({
4343
+ asset,
4344
+ mobile,
4345
+ mediaOrigin,
4346
+ alt,
4347
+ sizes,
4348
+ priority = false,
4349
+ className
4350
+ }) {
4351
+ const src = _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin });
4352
+ if (src === null) return null;
4353
+ const srcSet = srcSetOf(asset, mediaOrigin);
4354
+ const img = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4355
+ "img",
4356
+ {
4357
+ src,
4358
+ ...srcSet === "" ? {} : { srcSet, sizes },
4359
+ width: asset.width,
4360
+ height: asset.height,
4361
+ alt,
4362
+ loading: priority ? "eager" : "lazy",
4363
+ ...priority ? { fetchPriority: "high" } : {},
4364
+ decoding: "async",
4365
+ ...className === void 0 ? {} : { className }
4366
+ }
4367
+ );
4368
+ if (mobile === null || mobile === void 0) return img;
4369
+ const mobileSrc = _builderschema.safeUrl.call(void 0, mobile.url, "src", { mediaOrigin });
4370
+ if (mobileSrc === null) return img;
4371
+ const mobileSet = srcSetOf(mobile, mediaOrigin);
4372
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "picture", { children: [
4373
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4374
+ "source",
4375
+ {
4376
+ media: "(max-width: 767px)",
4377
+ srcSet: mobileSet === "" ? mobileSrc : mobileSet,
4378
+ ...mobileSet === "" ? {} : { sizes: "100vw" },
4379
+ width: mobile.width,
4380
+ height: mobile.height
4381
+ }
4382
+ ),
4383
+ img
4384
+ ] });
4385
+ }
4386
+ var R23_CSS = `@layer throttle{
4387
+ .tb-b-sr{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
4388
+ .tb-b-iwt{display:flex;flex-direction:var(--bx-dir,row);gap:var(--tb-space-l);align-items:stretch}
4389
+ .tb-b-iwt-media{flex:var(--bx-mediaFr,1) 1 0;min-inline-size:0}
4390
+ .tb-b-iwt-media img{display:block;inline-size:100%;block-size:auto;aspect-ratio:var(--bx-ratio,auto);object-fit:cover;border-radius:var(--throttle-radius,8px)}
4391
+ .tb-b-iwt-content{flex:var(--bx-textFr,1) 1 0;min-inline-size:0;align-self:var(--bx-self,center);box-sizing:border-box;padding:var(--tb-space-m);background:var(--b-cardBackground,transparent);border-radius:var(--throttle-radius,8px);margin-inline-start:calc(var(--bx-overlap,0rem)*var(--bx-sa,0));margin-inline-end:calc(var(--bx-overlap,0rem)*var(--bx-ea,0));position:relative}
4392
+ .tb-b-iwt-kicker{margin:0 0 var(--tb-space-xs);font-size:var(--tb-text-s);letter-spacing:.08em;text-transform:uppercase;color:var(--tb-color-muted-foreground,inherit)}
4393
+ .tb-b-iwt-title{margin:0 0 var(--tb-space-s);font-family:var(--throttle-font-family-heading,inherit);line-height:1.2;overflow-wrap:anywhere}
4394
+ .tb-b-iwt-text{line-height:1.6;overflow-wrap:anywhere}
4395
+ .tb-b-iwt-text>:first-child{margin-block-start:0}
4396
+ .tb-b-iwt-content .tb-b-button{margin-block-start:var(--tb-space-s);min-block-size:44px;box-sizing:border-box}
4397
+ .tb-b-iwt-content a:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
4398
+ @media (max-width:767px){.tb-b-iwt{flex-direction:var(--bx-pdir,column);gap:var(--tb-space-m)}.tb-b-iwt-media,.tb-b-iwt-content{flex:0 0 auto;align-self:stretch}.tb-b-iwt-content{margin-inline:0}}
4399
+ .tb-b-fg{display:grid;grid-template-columns:repeat(var(--b-columnsDesktop,3),minmax(0,1fr));gap:var(--tb-space-m);margin:0;padding:0;list-style:none;text-align:var(--b-align,left)}
4400
+ @media (max-width:1024px){.tb-b-fg{grid-template-columns:repeat(var(--b-columnsTablet,2),minmax(0,1fr))}}
4401
+ @media (max-width:767px){.tb-b-fg{grid-template-columns:repeat(var(--b-columnsMobile,1),minmax(0,1fr))}}
4402
+ .tb-b-fg-item{display:flex;flex-direction:column;gap:var(--tb-space-s);box-sizing:border-box;min-inline-size:0;align-items:var(--b-align-items,stretch)}
4403
+ .tb-b-fg--left .tb-b-fg-item{flex-direction:row;align-items:flex-start}
4404
+ .tb-b-fg--card .tb-b-fg-item,.tb-b-fg--bordered .tb-b-fg-item{padding:var(--tb-space-m);border-radius:var(--throttle-radius,8px)}
4405
+ .tb-b-fg--card .tb-b-fg-item{background:var(--tb-color-surface,var(--tb-color-muted,#f4f4f4))}
4406
+ .tb-b-fg--bordered .tb-b-fg-item{border:1px solid var(--tb-color-border,currentColor)}
4407
+ .tb-b-fg-media{flex:0 0 auto;display:inline-flex;color:var(--b-iconColor,var(--tb-color-primary,currentColor))}
4408
+ .tb-b-fg-media svg,.tb-b-fg-media img{inline-size:calc(var(--b-iconSize,40)*1px);block-size:calc(var(--b-iconSize,40)*1px);object-fit:cover}
4409
+ .tb-b-fg-title{margin:0;font-family:var(--throttle-font-family-heading,inherit);font-size:var(--tb-text-l);line-height:1.25}
4410
+ .tb-b-fg-title a{color:inherit;display:inline-block;min-block-size:44px;line-height:44px}
4411
+ .tb-b-fg-title a:focus-visible,.tb-b-badge a:focus-visible,.tb-b-logos a:focus-visible,.tb-b-social a:focus-visible,.tb-b-tm-btn:focus-visible,.tb-b-logos-pause:focus-visible,.tb-b-tm-list:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
4412
+ .tb-b-fg-text>:first-child{margin-block-start:0}
4413
+ .tb-b-fg-text>:last-child{margin-block-end:0}
4414
+ .tb-b-fg-body{min-inline-size:0;display:flex;flex-direction:column;gap:var(--tb-space-xs)}
4415
+ .tb-b-tm{color:var(--b-color,inherit);font-size:var(--b-size,var(--tb-text-m));text-align:var(--b-align,left);position:relative}
4416
+ .tb-b-tm-list{margin:0;padding:0;list-style:none}
4417
+ .tb-b-tm--grid .tb-b-tm-list{display:grid;grid-template-columns:repeat(var(--b-columnsDesktop,3),minmax(0,1fr));gap:var(--tb-space-m)}
4418
+ .tb-b-tm--masonry .tb-b-tm-list{column-count:var(--b-columnsDesktop,3);column-gap:var(--tb-space-m)}
4419
+ .tb-b-tm--masonry .tb-b-tm-list>li{break-inside:avoid;margin-block-end:var(--tb-space-m)}
4420
+ .tb-b-tm--carousel .tb-b-tm-list{display:flex;gap:var(--tb-space-m);overflow-x:auto;scroll-snap-type:x mandatory;scrollbar-width:thin;overscroll-behavior-x:contain}
4421
+ .tb-b-tm--carousel .tb-b-tm-slide{flex:0 0 calc((100% - (var(--b-columnsDesktop,3) - 1)*var(--tb-space-m))/var(--b-columnsDesktop,3));scroll-snap-align:start;min-inline-size:0}
4422
+ @media (max-width:1024px){.tb-b-tm--grid .tb-b-tm-list{grid-template-columns:repeat(min(var(--b-columnsDesktop,3),2),minmax(0,1fr))}.tb-b-tm--masonry .tb-b-tm-list{column-count:min(var(--b-columnsDesktop,3),2)}.tb-b-tm--carousel .tb-b-tm-slide{flex-basis:calc((100% - var(--tb-space-m))/min(var(--b-columnsDesktop,3),2))}}
4423
+ @media (max-width:767px){.tb-b-tm--grid .tb-b-tm-list{grid-template-columns:repeat(var(--b-columnsMobile,1),minmax(0,1fr))}.tb-b-tm--masonry .tb-b-tm-list{column-count:var(--b-columnsMobile,1)}.tb-b-tm--carousel .tb-b-tm-slide{flex-basis:calc((100% - (var(--b-columnsMobile,1) - 1)*var(--tb-space-m))/var(--b-columnsMobile,1))}}
4424
+ .tb-b-tm-card{margin:0;box-sizing:border-box;block-size:100%;display:flex;flex-direction:column;gap:var(--tb-space-s)}
4425
+ .tb-b-tm--card .tb-b-tm-card,.tb-b-tm--bordered .tb-b-tm-card{padding:var(--tb-space-m);border-radius:var(--throttle-radius,8px)}
4426
+ .tb-b-tm--card .tb-b-tm-card{background:var(--tb-color-surface,var(--tb-color-muted,#f4f4f4))}
4427
+ .tb-b-tm--bordered .tb-b-tm-card{border:1px solid var(--tb-color-border,currentColor)}
4428
+ .tb-b-tm-card blockquote{margin:0;line-height:1.5;overflow-wrap:anywhere}
4429
+ .tb-b-tm-card figcaption{display:flex;align-items:center;gap:var(--tb-space-s);font-size:var(--tb-text-s)}
4430
+ .tb-b-tm-photo{inline-size:44px;block-size:44px;border-radius:50%;object-fit:cover;flex:0 0 auto}
4431
+ .tb-b-tm-by{display:flex;flex-direction:column}
4432
+ .tb-b-tm-name{font-weight:600}
4433
+ .tb-b-tm-role,.tb-b-tm-source{color:var(--tb-color-muted-foreground,inherit)}
4434
+ .tb-b-tm-rating{margin:0;display:flex;gap:2px}
4435
+ .tb-b-star{position:relative;display:inline-block;color:var(--tb-color-border-control,#bbb);line-height:1}
4436
+ .tb-b-star--full{color:var(--tb-color-accent,#f5a623)}
4437
+ .tb-b-star--half::before{content:"\\2605";position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:50%;overflow:hidden;color:var(--tb-color-accent,#f5a623)}
4438
+ .tb-b-tm-ctrl{display:flex;justify-content:center;gap:var(--tb-space-s);margin-block-start:var(--tb-space-s);min-block-size:44px}
4439
+ .tb-b-tm-ctrl--wait{visibility:hidden}
4440
+ @media (prefers-reduced-motion:reduce){.tb-b-tm-pause{display:none}}
4441
+ .tb-b-tm-btn{appearance:none;cursor:pointer;font:inherit;color:inherit;background:var(--tb-color-surface,transparent);border:1px solid var(--tb-color-border-control,currentColor);border-radius:999px;min-inline-size:44px;min-block-size:44px;padding:0 var(--tb-space-m)}
4442
+ .tb-b-tm-btn[hidden]{display:none}
4443
+ @media (prefers-reduced-motion:reduce){.tb-b-tm-list{scroll-behavior:auto}}
4444
+ .tb-b-logos{text-align:var(--b-align,center)}
4445
+ .tb-b-logos-title{margin:0 0 var(--tb-space-s);font-size:var(--tb-text-s);letter-spacing:.08em;text-transform:uppercase;color:var(--tb-color-muted-foreground,inherit)}
4446
+ .tb-b-logos-list{margin:0;padding:0;list-style:none}
4447
+ .tb-b-logos--row .tb-b-logos-list>li,.tb-b-logos--grid .tb-b-logos-list>li{display:inline-flex;align-items:center;justify-content:center;margin:calc(var(--b-gap,var(--tb-space-m))/2)}
4448
+ .tb-b-logos--grid .tb-b-logos-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(8rem,1fr));gap:var(--b-gap,var(--tb-space-m));justify-items:center;align-items:center}
4449
+ .tb-b-logos--grid .tb-b-logos-list>li{margin:0}
4450
+ @media (max-width:767px){.tb-b-logos--grid .tb-b-logos-list{grid-template-columns:repeat(var(--b-columnsMobile,2),minmax(0,1fr))}}
4451
+ .tb-b-logos img{display:block;inline-size:auto;max-inline-size:100%;block-size:calc(var(--b-logoHeight,40)*1px);object-fit:contain;filter:grayscale(var(--b-grayscale,0));opacity:calc(1 - var(--b-grayscale,0)*.25)}
4452
+ .tb-b-logos a{display:inline-flex;align-items:center;min-block-size:44px}
4453
+ .tb-b-logos-warn{padding:var(--tb-space-xs);border:1px dashed currentColor;font-size:var(--tb-text-s)}
4454
+ .tb-b-logos--marquee .tb-b-logos-track{display:flex;overflow-x:auto;scrollbar-width:none}
4455
+ .tb-b-logos--marquee .tb-b-logos-track::-webkit-scrollbar{display:none}
4456
+ .tb-b-logos--marquee .tb-b-logos-list{display:flex;flex:0 0 auto;flex-wrap:nowrap;align-items:center;gap:var(--b-gap,var(--tb-space-m));padding-inline-end:var(--b-gap,var(--tb-space-m))}
4457
+ .tb-b-logos--marquee .tb-b-logos-list>li{flex:0 0 auto;margin:0}
4458
+ .tb-b-logos--marquee.is-live .tb-b-logos-track{inline-size:max-content;animation:tb-b-marquee var(--bx-speed,40s) linear infinite}
4459
+ .tb-b-logos--marquee.is-live{overflow:hidden}
4460
+ :dir(rtl) .tb-b-logos--marquee.is-live .tb-b-logos-track{animation-name:tb-b-marquee-rtl}
4461
+ .tb-b-logos--marquee.is-live.is-paused .tb-b-logos-track,.tb-b-logos--marquee.is-live:hover .tb-b-logos-track,.tb-b-logos--marquee.is-live:focus-within .tb-b-logos-track{animation-play-state:paused}
4462
+ @keyframes tb-b-marquee{to{transform:translateX(-50%)}}
4463
+ @keyframes tb-b-marquee-rtl{to{transform:translateX(50%)}}
4464
+ @media (prefers-reduced-motion:reduce){.tb-b-logos--marquee.is-live .tb-b-logos-track{animation:none}.tb-b-logos-pause{display:none}}
4465
+ .tb-b-logos-pause{appearance:none;cursor:pointer;font:inherit;color:inherit;background:var(--tb-color-surface,transparent);border:1px solid var(--tb-color-border-control,currentColor);border-radius:999px;min-inline-size:44px;min-block-size:44px;margin-block-start:var(--tb-space-xs);padding:0 var(--tb-space-m)}
4466
+ .tb-b-social{margin:0;padding:0;list-style:none;color:var(--b-color,inherit);text-align:var(--b-align,left)}
4467
+ .tb-b-social>li{display:inline-block;vertical-align:top;margin:calc(var(--tb-space-xs)/2)}
4468
+ .tb-b-social a{display:inline-flex;align-items:center;justify-content:center;gap:var(--tb-space-xs);min-inline-size:44px;min-block-size:44px;box-sizing:border-box;padding-inline:var(--tb-space-xs);color:inherit;text-decoration:none}
4469
+ .tb-b-social--icon-label a,.tb-b-social--label a{padding-inline:var(--tb-space-s)}
4470
+ .tb-b-social svg{inline-size:calc(var(--b-iconSize,24)*1px);block-size:calc(var(--b-iconSize,24)*1px);flex:0 0 auto}
4471
+ .tb-b-social--circle a,.tb-b-social--square a{border:1px solid currentColor}
4472
+ .tb-b-social--circle.tb-b-social--icon a{border-radius:50%}
4473
+ .tb-b-social--circle.tb-b-social--icon-label a,.tb-b-social--circle.tb-b-social--label a{border-radius:999px}
4474
+ .tb-b-social--square a{border-radius:var(--throttle-radius,8px)}
4475
+ .tb-b-trust{color:var(--b-color,inherit);font-size:var(--b-size,var(--tb-text-m));text-align:var(--b-align,center)}
4476
+ .tb-b-badges,.tb-b-pay{display:flex;flex-wrap:wrap;gap:var(--tb-space-m);margin:0;padding:0;list-style:none;justify-content:center}
4477
+ .tb-b-trust--grid .tb-b-badges{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr))}
4478
+ .tb-b-badge{display:flex;align-items:flex-start;gap:var(--tb-space-s);text-align:start}
4479
+ .tb-b-badge-icon{flex:0 0 auto;display:inline-flex;color:var(--b-iconColor,var(--tb-color-primary,currentColor))}
4480
+ .tb-b-badge-icon svg,.tb-b-badge-icon img{inline-size:calc(var(--b-iconSize,32)*1px);block-size:calc(var(--b-iconSize,32)*1px)}
4481
+ .tb-b-badge-body{display:flex;flex-direction:column}
4482
+ .tb-b-badge-title{font-weight:600}
4483
+ .tb-b-badge a{color:inherit;display:inline-flex;align-items:center;min-block-size:44px}
4484
+ .tb-b-badge-text{font-size:var(--tb-text-s);color:var(--tb-color-muted-foreground,inherit)}
4485
+ .tb-b-pay{margin-block-start:var(--tb-space-m);gap:var(--tb-space-xs)}
4486
+ .tb-b-pay svg{display:block;inline-size:calc(var(--b-iconSize,32)*1.5px);block-size:auto}
4487
+ }`;
4488
+ function R23Styles() {
4489
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4490
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
4491
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { href: "tb-basics-r23", precedence: "throttle", children: R23_CSS })
4492
+ ] });
4493
+ }
4494
+
4495
+ // src/basics/r23/feature-grid.tsx
4496
+
4497
+ var LEVELS2 = ["h2", "h3", "h4"];
4498
+ var CARDS = ["plain", "card", "bordered"];
4499
+ var isIconName2 = (name) => typeof name === "string" && _ui.ICON_NAMES.includes(name);
4500
+ function FeatureGrid({ props, mediaOrigin, editMode }) {
4501
+ const rows = rowsOf(props.items).filter((row) => str(row.title) !== void 0 || str(row.text) !== void 0);
4502
+ if (rows.length === 0) {
4503
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4504
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4505
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add features in the settings" })
4506
+ ] });
4507
+ }
4508
+ const level = oneOf(props.titleLevel, LEVELS2, "h3");
4509
+ const card = oneOf(props.cardStyle, CARDS, "plain");
4510
+ const left = props.mediaPosition === "left";
4511
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4512
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4513
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: `tb-b-fg tb-b-fg--${card}${left ? " tb-b-fg--left" : ""}`, children: rows.map((row, index) => {
4514
+ const image = usableAsset(row.image, mediaOrigin);
4515
+ const svg = image === null && usableAsset(row.svgAsset, mediaOrigin) !== null ? row.svgAsset : null;
4516
+ const icon = image === null && svg === null && isIconName2(row.icon) ? row.icon : null;
4517
+ const title = str(row.title);
4518
+ const href = hrefOf(row.link, mediaOrigin);
4519
+ const html = str(row.text);
4520
+ const body = html === void 0 ? null : renderMarkup(parseMarkup(_builderschema.sanitizeRichContent.call(void 0, html, mediaOrigin).html, "rich"), { mediaOrigin });
4521
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { className: "tb-b-fg-item", children: [
4522
+ (image !== null || svg !== null || icon !== null) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-fg-media", "aria-hidden": "true", children: image !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset: image, mediaOrigin, alt: "", sizes: "96px" }) : svg !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SvgFromAsset, { asset: svg, mediaOrigin }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ui.Icon, { name: icon }) }),
4523
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-fg-body", children: [
4524
+ title !== void 0 && _react.createElement.call(void 0, level, { className: "tb-b-fg-title" }, href === null ? title : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href, children: title })),
4525
+ body !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-fg-text", children: body })
4526
+ ] })
4527
+ ] }, `${String(index)}:${textOf3(row.title)}`);
4528
+ }) })
4529
+ ] });
4530
+ }
4531
+ var featureGridWidgets = [{ ...r23Definition("basic.feature-grid"), Component: FeatureGrid }];
4532
+
4533
+ // src/basics/r23/image-with-text.tsx
4534
+
4535
+
4536
+
4537
+ var TYPE = "basic.image-with-text";
4538
+ var LEVELS3 = ["h1", "h2", "h3", "h4", "h5", "h6"];
4539
+ var BUTTON_STYLES = ["primary", "secondary", "outline", "link"];
4540
+ var RULES4 = [
4541
+ { key: "imageRatio", property: "--bx-ratio", values: { adapt: "auto", "1:1": "1 / 1", "4:3": "4 / 3", "3:4": "3 / 4", "16:9": "16 / 9" } },
4542
+ { key: "imagePosition", property: "--bx-dir", values: { left: "row", right: "row-reverse" } },
4543
+ { key: "imagePosition", property: "--bx-sa", values: { left: "-1", right: "0" } },
4544
+ { key: "imagePosition", property: "--bx-ea", values: { left: "0", right: "-1" } },
4545
+ { key: "stackOnPhone", property: "--bx-pdir", values: { "image-first": "column", "text-first": "column-reverse" } },
4546
+ { key: "contentPosition", property: "--bx-self", values: { top: "flex-start", center: "center", bottom: "flex-end" } },
4547
+ { key: "overlap", property: "--bx-overlap", values: { none: "0rem", small: "2rem", large: "4rem" } },
4548
+ { key: "imageWidth", property: "--bx-mediaFr", values: { "33": "1", "50": "1", "66": "2" } },
4549
+ { key: "imageWidth", property: "--bx-textFr", values: { "33": "2", "50": "1", "66": "1" } }
4550
+ ];
4551
+ function ImageWithText({ node, props, mediaOrigin, editMode, inlineEdit }) {
4552
+ const image = usableAsset(props.image, mediaOrigin);
4553
+ const mobile = usableAsset(props.mobileImage, mediaOrigin);
4554
+ const title = _nullishCoalesce(_optionalChain([inlineEdit, 'optionalCall', _207 => _207("title")]), () => ( str(props.title)));
4555
+ const kicker = str(props.kicker);
4556
+ const html = str(props.text);
4557
+ const label2 = str(props.buttonLabel);
4558
+ const href = hrefOf(props.buttonLink, mediaOrigin);
4559
+ const body = html === void 0 ? null : renderMarkup(parseMarkup(_builderschema.sanitizeRichContent.call(void 0, html, mediaOrigin).html, "rich"), { mediaOrigin });
4560
+ if (image === null && title === void 0 && kicker === void 0 && html === void 0 && label2 === void 0) {
4561
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4562
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4563
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Choose an image and write some text" })
4564
+ ] });
4565
+ }
4566
+ const alt = props.decorative === true ? "" : _nullishCoalesce(str(props.alt), () => ( ""));
4567
+ const level = oneOf(props.titleLevel, LEVELS3, "h2");
4568
+ const style = oneOf(props.buttonStyle, BUTTON_STYLES, "primary");
4569
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4570
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4571
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyle, { css: enumCss(node, RULES4) }),
4572
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-iwt", children: [
4573
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-iwt-media", children: [
4574
+ image !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PictureImage, { asset: image, mobile, mediaOrigin, alt, sizes: `(max-width: 767px) 100vw, ${oneOf(props.imageWidth, ["33", "50", "66"], "50")}vw`, priority: props.priority === true }),
4575
+ editMode && image !== null && alt === "" && props.decorative !== true && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-empty", children: "Add alt text or mark the image decorative" })
4576
+ ] }),
4577
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-iwt-content", children: [
4578
+ kicker !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-iwt-kicker", children: kicker }),
4579
+ title !== void 0 && _react.createElement.call(void 0, level, { className: "tb-b-iwt-title" }, title),
4580
+ body !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-iwt-text", children: body }),
4581
+ label2 !== void 0 && href !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className: `tb-b-button tb-b-button--${style} tb-b-button--m`, href, children: label2 })
4582
+ ] })
4583
+ ] })
4584
+ ] });
4585
+ }
4586
+ var imageWithTextWidgets = [{ ...r23Definition(TYPE), Component: ImageWithText }];
4587
+
4588
+ // src/basics/r23/logo-strip.tsx
4589
+
4590
+
4591
+ var LAYOUTS2 = ["row", "grid", "marquee"];
4592
+ var RULES5 = [{ key: "speed", property: "--bx-speed", values: { slow: "60s", medium: "40s", fast: "20s" } }];
4593
+ function LogoStrip({ node, props, mediaOrigin, editMode }) {
4594
+ const titleId = _react.useId.call(void 0, );
4595
+ const [reduced2, setReduced] = _react.useState.call(void 0, null);
4596
+ const [paused, setPaused] = _react.useState.call(void 0, false);
4597
+ const layout = oneOf(props.layout, LAYOUTS2, "row");
4598
+ const live = reduced2 === false;
4599
+ _react.useEffect.call(void 0, () => {
4600
+ setReduced(_optionalChain([window, 'access', _208 => _208.matchMedia, 'optionalCall', _209 => _209("(prefers-reduced-motion: reduce)"), 'access', _210 => _210.matches]) === true);
4601
+ }, []);
4602
+ const pauseLabel = _nullishCoalesce(str(props.pauseLabel), () => ( "Pause logo scrolling"));
4603
+ const playLabel = _nullishCoalesce(str(props.playLabel), () => ( "Play logo scrolling"));
4604
+ const logos = [];
4605
+ const warnings = [];
4606
+ rowsOf(props.items).forEach((row, index) => {
4607
+ const image = usableAsset(row.image, mediaOrigin);
4608
+ if (image === null) return;
4609
+ const decorative = row.decorative === true;
4610
+ const alt = decorative ? "" : _nullishCoalesce(str(row.alt), () => ( ""));
4611
+ if (!decorative && alt === "") {
4612
+ warnings.push(index);
4613
+ return;
4614
+ }
4615
+ logos.push({ key: String(index), image, alt, href: decorative ? null : hrefOf(row.link, mediaOrigin) });
4616
+ });
4617
+ if (logos.length === 0 && !(editMode && warnings.length > 0)) {
4618
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4619
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4620
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add logos in the settings" })
4621
+ ] });
4622
+ }
4623
+ const title = str(props.title);
4624
+ const marquee = layout === "marquee" && live && logos.length > 0;
4625
+ const renderLogos = (copy) => logos.map((logo) => {
4626
+ const img = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset: logo.image, mediaOrigin, alt: copy ? "" : logo.alt, sizes: "160px" });
4627
+ const external = logo.href !== null && logo.href.startsWith("https://");
4628
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: logo.href === null ? img : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4629
+ "a",
4630
+ {
4631
+ href: logo.href,
4632
+ ...external ? { rel: "nofollow noopener" } : {},
4633
+ ...copy ? { tabIndex: -1 } : {},
4634
+ children: img
4635
+ }
4636
+ ) }, logo.key);
4637
+ });
4638
+ const list2 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "ul", { className: "tb-b-logos-list", ...title === void 0 ? {} : { "aria-labelledby": titleId }, children: [
4639
+ renderLogos(false),
4640
+ editMode && warnings.map((index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { className: "tb-b-logos-warn", children: "Add alt text or mark it decorative" }, `w${String(index)}`))
4641
+ ] });
4642
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4643
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4644
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WidgetStyle, { css: enumCss(node, RULES5) }),
4645
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `tb-b-logos tb-b-logos--${layout}${marquee ? " is-live" : ""}${marquee && paused ? " is-paused" : ""}`, children: [
4646
+ title !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-logos-title", id: titleId, children: title }),
4647
+ layout === "marquee" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-logos-track", children: [
4648
+ list2,
4649
+ marquee && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-logos-list", "aria-hidden": "true", children: renderLogos(true) })
4650
+ ] }) : list2,
4651
+ layout === "marquee" && logos.length > 0 && reduced2 !== true && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-logos-pause", disabled: !live, "aria-label": paused ? playLabel : pauseLabel, onClick: () => setPaused(!paused), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: paused ? "\u25B6" : "\u23F8" }) })
4652
+ ] })
4653
+ ] });
4654
+ }
4655
+ var logoStripWidgets = [{ ...r23Definition("basic.logo-strip"), Component: LogoStrip }];
4656
+
4657
+ // src/basics/r23/social-links.tsx
4658
+
4659
+
4660
+
4661
+ // src/basics/r23/icons.tsx
4662
+
4663
+ var Svg2 = ({ children }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", children });
4664
+ var PLATFORM_NAMES = {
4665
+ instagram: "Instagram",
4666
+ facebook: "Facebook",
4667
+ x: "X",
4668
+ tiktok: "TikTok",
4669
+ youtube: "YouTube",
4670
+ pinterest: "Pinterest",
4671
+ linkedin: "LinkedIn",
4672
+ threads: "Threads",
4673
+ whatsapp: "WhatsApp",
4674
+ email: "Email",
4675
+ custom: "Website"
4676
+ };
4677
+ var SOCIAL = {
4678
+ instagram: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4679
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "3", y: "3", width: "18", height: "18", rx: "5" }),
4680
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "4" }),
4681
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "17.5", cy: "6.5", r: ".6", fill: "currentColor" })
4682
+ ] }),
4683
+ facebook: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M15 3h-2.5A3.5 3.5 0 0 0 9 6.5V9H6v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h2z", fill: "currentColor", stroke: "none" }) }),
4684
+ x: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4 4l16 16M20 4L4 20" }) }),
4685
+ tiktok: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M14 3v11.5a3.5 3.5 0 1 1-3.5-3.5M14 3c.5 3 2.5 4.5 5 4.5" }) }),
4686
+ youtube: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4687
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "2", y: "5", width: "20", height: "14", rx: "4" }),
4688
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10 9l6 3-6 3z", fill: "currentColor" })
4689
+ ] }),
4690
+ pinterest: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4691
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
4692
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M10.5 20l1.8-7.5M9.5 10.5a2.8 2.8 0 1 1 4.5 2.3" })
4693
+ ] }),
4694
+ linkedin: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4695
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "3", y: "3", width: "18", height: "18", rx: "3" }),
4696
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 10v6M8 7.5v.01M12 16v-6M12 12.5a2.5 2.5 0 0 1 5 0V16" })
4697
+ ] }),
4698
+ threads: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M16.5 8.5C15.8 6.8 14.2 6 12.3 6 9.5 6 7.5 8.2 7.5 12s2 6 5 6c2.6 0 4.2-1.5 4.2-3.5 0-2.3-2.3-3-4.5-3-1.8 0-2.7.9-2.7 1.8" }) }),
4699
+ whatsapp: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4700
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M3 21l1.6-4.7A9 9 0 1 1 8 19.5z" }),
4701
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M9 9c0 3 3 6 6 6l1-1.5-2-1-1 .8c-1-.4-2-1.4-2.4-2.4l.8-1-1-2z", fill: "currentColor" })
4702
+ ] }),
4703
+ email: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4704
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
4705
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M3 7l9 6 9-6" })
4706
+ ] }),
4707
+ custom: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4708
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "12", cy: "12", r: "9" }),
4709
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18" })
4710
+ ] })
4711
+ };
4712
+ var SocialIcon = ({ platform }) => Object.hasOwn(SOCIAL, platform) ? SOCIAL[platform]() : null;
4713
+ var BADGE2 = {
4714
+ "secure-checkout": () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4715
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: "5", y: "11", width: "14", height: "9", rx: "2" }),
4716
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
4717
+ ] }),
4718
+ "free-shipping": () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4719
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M2 6h12v10H2zM14 9h4l3 3v4h-7" }),
4720
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "6", cy: "18", r: "2" }),
4721
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "17", cy: "18", r: "2" })
4722
+ ] }),
4723
+ returns: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4 12a8 8 0 1 0 3-6.2M4 4v4h4" }) }),
4724
+ warranty: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Svg2, { children: [
4725
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z" }),
4726
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8.5 12l2.5 2.5 4.5-5" })
4727
+ ] }),
4728
+ support: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M4 14v-2a8 8 0 0 1 16 0v2M4 14h3v5H5a1 1 0 0 1-1-1zM20 14h-3v5h2a1 1 0 0 0 1-1z" }) }),
4729
+ eco: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Svg2, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M5 19c0-8 5-14 15-14 0 10-6 15-14 15M5 19c2-5 5-8 9-10" }) })
4730
+ };
4731
+ var BadgeIcon = ({ name }) => Object.hasOwn(BADGE2, name) ? BADGE2[name]() : null;
4732
+ var Card = ({ title, fill: fill2 = "#fff", children }) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { viewBox: "0 0 40 26", role: "img", children: [
4733
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "title", { children: title }),
4734
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "rect", { x: ".5", y: ".5", width: "39", height: "25", rx: "4", fill: fill2, stroke: "#c8c8c8" }),
4735
+ children
4736
+ ] });
4737
+ var label = (text2, fill2, size = 9, extra = {}) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "text", { x: "20", y: "16", textAnchor: "middle", fontFamily: "Arial, Helvetica, sans-serif", fontSize: size, fontWeight: "700", fill: fill2, ...extra, children: text2 });
4738
+ var PAYMENT = {
4739
+ visa: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "Visa", children: label("VISA", "#1a1f71", 10, { fontStyle: "italic" }) }),
4740
+ mastercard: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Card, { title: "Mastercard", children: [
4741
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "15", cy: "13", r: "7", fill: "#eb001b" }),
4742
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "25", cy: "13", r: "7", fill: "#f79e1b", fillOpacity: ".85" })
4743
+ ] }),
4744
+ amex: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "American Express", fill: "#2e77bb", children: label("AMEX", "#fff", 9) }),
4745
+ discover: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Card, { title: "Discover", children: [
4746
+ label("DISCOVER", "#222", 5.5),
4747
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "30", cy: "20", r: "3", fill: "#f58220" })
4748
+ ] }),
4749
+ paypal: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "PayPal", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "text", { x: "20", y: "16", textAnchor: "middle", fontFamily: "Arial, Helvetica, sans-serif", fontSize: "8", fontWeight: "700", fill: "#003087", children: [
4750
+ "Pay",
4751
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tspan", { fill: "#009cde", children: "Pal" })
4752
+ ] }) }),
4753
+ "apple-pay": () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "Apple Pay", children: label("Apple Pay", "#000", 6.5) }),
4754
+ "google-pay": () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "Google Pay", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "text", { x: "20", y: "16", textAnchor: "middle", fontFamily: "Arial, Helvetica, sans-serif", fontSize: "7.5", fontWeight: "700", fill: "#5f6368", children: [
4755
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tspan", { fill: "#4285f4", children: "G" }),
4756
+ " Pay"
4757
+ ] }) }),
4758
+ klarna: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Card, { title: "Klarna", fill: "#ffb3c7", children: label("Klarna", "#17120f", 8) }),
4759
+ maestro: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Card, { title: "Maestro", children: [
4760
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "15", cy: "13", r: "7", fill: "#eb001b" }),
4761
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "25", cy: "13", r: "7", fill: "#0099df", fillOpacity: ".85" })
4762
+ ] }),
4763
+ diners: () => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Card, { title: "Diners Club", children: [
4764
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "circle", { cx: "20", cy: "13", r: "8", fill: "none", stroke: "#0079be", strokeWidth: "2" }),
4765
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M20 5v16", stroke: "#0079be", strokeWidth: "2" })
4766
+ ] })
4767
+ };
4768
+ var PaymentMark = ({ method }) => Object.hasOwn(PAYMENT, method) ? PAYMENT[method]() : null;
4769
+
4770
+ // src/basics/r23/social-links.tsx
4771
+
4772
+ var STYLES2 = ["icon", "icon-label", "label"];
4773
+ var SHAPES = ["none", "circle", "square"];
4774
+ var EMAIL = /^[^\s@<>"'\\]+@[^\s@<>"'\\]+\.[^\s@<>"'\\]+$/u;
4775
+ var PHONE = /^\+?\d{6,15}$/u;
4776
+ function socialHref(platform, value, mediaOrigin) {
4777
+ const url = value.trim();
4778
+ if (platform === "email") {
4779
+ const address = url.replace(/^mailto:/iu, "");
4780
+ return EMAIL.test(address) ? `mailto:${address}` : null;
4781
+ }
4782
+ if (platform === "whatsapp" && !url.startsWith("https://")) {
4783
+ const digits = url.replace(/[\s().-]/gu, "");
4784
+ return PHONE.test(digits) ? `https://wa.me/${digits.replace("+", "")}` : null;
4785
+ }
4786
+ const safe = _builderschema.safeUrl.call(void 0, url, "href", { mediaOrigin });
4787
+ if (safe === null) return null;
4788
+ return safe.startsWith("https://") || platform === "custom" && safe.startsWith("/") ? safe : null;
4789
+ }
4790
+ function SocialLinks({ props, mediaOrigin, editMode }) {
4791
+ const design = _ui.useSiteDesign.call(void 0, );
4792
+ const store = str(_optionalChain([design, 'optionalAccess', _211 => _211.brand, 'optionalAccess', _212 => _212.storeName, 'optionalAccess', _213 => _213.trim, 'call', _214 => _214()]));
4793
+ const template = _nullishCoalesce(str(props.nameTemplate), () => ( "{store} on {platform}"));
4794
+ const style = oneOf(props.style, STYLES2, "icon");
4795
+ const shape = oneOf(props.shape, SHAPES, "none");
4796
+ const newTab = props.newTab !== false;
4797
+ const links = rowsOf(props.links).flatMap((row, index) => {
4798
+ const platform = typeof row.platform === "string" && Object.hasOwn(PLATFORM_NAMES, row.platform) ? row.platform : null;
4799
+ const href = platform === null ? null : socialHref(platform, textOf3(row.url), mediaOrigin);
4800
+ return platform === null || href === null ? [] : [{ index, platform, href, label: str(row.label) }];
4801
+ });
4802
+ if (links.length === 0) {
4803
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4804
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4805
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add your social profiles in the settings" })
4806
+ ] });
4807
+ }
4808
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4809
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4810
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: `tb-b-social tb-b-social--${style} tb-b-social--${shape}`, children: links.map(({ index, platform, href, label: label2 }) => {
4811
+ const platformName = PLATFORM_NAMES[platform];
4812
+ const name = _nullishCoalesce(label2, () => ( (store === void 0 || platform === "custom" ? platformName : fill(template, { store, platform: platformName }))));
4813
+ const visible = style === "icon" ? void 0 : _nullishCoalesce(label2, () => ( platformName));
4814
+ const web = href.startsWith("http") || href.startsWith("/");
4815
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
4816
+ "a",
4817
+ {
4818
+ href,
4819
+ ...visible === name ? {} : { "aria-label": name },
4820
+ ...web ? { rel: "me noopener" } : {},
4821
+ ...web && newTab && href.startsWith("http") ? { target: "_blank" } : {},
4822
+ children: [
4823
+ style !== "label" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SocialIcon, { platform }),
4824
+ visible !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-social-label", children: visible })
4825
+ ]
4826
+ }
4827
+ ) }, `${String(index)}:${platform}`);
4828
+ }) })
4829
+ ] });
4830
+ }
4831
+ var socialLinksWidgets = [{ ...r23Definition("basic.social-links"), Component: SocialLinks }];
4832
+
4833
+ // src/basics/r23/testimonials.tsx
4834
+
4835
+
4836
+ var LAYOUTS3 = ["grid", "carousel", "masonry"];
4837
+ var CARDS2 = ["plain", "card", "bordered"];
4838
+ var reducedMotion = () => _optionalChain([window, 'access', _215 => _215.matchMedia, 'optionalCall', _216 => _216("(prefers-reduced-motion: reduce)"), 'access', _217 => _217.matches]) === true;
4839
+ function Rating({ value, template }) {
4840
+ const rounded = Math.round(Math.min(5, Math.max(0, value)) * 2) / 2;
4841
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "tb-b-tm-rating", children: [
4842
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-sr", children: fill(template, { rating: String(rounded) }) }),
4843
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: [1, 2, 3, 4, 5].map((n) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: `tb-b-star tb-b-star--${rounded >= n ? "full" : rounded >= n - 0.5 ? "half" : "empty"}`, children: "\u2605" }, n)) })
4844
+ ] });
4845
+ }
4846
+ function Testimonials({ props, mediaOrigin, editMode }) {
4847
+ const track = _react.useRef.call(void 0, null);
4848
+ const [live, setLive] = _react.useState.call(void 0, false);
4849
+ const [motion, setMotion] = _react.useState.call(void 0, false);
4850
+ const [hover, setHover] = _react.useState.call(void 0, false);
4851
+ const [focus, setFocus] = _react.useState.call(void 0, false);
4852
+ const [paused, setPaused] = _react.useState.call(void 0, false);
4853
+ const layout = oneOf(props.layout, LAYOUTS3, "grid");
4854
+ const rows = rowsOf(props.items).filter((row) => str(row.quote) !== void 0);
4855
+ const carousel = layout === "carousel" && rows.length > 1;
4856
+ const interval = typeof props.intervalMs === "number" ? props.intervalMs : 6e3;
4857
+ const autoplay2 = carousel && props.autoplay === true && live && motion;
4858
+ _react.useEffect.call(void 0, () => {
4859
+ setLive(true);
4860
+ setMotion(!reducedMotion());
4861
+ }, []);
4862
+ const step2 = (dir, wrap = false) => {
4863
+ const el = track.current;
4864
+ if (el === null) return;
4865
+ const slide = el.firstElementChild instanceof HTMLElement ? el.firstElementChild.offsetWidth : 0;
4866
+ const width = slide > 0 ? slide : el.clientWidth;
4867
+ if (wrap && dir > 0 && el.scrollWidth > el.clientWidth && Math.abs(el.scrollLeft) + el.clientWidth >= el.scrollWidth - 2) {
4868
+ _optionalChain([el, 'access', _218 => _218.scrollTo, 'optionalCall', _219 => _219({ left: 0, behavior: "auto" })]);
4869
+ return;
4870
+ }
4871
+ const rtl = getComputedStyle(el).direction === "rtl";
4872
+ _optionalChain([el, 'access', _220 => _220.scrollBy, 'optionalCall', _221 => _221({ left: dir * width * (rtl ? -1 : 1), behavior: reducedMotion() ? "auto" : "smooth" })]);
4873
+ };
4874
+ _react.useEffect.call(void 0, () => {
4875
+ if (!autoplay2 || paused || hover || focus) return;
4876
+ const id = window.setInterval(() => step2(1, true), Math.max(3e3, interval));
4877
+ return () => window.clearInterval(id);
4878
+ }, [autoplay2, paused, hover, focus, interval]);
4879
+ if (rows.length === 0) {
4880
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4881
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4882
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add testimonials in the settings" })
4883
+ ] });
4884
+ }
4885
+ const showRating = props.showRating !== false;
4886
+ const showImage = props.showImage !== false;
4887
+ const label2 = _nullishCoalesce(str(props.carouselLabel), () => ( "Customer reviews"));
4888
+ const prevLabel = _nullishCoalesce(str(props.prevLabel), () => ( "Previous review"));
4889
+ const nextLabel = _nullishCoalesce(str(props.nextLabel), () => ( "Next review"));
4890
+ const pauseLabel = _nullishCoalesce(str(props.pauseLabel), () => ( "Pause autoplay"));
4891
+ const playLabel = _nullishCoalesce(str(props.playLabel), () => ( "Start autoplay"));
4892
+ const ratingLabel = _nullishCoalesce(str(props.ratingLabel), () => ( "{rating} out of 5"));
4893
+ const slideLabel = _nullishCoalesce(str(props.slideLabel), () => ( "{n} of {total}"));
4894
+ const cards = rows.map((row, index) => {
4895
+ const name = str(row.name);
4896
+ const role = str(row.role);
4897
+ const source = str(row.source);
4898
+ const photo = showImage ? usableAsset(row.image, mediaOrigin) : null;
4899
+ const rating = showRating && typeof row.rating === "number" && row.rating > 0 ? row.rating : null;
4900
+ const card2 = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "tb-b-tm-card", children: [
4901
+ rating !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Rating, { value: rating, template: ratingLabel }),
4902
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "blockquote", { children: str(row.quote) }),
4903
+ (name !== void 0 || role !== void 0 || source !== void 0 || photo !== null) && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figcaption", { children: [
4904
+ photo !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset: photo, mediaOrigin, alt: "", className: "tb-b-tm-photo", sizes: "44px" }),
4905
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "tb-b-tm-by", children: [
4906
+ name !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-tm-name", children: name }),
4907
+ role !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-tm-role", children: role }),
4908
+ source !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-tm-source", children: source })
4909
+ ] })
4910
+ ] })
4911
+ ] });
4912
+ return carousel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
4913
+ "div",
4914
+ {
4915
+ className: "tb-b-tm-slide",
4916
+ role: "group",
4917
+ "aria-roledescription": "slide",
4918
+ "aria-label": fill(slideLabel, { n: String(index + 1), total: String(rows.length) }),
4919
+ children: card2
4920
+ },
4921
+ index
4922
+ ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: card2 }, index);
4923
+ });
4924
+ const card = oneOf(props.cardStyle, CARDS2, "card");
4925
+ const className = `tb-b-tm tb-b-tm--${carousel ? "carousel" : layout === "carousel" ? "grid" : layout} tb-b-tm--${card}`;
4926
+ if (!carousel) {
4927
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4928
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4929
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-tm-list", children: cards }) })
4930
+ ] });
4931
+ }
4932
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4933
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4934
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
4935
+ "div",
4936
+ {
4937
+ className,
4938
+ role: "region",
4939
+ "aria-roledescription": "carousel",
4940
+ "aria-label": label2,
4941
+ "data-interval": String(Math.min(15e3, Math.max(3e3, interval))),
4942
+ onMouseEnter: () => setHover(true),
4943
+ onMouseLeave: () => setHover(false),
4944
+ onFocus: () => setFocus(true),
4945
+ onBlur: () => setFocus(false),
4946
+ children: [
4947
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-tm-list", ref: track, role: "group", tabIndex: 0, children: cards }),
4948
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `tb-b-tm-ctrl${live ? "" : " tb-b-tm-ctrl--wait"}`, children: [
4949
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-tm-btn", "aria-label": prevLabel, onClick: () => step2(-1), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: "\u2039" }) }),
4950
+ props.autoplay === true && !(live && !motion) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-tm-btn tb-b-tm-pause", "aria-label": paused ? playLabel : pauseLabel, onClick: () => setPaused(!paused), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: paused ? "\u25B6" : "\u23F8" }) }),
4951
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-tm-btn", "aria-label": nextLabel, onClick: () => step2(1), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { "aria-hidden": "true", children: "\u203A" }) })
4952
+ ] })
4953
+ ]
4954
+ }
4955
+ )
4956
+ ] });
4957
+ }
4958
+ var testimonialsWidgets = [{ ...r23Definition("basic.testimonials"), Component: Testimonials }];
4959
+
4960
+ // src/basics/r23/trust-badges.tsx
4961
+
4962
+ var LAYOUTS4 = ["row", "grid"];
4963
+ function TrustBadges({ props, mediaOrigin, editMode }) {
4964
+ const badges = rowsOf(props.items).filter((row) => str(row.title) !== void 0 || str(row.text) !== void 0);
4965
+ const methods = rowsOf(props.paymentIcons).flatMap((row) => typeof row.method === "string" ? [row.method] : []);
4966
+ if (badges.length === 0 && methods.length === 0) {
4967
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4968
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4969
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add badges or payment methods in the settings" })
4970
+ ] });
4971
+ }
4972
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
4973
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23Styles, {}),
4974
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `tb-b-trust tb-b-trust--${oneOf(props.layout, LAYOUTS4, "row")}`, children: [
4975
+ badges.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-badges", children: badges.map((row, index) => {
4976
+ const svg = usableAsset(row.svgAsset, mediaOrigin) === null ? null : row.svgAsset;
4977
+ const title = str(row.title);
4978
+ const href = hrefOf(row.link, mediaOrigin);
4979
+ const text2 = str(row.text);
4980
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { className: "tb-b-badge", children: [
4981
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-badge-icon", "aria-hidden": "true", children: svg !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SvgFromAsset, { asset: svg, mediaOrigin }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BadgeIcon, { name: textOf3(row.icon) }) }),
4982
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "tb-b-badge-body", children: [
4983
+ title !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-badge-title", children: href === null ? title : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href, children: title }) }),
4984
+ text2 !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-badge-text", children: text2 })
4985
+ ] })
4986
+ ] }, `${String(index)}:${textOf3(row.title)}`);
4987
+ }) }),
4988
+ methods.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-pay", role: "list", "aria-label": _nullishCoalesce(str(props.paymentTitle), () => ( "Payment methods we accept")), children: methods.map((method, index) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, PaymentMark, { method }) }, `${String(index)}:${method}`)) })
4989
+ ] })
4990
+ ] });
4991
+ }
4992
+ var trustBadgesWidgets = [{ ...r23Definition("basic.trust-badges"), Component: TrustBadges }];
4993
+
4994
+ // src/basics/r23/index.ts
4995
+ var r23ContentWidgets = [
4996
+ ...imageWithTextWidgets,
4997
+ ...featureGridWidgets,
4998
+ ...testimonialsWidgets,
4999
+ ...logoStripWidgets,
5000
+ ...socialLinksWidgets,
5001
+ ...trustBadgesWidgets
5002
+ ];
5003
+
5004
+ // src/basics/r23/before-after.tsx
5005
+
5006
+
5007
+ // src/basics/r23/media-shared.tsx
5008
+
5009
+
5010
+ function r23MediaDefinition(type) {
5011
+ const found = _builderschema.BASIC_WIDGET_DEFINITIONS.filter((d) => d.type === type).sort((a, b) => b.v - a.v)[0];
5012
+ if (found === void 0) throw new Error(`No R2.3 definition of ${type}`);
5013
+ return found;
5014
+ }
5015
+ var mediaRows = (value) => Array.isArray(value) ? value.flatMap((row) => isRecord(row) ? [row] : []) : [];
5016
+ var mediaText = (value) => typeof value === "string" ? value : "";
5017
+ function mediaAsset(value, mediaOrigin) {
5018
+ return isFrozenAsset(value) && _builderschema.safeUrl.call(void 0, value.url, "src", { mediaOrigin }) !== null ? value : null;
5019
+ }
5020
+ function MediaImage({
5021
+ asset,
5022
+ mediaOrigin,
5023
+ alt,
5024
+ sizes,
5025
+ priority = false,
5026
+ style
5027
+ }) {
5028
+ const src = _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin });
5029
+ if (src === null) return null;
5030
+ const srcSet = asset.variants.flatMap((variant) => {
5031
+ const url = _builderschema.safeUrl.call(void 0, variant.url, "src", { mediaOrigin });
5032
+ return url === null || url.includes(",") ? [] : [`${url} ${String(variant.width)}w`];
5033
+ }).join(", ");
5034
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5035
+ "img",
5036
+ {
5037
+ src,
5038
+ ...srcSet === "" ? {} : { srcSet, sizes },
5039
+ width: asset.width,
5040
+ height: asset.height,
5041
+ alt,
5042
+ loading: priority ? "eager" : "lazy",
5043
+ ...priority ? { fetchPriority: "high" } : {},
5044
+ decoding: "async",
5045
+ style: { aspectRatio: `${String(asset.width)} / ${String(asset.height)}`, ...style }
5046
+ }
5047
+ );
5048
+ }
5049
+ var R23_MEDIA_CSS = `@layer throttle{
5050
+ .tb-b-msr{position:absolute;inline-size:1px;block-size:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
5051
+ .tb-b-gal{--g:calc(var(--b-gap,12)*1px)}
5052
+ .tb-b-gal-list{margin:0;padding:0;list-style:none}
5053
+ .tb-b-gal--grid .tb-b-gal-list{display:grid;grid-template-columns:repeat(var(--b-columnsDesktop,3),minmax(0,1fr));gap:var(--g)}
5054
+ .tb-b-gal--masonry .tb-b-gal-list{column-count:var(--b-columnsDesktop,3);column-gap:var(--g)}
5055
+ .tb-b-gal--masonry .tb-b-gal-list>li{break-inside:avoid;margin-block-end:var(--g)}
5056
+ .tb-b-gal-scroll{overflow-x:auto;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:thin}
5057
+ .tb-b-gal--carousel .tb-b-gal-list{display:flex;gap:var(--g)}
5058
+ .tb-b-gal--carousel .tb-b-gal-list>li{flex:0 0 calc((100% - (var(--b-columnsDesktop,3) - 1)*var(--g))/var(--b-columnsDesktop,3));scroll-snap-align:start;min-inline-size:0}
5059
+ @media (max-width:1024px){.tb-b-gal--grid .tb-b-gal-list{grid-template-columns:repeat(min(var(--b-columnsDesktop,3),3),minmax(0,1fr))}.tb-b-gal--masonry .tb-b-gal-list{column-count:min(var(--b-columnsDesktop,3),3)}.tb-b-gal--carousel .tb-b-gal-list>li{flex-basis:calc((100% - (min(var(--b-columnsDesktop,3),3) - 1)*var(--g))/min(var(--b-columnsDesktop,3),3))}}
5060
+ @media (max-width:767px){.tb-b-gal--grid .tb-b-gal-list{grid-template-columns:repeat(var(--b-columnsMobile,2),minmax(0,1fr))}.tb-b-gal--masonry .tb-b-gal-list{column-count:var(--b-columnsMobile,2)}.tb-b-gal--carousel .tb-b-gal-list>li{flex-basis:calc((100% - (var(--b-columnsMobile,2) - 1)*var(--g))/var(--b-columnsMobile,2))}}
5061
+ .tb-b-gal-item{margin:0;position:relative;min-inline-size:0}
5062
+ .tb-b-gal-item img{display:block;inline-size:100%;block-size:auto;object-fit:cover}
5063
+ .tb-b-gal-link{display:block;min-block-size:44px}
5064
+ .tb-b-gal-link:focus-visible,.tb-b-gal-scroll:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
5065
+ .tb-b-gal-item figcaption{padding-block-start:4px;font-size:.875em;overflow-wrap:anywhere}
5066
+ .tb-b-gal--caps-overlay .tb-b-gal-item figcaption{position:absolute;inset-inline:0;inset-block-end:0;padding:6px 10px;background:rgba(0,0,0,.65);color:#fff;pointer-events:none}
5067
+ .tb-b-gal-ctrl{display:flex;justify-content:center;gap:8px;margin-block-start:8px}
5068
+ .tb-b-gal-btn,.tb-b-gal-dialog button{appearance:none;cursor:pointer;font:inherit;color:inherit;background:transparent;border:1px solid currentColor;border-radius:999px;min-inline-size:44px;min-block-size:44px;padding:0 16px}
5069
+ .tb-b-gal-btn[hidden]{display:none}
5070
+ .tb-b-gal-btn:focus-visible,.tb-b-gal-dialog button:focus-visible{outline:3px solid #fff;outline-offset:2px}
5071
+ .tb-b-gal-ctrl .tb-b-gal-btn:focus-visible{outline-color:var(--tb-color-primary,currentColor)}
5072
+ .tb-b-gal-dialog{position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;box-sizing:border-box;padding:16px;background:rgba(0,0,0,.92);color:#fff}
5073
+ .tb-b-gal-stage{display:flex;align-items:center;justify-content:center;gap:12px;inline-size:100%;min-block-size:0}
5074
+ .tb-b-gal-stage figure{margin:0;display:flex;flex-direction:column;align-items:center;gap:8px;min-inline-size:0}
5075
+ .tb-b-gal-stage img{display:block;inline-size:auto;max-inline-size:100%;block-size:auto;max-block-size:72vh;object-fit:contain}
5076
+ .tb-b-gal-stage figcaption{text-align:center;overflow-wrap:anywhere}
5077
+ .tb-b-gal-status{font-size:.875em}
5078
+ .tb-b-gal-x{position:absolute;inset-block-start:12px;inset-inline-end:12px}
5079
+ .tb-b-ba{inline-size:100%}
5080
+ .tb-b-ba-stage{position:relative;overflow:hidden;inline-size:100%;border-radius:var(--throttle-radius,8px);touch-action:pan-y;user-select:none}
5081
+ .tb-b-ba--vertical .tb-b-ba-stage{touch-action:pan-x}
5082
+ .tb-b-ba-pane{margin:0;position:absolute;inset:0}
5083
+ .tb-b-ba-pane img{display:block;inline-size:100%;block-size:100%;object-fit:cover}
5084
+ .tb-b-ba-after{clip-path:inset(0 0 0 var(--pos,50%))}
5085
+ :dir(rtl) .tb-b-ba-after{clip-path:inset(0 var(--pos,50%) 0 0)}
5086
+ .tb-b-ba--vertical .tb-b-ba-after,:dir(rtl) .tb-b-ba--vertical .tb-b-ba-after{clip-path:inset(var(--pos,50%) 0 0 0)}
5087
+ .tb-b-ba-pane figcaption{position:absolute;inset-block-start:8px;padding:4px 10px;border-radius:4px;background:rgba(0,0,0,.7);color:#fff;font-size:.875em}
5088
+ .tb-b-ba-before figcaption{inset-inline-start:8px}
5089
+ .tb-b-ba-after figcaption{inset-inline-end:8px}
5090
+ .tb-b-ba--vertical .tb-b-ba-after figcaption{inset-block-start:auto;inset-block-end:8px;inset-inline-end:auto;inset-inline-start:8px}
5091
+ .tb-b-ba-range{position:absolute;inset:0;inline-size:100%;block-size:100%;margin:0;opacity:0;pointer-events:none}
5092
+ .tb-b-ba-handle{position:absolute;inset-block:0;inset-inline-start:var(--pos,50%);inline-size:4px;margin-inline-start:-2px;background:var(--b-handleColor,#fff);box-shadow:0 0 0 1px rgba(0,0,0,.35);pointer-events:none}
5093
+ .tb-b-ba-handle::after{content:"";position:absolute;inset-block-start:50%;inset-inline-start:50%;inline-size:44px;block-size:44px;margin:-22px 0 0 -22px;border-radius:50%;background:var(--b-handleColor,#fff);box-shadow:0 0 0 1px rgba(0,0,0,.35),0 2px 6px rgba(0,0,0,.35)}
5094
+ :dir(rtl) .tb-b-ba-handle::after{margin-inline:0;margin:-22px -22px 0 0}
5095
+ .tb-b-ba--vertical .tb-b-ba-handle{inset-block:auto;inset-inline:0;inset-block-start:var(--pos,50%);inline-size:auto;block-size:4px;margin:-2px 0 0}
5096
+ .tb-b-ba-range:focus-visible+.tb-b-ba-handle::after{outline:3px solid var(--tb-color-primary,#2563eb);outline-offset:2px}
5097
+ @media (scripting:none){.tb-b-ba-stage{aspect-ratio:auto!important;display:grid;grid-template-columns:1fr 1fr;gap:8px;overflow:visible}.tb-b-ba--vertical .tb-b-ba-stage{grid-template-columns:1fr}.tb-b-ba-pane{position:relative;inset:auto;aspect-ratio:var(--ba-ratio,auto);clip-path:none!important}.tb-b-ba-range,.tb-b-ba-handle{display:none}}
5098
+ .tb-b-ct{color:var(--b-color,inherit)}
5099
+ .tb-b-ct-scroll{overflow-x:auto}
5100
+ .tb-b-ct-scroll:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
5101
+ .tb-b-ct--sticky-head .tb-b-ct-scroll{max-block-size:70vh;overflow:auto}
5102
+ .tb-b-ct-table{border-collapse:separate;border-spacing:0;inline-size:100%;min-inline-size:36rem}
5103
+ .tb-b-ct-table caption{caption-side:top;text-align:start;font-weight:600;padding-block-end:8px}
5104
+ .tb-b-ct-table th,.tb-b-ct-table td{padding:12px 16px;border-block-end:1px solid var(--tb-color-border,currentColor);text-align:center;vertical-align:middle;background:var(--tb-color-background,#fff)}
5105
+ .tb-b-ct-table tbody th{text-align:start;font-weight:600}
5106
+ .tb-b-ct-table thead th{font-weight:600}
5107
+ .tb-b-ct-table .tb-b-ct-title{display:block}
5108
+ .tb-b-ct-table thead .tb-b-button{display:inline-flex;align-items:center;justify-content:center;min-block-size:44px;box-sizing:border-box;margin-block-start:8px}
5109
+ .tb-b-ct-table thead a:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
5110
+ .tb-b-ct--sticky-head .tb-b-ct-table thead th{position:sticky;inset-block-start:0;z-index:2}
5111
+ .tb-b-ct--sticky-col .tb-b-ct-table tbody th,.tb-b-ct--sticky-col .tb-b-ct-table thead th:first-child{position:sticky;inset-inline-start:0;z-index:1}
5112
+ .tb-b-ct--sticky-col.tb-b-ct--sticky-head .tb-b-ct-table thead th:first-child{z-index:3}
5113
+ .tb-b-ct-table .is-hl{background:color-mix(in srgb,var(--b-highlightColor,var(--tb-color-primary,#2563eb)) 12%,var(--tb-color-background,#fff))}
5114
+ .tb-b-ct-mark{font-weight:700}
5115
+ .tb-b-ct-stack{display:none}
5116
+ .tb-b-ct-stack-card{padding:16px;border:1px solid var(--tb-color-border,currentColor);border-radius:var(--throttle-radius,8px)}
5117
+ .tb-b-ct-stack-card.is-hl{background:color-mix(in srgb,var(--b-highlightColor,var(--tb-color-primary,#2563eb)) 12%,var(--tb-color-background,#fff))}
5118
+ .tb-b-ct-stack-title{margin:0 0 8px;font-weight:700}
5119
+ .tb-b-ct-stack dl{margin:0;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 16px}
5120
+ .tb-b-ct-stack dt{font-weight:600}
5121
+ .tb-b-ct-stack dd{margin:0;text-align:end}
5122
+ .tb-b-ct-stack .tb-b-button{display:inline-flex;align-items:center;min-block-size:44px;box-sizing:border-box;margin-block-start:8px}
5123
+ @media (max-width:767px){.tb-b-ct--stacked .tb-b-ct-scroll{display:none}.tb-b-ct--stacked .tb-b-ct-stack{display:grid;gap:16px}}
5124
+ .tb-b-map{display:grid;gap:16px}
5125
+ .tb-b-map--list-beside{grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:start}
5126
+ @media (max-width:767px){.tb-b-map--list-beside{grid-template-columns:minmax(0,1fr)}}
5127
+ .tb-b-map-frame{position:relative;block-size:calc(var(--b-height,400)*1px);border-radius:var(--throttle-radius,8px);overflow:hidden;background:var(--tb-color-muted,#eef0f2)}
5128
+ .tb-b-map-frame iframe{display:block;inline-size:100%;block-size:100%;border:0}
5129
+ .tb-b-map-facade{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;text-align:center;background:repeating-linear-gradient(45deg,transparent 0 14px,rgba(0,0,0,.04) 14px 28px)}
5130
+ .tb-b-map-pin{inline-size:28px;block-size:28px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:var(--tb-color-primary,#2563eb)}
5131
+ .tb-b-map-note{margin:0;max-inline-size:32rem;font-size:.875em}
5132
+ .tb-b-map-load,.tb-b-map-show{appearance:none;cursor:pointer;font:inherit;color:inherit;background:var(--tb-color-surface,#fff);border:1px solid var(--tb-color-border-control,currentColor);border-radius:999px;min-inline-size:44px;min-block-size:44px;padding:0 16px}
5133
+ .tb-b-map-load:focus-visible,.tb-b-map-show:focus-visible,.tb-b-map-card a:focus-visible{outline:2px solid var(--tb-color-primary,currentColor);outline-offset:2px}
5134
+ .tb-b-map-show[hidden]{display:none}
5135
+ .tb-b-map-list{margin:0;padding:0;list-style:none;display:grid;gap:12px}
5136
+ .tb-b-map--list-hidden .tb-b-map-list{position:absolute;inline-size:1px;block-size:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
5137
+ .tb-b-map-card{display:flex;flex-direction:column;gap:4px;padding:12px;border:1px solid var(--tb-color-border,currentColor);border-radius:var(--throttle-radius,8px);overflow-wrap:anywhere}
5138
+ .tb-b-map-card p{margin:0}
5139
+ .tb-b-map-name{font-weight:600}
5140
+ .tb-b-map-card a{display:inline-flex;align-items:center;min-block-size:44px;color:inherit}
5141
+ }`;
5142
+ function R23MediaStyles() {
5143
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5144
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, BasicStyles, {}),
5145
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "style", { href: "tb-basics-r23-media", precedence: "throttle", children: R23_MEDIA_CSS })
5146
+ ] });
5147
+ }
5148
+
5149
+ // src/basics/r23/before-after.tsx
5150
+
5151
+ var ORIENTATIONS = ["horizontal", "vertical"];
5152
+ var RATIOS2 = { "1:1": "1 / 1", "4:3": "4 / 3", "3:2": "3 / 2", "16:9": "16 / 9" };
5153
+ var clamp = (n) => Math.min(100, Math.max(0, Math.round(n)));
5154
+ function BeforeAfter({ props, mediaOrigin, editMode }) {
5155
+ const startValue = typeof props.start === "number" && Number.isFinite(props.start) ? clamp(props.start) : 50;
5156
+ const [pos, setPos] = _react.useState.call(void 0, startValue);
5157
+ const stage = _react.useRef.call(void 0, null);
5158
+ const dragging = _react.useRef.call(void 0, false);
5159
+ const before = mediaAsset(props.before, mediaOrigin);
5160
+ const after = mediaAsset(props.after, mediaOrigin);
5161
+ if (before === null || after === null) {
5162
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5163
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5164
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Choose a before and an after image" })
5165
+ ] });
5166
+ }
5167
+ const orientation = oneOf(props.orientation, ORIENTATIONS, "horizontal");
5168
+ const vertical = orientation === "vertical";
5169
+ const ratio = typeof props.ratio === "string" && Object.hasOwn(RATIOS2, props.ratio) ? RATIOS2[props.ratio] : `${String(before.width)} / ${String(before.height)}`;
5170
+ const beforeLabel = _nullishCoalesce(str(props.beforeLabel), () => ( "Before"));
5171
+ const afterLabel = _nullishCoalesce(str(props.afterLabel), () => ( "After"));
5172
+ const name = _nullishCoalesce(str(props.handleLabel), () => ( "Comparison slider"));
5173
+ const isRtl = () => stage.current !== null && getComputedStyle(stage.current).direction === "rtl";
5174
+ const onKeyDown = (event) => {
5175
+ const flip = !vertical && isRtl();
5176
+ const keys = { ArrowRight: flip ? -1 : 1, ArrowUp: vertical ? -1 : 1, ArrowLeft: flip ? 1 : -1, ArrowDown: vertical ? 1 : -1, PageUp: 10, PageDown: -10 };
5177
+ if (event.key === "Home") setPos(0);
5178
+ else if (event.key === "End") setPos(100);
5179
+ else if (Object.hasOwn(keys, event.key)) setPos((current) => clamp(current + (_nullishCoalesce(keys[event.key], () => ( 0)))));
5180
+ else return;
5181
+ event.preventDefault();
5182
+ };
5183
+ const fromPointer = (event) => {
5184
+ const rect = _optionalChain([stage, 'access', _222 => _222.current, 'optionalAccess', _223 => _223.getBoundingClientRect, 'call', _224 => _224()]);
5185
+ if (rect === void 0) return;
5186
+ const size = vertical ? rect.height : rect.width;
5187
+ if (size <= 0) return;
5188
+ const offset = vertical ? event.clientY - rect.top : isRtl() ? rect.right - event.clientX : event.clientX - rect.left;
5189
+ setPos(clamp(offset / size * 100));
5190
+ };
5191
+ const style = { aspectRatio: ratio, "--ba-ratio": ratio, "--pos": `${String(pos)}%` };
5192
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5193
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5194
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: `tb-b-ba tb-b-ba--${orientation}`, children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
5195
+ "div",
5196
+ {
5197
+ ref: stage,
5198
+ className: "tb-b-ba-stage",
5199
+ style,
5200
+ onPointerDown: (event) => {
5201
+ if (event.button > 0) return;
5202
+ dragging.current = true;
5203
+ _optionalChain([event, 'access', _225 => _225.currentTarget, 'access', _226 => _226.setPointerCapture, 'optionalCall', _227 => _227(event.pointerId)]);
5204
+ fromPointer(event);
5205
+ },
5206
+ onPointerMove: (event) => {
5207
+ if (dragging.current) fromPointer(event);
5208
+ },
5209
+ onPointerUp: () => {
5210
+ dragging.current = false;
5211
+ },
5212
+ onPointerCancel: () => {
5213
+ dragging.current = false;
5214
+ },
5215
+ children: [
5216
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "tb-b-ba-pane tb-b-ba-before", children: [
5217
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MediaImage, { asset: before, mediaOrigin, alt: _nullishCoalesce(str(props.beforeAlt), () => ( "")), sizes: "100vw", priority: props.priority === true, style: { aspectRatio: "auto" } }),
5218
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { children: beforeLabel })
5219
+ ] }),
5220
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "tb-b-ba-pane tb-b-ba-after", children: [
5221
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, MediaImage, { asset: after, mediaOrigin, alt: _nullishCoalesce(str(props.afterAlt), () => ( "")), sizes: "100vw", priority: props.priority === true, style: { aspectRatio: "auto" } }),
5222
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { children: afterLabel })
5223
+ ] }),
5224
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5225
+ "input",
5226
+ {
5227
+ type: "range",
5228
+ className: "tb-b-ba-range",
5229
+ min: 0,
5230
+ max: 100,
5231
+ step: 1,
5232
+ value: pos,
5233
+ "aria-label": name,
5234
+ "aria-orientation": orientation,
5235
+ "aria-valuetext": `${String(pos)} % ${beforeLabel}, ${String(100 - pos)} % ${afterLabel}`,
5236
+ onKeyDown,
5237
+ onChange: (event) => setPos(clamp(Number(event.target.value)))
5238
+ }
5239
+ ),
5240
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-ba-handle", "aria-hidden": "true" })
5241
+ ]
5242
+ }
5243
+ ) })
5244
+ ] });
5245
+ }
5246
+ var beforeAfterWidgets = [{ ...r23MediaDefinition("basic.before-after"), Component: BeforeAfter }];
5247
+
5248
+ // src/basics/r23/comparison-table.tsx
5249
+
5250
+
5251
+ var MODES2 = ["scroll", "stacked"];
5252
+ var VALUE_KEYS = ["value1", "value2", "value3", "value4", "value5"];
5253
+ function ComparisonTable({ props, mediaOrigin, editMode }) {
5254
+ const stackId = _react.useId.call(void 0, );
5255
+ const columns = mediaRows(props.columns).slice(0, 5).flatMap((row, index) => {
5256
+ const title = str(row.title);
5257
+ return title === void 0 ? [] : [{ index, title, highlight: row.highlight === true, href: hrefOf(row.link, mediaOrigin), buttonLabel: str(row.buttonLabel) }];
5258
+ });
5259
+ const rows = mediaRows(props.rows).flatMap((row) => {
5260
+ const label2 = str(row.label);
5261
+ return label2 === void 0 ? [] : [{ label: label2, row }];
5262
+ });
5263
+ if (columns.length === 0 || rows.length === 0) {
5264
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5265
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5266
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add columns and rows in the settings" })
5267
+ ] });
5268
+ }
5269
+ const included = _nullishCoalesce(str(props.includedText), () => ( "Included"));
5270
+ const notIncluded = _nullishCoalesce(str(props.notIncludedText), () => ( "Not included"));
5271
+ const notApplicable = _nullishCoalesce(str(props.notApplicableText), () => ( "Not applicable"));
5272
+ const mode = oneOf(props.mobileMode, MODES2, "scroll");
5273
+ const caption = str(props.caption);
5274
+ const cell = (raw) => {
5275
+ const value = mediaText(raw).trim();
5276
+ switch (value.toLowerCase()) {
5277
+ case "check":
5278
+ case "\u2713":
5279
+ case "\u2714":
5280
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5281
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-ct-mark tb-b-ct-mark--check", "aria-hidden": "true", children: "\u2713" }),
5282
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-msr", children: included })
5283
+ ] });
5284
+ case "cross":
5285
+ case "\u2715":
5286
+ case "\u2717":
5287
+ case "\u2716":
5288
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5289
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-ct-mark tb-b-ct-mark--cross", "aria-hidden": "true", children: "\u2715" }),
5290
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-msr", children: notIncluded })
5291
+ ] });
5292
+ case "dash":
5293
+ case "\u2013":
5294
+ case "\u2014":
5295
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5296
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-ct-mark tb-b-ct-mark--dash", "aria-hidden": "true", children: "\u2013" }),
5297
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-msr", children: notApplicable })
5298
+ ] });
5299
+ default:
5300
+ return value;
5301
+ }
5302
+ };
5303
+ const button = (col) => col.href !== null && col.buttonLabel !== void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className: "tb-b-button tb-b-button--primary", href: col.href, "aria-label": `${col.buttonLabel}: ${col.title}`, children: col.buttonLabel }) : null;
5304
+ const className = [
5305
+ "tb-b-ct",
5306
+ props.stickyHeader === true ? "tb-b-ct--sticky-head" : "",
5307
+ props.stickyFirstColumn === true ? "tb-b-ct--sticky-col" : "",
5308
+ mode === "stacked" ? "tb-b-ct--stacked" : ""
5309
+ ].filter((c) => c !== "").join(" ");
5310
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5311
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5312
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
5313
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-ct-scroll", role: "region", tabIndex: 0, "aria-label": _nullishCoalesce(str(props.scrollLabel), () => ( "Comparison table, scrollable")), children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "table", { className: "tb-b-ct-table", children: [
5314
+ caption !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "caption", { children: caption }),
5315
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "thead", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { children: [
5316
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { scope: "col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-msr", children: _nullishCoalesce(str(props.featureLabel), () => ( "Feature")) }) }),
5317
+ columns.map((col) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "th", { scope: "col", className: col.highlight ? "is-hl" : void 0, children: [
5318
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-ct-title", children: col.title }),
5319
+ button(col)
5320
+ ] }, col.index))
5321
+ ] }) }),
5322
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "tbody", { children: rows.map(({ label: label2, row }, r) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "tr", { children: [
5323
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "th", { scope: "row", children: label2 }),
5324
+ columns.map((col) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "td", { className: col.highlight ? "is-hl" : void 0, children: cell(row[_nullishCoalesce(VALUE_KEYS[col.index], () => ( "value1"))]) }, col.index))
5325
+ ] }, r)) })
5326
+ ] }) }),
5327
+ mode === "stacked" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-ct-stack", children: columns.map((col) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { role: "group", "aria-labelledby": `${stackId}-${String(col.index)}`, className: `tb-b-ct-stack-card${col.highlight ? " is-hl" : ""}`, children: [
5328
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { id: `${stackId}-${String(col.index)}`, className: "tb-b-ct-stack-title", children: col.title }),
5329
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "dl", { children: rows.flatMap(({ label: label2, row }, r) => [
5330
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "dt", { children: label2 }, `t${String(r)}`),
5331
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "dd", { children: cell(row[_nullishCoalesce(VALUE_KEYS[col.index], () => ( "value1"))]) }, `d${String(r)}`)
5332
+ ]) }),
5333
+ button(col)
5334
+ ] }, col.index)) })
5335
+ ] })
5336
+ ] });
5337
+ }
5338
+ var comparisonTableWidgets = [{ ...r23MediaDefinition("basic.comparison-table"), Component: ComparisonTable }];
5339
+
5340
+ // src/basics/r23/gallery.tsx
5341
+
5342
+ var _reactdom = require('react-dom');
5343
+
5344
+
5345
+ var LAYOUTS5 = ["grid", "masonry", "carousel"];
5346
+ var CAPTIONS = ["below", "overlay", "hidden"];
5347
+ var RATIOS3 = { "1:1": "1 / 1", "4:5": "4 / 5" };
5348
+ var reducedMotion2 = () => _optionalChain([window, 'access', _228 => _228.matchMedia, 'optionalCall', _229 => _229("(prefers-reduced-motion: reduce)"), 'access', _230 => _230.matches]) === true;
5349
+ var statusOf = (template, n, total) => template.replaceAll("{n}", String(n)).replaceAll("{total}", String(total));
5350
+ function Lightbox({
5351
+ shots,
5352
+ index,
5353
+ setIndex,
5354
+ onClose,
5355
+ returnTo,
5356
+ label: label2,
5357
+ statusText,
5358
+ texts,
5359
+ mediaOrigin
5360
+ }) {
5361
+ const dialog = _react.useRef.call(void 0, null);
5362
+ const closeButton = _react.useRef.call(void 0, null);
5363
+ _react.useEffect.call(void 0, () => {
5364
+ _optionalChain([closeButton, 'access', _231 => _231.current, 'optionalAccess', _232 => _232.focus, 'call', _233 => _233()]);
5365
+ const previous = document.body.style.overflow;
5366
+ document.body.style.overflow = "hidden";
5367
+ return () => {
5368
+ document.body.style.overflow = previous;
5369
+ _optionalChain([returnTo, 'optionalAccess', _234 => _234.focus, 'call', _235 => _235()]);
5370
+ };
5371
+ }, [returnTo]);
5372
+ const total = shots.length;
5373
+ const go = (dir) => setIndex((index + dir + total) % total);
5374
+ const onKeyDown = (event) => {
5375
+ if (event.key === "Escape") {
5376
+ event.stopPropagation();
5377
+ onClose();
5378
+ } else if (event.key === "ArrowRight" || event.key === "ArrowLeft") {
5379
+ if (total < 2) return;
5380
+ event.stopPropagation();
5381
+ const rtl = dialog.current !== null && getComputedStyle(dialog.current).direction === "rtl";
5382
+ go(event.key === "ArrowRight" !== rtl ? 1 : -1);
5383
+ } else if (event.key === "Tab") {
5384
+ event.stopPropagation();
5385
+ if (dialog.current !== null) trapTab(event, focusablesOf(dialog.current));
5386
+ }
5387
+ };
5388
+ const latestKeyDown = _react.useRef.call(void 0, onKeyDown);
5389
+ latestKeyDown.current = onKeyDown;
5390
+ _react.useEffect.call(void 0, () => {
5391
+ const listener = (event) => latestKeyDown.current(event);
5392
+ document.addEventListener("keydown", listener, true);
5393
+ return () => document.removeEventListener("keydown", listener, true);
5394
+ }, []);
5395
+ const shot = shots[index];
5396
+ if (shot === void 0) return null;
5397
+ return _reactdom.createPortal.call(void 0,
5398
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
5399
+ "div",
5400
+ {
5401
+ ref: dialog,
5402
+ className: "tb-b-gal-dialog",
5403
+ role: "dialog",
5404
+ "aria-modal": "true",
5405
+ "aria-label": label2,
5406
+ tabIndex: -1,
5407
+ onClick: (event) => {
5408
+ if (event.target === event.currentTarget) onClose();
5409
+ },
5410
+ children: [
5411
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { ref: closeButton, type: "button", className: "tb-b-gal-x", onClick: onClose, children: texts.close }),
5412
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-gal-stage", children: [
5413
+ total > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": texts.prev, onClick: () => go(-1), children: "\u2039" }),
5414
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { children: [
5415
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, AssetImage, { asset: shot.asset, mediaOrigin, alt: shot.alt, sizes: "100vw", loading: "eager" }),
5416
+ shot.caption !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { children: shot.caption })
5417
+ ] }),
5418
+ total > 1 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", "aria-label": texts.next, onClick: () => go(1), children: "\u203A" })
5419
+ ] }),
5420
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-gal-status", role: "status", "aria-live": "polite", children: statusOf(statusText, index + 1, total) })
5421
+ ]
5422
+ }
5423
+ ),
5424
+ document.body
5425
+ );
5426
+ }
5427
+ function Gallery({ props, mediaOrigin, editMode, interactive }) {
5428
+ const [open, setOpen2] = _react.useState.call(void 0, null);
5429
+ const returnTo = _react.useRef.call(void 0, null);
5430
+ const track = _react.useRef.call(void 0, null);
5431
+ const shots = [];
5432
+ for (const row of mediaRows(props.images)) {
5433
+ const asset = mediaAsset(row.image, mediaOrigin);
5434
+ const full = asset === null ? null : _builderschema.safeUrl.call(void 0, asset.url, "src", { mediaOrigin });
5435
+ if (asset === null || full === null) continue;
5436
+ shots.push({ asset, full, alt: _nullishCoalesce(str(row.alt), () => ( "")), caption: str(row.caption), href: hrefOf(row.link, mediaOrigin) });
5437
+ }
5438
+ if (shots.length === 0) {
5439
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5440
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5441
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add images in the settings" })
5442
+ ] });
5443
+ }
5444
+ const layout = oneOf(props.layout, LAYOUTS5, "grid");
5445
+ const captions = oneOf(props.captions, CAPTIONS, "below");
5446
+ const ratio = typeof props.ratio === "string" && Object.hasOwn(RATIOS3, props.ratio) ? RATIOS3[props.ratio] : void 0;
5447
+ const lightbox = props.lightbox !== false;
5448
+ const label2 = _nullishCoalesce(str(props.label), () => ( "Gallery"));
5449
+ const statusText = _nullishCoalesce(str(props.statusText), () => ( "Image {n} of {total}"));
5450
+ const texts = { close: _nullishCoalesce(str(props.closeLabel), () => ( "Close")), prev: _nullishCoalesce(str(props.prevLabel), () => ( "Previous image")), next: _nullishCoalesce(str(props.nextLabel), () => ( "Next image")) };
5451
+ const priority = props.priority === true;
5452
+ const columns = (value, fallback) => typeof value === "number" && value >= 1 ? value : fallback;
5453
+ const sizes = `(max-width: 767px) ${String(Math.round(100 / columns(props.columnsMobile, 2)))}vw, ${String(Math.round(100 / columns(props.columnsDesktop, 3)))}vw`;
5454
+ const step2 = (dir) => {
5455
+ const el = track.current;
5456
+ if (el === null) return;
5457
+ const rtl = getComputedStyle(el).direction === "rtl";
5458
+ _optionalChain([el, 'access', _236 => _236.scrollBy, 'optionalCall', _237 => _237({ left: dir * el.clientWidth * (rtl ? -1 : 1), behavior: reducedMotion2() ? "auto" : "smooth" })]);
5459
+ };
5460
+ const items = shots.map((shot, index) => {
5461
+ const img = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5462
+ MediaImage,
5463
+ {
5464
+ asset: shot.asset,
5465
+ mediaOrigin,
5466
+ alt: shot.alt,
5467
+ sizes,
5468
+ priority: priority && index === 0,
5469
+ ...ratio === void 0 ? {} : { style: { aspectRatio: ratio } }
5470
+ }
5471
+ );
5472
+ const href = lightbox ? shot.full : shot.href;
5473
+ const name = shot.alt === "" ? _nullishCoalesce(shot.caption, () => ( statusOf(statusText, index + 1, shots.length))) : void 0;
5474
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "figure", { className: "tb-b-gal-item", children: [
5475
+ href === null ? img : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5476
+ "a",
5477
+ {
5478
+ className: "tb-b-gal-link",
5479
+ href,
5480
+ ...name === void 0 ? {} : { "aria-label": name },
5481
+ ...lightbox ? { "aria-haspopup": "dialog" } : {},
5482
+ onClick: lightbox && interactive !== false && !editMode ? (event) => {
5483
+ if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
5484
+ event.preventDefault();
5485
+ returnTo.current = event.currentTarget;
5486
+ setOpen2(index);
5487
+ } : void 0,
5488
+ children: img
5489
+ }
5490
+ ),
5491
+ captions !== "hidden" && shot.caption !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "figcaption", { children: shot.caption })
5492
+ ] }) }, index);
5493
+ });
5494
+ const carousel = layout === "carousel" && shots.length > 1;
5495
+ const className = `tb-b-gal tb-b-gal--${carousel ? "carousel" : layout === "carousel" ? "grid" : layout} tb-b-gal--caps-${captions}`;
5496
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5497
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5498
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className, children: [
5499
+ carousel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5500
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-gal-scroll", ref: track, role: "group", tabIndex: 0, "aria-label": label2, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-gal-list", children: items }) }),
5501
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-gal-ctrl", children: [
5502
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-gal-btn", "aria-label": texts.prev, onClick: () => step2(-1), children: "\u2039" }),
5503
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-gal-btn", "aria-label": texts.next, onClick: () => step2(1), children: "\u203A" })
5504
+ ] })
5505
+ ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-gal-list", "aria-label": label2, children: items }),
5506
+ open !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5507
+ Lightbox,
5508
+ {
5509
+ shots,
5510
+ index: open,
5511
+ setIndex: setOpen2,
5512
+ onClose: () => setOpen2(null),
5513
+ returnTo: returnTo.current,
5514
+ label: label2,
5515
+ statusText,
5516
+ texts,
5517
+ mediaOrigin
5518
+ }
5519
+ )
5520
+ ] })
5521
+ ] });
5522
+ }
5523
+ var galleryWidgets = [{ ...r23MediaDefinition("basic.gallery"), Component: Gallery }];
5524
+
5525
+ // src/basics/r23/map.tsx
5526
+
5527
+
5528
+ var PROVIDERS = ["openstreetmap", "google"];
5529
+ var LIST = ["below", "beside", "hidden"];
5530
+ var TYPES = ["LocalBusiness", "Store"];
5531
+ var DAYS = { mon: "Mo", tue: "Tu", wed: "We", thu: "Th", fri: "Fr", sat: "Sa", sun: "Su" };
5532
+ var DAY = "[A-Za-z]{3,9}";
5533
+ var DAY_PART = `${DAY}(?:\\s*[-\u2013]\\s*${DAY})?`;
5534
+ var HOURS_RE = new RegExp(`^\\s*(${DAY_PART}(?:\\s*,\\s*${DAY_PART})*)\\s+(\\d{1,2})(?::(\\d{2}))?\\s*(?:-|\u2013|to)\\s*(\\d{1,2})(?::(\\d{2}))?\\s*$`, "iu");
5535
+ var dayCode = (word) => {
5536
+ const key = word.trim().slice(0, 3).toLowerCase();
5537
+ return /^[a-z]{3,9}$/iu.test(word.trim()) && Object.hasOwn(DAYS, key) ? DAYS[key] : void 0;
5538
+ };
5539
+ var clock = (hour, minute) => {
5540
+ const h = Number(hour);
5541
+ const m = minute === void 0 ? 0 : Number(minute);
5542
+ return h > 24 || m > 59 || h === 24 && m > 0 ? null : `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`;
5543
+ };
5544
+ function parseOpeningHours(input) {
5545
+ const out = [];
5546
+ for (const segment of input.split(/[;\n]+/u)) {
5547
+ const match = HOURS_RE.exec(segment);
5548
+ if (match === null) continue;
5549
+ const days = [];
5550
+ for (const part2 of (_nullishCoalesce(match[1], () => ( ""))).split(",")) {
5551
+ const ends = part2.split(/[-–]/u).map(dayCode);
5552
+ if (ends.length === 0 || ends.some((end) => end === void 0)) {
5553
+ days.length = 0;
5554
+ break;
5555
+ }
5556
+ days.push(ends.join("-"));
5557
+ }
5558
+ const open = clock(_nullishCoalesce(match[2], () => ( "")), match[3]);
5559
+ const close = clock(_nullishCoalesce(match[4], () => ( "")), match[5]);
5560
+ if (days.length > 0 && open !== null && close !== null) out.push(`${days.join(",")} ${open}-${close}`);
5561
+ }
5562
+ return out;
5563
+ }
5564
+ var coord = (value, limit) => typeof value === "number" && Number.isFinite(value) && Math.abs(value) <= limit ? value : null;
5565
+ var round = (n) => String(Math.round(n * 1e6) / 1e6);
5566
+ function embedSrc2(provider, lat, lng, zoom) {
5567
+ if (provider === "google") {
5568
+ return `https://www.google.com/maps?${new URLSearchParams({ q: `${round(lat)},${round(lng)}`, z: String(zoom), output: "embed" }).toString()}`;
5569
+ }
5570
+ const lon = 360 / 2 ** zoom * 1.5;
5571
+ const la = lon * 0.6;
5572
+ const bbox = [Math.max(-180, lng - lon), Math.max(-85, lat - la), Math.min(180, lng + lon), Math.min(85, lat + la)].map(round).join(",");
5573
+ return `https://www.openstreetmap.org/export/embed.html?${new URLSearchParams({ bbox, layer: "mapnik", marker: `${round(lat)},${round(lng)}` }).toString()}`;
5574
+ }
5575
+ var directionsHref = (place) => {
5576
+ const destination = place.lat !== null && place.lng !== null ? `${round(place.lat)},${round(place.lng)}` : place.address;
5577
+ return destination === void 0 ? null : `https://www.google.com/maps/dir/?${new URLSearchParams({ api: "1", destination }).toString()}`;
5578
+ };
5579
+ var telHref = (phone) => {
5580
+ const digits = phone.replace(/[^\d]/gu, "");
5581
+ return digits.length >= 5 && digits.length <= 15 ? `tel:${phone.trim().startsWith("+") ? "+" : ""}${digits}` : null;
5582
+ };
5583
+ function MapWidget({ node, props, mediaOrigin, editMode }) {
5584
+ const consentRequired = props.consentRequired !== false;
5585
+ const [loaded, setLoaded] = _react.useState.call(void 0, !consentRequired);
5586
+ const places = mediaRows(props.locations).slice(0, 20).map((row, index) => ({
5587
+ index,
5588
+ name: str(row.name),
5589
+ address: str(row.address),
5590
+ lat: coord(row.lat, 90),
5591
+ lng: coord(row.lng, 180),
5592
+ hours: str(row.hours),
5593
+ phone: str(row.phone),
5594
+ href: hrefOf(row.link, mediaOrigin)
5595
+ })).filter((place) => place.name !== void 0 || place.address !== void 0);
5596
+ const mappable = places.filter((place) => place.lat !== null && place.lng !== null);
5597
+ const [selected, setSelected] = _react.useState.call(void 0, _nullishCoalesce(_optionalChain([mappable, 'access', _238 => _238[0], 'optionalAccess', _239 => _239.index]), () => ( 0)));
5598
+ if (places.length === 0) {
5599
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5600
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5601
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Placeholder, { editMode, children: "Add locations in the settings" })
5602
+ ] });
5603
+ }
5604
+ const provider = oneOf(props.provider, PROVIDERS, "openstreetmap");
5605
+ const zoom = typeof props.zoom === "number" && props.zoom >= 3 && props.zoom <= 18 ? Math.round(props.zoom) : 14;
5606
+ const listMode = oneOf(props.showList, LIST, "below");
5607
+ const current = _nullishCoalesce(mappable.find((place) => place.index === selected), () => ( mappable[0]));
5608
+ const showFrame = loaded && !editMode && current !== void 0 && current.lat !== null && current.lng !== null;
5609
+ const directions = _nullishCoalesce(str(props.directionsLabel), () => ( "Get directions"));
5610
+ const showLabel = _nullishCoalesce(str(props.showLabel), () => ( "Show on map"));
5611
+ const schemaType = oneOf(props.schemaType, TYPES, "LocalBusiness");
5612
+ const lds = props.jsonLd !== true ? [] : places.flatMap((place) => {
5613
+ if (place.name === void 0 || place.address === void 0) return [];
5614
+ const hours = place.hours === void 0 ? [] : parseOpeningHours(place.hours);
5615
+ return [
5616
+ {
5617
+ "@context": "https://schema.org",
5618
+ "@type": schemaType,
5619
+ // A fragment of the page's own address: stable per position in the list.
5620
+ "@id": `#store-${node.id}-${String(place.index)}`,
5621
+ name: place.name,
5622
+ address: { "@type": "PostalAddress", streetAddress: place.address },
5623
+ ...place.lat !== null && place.lng !== null ? { geo: { "@type": "GeoCoordinates", latitude: place.lat, longitude: place.lng } } : {},
5624
+ ...hours.length === 0 ? {} : { openingHours: hours },
5625
+ ...place.phone === void 0 ? {} : { telephone: place.phone },
5626
+ ...place.href !== null && place.href.startsWith("https://") ? { url: place.href } : {}
5627
+ }
5628
+ ];
5629
+ });
5630
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
5631
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, R23MediaStyles, {}),
5632
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: `tb-b-map tb-b-map--list-${listMode}`, children: [
5633
+ mappable.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "tb-b-map-frame", children: showFrame && current.lat !== null && current.lng !== null ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5634
+ "iframe",
5635
+ {
5636
+ src: embedSrc2(provider, current.lat, current.lng, zoom),
5637
+ title: _nullishCoalesce(str(props.mapTitle), () => ( "Map")),
5638
+ loading: "lazy",
5639
+ referrerPolicy: "strict-origin-when-cross-origin",
5640
+ sandbox: "allow-scripts allow-same-origin allow-popups"
5641
+ },
5642
+ `${String(current.index)}-${provider}`
5643
+ ) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "tb-b-map-facade", children: [
5644
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "tb-b-map-pin", "aria-hidden": "true" }),
5645
+ str(props.privacyNote) !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-map-note", children: str(props.privacyNote) }),
5646
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", className: "tb-b-map-load", onClick: () => setLoaded(true), children: _nullishCoalesce(str(props.loadLabel), () => ( "Load interactive map")) })
5647
+ ] }) }),
5648
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "tb-b-map-list", children: places.map((place) => {
5649
+ const plain = listMode === "hidden";
5650
+ const dir = plain ? null : directionsHref(place);
5651
+ const tel = place.phone === void 0 || plain ? null : telHref(place.phone);
5652
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "li", { className: "tb-b-map-card", children: [
5653
+ place.name !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-map-name", children: place.href === null || plain ? place.name : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: place.href, children: place.name }) }),
5654
+ place.address !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-map-address", children: place.address }),
5655
+ place.hours !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-map-hours", children: place.hours }),
5656
+ place.phone !== void 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "tb-b-map-phone", children: tel === null ? place.phone : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { href: tel, children: place.phone }) }),
5657
+ dir !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "a", { className: "tb-b-map-dir", href: dir, target: "_blank", rel: "noopener", "aria-label": place.name === void 0 ? directions : `${directions}: ${place.name}`, children: directions }),
5658
+ !plain && mappable.length > 1 && place.lat !== null && place.lng !== null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
5659
+ "button",
5660
+ {
5661
+ type: "button",
5662
+ className: "tb-b-map-show",
5663
+ "aria-pressed": _optionalChain([current, 'optionalAccess', _240 => _240.index]) === place.index,
5664
+ "aria-label": place.name === void 0 ? showLabel : `${showLabel}: ${place.name}`,
5665
+ onClick: () => setSelected(place.index),
5666
+ children: showLabel
5667
+ }
5668
+ )
5669
+ ] }, place.index);
5670
+ }) }),
5671
+ lds.map((ld, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "script", { type: "application/ld+json", children: jsonLdString(ld) }, i))
5672
+ ] })
5673
+ ] });
5674
+ }
5675
+ var mapWidgets = [{ ...r23MediaDefinition("basic.map"), Component: MapWidget }];
5676
+
5677
+ // src/basics/r23/media-index.ts
5678
+ var r23MediaWidgets = [...galleryWidgets, ...beforeAfterWidgets, ...comparisonTableWidgets, ...mapWidgets];
5679
+
4185
5680
  // src/basics/index.ts
4186
5681
  var BASIC_COMPONENTS = {
4187
5682
  "basic.heading": Heading,
@@ -4209,7 +5704,9 @@ var widgets = mergeV2Widgets(v1Widgets, [
4209
5704
  ...quoteWidgets,
4210
5705
  ...menuV2Widgets,
4211
5706
  ...announcementV2Widgets,
4212
- ...headingV2Widgets
5707
+ ...headingV2Widgets,
5708
+ ...r23ContentWidgets,
5709
+ ...r23MediaWidgets
4213
5710
  ]);
4214
5711
  var basicPack = { id: "basic", version: "0.0.0", widgets, dataSources: [] };
4215
5712
 
@@ -4231,17 +5728,17 @@ function parseBody(raw) {
4231
5728
  const stack = Array.isArray(raw.stack) ? raw.stack : void 0;
4232
5729
  if (columns === void 0 === (stack === void 0)) return null;
4233
5730
  const children = columns !== void 0 ? [{ id: WRAP.inner, type: "inner-section", props: {}, columns }] : _nullishCoalesce(stack, () => ( []));
4234
- if (_optionalChain([stack, 'optionalAccess', _205 => _205.some, 'call', _206 => _206((node) => isRecord6(node) && node.type === "inner-section")])) return null;
5731
+ if (_optionalChain([stack, 'optionalAccess', _241 => _241.some, 'call', _242 => _242((node) => isRecord6(node) && node.type === "inner-section")])) return null;
4235
5732
  const parsed2 = _builderschema.pageDocumentSchema.safeParse({
4236
5733
  schemaVersion: 1,
4237
5734
  sections: [{ id: WRAP.section, type: "section", props: {}, columns: [{ id: WRAP.column, type: "column", props: { width: 100 }, children }] }]
4238
5735
  });
4239
5736
  if (!parsed2.success) return null;
4240
5737
  const wrapper = parsed2.data.sections[0];
4241
- const first = _nullishCoalesce((_optionalChain([wrapper, 'optionalAccess', _207 => _207.type]) === "section" ? _optionalChain([wrapper, 'access', _208 => _208.columns, 'access', _209 => _209[0], 'optionalAccess', _210 => _210.children]) : void 0), () => ( []));
5738
+ const first = _nullishCoalesce((_optionalChain([wrapper, 'optionalAccess', _243 => _243.type]) === "section" ? _optionalChain([wrapper, 'access', _244 => _244.columns, 'access', _245 => _245[0], 'optionalAccess', _246 => _246.children]) : void 0), () => ( []));
4242
5739
  if (columns !== void 0) {
4243
5740
  const inner = first[0];
4244
- return _optionalChain([inner, 'optionalAccess', _211 => _211.type]) === "inner-section" ? { columns: inner.columns } : null;
5741
+ return _optionalChain([inner, 'optionalAccess', _247 => _247.type]) === "inner-section" ? { columns: inner.columns } : null;
4245
5742
  }
4246
5743
  return { stack: first.filter((node) => node.type !== "inner-section") };
4247
5744
  }
@@ -4252,9 +5749,9 @@ function compileComposite(snapshot) {
4252
5749
  return result;
4253
5750
  }
4254
5751
  function compile2(snapshot) {
4255
- const label = `${snapshot.type}@${String(snapshot.v)}`;
5752
+ const label2 = `${snapshot.type}@${String(snapshot.v)}`;
4256
5753
  const refuse = (why) => {
4257
- warnOnce(`composite:${label}`, `${label} was refused (${why}); rendering nothing for it`);
5754
+ warnOnce(`composite:${label2}`, `${label2} was refused (${why}); rendering nothing for it`);
4258
5755
  return null;
4259
5756
  };
4260
5757
  if (snapshot.kind !== "composite") return refuse("not a composite widget");
@@ -4295,7 +5792,7 @@ var DEVICES6 = ["tablet", "phone"];
4295
5792
  function withoutAnchor(node) {
4296
5793
  delete node.props.anchor;
4297
5794
  const responsive = node.responsive;
4298
- for (const device of DEVICES6) if (_optionalChain([responsive, 'optionalAccess', _212 => _212[device]]) !== void 0) delete responsive[device].anchor;
5795
+ for (const device of DEVICES6) if (_optionalChain([responsive, 'optionalAccess', _248 => _248[device]]) !== void 0) delete responsive[device].anchor;
4299
5796
  }
4300
5797
  function instanceId(outer, inner) {
4301
5798
  let a = 3735928559;
@@ -4315,9 +5812,9 @@ function build2(input) {
4315
5812
  const assets = {};
4316
5813
  const hrefs = /* @__PURE__ */ new Map();
4317
5814
  const innerData = {};
4318
- const keep = (child) => _optionalChain([registry, 'access', _213 => _213.widget, 'call', _214 => _214(child.type, child.v), 'optionalAccess', _215 => _215.kind]) !== "composite";
4319
- const columns = _optionalChain([body, 'access', _216 => _216.columns, 'optionalAccess', _217 => _217.map, 'call', _218 => _218((column2) => ({ ...column2, children: column2.children.filter(keep) }))]);
4320
- const stack = _optionalChain([body, 'access', _219 => _219.stack, 'optionalAccess', _220 => _220.filter, 'call', _221 => _221(keep)]);
5815
+ const keep = (child) => _optionalChain([registry, 'access', _249 => _249.widget, 'call', _250 => _250(child.type, child.v), 'optionalAccess', _251 => _251.kind]) !== "composite";
5816
+ const columns = _optionalChain([body, 'access', _252 => _252.columns, 'optionalAccess', _253 => _253.map, 'call', _254 => _254((column2) => ({ ...column2, children: column2.children.filter(keep) }))]);
5817
+ const stack = _optionalChain([body, 'access', _255 => _255.stack, 'optionalAccess', _256 => _256.filter, 'call', _257 => _257(keep)]);
4321
5818
  const widgets2 = columns !== void 0 ? columns.flatMap((column2) => column2.children) : _nullishCoalesce(stack, () => ( []));
4322
5819
  for (const widget of widgets2) {
4323
5820
  withoutAnchor(widget);
@@ -4352,15 +5849,15 @@ function build2(input) {
4352
5849
  const value = props[binding.setting];
4353
5850
  for (const target2 of binding.targets) {
4354
5851
  const inner = byId.get(target2.node);
4355
- const innerField = inner === void 0 ? void 0 : _optionalChain([registry, 'access', _222 => _222.widget, 'call', _223 => _223(inner.type, inner.v), 'optionalAccess', _224 => _224.settings, 'access', _225 => _225.find, 'call', _226 => _226((f) => f.key === target2.prop)]);
5852
+ const innerField = inner === void 0 ? void 0 : _optionalChain([registry, 'access', _258 => _258.widget, 'call', _259 => _259(inner.type, inner.v), 'optionalAccess', _260 => _260.settings, 'access', _261 => _261.find, 'call', _262 => _262((f) => f.key === target2.prop)]);
4356
5853
  if (inner === void 0 || innerField === void 0 || innerField.control !== field.control) continue;
4357
5854
  const converted = convert(field, value);
4358
5855
  if (_builderschema.validateSettingValue.call(void 0, innerField, converted) !== null) continue;
4359
5856
  inner.props[target2.prop] = converted;
4360
5857
  const responsive = inner.responsive;
4361
5858
  for (const device of DEVICES6) {
4362
- if (_optionalChain([responsive, 'optionalAccess', _227 => _227[device]]) !== void 0) delete responsive[device][target2.prop];
4363
- const raw = _optionalChain([outer, 'access', _228 => _228.responsive, 'optionalAccess', _229 => _229[device]]);
5859
+ if (_optionalChain([responsive, 'optionalAccess', _263 => _263[device]]) !== void 0) delete responsive[device][target2.prop];
5860
+ const raw = _optionalChain([outer, 'access', _264 => _264.responsive, 'optionalAccess', _265 => _265[device]]);
4364
5861
  const plain = field.output === "css" && field.translatable !== true && field.control !== "image" && field.control !== "link";
4365
5862
  if (plain && raw !== void 0 && Object.hasOwn(raw, binding.setting) && _builderschema.validateSettingValue.call(void 0, innerField, raw[binding.setting]) === null) {
4366
5863
  const target$ = _nullishCoalesce(inner.responsive, () => ( (inner.responsive = {})));
@@ -4375,7 +5872,7 @@ function build2(input) {
4375
5872
  for (const target2 of input$.targets) {
4376
5873
  const inner = byId.get(target2.node);
4377
5874
  const def = inner === void 0 ? void 0 : registry.widget(inner.type, inner.v);
4378
- if (inner === void 0 || _optionalChain([def, 'optionalAccess', _230 => _230.data]) === void 0 || !Object.hasOwn(def.data, target2.input)) continue;
5875
+ if (inner === void 0 || _optionalChain([def, 'optionalAccess', _266 => _266.data]) === void 0 || !Object.hasOwn(def.data, target2.input)) continue;
4379
5876
  inner.data = { ..._nullishCoalesce(inner.data, () => ( {})), [target2.input]: { source: key } };
4380
5877
  innerData[key] = data[name];
4381
5878
  }
@@ -4393,7 +5890,7 @@ function build2(input) {
4393
5890
  schemaVersion: 1,
4394
5891
  sections: [{ id: ids.section, type: "section", props: { width: "full" }, columns: [column] }]
4395
5892
  };
4396
- let weight = 2 + (_nullishCoalesce(_optionalChain([columns, 'optionalAccess', _231 => _231.length]), () => ( 0))) + (columns === void 0 ? 0 : 1);
5893
+ let weight = 2 + (_nullishCoalesce(_optionalChain([columns, 'optionalAccess', _267 => _267.length]), () => ( 0))) + (columns === void 0 ? 0 : 1);
4397
5894
  for (const widget of widgets2) {
4398
5895
  const component = registry.component(widget);
4399
5896
  weight += 1 + (component === void 0 ? 0 : _nullishCoalesce(componentWeights.get(component), () => ( 0)));
@@ -4420,7 +5917,7 @@ function CompositeBody(props) {
4420
5917
  mediaOrigin,
4421
5918
  interactive,
4422
5919
  idScope,
4423
- resolveLink: (target2) => _nullishCoalesce(_nullishCoalesce(built.hrefs.get(JSON.stringify(target2)), () => ( _optionalChain([resolveLink, 'optionalCall', _232 => _232(target2)]))), () => ( null))
5920
+ resolveLink: (target2) => _nullishCoalesce(_nullishCoalesce(built.hrefs.get(JSON.stringify(target2)), () => ( _optionalChain([resolveLink, 'optionalCall', _268 => _268(target2)]))), () => ( null))
4424
5921
  }
4425
5922
  );
4426
5923
  }
@@ -4532,7 +6029,7 @@ async function loadBuilderPage(options) {
4532
6029
  // src/server/load-template.ts
4533
6030
  function templateRootOf(packs, name) {
4534
6031
  for (const pack of _nullishCoalesce(packs, () => ( []))) {
4535
- const found = _optionalChain([pack, 'access', _233 => _233.templates, 'optionalAccess', _234 => _234.find, 'call', _235 => _235((entry) => entry.name === name)]);
6032
+ const found = _optionalChain([pack, 'access', _269 => _269.templates, 'optionalAccess', _270 => _270.find, 'call', _271 => _271((entry) => entry.name === name)]);
4536
6033
  if (found !== void 0) return found.Root;
4537
6034
  }
4538
6035
  return void 0;
@@ -4600,7 +6097,7 @@ function pagePathOf(settings, page, resolve) {
4600
6097
  return _nullishCoalesce(_builderschema.safeUrl.call(void 0, resolve({ ...page, path }), "href", { mediaOrigin: "" }), () => ( path));
4601
6098
  }
4602
6099
  function originOf(storeUrl) {
4603
- const origin = _optionalChain([storeUrl, 'optionalAccess', _236 => _236.replace, 'call', _237 => _237(/\/+$/u, "")]);
6100
+ const origin = _optionalChain([storeUrl, 'optionalAccess', _272 => _272.replace, 'call', _273 => _273(/\/+$/u, "")]);
4604
6101
  return origin !== void 0 && ORIGIN_RE.test(origin) ? origin : void 0;
4605
6102
  }
4606
6103
  function siteLocales(settings) {
@@ -4628,22 +6125,22 @@ function templateMetadataOf(name, input) {
4628
6125
  const site = isRec2(settings.seo) ? settings.seo : {};
4629
6126
  const brand = isRec2(settings.brand) ? settings.brand : {};
4630
6127
  const store = _nullishCoalesce(text(brand.storeName), () => ( ""));
4631
- const query = _optionalChain([context, 'optionalAccess', _238 => _238.route, 'optionalAccess', _239 => _239.query, 'optionalAccess', _240 => _240.q]);
6128
+ const query = _optionalChain([context, 'optionalAccess', _274 => _274.route, 'optionalAccess', _275 => _275.query, 'optionalAccess', _276 => _276.q]);
4632
6129
  const tokens = {
4633
- "{product.title}": titleOf(_optionalChain([context, 'optionalAccess', _241 => _241.product])),
4634
- "{listing.title}": titleOf(_optionalChain([context, 'optionalAccess', _242 => _242.listing])),
6130
+ "{product.title}": titleOf(_optionalChain([context, 'optionalAccess', _277 => _277.product])),
6131
+ "{listing.title}": titleOf(_optionalChain([context, 'optionalAccess', _278 => _278.listing])),
4635
6132
  "{query}": _nullishCoalesce((Array.isArray(query) ? query[0] : query), () => ( "")),
4636
6133
  "{store}": store
4637
6134
  };
4638
- const pattern = _nullishCoalesce(_nullishCoalesce(text(_optionalChain([input, 'access', _243 => _243.meta, 'optionalAccess', _244 => _244.seo, 'optionalAccess', _245 => _245.titleTemplate])), () => ( DEFAULT_TITLE[name])), () => ( "{store}"));
6135
+ const pattern = _nullishCoalesce(_nullishCoalesce(text(_optionalChain([input, 'access', _279 => _279.meta, 'optionalAccess', _280 => _280.seo, 'optionalAccess', _281 => _281.titleTemplate])), () => ( DEFAULT_TITLE[name])), () => ( "{store}"));
4639
6136
  let title = pattern;
4640
6137
  for (const [token, value] of Object.entries(tokens)) title = title.replaceAll(token, () => value);
4641
6138
  title = title.replace(/^[\s–—|·:-]+|[\s–—|·:-]+$/gu, "");
4642
6139
  if (title === "") title = store;
4643
- const description = _nullishCoalesce(localizedOf(_optionalChain([input, 'access', _246 => _246.meta, 'optionalAccess', _247 => _247.seo, 'optionalAccess', _248 => _248.description])), () => ( localizedOf(site.defaultDescription)));
6140
+ const description = _nullishCoalesce(localizedOf(_optionalChain([input, 'access', _282 => _282.meta, 'optionalAccess', _283 => _283.seo, 'optionalAccess', _284 => _284.description])), () => ( localizedOf(site.defaultDescription)));
4644
6141
  const mediaOrigin = _nullishCoalesce(input.mediaOrigin, () => ( ""));
4645
- const image = _nullishCoalesce(imageOf(_optionalChain([input, 'access', _249 => _249.meta, 'optionalAccess', _250 => _250.seo, 'optionalAccess', _251 => _251.shareImage]), mediaOrigin), () => ( imageOf(site.shareImage, mediaOrigin)));
4646
- const noindex = input.noindex === true || name === "search" || (_nullishCoalesce(_optionalChain([input, 'access', _252 => _252.meta, 'optionalAccess', _253 => _253.noindex]), () => ( _builderschema.TEMPLATE_NOINDEX_DEFAULT[name]))) || site.noindex === true;
6142
+ const image = _nullishCoalesce(imageOf(_optionalChain([input, 'access', _285 => _285.meta, 'optionalAccess', _286 => _286.seo, 'optionalAccess', _287 => _287.shareImage]), mediaOrigin), () => ( imageOf(site.shareImage, mediaOrigin)));
6143
+ const noindex = input.noindex === true || name === "search" || (_nullishCoalesce(_optionalChain([input, 'access', _288 => _288.meta, 'optionalAccess', _289 => _289.noindex]), () => ( _builderschema.TEMPLATE_NOINDEX_DEFAULT[name]))) || site.noindex === true;
4647
6144
  const origin = _nullishCoalesce(originOf(text(site.canonicalBase)), () => ( originOf(input.storeUrl)));
4648
6145
  const kind = name === "product" ? "product" : name === "search" ? "search" : LISTING_TEMPLATES.includes(name) ? "listing" : "page";
4649
6146
  const canonical = noindex || origin === void 0 ? void 0 : canonicalFor(`${origin}${input.path}${_nullishCoalesce(input.search, () => ( ""))}`, kind);
@@ -4667,6 +6164,59 @@ function templateMetadataOf(name, input) {
4667
6164
  }
4668
6165
  };
4669
6166
  }
6167
+ function siteJsonLdOf(settings, context) {
6168
+ const site = isRec2(settings.seo) ? settings.seo : {};
6169
+ const data = isRec2(site.structuredData) ? site.structuredData : {};
6170
+ const brand = isRec2(settings.brand) ? settings.brand : {};
6171
+ const origin = _nullishCoalesce(originOf(text(site.canonicalBase)), () => ( originOf(context.storeUrl)));
6172
+ const name = text(brand.storeName);
6173
+ if (origin === void 0 || name === void 0) return [];
6174
+ const logoField = isRec2(brand.logo) ? brand.logo.light : void 0;
6175
+ const logo = _optionalChain([imageOf, 'call', _290 => _290(logoField, context.mediaOrigin), 'optionalAccess', _291 => _291.url]);
6176
+ const org = isRec2(data.organization) ? data.organization : {};
6177
+ const shop = isRec2(data.localBusiness) ? data.localBusiness : {};
6178
+ const orgOn = org.enabled === true;
6179
+ const out = [];
6180
+ if (orgOn) {
6181
+ out.push({
6182
+ ...organizationJsonLd({
6183
+ name,
6184
+ url: origin,
6185
+ logo,
6186
+ sameAs: Array.isArray(org.sameAs) ? org.sameAs.filter((entry) => typeof entry === "string") : []
6187
+ }),
6188
+ "@id": `${origin}/#organization`
6189
+ });
6190
+ }
6191
+ if (data.website === true) {
6192
+ const searchPath = context.searchPath === void 0 ? "/search" : context.searchPath;
6193
+ const { potentialAction, ...website } = webSiteJsonLd({ name, url: origin, searchPath: _nullishCoalesce(searchPath, () => ( void 0)) });
6194
+ out.push({
6195
+ ...website,
6196
+ "@id": `${origin}/#website`,
6197
+ ...orgOn ? { publisher: { "@id": `${origin}/#organization` } } : {},
6198
+ ...searchPath === null ? {} : { potentialAction }
6199
+ });
6200
+ }
6201
+ const address = text(shop.address);
6202
+ if (shop.enabled === true && address !== void 0) {
6203
+ const { address: _plain, ...business } = localBusinessJsonLd({
6204
+ name,
6205
+ url: origin,
6206
+ address,
6207
+ phone: text(shop.phone),
6208
+ openingHours: Array.isArray(shop.openingHours) ? shop.openingHours.filter((entry) => typeof entry === "string") : []
6209
+ });
6210
+ out.push({
6211
+ ...business,
6212
+ "@id": `${origin}/#localbusiness`,
6213
+ address: { "@type": "PostalAddress", streetAddress: address },
6214
+ ...orgOn ? { parentOrganization: { "@id": `${origin}/#organization` } } : {},
6215
+ ...logo === void 0 ? {} : { image: logo }
6216
+ });
6217
+ }
6218
+ return out;
6219
+ }
4670
6220
  function metadataOf(page, context) {
4671
6221
  const { settings, mediaOrigin, routeLocale } = context;
4672
6222
  const site = isRec2(settings.seo) ? settings.seo : {};
@@ -4743,4 +6293,6 @@ function metadataOf(page, context) {
4743
6293
 
4744
6294
 
4745
6295
 
4746
- exports.__publicField = __publicField; exports.warnOnce = warnOnce; exports.buildRouteTable = buildRouteTable; exports.organizationJsonLd = organizationJsonLd; exports.webSiteJsonLd = webSiteJsonLd; exports.breadcrumbJsonLd = breadcrumbJsonLd; exports.faqJsonLd = faqJsonLd; exports.localBusinessJsonLd = localBusinessJsonLd; exports.jsonLdString = jsonLdString; exports.createRendererRegistry = createRendererRegistry; exports.staticDataFor = staticDataFor; exports.partOf = partOf; exports.isRedirect = isRedirect; exports.getBundle = getBundle; exports.clientOf = clientOf; exports.isOwnPath = isOwnPath; exports.loadBuilderPageByPath = loadBuilderPageByPath; exports.loadOwnPagePaths = loadOwnPagePaths; exports.loadBuilderPage = loadBuilderPage; exports.templateRootOf = templateRootOf; exports.loadBuilderTemplate = loadBuilderTemplate; exports.pageSeoOf = pageSeoOf; exports.canonicalFor = canonicalFor; exports.pagePathOf = pagePathOf; exports.originOf = originOf; exports.siteLocales = siteLocales; exports.localized = localized2; exports.templateMetadataOf = templateMetadataOf; exports.metadataOf = metadataOf;
6296
+
6297
+
6298
+ exports.__publicField = __publicField; exports.organizationJsonLd = organizationJsonLd; exports.webSiteJsonLd = webSiteJsonLd; exports.breadcrumbJsonLd = breadcrumbJsonLd; exports.faqJsonLd = faqJsonLd; exports.videoJsonLd = videoJsonLd; exports.localBusinessJsonLd = localBusinessJsonLd; exports.jsonLdString = jsonLdString; exports.warnOnce = warnOnce; exports.buildRouteTable = buildRouteTable; exports.createRendererRegistry = createRendererRegistry; exports.staticDataFor = staticDataFor; exports.partOf = partOf; exports.isRedirect = isRedirect; exports.getBundle = getBundle; exports.clientOf = clientOf; exports.isOwnPath = isOwnPath; exports.loadBuilderPageByPath = loadBuilderPageByPath; exports.loadOwnPagePaths = loadOwnPagePaths; exports.loadBuilderPage = loadBuilderPage; exports.templateRootOf = templateRootOf; exports.loadBuilderTemplate = loadBuilderTemplate; exports.pageSeoOf = pageSeoOf; exports.canonicalFor = canonicalFor; exports.pagePathOf = pagePathOf; exports.originOf = originOf; exports.siteLocales = siteLocales; exports.localized = localized2; exports.templateMetadataOf = templateMetadataOf; exports.siteJsonLdOf = siteJsonLdOf; exports.metadataOf = metadataOf;