@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 = (input.openingHours ?? []).filter((line) => line !== "");
61
73
  return {
@@ -412,7 +424,7 @@ function clientOf(options) {
412
424
  import { createRegistry } from "@usethrottle/builder-schema";
413
425
 
414
426
  // src/basics/index.ts
415
- import { BASIC_WIDGET_DEFINITIONS as BASIC_WIDGET_DEFINITIONS3 } from "@usethrottle/builder-schema";
427
+ import { BASIC_WIDGET_DEFINITIONS as BASIC_WIDGET_DEFINITIONS5 } from "@usethrottle/builder-schema";
416
428
 
417
429
  // src/basics/announcement.tsx
418
430
  import { useEffect, useState } from "react";
@@ -585,13 +597,29 @@ function Announcement({ props, mediaOrigin, editMode }) {
585
597
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
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 = inlineEdit?.("label") ?? str(props.label) ?? "";
612
+ const label2 = inlineEdit?.("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__ */ jsxs2(Fragment2, { children: [
593
621
  /* @__PURE__ */ jsx5(BasicStyles, {}),
594
- /* @__PURE__ */ jsx5("div", { className: "tb-b-button-wrap", children: /* @__PURE__ */ jsx5("a", { className, ...href === null ? {} : { href }, children: label }) })
622
+ /* @__PURE__ */ jsx5("div", { className: "tb-b-button-wrap", children: /* @__PURE__ */ jsx5("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 = safeUrl3(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) => safeUrl3(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__ */ jsx13(
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__ */ jsx14(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 : safeUrl4(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__ */ jsx14(
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__ */ jsxs8("picture", { children: [
1120
+ /* @__PURE__ */ jsx14("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 && safeUrl4(asset.url, "src", { mediaOrigin }) !== null;
1066
1124
  return /* @__PURE__ */ jsxs8(Fragment8, { children: [
1067
1125
  /* @__PURE__ */ jsx14(BasicStyles, {}),
1068
- /* @__PURE__ */ jsx14(WidgetStyle, { css: enumCss(node, RULES2) }),
1126
+ /* @__PURE__ */ jsx14(WidgetStyle, { css: enumCss(node, RULES2) + reserve }),
1069
1127
  shown2 ? /* @__PURE__ */ jsx14("div", { className: "tb-b-image", children: /* @__PURE__ */ jsx14("div", { className: "tb-b-image-box", children: href === null ? image : /* @__PURE__ */ jsx14("a", { href, children: image }) }) }) : /* @__PURE__ */ jsx14(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 = design?.menus;
1129
1187
  const items = menus !== void 0 && Object.hasOwn(menus, name) ? menus[name] : void 0;
1130
1188
  const strings = design?.strings;
1131
- const label = (strings !== void 0 && Object.hasOwn(strings, "nav.menu") ? str(strings["nav.menu"]) : void 0) ?? SITE_STRING_DEFAULTS3["nav.menu"];
1189
+ const label2 = (strings !== void 0 && Object.hasOwn(strings, "nav.menu") ? str(strings["nav.menu"]) : void 0) ?? SITE_STRING_DEFAULTS3["nav.menu"];
1132
1190
  if (items === void 0 || items.length === 0) {
1133
1191
  return /* @__PURE__ */ jsxs10(Fragment10, { children: [
1134
1192
  /* @__PURE__ */ jsx16(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__ */ jsx16(Icon2, { name: open ? "close" : "menu", size: 24, label })
1222
+ children: /* @__PURE__ */ jsx16(Icon2, { name: open ? "close" : "menu", size: 24, label: label2 })
1165
1223
  }
1166
1224
  ),
1167
1225
  /* @__PURE__ */ jsx16(List, { items, mediaOrigin, id: listId, ...drawer ? { onNavigate: () => setOpen2(false) } : {} })
@@ -1395,11 +1453,14 @@ function Text({ props, mediaOrigin, editMode, inlineEdit }) {
1395
1453
 
1396
1454
  // src/basics/video.tsx
1397
1455
  import { useState as useState3 } from "react";
1456
+ import { safeUrl as safeUrl8 } from "@usethrottle/builder-schema";
1398
1457
  import { Icon as Icon3 } from "@usethrottle/ui";
1399
1458
  import { Fragment as Fragment14, jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
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] = useState3(false);
1440
1501
  const video = parseVideoUrl(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 : safeUrl8(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__ */ jsxs14(Fragment14, { children: [
1442
1517
  /* @__PURE__ */ jsx20(BasicStyles, {}),
1443
1518
  /* @__PURE__ */ jsx20(WidgetStyle, { css: enumCss(node, RULES3) }),
1444
- video === null ? /* @__PURE__ */ jsx20(Placeholder, { editMode, children: "Paste a YouTube or Vimeo link" }) : /* @__PURE__ */ jsx20("div", { className: "tb-b-video", "data-provider": video.provider, children: loaded && !editMode ? /* @__PURE__ */ jsx20(
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__ */ jsx20("button", { type: "button", className: "tb-b-play", "aria-label": "Play video", onClick: () => setLoaded(true), children: /* @__PURE__ */ jsx20("span", { children: /* @__PURE__ */ jsx20(Icon3, { name: "play", size: 28 }) }) }) })
1519
+ video === null ? /* @__PURE__ */ jsx20(Placeholder, { editMode, children: "Paste a YouTube or Vimeo link" }) : /* @__PURE__ */ jsxs14("div", { className: "tb-b-video", "data-provider": video.provider, children: [
1520
+ loaded && !editMode ? /* @__PURE__ */ jsx20(
1521
+ "iframe",
1522
+ {
1523
+ src: embedSrc(video, props.autoplayMuted === true),
1524
+ title: 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__ */ jsxs14(Fragment14, { children: [
1530
+ posterSrc !== null && /* @__PURE__ */ jsx20(
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__ */ jsx20(
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__ */ jsx20("span", { children: /* @__PURE__ */ jsx20(Icon3, { name: "play", size: 28 }) })
1550
+ }
1551
+ )
1552
+ ] }),
1553
+ jsonLd !== null && /* @__PURE__ */ jsx20("script", { type: "application/ld+json", children: jsonLd })
1554
+ ] })
1454
1555
  ] });
1455
1556
  }
1456
1557
 
@@ -1465,7 +1566,7 @@ var BuilderContext = typeof createContext === "function" ? createContext(null) :
1465
1566
  var useBuilder = () => useContext(BuilderContext);
1466
1567
 
1467
1568
  // src/theme.ts
1468
- import { SITE_FONTS, eligibleMessages, safeUrl as safeUrl8, sanitizeSiteCss } from "@usethrottle/builder-schema";
1569
+ import { SITE_FONTS, eligibleMessages, safeUrl as safeUrl9, sanitizeSiteCss } from "@usethrottle/builder-schema";
1469
1570
  import { PRESET_NAMES, PRESET_TOKENS } from "@usethrottle/ui/presets";
1470
1571
  var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
1471
1572
  var str2 = (v) => typeof v === "string" && v !== "" ? v : void 0;
@@ -1506,7 +1607,7 @@ var useViewer = () => useContext2(ViewerContext);
1506
1607
  // src/basics/v2/menu-v2.tsx
1507
1608
  import { useEffect as useEffect6, useId as useId2 } from "react";
1508
1609
  import { Icon as Icon4, useSiteDesign as useSiteDesign5 } from "@usethrottle/ui";
1509
- import { MB_BASIC_WIDGET_DEFINITIONS, SITE_STRING_DEFAULTS as SITE_STRING_DEFAULTS5, expandMenu, safeUrl as safeUrl12, sectionNodeSchema as sectionNodeSchema2 } from "@usethrottle/builder-schema";
1610
+ import { MB_BASIC_WIDGET_DEFINITIONS, SITE_STRING_DEFAULTS as SITE_STRING_DEFAULTS5, expandMenu, safeUrl as safeUrl13, sectionNodeSchema as sectionNodeSchema2 } from "@usethrottle/builder-schema";
1510
1611
 
1511
1612
  // src/interactions/focus-trap.ts
1512
1613
  var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
@@ -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
  focusablesOf(list2)[0]?.focus();
1603
1704
  } else {
1604
1705
  list2.removeAttribute("role");
@@ -1707,7 +1808,7 @@ import {
1707
1808
  resolveInteraction,
1708
1809
  codeWidgetSnapshotSchema,
1709
1810
  resolveResponsive as resolveResponsive4,
1710
- safeUrl as safeUrl11,
1811
+ safeUrl as safeUrl12,
1711
1812
  upgradeNodes,
1712
1813
  validateSettingValue as validateSettingValue2,
1713
1814
  walkNodes as walkNodes3
@@ -1765,7 +1866,7 @@ import {
1765
1866
  RESERVED_DATA_PREFIX,
1766
1867
  VOID_ELEMENTS,
1767
1868
  isReservedClass,
1768
- safeUrl as safeUrl9
1869
+ safeUrl as safeUrl10
1769
1870
  } from "@usethrottle/builder-schema";
1770
1871
  import { jsx as jsx22 } from "react/jsx-runtime";
1771
1872
  var MAX_OUTPUT_CHARS = 1e6;
@@ -1867,7 +1968,7 @@ function attrProp(tag, attr, env, scope) {
1867
1968
  const { name } = attr;
1868
1969
  if (!attrAllowed(tag, name)) return null;
1869
1970
  if (name === "href" || name === "src") {
1870
- const safe = safeUrl9(urlSource(attr, env, scope), name, { mediaOrigin: env.mediaOrigin });
1971
+ const safe = safeUrl10(urlSource(attr, env, scope), name, { mediaOrigin: env.mediaOrigin });
1871
1972
  return safe === null || !spend(env, safe.length) ? null : [name, safe];
1872
1973
  }
1873
1974
  const text2 = attrText(attr, env, scope);
@@ -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__ */ jsx23(Boundary, { label, resetKeys: [builder?.site, resetKey], onError: builder?.onError, children });
2087
+ return /* @__PURE__ */ jsx23(Boundary, { label: label2, resetKeys: [builder?.site, resetKey], onError: builder?.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__ */ jsxs16(
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__ */ jsx25(PartBoundary, { label, children: /* @__PURE__ */ jsxs16(Suspense2, { fallback: null, children: [
2323
+ /* @__PURE__ */ jsx25(PartBoundary, { label: label2, children: /* @__PURE__ */ jsxs16(Suspense2, { fallback: null, children: [
2223
2324
  template.css === "" ? null : /* @__PURE__ */ jsx25(CustomCss, { css: template.css }),
2224
2325
  renderTemplate(template.ast, env)
2225
2326
  ] }) }),
2226
2327
  src === null && (edit !== void 0 || props.code?.preview === true) ? /* @__PURE__ */ jsx25("div", { "data-b-code-badge": "", style: BADGE, children: "Runs on your store" }) : null,
2227
- src === null ? null : /* @__PURE__ */ jsx25(CodeInput, { props: props.props, data: props.data, label }),
2328
+ src === null ? null : /* @__PURE__ */ jsx25(CodeInput, { props: props.props, data: props.data, label: label2 }),
2228
2329
  src === null ? null : /* @__PURE__ */ jsx25("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 {
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__ */ jsx25("script", { type: "application/json", "data-b-code-input": "", children: json });
@@ -2251,7 +2352,7 @@ import {
2251
2352
  resolveColumnProps,
2252
2353
  resolveColumnWidths,
2253
2354
  resolveResponsive as resolveResponsive2,
2254
- safeUrl as safeUrl10,
2355
+ safeUrl as safeUrl11,
2255
2356
  validateSettingValue,
2256
2357
  wrapColumnRows
2257
2358
  } from "@usethrottle/builder-schema";
@@ -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 && safeUrl10(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 && safeUrl11(found.url, "src", { mediaOrigin }) !== null && URL_QUOTE_SAFE.test(found.url) ? found : void 0;
2471
+ };
2472
+ return (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 = resolveColumnWidths(section, device);
2380
2487
  const rows = wrapColumnRows(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__ */ jsxs19(Fragment17, { children: [
2636
2743
  /* @__PURE__ */ jsx28("style", { href: `tb-fr-${sectionId}`, precedence: "throttle", children: collapseCss(sectionId, px2) }),
2637
2744
  /* @__PURE__ */ jsxs19("div", { className: "tb-fr", "data-tb-collapse": "", children: [
2638
- /* @__PURE__ */ jsx28("button", { type: "button", className: "tb-fr-open", "data-tb-drawer-open": "", "aria-expanded": "false", "aria-controls": id, children: label }),
2745
+ /* @__PURE__ */ jsx28("button", { type: "button", className: "tb-fr-open", "data-tb-drawer-open": "", "aria-expanded": "false", "aria-controls": id, children: label2 }),
2639
2746
  /* @__PURE__ */ jsxs19("div", { id, className: "tb-fr-body", children: [
2640
2747
  /* @__PURE__ */ jsx28("button", { type: "button", className: "tb-fr-close", "data-tb-drawer-close": "", "aria-label": "Close", children: /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", children: "\xD7" }) }),
2641
2748
  children
@@ -2834,8 +2941,8 @@ function pickLocale(value, locale) {
2834
2941
  return "";
2835
2942
  }
2836
2943
  function onOrigin(asset, mediaOrigin) {
2837
- if (safeUrl11(asset.url, "src", { mediaOrigin }) === null) return null;
2838
- return { ...asset, variants: asset.variants.filter((v) => safeUrl11(v.url, "src", { mediaOrigin }) !== null) };
2944
+ if (safeUrl12(asset.url, "src", { mediaOrigin }) === null) return null;
2945
+ return { ...asset, variants: asset.variants.filter((v) => safeUrl12(v.url, "src", { mediaOrigin }) !== null) };
2839
2946
  }
2840
2947
  function prepareItem(field, item, ctx) {
2841
2948
  if (!isRecord5(item)) return item;
@@ -2858,7 +2965,7 @@ function prepare(field, value, ctx) {
2858
2965
  if (field.control === "link" && isRecord5(value) && typeof value.kind === "string") {
2859
2966
  const target2 = value;
2860
2967
  const raw = ctx.resolveLink?.(target2) ?? (target2.kind === "url" ? target2.href : null);
2861
- return { ...value, href: safeUrl11(raw, "href", { mediaOrigin: ctx.mediaOrigin }) };
2968
+ return { ...value, href: safeUrl12(raw, "href", { mediaOrigin: ctx.mediaOrigin }) };
2862
2969
  }
2863
2970
  return value;
2864
2971
  }
@@ -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) => resolveResponsive4(section.props, section.responsive, device);
3237
+ const desktopBg = on("desktop").background;
3238
+ const phoneBg = on("phone").background;
3239
+ if (desktopBg?.priority !== true && phoneBg?.priority !== true) return [];
3240
+ const main = backgroundAsset(desktopBg, "desktop", ctx.assets, ctx.mediaOrigin) ?? null;
3241
+ const mobile = backgroundAsset(phoneBg, "phone", ctx.assets, ctx.mediaOrigin) ?? null;
3242
+ const link = (key, asset, media) => /* @__PURE__ */ jsx32(
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;
@@ -3192,16 +3326,16 @@ function makeLink(builder, own, mediaOrigin) {
3192
3326
  const targets = builder?.linkTargets;
3193
3327
  const fallback = own ?? builder?.resolveLink;
3194
3328
  return (target2) => {
3195
- if (target2.kind === "url") return safeUrl12(target2.href, "href", { mediaOrigin });
3329
+ if (target2.kind === "url") return safeUrl13(target2.href, "href", { mediaOrigin });
3196
3330
  if (targets !== void 0 && typeof target2.id === "string") {
3197
3331
  const key = `${String(target2.kind)}:${target2.id}`;
3198
3332
  if (Object.hasOwn(targets, key)) {
3199
3333
  const known = targets[key];
3200
- return typeof known === "string" ? safeUrl12(known, "href", { mediaOrigin }) : null;
3334
+ return typeof known === "string" ? safeUrl13(known, "href", { mediaOrigin }) : null;
3201
3335
  }
3202
3336
  }
3203
3337
  const raw = fallback?.(target2) ?? null;
3204
- return raw === null ? null : safeUrl12(raw, "href", { mediaOrigin });
3338
+ return raw === null ? null : safeUrl13(raw, "href", { mediaOrigin });
3205
3339
  };
3206
3340
  }
3207
3341
  function megaOf(value, locale) {
@@ -3221,12 +3355,12 @@ 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,
3229
- href: target2.kind === "category" && typeof entry.url === "string" ? safeUrl12(entry.url, "href", { mediaOrigin: b.r.mediaOrigin }) : b.r.link(target2),
3362
+ label: label2,
3363
+ href: target2.kind === "category" && typeof entry.url === "string" ? safeUrl13(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)) : [],
3232
3366
  description: localized(entry.description, b.r.locale),
@@ -3243,7 +3377,7 @@ function fromDesign(items, level, r) {
3243
3377
  return items.map((item, index) => ({
3244
3378
  key: String(index),
3245
3379
  label: item.label,
3246
- href: safeUrl12(item.href, "href", { mediaOrigin: r.mediaOrigin }),
3380
+ href: safeUrl13(item.href, "href", { mediaOrigin: r.mediaOrigin }),
3247
3381
  newTab: false,
3248
3382
  classes: [],
3249
3383
  description: void 0,
@@ -3259,7 +3393,7 @@ var Extras = ({ item, describe }) => /* @__PURE__ */ jsxs24(Fragment20, { childr
3259
3393
  item.badge === void 0 ? null : /* @__PURE__ */ jsx33("span", { className: "tb-mm-badge", children: item.badge }),
3260
3394
  describe && item.description !== void 0 ? /* @__PURE__ */ jsx33("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
3398
  const site = builder?.site;
3265
3399
  if (builder === null || site === void 0 || site.status !== "ok") return null;
@@ -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__ */ jsx33(AssetImage, { asset, mediaOrigin: props.mediaOrigin, alt: href === null ? featured.caption : featured.caption || label });
3430
+ const image = /* @__PURE__ */ jsx33(AssetImage, { asset, mediaOrigin: props.mediaOrigin, alt: href === null ? featured.caption : featured.caption || label2 });
3297
3431
  return /* @__PURE__ */ jsxs24("figure", { className: "tb-mm-feat", children: [
3298
3432
  href === null ? image : /* @__PURE__ */ jsx33("a", { href, children: image }),
3299
3433
  featured.caption === "" ? null : /* @__PURE__ */ jsx33("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__ */ jsx33("span", { ...part("category-nav-link", "tb-mm-text"), children: item.label }) : /* @__PURE__ */ jsx33("a", { ...part("category-nav-link"), href: item.href, ...item.newTab ? { target: "_blank", rel: "noopener noreferrer" } : {}, children: item.label });
3355
- return /* @__PURE__ */ jsx33("nav", { ...part("category-nav", className), "aria-label": label, ...categories ? {} : { "data-menu": menu }, children: /* @__PURE__ */ jsx33("ul", { ...part("category-nav-list"), children: items.map((item) => {
3489
+ return /* @__PURE__ */ jsx33("nav", { ...part("category-nav", className), "aria-label": label2, ...categories ? {} : { "data-menu": menu }, children: /* @__PURE__ */ jsx33("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__ */ jsxs24("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__ */ jsx33(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__ */ jsx33(StorefrontNav, { items, label: label2, listId, ctx, menu, ...className === void 0 ? {} : { className } });
3378
3512
  const full = { ...ctx, listId };
3379
- return /* @__PURE__ */ jsxs24("nav", { className: `tb-mm tb-mm--${ctx.mode}${className === void 0 ? "" : ` ${className}`}`, "aria-label": label, children: [
3380
- ctx.mode === "drawer" && /* @__PURE__ */ jsx33("button", { type: "button", className: "tb-mm-drawer", "data-tb-drawer": "", "aria-expanded": "false", "aria-controls": listId, children: /* @__PURE__ */ jsx33(Icon4, { name: "menu", size: 24, label }) }),
3513
+ return /* @__PURE__ */ jsxs24("nav", { className: `tb-mm tb-mm--${ctx.mode}${className === void 0 ? "" : ` ${className}`}`, "aria-label": label2, children: [
3514
+ ctx.mode === "drawer" && /* @__PURE__ */ jsx33("button", { type: "button", className: "tb-mm-drawer", "data-tb-drawer": "", "aria-expanded": "false", "aria-controls": listId, children: /* @__PURE__ */ jsx33(Icon4, { name: "menu", size: 24, label: label2 }) }),
3381
3515
  /* @__PURE__ */ jsx33(List2, { items, top: { id: listId }, ctx: full })
3382
3516
  ] });
3383
3517
  }
@@ -3408,7 +3542,7 @@ function MenuV2(props) {
3408
3542
  }
3409
3543
  return fallback;
3410
3544
  };
3411
- const label = word("nav.menu", SITE_STRING_DEFAULTS5["nav.menu"]);
3545
+ const label2 = word("nav.menu", SITE_STRING_DEFAULTS5["nav.menu"]);
3412
3546
  if (items.length === 0 && mobile.length === 0) {
3413
3547
  return /* @__PURE__ */ jsxs24(Fragment20, { children: [
3414
3548
  /* @__PURE__ */ jsx33(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__ */ jsxs24(Fragment20, { children: [
3421
3555
  /* @__PURE__ */ jsx33(BasicStyles, {}),
3422
3556
  /* @__PURE__ */ jsx33("style", { href: "tb-menu-v2", precedence: "throttle", children: MENU_V2_CSS }),
@@ -3718,7 +3852,7 @@ var announcementV2Widgets = [{ ...definition2, Component: AnnouncementV2 }];
3718
3852
 
3719
3853
  // src/basics/v2/breadcrumbs.tsx
3720
3854
  import { useSiteDesign as useSiteDesign7 } from "@usethrottle/ui";
3721
- import { safeUrl as safeUrl13 } from "@usethrottle/builder-schema";
3855
+ import { safeUrl as safeUrl14 } from "@usethrottle/builder-schema";
3722
3856
 
3723
3857
  // src/basics/v2/definitions.ts
3724
3858
  import { MB_BASIC_WIDGET_DEFINITIONS as MB_BASIC_WIDGET_DEFINITIONS2 } from "@usethrottle/builder-schema";
@@ -3746,7 +3880,7 @@ function Breadcrumbs({ props, data, mediaOrigin, resolveLink, editMode }) {
3746
3880
  /* @__PURE__ */ jsx35(Placeholder, { editMode, children: "The trail appears on a product page" })
3747
3881
  ] });
3748
3882
  }
3749
- const href = (target2) => safeUrl13(resolveLink?.(target2), "href", { mediaOrigin });
3883
+ const href = (target2) => safeUrl14(resolveLink?.(target2), "href", { mediaOrigin });
3750
3884
  const trail = [{ name: str(design?.brand?.storeName?.trim()) ?? "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;
@@ -3780,7 +3914,7 @@ import { sanitizeRichContent } from "@usethrottle/builder-schema";
3780
3914
 
3781
3915
  // src/basics/v2/markup.tsx
3782
3916
  import { createElement as createElement4, useEffect as useEffect8, useState as useState6 } from "react";
3783
- import { RICH_CONTENT_ALLOWED_TAGS, SVG_ALLOWED_TAGS, SVG_MAX_BYTES, safeUrl as safeUrl14, sanitizeSvg } from "@usethrottle/builder-schema";
3917
+ import { RICH_CONTENT_ALLOWED_TAGS, SVG_ALLOWED_TAGS, SVG_MAX_BYTES, safeUrl as safeUrl15, sanitizeSvg } from "@usethrottle/builder-schema";
3784
3918
  import { jsx as jsx36 } from "react/jsx-runtime";
3785
3919
  var RICH = new Set(RICH_CONTENT_ALLOWED_TAGS);
3786
3920
  var SVG = new Set(SVG_ALLOWED_TAGS);
@@ -3921,7 +4055,7 @@ function checkUrls(tag, props, mediaOrigin) {
3921
4055
  for (const key of ["href", "xlinkHref", "src"]) {
3922
4056
  if (!Object.hasOwn(props, key)) continue;
3923
4057
  const value = props[key];
3924
- const safe = SVG.has(tag) ? typeof value === "string" && FRAGMENT.test(value) ? value : null : safeUrl14(value, key === "src" ? "src" : "href", { mediaOrigin });
4058
+ const safe = SVG.has(tag) ? typeof value === "string" && FRAGMENT.test(value) ? value : null : safeUrl15(value, key === "src" ? "src" : "href", { mediaOrigin });
3925
4059
  if (safe !== null) {
3926
4060
  props[key] = safe;
3927
4061
  continue;
@@ -3949,7 +4083,7 @@ function svgElement(svg) {
3949
4083
  return renderMarkup([withFill])[0] ?? null;
3950
4084
  }
3951
4085
  async function readSvg(response, mediaOrigin) {
3952
- if (!response.ok || safeUrl14(response.url, "src", { mediaOrigin }) === null) return null;
4086
+ if (!response.ok || safeUrl15(response.url, "src", { mediaOrigin }) === null) return null;
3953
4087
  if (!/^image\/svg\+xml(?:\s*;|$)/iu.test(response.headers.get("content-type") ?? "")) return null;
3954
4088
  const reader = response.body?.getReader();
3955
4089
  if (reader === void 0) {
@@ -3970,8 +4104,8 @@ async function readSvg(response, mediaOrigin) {
3970
4104
  text2 += decoder.decode(value, { stream: true });
3971
4105
  }
3972
4106
  }
3973
- function SvgFromAsset({ asset, mediaOrigin, label }) {
3974
- const src = isFrozenAsset(asset) ? safeUrl14(asset.url, "src", { mediaOrigin }) : null;
4107
+ function SvgFromAsset({ asset, mediaOrigin, label: label2 }) {
4108
+ const src = isFrozenAsset(asset) ? safeUrl15(asset.url, "src", { mediaOrigin }) : null;
3975
4109
  const [source, setSource] = useState6(null);
3976
4110
  useEffect8(() => {
3977
4111
  if (src === null) return;
@@ -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__ */ jsx36(AssetImage, { asset, mediaOrigin, alt: label ?? "", loading: "eager" });
4121
+ return /* @__PURE__ */ jsx36(AssetImage, { asset, mediaOrigin, alt: label2 ?? "", loading: "eager" });
3988
4122
  }
3989
4123
 
3990
4124
  // src/basics/v2/faq.tsx
@@ -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
  import { Fragment as Fragment28, jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
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__ */ jsxs31(Fragment28, { children: [
4179
4313
  /* @__PURE__ */ jsx41(BasicV2Styles, {}),
4180
- /* @__PURE__ */ jsx41("div", { className: "tb-b-svg", ...access, children: inline2 ?? /* @__PURE__ */ jsx41(SvgFromAsset, { asset, mediaOrigin, ...label === void 0 || decorative ? {} : { label } }) })
4314
+ /* @__PURE__ */ jsx41("div", { className: "tb-b-svg", ...access, children: inline2 ?? /* @__PURE__ */ jsx41(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
+ import { createElement as createElement5 } from "react";
4321
+ import { ICON_NAMES as ICON_NAMES2, Icon as Icon7 } from "@usethrottle/ui";
4322
+ import { sanitizeRichContent as sanitizeRichContent3 } from "@usethrottle/builder-schema";
4323
+
4324
+ // src/basics/r23/shared.tsx
4325
+ import { BASIC_WIDGET_DEFINITIONS as BASIC_WIDGET_DEFINITIONS3, safeUrl as safeUrl16 } from "@usethrottle/builder-schema";
4326
+ import { Fragment as Fragment29, jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
4327
+ function r23Definition(type) {
4328
+ const found = BASIC_WIDGET_DEFINITIONS3.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) && safeUrl16(value.url, "src", { mediaOrigin }) !== null ? value : null;
4337
+ }
4338
+ var srcSetOf = (asset, mediaOrigin) => asset.variants.flatMap((variant) => {
4339
+ const url = safeUrl16(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 = safeUrl16(asset.url, "src", { mediaOrigin });
4352
+ if (src === null) return null;
4353
+ const srcSet = srcSetOf(asset, mediaOrigin);
4354
+ const img = /* @__PURE__ */ jsx42(
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 = safeUrl16(mobile.url, "src", { mediaOrigin });
4370
+ if (mobileSrc === null) return img;
4371
+ const mobileSet = srcSetOf(mobile, mediaOrigin);
4372
+ return /* @__PURE__ */ jsxs32("picture", { children: [
4373
+ /* @__PURE__ */ jsx42(
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__ */ jsxs32(Fragment29, { children: [
4490
+ /* @__PURE__ */ jsx42(BasicStyles, {}),
4491
+ /* @__PURE__ */ jsx42("style", { href: "tb-basics-r23", precedence: "throttle", children: R23_CSS })
4492
+ ] });
4493
+ }
4494
+
4495
+ // src/basics/r23/feature-grid.tsx
4496
+ import { Fragment as Fragment30, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
4497
+ var LEVELS2 = ["h2", "h3", "h4"];
4498
+ var CARDS = ["plain", "card", "bordered"];
4499
+ var isIconName2 = (name) => typeof name === "string" && ICON_NAMES2.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__ */ jsxs33(Fragment30, { children: [
4504
+ /* @__PURE__ */ jsx43(R23Styles, {}),
4505
+ /* @__PURE__ */ jsx43(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__ */ jsxs33(Fragment30, { children: [
4512
+ /* @__PURE__ */ jsx43(R23Styles, {}),
4513
+ /* @__PURE__ */ jsx43("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(sanitizeRichContent3(html, mediaOrigin).html, "rich"), { mediaOrigin });
4521
+ return /* @__PURE__ */ jsxs33("li", { className: "tb-b-fg-item", children: [
4522
+ (image !== null || svg !== null || icon !== null) && /* @__PURE__ */ jsx43("span", { className: "tb-b-fg-media", "aria-hidden": "true", children: image !== null ? /* @__PURE__ */ jsx43(AssetImage, { asset: image, mediaOrigin, alt: "", sizes: "96px" }) : svg !== null ? /* @__PURE__ */ jsx43(SvgFromAsset, { asset: svg, mediaOrigin }) : /* @__PURE__ */ jsx43(Icon7, { name: icon }) }),
4523
+ /* @__PURE__ */ jsxs33("div", { className: "tb-b-fg-body", children: [
4524
+ title !== void 0 && createElement5(level, { className: "tb-b-fg-title" }, href === null ? title : /* @__PURE__ */ jsx43("a", { href, children: title })),
4525
+ body !== null && /* @__PURE__ */ jsx43("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
+ import { createElement as createElement6 } from "react";
4535
+ import { sanitizeRichContent as sanitizeRichContent4 } from "@usethrottle/builder-schema";
4536
+ import { Fragment as Fragment31, jsx as jsx44, jsxs as jsxs34 } from "react/jsx-runtime";
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 = inlineEdit?.("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(sanitizeRichContent4(html, mediaOrigin).html, "rich"), { mediaOrigin });
4560
+ if (image === null && title === void 0 && kicker === void 0 && html === void 0 && label2 === void 0) {
4561
+ return /* @__PURE__ */ jsxs34(Fragment31, { children: [
4562
+ /* @__PURE__ */ jsx44(R23Styles, {}),
4563
+ /* @__PURE__ */ jsx44(Placeholder, { editMode, children: "Choose an image and write some text" })
4564
+ ] });
4565
+ }
4566
+ const alt = props.decorative === true ? "" : str(props.alt) ?? "";
4567
+ const level = oneOf(props.titleLevel, LEVELS3, "h2");
4568
+ const style = oneOf(props.buttonStyle, BUTTON_STYLES, "primary");
4569
+ return /* @__PURE__ */ jsxs34(Fragment31, { children: [
4570
+ /* @__PURE__ */ jsx44(R23Styles, {}),
4571
+ /* @__PURE__ */ jsx44(WidgetStyle, { css: enumCss(node, RULES4) }),
4572
+ /* @__PURE__ */ jsxs34("div", { className: "tb-b-iwt", children: [
4573
+ /* @__PURE__ */ jsxs34("div", { className: "tb-b-iwt-media", children: [
4574
+ image !== null && /* @__PURE__ */ jsx44(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__ */ jsx44("p", { className: "tb-b-empty", children: "Add alt text or mark the image decorative" })
4576
+ ] }),
4577
+ /* @__PURE__ */ jsxs34("div", { className: "tb-b-iwt-content", children: [
4578
+ kicker !== void 0 && /* @__PURE__ */ jsx44("p", { className: "tb-b-iwt-kicker", children: kicker }),
4579
+ title !== void 0 && createElement6(level, { className: "tb-b-iwt-title" }, title),
4580
+ body !== null && /* @__PURE__ */ jsx44("div", { className: "tb-b-iwt-text", children: body }),
4581
+ label2 !== void 0 && href !== null && /* @__PURE__ */ jsx44("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
+ import { useEffect as useEffect9, useId as useId4, useState as useState8 } from "react";
4590
+ import { Fragment as Fragment32, jsx as jsx45, jsxs as jsxs35 } from "react/jsx-runtime";
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 = useId4();
4595
+ const [reduced2, setReduced] = useState8(null);
4596
+ const [paused, setPaused] = useState8(false);
4597
+ const layout = oneOf(props.layout, LAYOUTS2, "row");
4598
+ const live = reduced2 === false;
4599
+ useEffect9(() => {
4600
+ setReduced(window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true);
4601
+ }, []);
4602
+ const pauseLabel = str(props.pauseLabel) ?? "Pause logo scrolling";
4603
+ const playLabel = 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 ? "" : 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__ */ jsxs35(Fragment32, { children: [
4619
+ /* @__PURE__ */ jsx45(R23Styles, {}),
4620
+ /* @__PURE__ */ jsx45(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__ */ jsx45(AssetImage, { asset: logo.image, mediaOrigin, alt: copy ? "" : logo.alt, sizes: "160px" });
4627
+ const external = logo.href !== null && logo.href.startsWith("https://");
4628
+ return /* @__PURE__ */ jsx45("li", { children: logo.href === null ? img : /* @__PURE__ */ jsx45(
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__ */ jsxs35("ul", { className: "tb-b-logos-list", ...title === void 0 ? {} : { "aria-labelledby": titleId }, children: [
4639
+ renderLogos(false),
4640
+ editMode && warnings.map((index) => /* @__PURE__ */ jsx45("li", { className: "tb-b-logos-warn", children: "Add alt text or mark it decorative" }, `w${String(index)}`))
4641
+ ] });
4642
+ return /* @__PURE__ */ jsxs35(Fragment32, { children: [
4643
+ /* @__PURE__ */ jsx45(R23Styles, {}),
4644
+ /* @__PURE__ */ jsx45(WidgetStyle, { css: enumCss(node, RULES5) }),
4645
+ /* @__PURE__ */ jsxs35("div", { className: `tb-b-logos tb-b-logos--${layout}${marquee ? " is-live" : ""}${marquee && paused ? " is-paused" : ""}`, children: [
4646
+ title !== void 0 && /* @__PURE__ */ jsx45("p", { className: "tb-b-logos-title", id: titleId, children: title }),
4647
+ layout === "marquee" ? /* @__PURE__ */ jsxs35("div", { className: "tb-b-logos-track", children: [
4648
+ list2,
4649
+ marquee && /* @__PURE__ */ jsx45("ul", { className: "tb-b-logos-list", "aria-hidden": "true", children: renderLogos(true) })
4650
+ ] }) : list2,
4651
+ layout === "marquee" && logos.length > 0 && reduced2 !== true && /* @__PURE__ */ jsx45("button", { type: "button", className: "tb-b-logos-pause", disabled: !live, "aria-label": paused ? playLabel : pauseLabel, onClick: () => setPaused(!paused), children: /* @__PURE__ */ jsx45("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
+ import { useSiteDesign as useSiteDesign8 } from "@usethrottle/ui";
4659
+ import { safeUrl as safeUrl17 } from "@usethrottle/builder-schema";
4660
+
4661
+ // src/basics/r23/icons.tsx
4662
+ import { jsx as jsx46, jsxs as jsxs36 } from "react/jsx-runtime";
4663
+ var Svg2 = ({ children }) => /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4679
+ /* @__PURE__ */ jsx46("rect", { x: "3", y: "3", width: "18", height: "18", rx: "5" }),
4680
+ /* @__PURE__ */ jsx46("circle", { cx: "12", cy: "12", r: "4" }),
4681
+ /* @__PURE__ */ jsx46("circle", { cx: "17.5", cy: "6.5", r: ".6", fill: "currentColor" })
4682
+ ] }),
4683
+ facebook: () => /* @__PURE__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("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__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("path", { d: "M4 4l16 16M20 4L4 20" }) }),
4685
+ tiktok: () => /* @__PURE__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4687
+ /* @__PURE__ */ jsx46("rect", { x: "2", y: "5", width: "20", height: "14", rx: "4" }),
4688
+ /* @__PURE__ */ jsx46("path", { d: "M10 9l6 3-6 3z", fill: "currentColor" })
4689
+ ] }),
4690
+ pinterest: () => /* @__PURE__ */ jsxs36(Svg2, { children: [
4691
+ /* @__PURE__ */ jsx46("circle", { cx: "12", cy: "12", r: "9" }),
4692
+ /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4695
+ /* @__PURE__ */ jsx46("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3" }),
4696
+ /* @__PURE__ */ jsx46("path", { d: "M8 10v6M8 7.5v.01M12 16v-6M12 12.5a2.5 2.5 0 0 1 5 0V16" })
4697
+ ] }),
4698
+ threads: () => /* @__PURE__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4700
+ /* @__PURE__ */ jsx46("path", { d: "M3 21l1.6-4.7A9 9 0 1 1 8 19.5z" }),
4701
+ /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4704
+ /* @__PURE__ */ jsx46("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2" }),
4705
+ /* @__PURE__ */ jsx46("path", { d: "M3 7l9 6 9-6" })
4706
+ ] }),
4707
+ custom: () => /* @__PURE__ */ jsxs36(Svg2, { children: [
4708
+ /* @__PURE__ */ jsx46("circle", { cx: "12", cy: "12", r: "9" }),
4709
+ /* @__PURE__ */ jsx46("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__ */ jsxs36(Svg2, { children: [
4715
+ /* @__PURE__ */ jsx46("rect", { x: "5", y: "11", width: "14", height: "9", rx: "2" }),
4716
+ /* @__PURE__ */ jsx46("path", { d: "M8 11V8a4 4 0 0 1 8 0v3" })
4717
+ ] }),
4718
+ "free-shipping": () => /* @__PURE__ */ jsxs36(Svg2, { children: [
4719
+ /* @__PURE__ */ jsx46("path", { d: "M2 6h12v10H2zM14 9h4l3 3v4h-7" }),
4720
+ /* @__PURE__ */ jsx46("circle", { cx: "6", cy: "18", r: "2" }),
4721
+ /* @__PURE__ */ jsx46("circle", { cx: "17", cy: "18", r: "2" })
4722
+ ] }),
4723
+ returns: () => /* @__PURE__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("path", { d: "M4 12a8 8 0 1 0 3-6.2M4 4v4h4" }) }),
4724
+ warranty: () => /* @__PURE__ */ jsxs36(Svg2, { children: [
4725
+ /* @__PURE__ */ jsx46("path", { d: "M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z" }),
4726
+ /* @__PURE__ */ jsx46("path", { d: "M8.5 12l2.5 2.5 4.5-5" })
4727
+ ] }),
4728
+ support: () => /* @__PURE__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("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__ */ jsx46(Svg2, { children: /* @__PURE__ */ jsx46("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__ */ jsxs36("svg", { viewBox: "0 0 40 26", role: "img", children: [
4733
+ /* @__PURE__ */ jsx46("title", { children: title }),
4734
+ /* @__PURE__ */ jsx46("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__ */ jsx46("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__ */ jsx46(Card, { title: "Visa", children: label("VISA", "#1a1f71", 10, { fontStyle: "italic" }) }),
4740
+ mastercard: () => /* @__PURE__ */ jsxs36(Card, { title: "Mastercard", children: [
4741
+ /* @__PURE__ */ jsx46("circle", { cx: "15", cy: "13", r: "7", fill: "#eb001b" }),
4742
+ /* @__PURE__ */ jsx46("circle", { cx: "25", cy: "13", r: "7", fill: "#f79e1b", fillOpacity: ".85" })
4743
+ ] }),
4744
+ amex: () => /* @__PURE__ */ jsx46(Card, { title: "American Express", fill: "#2e77bb", children: label("AMEX", "#fff", 9) }),
4745
+ discover: () => /* @__PURE__ */ jsxs36(Card, { title: "Discover", children: [
4746
+ label("DISCOVER", "#222", 5.5),
4747
+ /* @__PURE__ */ jsx46("circle", { cx: "30", cy: "20", r: "3", fill: "#f58220" })
4748
+ ] }),
4749
+ paypal: () => /* @__PURE__ */ jsx46(Card, { title: "PayPal", children: /* @__PURE__ */ jsxs36("text", { x: "20", y: "16", textAnchor: "middle", fontFamily: "Arial, Helvetica, sans-serif", fontSize: "8", fontWeight: "700", fill: "#003087", children: [
4750
+ "Pay",
4751
+ /* @__PURE__ */ jsx46("tspan", { fill: "#009cde", children: "Pal" })
4752
+ ] }) }),
4753
+ "apple-pay": () => /* @__PURE__ */ jsx46(Card, { title: "Apple Pay", children: label("Apple Pay", "#000", 6.5) }),
4754
+ "google-pay": () => /* @__PURE__ */ jsx46(Card, { title: "Google Pay", children: /* @__PURE__ */ jsxs36("text", { x: "20", y: "16", textAnchor: "middle", fontFamily: "Arial, Helvetica, sans-serif", fontSize: "7.5", fontWeight: "700", fill: "#5f6368", children: [
4755
+ /* @__PURE__ */ jsx46("tspan", { fill: "#4285f4", children: "G" }),
4756
+ " Pay"
4757
+ ] }) }),
4758
+ klarna: () => /* @__PURE__ */ jsx46(Card, { title: "Klarna", fill: "#ffb3c7", children: label("Klarna", "#17120f", 8) }),
4759
+ maestro: () => /* @__PURE__ */ jsxs36(Card, { title: "Maestro", children: [
4760
+ /* @__PURE__ */ jsx46("circle", { cx: "15", cy: "13", r: "7", fill: "#eb001b" }),
4761
+ /* @__PURE__ */ jsx46("circle", { cx: "25", cy: "13", r: "7", fill: "#0099df", fillOpacity: ".85" })
4762
+ ] }),
4763
+ diners: () => /* @__PURE__ */ jsxs36(Card, { title: "Diners Club", children: [
4764
+ /* @__PURE__ */ jsx46("circle", { cx: "20", cy: "13", r: "8", fill: "none", stroke: "#0079be", strokeWidth: "2" }),
4765
+ /* @__PURE__ */ jsx46("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
+ import { Fragment as Fragment33, jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
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 = safeUrl17(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 = useSiteDesign8();
4792
+ const store = str(design?.brand?.storeName?.trim());
4793
+ const template = 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__ */ jsxs37(Fragment33, { children: [
4804
+ /* @__PURE__ */ jsx47(R23Styles, {}),
4805
+ /* @__PURE__ */ jsx47(Placeholder, { editMode, children: "Add your social profiles in the settings" })
4806
+ ] });
4807
+ }
4808
+ return /* @__PURE__ */ jsxs37(Fragment33, { children: [
4809
+ /* @__PURE__ */ jsx47(R23Styles, {}),
4810
+ /* @__PURE__ */ jsx47("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 = label2 ?? (store === void 0 || platform === "custom" ? platformName : fill(template, { store, platform: platformName }));
4813
+ const visible = style === "icon" ? void 0 : label2 ?? platformName;
4814
+ const web = href.startsWith("http") || href.startsWith("/");
4815
+ return /* @__PURE__ */ jsx47("li", { children: /* @__PURE__ */ jsxs37(
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__ */ jsx47(SocialIcon, { platform }),
4824
+ visible !== void 0 && /* @__PURE__ */ jsx47("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
+ import { useEffect as useEffect10, useRef as useRef5, useState as useState9 } from "react";
4835
+ import { Fragment as Fragment34, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
4836
+ var LAYOUTS3 = ["grid", "carousel", "masonry"];
4837
+ var CARDS2 = ["plain", "card", "bordered"];
4838
+ var reducedMotion = () => window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
4839
+ function Rating({ value, template }) {
4840
+ const rounded = Math.round(Math.min(5, Math.max(0, value)) * 2) / 2;
4841
+ return /* @__PURE__ */ jsxs38("p", { className: "tb-b-tm-rating", children: [
4842
+ /* @__PURE__ */ jsx48("span", { className: "tb-b-sr", children: fill(template, { rating: String(rounded) }) }),
4843
+ /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", children: [1, 2, 3, 4, 5].map((n) => /* @__PURE__ */ jsx48("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 = useRef5(null);
4848
+ const [live, setLive] = useState9(false);
4849
+ const [motion, setMotion] = useState9(false);
4850
+ const [hover, setHover] = useState9(false);
4851
+ const [focus, setFocus] = useState9(false);
4852
+ const [paused, setPaused] = useState9(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
+ useEffect10(() => {
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
+ el.scrollTo?.({ left: 0, behavior: "auto" });
4869
+ return;
4870
+ }
4871
+ const rtl = getComputedStyle(el).direction === "rtl";
4872
+ el.scrollBy?.({ left: dir * width * (rtl ? -1 : 1), behavior: reducedMotion() ? "auto" : "smooth" });
4873
+ };
4874
+ useEffect10(() => {
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__ */ jsxs38(Fragment34, { children: [
4881
+ /* @__PURE__ */ jsx48(R23Styles, {}),
4882
+ /* @__PURE__ */ jsx48(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 = str(props.carouselLabel) ?? "Customer reviews";
4888
+ const prevLabel = str(props.prevLabel) ?? "Previous review";
4889
+ const nextLabel = str(props.nextLabel) ?? "Next review";
4890
+ const pauseLabel = str(props.pauseLabel) ?? "Pause autoplay";
4891
+ const playLabel = str(props.playLabel) ?? "Start autoplay";
4892
+ const ratingLabel = str(props.ratingLabel) ?? "{rating} out of 5";
4893
+ const slideLabel = 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__ */ jsxs38("figure", { className: "tb-b-tm-card", children: [
4901
+ rating !== null && /* @__PURE__ */ jsx48(Rating, { value: rating, template: ratingLabel }),
4902
+ /* @__PURE__ */ jsx48("blockquote", { children: str(row.quote) }),
4903
+ (name !== void 0 || role !== void 0 || source !== void 0 || photo !== null) && /* @__PURE__ */ jsxs38("figcaption", { children: [
4904
+ photo !== null && /* @__PURE__ */ jsx48(AssetImage, { asset: photo, mediaOrigin, alt: "", className: "tb-b-tm-photo", sizes: "44px" }),
4905
+ /* @__PURE__ */ jsxs38("span", { className: "tb-b-tm-by", children: [
4906
+ name !== void 0 && /* @__PURE__ */ jsx48("span", { className: "tb-b-tm-name", children: name }),
4907
+ role !== void 0 && /* @__PURE__ */ jsx48("span", { className: "tb-b-tm-role", children: role }),
4908
+ source !== void 0 && /* @__PURE__ */ jsx48("span", { className: "tb-b-tm-source", children: source })
4909
+ ] })
4910
+ ] })
4911
+ ] });
4912
+ return carousel ? /* @__PURE__ */ jsx48(
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__ */ jsx48("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__ */ jsxs38(Fragment34, { children: [
4928
+ /* @__PURE__ */ jsx48(R23Styles, {}),
4929
+ /* @__PURE__ */ jsx48("div", { className, children: /* @__PURE__ */ jsx48("ul", { className: "tb-b-tm-list", children: cards }) })
4930
+ ] });
4931
+ }
4932
+ return /* @__PURE__ */ jsxs38(Fragment34, { children: [
4933
+ /* @__PURE__ */ jsx48(R23Styles, {}),
4934
+ /* @__PURE__ */ jsxs38(
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__ */ jsx48("div", { className: "tb-b-tm-list", ref: track, role: "group", tabIndex: 0, children: cards }),
4948
+ /* @__PURE__ */ jsxs38("div", { className: `tb-b-tm-ctrl${live ? "" : " tb-b-tm-ctrl--wait"}`, children: [
4949
+ /* @__PURE__ */ jsx48("button", { type: "button", className: "tb-b-tm-btn", "aria-label": prevLabel, onClick: () => step2(-1), children: /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", children: "\u2039" }) }),
4950
+ props.autoplay === true && !(live && !motion) && /* @__PURE__ */ jsx48("button", { type: "button", className: "tb-b-tm-btn tb-b-tm-pause", "aria-label": paused ? playLabel : pauseLabel, onClick: () => setPaused(!paused), children: /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", children: paused ? "\u25B6" : "\u23F8" }) }),
4951
+ /* @__PURE__ */ jsx48("button", { type: "button", className: "tb-b-tm-btn", "aria-label": nextLabel, onClick: () => step2(1), children: /* @__PURE__ */ jsx48("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
+ import { Fragment as Fragment35, jsx as jsx49, jsxs as jsxs39 } from "react/jsx-runtime";
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__ */ jsxs39(Fragment35, { children: [
4968
+ /* @__PURE__ */ jsx49(R23Styles, {}),
4969
+ /* @__PURE__ */ jsx49(Placeholder, { editMode, children: "Add badges or payment methods in the settings" })
4970
+ ] });
4971
+ }
4972
+ return /* @__PURE__ */ jsxs39(Fragment35, { children: [
4973
+ /* @__PURE__ */ jsx49(R23Styles, {}),
4974
+ /* @__PURE__ */ jsxs39("div", { className: `tb-b-trust tb-b-trust--${oneOf(props.layout, LAYOUTS4, "row")}`, children: [
4975
+ badges.length > 0 && /* @__PURE__ */ jsx49("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__ */ jsxs39("li", { className: "tb-b-badge", children: [
4981
+ /* @__PURE__ */ jsx49("span", { className: "tb-b-badge-icon", "aria-hidden": "true", children: svg !== null ? /* @__PURE__ */ jsx49(SvgFromAsset, { asset: svg, mediaOrigin }) : /* @__PURE__ */ jsx49(BadgeIcon, { name: textOf3(row.icon) }) }),
4982
+ /* @__PURE__ */ jsxs39("span", { className: "tb-b-badge-body", children: [
4983
+ title !== void 0 && /* @__PURE__ */ jsx49("span", { className: "tb-b-badge-title", children: href === null ? title : /* @__PURE__ */ jsx49("a", { href, children: title }) }),
4984
+ text2 !== void 0 && /* @__PURE__ */ jsx49("span", { className: "tb-b-badge-text", children: text2 })
4985
+ ] })
4986
+ ] }, `${String(index)}:${textOf3(row.title)}`);
4987
+ }) }),
4988
+ methods.length > 0 && /* @__PURE__ */ jsx49("ul", { className: "tb-b-pay", role: "list", "aria-label": str(props.paymentTitle) ?? "Payment methods we accept", children: methods.map((method, index) => /* @__PURE__ */ jsx49("li", { children: /* @__PURE__ */ jsx49(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
+ import { useRef as useRef6, useState as useState10 } from "react";
5006
+
5007
+ // src/basics/r23/media-shared.tsx
5008
+ import { BASIC_WIDGET_DEFINITIONS as BASIC_WIDGET_DEFINITIONS4, safeUrl as safeUrl18 } from "@usethrottle/builder-schema";
5009
+ import { Fragment as Fragment36, jsx as jsx50, jsxs as jsxs40 } from "react/jsx-runtime";
5010
+ function r23MediaDefinition(type) {
5011
+ const found = BASIC_WIDGET_DEFINITIONS4.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) && safeUrl18(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 = safeUrl18(asset.url, "src", { mediaOrigin });
5029
+ if (src === null) return null;
5030
+ const srcSet = asset.variants.flatMap((variant) => {
5031
+ const url = safeUrl18(variant.url, "src", { mediaOrigin });
5032
+ return url === null || url.includes(",") ? [] : [`${url} ${String(variant.width)}w`];
5033
+ }).join(", ");
5034
+ return /* @__PURE__ */ jsx50(
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__ */ jsxs40(Fragment36, { children: [
5144
+ /* @__PURE__ */ jsx50(BasicStyles, {}),
5145
+ /* @__PURE__ */ jsx50("style", { href: "tb-basics-r23-media", precedence: "throttle", children: R23_MEDIA_CSS })
5146
+ ] });
5147
+ }
5148
+
5149
+ // src/basics/r23/before-after.tsx
5150
+ import { Fragment as Fragment37, jsx as jsx51, jsxs as jsxs41 } from "react/jsx-runtime";
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] = useState10(startValue);
5157
+ const stage = useRef6(null);
5158
+ const dragging = useRef6(false);
5159
+ const before = mediaAsset(props.before, mediaOrigin);
5160
+ const after = mediaAsset(props.after, mediaOrigin);
5161
+ if (before === null || after === null) {
5162
+ return /* @__PURE__ */ jsxs41(Fragment37, { children: [
5163
+ /* @__PURE__ */ jsx51(R23MediaStyles, {}),
5164
+ /* @__PURE__ */ jsx51(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 = str(props.beforeLabel) ?? "Before";
5171
+ const afterLabel = str(props.afterLabel) ?? "After";
5172
+ const name = 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 + (keys[event.key] ?? 0)));
5180
+ else return;
5181
+ event.preventDefault();
5182
+ };
5183
+ const fromPointer = (event) => {
5184
+ const rect = stage.current?.getBoundingClientRect();
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__ */ jsxs41(Fragment37, { children: [
5193
+ /* @__PURE__ */ jsx51(R23MediaStyles, {}),
5194
+ /* @__PURE__ */ jsx51("div", { className: `tb-b-ba tb-b-ba--${orientation}`, children: /* @__PURE__ */ jsxs41(
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
+ event.currentTarget.setPointerCapture?.(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__ */ jsxs41("figure", { className: "tb-b-ba-pane tb-b-ba-before", children: [
5217
+ /* @__PURE__ */ jsx51(MediaImage, { asset: before, mediaOrigin, alt: str(props.beforeAlt) ?? "", sizes: "100vw", priority: props.priority === true, style: { aspectRatio: "auto" } }),
5218
+ /* @__PURE__ */ jsx51("figcaption", { children: beforeLabel })
5219
+ ] }),
5220
+ /* @__PURE__ */ jsxs41("figure", { className: "tb-b-ba-pane tb-b-ba-after", children: [
5221
+ /* @__PURE__ */ jsx51(MediaImage, { asset: after, mediaOrigin, alt: str(props.afterAlt) ?? "", sizes: "100vw", priority: props.priority === true, style: { aspectRatio: "auto" } }),
5222
+ /* @__PURE__ */ jsx51("figcaption", { children: afterLabel })
5223
+ ] }),
5224
+ /* @__PURE__ */ jsx51(
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__ */ jsx51("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
+ import { useId as useId5 } from "react";
5250
+ import { Fragment as Fragment38, jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
5251
+ var MODES2 = ["scroll", "stacked"];
5252
+ var VALUE_KEYS = ["value1", "value2", "value3", "value4", "value5"];
5253
+ function ComparisonTable({ props, mediaOrigin, editMode }) {
5254
+ const stackId = useId5();
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__ */ jsxs42(Fragment38, { children: [
5265
+ /* @__PURE__ */ jsx52(R23MediaStyles, {}),
5266
+ /* @__PURE__ */ jsx52(Placeholder, { editMode, children: "Add columns and rows in the settings" })
5267
+ ] });
5268
+ }
5269
+ const included = str(props.includedText) ?? "Included";
5270
+ const notIncluded = str(props.notIncludedText) ?? "Not included";
5271
+ const notApplicable = 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__ */ jsxs42(Fragment38, { children: [
5281
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-ct-mark tb-b-ct-mark--check", "aria-hidden": "true", children: "\u2713" }),
5282
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-msr", children: included })
5283
+ ] });
5284
+ case "cross":
5285
+ case "\u2715":
5286
+ case "\u2717":
5287
+ case "\u2716":
5288
+ return /* @__PURE__ */ jsxs42(Fragment38, { children: [
5289
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-ct-mark tb-b-ct-mark--cross", "aria-hidden": "true", children: "\u2715" }),
5290
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-msr", children: notIncluded })
5291
+ ] });
5292
+ case "dash":
5293
+ case "\u2013":
5294
+ case "\u2014":
5295
+ return /* @__PURE__ */ jsxs42(Fragment38, { children: [
5296
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-ct-mark tb-b-ct-mark--dash", "aria-hidden": "true", children: "\u2013" }),
5297
+ /* @__PURE__ */ jsx52("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__ */ jsx52("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__ */ jsxs42(Fragment38, { children: [
5311
+ /* @__PURE__ */ jsx52(R23MediaStyles, {}),
5312
+ /* @__PURE__ */ jsxs42("div", { className, children: [
5313
+ /* @__PURE__ */ jsx52("div", { className: "tb-b-ct-scroll", role: "region", tabIndex: 0, "aria-label": str(props.scrollLabel) ?? "Comparison table, scrollable", children: /* @__PURE__ */ jsxs42("table", { className: "tb-b-ct-table", children: [
5314
+ caption !== void 0 && /* @__PURE__ */ jsx52("caption", { children: caption }),
5315
+ /* @__PURE__ */ jsx52("thead", { children: /* @__PURE__ */ jsxs42("tr", { children: [
5316
+ /* @__PURE__ */ jsx52("th", { scope: "col", children: /* @__PURE__ */ jsx52("span", { className: "tb-b-msr", children: str(props.featureLabel) ?? "Feature" }) }),
5317
+ columns.map((col) => /* @__PURE__ */ jsxs42("th", { scope: "col", className: col.highlight ? "is-hl" : void 0, children: [
5318
+ /* @__PURE__ */ jsx52("span", { className: "tb-b-ct-title", children: col.title }),
5319
+ button(col)
5320
+ ] }, col.index))
5321
+ ] }) }),
5322
+ /* @__PURE__ */ jsx52("tbody", { children: rows.map(({ label: label2, row }, r) => /* @__PURE__ */ jsxs42("tr", { children: [
5323
+ /* @__PURE__ */ jsx52("th", { scope: "row", children: label2 }),
5324
+ columns.map((col) => /* @__PURE__ */ jsx52("td", { className: col.highlight ? "is-hl" : void 0, children: cell(row[VALUE_KEYS[col.index] ?? "value1"]) }, col.index))
5325
+ ] }, r)) })
5326
+ ] }) }),
5327
+ mode === "stacked" && /* @__PURE__ */ jsx52("div", { className: "tb-b-ct-stack", children: columns.map((col) => /* @__PURE__ */ jsxs42("div", { role: "group", "aria-labelledby": `${stackId}-${String(col.index)}`, className: `tb-b-ct-stack-card${col.highlight ? " is-hl" : ""}`, children: [
5328
+ /* @__PURE__ */ jsx52("p", { id: `${stackId}-${String(col.index)}`, className: "tb-b-ct-stack-title", children: col.title }),
5329
+ /* @__PURE__ */ jsx52("dl", { children: rows.flatMap(({ label: label2, row }, r) => [
5330
+ /* @__PURE__ */ jsx52("dt", { children: label2 }, `t${String(r)}`),
5331
+ /* @__PURE__ */ jsx52("dd", { children: cell(row[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
+ import { useEffect as useEffect11, useRef as useRef7, useState as useState11 } from "react";
5342
+ import { createPortal } from "react-dom";
5343
+ import { safeUrl as safeUrl19 } from "@usethrottle/builder-schema";
5344
+ import { Fragment as Fragment39, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
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 = () => window.matchMedia?.("(prefers-reduced-motion: reduce)").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 = useRef7(null);
5362
+ const closeButton = useRef7(null);
5363
+ useEffect11(() => {
5364
+ closeButton.current?.focus();
5365
+ const previous = document.body.style.overflow;
5366
+ document.body.style.overflow = "hidden";
5367
+ return () => {
5368
+ document.body.style.overflow = previous;
5369
+ returnTo?.focus();
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 = useRef7(onKeyDown);
5389
+ latestKeyDown.current = onKeyDown;
5390
+ useEffect11(() => {
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 createPortal(
5398
+ /* @__PURE__ */ jsxs43(
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__ */ jsx53("button", { ref: closeButton, type: "button", className: "tb-b-gal-x", onClick: onClose, children: texts.close }),
5412
+ /* @__PURE__ */ jsxs43("div", { className: "tb-b-gal-stage", children: [
5413
+ total > 1 && /* @__PURE__ */ jsx53("button", { type: "button", "aria-label": texts.prev, onClick: () => go(-1), children: "\u2039" }),
5414
+ /* @__PURE__ */ jsxs43("figure", { children: [
5415
+ /* @__PURE__ */ jsx53(AssetImage, { asset: shot.asset, mediaOrigin, alt: shot.alt, sizes: "100vw", loading: "eager" }),
5416
+ shot.caption !== void 0 && /* @__PURE__ */ jsx53("figcaption", { children: shot.caption })
5417
+ ] }),
5418
+ total > 1 && /* @__PURE__ */ jsx53("button", { type: "button", "aria-label": texts.next, onClick: () => go(1), children: "\u203A" })
5419
+ ] }),
5420
+ /* @__PURE__ */ jsx53("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] = useState11(null);
5429
+ const returnTo = useRef7(null);
5430
+ const track = useRef7(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 : safeUrl19(asset.url, "src", { mediaOrigin });
5435
+ if (asset === null || full === null) continue;
5436
+ shots.push({ asset, full, alt: str(row.alt) ?? "", caption: str(row.caption), href: hrefOf(row.link, mediaOrigin) });
5437
+ }
5438
+ if (shots.length === 0) {
5439
+ return /* @__PURE__ */ jsxs43(Fragment39, { children: [
5440
+ /* @__PURE__ */ jsx53(R23MediaStyles, {}),
5441
+ /* @__PURE__ */ jsx53(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 = str(props.label) ?? "Gallery";
5449
+ const statusText = str(props.statusText) ?? "Image {n} of {total}";
5450
+ const texts = { close: str(props.closeLabel) ?? "Close", prev: str(props.prevLabel) ?? "Previous image", next: 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
+ el.scrollBy?.({ left: dir * el.clientWidth * (rtl ? -1 : 1), behavior: reducedMotion2() ? "auto" : "smooth" });
5459
+ };
5460
+ const items = shots.map((shot, index) => {
5461
+ const img = /* @__PURE__ */ jsx53(
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 === "" ? shot.caption ?? statusOf(statusText, index + 1, shots.length) : void 0;
5474
+ return /* @__PURE__ */ jsx53("li", { children: /* @__PURE__ */ jsxs43("figure", { className: "tb-b-gal-item", children: [
5475
+ href === null ? img : /* @__PURE__ */ jsx53(
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__ */ jsx53("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__ */ jsxs43(Fragment39, { children: [
5497
+ /* @__PURE__ */ jsx53(R23MediaStyles, {}),
5498
+ /* @__PURE__ */ jsxs43("div", { className, children: [
5499
+ carousel ? /* @__PURE__ */ jsxs43(Fragment39, { children: [
5500
+ /* @__PURE__ */ jsx53("div", { className: "tb-b-gal-scroll", ref: track, role: "group", tabIndex: 0, "aria-label": label2, children: /* @__PURE__ */ jsx53("ul", { className: "tb-b-gal-list", children: items }) }),
5501
+ /* @__PURE__ */ jsxs43("div", { className: "tb-b-gal-ctrl", children: [
5502
+ /* @__PURE__ */ jsx53("button", { type: "button", className: "tb-b-gal-btn", "aria-label": texts.prev, onClick: () => step2(-1), children: "\u2039" }),
5503
+ /* @__PURE__ */ jsx53("button", { type: "button", className: "tb-b-gal-btn", "aria-label": texts.next, onClick: () => step2(1), children: "\u203A" })
5504
+ ] })
5505
+ ] }) : /* @__PURE__ */ jsx53("ul", { className: "tb-b-gal-list", "aria-label": label2, children: items }),
5506
+ open !== null && /* @__PURE__ */ jsx53(
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
+ import { useState as useState12 } from "react";
5527
+ import { Fragment as Fragment40, jsx as jsx54, jsxs as jsxs44 } from "react/jsx-runtime";
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 (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(match[2] ?? "", match[3]);
5559
+ const close = clock(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] = useState12(!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] = useState12(mappable[0]?.index ?? 0);
5598
+ if (places.length === 0) {
5599
+ return /* @__PURE__ */ jsxs44(Fragment40, { children: [
5600
+ /* @__PURE__ */ jsx54(R23MediaStyles, {}),
5601
+ /* @__PURE__ */ jsx54(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 = 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 = str(props.directionsLabel) ?? "Get directions";
5610
+ const showLabel = 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__ */ jsxs44(Fragment40, { children: [
5631
+ /* @__PURE__ */ jsx54(R23MediaStyles, {}),
5632
+ /* @__PURE__ */ jsxs44("div", { className: `tb-b-map tb-b-map--list-${listMode}`, children: [
5633
+ mappable.length > 0 && /* @__PURE__ */ jsx54("div", { className: "tb-b-map-frame", children: showFrame && current.lat !== null && current.lng !== null ? /* @__PURE__ */ jsx54(
5634
+ "iframe",
5635
+ {
5636
+ src: embedSrc2(provider, current.lat, current.lng, zoom),
5637
+ title: 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__ */ jsxs44("div", { className: "tb-b-map-facade", children: [
5644
+ /* @__PURE__ */ jsx54("span", { className: "tb-b-map-pin", "aria-hidden": "true" }),
5645
+ str(props.privacyNote) !== void 0 && /* @__PURE__ */ jsx54("p", { className: "tb-b-map-note", children: str(props.privacyNote) }),
5646
+ /* @__PURE__ */ jsx54("button", { type: "button", className: "tb-b-map-load", onClick: () => setLoaded(true), children: str(props.loadLabel) ?? "Load interactive map" })
5647
+ ] }) }),
5648
+ /* @__PURE__ */ jsx54("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__ */ jsxs44("li", { className: "tb-b-map-card", children: [
5653
+ place.name !== void 0 && /* @__PURE__ */ jsx54("p", { className: "tb-b-map-name", children: place.href === null || plain ? place.name : /* @__PURE__ */ jsx54("a", { href: place.href, children: place.name }) }),
5654
+ place.address !== void 0 && /* @__PURE__ */ jsx54("p", { className: "tb-b-map-address", children: place.address }),
5655
+ place.hours !== void 0 && /* @__PURE__ */ jsx54("p", { className: "tb-b-map-hours", children: place.hours }),
5656
+ place.phone !== void 0 && /* @__PURE__ */ jsx54("p", { className: "tb-b-map-phone", children: tel === null ? place.phone : /* @__PURE__ */ jsx54("a", { href: tel, children: place.phone }) }),
5657
+ dir !== null && /* @__PURE__ */ jsx54("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__ */ jsx54(
5659
+ "button",
5660
+ {
5661
+ type: "button",
5662
+ className: "tb-b-map-show",
5663
+ "aria-pressed": current?.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__ */ jsx54("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,
@@ -4197,7 +5692,7 @@ var BASIC_COMPONENTS = {
4197
5692
  "basic.copyright": Copyright,
4198
5693
  "basic.countdown": Countdown
4199
5694
  };
4200
- var v1Widgets = BASIC_WIDGET_DEFINITIONS3.flatMap(
5695
+ var v1Widgets = BASIC_WIDGET_DEFINITIONS5.flatMap(
4201
5696
  (definition3) => definition3.v === 1 && Object.hasOwn(BASIC_COMPONENTS, definition3.type) ? [{ ...definition3, Component: BASIC_COMPONENTS[definition3.type] }] : []
4202
5697
  );
4203
5698
  var widgets = mergeV2Widgets(v1Widgets, [
@@ -4209,17 +5704,19 @@ 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
 
4216
5713
  // src/custom/factory.ts
4217
- import { createElement as createElement5 } from "react";
5714
+ import { createElement as createElement7 } from "react";
4218
5715
 
4219
5716
  // src/custom/composite-widget.tsx
4220
5717
  import { Suspense as Suspense3 } from "react";
4221
5718
  import { pageDocumentSchema, validateSettingValue as validateSettingValue3 } from "@usethrottle/builder-schema";
4222
- import { jsx as jsx42 } from "react/jsx-runtime";
5719
+ import { jsx as jsx55 } from "react/jsx-runtime";
4223
5720
  var SETTING_KEY_RE = /^[a-z][A-Za-z0-9]{0,39}$/;
4224
5721
  var NODE_ID_RE = /^[a-z0-9]{8,24}$/;
4225
5722
  var WRAP = { section: "zzcompsec001", column: "zzcompcol001", inner: "zzcompinr001" };
@@ -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");
@@ -4409,7 +5906,7 @@ function CompositeBody(props) {
4409
5906
  warnOnce(`composite-weight:${snapshot.type}@${String(snapshot.v)}`, `${snapshot.type} would render too many nodes; rendering nothing for it`);
4410
5907
  return null;
4411
5908
  }
4412
- return /* @__PURE__ */ jsx42(
5909
+ return /* @__PURE__ */ jsx55(
4413
5910
  BuilderRenderer,
4414
5911
  {
4415
5912
  document: built.document,
@@ -4425,23 +5922,23 @@ function CompositeBody(props) {
4425
5922
  );
4426
5923
  }
4427
5924
  function CompositeWidget(props) {
4428
- return /* @__PURE__ */ jsx42(PartBoundary, { label: `${props.snapshot.type}@${String(props.snapshot.v)}`, children: /* @__PURE__ */ jsx42(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx42(CompositeBody, { ...props }) }) });
5925
+ return /* @__PURE__ */ jsx55(PartBoundary, { label: `${props.snapshot.type}@${String(props.snapshot.v)}`, children: /* @__PURE__ */ jsx55(Suspense3, { fallback: null, children: /* @__PURE__ */ jsx55(CompositeBody, { ...props }) }) });
4429
5926
  }
4430
5927
 
4431
5928
  // src/custom/factory.ts
4432
5929
  var isDisabled = (snapshot) => snapshot.status === "disabled";
4433
- var Disabled = ({ editMode }) => editMode ? createElement5("div", { className: "tb-missing" }, "This custom widget is disabled") : null;
5930
+ var Disabled = ({ editMode }) => editMode ? createElement7("div", { className: "tb-missing" }, "This custom widget is disabled") : null;
4434
5931
  var customWidgetFactory = (snapshot, registry) => {
4435
5932
  if (isDisabled(snapshot)) return Disabled;
4436
5933
  if (snapshot.kind === "template") {
4437
5934
  const template = compileTemplate(snapshot, registry);
4438
5935
  if (template === null) return null;
4439
- const Component2 = (props) => createElement5(TemplateWidget, { ...props, snapshot, registry });
5936
+ const Component2 = (props) => createElement7(TemplateWidget, { ...props, snapshot, registry });
4440
5937
  componentWeights.set(Component2, template.weight);
4441
5938
  return Component2;
4442
5939
  }
4443
5940
  if (compileComposite(snapshot) === null) return null;
4444
- return (props) => createElement5(CompositeWidget, { ...props, snapshot, registry });
5941
+ return (props) => createElement7(CompositeWidget, { ...props, snapshot, registry });
4445
5942
  };
4446
5943
 
4447
5944
  // src/registry.ts
@@ -4550,7 +6047,7 @@ async function loadBuilderTemplate(options) {
4550
6047
  }
4551
6048
 
4552
6049
  // src/next/seo.ts
4553
- import { TEMPLATE_NOINDEX_DEFAULT, safeUrl as safeUrl15 } from "@usethrottle/builder-schema";
6050
+ import { TEMPLATE_NOINDEX_DEFAULT, safeUrl as safeUrl20 } from "@usethrottle/builder-schema";
4554
6051
  var isRec2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4555
6052
  var text = (value) => typeof value === "string" && value.trim() !== "" ? value : void 0;
4556
6053
  var ORIGIN_RE = /^https?:\/\/[^\s/\\]+$/iu;
@@ -4582,7 +6079,7 @@ function canonicalFor(url, kind) {
4582
6079
  }
4583
6080
  function imageOf(value, mediaOrigin) {
4584
6081
  const raw = isRec2(value) ? value.url : value;
4585
- const url = safeUrl15(raw, "src", { mediaOrigin });
6082
+ const url = safeUrl20(raw, "src", { mediaOrigin });
4586
6083
  if (url === null) return void 0;
4587
6084
  const frozen = isRec2(value) ? value : {};
4588
6085
  return {
@@ -4594,10 +6091,10 @@ function imageOf(value, mediaOrigin) {
4594
6091
  function pagePathOf(settings, page, resolve) {
4595
6092
  const routes = isRec2(settings.routes) ? settings.routes : {};
4596
6093
  const pattern = text(routes.page) ?? DEFAULT_PAGE_ROUTE;
4597
- const own = page.path !== void 0 && page.path !== "/" && !page.path.startsWith("/pages/") ? safeUrl15(page.path, "href", { mediaOrigin: "" }) : null;
4598
- const path = own ?? safeUrl15(pattern.replaceAll("{handle}", () => page.slug), "href", { mediaOrigin: "" });
6094
+ const own = page.path !== void 0 && page.path !== "/" && !page.path.startsWith("/pages/") ? safeUrl20(page.path, "href", { mediaOrigin: "" }) : null;
6095
+ const path = own ?? safeUrl20(pattern.replaceAll("{handle}", () => page.slug), "href", { mediaOrigin: "" });
4599
6096
  if (path === null || resolve === void 0) return path;
4600
- return safeUrl15(resolve({ ...page, path }), "href", { mediaOrigin: "" }) ?? path;
6097
+ return safeUrl20(resolve({ ...page, path }), "href", { mediaOrigin: "" }) ?? path;
4601
6098
  }
4602
6099
  function originOf(storeUrl) {
4603
6100
  const origin = storeUrl?.replace(/\/+$/u, "");
@@ -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 = 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 = imageOf(logoField, context.mediaOrigin)?.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: 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 : {};
@@ -4715,14 +6265,15 @@ function metadataOf(page, context) {
4715
6265
 
4716
6266
  export {
4717
6267
  __publicField,
4718
- warnOnce,
4719
- buildRouteTable,
4720
6268
  organizationJsonLd,
4721
6269
  webSiteJsonLd,
4722
6270
  breadcrumbJsonLd,
4723
6271
  faqJsonLd,
6272
+ videoJsonLd,
4724
6273
  localBusinessJsonLd,
4725
6274
  jsonLdString,
6275
+ warnOnce,
6276
+ buildRouteTable,
4726
6277
  createRendererRegistry,
4727
6278
  staticDataFor,
4728
6279
  partOf,
@@ -4742,5 +6293,6 @@ export {
4742
6293
  siteLocales,
4743
6294
  localized2 as localized,
4744
6295
  templateMetadataOf,
6296
+ siteJsonLdOf,
4745
6297
  metadataOf
4746
6298
  };