@ohhwells/bridge 0.1.125 → 0.1.126-next.347

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.
package/dist/index.cjs CHANGED
@@ -75,7 +75,7 @@ __export(index_exports, {
75
75
  module.exports = __toCommonJS(index_exports);
76
76
 
77
77
  // src/OhhwellsBridge.tsx
78
- var import_react19 = __toESM(require("react"), 1);
78
+ var import_react20 = __toESM(require("react"), 1);
79
79
  var import_client2 = require("react-dom/client");
80
80
  var import_react_dom4 = require("react-dom");
81
81
 
@@ -296,10 +296,14 @@ function reapRemovedAiSections(state, store, removedIds, excludeIds = /* @__PURE
296
296
  var BRAND_NAME_KEY = "__ohw_brand_name";
297
297
  var BRAND_TITLE_KEY = "__ohw_site_title";
298
298
  var BRAND_FAVICON_LETTER_KEY = "__ohw_favicon_letter";
299
+ var SITE_DESCRIPTION_KEY = "__ohw_site_description";
300
+ var SITE_OG_IMAGE_KEY = "__ohw_og_image";
299
301
  var BRAND_CHROME_KEYS = /* @__PURE__ */ new Set([
300
302
  BRAND_NAME_KEY,
301
303
  BRAND_TITLE_KEY,
302
- BRAND_FAVICON_LETTER_KEY
304
+ BRAND_FAVICON_LETTER_KEY,
305
+ SITE_DESCRIPTION_KEY,
306
+ SITE_OG_IMAGE_KEY
303
307
  ]);
304
308
  function upsertMeta(selector, attr, token, value) {
305
309
  let el = document.head.querySelector(selector);
@@ -310,6 +314,9 @@ function upsertMeta(selector, attr, token, value) {
310
314
  }
311
315
  if (el.getAttribute("content") !== value) el.setAttribute("content", value);
312
316
  }
317
+ function removeMeta(selector) {
318
+ document.head.querySelector(selector)?.remove();
319
+ }
313
320
  function escapeXml(value) {
314
321
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
315
322
  }
@@ -325,6 +332,22 @@ function applyLetterFavicon(letter) {
325
332
  link.type = "image/svg+xml";
326
333
  if (link.href !== href) link.href = href;
327
334
  }
335
+ function applyDescription(description) {
336
+ if (!description) return;
337
+ upsertMeta('meta[name="description"]', "name", "description", description);
338
+ upsertMeta('meta[property="og:description"]', "property", "og:description", description);
339
+ upsertMeta('meta[name="twitter:description"]', "name", "twitter:description", description);
340
+ }
341
+ function applyOgImage(url) {
342
+ if (url) {
343
+ upsertMeta('meta[property="og:image"]', "property", "og:image", url);
344
+ upsertMeta('meta[name="twitter:image"]', "name", "twitter:image", url);
345
+ upsertMeta('meta[name="twitter:card"]', "name", "twitter:card", "summary_large_image");
346
+ return;
347
+ }
348
+ removeMeta('meta[property="og:image"]');
349
+ removeMeta('meta[name="twitter:image"]');
350
+ }
328
351
  function applyBrandChrome(content) {
329
352
  const name = content[BRAND_NAME_KEY];
330
353
  if (typeof name === "string" && name.length > 0) {
@@ -343,6 +366,13 @@ function applyBrandChrome(content) {
343
366
  if (typeof letter === "string" && letter.length > 0) {
344
367
  applyLetterFavicon(letter);
345
368
  }
369
+ const description = content[SITE_DESCRIPTION_KEY];
370
+ if (typeof description === "string" && description.length > 0) {
371
+ applyDescription(description);
372
+ }
373
+ if (Object.prototype.hasOwnProperty.call(content, SITE_OG_IMAGE_KEY)) {
374
+ applyOgImage(String(content[SITE_OG_IMAGE_KEY] ?? "").trim());
375
+ }
346
376
  }
347
377
 
348
378
  // src/lib/brand-kit.ts
@@ -1753,6 +1783,22 @@ function pricingCardEmphasis(featured, ctx, hasBg) {
1753
1783
  function textAttrs(ctx, path) {
1754
1784
  return ctx.keyFor ? { "data-ohw-key": ctx.keyFor(path), "data-ohw-editable": "text" } : {};
1755
1785
  }
1786
+ var AI_RESPONSIVE_CSS = [
1787
+ "@media (max-width: 960px) {",
1788
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: repeat(2, 1fr) !important; }",
1789
+ ' [data-ai-responsive] [data-ai-grid="1"] { grid-template-columns: 1fr !important; }',
1790
+ "}",
1791
+ "@media (max-width: 640px) {",
1792
+ " [data-ai-responsive] [data-ai-grid] { grid-template-columns: 1fr !important; }",
1793
+ " [data-ai-responsive] [data-ai-columns] > * { grid-column: 1 / -1 !important; }",
1794
+ // Group containers flatten to a column on phones; span placements come along for free.
1795
+ " [data-ai-responsive] [data-ai-group] { display: flex !important; flex-direction: column !important; }",
1796
+ " [data-ai-responsive] [data-ai-group] > * { grid-column: auto !important; }",
1797
+ " [data-ai-responsive] [data-ai-section-inner] { padding-left: 20px !important; padding-right: 20px !important; }",
1798
+ " [data-ai-responsive] { overflow-x: hidden; }",
1799
+ " [data-ai-responsive] img { max-width: 100%; }",
1800
+ "}"
1801
+ ].join("\n");
1756
1802
  var TRANSPARENT_PX = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
1757
1803
  function MediaBox({
1758
1804
  refValue,
@@ -1770,9 +1816,9 @@ function MediaBox({
1770
1816
  const url = refValue ? ctx.resolveMedia(refValue) : null;
1771
1817
  const isIcon = /^(lucide|simple):/.test(refValue);
1772
1818
  const aspectRatio = aspect && /^\d+:\d+$/.test(aspect) ? aspect.replace(":", " / ") : void 0;
1773
- const editAttrs = ctx.keyFor && editPath && !isIcon ? {
1819
+ const editAttrs = ctx.keyFor && editPath ? {
1774
1820
  "data-ohw-key": ctx.keyFor(editPath),
1775
- ...genericImageEdit ? { "data-ohw-editable": "image" } : {}
1821
+ ...isIcon ? { "data-ohw-editable": "icon" } : genericImageEdit ? { "data-ohw-editable": "image" } : {}
1776
1822
  } : {};
1777
1823
  if (isIcon) {
1778
1824
  const Icon = refValue.startsWith("lucide:") ? lucideByName(refValue.slice(7)) : null;
@@ -1780,6 +1826,7 @@ function MediaBox({
1780
1826
  "span",
1781
1827
  {
1782
1828
  "data-ai-icon": refValue,
1829
+ ...editAttrs,
1783
1830
  style: {
1784
1831
  display: "inline-flex",
1785
1832
  width: 48,
@@ -1831,6 +1878,117 @@ function MediaBox({
1831
1878
  }
1832
1879
  );
1833
1880
  }
1881
+ function VideoEmbed({ slots, ctx, path }) {
1882
+ const [playing, setPlaying] = import_react.default.useState(false);
1883
+ const videoId = str(slots.videoId);
1884
+ const caption = str(slots.caption);
1885
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: AI_TREE_TOKENS.spacing3 }, children: [
1886
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1887
+ "div",
1888
+ {
1889
+ "data-ohw-video-block": "",
1890
+ "data-ohw-video-path": path,
1891
+ style: {
1892
+ position: "relative",
1893
+ width: "100%",
1894
+ aspectRatio: "16 / 9",
1895
+ // Floor so YouTube's own control chrome (volume tooltip, CC, related-videos
1896
+ // overlay) has enough room on narrow mobile widths — 16:9 alone can shrink
1897
+ // below what that fixed-size chrome needs and it starts clipping.
1898
+ minHeight: 250,
1899
+ borderRadius: AI_TREE_TOKENS.radiusCard,
1900
+ overflow: "hidden",
1901
+ background: "#DBEAFE"
1902
+ },
1903
+ children: !videoId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1904
+ "div",
1905
+ {
1906
+ style: {
1907
+ position: "absolute",
1908
+ inset: 0,
1909
+ display: "flex",
1910
+ alignItems: "center",
1911
+ justifyContent: "center",
1912
+ color: "#93C5FD",
1913
+ fontSize: 13
1914
+ },
1915
+ children: "video"
1916
+ }
1917
+ ) : playing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1918
+ "iframe",
1919
+ {
1920
+ src: `https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1&mute=1&rel=0`,
1921
+ title: caption || "YouTube video",
1922
+ style: { position: "absolute", inset: 0, width: "100%", height: "100%", border: 0 },
1923
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; fullscreen; gyroscope; picture-in-picture",
1924
+ allowFullScreen: true,
1925
+ sandbox: "allow-scripts allow-same-origin allow-presentation allow-popups allow-popups-to-escape-sandbox",
1926
+ loading: "lazy"
1927
+ }
1928
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1929
+ "button",
1930
+ {
1931
+ type: "button",
1932
+ onClick: () => setPlaying(true),
1933
+ "aria-label": "Play video",
1934
+ style: {
1935
+ position: "absolute",
1936
+ inset: 0,
1937
+ width: "100%",
1938
+ height: "100%",
1939
+ border: 0,
1940
+ padding: 0,
1941
+ margin: 0,
1942
+ cursor: "pointer",
1943
+ background: "none"
1944
+ },
1945
+ children: [
1946
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1947
+ "img",
1948
+ {
1949
+ src: `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`,
1950
+ alt: "",
1951
+ style: { width: "100%", height: "100%", objectFit: "cover", display: "block" }
1952
+ }
1953
+ ),
1954
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1955
+ "span",
1956
+ {
1957
+ style: {
1958
+ position: "absolute",
1959
+ top: "50%",
1960
+ left: "50%",
1961
+ transform: "translate(-50%, -50%)",
1962
+ width: 64,
1963
+ height: 64,
1964
+ borderRadius: "50%",
1965
+ background: "rgba(0,0,0,0.65)",
1966
+ display: "flex",
1967
+ alignItems: "center",
1968
+ justifyContent: "center"
1969
+ },
1970
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Play, { size: 28, color: "#fff", fill: "#fff" })
1971
+ }
1972
+ )
1973
+ ]
1974
+ }
1975
+ )
1976
+ }
1977
+ ),
1978
+ caption && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1979
+ "div",
1980
+ {
1981
+ ...textAttrs(ctx, `${path}.caption`),
1982
+ style: {
1983
+ ...typeStyle(AI_TREE_TOKENS.type.bodyM, ctx.brand.fonts.body),
1984
+ color: ctx.brand.palette.dark,
1985
+ textAlign: "center"
1986
+ },
1987
+ children: caption
1988
+ }
1989
+ )
1990
+ ] });
1991
+ }
1834
1992
  function ButtonEl({
1835
1993
  slots,
1836
1994
  ctx,
@@ -2838,7 +2996,7 @@ function CollectionBlock({ node, ctx, path }) {
2838
2996
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2839
2997
  "div",
2840
2998
  {
2841
- "data-ai-grid": "",
2999
+ "data-ai-grid": String(itemsPerRow),
2842
3000
  "data-ohw-pricing-collection": isPricing ? "" : void 0,
2843
3001
  style: {
2844
3002
  display: "grid",
@@ -2911,6 +3069,8 @@ function renderNode(node, ctx, path) {
2911
3069
  editPath: `${path}.source`
2912
3070
  }
2913
3071
  );
3072
+ case "video":
3073
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(VideoEmbed, { slots, ctx, path });
2914
3074
  case "media-list": {
2915
3075
  const stacked = slots.layout === "stack";
2916
3076
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { display: "flex", gap: stacked ? 0 : AI_TREE_TOKENS.spacing3 }, children: (node.children ?? []).map((child, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -3197,6 +3357,7 @@ function AiTreeRenderer({
3197
3357
  {
3198
3358
  "data-ai-section": tree.tag ?? "",
3199
3359
  ...bgAttrs,
3360
+ "data-ai-responsive": "",
3200
3361
  style: {
3201
3362
  position: "relative",
3202
3363
  padding: `${pad}px 0`,
@@ -3207,12 +3368,13 @@ function AiTreeRenderer({
3207
3368
  color: settings.sectionBackground === "accent" ? blockBrand.palette.dark : void 0
3208
3369
  },
3209
3370
  children: [
3210
- isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
3371
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_RESPONSIVE_CSS }),
3211
3372
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: AI_MOBILE_CSS }),
3373
+ isOverlay && backgroundUrl && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { position: "absolute", inset: 0, background: `rgba(255,255,255,${overlayAlpha})` } }),
3212
3374
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3213
3375
  "div",
3214
3376
  {
3215
- "data-ai-container": "",
3377
+ "data-ai-section-inner": "",
3216
3378
  style: {
3217
3379
  position: "relative",
3218
3380
  maxWidth: AI_TREE_TOKENS.sectionMaxWidth,
@@ -3223,7 +3385,7 @@ function AiTreeRenderer({
3223
3385
  children: tree.rows.map((row, r2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3224
3386
  "div",
3225
3387
  {
3226
- "data-ai-row": "",
3388
+ "data-ai-columns": "",
3227
3389
  style: {
3228
3390
  display: "grid",
3229
3391
  gridTemplateColumns: "repeat(12, 1fr)",
@@ -3627,9 +3789,10 @@ function applyAiSectionsToDom(state, options) {
3627
3789
  if (existing && existing.serialized === serialized && existing.container.isConnected) {
3628
3790
  continue;
3629
3791
  }
3630
- const isNewMount = !existing || !existing.container.isConnected;
3631
3792
  let container = existing?.container;
3793
+ let isNewMount = false;
3632
3794
  if (!container || !container.isConnected) {
3795
+ isNewMount = true;
3633
3796
  existing?.root.unmount();
3634
3797
  container?.remove();
3635
3798
  container = document.createElement("div");
@@ -9524,6 +9687,7 @@ function MediaOverlay({
9524
9687
  (prev) => prev && prev.fullWidth === width && prev.height === height ? prev : { fullWidth: width, height }
9525
9688
  );
9526
9689
  }, [isVideo]);
9690
+ const replaceLabel = isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image";
9527
9691
  const replaceMode = buttonSize ? replaceButtonMode({ width: rect.width, height: rect.height }, buttonSize) : "none";
9528
9692
  const box = {
9529
9693
  position: "fixed",
@@ -9622,11 +9786,10 @@ function MediaOverlay({
9622
9786
  className: "flex items-center justify-center cursor-pointer",
9623
9787
  style: {
9624
9788
  ...box,
9625
- // When text overlays this media, let clicks fall THROUGH to the text underneath. In the
9626
- // parent this needed a whole `ow:click-at` round-trip to re-hit-test inside the iframe;
9627
- // in-document, pointer-events does it natively. The button below opts back in, so
9628
- // Replace still works.
9629
- pointerEvents: hover.hasTextOverlap || cueOnly ? "none" : "auto",
9789
+ // Visual only. `pointer-events: auto` on this full-bleed rect covered the navbar
9790
+ // (hero bg includes the absolute TopNav) and swallowed CTA press-drag. Text overlay
9791
+ // and cueOnly also need clicks to fall through — Replace / video controls opt back in.
9792
+ pointerEvents: "none",
9630
9793
  // Selected: a firm component ring with no wash, so the image reads as chosen rather
9631
9794
  // than hovered. Hover keeps the existing tinted preview.
9632
9795
  boxShadow: selected ? "inset 0 0 0 2px var(--color-bridge-primary)" : "inset 0 0 0 1.5px var(--color-bridge-primary)",
@@ -9653,17 +9816,17 @@ function MediaOverlay({
9653
9816
  },
9654
9817
  children: [
9655
9818
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
9656
- isVideo ? "Replace video" : "Replace image"
9819
+ replaceLabel
9657
9820
  ]
9658
9821
  }
9659
9822
  ),
9660
- replaceMode === "none" || cueOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9823
+ showChrome && replaceMode !== "none" && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
9661
9824
  Button,
9662
9825
  {
9663
9826
  "data-ohw-media-overlay": "",
9664
9827
  variant: "outline",
9665
9828
  size: "sm",
9666
- "aria-label": isVideo ? "Replace video" : "Replace image",
9829
+ "aria-label": replaceLabel,
9667
9830
  className: "gap-1.5 cursor-pointer hover:bg-background",
9668
9831
  style: {
9669
9832
  ...OVERLAY_BUTTON_STYLE,
@@ -9686,7 +9849,7 @@ function MediaOverlay({
9686
9849
  },
9687
9850
  children: [
9688
9851
  isVideo ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.Film, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react5.ImageIcon, { size: 14 }),
9689
- replaceMode === "full" ? isVideo ? "Replace video" : hover.elementType === "bg-image" ? "Replace background" : "Replace image" : null
9852
+ replaceMode === "full" ? replaceLabel : null
9690
9853
  ]
9691
9854
  }
9692
9855
  )
@@ -11407,9 +11570,501 @@ function AiPricingCardOverlay({
11407
11570
  width: 28,
11408
11571
  height: 28,
11409
11572
  borderRadius: 8,
11410
- border: `1.5px dashed ${PRIMARY4}`,
11573
+ border: `1.5px dashed ${PRIMARY4}`,
11574
+ background: "#ffffff",
11575
+ color: PRIMARY4,
11576
+ display: "flex",
11577
+ alignItems: "center",
11578
+ justifyContent: "center",
11579
+ cursor: "pointer",
11580
+ zIndex: 2147483643,
11581
+ fontSize: 14,
11582
+ fontWeight: 700
11583
+ },
11584
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Star, { size: 14, style: { pointerEvents: "none" } })
11585
+ }
11586
+ ),
11587
+ activeCardRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
11588
+ ItemInteractionLayer,
11589
+ {
11590
+ rect: activeCardRect,
11591
+ state: "active-top",
11592
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
11593
+ PricingCardToolbar,
11594
+ {
11595
+ entry: activeEntry,
11596
+ index: active.index,
11597
+ pending,
11598
+ error,
11599
+ onAddTier: () => runMutation(active.sectionId, addPricingTier),
11600
+ onRemoveTier: () => {
11601
+ void runMutation(active.sectionId, (tree) => removePricingTier(tree, active.index)).then(
11602
+ (applied) => {
11603
+ if (applied) setActive(null);
11604
+ }
11605
+ );
11606
+ },
11607
+ onToggleFeatured: (enabled) => runMutation(
11608
+ active.sectionId,
11609
+ (tree) => setPricingCardFeatured(tree, active.index, { enabled })
11610
+ ),
11611
+ onSetTreatment: (treatment) => runMutation(
11612
+ active.sectionId,
11613
+ (tree) => setPricingCardFeatured(tree, active.index, { enabled: true, treatment })
11614
+ ),
11615
+ onAddButton: () => runMutation(active.sectionId, (tree) => addPricingCardButton(tree, active.index, "Learn more")),
11616
+ onRemoveButton: () => runMutation(active.sectionId, (tree) => removePricingCardButton(tree, active.index)),
11617
+ onAddFeature: () => runMutation(active.sectionId, (tree) => addPricingCardFeature(tree, active.index, "New feature")),
11618
+ onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
11619
+ }
11620
+ )
11621
+ }
11622
+ )
11623
+ ] });
11624
+ }
11625
+
11626
+ // src/ui/ai-section/AiVideoOverlay.tsx
11627
+ var import_react11 = require("react");
11628
+ var import_lucide_react10 = require("lucide-react");
11629
+
11630
+ // src/lib/ai-video-tree.ts
11631
+ function resolveVideoBlock(tree, path) {
11632
+ const segments = path.split(".");
11633
+ const rowSeg = segments[0];
11634
+ const blockSeg = segments[1];
11635
+ if (!rowSeg?.startsWith("r") || !blockSeg?.startsWith("b")) return null;
11636
+ let node = tree.rows[Number(rowSeg.slice(1))]?.blocks[Number(blockSeg.slice(1))];
11637
+ for (const seg of segments.slice(2)) {
11638
+ if (!node || !seg.startsWith("c")) return null;
11639
+ node = node.children?.[Number(seg.slice(1))];
11640
+ }
11641
+ return node && node.type === "video" ? node : null;
11642
+ }
11643
+ function withVideo(tree, path, mutate) {
11644
+ const next = JSON.parse(JSON.stringify(tree));
11645
+ const block = resolveVideoBlock(next, path);
11646
+ if (!block) return null;
11647
+ block.slots = block.slots ?? {};
11648
+ return mutate(block) ? next : null;
11649
+ }
11650
+ function videoIdAt(tree, path) {
11651
+ const block = resolveVideoBlock(tree, path);
11652
+ const id = block?.slots?.videoId;
11653
+ return typeof id === "string" ? id : "";
11654
+ }
11655
+ function setVideoId(tree, path, videoId) {
11656
+ return withVideo(tree, path, (block) => {
11657
+ block.slots = { ...block.slots, videoId };
11658
+ return true;
11659
+ });
11660
+ }
11661
+ function clearVideo(tree, path) {
11662
+ return withVideo(tree, path, (block) => {
11663
+ const slots = { ...block.slots };
11664
+ delete slots.videoId;
11665
+ block.slots = slots;
11666
+ return true;
11667
+ });
11668
+ }
11669
+
11670
+ // src/lib/youtube.ts
11671
+ var YOUTUBE_ID_PATTERN = /^[A-Za-z0-9_-]{11}$/;
11672
+ function extractYouTubeId(input) {
11673
+ const trimmed = input.trim();
11674
+ if (!trimmed) return null;
11675
+ if (YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
11676
+ let url;
11677
+ try {
11678
+ url = new URL(trimmed);
11679
+ } catch {
11680
+ return null;
11681
+ }
11682
+ const host = url.hostname.replace(/^www\./, "");
11683
+ if (host !== "youtube.com" && host !== "m.youtube.com" && host !== "youtu.be" && host !== "youtube-nocookie.com") {
11684
+ return null;
11685
+ }
11686
+ let candidate = null;
11687
+ if (host === "youtu.be") {
11688
+ candidate = url.pathname.slice(1).split("/")[0] ?? null;
11689
+ } else if (url.pathname === "/watch") {
11690
+ candidate = url.searchParams.get("v");
11691
+ } else {
11692
+ const match = url.pathname.match(/^\/(?:embed|shorts)\/([^/]+)/);
11693
+ candidate = match ? match[1] : null;
11694
+ }
11695
+ return candidate && YOUTUBE_ID_PATTERN.test(candidate) ? candidate : null;
11696
+ }
11697
+
11698
+ // src/ui/ai-section/AiVideoOverlay.tsx
11699
+ var import_jsx_runtime20 = require("react/jsx-runtime");
11700
+ var PRIMARY5 = "#0885FE";
11701
+ var OHW_BLUE3 = `var(--ohw-primary, ${PRIMARY5})`;
11702
+ var OHW_BLUE_DARK3 = `color-mix(in srgb, var(--ohw-primary, ${PRIMARY5}) 60%, #000000)`;
11703
+ function findVideoBlockElement(sectionId, path) {
11704
+ const sectionEl = findByInstanceId(sectionId);
11705
+ if (!sectionEl) return null;
11706
+ const items = sectionEl.querySelectorAll("[data-ohw-video-block]");
11707
+ for (const el of Array.from(items)) {
11708
+ if (el.dataset.ohwVideoPath === path) return el;
11709
+ }
11710
+ return null;
11711
+ }
11712
+ function readRect4(ref) {
11713
+ const el = ref && findVideoBlockElement(ref.sectionId, ref.path);
11714
+ if (!el) return null;
11715
+ const r2 = el.getBoundingClientRect();
11716
+ if (r2.width <= 0 || r2.height <= 0) return null;
11717
+ return { top: r2.top, left: r2.left, width: r2.width, height: r2.height };
11718
+ }
11719
+ function useLiveBlockRect(ref) {
11720
+ const [rect, setRect] = (0, import_react11.useState)(null);
11721
+ (0, import_react11.useEffect)(() => {
11722
+ if (!ref) {
11723
+ setRect(null);
11724
+ return;
11725
+ }
11726
+ const update = () => {
11727
+ const next = readRect4(ref);
11728
+ setRect(
11729
+ (prev) => prev && next && prev.top === next.top && prev.left === next.left && prev.width === next.width && prev.height === next.height ? prev : next
11730
+ );
11731
+ };
11732
+ update();
11733
+ const opts = { capture: true, passive: true };
11734
+ window.addEventListener("scroll", update, opts);
11735
+ window.addEventListener("resize", update);
11736
+ const interval = setInterval(update, 500);
11737
+ return () => {
11738
+ window.removeEventListener("scroll", update, opts);
11739
+ window.removeEventListener("resize", update);
11740
+ clearInterval(interval);
11741
+ };
11742
+ }, [ref?.sectionId, ref?.path]);
11743
+ return rect;
11744
+ }
11745
+ function requestValidateTree3(postToParent2, tree) {
11746
+ return new Promise((resolve) => {
11747
+ const id = `ai-validate-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`;
11748
+ const timeout = window.setTimeout(() => {
11749
+ window.removeEventListener("message", onMessage);
11750
+ resolve({ ok: false, reasons: ["Validation request timed out."] });
11751
+ }, 8e3);
11752
+ function onMessage(e) {
11753
+ if (e.data?.type !== "ow:ai-validate-tree-result" || e.data.id !== id) return;
11754
+ window.clearTimeout(timeout);
11755
+ window.removeEventListener("message", onMessage);
11756
+ resolve({ ok: e.data.ok === true, reasons: Array.isArray(e.data.reasons) ? e.data.reasons : [] });
11757
+ }
11758
+ window.addEventListener("message", onMessage);
11759
+ postToParent2({ type: "ow:ai-validate-tree-request", id, tree });
11760
+ });
11761
+ }
11762
+ function Pill3({
11763
+ label,
11764
+ onClick,
11765
+ disabled
11766
+ }) {
11767
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11768
+ "button",
11769
+ {
11770
+ type: "button",
11771
+ onClick,
11772
+ disabled,
11773
+ style: {
11774
+ height: 28,
11775
+ padding: "0 10px",
11776
+ display: "inline-flex",
11777
+ alignItems: "center",
11778
+ gap: 4,
11779
+ borderRadius: 999,
11780
+ border: "none",
11781
+ cursor: disabled ? "default" : "pointer",
11782
+ background: "#ffffff",
11783
+ color: OHW_BLUE_DARK3,
11784
+ opacity: disabled ? 0.4 : 1,
11785
+ fontSize: 12,
11786
+ lineHeight: "16px",
11787
+ fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
11788
+ whiteSpace: "nowrap",
11789
+ flex: "0 0 auto"
11790
+ },
11791
+ children: label
11792
+ }
11793
+ );
11794
+ }
11795
+ function watchUrl(id) {
11796
+ return `https://www.youtube.com/watch?v=${id}`;
11797
+ }
11798
+ function VideoUrlInput({ value, onCommit }) {
11799
+ const [draft, setDraft] = (0, import_react11.useState)(value ? watchUrl(value) : "");
11800
+ const [invalid, setInvalid] = (0, import_react11.useState)(false);
11801
+ (0, import_react11.useEffect)(() => {
11802
+ setDraft(value ? watchUrl(value) : "");
11803
+ setInvalid(false);
11804
+ }, [value]);
11805
+ const commit = () => {
11806
+ const next = draft.trim();
11807
+ if (!next) {
11808
+ setInvalid(false);
11809
+ if (value) onCommit(null);
11810
+ return;
11811
+ }
11812
+ const id = extractYouTubeId(next);
11813
+ if (!id) return setInvalid(true);
11814
+ setInvalid(false);
11815
+ setDraft(watchUrl(id));
11816
+ if (id !== value) onCommit(id);
11817
+ };
11818
+ const handleChange = (next) => {
11819
+ setDraft(next);
11820
+ const id = extractYouTubeId(next.trim());
11821
+ if (id && id !== value) {
11822
+ setInvalid(false);
11823
+ onCommit(id);
11824
+ }
11825
+ };
11826
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: 4, width: "100%", maxWidth: 280 }, children: [
11827
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
11828
+ "div",
11829
+ {
11830
+ style: {
11831
+ display: "flex",
11832
+ alignItems: "center",
11833
+ gap: 6,
11834
+ height: 28,
11835
+ padding: "0 12px",
11836
+ borderRadius: 999,
11837
+ background: "#ffffff",
11838
+ width: "100%",
11839
+ boxSizing: "border-box",
11840
+ boxShadow: invalid ? "inset 0 0 0 1.5px #EF4444" : "none"
11841
+ },
11842
+ children: [
11843
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11844
+ "span",
11845
+ {
11846
+ style: {
11847
+ flex: "0 0 auto",
11848
+ color: OHW_BLUE_DARK3,
11849
+ fontSize: 10,
11850
+ lineHeight: "16px",
11851
+ fontWeight: 700,
11852
+ textTransform: "uppercase",
11853
+ letterSpacing: 0.4
11854
+ },
11855
+ children: "Video"
11856
+ }
11857
+ ),
11858
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11859
+ "input",
11860
+ {
11861
+ type: "text",
11862
+ inputMode: "url",
11863
+ value: draft,
11864
+ onChange: (e) => handleChange(e.target.value),
11865
+ onBlur: commit,
11866
+ onKeyDown: (e) => {
11867
+ if (e.key === "Enter") e.currentTarget.blur();
11868
+ if (e.key === "Escape") {
11869
+ setDraft(value ? watchUrl(value) : "");
11870
+ setInvalid(false);
11871
+ e.currentTarget.blur();
11872
+ }
11873
+ },
11874
+ placeholder: "Paste a YouTube URL",
11875
+ "aria-label": "YouTube video URL",
11876
+ "aria-invalid": invalid,
11877
+ style: {
11878
+ flex: 1,
11879
+ minWidth: 0,
11880
+ border: "none",
11881
+ outline: "none",
11882
+ background: "transparent",
11883
+ padding: 0,
11884
+ margin: 0,
11885
+ fontSize: 12,
11886
+ lineHeight: "16px",
11887
+ fontFamily: "Figtree, ui-sans-serif, system-ui, sans-serif",
11888
+ color: "#1f2937"
11889
+ }
11890
+ }
11891
+ )
11892
+ ]
11893
+ }
11894
+ ),
11895
+ invalid && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, textAlign: "center" }, children: "That doesn't look like a YouTube link \u2014 try pasting the video URL again." })
11896
+ ] });
11897
+ }
11898
+ function VideoToolbar({
11899
+ videoId,
11900
+ pending,
11901
+ error,
11902
+ onSetVideoId,
11903
+ onRemove
11904
+ }) {
11905
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
11906
+ "div",
11907
+ {
11908
+ "data-ohw-bridge": "",
11909
+ "data-ohw-toolbar": "",
11910
+ onMouseDown: (e) => e.stopPropagation(),
11911
+ style: {
11912
+ display: "flex",
11913
+ flexDirection: "column",
11914
+ gap: 6,
11915
+ alignItems: "center",
11916
+ width: 280,
11917
+ background: OHW_BLUE3,
11918
+ padding: 8,
11919
+ borderRadius: 12,
11920
+ boxShadow: "0 8px 24px rgba(0,0,0,0.25)",
11921
+ pointerEvents: pending ? "none" : "auto",
11922
+ opacity: pending ? 0.6 : 1
11923
+ },
11924
+ children: [
11925
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(VideoUrlInput, { value: videoId, onCommit: onSetVideoId }),
11926
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Pill3, { label: "Remove video", onClick: onRemove, disabled: !videoId }),
11927
+ error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "#FCA5A5", fontSize: 11, maxWidth: 220, textAlign: "center" }, children: error })
11928
+ ]
11929
+ }
11930
+ );
11931
+ }
11932
+ function AiVideoOverlay({
11933
+ postToParent: postToParent2,
11934
+ aiSectionsRef,
11935
+ applyTreeLocalRef,
11936
+ clearInteractionChromeRef
11937
+ }) {
11938
+ const [hover, setHover] = (0, import_react11.useState)(null);
11939
+ const [active, setActive] = (0, import_react11.useState)(null);
11940
+ const [pending, setPending] = (0, import_react11.useState)(false);
11941
+ const [error, setError] = (0, import_react11.useState)(null);
11942
+ const activeRef = (0, import_react11.useRef)(null);
11943
+ activeRef.current = active;
11944
+ (0, import_react11.useEffect)(() => {
11945
+ const onMove = (e) => {
11946
+ const t = e.target;
11947
+ if (!(t instanceof HTMLElement)) return;
11948
+ if (t.closest("[data-ohw-toolbar], [data-ohw-edit-chrome], [data-ohw-item-interaction], [data-ohw-link-modal-root], [data-ohw-section-picker], [data-ohw-ai-review]")) {
11949
+ return;
11950
+ }
11951
+ const blockEl = t.closest("[data-ohw-video-block]");
11952
+ if (!blockEl) {
11953
+ setHover(null);
11954
+ return;
11955
+ }
11956
+ const sectionEl = blockEl.closest("[data-ohw-section]");
11957
+ const unit = sectionEl ? movableUnit(sectionEl) : null;
11958
+ const sectionId = unit ? instanceIdOf(unit) || null : null;
11959
+ const path = blockEl.dataset.ohwVideoPath;
11960
+ if (!sectionId || !path) {
11961
+ setHover(null);
11962
+ return;
11963
+ }
11964
+ setHover({ sectionId, path });
11965
+ };
11966
+ const onLeave = () => setHover(null);
11967
+ document.addEventListener("mousemove", onMove, { passive: true });
11968
+ document.documentElement.addEventListener("mouseleave", onLeave);
11969
+ return () => {
11970
+ document.removeEventListener("mousemove", onMove);
11971
+ document.documentElement.removeEventListener("mouseleave", onLeave);
11972
+ };
11973
+ }, []);
11974
+ (0, import_react11.useEffect)(() => {
11975
+ const onClick = (e) => {
11976
+ const current = activeRef.current;
11977
+ if (!current) return;
11978
+ const t = e.target;
11979
+ if (!(t instanceof HTMLElement)) return;
11980
+ if (t.closest("[data-ohw-item-interaction]")) return;
11981
+ const blockEl = findVideoBlockElement(current.sectionId, current.path);
11982
+ if (blockEl && blockEl.contains(t)) return;
11983
+ setActive(null);
11984
+ setError(null);
11985
+ };
11986
+ document.addEventListener("click", onClick, true);
11987
+ return () => document.removeEventListener("click", onClick, true);
11988
+ }, []);
11989
+ (0, import_react11.useEffect)(() => {
11990
+ const onBlur = () => {
11991
+ if (!activeRef.current) return;
11992
+ setActive(null);
11993
+ setError(null);
11994
+ };
11995
+ window.addEventListener("blur", onBlur);
11996
+ return () => window.removeEventListener("blur", onBlur);
11997
+ }, []);
11998
+ (0, import_react11.useEffect)(() => {
11999
+ const onKeyDown = (e) => {
12000
+ if (e.key !== "Escape") return;
12001
+ if (!activeRef.current) return;
12002
+ setActive(null);
12003
+ setError(null);
12004
+ };
12005
+ document.addEventListener("keydown", onKeyDown);
12006
+ return () => document.removeEventListener("keydown", onKeyDown);
12007
+ }, []);
12008
+ const findEntry = (0, import_react11.useCallback)(
12009
+ (sectionId) => {
12010
+ const state = parseAiSectionsState(aiSectionsRef.current);
12011
+ return state.sections.find((s) => s.id === sectionId) ?? null;
12012
+ },
12013
+ [aiSectionsRef]
12014
+ );
12015
+ const runMutation = (0, import_react11.useCallback)(
12016
+ async (sectionId, mutate) => {
12017
+ const entry = findEntry(sectionId);
12018
+ if (!entry) return false;
12019
+ const nextTree = mutate(entry.tree);
12020
+ if (!nextTree) return false;
12021
+ setPending(true);
12022
+ setError(null);
12023
+ const { ok, reasons } = await requestValidateTree3(postToParent2, nextTree);
12024
+ setPending(false);
12025
+ if (!ok) {
12026
+ setError(reasons[0] ?? "That change is not allowed.");
12027
+ return false;
12028
+ }
12029
+ applyTreeLocalRef.current?.({
12030
+ id: sectionId,
12031
+ mode: "replace",
12032
+ targetSectionId: sectionId,
12033
+ tree: nextTree,
12034
+ label: entry.label,
12035
+ media: entry.media,
12036
+ ...entry.brand ? { brand: entry.brand } : {}
12037
+ });
12038
+ return true;
12039
+ },
12040
+ [findEntry, postToParent2, applyTreeLocalRef]
12041
+ );
12042
+ const activeEntry = active ? findEntry(active.sectionId) : null;
12043
+ const hoverHandleRect = useLiveBlockRect(!active && hover ? hover : null);
12044
+ const activeBlockRect = useLiveBlockRect(active);
12045
+ const TOOLBAR_APPROX_H = 90;
12046
+ const toolbarState = activeBlockRect && activeBlockRect.top < TOOLBAR_APPROX_H ? "active-bottom" : "active-top";
12047
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
12048
+ hoverHandleRect && hover && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12049
+ "button",
12050
+ {
12051
+ type: "button",
12052
+ "data-ohw-toolbar": "",
12053
+ onClick: () => {
12054
+ clearInteractionChromeRef.current();
12055
+ setActive(hover);
12056
+ },
12057
+ "aria-label": "Configure video",
12058
+ style: {
12059
+ position: "fixed",
12060
+ top: hoverHandleRect.top + 8,
12061
+ left: hoverHandleRect.left + hoverHandleRect.width - 36,
12062
+ width: 28,
12063
+ height: 28,
12064
+ borderRadius: 8,
12065
+ border: `1.5px dashed ${PRIMARY5}`,
11411
12066
  background: "#ffffff",
11412
- color: PRIMARY4,
12067
+ color: PRIMARY5,
11413
12068
  display: "flex",
11414
12069
  alignItems: "center",
11415
12070
  justifyContent: "center",
@@ -11418,41 +12073,29 @@ function AiPricingCardOverlay({
11418
12073
  fontSize: 14,
11419
12074
  fontWeight: 700
11420
12075
  },
11421
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react9.Star, { size: 14, style: { pointerEvents: "none" } })
12076
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.Star, { size: 14, style: { pointerEvents: "none" } })
11422
12077
  }
11423
12078
  ),
11424
- activeCardRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
12079
+ activeBlockRect && active && activeEntry && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
11425
12080
  ItemInteractionLayer,
11426
12081
  {
11427
- rect: activeCardRect,
11428
- state: "active-top",
11429
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
11430
- PricingCardToolbar,
12082
+ rect: activeBlockRect,
12083
+ state: toolbarState,
12084
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12085
+ VideoToolbar,
11431
12086
  {
11432
- entry: activeEntry,
11433
- index: active.index,
12087
+ videoId: videoIdAt(activeEntry.tree, active.path),
11434
12088
  pending,
11435
12089
  error,
11436
- onAddTier: () => runMutation(active.sectionId, addPricingTier),
11437
- onRemoveTier: () => {
11438
- void runMutation(active.sectionId, (tree) => removePricingTier(tree, active.index)).then(
11439
- (applied) => {
11440
- if (applied) setActive(null);
11441
- }
12090
+ onSetVideoId: (videoId) => {
12091
+ void runMutation(
12092
+ active.sectionId,
12093
+ (tree) => videoId ? setVideoId(tree, active.path, videoId) : clearVideo(tree, active.path)
11442
12094
  );
11443
12095
  },
11444
- onToggleFeatured: (enabled) => runMutation(
11445
- active.sectionId,
11446
- (tree) => setPricingCardFeatured(tree, active.index, { enabled })
11447
- ),
11448
- onSetTreatment: (treatment) => runMutation(
11449
- active.sectionId,
11450
- (tree) => setPricingCardFeatured(tree, active.index, { enabled: true, treatment })
11451
- ),
11452
- onAddButton: () => runMutation(active.sectionId, (tree) => addPricingCardButton(tree, active.index, "Learn more")),
11453
- onRemoveButton: () => runMutation(active.sectionId, (tree) => removePricingCardButton(tree, active.index)),
11454
- onAddFeature: () => runMutation(active.sectionId, (tree) => addPricingCardFeature(tree, active.index, "New feature")),
11455
- onRemoveFeature: () => runMutation(active.sectionId, (tree) => removePricingCardFeature(tree, active.index))
12096
+ onRemove: () => {
12097
+ void runMutation(active.sectionId, (tree) => clearVideo(tree, active.path));
12098
+ }
11456
12099
  }
11457
12100
  )
11458
12101
  }
@@ -11771,28 +12414,28 @@ function scrollToHashSectionWhenReady(behavior = "smooth") {
11771
12414
  }
11772
12415
 
11773
12416
  // src/ui/link-modal/LinkPopover.tsx
11774
- var import_react14 = require("react");
12417
+ var import_react15 = require("react");
11775
12418
 
11776
12419
  // src/ui/dialog.tsx
11777
12420
  var React9 = __toESM(require("react"), 1);
11778
12421
  var import_radix_ui6 = require("radix-ui");
11779
- var import_lucide_react10 = require("lucide-react");
11780
- var import_jsx_runtime20 = require("react/jsx-runtime");
12422
+ var import_lucide_react11 = require("lucide-react");
12423
+ var import_jsx_runtime21 = require("react/jsx-runtime");
11781
12424
  function Dialog2({
11782
12425
  ...props
11783
12426
  }) {
11784
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
12427
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_radix_ui6.Dialog.Root, { "data-slot": "dialog", ...props });
11785
12428
  }
11786
12429
  function DialogPortal({
11787
12430
  ...props
11788
12431
  }) {
11789
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
12432
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_radix_ui6.Dialog.Portal, { ...props });
11790
12433
  }
11791
12434
  function DialogOverlay({
11792
12435
  className,
11793
12436
  ...props
11794
12437
  }) {
11795
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12438
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11796
12439
  import_radix_ui6.Dialog.Overlay,
11797
12440
  {
11798
12441
  "data-slot": "dialog-overlay",
@@ -11805,9 +12448,9 @@ function DialogOverlay({
11805
12448
  var DialogContent = React9.forwardRef(
11806
12449
  ({ className, children, showCloseButton = true, container, ...props }, ref) => {
11807
12450
  const positionMode = container ? "absolute" : "fixed";
11808
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(DialogPortal, { container: container ?? void 0, children: [
11809
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
11810
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
12451
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(DialogPortal, { container: container ?? void 0, children: [
12452
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DialogOverlay, { className: cn(positionMode, "inset-0") }),
12453
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
11811
12454
  import_radix_ui6.Dialog.Content,
11812
12455
  {
11813
12456
  ref,
@@ -11823,13 +12466,13 @@ var DialogContent = React9.forwardRef(
11823
12466
  ...props,
11824
12467
  children: [
11825
12468
  children,
11826
- showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12469
+ showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11827
12470
  import_radix_ui6.Dialog.Close,
11828
12471
  {
11829
12472
  type: "button",
11830
12473
  className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50",
11831
12474
  "aria-label": "Close",
11832
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react10.X, { size: 16, "aria-hidden": true })
12475
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.X, { size: 16, "aria-hidden": true })
11833
12476
  }
11834
12477
  ) : null
11835
12478
  ]
@@ -11843,13 +12486,13 @@ function DialogHeader({
11843
12486
  className,
11844
12487
  ...props
11845
12488
  }) {
11846
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
12489
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("flex flex-col gap-1.5", className), ...props });
11847
12490
  }
11848
12491
  function DialogFooter({
11849
12492
  className,
11850
12493
  ...props
11851
12494
  }) {
11852
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12495
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11853
12496
  "div",
11854
12497
  {
11855
12498
  className: cn("flex items-center justify-end gap-2", className),
@@ -11857,7 +12500,7 @@ function DialogFooter({
11857
12500
  }
11858
12501
  );
11859
12502
  }
11860
- var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12503
+ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11861
12504
  import_radix_ui6.Dialog.Title,
11862
12505
  {
11863
12506
  ref,
@@ -11869,7 +12512,7 @@ var DialogTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE
11869
12512
  }
11870
12513
  ));
11871
12514
  DialogTitle.displayName = import_radix_ui6.Dialog.Title.displayName;
11872
- var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
12515
+ var DialogDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11873
12516
  import_radix_ui6.Dialog.Description,
11874
12517
  {
11875
12518
  ref,
@@ -11881,63 +12524,63 @@ DialogDescription.displayName = import_radix_ui6.Dialog.Description.displayName;
11881
12524
  var DialogClose = import_radix_ui6.Dialog.Close;
11882
12525
 
11883
12526
  // src/ui/link-modal/LinkEditorPanel.tsx
11884
- var import_lucide_react14 = require("lucide-react");
12527
+ var import_lucide_react15 = require("lucide-react");
11885
12528
 
11886
12529
  // src/ui/link-modal/DestinationBreadcrumb.tsx
11887
- var import_lucide_react11 = require("lucide-react");
11888
- var import_jsx_runtime21 = require("react/jsx-runtime");
12530
+ var import_lucide_react12 = require("lucide-react");
12531
+ var import_jsx_runtime22 = require("react/jsx-runtime");
11889
12532
  function DestinationBreadcrumb({
11890
12533
  pageTitle,
11891
12534
  sectionLabel
11892
12535
  }) {
11893
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex w-full flex-col gap-2", children: [
11894
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-sm font-medium! text-foreground m-0", children: "Destination" }),
11895
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-3", children: [
11896
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
11897
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.File, { size: 16, className: "shrink-0 text-foreground", "aria-hidden": true }),
11898
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
12536
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex w-full flex-col gap-2", children: [
12537
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-sm font-medium! text-foreground m-0", children: "Destination" }),
12538
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-3", children: [
12539
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
12540
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react12.File, { size: 16, className: "shrink-0 text-foreground", "aria-hidden": true }),
12541
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium leading-none text-foreground!", children: pageTitle })
11899
12542
  ] }),
11900
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11901
- import_lucide_react11.ArrowRight,
12543
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
12544
+ import_lucide_react12.ArrowRight,
11902
12545
  {
11903
12546
  size: 16,
11904
12547
  className: "shrink-0 text-muted-foreground",
11905
12548
  "aria-hidden": true
11906
12549
  }
11907
12550
  ),
11908
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
11909
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
11910
- import_lucide_react11.GalleryVertical,
12551
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
12552
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
12553
+ import_lucide_react12.GalleryVertical,
11911
12554
  {
11912
12555
  size: 16,
11913
12556
  className: "shrink-0 text-foreground",
11914
12557
  "aria-hidden": true
11915
12558
  }
11916
12559
  ),
11917
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "truncate text-sm font-medium leading-none text-foreground", children: sectionLabel })
12560
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "truncate text-sm font-medium leading-none text-foreground", children: sectionLabel })
11918
12561
  ] })
11919
12562
  ] })
11920
12563
  ] });
11921
12564
  }
11922
12565
 
11923
12566
  // src/ui/link-modal/SectionTreeItem.tsx
11924
- var import_lucide_react12 = require("lucide-react");
11925
- var import_jsx_runtime22 = require("react/jsx-runtime");
12567
+ var import_lucide_react13 = require("lucide-react");
12568
+ var import_jsx_runtime23 = require("react/jsx-runtime");
11926
12569
  function SectionTreeItem({
11927
12570
  section,
11928
12571
  onSelect,
11929
12572
  selected
11930
12573
  }) {
11931
12574
  const interactive = Boolean(onSelect);
11932
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex h-9 w-full items-end pl-3", children: [
11933
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
12575
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "flex h-9 w-full items-end pl-3", children: [
12576
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
11934
12577
  "div",
11935
12578
  {
11936
12579
  className: "-mr-px h-9 w-2 shrink-0 rounded-bl-sm border-b border-l border-border mb-4",
11937
12580
  "aria-hidden": true
11938
12581
  }
11939
12582
  ),
11940
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
12583
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
11941
12584
  "div",
11942
12585
  {
11943
12586
  role: interactive ? "button" : void 0,
@@ -11955,15 +12598,15 @@ function SectionTreeItem({
11955
12598
  interactive && selected && "border-bridge-primary"
11956
12599
  ),
11957
12600
  children: [
11958
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
11959
- import_lucide_react12.GalleryVertical,
12601
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
12602
+ import_lucide_react13.GalleryVertical,
11960
12603
  {
11961
12604
  size: 16,
11962
12605
  className: "shrink-0 text-foreground",
11963
12606
  "aria-hidden": true
11964
12607
  }
11965
12608
  ),
11966
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "truncate text-sm font-normal leading-5 text-foreground", children: section.label })
12609
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate text-sm font-normal leading-5 text-foreground", children: section.label })
11967
12610
  ]
11968
12611
  }
11969
12612
  )
@@ -11971,14 +12614,14 @@ function SectionTreeItem({
11971
12614
  }
11972
12615
 
11973
12616
  // src/ui/link-modal/UrlOrPageInput.tsx
11974
- var import_react11 = require("react");
12617
+ var import_react12 = require("react");
11975
12618
 
11976
12619
  // src/ui/input.tsx
11977
12620
  var React10 = __toESM(require("react"), 1);
11978
- var import_jsx_runtime23 = require("react/jsx-runtime");
12621
+ var import_jsx_runtime24 = require("react/jsx-runtime");
11979
12622
  var Input = React10.forwardRef(
11980
12623
  ({ className, type, ...props }, ref) => {
11981
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
12624
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
11982
12625
  "input",
11983
12626
  {
11984
12627
  type,
@@ -11997,9 +12640,9 @@ Input.displayName = "Input";
11997
12640
 
11998
12641
  // src/ui/label.tsx
11999
12642
  var import_radix_ui7 = require("radix-ui");
12000
- var import_jsx_runtime24 = require("react/jsx-runtime");
12643
+ var import_jsx_runtime25 = require("react/jsx-runtime");
12001
12644
  function Label({ className, ...props }) {
12002
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
12645
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12003
12646
  import_radix_ui7.Label.Root,
12004
12647
  {
12005
12648
  "data-slot": "label",
@@ -12010,12 +12653,12 @@ function Label({ className, ...props }) {
12010
12653
  }
12011
12654
 
12012
12655
  // src/ui/link-modal/UrlOrPageInput.tsx
12013
- var import_lucide_react13 = require("lucide-react");
12014
- var import_jsx_runtime25 = require("react/jsx-runtime");
12656
+ var import_lucide_react14 = require("lucide-react");
12657
+ var import_jsx_runtime26 = require("react/jsx-runtime");
12015
12658
  function FieldChevron({
12016
12659
  onClick
12017
12660
  }) {
12018
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12661
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12019
12662
  "button",
12020
12663
  {
12021
12664
  type: "button",
@@ -12023,7 +12666,7 @@ function FieldChevron({
12023
12666
  onClick,
12024
12667
  "aria-label": "Open page list",
12025
12668
  tabIndex: -1,
12026
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.ChevronDown, { size: 16 })
12669
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.ChevronDown, { size: 16 })
12027
12670
  }
12028
12671
  );
12029
12672
  }
@@ -12039,11 +12682,11 @@ function UrlOrPageInput({
12039
12682
  readOnly = false,
12040
12683
  urlError
12041
12684
  }) {
12042
- const inputId = (0, import_react11.useId)();
12043
- const inputRef = (0, import_react11.useRef)(null);
12044
- const rootRef = (0, import_react11.useRef)(null);
12045
- const [isFocused, setIsFocused] = (0, import_react11.useState)(false);
12046
- (0, import_react11.useEffect)(() => {
12685
+ const inputId = (0, import_react12.useId)();
12686
+ const inputRef = (0, import_react12.useRef)(null);
12687
+ const rootRef = (0, import_react12.useRef)(null);
12688
+ const [isFocused, setIsFocused] = (0, import_react12.useState)(false);
12689
+ (0, import_react12.useEffect)(() => {
12047
12690
  if (!dropdownOpen) return;
12048
12691
  const isOutside = (e) => {
12049
12692
  const root = rootRef.current;
@@ -12084,19 +12727,19 @@ function UrlOrPageInput({
12084
12727
  "data-ohw-link-field flex h-[36px] w-full items-center overflow-hidden rounded-md border bg-background pl-3 pr-3 py-2 outline-none transition-[border-color,box-shadow]",
12085
12728
  urlError ? "border-destructive shadow-[0_0_0_1px_var(--ohw-destructive)]" : isFocused ? "border-bridge-primary shadow-[0_0_0_1px_var(--ohw-primary)]" : "border-input"
12086
12729
  );
12087
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex w-full flex-col gap-2 p-0", children: [
12088
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Label, { htmlFor: inputId, className: cn(urlError && "text-destructive"), children: "Destination" }),
12089
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { ref: rootRef, className: "relative w-full", children: [
12090
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { "data-ohw-link-field": true, className: fieldClassName, children: [
12091
- selectedPage ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex shrink-0 items-center pr-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12092
- import_lucide_react13.File,
12730
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex w-full flex-col gap-2 p-0", children: [
12731
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { htmlFor: inputId, className: cn(urlError && "text-destructive"), children: "Destination" }),
12732
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { ref: rootRef, className: "relative w-full", children: [
12733
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { "data-ohw-link-field": true, className: fieldClassName, children: [
12734
+ selectedPage ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex shrink-0 items-center pr-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12735
+ import_lucide_react14.File,
12093
12736
  {
12094
12737
  size: 16,
12095
12738
  className: "shrink-0 text-foreground",
12096
12739
  "aria-hidden": true
12097
12740
  }
12098
12741
  ) }) : null,
12099
- readOnly ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm leading-5 text-foreground", children: selectedPage?.title ?? value }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12742
+ readOnly ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm leading-5 text-foreground", children: selectedPage?.title ?? value }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12100
12743
  Input,
12101
12744
  {
12102
12745
  ref: inputRef,
@@ -12122,7 +12765,7 @@ function UrlOrPageInput({
12122
12765
  )
12123
12766
  }
12124
12767
  ),
12125
- selectedPage && !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12768
+ selectedPage && !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12126
12769
  "button",
12127
12770
  {
12128
12771
  type: "button",
@@ -12130,26 +12773,26 @@ function UrlOrPageInput({
12130
12773
  onMouseDown: clearSelection,
12131
12774
  "aria-label": "Clear selected page",
12132
12775
  tabIndex: -1,
12133
- children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.X, { size: 16, "aria-hidden": true })
12776
+ children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.X, { size: 16, "aria-hidden": true })
12134
12777
  }
12135
12778
  ) : null,
12136
- !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(FieldChevron, { onClick: toggleDropdown }) : null
12779
+ !readOnly ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FieldChevron, { onClick: toggleDropdown }) : null
12137
12780
  ] }),
12138
- dropdownOpen && !readOnly && filteredPages.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
12781
+ dropdownOpen && !readOnly && filteredPages.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12139
12782
  "div",
12140
12783
  {
12141
12784
  "data-ohw-link-page-dropdown": "",
12142
12785
  className: "absolute left-0 right-0 top-[calc(100%+4px)] z-50 max-h-48 overflow-auto rounded-lg border border-border bg-popover py-1 shadow-lg",
12143
12786
  onMouseDown: (e) => e.preventDefault(),
12144
- children: filteredPages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
12787
+ children: filteredPages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
12145
12788
  "button",
12146
12789
  {
12147
12790
  type: "button",
12148
12791
  className: "flex h-9 w-full items-center gap-2 border-0 bg-transparent px-3 text-left text-sm leading-5 text-foreground outline-none hover:bg-muted",
12149
12792
  onClick: () => onPageSelect(page),
12150
12793
  children: [
12151
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.File, { size: 16, className: "shrink-0", "aria-hidden": true }),
12152
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "truncate", children: page.title })
12794
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.File, { size: 16, className: "shrink-0", "aria-hidden": true }),
12795
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "truncate", children: page.title })
12153
12796
  ]
12154
12797
  },
12155
12798
  page.path
@@ -12157,34 +12800,34 @@ function UrlOrPageInput({
12157
12800
  }
12158
12801
  ) : null
12159
12802
  ] }),
12160
- urlError ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm font-medium text-destructive", children: urlError }) : null
12803
+ urlError ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm font-medium text-destructive", children: urlError }) : null
12161
12804
  ] });
12162
12805
  }
12163
12806
 
12164
12807
  // src/ui/link-modal/LinkEditorPanel.tsx
12165
- var import_jsx_runtime26 = require("react/jsx-runtime");
12808
+ var import_jsx_runtime27 = require("react/jsx-runtime");
12166
12809
  function LinkEditorPanel({ state, onClose }) {
12167
12810
  const isCancel = state.secondaryLabel === "Cancel" || state.secondaryLabel === "Back to sections";
12168
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
12169
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DialogClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12811
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
12812
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12170
12813
  "button",
12171
12814
  {
12172
12815
  type: "button",
12173
12816
  className: "absolute right-[9px] top-[9px] rounded-sm p-1.5 text-foreground hover:bg-muted/50 h-7",
12174
12817
  "aria-label": "Close",
12175
12818
  onClick: onClose,
12176
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.X, { size: 16, "aria-hidden": true })
12819
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.X, { size: 16, "aria-hidden": true })
12177
12820
  }
12178
12821
  ) }),
12179
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DialogHeader, { className: "w-full gap-1.5 p-6 pr-12", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(DialogTitle, { className: "m-0 w-full break-words", children: state.title }) }),
12180
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex w-full flex-col gap-3 px-6 pb-8 pt-1", children: [
12181
- state.showBreadcrumb && state.selectedPage && state.selectedSection ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12822
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogHeader, { className: "w-full gap-1.5 p-6 pr-12", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DialogTitle, { className: "m-0 w-full break-words", children: state.title }) }),
12823
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex w-full flex-col gap-3 px-6 pb-8 pt-1", children: [
12824
+ state.showBreadcrumb && state.selectedPage && state.selectedSection ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12182
12825
  DestinationBreadcrumb,
12183
12826
  {
12184
12827
  pageTitle: state.selectedPage.title,
12185
12828
  sectionLabel: state.selectedSection.label
12186
12829
  }
12187
- ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12830
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12188
12831
  UrlOrPageInput,
12189
12832
  {
12190
12833
  value: state.searchValue,
@@ -12197,8 +12840,8 @@ function LinkEditorPanel({ state, onClose }) {
12197
12840
  urlError: state.urlError
12198
12841
  }
12199
12842
  ),
12200
- state.showChooseSection ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col justify-center gap-2", children: [
12201
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12843
+ state.showChooseSection ? /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col justify-center gap-2", children: [
12844
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12202
12845
  Button,
12203
12846
  {
12204
12847
  type: "button",
@@ -12209,15 +12852,15 @@ function LinkEditorPanel({ state, onClose }) {
12209
12852
  children: "Choose a section"
12210
12853
  }
12211
12854
  ),
12212
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
12213
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.Info, { size: 16, className: "shrink-0", "aria-hidden": true }),
12214
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Pick a section this link should scroll to." })
12855
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
12856
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Info, { size: 16, className: "shrink-0", "aria-hidden": true }),
12857
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Pick a section this link should scroll to." })
12215
12858
  ] })
12216
12859
  ] }) : null,
12217
- state.showSectionRow && state.selectedSection ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SectionTreeItem, { section: state.selectedSection, selected: true }) : null
12860
+ state.showSectionRow && state.selectedSection ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(SectionTreeItem, { section: state.selectedSection, selected: true }) : null
12218
12861
  ] }),
12219
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(DialogFooter, { className: "w-full px-6 pb-6", children: [
12220
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12862
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(DialogFooter, { className: "w-full px-6 pb-6", children: [
12863
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12221
12864
  Button,
12222
12865
  {
12223
12866
  type: "button",
@@ -12232,7 +12875,7 @@ function LinkEditorPanel({ state, onClose }) {
12232
12875
  children: state.secondaryLabel
12233
12876
  }
12234
12877
  ),
12235
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
12878
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
12236
12879
  Button,
12237
12880
  {
12238
12881
  type: "button",
@@ -12251,9 +12894,9 @@ function LinkEditorPanel({ state, onClose }) {
12251
12894
  }
12252
12895
 
12253
12896
  // src/ui/link-modal/SectionPickerOverlay.tsx
12254
- var import_react12 = require("react");
12897
+ var import_react13 = require("react");
12255
12898
  var import_react_dom3 = require("react-dom");
12256
- var import_lucide_react15 = require("lucide-react");
12899
+ var import_lucide_react16 = require("lucide-react");
12257
12900
  var import_navigation2 = require("next/navigation");
12258
12901
 
12259
12902
  // src/lib/parent-scroll.ts
@@ -12275,7 +12918,7 @@ function getIframeChromeClip(parentScroll) {
12275
12918
  }
12276
12919
 
12277
12920
  // src/ui/link-modal/SectionPickerOverlay.tsx
12278
- var import_jsx_runtime27 = require("react/jsx-runtime");
12921
+ var import_jsx_runtime28 = require("react/jsx-runtime");
12279
12922
  var DIM_OVERLAY = "rgba(0, 0, 0, 0.45)";
12280
12923
  function rectsEqual(a, b) {
12281
12924
  if (a.size !== b.size) return false;
@@ -12308,12 +12951,12 @@ function hitTestSectionId(x, y, sectionIds, rects) {
12308
12951
  return null;
12309
12952
  }
12310
12953
  function useSectionRects(sectionIdsKey, enabled) {
12311
- const [rects, setRects] = (0, import_react12.useState)(/* @__PURE__ */ new Map());
12312
- const sectionIds = (0, import_react12.useMemo)(
12954
+ const [rects, setRects] = (0, import_react13.useState)(/* @__PURE__ */ new Map());
12955
+ const sectionIds = (0, import_react13.useMemo)(
12313
12956
  () => sectionIdsKey ? sectionIdsKey.split("\0") : [],
12314
12957
  [sectionIdsKey]
12315
12958
  );
12316
- (0, import_react12.useEffect)(() => {
12959
+ (0, import_react13.useEffect)(() => {
12317
12960
  if (!enabled || sectionIds.length === 0) {
12318
12961
  setRects((prev) => prev.size === 0 ? prev : /* @__PURE__ */ new Map());
12319
12962
  return;
@@ -12354,13 +12997,13 @@ function SectionPickerOverlay({
12354
12997
  }) {
12355
12998
  const router = (0, import_navigation2.useRouter)();
12356
12999
  const pathname = (0, import_navigation2.usePathname)();
12357
- const [selectedId, setSelectedId] = (0, import_react12.useState)(null);
12358
- const [hoveredId, setHoveredId] = (0, import_react12.useState)(null);
12359
- const pointerRef = (0, import_react12.useRef)(null);
12360
- const pointerScreenRef = (0, import_react12.useRef)(null);
12361
- const iframeOffsetTopRef = (0, import_react12.useRef)(null);
12362
- const sectionIdsRef = (0, import_react12.useRef)([]);
12363
- const [chromeClip, setChromeClip] = (0, import_react12.useState)(
13000
+ const [selectedId, setSelectedId] = (0, import_react13.useState)(null);
13001
+ const [hoveredId, setHoveredId] = (0, import_react13.useState)(null);
13002
+ const pointerRef = (0, import_react13.useRef)(null);
13003
+ const pointerScreenRef = (0, import_react13.useRef)(null);
13004
+ const iframeOffsetTopRef = (0, import_react13.useRef)(null);
13005
+ const sectionIdsRef = (0, import_react13.useRef)([]);
13006
+ const [chromeClip, setChromeClip] = (0, import_react13.useState)(
12364
13007
  () => ({
12365
13008
  top: 0,
12366
13009
  bottom: typeof window !== "undefined" ? window.innerHeight : 0
@@ -12368,12 +13011,12 @@ function SectionPickerOverlay({
12368
13011
  );
12369
13012
  const normalizedTarget = normalizePath(pagePath);
12370
13013
  const isOnTargetPage = normalizePath(pathname) === normalizedTarget;
12371
- (0, import_react12.useEffect)(() => {
13014
+ (0, import_react13.useEffect)(() => {
12372
13015
  if (isOnTargetPage) return;
12373
13016
  const search = readPreservedSearch();
12374
13017
  router.push(`${normalizedTarget}${search}`);
12375
13018
  }, [isOnTargetPage, normalizedTarget, router]);
12376
- (0, import_react12.useEffect)(() => {
13019
+ (0, import_react13.useEffect)(() => {
12377
13020
  document.documentElement.setAttribute("data-ohw-section-picking", "");
12378
13021
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => {
12379
13022
  el.removeAttribute("data-ohw-hovered");
@@ -12385,24 +13028,24 @@ function SectionPickerOverlay({
12385
13028
  document.documentElement.removeAttribute("data-ohw-section-picking");
12386
13029
  };
12387
13030
  }, []);
12388
- const liveSections = (0, import_react12.useMemo)(() => {
13031
+ const liveSections = (0, import_react13.useMemo)(() => {
12389
13032
  if (!isOnTargetPage) return sections;
12390
13033
  const live = collectSectionsFromDom();
12391
13034
  if (live.length === 0) return sections;
12392
13035
  const labels = new Map(sections.map((s) => [s.id, s.label]));
12393
13036
  return live.map((s) => ({ id: s.id, label: labels.get(s.id) ?? s.label }));
12394
13037
  }, [isOnTargetPage, sections, pathname]);
12395
- const sectionIdsKey = (0, import_react12.useMemo)(
13038
+ const sectionIdsKey = (0, import_react13.useMemo)(
12396
13039
  () => liveSections.map((s) => s.id).join("\0"),
12397
13040
  [liveSections]
12398
13041
  );
12399
- const sectionIds = (0, import_react12.useMemo)(
13042
+ const sectionIds = (0, import_react13.useMemo)(
12400
13043
  () => liveSections.map((s) => s.id),
12401
13044
  [liveSections]
12402
13045
  );
12403
13046
  sectionIdsRef.current = sectionIds;
12404
13047
  const rects = useSectionRects(sectionIdsKey, isOnTargetPage);
12405
- const applyHoverAt = (0, import_react12.useCallback)(
13048
+ const applyHoverAt = (0, import_react13.useCallback)(
12406
13049
  (x, y, liveRects) => {
12407
13050
  const ids = sectionIdsRef.current;
12408
13051
  const map = liveRects ?? readSectionRects(ids);
@@ -12411,7 +13054,7 @@ function SectionPickerOverlay({
12411
13054
  },
12412
13055
  []
12413
13056
  );
12414
- (0, import_react12.useEffect)(() => {
13057
+ (0, import_react13.useEffect)(() => {
12415
13058
  const applyClip = (iframeOffsetTop, visibleCanvasTop, canvasH, promptBarH = 0) => {
12416
13059
  const next = getIframeVisibleClip({
12417
13060
  iframeOffsetTop,
@@ -12455,12 +13098,12 @@ function SectionPickerOverlay({
12455
13098
  window.removeEventListener("resize", onResize);
12456
13099
  };
12457
13100
  }, [applyHoverAt]);
12458
- (0, import_react12.useEffect)(() => {
13101
+ (0, import_react13.useEffect)(() => {
12459
13102
  const ptr = pointerRef.current;
12460
13103
  if (!ptr) return;
12461
13104
  applyHoverAt(ptr.x, ptr.y, rects);
12462
13105
  }, [rects, applyHoverAt]);
12463
- (0, import_react12.useEffect)(() => {
13106
+ (0, import_react13.useEffect)(() => {
12464
13107
  const rememberPointer = (clientX, clientY) => {
12465
13108
  pointerRef.current = { x: clientX, y: clientY };
12466
13109
  const top = iframeOffsetTopRef.current;
@@ -12484,7 +13127,7 @@ function SectionPickerOverlay({
12484
13127
  window.removeEventListener("message", onPointerSync);
12485
13128
  };
12486
13129
  }, [rects, applyHoverAt]);
12487
- const handleSelect = (0, import_react12.useCallback)(
13130
+ const handleSelect = (0, import_react13.useCallback)(
12488
13131
  (section) => {
12489
13132
  if (selectedId) return;
12490
13133
  setSelectedId(section.id);
@@ -12492,7 +13135,7 @@ function SectionPickerOverlay({
12492
13135
  },
12493
13136
  [selectedId, onSelect]
12494
13137
  );
12495
- (0, import_react12.useEffect)(() => {
13138
+ (0, import_react13.useEffect)(() => {
12496
13139
  const onKeyDown = (e) => {
12497
13140
  if (e.key === "Escape") {
12498
13141
  e.preventDefault();
@@ -12506,7 +13149,7 @@ function SectionPickerOverlay({
12506
13149
  const portalRoot = typeof document !== "undefined" ? document.querySelector("[data-ohw-bridge-root]") ?? document.body : null;
12507
13150
  if (!portalRoot) return null;
12508
13151
  return (0, import_react_dom3.createPortal)(
12509
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
13152
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
12510
13153
  "div",
12511
13154
  {
12512
13155
  "data-ohw-section-picker": "",
@@ -12516,12 +13159,12 @@ function SectionPickerOverlay({
12516
13159
  role: "dialog",
12517
13160
  "aria-label": "Choose a section",
12518
13161
  children: [
12519
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13162
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12520
13163
  "div",
12521
13164
  {
12522
13165
  className: "pointer-events-auto fixed left-5 z-[2]",
12523
13166
  style: { top: chromeClip.top + 20 },
12524
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
13167
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
12525
13168
  Button,
12526
13169
  {
12527
13170
  type: "button",
@@ -12530,14 +13173,14 @@ function SectionPickerOverlay({
12530
13173
  className: "h-8 min-w-0 gap-1 border-border bg-background px-2 py-1.5 shadow-sm hover:bg-muted cursor-pointer",
12531
13174
  onClick: onBack,
12532
13175
  children: [
12533
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.ArrowLeft, { className: "size-4 shrink-0", "aria-hidden": true }),
13176
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.ArrowLeft, { className: "size-4 shrink-0", "aria-hidden": true }),
12534
13177
  "Back"
12535
13178
  ]
12536
13179
  }
12537
13180
  )
12538
13181
  }
12539
13182
  ),
12540
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13183
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12541
13184
  "div",
12542
13185
  {
12543
13186
  className: "pointer-events-none fixed left-1/2 z-[2] rounded-lg px-4 py-3 text-xs leading-4 tracking-[0.18px] text-white shadow-md",
@@ -12550,7 +13193,7 @@ function SectionPickerOverlay({
12550
13193
  children: "Click on section to select"
12551
13194
  }
12552
13195
  ),
12553
- !isOnTargetPage ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13196
+ !isOnTargetPage ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12554
13197
  "div",
12555
13198
  {
12556
13199
  className: "pointer-events-none fixed left-1/2 z-[1] -translate-x-1/2 rounded-md px-3 py-2 text-sm text-muted-foreground shadow-sm",
@@ -12558,14 +13201,14 @@ function SectionPickerOverlay({
12558
13201
  children: "Loading page preview\u2026"
12559
13202
  }
12560
13203
  ) : null,
12561
- isOnTargetPage && liveSections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "pointer-events-auto fixed inset-0 z-[1] flex items-center justify-center bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-sm text-muted-foreground", children: "No sections found on this page." }) }) : null,
13204
+ isOnTargetPage && liveSections.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pointer-events-auto fixed inset-0 z-[1] flex items-center justify-center bg-muted/40", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-sm text-muted-foreground", children: "No sections found on this page." }) }) : null,
12562
13205
  isOnTargetPage ? liveSections.map((section) => {
12563
13206
  const rect = rects.get(section.id);
12564
13207
  if (!rect || rect.width <= 0 || rect.height <= 0) return null;
12565
13208
  const isSelected = selectedId === section.id;
12566
13209
  const isHovered = hoveredId === section.id;
12567
13210
  const isLit = isSelected || isHovered;
12568
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
13211
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
12569
13212
  "button",
12570
13213
  {
12571
13214
  type: "button",
@@ -12580,7 +13223,7 @@ function SectionPickerOverlay({
12580
13223
  "aria-label": `Select section ${section.label}`,
12581
13224
  onClick: () => handleSelect(section),
12582
13225
  children: [
12583
- isLit ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13226
+ isLit ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12584
13227
  "span",
12585
13228
  {
12586
13229
  className: "pointer-events-none absolute",
@@ -12593,13 +13236,13 @@ function SectionPickerOverlay({
12593
13236
  "aria-hidden": true
12594
13237
  }
12595
13238
  ) : null,
12596
- isSelected ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13239
+ isSelected ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
12597
13240
  "span",
12598
13241
  {
12599
13242
  className: "absolute right-3 top-3 flex size-8 items-center justify-center rounded-full text-white",
12600
13243
  style: { backgroundColor: "var(--ohw-primary, #0885fe)" },
12601
13244
  "aria-hidden": true,
12602
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Check, { className: "size-5" })
13245
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Check, { className: "size-5" })
12603
13246
  }
12604
13247
  ) : null
12605
13248
  ]
@@ -12615,7 +13258,7 @@ function SectionPickerOverlay({
12615
13258
  }
12616
13259
 
12617
13260
  // src/ui/link-modal/useLinkModalState.ts
12618
- var import_react13 = require("react");
13261
+ var import_react14 = require("react");
12619
13262
  function useLinkModalState({
12620
13263
  open,
12621
13264
  mode,
@@ -12627,14 +13270,14 @@ function useLinkModalState({
12627
13270
  onClose,
12628
13271
  onSubmit
12629
13272
  }) {
12630
- const availablePages = (0, import_react13.useMemo)(() => pages, [pages]);
12631
- const [searchValue, setSearchValue] = (0, import_react13.useState)("");
12632
- const [selectedPage, setSelectedPage] = (0, import_react13.useState)(null);
12633
- const [selectedSection, setSelectedSection] = (0, import_react13.useState)(null);
12634
- const [step, setStep] = (0, import_react13.useState)("input");
12635
- const [dropdownOpen, setDropdownOpen] = (0, import_react13.useState)(false);
12636
- const [urlError, setUrlError] = (0, import_react13.useState)("");
12637
- const reset = (0, import_react13.useCallback)(() => {
13273
+ const availablePages = (0, import_react14.useMemo)(() => pages, [pages]);
13274
+ const [searchValue, setSearchValue] = (0, import_react14.useState)("");
13275
+ const [selectedPage, setSelectedPage] = (0, import_react14.useState)(null);
13276
+ const [selectedSection, setSelectedSection] = (0, import_react14.useState)(null);
13277
+ const [step, setStep] = (0, import_react14.useState)("input");
13278
+ const [dropdownOpen, setDropdownOpen] = (0, import_react14.useState)(false);
13279
+ const [urlError, setUrlError] = (0, import_react14.useState)("");
13280
+ const reset = (0, import_react14.useCallback)(() => {
12638
13281
  setSearchValue("");
12639
13282
  setSelectedPage(null);
12640
13283
  setSelectedSection(null);
@@ -12642,7 +13285,7 @@ function useLinkModalState({
12642
13285
  setDropdownOpen(false);
12643
13286
  setUrlError("");
12644
13287
  }, []);
12645
- (0, import_react13.useEffect)(() => {
13288
+ (0, import_react14.useEffect)(() => {
12646
13289
  if (!open) return;
12647
13290
  if (mode === "edit" && initialTarget) {
12648
13291
  const { pageRoute } = parseTarget(initialTarget);
@@ -12658,11 +13301,11 @@ function useLinkModalState({
12658
13301
  setDropdownOpen(false);
12659
13302
  setUrlError("");
12660
13303
  }, [open, mode, initialTarget, reset]);
12661
- const filteredPages = (0, import_react13.useMemo)(() => {
13304
+ const filteredPages = (0, import_react14.useMemo)(() => {
12662
13305
  if (!searchValue.trim()) return availablePages;
12663
13306
  return availablePages.filter((p) => p.title.toLowerCase().startsWith(searchValue.toLowerCase()));
12664
13307
  }, [availablePages, searchValue]);
12665
- const activeSections = (0, import_react13.useMemo)(() => {
13308
+ const activeSections = (0, import_react14.useMemo)(() => {
12666
13309
  if (!selectedPage) return [];
12667
13310
  return getSectionsForPath(sectionsByPath, selectedPage.path);
12668
13311
  }, [selectedPage, sectionsByPath]);
@@ -12711,7 +13354,7 @@ function useLinkModalState({
12711
13354
  reset();
12712
13355
  onClose();
12713
13356
  };
12714
- const isValid = (0, import_react13.useMemo)(() => {
13357
+ const isValid = (0, import_react14.useMemo)(() => {
12715
13358
  if (urlError) return false;
12716
13359
  if (showBreadcrumb) return true;
12717
13360
  if (selectedPage) return true;
@@ -12779,7 +13422,7 @@ function useLinkModalState({
12779
13422
  }
12780
13423
 
12781
13424
  // src/ui/link-modal/LinkPopover.tsx
12782
- var import_jsx_runtime28 = require("react/jsx-runtime");
13425
+ var import_jsx_runtime29 = require("react/jsx-runtime");
12783
13426
  function postToParent(data) {
12784
13427
  window.parent?.postMessage(data, "*");
12785
13428
  }
@@ -12808,7 +13451,7 @@ function LinkPopover({
12808
13451
  onSubmit
12809
13452
  });
12810
13453
  const sectionPickerActive = state.showSectionPicker && Boolean(state.selectedPage);
12811
- (0, import_react14.useEffect)(() => {
13454
+ (0, import_react15.useEffect)(() => {
12812
13455
  if (!open) return;
12813
13456
  if (sectionPickerActive) {
12814
13457
  postToParent({ type: "ui:unlock" });
@@ -12875,15 +13518,15 @@ function LinkPopover({
12875
13518
  );
12876
13519
  };
12877
13520
  }, [open, sectionPickerActive]);
12878
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
12879
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13521
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
13522
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
12880
13523
  Dialog2,
12881
13524
  {
12882
13525
  open: open && !sectionPickerActive,
12883
13526
  onOpenChange: (next) => {
12884
13527
  if (!next) onClose?.();
12885
13528
  },
12886
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13529
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
12887
13530
  DialogContent,
12888
13531
  {
12889
13532
  ref: panelRef,
@@ -12893,12 +13536,12 @@ function LinkPopover({
12893
13536
  "data-ohw-bridge": "",
12894
13537
  showCloseButton: false,
12895
13538
  className: "gap-0 p-0 w-full max-w-[448px] pointer-events-auto z-[2147483646] overflow-visible",
12896
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(LinkEditorPanel, { state, onClose })
13539
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LinkEditorPanel, { state, onClose })
12897
13540
  }
12898
13541
  )
12899
13542
  }
12900
13543
  ),
12901
- sectionPickerActive && state.selectedPage ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13544
+ sectionPickerActive && state.selectedPage ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
12902
13545
  SectionPickerOverlay,
12903
13546
  {
12904
13547
  pagePath: state.selectedPage.path,
@@ -16020,6 +16663,7 @@ function readLogoSizeState(content, placement) {
16020
16663
  function getLogoElement(el) {
16021
16664
  const marked = el.closest('[data-ohw-role="logo"], [data-ohw-logo]');
16022
16665
  if (marked) return marked;
16666
+ if (el.closest('[data-ohw-editable="icon"]')) return null;
16023
16667
  const root = el.closest("nav, [data-ohw-nav-root], footer");
16024
16668
  if (!root) return null;
16025
16669
  const anchor = el.closest("a");
@@ -16086,9 +16730,9 @@ function addFooterColumnWithPersist({
16086
16730
  }
16087
16731
 
16088
16732
  // src/ui/FloatingPanel.tsx
16089
- var import_react15 = require("react");
16090
- var import_lucide_react16 = require("lucide-react");
16091
- var import_jsx_runtime29 = require("react/jsx-runtime");
16733
+ var import_react16 = require("react");
16734
+ var import_lucide_react17 = require("lucide-react");
16735
+ var import_jsx_runtime30 = require("react/jsx-runtime");
16092
16736
  var PANEL_WIDTH = 256;
16093
16737
  var EDGE_MARGIN = 16;
16094
16738
  var HEADER_MIN = 56;
@@ -16148,10 +16792,10 @@ function FloatingPanel({
16148
16792
  className,
16149
16793
  bodyClassName
16150
16794
  }) {
16151
- const panelRef = (0, import_react15.useRef)(null);
16152
- const [measured, setMeasured] = (0, import_react15.useState)({ w: PANEL_WIDTH, h: 280 });
16153
- const dragRef = (0, import_react15.useRef)(null);
16154
- const homeRef = (0, import_react15.useRef)(null);
16795
+ const panelRef = (0, import_react16.useRef)(null);
16796
+ const [measured, setMeasured] = (0, import_react16.useState)({ w: PANEL_WIDTH, h: 280 });
16797
+ const dragRef = (0, import_react16.useRef)(null);
16798
+ const homeRef = (0, import_react16.useRef)(null);
16155
16799
  if (!open) {
16156
16800
  homeRef.current = null;
16157
16801
  } else if (position) {
@@ -16159,17 +16803,17 @@ function FloatingPanel({
16159
16803
  } else if (homeRef.current == null) {
16160
16804
  homeRef.current = defaultFloatingPanelPosition(parentScroll);
16161
16805
  }
16162
- const [liveScroll, setLiveScroll] = (0, import_react15.useState)(parentScroll);
16806
+ const [liveScroll, setLiveScroll] = (0, import_react16.useState)(parentScroll);
16163
16807
  const home = position ?? homeRef.current ?? defaultFloatingPanelPosition(parentScroll);
16164
16808
  const { y: fittedY, maxHeight } = fitPanelInClip(home.y, liveScroll, measured.h);
16165
16809
  const clamped = {
16166
16810
  x: clampX(home.x, measured.w),
16167
16811
  y: fittedY
16168
16812
  };
16169
- (0, import_react15.useEffect)(() => {
16813
+ (0, import_react16.useEffect)(() => {
16170
16814
  setLiveScroll(parentScroll);
16171
16815
  }, [parentScroll]);
16172
- (0, import_react15.useEffect)(() => {
16816
+ (0, import_react16.useEffect)(() => {
16173
16817
  if (!open) return;
16174
16818
  const onParentScroll = (e) => {
16175
16819
  if (e.data?.type !== "ow:parent-scroll") return;
@@ -16179,8 +16823,8 @@ function FloatingPanel({
16179
16823
  window.addEventListener("message", onParentScroll);
16180
16824
  return () => window.removeEventListener("message", onParentScroll);
16181
16825
  }, [open]);
16182
- const positionRef = (0, import_react15.useRef)(position);
16183
- (0, import_react15.useLayoutEffect)(() => {
16826
+ const positionRef = (0, import_react16.useRef)(position);
16827
+ (0, import_react16.useLayoutEffect)(() => {
16184
16828
  if (!open) {
16185
16829
  positionRef.current = position;
16186
16830
  return;
@@ -16190,7 +16834,7 @@ function FloatingPanel({
16190
16834
  }
16191
16835
  positionRef.current = position;
16192
16836
  }, [open, position, liveScroll, parentScroll]);
16193
- (0, import_react15.useLayoutEffect)(() => {
16837
+ (0, import_react16.useLayoutEffect)(() => {
16194
16838
  if (!open || !panelRef.current) return;
16195
16839
  const el = panelRef.current;
16196
16840
  const header = el.querySelector("[data-ohw-floating-panel-header]");
@@ -16199,7 +16843,7 @@ function FloatingPanel({
16199
16843
  const next = { w: el.offsetWidth || PANEL_WIDTH, h: contentH };
16200
16844
  setMeasured((prev) => prev.w === next.w && prev.h === next.h ? prev : next);
16201
16845
  }, [open, children, title, context]);
16202
- const onHeaderPointerDown = (0, import_react15.useCallback)(
16846
+ const onHeaderPointerDown = (0, import_react16.useCallback)(
16203
16847
  (e) => {
16204
16848
  if (e.button !== 0) return;
16205
16849
  if (e.target.closest("[data-ohw-floating-panel-close]")) return;
@@ -16218,7 +16862,7 @@ function FloatingPanel({
16218
16862
  },
16219
16863
  [clamped.x, clamped.y]
16220
16864
  );
16221
- const onHeaderPointerMove = (0, import_react15.useCallback)(
16865
+ const onHeaderPointerMove = (0, import_react16.useCallback)(
16222
16866
  (e) => {
16223
16867
  const drag = dragRef.current;
16224
16868
  if (!drag || drag.pointerId !== e.pointerId) return;
@@ -16244,7 +16888,7 @@ function FloatingPanel({
16244
16888
  },
16245
16889
  [measured.w, onPositionChange, liveScroll]
16246
16890
  );
16247
- const endDrag = (0, import_react15.useCallback)((e) => {
16891
+ const endDrag = (0, import_react16.useCallback)((e) => {
16248
16892
  const drag = dragRef.current;
16249
16893
  if (!drag || drag.pointerId !== e.pointerId) return;
16250
16894
  dragRef.current = null;
@@ -16254,13 +16898,13 @@ function FloatingPanel({
16254
16898
  } catch {
16255
16899
  }
16256
16900
  }, []);
16257
- (0, import_react15.useEffect)(() => {
16901
+ (0, import_react16.useEffect)(() => {
16258
16902
  if (open) return;
16259
16903
  document.documentElement.removeAttribute("data-ohw-panel-dragging");
16260
16904
  }, [open]);
16261
- (0, import_react15.useEffect)(() => () => document.documentElement.removeAttribute("data-ohw-panel-dragging"), []);
16905
+ (0, import_react16.useEffect)(() => () => document.documentElement.removeAttribute("data-ohw-panel-dragging"), []);
16262
16906
  if (!open) return null;
16263
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
16907
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
16264
16908
  "div",
16265
16909
  {
16266
16910
  ref: panelRef,
@@ -16277,7 +16921,7 @@ function FloatingPanel({
16277
16921
  onPointerDown: (e) => e.stopPropagation(),
16278
16922
  onClick: (e) => e.stopPropagation(),
16279
16923
  children: [
16280
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
16924
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
16281
16925
  "div",
16282
16926
  {
16283
16927
  "data-ohw-floating-panel-header": "",
@@ -16287,14 +16931,14 @@ function FloatingPanel({
16287
16931
  onPointerUp: endDrag,
16288
16932
  onPointerCancel: endDrag,
16289
16933
  children: [
16290
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
16291
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-2", children: [
16292
- icon ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "shrink-0 text-foreground", children: icon }) : null,
16293
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
16934
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
16935
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex items-center gap-2", children: [
16936
+ icon ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "shrink-0 text-foreground", children: icon }) : null,
16937
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "min-w-0 flex-1 text-lg font-semibold leading-7 text-foreground", children: title })
16294
16938
  ] }),
16295
- context ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
16939
+ context ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "w-full text-sm leading-5 text-muted-foreground", children: context }) : null
16296
16940
  ] }),
16297
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
16941
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
16298
16942
  "button",
16299
16943
  {
16300
16944
  type: "button",
@@ -16306,13 +16950,13 @@ function FloatingPanel({
16306
16950
  onClose();
16307
16951
  },
16308
16952
  onPointerDown: (e) => e.stopPropagation(),
16309
- children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react16.X, { size: 16, "aria-hidden": true })
16953
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react17.X, { size: 16, "aria-hidden": true })
16310
16954
  }
16311
16955
  )
16312
16956
  ]
16313
16957
  }
16314
16958
  ),
16315
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
16959
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
16316
16960
  "div",
16317
16961
  {
16318
16962
  "data-ohw-floating-panel-body": "",
@@ -16330,15 +16974,15 @@ function FloatingPanel({
16330
16974
  }
16331
16975
 
16332
16976
  // src/ui/socials-display-panel.tsx
16333
- var import_jsx_runtime30 = require("react/jsx-runtime");
16977
+ var import_jsx_runtime31 = require("react/jsx-runtime");
16334
16978
  function DisplaySwitch({
16335
16979
  label,
16336
16980
  checked,
16337
16981
  disabled,
16338
16982
  onChange
16339
16983
  }) {
16340
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex w-full items-center gap-2", children: [
16341
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
16984
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex w-full items-center gap-2", children: [
16985
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16342
16986
  "span",
16343
16987
  {
16344
16988
  className: cn(
@@ -16348,7 +16992,7 @@ function DisplaySwitch({
16348
16992
  children: label
16349
16993
  }
16350
16994
  ),
16351
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
16995
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16352
16996
  "button",
16353
16997
  {
16354
16998
  type: "button",
@@ -16362,7 +17006,7 @@ function DisplaySwitch({
16362
17006
  checked ? "bg-bridge-primary" : "bg-primary-50",
16363
17007
  disabled ? "cursor-default opacity-50" : "cursor-pointer"
16364
17008
  ),
16365
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17009
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16366
17010
  "span",
16367
17011
  {
16368
17012
  className: cn(
@@ -16376,8 +17020,8 @@ function DisplaySwitch({
16376
17020
  ] });
16377
17021
  }
16378
17022
  function SocialsDisplayPanel({ display, onChange, className }) {
16379
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: cn("flex w-full flex-col gap-3", className), children: [
16380
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17023
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: cn("flex w-full flex-col gap-3", className), children: [
17024
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16381
17025
  DisplaySwitch,
16382
17026
  {
16383
17027
  label: "Text",
@@ -16386,7 +17030,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
16386
17030
  onChange: (text) => onChange({ ...display, text })
16387
17031
  }
16388
17032
  ),
16389
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17033
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
16390
17034
  DisplaySwitch,
16391
17035
  {
16392
17036
  label: "Icon",
@@ -16399,7 +17043,7 @@ function SocialsDisplayPanel({ display, onChange, className }) {
16399
17043
  }
16400
17044
 
16401
17045
  // src/ui/button-style-panel.tsx
16402
- var import_lucide_react17 = require("lucide-react");
17046
+ var import_lucide_react18 = require("lucide-react");
16403
17047
 
16404
17048
  // src/lib/button-styles.ts
16405
17049
  var BUTTON_VARIANTS_KEY = "__ohw_button_variants";
@@ -17102,7 +17746,7 @@ function withAssignment(content, id, assignment) {
17102
17746
  }
17103
17747
 
17104
17748
  // src/ui/button-style-panel.tsx
17105
- var import_jsx_runtime31 = require("react/jsx-runtime");
17749
+ var import_jsx_runtime32 = require("react/jsx-runtime");
17106
17750
  var SIZE_LABEL = { s: "S", m: "M", l: "L" };
17107
17751
  function ButtonStylePanel({
17108
17752
  variants,
@@ -17116,15 +17760,15 @@ function ButtonStylePanel({
17116
17760
  }) {
17117
17761
  const preview = scaleGeometry(sizes.m, 0.75);
17118
17762
  const label = previewLabel.trim() || "Book Now";
17119
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex w-full flex-col gap-5", children: [
17120
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "flex w-full flex-col gap-2.5", children: [
17121
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { className: "text-xs font-semibold uppercase leading-4 tracking-[0.6px] text-stone-500 font-sans", children: "Variants" }),
17122
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex w-full flex-col gap-2.5", children: BUTTON_VARIANT_IDS.map((id) => {
17763
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex w-full flex-col gap-5", children: [
17764
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("section", { className: "flex w-full flex-col gap-2.5", children: [
17765
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "text-xs font-semibold uppercase leading-4 tracking-[0.6px] text-stone-500 font-sans", children: "Variants" }),
17766
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex w-full flex-col gap-2.5", children: BUTTON_VARIANT_IDS.map((id) => {
17123
17767
  const chrome = variants[id];
17124
17768
  const selected = id === variant;
17125
17769
  const hasBorder = parseFloat(chrome.borderWidth) > 0;
17126
17770
  const cardSlot = previewSlotForChrome(chrome, slotBackground);
17127
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
17771
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
17128
17772
  "button",
17129
17773
  {
17130
17774
  type: "button",
@@ -17140,12 +17784,12 @@ function ButtonStylePanel({
17140
17784
  selected ? "border-2 border-primary" : "border border-border"
17141
17785
  ),
17142
17786
  children: [
17143
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17787
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17144
17788
  "div",
17145
17789
  {
17146
17790
  className: "flex w-full items-center justify-center py-4",
17147
17791
  style: { background: cardSlot },
17148
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17792
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17149
17793
  "span",
17150
17794
  {
17151
17795
  className: "inline-flex items-center justify-center whitespace-nowrap font-semibold uppercase leading-none",
@@ -17167,12 +17811,12 @@ function ButtonStylePanel({
17167
17811
  )
17168
17812
  }
17169
17813
  ),
17170
- selected ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17814
+ selected ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17171
17815
  "span",
17172
17816
  {
17173
17817
  className: "absolute right-0.5 top-0.5 flex size-5 items-center justify-center rounded-full bg-primary text-primary-foreground",
17174
17818
  "aria-hidden": true,
17175
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react17.Check, { className: "size-3", strokeWidth: 3 })
17819
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.Check, { className: "size-3", strokeWidth: 3 })
17176
17820
  }
17177
17821
  ) : null
17178
17822
  ]
@@ -17181,9 +17825,9 @@ function ButtonStylePanel({
17181
17825
  );
17182
17826
  }) })
17183
17827
  ] }),
17184
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("section", { className: "flex w-full flex-col gap-2.5", children: [
17185
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { className: "text-xs font-semibold uppercase leading-4 tracking-[0.6px] text-stone-500 font-sans", children: "Size" }),
17186
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17828
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("section", { className: "flex w-full flex-col gap-2.5", children: [
17829
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "text-xs font-semibold uppercase leading-4 tracking-[0.6px] text-stone-500 font-sans", children: "Size" }),
17830
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17187
17831
  "div",
17188
17832
  {
17189
17833
  className: "flex w-full items-start rounded-lg bg-stone-100 p-1",
@@ -17191,7 +17835,7 @@ function ButtonStylePanel({
17191
17835
  "aria-label": "Size",
17192
17836
  children: BUTTON_SIZE_IDS.map((id) => {
17193
17837
  const selected = id === size;
17194
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17838
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17195
17839
  "button",
17196
17840
  {
17197
17841
  type: "button",
@@ -18095,7 +18739,7 @@ function hitTestNavDropSlot(clientX, clientY, draggedHrefKey, draggedEl) {
18095
18739
  }
18096
18740
 
18097
18741
  // src/useNavItemDrag.ts
18098
- var import_react16 = require("react");
18742
+ var import_react17 = require("react");
18099
18743
  function useNavItemDrag({
18100
18744
  isEditMode,
18101
18745
  editContentRef,
@@ -18119,11 +18763,11 @@ function useNavItemDrag({
18119
18763
  getNavigationItemAnchor: getNavigationItemAnchor2,
18120
18764
  isDragHandleDisabled: isDragHandleDisabled2
18121
18765
  }) {
18122
- const navDragRef = (0, import_react16.useRef)(null);
18123
- const [navDropSlots, setNavDropSlots] = (0, import_react16.useState)([]);
18124
- const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react16.useState)(null);
18125
- const navPointerDragRef = (0, import_react16.useRef)(null);
18126
- const clearNavDragVisuals = (0, import_react16.useCallback)(() => {
18766
+ const navDragRef = (0, import_react17.useRef)(null);
18767
+ const [navDropSlots, setNavDropSlots] = (0, import_react17.useState)([]);
18768
+ const [activeNavDropIndex, setActiveNavDropIndex] = (0, import_react17.useState)(null);
18769
+ const navPointerDragRef = (0, import_react17.useRef)(null);
18770
+ const clearNavDragVisuals = (0, import_react17.useCallback)(() => {
18127
18771
  const session = navDragRef.current;
18128
18772
  const nestedHrefKey = session?.draggedEl?.closest("[data-ohw-nav-children]") != null ? session.hrefKey : null;
18129
18773
  navDragRef.current = null;
@@ -18156,7 +18800,7 @@ function useNavItemDrag({
18156
18800
  document.documentElement.removeAttribute("data-ohw-nav-dragging-root");
18157
18801
  unlockItemDragInteraction();
18158
18802
  }, [setDraggedItemRect, setIsItemDragging, setSiblingHintRects]);
18159
- const refreshNavDragVisuals = (0, import_react16.useCallback)(
18803
+ const refreshNavDragVisuals = (0, import_react17.useCallback)(
18160
18804
  (session, activeSlot, clientX, clientY) => {
18161
18805
  setDraggedItemRect(session.draggedEl.getBoundingClientRect());
18162
18806
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -18174,13 +18818,13 @@ function useNavItemDrag({
18174
18818
  },
18175
18819
  [setDraggedItemRect, setSiblingHintRects]
18176
18820
  );
18177
- const refreshNavDragVisualsRef = (0, import_react16.useRef)(refreshNavDragVisuals);
18821
+ const refreshNavDragVisualsRef = (0, import_react17.useRef)(refreshNavDragVisuals);
18178
18822
  refreshNavDragVisualsRef.current = refreshNavDragVisuals;
18179
- const commitNavDragRef = (0, import_react16.useRef)(() => {
18823
+ const commitNavDragRef = (0, import_react17.useRef)(() => {
18180
18824
  });
18181
- const beginNavDragRef = (0, import_react16.useRef)(() => {
18825
+ const beginNavDragRef = (0, import_react17.useRef)(() => {
18182
18826
  });
18183
- const beginNavDrag = (0, import_react16.useCallback)(
18827
+ const beginNavDrag = (0, import_react17.useCallback)(
18184
18828
  (session) => {
18185
18829
  const rect = session.draggedEl.getBoundingClientRect();
18186
18830
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -18219,7 +18863,7 @@ function useNavItemDrag({
18219
18863
  ]
18220
18864
  );
18221
18865
  beginNavDragRef.current = beginNavDrag;
18222
- const commitNavDrag = (0, import_react16.useCallback)(
18866
+ const commitNavDrag = (0, import_react17.useCallback)(
18223
18867
  (clientX, clientY) => {
18224
18868
  const session = navDragRef.current;
18225
18869
  if (!session) {
@@ -18298,7 +18942,7 @@ function useNavItemDrag({
18298
18942
  [clearNavDragVisuals, deselectRef, editContentRef, postToParentRef, selectRef]
18299
18943
  );
18300
18944
  commitNavDragRef.current = commitNavDrag;
18301
- const startNavLinkDrag = (0, import_react16.useCallback)(
18945
+ const startNavLinkDrag = (0, import_react17.useCallback)(
18302
18946
  (anchor, clientX, clientY, wasSelected) => {
18303
18947
  if (footerDragRef.current) return false;
18304
18948
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
@@ -18316,7 +18960,7 @@ function useNavItemDrag({
18316
18960
  },
18317
18961
  [beginNavDrag, footerDragRef, isDragHandleDisabled2, isCtaButton]
18318
18962
  );
18319
- const onNavDragOver = (0, import_react16.useCallback)(
18963
+ const onNavDragOver = (0, import_react17.useCallback)(
18320
18964
  (e) => {
18321
18965
  const session = navDragRef.current;
18322
18966
  if (!session) return false;
@@ -18328,7 +18972,7 @@ function useNavItemDrag({
18328
18972
  },
18329
18973
  []
18330
18974
  );
18331
- (0, import_react16.useEffect)(() => {
18975
+ (0, import_react17.useEffect)(() => {
18332
18976
  if (!isEditMode) return;
18333
18977
  const THRESHOLD = 10;
18334
18978
  const resolveWasSelected = (el) => {
@@ -18455,7 +19099,7 @@ function useNavItemDrag({
18455
19099
  setLinkPopover,
18456
19100
  suppressNextClickRef
18457
19101
  ]);
18458
- const armNavPressFromChrome = (0, import_react16.useCallback)(
19102
+ const armNavPressFromChrome = (0, import_react17.useCallback)(
18459
19103
  (selected, clientX, clientY, pointerId) => {
18460
19104
  const hrefKey = selected.getAttribute("data-ohw-href-key");
18461
19105
  if (!hrefKey || !isNavbarHrefKey(hrefKey)) return false;
@@ -18487,7 +19131,7 @@ function useNavItemDrag({
18487
19131
  }
18488
19132
 
18489
19133
  // src/useSectionDrag.ts
18490
- var import_react17 = require("react");
19134
+ var import_react18 = require("react");
18491
19135
 
18492
19136
  // src/lib/section-dnd.ts
18493
19137
  function isFooterSection(el) {
@@ -18580,21 +19224,21 @@ function useSectionDrag({
18580
19224
  suppressNextClickRef,
18581
19225
  suppressClickUntilRef
18582
19226
  }) {
18583
- const sectionDragRef = (0, import_react17.useRef)(null);
18584
- const [sectionDropSlots, setSectionDropSlots] = (0, import_react17.useState)([]);
18585
- const [activeSectionDropIndex, setActiveSectionDropIndex] = (0, import_react17.useState)(null);
18586
- const [isSectionDragging, setIsSectionDragging] = (0, import_react17.useState)(false);
18587
- const sectionPointerDragRef = (0, import_react17.useRef)(null);
18588
- const autoScrollRafRef = (0, import_react17.useRef)(null);
18589
- const autoScrollDeltaRef = (0, import_react17.useRef)(0);
18590
- const stopAutoScroll = (0, import_react17.useCallback)(() => {
19227
+ const sectionDragRef = (0, import_react18.useRef)(null);
19228
+ const [sectionDropSlots, setSectionDropSlots] = (0, import_react18.useState)([]);
19229
+ const [activeSectionDropIndex, setActiveSectionDropIndex] = (0, import_react18.useState)(null);
19230
+ const [isSectionDragging, setIsSectionDragging] = (0, import_react18.useState)(false);
19231
+ const sectionPointerDragRef = (0, import_react18.useRef)(null);
19232
+ const autoScrollRafRef = (0, import_react18.useRef)(null);
19233
+ const autoScrollDeltaRef = (0, import_react18.useRef)(0);
19234
+ const stopAutoScroll = (0, import_react18.useCallback)(() => {
18591
19235
  if (autoScrollRafRef.current != null) {
18592
19236
  cancelAnimationFrame(autoScrollRafRef.current);
18593
19237
  autoScrollRafRef.current = null;
18594
19238
  }
18595
19239
  autoScrollDeltaRef.current = 0;
18596
19240
  }, []);
18597
- const tickAutoScroll = (0, import_react17.useCallback)(() => {
19241
+ const tickAutoScroll = (0, import_react18.useCallback)(() => {
18598
19242
  if (!sectionDragRef.current) {
18599
19243
  stopAutoScroll();
18600
19244
  return;
@@ -18604,7 +19248,7 @@ function useSectionDrag({
18604
19248
  }
18605
19249
  autoScrollRafRef.current = requestAnimationFrame(tickAutoScroll);
18606
19250
  }, [postToParentRef, stopAutoScroll]);
18607
- const updateAutoScroll = (0, import_react17.useCallback)(
19251
+ const updateAutoScroll = (0, import_react18.useCallback)(
18608
19252
  (clientY) => {
18609
19253
  const clip = getIframeChromeClip(parentScrollRef.current);
18610
19254
  let delta = 0;
@@ -18626,7 +19270,7 @@ function useSectionDrag({
18626
19270
  },
18627
19271
  [parentScrollRef, stopAutoScroll, tickAutoScroll]
18628
19272
  );
18629
- const clearSectionDragVisuals = (0, import_react17.useCallback)(() => {
19273
+ const clearSectionDragVisuals = (0, import_react18.useCallback)(() => {
18630
19274
  sectionDragRef.current?.draggedEl.removeAttribute("data-ohw-section-dragging");
18631
19275
  sectionDragRef.current = null;
18632
19276
  setSectionDropSlots([]);
@@ -18636,7 +19280,7 @@ function useSectionDrag({
18636
19280
  document.documentElement.removeAttribute("data-ohw-section-dragging-root");
18637
19281
  unlockItemDragInteraction();
18638
19282
  }, [stopAutoScroll]);
18639
- const refreshSectionDragVisuals = (0, import_react17.useCallback)(
19283
+ const refreshSectionDragVisuals = (0, import_react18.useCallback)(
18640
19284
  (session, clientX, clientY) => {
18641
19285
  session.lastClientX = clientX;
18642
19286
  session.lastClientY = clientY;
@@ -18650,7 +19294,7 @@ function useSectionDrag({
18650
19294
  },
18651
19295
  [updateAutoScroll]
18652
19296
  );
18653
- const beginSectionDrag = (0, import_react17.useCallback)(
19297
+ const beginSectionDrag = (0, import_react18.useCallback)(
18654
19298
  (session) => {
18655
19299
  sectionDragRef.current = session;
18656
19300
  setIsSectionDragging(true);
@@ -18661,7 +19305,7 @@ function useSectionDrag({
18661
19305
  },
18662
19306
  [refreshSectionDragVisuals]
18663
19307
  );
18664
- const commitSectionDrag = (0, import_react17.useCallback)(() => {
19308
+ const commitSectionDrag = (0, import_react18.useCallback)(() => {
18665
19309
  const session = sectionDragRef.current;
18666
19310
  if (!session) {
18667
19311
  clearSectionDragVisuals();
@@ -18690,7 +19334,7 @@ function useSectionDrag({
18690
19334
  });
18691
19335
  });
18692
19336
  }, [clearSectionDragVisuals, editContentRef, postToParentRef]);
18693
- const startSectionPressDrag = (0, import_react17.useCallback)(
19337
+ const startSectionPressDrag = (0, import_react18.useCallback)(
18694
19338
  (el, clientX, clientY, pointerId) => {
18695
19339
  if (navDragRef.current || footerDragRef.current || sectionDragRef.current) return false;
18696
19340
  const instanceId = instanceIdOf(el);
@@ -18707,7 +19351,7 @@ function useSectionDrag({
18707
19351
  },
18708
19352
  [footerDragRef, navDragRef]
18709
19353
  );
18710
- (0, import_react17.useEffect)(() => {
19354
+ (0, import_react18.useEffect)(() => {
18711
19355
  if (!isEditMode) return;
18712
19356
  const onPointerDown = (e) => {
18713
19357
  if (e.button !== 0) return;
@@ -18812,8 +19456,8 @@ function useSectionDrag({
18812
19456
  }
18813
19457
 
18814
19458
  // src/ui/footer-container-chrome.tsx
18815
- var import_lucide_react18 = require("lucide-react");
18816
- var import_jsx_runtime32 = require("react/jsx-runtime");
19459
+ var import_lucide_react19 = require("lucide-react");
19460
+ var import_jsx_runtime33 = require("react/jsx-runtime");
18817
19461
  function FooterContainerChrome({
18818
19462
  rect,
18819
19463
  onAdd,
@@ -18821,7 +19465,7 @@ function FooterContainerChrome({
18821
19465
  }) {
18822
19466
  const chromeGap = 6;
18823
19467
  const buttonMargin = 7;
18824
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
19468
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18825
19469
  "div",
18826
19470
  {
18827
19471
  "data-ohw-footer-container-chrome": "",
@@ -18833,8 +19477,8 @@ function FooterContainerChrome({
18833
19477
  width: rect.width + chromeGap * 2,
18834
19478
  height: rect.height + chromeGap * 2
18835
19479
  },
18836
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Tooltip, { children: [
18837
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
19480
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Tooltip, { children: [
19481
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18838
19482
  "button",
18839
19483
  {
18840
19484
  type: "button",
@@ -18853,17 +19497,17 @@ function FooterContainerChrome({
18853
19497
  if (addDisabled) return;
18854
19498
  onAdd();
18855
19499
  },
18856
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react18.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
19500
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
18857
19501
  }
18858
19502
  ) }),
18859
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
19503
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(TooltipContent, { side: "bottom", sideOffset: 9, children: addDisabled ? "Maximum columns reached" : "Add item" })
18860
19504
  ] })
18861
19505
  }
18862
19506
  ) });
18863
19507
  }
18864
19508
 
18865
19509
  // src/lib/carousel.ts
18866
- var import_react18 = require("react");
19510
+ var import_react19 = require("react");
18867
19511
  var CAROUSEL_ATTR = "data-ohw-carousel";
18868
19512
  var CAROUSEL_VALUE_ATTR = "data-ohw-carousel-value";
18869
19513
  var CAROUSEL_SLIDE_ATTR = "data-ohw-carousel-slide";
@@ -18925,8 +19569,8 @@ function applyCarouselNode(key, val) {
18925
19569
  return true;
18926
19570
  }
18927
19571
  function useOhwCarousel(key, initial) {
18928
- const [images, setImages] = (0, import_react18.useState)(initial);
18929
- (0, import_react18.useEffect)(() => {
19572
+ const [images, setImages] = (0, import_react19.useState)(initial);
19573
+ (0, import_react19.useEffect)(() => {
18930
19574
  const el = document.querySelector(
18931
19575
  `[${CAROUSEL_ATTR}][data-ohw-key="${CSS.escape(key)}"]`
18932
19576
  );
@@ -19345,14 +19989,14 @@ function deleteSelectedNavFooterItem(deps) {
19345
19989
  }
19346
19990
 
19347
19991
  // src/ui/navbar-container-chrome.tsx
19348
- var import_lucide_react19 = require("lucide-react");
19349
- var import_jsx_runtime33 = require("react/jsx-runtime");
19992
+ var import_lucide_react20 = require("lucide-react");
19993
+ var import_jsx_runtime34 = require("react/jsx-runtime");
19350
19994
  function NavbarContainerChrome({
19351
19995
  rect,
19352
19996
  onAdd
19353
19997
  }) {
19354
19998
  const chromeGap = 6;
19355
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
19999
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
19356
20000
  "div",
19357
20001
  {
19358
20002
  "data-ohw-navbar-container-chrome": "",
@@ -19364,7 +20008,7 @@ function NavbarContainerChrome({
19364
20008
  width: rect.width + chromeGap * 2,
19365
20009
  height: rect.height + chromeGap * 2
19366
20010
  },
19367
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
20011
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
19368
20012
  "button",
19369
20013
  {
19370
20014
  type: "button",
@@ -19381,7 +20025,7 @@ function NavbarContainerChrome({
19381
20025
  e.stopPropagation();
19382
20026
  onAdd();
19383
20027
  },
19384
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_lucide_react19.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
20028
+ children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react20.Plus, { className: "size-4 shrink-0 text-foreground", "aria-hidden": true })
19385
20029
  }
19386
20030
  )
19387
20031
  }
@@ -19390,7 +20034,7 @@ function NavbarContainerChrome({
19390
20034
 
19391
20035
  // src/ui/drop-indicator.tsx
19392
20036
  var React11 = __toESM(require("react"), 1);
19393
- var import_jsx_runtime34 = require("react/jsx-runtime");
20037
+ var import_jsx_runtime35 = require("react/jsx-runtime");
19394
20038
  var dropIndicatorVariants = cva(
19395
20039
  "ov-gap-line pointer-events-none shrink-0 transition-opacity duration-150",
19396
20040
  {
@@ -19414,7 +20058,7 @@ var dropIndicatorVariants = cva(
19414
20058
  );
19415
20059
  var DropIndicator = React11.forwardRef(
19416
20060
  ({ className, direction, state, ...props }, ref) => {
19417
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
20061
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
19418
20062
  "div",
19419
20063
  {
19420
20064
  ref,
@@ -19431,7 +20075,7 @@ var DropIndicator = React11.forwardRef(
19431
20075
  DropIndicator.displayName = "DropIndicator";
19432
20076
 
19433
20077
  // src/ui/badge.tsx
19434
- var import_jsx_runtime35 = require("react/jsx-runtime");
20078
+ var import_jsx_runtime36 = require("react/jsx-runtime");
19435
20079
  var badgeVariants = cva(
19436
20080
  "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
19437
20081
  {
@@ -19449,13 +20093,13 @@ var badgeVariants = cva(
19449
20093
  }
19450
20094
  );
19451
20095
  function Badge({ className, variant, ...props }) {
19452
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
20096
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
19453
20097
  }
19454
20098
 
19455
20099
  // src/OhhwellsBridge.tsx
19456
- var import_lucide_react20 = require("lucide-react");
19457
- var import_jsx_runtime36 = require("react/jsx-runtime");
19458
- var PRIMARY5 = "#0885FE";
20100
+ var import_lucide_react21 = require("lucide-react");
20101
+ var import_jsx_runtime37 = require("react/jsx-runtime");
20102
+ var PRIMARY6 = "#0885FE";
19459
20103
  var IMAGE_FADE_MS = 300;
19460
20104
  var MEDIA_SETTLE_TIMEOUT_MS = 2500;
19461
20105
  function runOpacityFade(el, onDone) {
@@ -19576,7 +20220,7 @@ function duplicateSchedulingWidget(instanceId, scheduleId) {
19576
20220
  schedulingRoots.set(container, root);
19577
20221
  (0, import_react_dom4.flushSync)(() => {
19578
20222
  root.render(
19579
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
20223
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
19580
20224
  SchedulingWidget,
19581
20225
  {
19582
20226
  notifyOnConnect: false,
@@ -19704,7 +20348,7 @@ function mountSchedulingWidget(anchorId, notifyOnConnect = false, scheduleId, be
19704
20348
  schedulingRoots.set(container, root);
19705
20349
  (0, import_react_dom4.flushSync)(() => {
19706
20350
  root.render(
19707
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
20351
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
19708
20352
  SchedulingWidget,
19709
20353
  {
19710
20354
  notifyOnConnect,
@@ -20213,7 +20857,7 @@ function getNavigationSelectionParent(el) {
20213
20857
  if (!isFooterLinksContainer(el) && (el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isInferredFooterGroup2(el))) {
20214
20858
  return getFooterLinksContainer();
20215
20859
  }
20216
- if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || isFooterLinksContainer(el)) {
20860
+ if (el.hasAttribute("data-ohw-nav-container") || el.hasAttribute("data-ohw-nav-drawer") || el.hasAttribute("data-ohw-footer-col") || el.hasAttribute("data-ohw-footer-column") || isFooterLinksContainer(el) || isInferredFooterGroup2(el)) {
20217
20861
  return getNavigationRoot(el);
20218
20862
  }
20219
20863
  return null;
@@ -20435,13 +21079,12 @@ var ICONS = {
20435
21079
  insertUnorderedList: '<line x1="8" y1="6" x2="21" y2="6"/><line x1="8" y1="12" x2="21" y2="12"/><line x1="8" y1="18" x2="21" y2="18"/><line x1="3" y1="6" x2="3.01" y2="6"/><line x1="3" y1="12" x2="3.01" y2="12"/><line x1="3" y1="18" x2="3.01" y2="18"/>',
20436
21080
  insertOrderedList: '<line x1="10" y1="6" x2="21" y2="6"/><line x1="10" y1="12" x2="21" y2="12"/><line x1="10" y1="18" x2="21" y2="18"/><path d="M4 6h1v4"/><path d="M4 10h2"/><path d="M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"/>'
20437
21081
  };
20438
- var HEIGHT_SETTLE_DELAYS = [150, 400, 800];
20439
21082
  var SELECTION_CHROME_GAP2 = 4;
20440
21083
  var TOOLBAR_STROKE_GAP2 = 4;
20441
21084
  var TOOLBAR_OFFSET_FROM_ELEMENT = SELECTION_CHROME_GAP2 + TOOLBAR_STROKE_GAP2;
20442
21085
  var HOVER_STROKE_WIDTH = 1.5;
20443
21086
  var TEXT_HOVER_SIDE_PAD = 4;
20444
- var CHROME_PRIMARY = `var(--ohw-primary, ${PRIMARY5})`;
21087
+ var CHROME_PRIMARY = `var(--ohw-primary, ${PRIMARY6})`;
20445
21088
  var TOOLBAR_GROUPS = [
20446
21089
  [
20447
21090
  { cmd: "bold", title: "Bold" },
@@ -20467,7 +21110,7 @@ function EditGlowChrome({
20467
21110
  hideHandle = false
20468
21111
  }) {
20469
21112
  const GAP = SELECTION_CHROME_GAP2;
20470
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
21113
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
20471
21114
  "div",
20472
21115
  {
20473
21116
  ref: elRef,
@@ -20482,7 +21125,7 @@ function EditGlowChrome({
20482
21125
  zIndex: 2147483646
20483
21126
  },
20484
21127
  children: [
20485
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21128
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20486
21129
  "div",
20487
21130
  {
20488
21131
  style: {
@@ -20496,7 +21139,7 @@ function EditGlowChrome({
20496
21139
  }
20497
21140
  }
20498
21141
  ),
20499
- reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21142
+ reorderHrefKey && !hideHandle && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20500
21143
  "div",
20501
21144
  {
20502
21145
  "data-ohw-drag-handle-container": "",
@@ -20508,7 +21151,7 @@ function EditGlowChrome({
20508
21151
  transform: "translate(calc(-100% - 7px), -50%)",
20509
21152
  pointerEvents: dragDisabled ? "none" : "auto"
20510
21153
  },
20511
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21154
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20512
21155
  DragHandle,
20513
21156
  {
20514
21157
  "aria-label": `Reorder ${reorderHrefKey}`,
@@ -20685,9 +21328,9 @@ function FloatingToolbar({
20685
21328
  showEditLink,
20686
21329
  onEditLink
20687
21330
  }) {
20688
- const localRef = import_react19.default.useRef(null);
20689
- const [measuredW, setMeasuredW] = import_react19.default.useState(330);
20690
- const setRefs = import_react19.default.useCallback(
21331
+ const localRef = import_react20.default.useRef(null);
21332
+ const [measuredW, setMeasuredW] = import_react20.default.useState(330);
21333
+ const setRefs = import_react20.default.useCallback(
20691
21334
  (node) => {
20692
21335
  localRef.current = node;
20693
21336
  if (typeof elRef === "function") elRef(node);
@@ -20699,7 +21342,7 @@ function FloatingToolbar({
20699
21342
  },
20700
21343
  [elRef]
20701
21344
  );
20702
- import_react19.default.useLayoutEffect(() => {
21345
+ import_react20.default.useLayoutEffect(() => {
20703
21346
  const node = localRef.current;
20704
21347
  if (!node) return;
20705
21348
  const update = () => {
@@ -20712,7 +21355,7 @@ function FloatingToolbar({
20712
21355
  return () => ro.disconnect();
20713
21356
  }, [showEditLink, activeCommands]);
20714
21357
  const { top, left, transform } = calcToolbarPos(rect, parentScroll, measuredW);
20715
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21358
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20716
21359
  "div",
20717
21360
  {
20718
21361
  ref: setRefs,
@@ -20724,12 +21367,12 @@ function FloatingToolbar({
20724
21367
  zIndex: 2147483647,
20725
21368
  pointerEvents: "auto"
20726
21369
  },
20727
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(CustomToolbar, { children: [
20728
- TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_react19.default.Fragment, { children: [
20729
- gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CustomToolbarDivider, {}),
21370
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(CustomToolbar, { children: [
21371
+ TOOLBAR_GROUPS.map((btns, gi) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react20.default.Fragment, { children: [
21372
+ gi > 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(CustomToolbarDivider, {}),
20730
21373
  btns.map((btn) => {
20731
21374
  const isActive = activeCommands.has(btn.cmd);
20732
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21375
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20733
21376
  CustomToolbarButton,
20734
21377
  {
20735
21378
  title: btn.title,
@@ -20738,7 +21381,7 @@ function FloatingToolbar({
20738
21381
  e.preventDefault();
20739
21382
  onCommand(btn.cmd);
20740
21383
  },
20741
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21384
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20742
21385
  "svg",
20743
21386
  {
20744
21387
  width: "16",
@@ -20759,7 +21402,7 @@ function FloatingToolbar({
20759
21402
  );
20760
21403
  })
20761
21404
  ] }, gi)),
20762
- showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21405
+ showEditLink ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20763
21406
  CustomToolbarButton,
20764
21407
  {
20765
21408
  type: "button",
@@ -20773,7 +21416,7 @@ function FloatingToolbar({
20773
21416
  e.preventDefault();
20774
21417
  e.stopPropagation();
20775
21418
  },
20776
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Link, { className: "size-4 shrink-0", "aria-hidden": true })
21419
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.Link, { className: "size-4 shrink-0", "aria-hidden": true })
20777
21420
  }
20778
21421
  ) : null
20779
21422
  ] })
@@ -20790,7 +21433,7 @@ function StateToggle({
20790
21433
  states,
20791
21434
  onStateChange
20792
21435
  }) {
20793
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21436
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20794
21437
  ToggleGroup,
20795
21438
  {
20796
21439
  "data-ohw-state-toggle": "",
@@ -20804,7 +21447,7 @@ function StateToggle({
20804
21447
  left: rect.right - 8,
20805
21448
  transform: "translateX(-100%)"
20806
21449
  },
20807
- children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
21450
+ children: states.map((state) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ToggleGroupItem, { value: state, size: "sm", children: state }, state))
20808
21451
  }
20809
21452
  );
20810
21453
  }
@@ -20821,9 +21464,9 @@ var OHW_LOADER_STYLE = {
20821
21464
  justifyContent: "center"
20822
21465
  };
20823
21466
  function OhwLoaderSpinner() {
20824
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", "aria-hidden": true, children: [
20825
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("circle", { cx: "14", cy: "14", r: "11", stroke: "#E7E5E4", strokeWidth: "3" }),
20826
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21467
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("svg", { width: "28", height: "28", viewBox: "0 0 28 28", fill: "none", "aria-hidden": true, children: [
21468
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("circle", { cx: "14", cy: "14", r: "11", stroke: "#E7E5E4", strokeWidth: "3" }),
21469
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20827
21470
  "circle",
20828
21471
  {
20829
21472
  cx: "14",
@@ -20833,7 +21476,7 @@ function OhwLoaderSpinner() {
20833
21476
  strokeWidth: "3",
20834
21477
  strokeDasharray: "17 52",
20835
21478
  strokeLinecap: "round",
20836
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21479
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20837
21480
  "animateTransform",
20838
21481
  {
20839
21482
  attributeName: "transform",
@@ -20849,7 +21492,7 @@ function OhwLoaderSpinner() {
20849
21492
  ] });
20850
21493
  }
20851
21494
  function OhwBrandMark() {
20852
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
21495
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
20853
21496
  "svg",
20854
21497
  {
20855
21498
  width: "16",
@@ -20860,7 +21503,7 @@ function OhwBrandMark() {
20860
21503
  style: { display: "block", flexShrink: 0 },
20861
21504
  xmlns: "http://www.w3.org/2000/svg",
20862
21505
  children: [
20863
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
21506
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
20864
21507
  "mask",
20865
21508
  {
20866
21509
  id: "ohw-badge-mark",
@@ -20870,15 +21513,15 @@ function OhwBrandMark() {
20870
21513
  y: "0",
20871
21514
  width: "48",
20872
21515
  height: "48",
20873
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M23.8741 48C37.0594 48 47.7481 37.2548 47.7481 24C47.7481 10.7452 37.0594 0 23.8741 0C10.6888 0 0 10.7452 0 24C0 37.2548 10.6888 48 23.8741 48Z", fill: "white" })
21516
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M23.8741 48C37.0594 48 47.7481 37.2548 47.7481 24C47.7481 10.7452 37.0594 0 23.8741 0C10.6888 0 0 10.7452 0 24C0 37.2548 10.6888 48 23.8741 48Z", fill: "white" })
20874
21517
  }
20875
21518
  ),
20876
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("g", { mask: "url(#ohw-badge-mark)", children: [
20877
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M23.8731 48.0497C37.0584 48.0497 47.7472 37.3046 47.7472 24.0497C47.7472 10.7949 37.0584 0.0497208 23.8731 0.0497208C10.6878 0.0497208 -0.000976562 10.7949 -0.000976562 24.0497C-0.000976562 37.3046 10.6878 48.0497 23.8731 48.0497Z", fill: "#0078E5" }),
20878
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M17.1307 14.7172C13.1687 14.7172 9.38102 18.1154 8.65114 22.34C8.38885 23.8488 8.5598 25.2581 9.06929 26.4451C6.20005 29.1677 1.77216 27.8721 -1.40212 26.1536C-2.73618 25.4317 -3.92695 27.4745 -2.59037 28.1981C1.33389 30.3226 6.86037 31.6621 10.4402 28.4188C11.4718 29.3859 12.867 29.9621 14.4894 29.9621C18.4161 29.9621 22.2038 26.5318 22.9337 22.34C23.6636 18.1162 21.0566 14.7172 17.1298 14.7172H17.1307ZM19.9798 22.34C19.5281 25.0399 17.2689 27.231 14.9754 27.231C12.6466 27.231 11.1877 25.0399 11.6394 22.34C12.1262 19.6401 14.3151 17.4482 16.6438 17.4482C18.9374 17.4482 20.4667 19.6401 19.9798 22.34Z", fill: "white" }),
20879
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M40.0017 27.0262C39.1797 27.081 38.2721 26.995 37.4668 26.7415C37.3344 26.6993 37.28 26.5401 37.3529 26.4205C37.5959 26.0212 37.8255 25.6152 38.009 25.1889C38.1071 24.9918 38.2018 24.793 38.2897 24.5908C38.3274 24.5041 38.4163 24.451 38.5101 24.4619C38.63 24.4754 38.7054 24.4821 38.8881 24.4821L39.1529 24.4796L39.8283 24.4543C45.9229 24.0492 50.4765 20.4319 54.8466 16.9014C56.0172 15.9554 57.6932 17.6208 56.5116 18.5752C51.7687 22.4065 47.1966 26.5081 40.9319 26.9689", fill: "white" }),
20880
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M37.9687 24.27C38.4472 23.1319 38.7656 21.9045 38.9609 20.6991C39.5927 16.76 38.5058 14.2193 36.1553 14.2193C34.1835 14.2193 33.1469 17.2427 32.9199 18.8694C32.743 19.9872 32.5914 22.1219 33.6028 23.9524C33.7553 24.259 34.15 24.7712 34.471 25.1259C34.5447 25.2067 34.6746 25.2 34.7349 25.1082C34.9528 24.7788 35.1615 24.4039 35.3584 24.0257C35.5444 23.6677 35.5888 23.6138 35.8587 23.0207C35.8838 22.966 35.8813 22.9002 35.8478 22.8505C35.5888 22.4597 35.2168 21.9787 35.1204 21.4614C34.9184 20.4455 34.9436 19.2257 35.2218 18.1078C35.4413 17.3118 35.7195 16.7844 35.9039 16.5106C35.9466 16.4466 36.0279 16.4129 36.0975 16.4449C36.369 16.5671 36.5827 16.8838 36.7385 17.396C37.0167 18.2089 37.0167 19.3782 36.814 20.6999C36.6991 21.5271 36.4771 22.3729 36.1746 23.1673C36.1293 23.308 36.0757 23.4461 36.0187 23.5826C36.0187 23.5868 36.0187 23.591 36.0187 23.5961C35.9911 23.6946 35.9207 23.8067 35.8846 23.901C35.5536 24.5497 35.2344 25.1697 34.8439 25.7838C34.8388 25.7863 34.8346 25.7914 34.8296 25.7931C34.6528 26.0525 34.4718 26.2901 34.2866 26.4965C34.2774 26.5099 34.2682 26.5234 34.2589 26.5369C34.2405 26.5638 34.2179 26.5815 34.1944 26.595C33.5064 27.3212 32.7665 27.6893 32.0123 27.6893C31.8606 27.6893 31.6838 27.664 31.507 27.4349C31.3042 27.1299 30.85 26.0879 31.2539 22.9112C31.4785 21.3949 31.8011 20.0268 31.931 19.5408C31.9579 19.4413 31.8908 19.3419 31.7886 19.3293L30.0062 19.1162C29.9241 19.1061 29.8478 19.1566 29.8252 19.2366C29.2704 21.1615 27.0305 27.6885 24.9599 27.6885C24.328 27.6885 24.1512 26.6211 24.1001 26.2909C23.775 23.6264 25.528 18.5492 29.5302 16.2267C29.6048 16.1838 29.635 16.0928 29.5998 16.0136L28.9042 14.467C28.8632 14.3752 28.7501 14.3389 28.6638 14.3886C25.8079 16.0414 24.1847 18.5231 23.2915 20.3436C22.2046 22.5793 21.6993 25.0189 21.9515 26.8738C22.1795 28.7794 23.1398 29.872 24.6054 29.872C26.0543 29.872 27.4369 28.9066 28.7098 27.0187C28.7953 26.8915 28.9889 26.9311 29.0149 27.0819C29.2646 28.5283 29.9811 29.872 31.6579 29.872C33.5282 29.872 35.3232 28.7288 36.7134 26.6447C36.7712 26.5874 36.7972 26.5411 36.8181 26.4906C36.8232 26.4931 36.8282 26.4948 36.8332 26.4973C37.01 26.2025 37.181 25.9051 37.3444 25.6027C37.4508 25.4005 37.5572 25.1992 37.6586 24.9945C37.7181 24.874 37.7743 24.7527 37.8262 24.6289C37.838 24.6002 37.8547 24.5665 37.8706 24.5337", fill: "white" }),
20881
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("path", { d: "M30.5839 31.6397C25.7546 34.8577 19.4773 34.7853 14.6907 31.5243C13.5368 30.7384 12.5044 32.6498 13.6474 33.4281C19.034 37.0985 26.3077 37.096 31.7218 33.488C32.8791 32.7172 31.7478 30.8639 30.5839 31.6397Z", fill: "white" })
21519
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("g", { mask: "url(#ohw-badge-mark)", children: [
21520
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M23.8731 48.0497C37.0584 48.0497 47.7472 37.3046 47.7472 24.0497C47.7472 10.7949 37.0584 0.0497208 23.8731 0.0497208C10.6878 0.0497208 -0.000976562 10.7949 -0.000976562 24.0497C-0.000976562 37.3046 10.6878 48.0497 23.8731 48.0497Z", fill: "#0078E5" }),
21521
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M17.1307 14.7172C13.1687 14.7172 9.38102 18.1154 8.65114 22.34C8.38885 23.8488 8.5598 25.2581 9.06929 26.4451C6.20005 29.1677 1.77216 27.8721 -1.40212 26.1536C-2.73618 25.4317 -3.92695 27.4745 -2.59037 28.1981C1.33389 30.3226 6.86037 31.6621 10.4402 28.4188C11.4718 29.3859 12.867 29.9621 14.4894 29.9621C18.4161 29.9621 22.2038 26.5318 22.9337 22.34C23.6636 18.1162 21.0566 14.7172 17.1298 14.7172H17.1307ZM19.9798 22.34C19.5281 25.0399 17.2689 27.231 14.9754 27.231C12.6466 27.231 11.1877 25.0399 11.6394 22.34C12.1262 19.6401 14.3151 17.4482 16.6438 17.4482C18.9374 17.4482 20.4667 19.6401 19.9798 22.34Z", fill: "white" }),
21522
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M40.0017 27.0262C39.1797 27.081 38.2721 26.995 37.4668 26.7415C37.3344 26.6993 37.28 26.5401 37.3529 26.4205C37.5959 26.0212 37.8255 25.6152 38.009 25.1889C38.1071 24.9918 38.2018 24.793 38.2897 24.5908C38.3274 24.5041 38.4163 24.451 38.5101 24.4619C38.63 24.4754 38.7054 24.4821 38.8881 24.4821L39.1529 24.4796L39.8283 24.4543C45.9229 24.0492 50.4765 20.4319 54.8466 16.9014C56.0172 15.9554 57.6932 17.6208 56.5116 18.5752C51.7687 22.4065 47.1966 26.5081 40.9319 26.9689", fill: "white" }),
21523
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M37.9687 24.27C38.4472 23.1319 38.7656 21.9045 38.9609 20.6991C39.5927 16.76 38.5058 14.2193 36.1553 14.2193C34.1835 14.2193 33.1469 17.2427 32.9199 18.8694C32.743 19.9872 32.5914 22.1219 33.6028 23.9524C33.7553 24.259 34.15 24.7712 34.471 25.1259C34.5447 25.2067 34.6746 25.2 34.7349 25.1082C34.9528 24.7788 35.1615 24.4039 35.3584 24.0257C35.5444 23.6677 35.5888 23.6138 35.8587 23.0207C35.8838 22.966 35.8813 22.9002 35.8478 22.8505C35.5888 22.4597 35.2168 21.9787 35.1204 21.4614C34.9184 20.4455 34.9436 19.2257 35.2218 18.1078C35.4413 17.3118 35.7195 16.7844 35.9039 16.5106C35.9466 16.4466 36.0279 16.4129 36.0975 16.4449C36.369 16.5671 36.5827 16.8838 36.7385 17.396C37.0167 18.2089 37.0167 19.3782 36.814 20.6999C36.6991 21.5271 36.4771 22.3729 36.1746 23.1673C36.1293 23.308 36.0757 23.4461 36.0187 23.5826C36.0187 23.5868 36.0187 23.591 36.0187 23.5961C35.9911 23.6946 35.9207 23.8067 35.8846 23.901C35.5536 24.5497 35.2344 25.1697 34.8439 25.7838C34.8388 25.7863 34.8346 25.7914 34.8296 25.7931C34.6528 26.0525 34.4718 26.2901 34.2866 26.4965C34.2774 26.5099 34.2682 26.5234 34.2589 26.5369C34.2405 26.5638 34.2179 26.5815 34.1944 26.595C33.5064 27.3212 32.7665 27.6893 32.0123 27.6893C31.8606 27.6893 31.6838 27.664 31.507 27.4349C31.3042 27.1299 30.85 26.0879 31.2539 22.9112C31.4785 21.3949 31.8011 20.0268 31.931 19.5408C31.9579 19.4413 31.8908 19.3419 31.7886 19.3293L30.0062 19.1162C29.9241 19.1061 29.8478 19.1566 29.8252 19.2366C29.2704 21.1615 27.0305 27.6885 24.9599 27.6885C24.328 27.6885 24.1512 26.6211 24.1001 26.2909C23.775 23.6264 25.528 18.5492 29.5302 16.2267C29.6048 16.1838 29.635 16.0928 29.5998 16.0136L28.9042 14.467C28.8632 14.3752 28.7501 14.3389 28.6638 14.3886C25.8079 16.0414 24.1847 18.5231 23.2915 20.3436C22.2046 22.5793 21.6993 25.0189 21.9515 26.8738C22.1795 28.7794 23.1398 29.872 24.6054 29.872C26.0543 29.872 27.4369 28.9066 28.7098 27.0187C28.7953 26.8915 28.9889 26.9311 29.0149 27.0819C29.2646 28.5283 29.9811 29.872 31.6579 29.872C33.5282 29.872 35.3232 28.7288 36.7134 26.6447C36.7712 26.5874 36.7972 26.5411 36.8181 26.4906C36.8232 26.4931 36.8282 26.4948 36.8332 26.4973C37.01 26.2025 37.181 25.9051 37.3444 25.6027C37.4508 25.4005 37.5572 25.1992 37.6586 24.9945C37.7181 24.874 37.7743 24.7527 37.8262 24.6289C37.838 24.6002 37.8547 24.5665 37.8706 24.5337", fill: "white" }),
21524
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("path", { d: "M30.5839 31.6397C25.7546 34.8577 19.4773 34.7853 14.6907 31.5243C13.5368 30.7384 12.5044 32.6498 13.6474 33.4281C19.034 37.0985 26.3077 37.096 31.7218 33.488C32.8791 32.7172 31.7478 30.8639 30.5839 31.6397Z", fill: "white" })
20882
21525
  ] })
20883
21526
  ]
20884
21527
  }
@@ -20915,7 +21558,7 @@ var OHW_BADGE_LABEL_STYLE = {
20915
21558
  whiteSpace: "nowrap"
20916
21559
  };
20917
21560
  function MadeWithOhhWells() {
20918
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
21561
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
20919
21562
  "a",
20920
21563
  {
20921
21564
  href: "https://ohhwells.com",
@@ -20925,8 +21568,8 @@ function MadeWithOhhWells() {
20925
21568
  "data-ohw-badge": "",
20926
21569
  style: OHW_BADGE_STYLE,
20927
21570
  children: [
20928
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(OhwBrandMark, {}),
20929
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { style: OHW_BADGE_LABEL_STYLE, children: "Made with OhhWells" })
21571
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(OhwBrandMark, {}),
21572
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { style: OHW_BADGE_LABEL_STYLE, children: "Made with OhhWells" })
20930
21573
  ]
20931
21574
  }
20932
21575
  );
@@ -20972,8 +21615,8 @@ function OhhwellsBridge() {
20972
21615
  const router = (0, import_navigation3.useRouter)();
20973
21616
  const searchParams = (0, import_navigation3.useSearchParams)();
20974
21617
  const isEditMode = isEditSessionActive();
20975
- const [bridgeRoot, setBridgeRoot] = (0, import_react19.useState)(null);
20976
- (0, import_react19.useEffect)(() => {
21618
+ const [bridgeRoot, setBridgeRoot] = (0, import_react20.useState)(null);
21619
+ (0, import_react20.useEffect)(() => {
20977
21620
  const figtreeFontId = "ohw-figtree-font";
20978
21621
  if (!document.getElementById(figtreeFontId)) {
20979
21622
  const preconnect1 = Object.assign(document.createElement("link"), { rel: "preconnect", href: "https://fonts.googleapis.com" });
@@ -20999,8 +21642,8 @@ function OhhwellsBridge() {
20999
21642
  };
21000
21643
  }, []);
21001
21644
  const subdomainFromQuery = searchParams.get("subdomain");
21002
- const [subdomain, setSubdomain] = (0, import_react19.useState)(() => resolveSubdomain(subdomainFromQuery));
21003
- (0, import_react19.useLayoutEffect)(() => {
21645
+ const [subdomain, setSubdomain] = (0, import_react20.useState)(() => resolveSubdomain(subdomainFromQuery));
21646
+ (0, import_react20.useLayoutEffect)(() => {
21004
21647
  const next = resolveSubdomain(subdomainFromQuery);
21005
21648
  if (next !== subdomain) setSubdomain(next);
21006
21649
  if (next) return;
@@ -21012,7 +21655,7 @@ function OhhwellsBridge() {
21012
21655
  }, 0);
21013
21656
  return () => window.clearTimeout(t);
21014
21657
  }, [subdomainFromQuery, subdomain]);
21015
- (0, import_react19.useEffect)(() => {
21658
+ (0, import_react20.useEffect)(() => {
21016
21659
  if (!subdomainFromQuery || typeof window === "undefined") return;
21017
21660
  const url = new URL(window.location.href);
21018
21661
  if (!url.searchParams.has("subdomain")) return;
@@ -21022,45 +21665,45 @@ function OhhwellsBridge() {
21022
21665
  }, [subdomainFromQuery]);
21023
21666
  useLinkHrefGuardian(pathname, subdomain, isEditMode);
21024
21667
  useSavedLinkNavigation(isEditMode);
21025
- const postToParent2 = (0, import_react19.useCallback)((data) => {
21668
+ const postToParent2 = (0, import_react20.useCallback)((data) => {
21026
21669
  if (typeof window !== "undefined" && window.parent !== window) {
21027
21670
  window.parent.postMessage(data, "*");
21028
21671
  }
21029
21672
  }, []);
21030
- const [fetchState, setFetchState] = (0, import_react19.useState)("idle");
21031
- const [showBranding, setShowBranding] = (0, import_react19.useState)(false);
21032
- const autoSaveTimers = (0, import_react19.useRef)(/* @__PURE__ */ new Map());
21033
- const activeElRef = (0, import_react19.useRef)(null);
21034
- const pointerHeldRef = (0, import_react19.useRef)(false);
21035
- const selectedElRef = (0, import_react19.useRef)(null);
21036
- const selectedHrefKeyRef = (0, import_react19.useRef)(null);
21037
- const selectedFooterColAttrRef = (0, import_react19.useRef)(null);
21038
- const originalContentRef = (0, import_react19.useRef)(null);
21039
- const activeStateElRef = (0, import_react19.useRef)(null);
21040
- const parentScrollRef = (0, import_react19.useRef)(null);
21041
- const visibleViewportRef = (0, import_react19.useRef)(null);
21042
- const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react19.useState)(null);
21043
- const attachVisibleViewport = (0, import_react19.useCallback)((node) => {
21673
+ const [fetchState, setFetchState] = (0, import_react20.useState)("idle");
21674
+ const [showBranding, setShowBranding] = (0, import_react20.useState)(false);
21675
+ const autoSaveTimers = (0, import_react20.useRef)(/* @__PURE__ */ new Map());
21676
+ const activeElRef = (0, import_react20.useRef)(null);
21677
+ const pointerHeldRef = (0, import_react20.useRef)(false);
21678
+ const selectedElRef = (0, import_react20.useRef)(null);
21679
+ const selectedHrefKeyRef = (0, import_react20.useRef)(null);
21680
+ const selectedFooterColAttrRef = (0, import_react20.useRef)(null);
21681
+ const originalContentRef = (0, import_react20.useRef)(null);
21682
+ const activeStateElRef = (0, import_react20.useRef)(null);
21683
+ const parentScrollRef = (0, import_react20.useRef)(null);
21684
+ const visibleViewportRef = (0, import_react20.useRef)(null);
21685
+ const [dialogPortalContainer, setDialogPortalContainer] = (0, import_react20.useState)(null);
21686
+ const attachVisibleViewport = (0, import_react20.useCallback)((node) => {
21044
21687
  visibleViewportRef.current = node;
21045
21688
  setDialogPortalContainer(node);
21046
21689
  if (node) applyVisibleViewport(node, parentScrollRef.current);
21047
21690
  }, []);
21048
- const toolbarElRef = (0, import_react19.useRef)(null);
21049
- const glowElRef = (0, import_react19.useRef)(null);
21050
- const hoveredImageRef = (0, import_react19.useRef)(null);
21051
- const hoveredImageHasTextOverlapRef = (0, import_react19.useRef)(false);
21052
- const dragOverElRef = (0, import_react19.useRef)(null);
21053
- const [mediaHover, setMediaHover] = (0, import_react19.useState)(null);
21054
- const [selectedAiSectionId, setSelectedAiSectionId] = (0, import_react19.useState)(null);
21055
- const selectedAiSectionIdRef = (0, import_react19.useRef)(null);
21056
- const handleAiSectionSelectionChange = (0, import_react19.useCallback)((id) => {
21691
+ const toolbarElRef = (0, import_react20.useRef)(null);
21692
+ const glowElRef = (0, import_react20.useRef)(null);
21693
+ const hoveredImageRef = (0, import_react20.useRef)(null);
21694
+ const hoveredImageHasTextOverlapRef = (0, import_react20.useRef)(false);
21695
+ const dragOverElRef = (0, import_react20.useRef)(null);
21696
+ const [mediaHover, setMediaHover] = (0, import_react20.useState)(null);
21697
+ const [selectedAiSectionId, setSelectedAiSectionId] = (0, import_react20.useState)(null);
21698
+ const selectedAiSectionIdRef = (0, import_react20.useRef)(null);
21699
+ const handleAiSectionSelectionChange = (0, import_react20.useCallback)((id) => {
21057
21700
  selectedAiSectionIdRef.current = id;
21058
21701
  setSelectedAiSectionId(id);
21059
21702
  }, []);
21060
- const [selectedMedia, setSelectedMedia] = (0, import_react19.useState)(null);
21061
- const selectedMediaElRef = (0, import_react19.useRef)(null);
21062
- const mediaKeyDropTokenRef = (0, import_react19.useRef)(0);
21063
- const clearMediaSelection = (0, import_react19.useCallback)(() => {
21703
+ const [selectedMedia, setSelectedMedia] = (0, import_react20.useState)(null);
21704
+ const selectedMediaElRef = (0, import_react20.useRef)(null);
21705
+ const mediaKeyDropTokenRef = (0, import_react20.useRef)(0);
21706
+ const clearMediaSelection = (0, import_react20.useCallback)(() => {
21064
21707
  const prev = selectedMediaElRef.current;
21065
21708
  selectedMediaElRef.current = null;
21066
21709
  setSelectedMedia(null);
@@ -21085,9 +21728,9 @@ function OhhwellsBridge() {
21085
21728
  window.postMessage({ type: "ow:media-key-drop", token }, "*");
21086
21729
  }
21087
21730
  }, []);
21088
- const clearMediaSelectionRef = (0, import_react19.useRef)(clearMediaSelection);
21731
+ const clearMediaSelectionRef = (0, import_react20.useRef)(clearMediaSelection);
21089
21732
  clearMediaSelectionRef.current = clearMediaSelection;
21090
- const selectMediaElement = (0, import_react19.useCallback)((el) => {
21733
+ const selectMediaElement = (0, import_react20.useCallback)((el) => {
21091
21734
  const r2 = el.getBoundingClientRect();
21092
21735
  const video = el.dataset.ohwEditable === "video" ? el.querySelector("video") : null;
21093
21736
  selectedMediaElRef.current = el;
@@ -21111,9 +21754,9 @@ function OhhwellsBridge() {
21111
21754
  keyLabel: el.dataset.ohwEditable === "video" ? "Video" : el.dataset.ohwEditable === "bg-image" ? "Background" : "Image"
21112
21755
  });
21113
21756
  }, []);
21114
- const selectMediaElementRef = (0, import_react19.useRef)(selectMediaElement);
21757
+ const selectMediaElementRef = (0, import_react20.useRef)(selectMediaElement);
21115
21758
  selectMediaElementRef.current = selectMediaElement;
21116
- (0, import_react19.useEffect)(() => {
21759
+ (0, import_react20.useEffect)(() => {
21117
21760
  if (!selectedMedia) return;
21118
21761
  const update = () => {
21119
21762
  const el = selectedMediaElRef.current;
@@ -21133,54 +21776,54 @@ function OhhwellsBridge() {
21133
21776
  window.removeEventListener("resize", update);
21134
21777
  };
21135
21778
  }, [selectedMedia !== null]);
21136
- const [carouselHover, setCarouselHover] = (0, import_react19.useState)(null);
21137
- const [uploadingRects, setUploadingRects] = (0, import_react19.useState)({});
21138
- const hoveredGapRef = (0, import_react19.useRef)(null);
21139
- const imageUnhoverTimerRef = (0, import_react19.useRef)(null);
21140
- const imageShowTimerRef = (0, import_react19.useRef)(null);
21141
- const editStylesRef = (0, import_react19.useRef)(null);
21142
- const activateRef = (0, import_react19.useRef)(() => {
21779
+ const [carouselHover, setCarouselHover] = (0, import_react20.useState)(null);
21780
+ const [uploadingRects, setUploadingRects] = (0, import_react20.useState)({});
21781
+ const hoveredGapRef = (0, import_react20.useRef)(null);
21782
+ const imageUnhoverTimerRef = (0, import_react20.useRef)(null);
21783
+ const imageShowTimerRef = (0, import_react20.useRef)(null);
21784
+ const editStylesRef = (0, import_react20.useRef)(null);
21785
+ const activateRef = (0, import_react20.useRef)(() => {
21143
21786
  });
21144
- const deactivateRef = (0, import_react19.useRef)(() => {
21787
+ const deactivateRef = (0, import_react20.useRef)(() => {
21145
21788
  });
21146
- const selectRef = (0, import_react19.useRef)(() => {
21789
+ const selectRef = (0, import_react20.useRef)(() => {
21147
21790
  });
21148
- const selectFrameRef = (0, import_react19.useRef)(() => {
21791
+ const selectFrameRef = (0, import_react20.useRef)(() => {
21149
21792
  });
21150
- const selectLogoRef = (0, import_react19.useRef)(() => {
21793
+ const selectLogoRef = (0, import_react20.useRef)(() => {
21151
21794
  });
21152
- const openLogoSizePanelRef = (0, import_react19.useRef)(() => {
21795
+ const openLogoSizePanelRef = (0, import_react20.useRef)(() => {
21153
21796
  });
21154
- const deselectRef = (0, import_react19.useRef)(() => {
21797
+ const deselectRef = (0, import_react20.useRef)(() => {
21155
21798
  });
21156
- const closeFloatingPanelOnlyRef = (0, import_react19.useRef)(() => {
21799
+ const closeFloatingPanelOnlyRef = (0, import_react20.useRef)(() => {
21157
21800
  });
21158
- const reselectNavigationItemRef = (0, import_react19.useRef)(() => {
21801
+ const reselectNavigationItemRef = (0, import_react20.useRef)(() => {
21159
21802
  });
21160
- const commitNavigationTextEditRef = (0, import_react19.useRef)(() => {
21803
+ const commitNavigationTextEditRef = (0, import_react20.useRef)(() => {
21161
21804
  });
21162
- const handleDeleteSelectedRef = (0, import_react19.useRef)(() => false);
21163
- const runPendingDeleteUndoRef = (0, import_react19.useRef)(() => false);
21164
- const isFooterFrameSelectionRef = (0, import_react19.useRef)(false);
21165
- const refreshActiveCommandsRef = (0, import_react19.useRef)(() => {
21805
+ const handleDeleteSelectedRef = (0, import_react20.useRef)(() => false);
21806
+ const runPendingDeleteUndoRef = (0, import_react20.useRef)(() => false);
21807
+ const isFooterFrameSelectionRef = (0, import_react20.useRef)(false);
21808
+ const refreshActiveCommandsRef = (0, import_react20.useRef)(() => {
21166
21809
  });
21167
- const postToParentRef = (0, import_react19.useRef)(postToParent2);
21810
+ const postToParentRef = (0, import_react20.useRef)(postToParent2);
21168
21811
  postToParentRef.current = postToParent2;
21169
- const aiSectionApiRef = (0, import_react19.useRef)(null);
21170
- const sectionsLoadedRef = (0, import_react19.useRef)(false);
21171
- const pendingScheduleConfigRequests = (0, import_react19.useRef)([]);
21172
- const [toolbarRect, setToolbarRect] = (0, import_react19.useState)(null);
21173
- const [formPickRect, setFormPickRect] = (0, import_react19.useState)(null);
21174
- const formPickElRef = (0, import_react19.useRef)(null);
21175
- const [formViewState, setFormViewStateUi] = (0, import_react19.useState)("default");
21176
- const [formPickCount, setFormPickCount] = (0, import_react19.useState)(null);
21177
- const [formHoverRect, setFormHoverRect] = (0, import_react19.useState)(null);
21178
- const formHoverElRef = (0, import_react19.useRef)(null);
21179
- const [fieldPickRect, setFieldPickRect] = (0, import_react19.useState)(null);
21180
- const fieldPickElRef = (0, import_react19.useRef)(null);
21181
- const [fieldPickState, setFieldPickState] = (0, import_react19.useState)(null);
21182
- const [fieldTypePickerOpen, setFieldTypePickerOpen] = (0, import_react19.useState)(false);
21183
- const clearFormPick = (0, import_react19.useCallback)(() => {
21812
+ const aiSectionApiRef = (0, import_react20.useRef)(null);
21813
+ const sectionsLoadedRef = (0, import_react20.useRef)(false);
21814
+ const pendingScheduleConfigRequests = (0, import_react20.useRef)([]);
21815
+ const [toolbarRect, setToolbarRect] = (0, import_react20.useState)(null);
21816
+ const [formPickRect, setFormPickRect] = (0, import_react20.useState)(null);
21817
+ const formPickElRef = (0, import_react20.useRef)(null);
21818
+ const [formViewState, setFormViewStateUi] = (0, import_react20.useState)("default");
21819
+ const [formPickCount, setFormPickCount] = (0, import_react20.useState)(null);
21820
+ const [formHoverRect, setFormHoverRect] = (0, import_react20.useState)(null);
21821
+ const formHoverElRef = (0, import_react20.useRef)(null);
21822
+ const [fieldPickRect, setFieldPickRect] = (0, import_react20.useState)(null);
21823
+ const fieldPickElRef = (0, import_react20.useRef)(null);
21824
+ const [fieldPickState, setFieldPickState] = (0, import_react20.useState)(null);
21825
+ const [fieldTypePickerOpen, setFieldTypePickerOpen] = (0, import_react20.useState)(false);
21826
+ const clearFormPick = (0, import_react20.useCallback)(() => {
21184
21827
  const form = formPickElRef.current;
21185
21828
  const editing = fieldPickElRef.current;
21186
21829
  if (commitPlaceholderEdit(editing) && editing) {
@@ -21200,7 +21843,7 @@ function OhhwellsBridge() {
21200
21843
  formPickElRef.current = null;
21201
21844
  setFormPickRect(null);
21202
21845
  }, []);
21203
- const clearFieldPick = (0, import_react19.useCallback)(() => {
21846
+ const clearFieldPick = (0, import_react20.useCallback)(() => {
21204
21847
  const wrapper = fieldPickElRef.current;
21205
21848
  if (commitPlaceholderEdit(wrapper) && wrapper) {
21206
21849
  const form = wrapper.closest('[data-ohw-editable="form"]');
@@ -21210,9 +21853,9 @@ function OhhwellsBridge() {
21210
21853
  setFieldPickRect(null);
21211
21854
  setFieldPickState(null);
21212
21855
  }, []);
21213
- const persistFieldsRef = (0, import_react19.useRef)(() => {
21856
+ const persistFieldsRef = (0, import_react20.useRef)(() => {
21214
21857
  });
21215
- const persistFields = (0, import_react19.useCallback)(
21858
+ const persistFields = (0, import_react20.useCallback)(
21216
21859
  (form) => {
21217
21860
  const key = formKeyOf(form);
21218
21861
  if (!key) return;
@@ -21223,7 +21866,7 @@ function OhhwellsBridge() {
21223
21866
  []
21224
21867
  );
21225
21868
  persistFieldsRef.current = persistFields;
21226
- const selectField = (0, import_react19.useCallback)((wrapper) => {
21869
+ const selectField = (0, import_react20.useCallback)((wrapper) => {
21227
21870
  if (fieldPickElRef.current && fieldPickElRef.current !== wrapper) {
21228
21871
  commitPlaceholderEdit(fieldPickElRef.current);
21229
21872
  }
@@ -21236,7 +21879,7 @@ function OhhwellsBridge() {
21236
21879
  setFieldPickState({ type: fieldTypeOf(wrapper), required: isFieldRequired(wrapper) });
21237
21880
  setFieldTypePickerOpen(false);
21238
21881
  }, []);
21239
- const withSelectedField = (0, import_react19.useCallback)(
21882
+ const withSelectedField = (0, import_react20.useCallback)(
21240
21883
  (run) => {
21241
21884
  const wrapper = fieldPickElRef.current;
21242
21885
  const form = formPickElRef.current;
@@ -21249,28 +21892,28 @@ function OhhwellsBridge() {
21249
21892
  },
21250
21893
  [persistFields]
21251
21894
  );
21252
- const handleFieldTypeChange = (0, import_react19.useCallback)(
21895
+ const handleFieldTypeChange = (0, import_react20.useCallback)(
21253
21896
  (type) => withSelectedField((_form, wrapper) => {
21254
21897
  applyFieldType(wrapper, type);
21255
21898
  selectField(wrapper);
21256
21899
  }),
21257
21900
  [selectField, withSelectedField]
21258
21901
  );
21259
- const handleFieldRequiredToggle = (0, import_react19.useCallback)(
21902
+ const handleFieldRequiredToggle = (0, import_react20.useCallback)(
21260
21903
  () => withSelectedField((_form, wrapper) => {
21261
21904
  setFieldRequired(wrapper, !isFieldRequired(wrapper));
21262
21905
  selectField(wrapper);
21263
21906
  }),
21264
21907
  [selectField, withSelectedField]
21265
21908
  );
21266
- const handleFieldDuplicate = (0, import_react19.useCallback)(
21909
+ const handleFieldDuplicate = (0, import_react20.useCallback)(
21267
21910
  () => withSelectedField((form, wrapper) => {
21268
21911
  const copy = duplicateField(form, wrapper);
21269
21912
  selectField(copy);
21270
21913
  }),
21271
21914
  [selectField, withSelectedField]
21272
21915
  );
21273
- const handleFieldDelete = (0, import_react19.useCallback)(
21916
+ const handleFieldDelete = (0, import_react20.useCallback)(
21274
21917
  () => withSelectedField((_form, wrapper) => {
21275
21918
  removeField(wrapper);
21276
21919
  clearFieldPick();
@@ -21278,7 +21921,7 @@ function OhhwellsBridge() {
21278
21921
  }),
21279
21922
  [clearFieldPick, withSelectedField]
21280
21923
  );
21281
- const handleAddField = (0, import_react19.useCallback)(
21924
+ const handleAddField = (0, import_react20.useCallback)(
21282
21925
  (type) => {
21283
21926
  const form = formPickElRef.current;
21284
21927
  if (!form) return;
@@ -21294,8 +21937,8 @@ function OhhwellsBridge() {
21294
21937
  },
21295
21938
  [persistFields, selectField]
21296
21939
  );
21297
- const fieldDragRef = (0, import_react19.useRef)(null);
21298
- const buildFieldDropSlots = (0, import_react19.useCallback)((form, draggedKey) => {
21940
+ const fieldDragRef = (0, import_react20.useRef)(null);
21941
+ const buildFieldDropSlots = (0, import_react20.useCallback)((form, draggedKey) => {
21299
21942
  const others = listFieldWrappers(form).filter((el) => fieldKeyOf(el) !== draggedKey);
21300
21943
  const slots = others.map((el) => {
21301
21944
  const rect = el.getBoundingClientRect();
@@ -21308,7 +21951,7 @@ function OhhwellsBridge() {
21308
21951
  }
21309
21952
  return slots;
21310
21953
  }, []);
21311
- const handleFieldDragStart = (0, import_react19.useCallback)(() => {
21954
+ const handleFieldDragStart = (0, import_react20.useCallback)(() => {
21312
21955
  const wrapper = fieldPickElRef.current;
21313
21956
  const form = formPickElRef.current;
21314
21957
  if (!wrapper || !form) return;
@@ -21317,18 +21960,18 @@ function OhhwellsBridge() {
21317
21960
  setFieldDragging(true);
21318
21961
  setFieldDropSlots(buildFieldDropSlots(form, key));
21319
21962
  }, [buildFieldDropSlots]);
21320
- const handleFieldDragEnd = (0, import_react19.useCallback)(() => {
21963
+ const handleFieldDragEnd = (0, import_react20.useCallback)(() => {
21321
21964
  fieldDragRef.current = null;
21322
21965
  setFieldDropIndex(null);
21323
21966
  setFieldDropSlots([]);
21324
21967
  setFieldDragging(false);
21325
21968
  }, []);
21326
- const [fieldDropIndex, setFieldDropIndex] = (0, import_react19.useState)(null);
21327
- const [fieldDropSlots, setFieldDropSlots] = (0, import_react19.useState)([]);
21328
- const [fieldDragging, setFieldDragging] = (0, import_react19.useState)(false);
21329
- const clearFormPickRef = (0, import_react19.useRef)(clearFormPick);
21969
+ const [fieldDropIndex, setFieldDropIndex] = (0, import_react20.useState)(null);
21970
+ const [fieldDropSlots, setFieldDropSlots] = (0, import_react20.useState)([]);
21971
+ const [fieldDragging, setFieldDragging] = (0, import_react20.useState)(false);
21972
+ const clearFormPickRef = (0, import_react20.useRef)(clearFormPick);
21330
21973
  clearFormPickRef.current = clearFormPick;
21331
- (0, import_react19.useEffect)(() => {
21974
+ (0, import_react20.useEffect)(() => {
21332
21975
  const el = fieldPickElRef.current;
21333
21976
  if (!el || fieldPickRect === null) return;
21334
21977
  const observer = new ResizeObserver(() => {
@@ -21337,7 +21980,7 @@ function OhhwellsBridge() {
21337
21980
  observer.observe(el);
21338
21981
  return () => observer.disconnect();
21339
21982
  }, [fieldPickRect !== null, fieldPickState]);
21340
- (0, import_react19.useEffect)(() => {
21983
+ (0, import_react20.useEffect)(() => {
21341
21984
  const el = formPickElRef.current;
21342
21985
  if (!el || formPickRect === null) return;
21343
21986
  const observer = new ResizeObserver(() => {
@@ -21346,25 +21989,25 @@ function OhhwellsBridge() {
21346
21989
  observer.observe(el);
21347
21990
  return () => observer.disconnect();
21348
21991
  }, [formPickRect !== null, formViewState]);
21349
- const [toolbarVariant, setToolbarVariant] = (0, import_react19.useState)("none");
21350
- const toolbarVariantRef = (0, import_react19.useRef)("none");
21992
+ const [toolbarVariant, setToolbarVariant] = (0, import_react20.useState)("none");
21993
+ const toolbarVariantRef = (0, import_react20.useRef)("none");
21351
21994
  toolbarVariantRef.current = toolbarVariant;
21352
- const [selectedIsCta, setSelectedIsCta] = (0, import_react19.useState)(false);
21353
- const [selectedIsSocial, setSelectedIsSocial] = (0, import_react19.useState)(false);
21354
- const [selectedIsSocialsRow, setSelectedIsSocialsRow] = (0, import_react19.useState)(false);
21355
- const [reorderHrefKey, setReorderHrefKey] = (0, import_react19.useState)(null);
21356
- const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react19.useState)(false);
21357
- const [toggleState, setToggleState] = (0, import_react19.useState)(null);
21358
- const [maxBadge, setMaxBadge] = (0, import_react19.useState)(null);
21359
- const [activeCommands, setActiveCommands] = (0, import_react19.useState)(/* @__PURE__ */ new Set());
21360
- const [sectionGap, setSectionGap] = (0, import_react19.useState)(null);
21361
- const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react19.useState)(false);
21362
- const hoveredNavContainerRef = (0, import_react19.useRef)(null);
21363
- const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react19.useState)(null);
21364
- const hoveredItemElRef = (0, import_react19.useRef)(null);
21365
- const [hoveredItemRect, setHoveredItemRect] = (0, import_react19.useState)(null);
21366
- const [hoveredTextRect, setHoveredTextRect] = (0, import_react19.useState)(null);
21367
- (0, import_react19.useEffect)(() => {
21995
+ const [selectedIsCta, setSelectedIsCta] = (0, import_react20.useState)(false);
21996
+ const [selectedIsSocial, setSelectedIsSocial] = (0, import_react20.useState)(false);
21997
+ const [selectedIsSocialsRow, setSelectedIsSocialsRow] = (0, import_react20.useState)(false);
21998
+ const [reorderHrefKey, setReorderHrefKey] = (0, import_react20.useState)(null);
21999
+ const [reorderDragDisabled, setReorderDragDisabled] = (0, import_react20.useState)(false);
22000
+ const [toggleState, setToggleState] = (0, import_react20.useState)(null);
22001
+ const [maxBadge, setMaxBadge] = (0, import_react20.useState)(null);
22002
+ const [activeCommands, setActiveCommands] = (0, import_react20.useState)(/* @__PURE__ */ new Set());
22003
+ const [sectionGap, setSectionGap] = (0, import_react20.useState)(null);
22004
+ const [toolbarShowEditLink, setToolbarShowEditLink] = (0, import_react20.useState)(false);
22005
+ const hoveredNavContainerRef = (0, import_react20.useRef)(null);
22006
+ const [hoveredNavContainerRect, setHoveredNavContainerRect] = (0, import_react20.useState)(null);
22007
+ const hoveredItemElRef = (0, import_react20.useRef)(null);
22008
+ const [hoveredItemRect, setHoveredItemRect] = (0, import_react20.useState)(null);
22009
+ const [hoveredTextRect, setHoveredTextRect] = (0, import_react20.useState)(null);
22010
+ (0, import_react20.useEffect)(() => {
21368
22011
  const sync = () => {
21369
22012
  const el = document.querySelector(
21370
22013
  '[data-ohw-hovered]:not([contenteditable]):not([data-ohw-href-key]):not([data-ohw-editable="form"] *)'
@@ -21408,60 +22051,71 @@ function OhhwellsBridge() {
21408
22051
  });
21409
22052
  return () => observer.disconnect();
21410
22053
  }, []);
21411
- const siblingHintElRef = (0, import_react19.useRef)(null);
21412
- const [siblingHintRect, setSiblingHintRect] = (0, import_react19.useState)(null);
21413
- const [siblingHintRects, setSiblingHintRects] = (0, import_react19.useState)([]);
21414
- const [isItemDragging, setIsItemDragging] = (0, import_react19.useState)(false);
21415
- const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react19.useState)(false);
22054
+ const siblingHintElRef = (0, import_react20.useRef)(null);
22055
+ const [siblingHintRect, setSiblingHintRect] = (0, import_react20.useState)(null);
22056
+ const [siblingHintRects, setSiblingHintRects] = (0, import_react20.useState)([]);
22057
+ const [isItemDragging, setIsItemDragging] = (0, import_react20.useState)(false);
22058
+ const [isFooterFrameSelection, setIsFooterFrameSelection] = (0, import_react20.useState)(false);
21416
22059
  isFooterFrameSelectionRef.current = isFooterFrameSelection;
21417
- const [floatingPanel, setFloatingPanel] = (0, import_react19.useState)(null);
21418
- const floatingPanelOpenRef = (0, import_react19.useRef)(false);
21419
- floatingPanelOpenRef.current = floatingPanel !== null;
21420
- const floatingPanelRef = (0, import_react19.useRef)(null);
21421
- floatingPanelRef.current = floatingPanel;
21422
- const [floatingPanelPos, setFloatingPanelPos] = (0, import_react19.useState)(null);
21423
- const buttonCollectionDragRef = (0, import_react19.useRef)(null);
21424
- const buttonDropInsertIndexRef = (0, import_react19.useRef)(null);
21425
- const [buttonDropSlots, setButtonDropSlots] = (0, import_react19.useState)([]);
21426
- const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react19.useState)(null);
21427
- const buttonPointerDragRef = (0, import_react19.useRef)(null);
21428
- const [buttonStyleTick, setButtonStyleTick] = (0, import_react19.useState)(0);
21429
- const [logoSizeDraft, setLogoSizeDraft] = (0, import_react19.useState)(null);
21430
- const [editorViewport, setEditorViewport] = (0, import_react19.useState)("desktop");
21431
- const [parentScrollSnap, setParentScrollSnap] = (0, import_react19.useState)(null);
21432
- const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react19.useState)(null);
21433
- const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react19.useState)(null);
21434
- const footerDragRef = (0, import_react19.useRef)(null);
21435
- const [footerDropSlots, setFooterDropSlots] = (0, import_react19.useState)([]);
21436
- const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react19.useState)(null);
21437
- const [draggedItemRect, setDraggedItemRect] = (0, import_react19.useState)(null);
21438
- const footerPointerDragRef = (0, import_react19.useRef)(null);
21439
- const suppressNextClickRef = (0, import_react19.useRef)(false);
21440
- const suppressClickUntilRef = (0, import_react19.useRef)(0);
21441
- const [linkPopover, setLinkPopover] = (0, import_react19.useState)(null);
21442
- const linkPopoverSessionRef = (0, import_react19.useRef)(null);
21443
- const addNavAfterAnchorRef = (0, import_react19.useRef)(null);
21444
- const editContentRef = (0, import_react19.useRef)({});
21445
- const aiSectionsRef = (0, import_react19.useRef)("");
21446
- const applyTreeLocalRef = (0, import_react19.useRef)(
22060
+ const [navDropdownPreviewOpen, setNavDropdownPreviewOpen] = (0, import_react20.useState)(null);
22061
+ const [footerHeadingVisible, setFooterHeadingVisible] = (0, import_react20.useState)(null);
22062
+ const footerDragRef = (0, import_react20.useRef)(null);
22063
+ const [footerDropSlots, setFooterDropSlots] = (0, import_react20.useState)([]);
22064
+ const [activeFooterDropIndex, setActiveFooterDropIndex] = (0, import_react20.useState)(null);
22065
+ const [draggedItemRect, setDraggedItemRect] = (0, import_react20.useState)(null);
22066
+ const footerPointerDragRef = (0, import_react20.useRef)(null);
22067
+ const suppressNextClickRef = (0, import_react20.useRef)(false);
22068
+ const suppressClickUntilRef = (0, import_react20.useRef)(0);
22069
+ const [linkPopover, setLinkPopover] = (0, import_react20.useState)(null);
22070
+ const linkPopoverSessionRef = (0, import_react20.useRef)(null);
22071
+ const addNavAfterAnchorRef = (0, import_react20.useRef)(null);
22072
+ const editContentRef = (0, import_react20.useRef)({});
22073
+ const aiSectionsRef = (0, import_react20.useRef)("");
22074
+ const applyTreeLocalRef = (0, import_react20.useRef)(
21447
22075
  null
21448
22076
  );
21449
- const clearInteractionChromeRef = (0, import_react19.useRef)(() => {
22077
+ const clearInteractionChromeRef = (0, import_react20.useRef)(() => {
21450
22078
  });
21451
- const brandKitRef = (0, import_react19.useRef)("");
21452
- const stylesRef = (0, import_react19.useRef)("");
21453
- const appliedDrawerRef = (0, import_react19.useRef)(null);
21454
- const pendingDeleteUndoRef = (0, import_react19.useRef)(null);
21455
- const [sitePages, setSitePages] = (0, import_react19.useState)([]);
21456
- const [sectionsByPath, setSectionsByPath] = (0, import_react19.useState)({});
21457
- const sectionsPrefetchGenRef = (0, import_react19.useRef)(0);
21458
- const setLinkPopoverRef = (0, import_react19.useRef)(setLinkPopover);
21459
- const linkPopoverPanelRef = (0, import_react19.useRef)(null);
21460
- const linkPopoverOpenRef = (0, import_react19.useRef)(false);
21461
- const linkPopoverGraceUntilRef = (0, import_react19.useRef)(0);
22079
+ const brandKitRef = (0, import_react20.useRef)("");
22080
+ const stylesRef = (0, import_react20.useRef)("");
22081
+ const appliedDrawerRef = (0, import_react20.useRef)(null);
22082
+ const pendingDeleteUndoRef = (0, import_react20.useRef)(null);
22083
+ const [floatingPanel, setFloatingPanel] = (0, import_react20.useState)(null);
22084
+ const floatingPanelOpenRef = (0, import_react20.useRef)(false);
22085
+ const floatingPanelRef = (0, import_react20.useRef)(null);
22086
+ floatingPanelRef.current = floatingPanel;
22087
+ const setFloatingPanelRef = (0, import_react20.useRef)(setFloatingPanel);
22088
+ const [floatingPanelPos, setFloatingPanelPos] = (0, import_react20.useState)(null);
22089
+ const buttonCollectionDragRef = (0, import_react20.useRef)(null);
22090
+ const buttonDropInsertIndexRef = (0, import_react20.useRef)(null);
22091
+ const [buttonDropSlots, setButtonDropSlots] = (0, import_react20.useState)([]);
22092
+ const [activeButtonDropIndex, setActiveButtonDropIndex] = (0, import_react20.useState)(null);
22093
+ const buttonPointerDragRef = (0, import_react20.useRef)(null);
22094
+ const [buttonStyleTick, setButtonStyleTick] = (0, import_react20.useState)(0);
22095
+ const [logoSizeDraft, setLogoSizeDraft] = (0, import_react20.useState)(null);
22096
+ const [editorViewport, setEditorViewport] = (0, import_react20.useState)("desktop");
22097
+ const [parentScrollSnap, setParentScrollSnap] = (0, import_react20.useState)(null);
22098
+ const [sitePages, setSitePages] = (0, import_react20.useState)([]);
22099
+ const [sectionsByPath, setSectionsByPath] = (0, import_react20.useState)({});
22100
+ const sectionsPrefetchGenRef = (0, import_react20.useRef)(0);
22101
+ const setLinkPopoverRef = (0, import_react20.useRef)(setLinkPopover);
22102
+ const linkPopoverPanelRef = (0, import_react20.useRef)(null);
22103
+ const linkPopoverOpenRef = (0, import_react20.useRef)(false);
22104
+ const linkPopoverGraceUntilRef = (0, import_react20.useRef)(0);
21462
22105
  setLinkPopoverRef.current = setLinkPopover;
22106
+ setFloatingPanelRef.current = setFloatingPanel;
21463
22107
  linkPopoverSessionRef.current = linkPopover;
21464
- (0, import_react19.useEffect)(() => {
22108
+ floatingPanelOpenRef.current = Boolean(floatingPanel);
22109
+ (0, import_react20.useEffect)(() => {
22110
+ const syncViewport = () => {
22111
+ const next = window.innerWidth <= 480 ? "mobile" : "desktop";
22112
+ setEditorViewport((prev) => prev === next ? prev : next);
22113
+ };
22114
+ syncViewport();
22115
+ window.addEventListener("resize", syncViewport);
22116
+ return () => window.removeEventListener("resize", syncViewport);
22117
+ }, []);
22118
+ (0, import_react20.useEffect)(() => {
21465
22119
  setSectionOrderPersistHandler((entries) => {
21466
22120
  const currentPath = window.location.pathname;
21467
22121
  const merged = mergePageSectionOrder(editContentRef.current[SECTION_ORDER_KEY], currentPath, entries);
@@ -21517,7 +22171,7 @@ function OhhwellsBridge() {
21517
22171
  const bumpLinkPopoverGrace = () => {
21518
22172
  linkPopoverGraceUntilRef.current = Date.now() + 350;
21519
22173
  };
21520
- const runSectionsPrefetch = (0, import_react19.useCallback)((pages) => {
22174
+ const runSectionsPrefetch = (0, import_react20.useCallback)((pages) => {
21521
22175
  if (!isEditMode || shouldUseDevFixtures() || pages.length === 0) return;
21522
22176
  const gen = ++sectionsPrefetchGenRef.current;
21523
22177
  const paths = pages.map((p) => p.path);
@@ -21536,9 +22190,9 @@ function OhhwellsBridge() {
21536
22190
  );
21537
22191
  });
21538
22192
  }, [isEditMode, pathname]);
21539
- const runSectionsPrefetchRef = (0, import_react19.useRef)(runSectionsPrefetch);
22193
+ const runSectionsPrefetchRef = (0, import_react20.useRef)(runSectionsPrefetch);
21540
22194
  runSectionsPrefetchRef.current = runSectionsPrefetch;
21541
- (0, import_react19.useEffect)(() => {
22195
+ (0, import_react20.useEffect)(() => {
21542
22196
  if (!linkPopover) {
21543
22197
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
21544
22198
  return;
@@ -21566,7 +22220,7 @@ function OhhwellsBridge() {
21566
22220
  document.documentElement.removeAttribute("data-ohw-link-popover-open");
21567
22221
  };
21568
22222
  }, [linkPopover, postToParent2]);
21569
- (0, import_react19.useEffect)(() => {
22223
+ (0, import_react20.useEffect)(() => {
21570
22224
  if (!isEditMode) return;
21571
22225
  const useFixtures = shouldUseDevFixtures();
21572
22226
  if (useFixtures) {
@@ -21590,14 +22244,14 @@ function OhhwellsBridge() {
21590
22244
  if (!useFixtures) postToParent2({ type: "ow:request-site-pages" });
21591
22245
  return () => window.removeEventListener("message", onSitePages);
21592
22246
  }, [isEditMode, postToParent2]);
21593
- (0, import_react19.useEffect)(() => {
22247
+ (0, import_react20.useEffect)(() => {
21594
22248
  if (!isEditMode || shouldUseDevFixtures()) return;
21595
22249
  void loadAllSectionsManifest().then((manifest) => {
21596
22250
  if (Object.keys(manifest).length === 0) return;
21597
22251
  setSectionsByPath((prev) => ({ ...manifest, ...prev }));
21598
22252
  });
21599
22253
  }, [isEditMode]);
21600
- (0, import_react19.useEffect)(() => {
22254
+ (0, import_react20.useEffect)(() => {
21601
22255
  const update = () => {
21602
22256
  const el = activeElRef.current ?? selectedElRef.current;
21603
22257
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
@@ -21621,10 +22275,10 @@ function OhhwellsBridge() {
21621
22275
  vvp.removeEventListener("resize", update);
21622
22276
  };
21623
22277
  }, []);
21624
- const refreshStateRules = (0, import_react19.useCallback)(() => {
22278
+ const refreshStateRules = (0, import_react20.useCallback)(() => {
21625
22279
  editStylesRef.current?.forceHover && (editStylesRef.current.forceHover.textContent = collectStateRules());
21626
22280
  }, []);
21627
- const processConfigRequest = (0, import_react19.useCallback)((insertAfterVal) => {
22281
+ const processConfigRequest = (0, import_react20.useCallback)((insertAfterVal) => {
21628
22282
  const tracker = getSectionsTracker();
21629
22283
  let entries = [];
21630
22284
  try {
@@ -21647,7 +22301,7 @@ function OhhwellsBridge() {
21647
22301
  }
21648
22302
  window.postMessage({ type: "ow:schedule-config", insertAfter: insertAfterVal, scheduleId: null }, "*");
21649
22303
  }, [isEditMode]);
21650
- const deactivate = (0, import_react19.useCallback)(() => {
22304
+ const deactivate = (0, import_react20.useCallback)(() => {
21651
22305
  const el = activeElRef.current;
21652
22306
  if (!el) return;
21653
22307
  const isFormBlock = el.dataset.ohwEditable === "form";
@@ -21698,12 +22352,12 @@ function OhhwellsBridge() {
21698
22352
  setToolbarShowEditLink(false);
21699
22353
  postToParent2({ type: "ow:exit-edit" });
21700
22354
  }, [postToParent2]);
21701
- const clearSelectedAttr = (0, import_react19.useCallback)(() => {
22355
+ const clearSelectedAttr = (0, import_react20.useCallback)(() => {
21702
22356
  document.querySelectorAll("[data-ohw-selected]").forEach((el) => {
21703
22357
  el.removeAttribute("data-ohw-selected");
21704
22358
  });
21705
22359
  }, []);
21706
- const deselect = (0, import_react19.useCallback)(() => {
22360
+ const deselect = (0, import_react20.useCallback)(() => {
21707
22361
  const nestedGroup = selectedElRef.current?.closest("[data-ohw-nav-children]") != null ? selectedElRef.current.closest("[data-ohw-nav-group]") : null;
21708
22362
  clearSelectedAttr();
21709
22363
  selectedElRef.current = null;
@@ -21738,20 +22392,20 @@ function OhhwellsBridge() {
21738
22392
  setToolbarVariant("none");
21739
22393
  }
21740
22394
  }, [clearSelectedAttr]);
21741
- const markSelected = (0, import_react19.useCallback)((el) => {
22395
+ const markSelected = (0, import_react20.useCallback)((el) => {
21742
22396
  clearSelectedAttr();
21743
22397
  el.removeAttribute("data-ohw-hovered");
21744
22398
  el.setAttribute("data-ohw-selected", "");
21745
22399
  }, [clearSelectedAttr]);
21746
- const isSelectedForHover = (0, import_react19.useCallback)((el) => {
22400
+ const isSelectedForHover = (0, import_react20.useCallback)((el) => {
21747
22401
  if (!el) return false;
21748
22402
  return [selectedElRef.current, activeElRef.current].some(
21749
22403
  (busy) => busy && (el === busy || busy.contains(el) || el.contains(busy))
21750
22404
  );
21751
22405
  }, []);
21752
- const isSelectedForHoverRef = (0, import_react19.useRef)(isSelectedForHover);
22406
+ const isSelectedForHoverRef = (0, import_react20.useRef)(isSelectedForHover);
21753
22407
  isSelectedForHoverRef.current = isSelectedForHover;
21754
- const resolveHrefKeyElement = (0, import_react19.useCallback)((hrefKey) => {
22408
+ const resolveHrefKeyElement = (0, import_react20.useCallback)((hrefKey) => {
21755
22409
  if (isFooterHrefKey(hrefKey)) {
21756
22410
  return document.querySelector(
21757
22411
  `footer [data-ohw-href-key="${CSS.escape(hrefKey)}"]`
@@ -21766,7 +22420,7 @@ function OhhwellsBridge() {
21766
22420
  `[data-ohw-href-key="${CSS.escape(hrefKey)}"]`
21767
22421
  );
21768
22422
  }, []);
21769
- const resyncSelectedNavigationItem = (0, import_react19.useCallback)(() => {
22423
+ const resyncSelectedNavigationItem = (0, import_react20.useCallback)(() => {
21770
22424
  const hrefKey = selectedHrefKeyRef.current;
21771
22425
  if (hrefKey) {
21772
22426
  const link = resolveHrefKeyElement(hrefKey);
@@ -21804,7 +22458,7 @@ function OhhwellsBridge() {
21804
22458
  );
21805
22459
  }
21806
22460
  }, [resolveHrefKeyElement]);
21807
- const reselectNavigationItem = (0, import_react19.useCallback)((navAnchor) => {
22461
+ const reselectNavigationItem = (0, import_react20.useCallback)((navAnchor) => {
21808
22462
  selectedElRef.current = navAnchor;
21809
22463
  selectedHrefKeyRef.current = navAnchor.getAttribute("data-ohw-href-key");
21810
22464
  selectedFooterColAttrRef.current = null;
@@ -21835,7 +22489,7 @@ function OhhwellsBridge() {
21835
22489
  setToolbarShowEditLink(false);
21836
22490
  setActiveCommands(/* @__PURE__ */ new Set());
21837
22491
  }, [markSelected]);
21838
- const commitNavigationTextEdit = (0, import_react19.useCallback)((navAnchor) => {
22492
+ const commitNavigationTextEdit = (0, import_react20.useCallback)((navAnchor) => {
21839
22493
  const el = activeElRef.current;
21840
22494
  if (!el) return;
21841
22495
  const key = el.dataset.ohwKey;
@@ -21868,7 +22522,7 @@ function OhhwellsBridge() {
21868
22522
  postToParent2({ type: "ow:exit-edit" });
21869
22523
  reselectNavigationItem(navAnchor);
21870
22524
  }, [postToParent2, reselectNavigationItem]);
21871
- const handleAddTopLevelNavItem = (0, import_react19.useCallback)(() => {
22525
+ const handleAddTopLevelNavItem = (0, import_react20.useCallback)(() => {
21872
22526
  const items = listNavbarRootItems();
21873
22527
  addNavAfterAnchorRef.current = items[items.length - 1] ?? null;
21874
22528
  deselectRef.current();
@@ -21880,7 +22534,7 @@ function OhhwellsBridge() {
21880
22534
  intent: "add-nav"
21881
22535
  });
21882
22536
  }, []);
21883
- const maybeWarnNavLinkDropdownConflict = (0, import_react19.useCallback)(
22537
+ const maybeWarnNavLinkDropdownConflict = (0, import_react20.useCallback)(
21884
22538
  (anchor) => {
21885
22539
  if (!isNavbarHrefKey(anchor.getAttribute("data-ohw-href-key"))) return;
21886
22540
  if (!navDropdownsOpenOnClick()) return;
@@ -21893,7 +22547,7 @@ function OhhwellsBridge() {
21893
22547
  },
21894
22548
  [postToParent2]
21895
22549
  );
21896
- const handleNavDropdownOpenChange = (0, import_react19.useCallback)((open) => {
22550
+ const handleNavDropdownOpenChange = (0, import_react20.useCallback)((open) => {
21897
22551
  const selected = selectedElRef.current;
21898
22552
  if (!selected || !isNavigationItem2(selected)) return;
21899
22553
  if (isNestedNavChild(selected)) return;
@@ -21909,7 +22563,7 @@ function OhhwellsBridge() {
21909
22563
  }
21910
22564
  });
21911
22565
  }, []);
21912
- const handleFooterHeadingVisibleChange = (0, import_react19.useCallback)(
22566
+ const handleFooterHeadingVisibleChange = (0, import_react20.useCallback)(
21913
22567
  (visible) => {
21914
22568
  const selected = selectedElRef.current;
21915
22569
  if (!selected || !isFooterFrameSelectionRef.current) return;
@@ -21933,7 +22587,7 @@ function OhhwellsBridge() {
21933
22587
  },
21934
22588
  [postToParent2]
21935
22589
  );
21936
- const enterEditOnNewItem = (0, import_react19.useCallback)((anchor) => {
22590
+ const enterEditOnNewItem = (0, import_react20.useCallback)((anchor) => {
21937
22591
  const label = anchor.querySelector('[data-ohw-editable="text"]');
21938
22592
  if (!label) {
21939
22593
  selectRef.current(anchor);
@@ -21942,8 +22596,8 @@ function OhhwellsBridge() {
21942
22596
  setNavGroupForceOpen(anchor, true);
21943
22597
  activateRef.current(label);
21944
22598
  }, []);
21945
- const pendingSocialAddRef = (0, import_react19.useRef)(null);
21946
- const handleAddChildItem = (0, import_react19.useCallback)(() => {
22599
+ const pendingSocialAddRef = (0, import_react20.useRef)(null);
22600
+ const handleAddChildItem = (0, import_react20.useCallback)(() => {
21947
22601
  const selected = selectedElRef.current;
21948
22602
  if (!selected) return;
21949
22603
  const socialsRow = isSocialsRow(selected) ? selected : findSocialsRow(selected);
@@ -22054,7 +22708,7 @@ function OhhwellsBridge() {
22054
22708
  });
22055
22709
  });
22056
22710
  }, [enterEditOnNewItem, isFooterFrameSelection, maybeWarnNavLinkDropdownConflict, postToParent2]);
22057
- const handleAddFooterColumn = (0, import_react19.useCallback)(() => {
22711
+ const handleAddFooterColumn = (0, import_react20.useCallback)(() => {
22058
22712
  if (!canAddFooterColumn()) {
22059
22713
  postToParent2({
22060
22714
  type: "ow:toast",
@@ -22075,7 +22729,7 @@ function OhhwellsBridge() {
22075
22729
  selectRef.current(result.firstLink);
22076
22730
  });
22077
22731
  }, [postToParent2]);
22078
- const clearFooterDragVisuals = (0, import_react19.useCallback)(() => {
22732
+ const clearFooterDragVisuals = (0, import_react20.useCallback)(() => {
22079
22733
  footerDragRef.current = null;
22080
22734
  setSiblingHintRects([]);
22081
22735
  setFooterDropSlots([]);
@@ -22084,7 +22738,7 @@ function OhhwellsBridge() {
22084
22738
  setIsItemDragging(false);
22085
22739
  unlockFooterDragInteraction();
22086
22740
  }, []);
22087
- const refreshFooterDragVisuals = (0, import_react19.useCallback)((session, activeSlot, clientX, clientY) => {
22741
+ const refreshFooterDragVisuals = (0, import_react20.useCallback)((session, activeSlot, clientX, clientY) => {
22088
22742
  const dragged = session.draggedEl;
22089
22743
  setDraggedItemRect(dragged.getBoundingClientRect());
22090
22744
  if (typeof clientX === "number" && typeof clientY === "number") {
@@ -22116,13 +22770,13 @@ function OhhwellsBridge() {
22116
22770
  const activeIdx = activeSlot ? slots.findIndex((s) => s.insertIndex === activeSlot.insertIndex) : -1;
22117
22771
  setActiveFooterDropIndex(activeIdx >= 0 ? activeIdx : null);
22118
22772
  }, []);
22119
- const refreshFooterDragVisualsRef = (0, import_react19.useRef)(refreshFooterDragVisuals);
22773
+ const refreshFooterDragVisualsRef = (0, import_react20.useRef)(refreshFooterDragVisuals);
22120
22774
  refreshFooterDragVisualsRef.current = refreshFooterDragVisuals;
22121
- const commitFooterDragRef = (0, import_react19.useRef)(() => {
22775
+ const commitFooterDragRef = (0, import_react20.useRef)(() => {
22122
22776
  });
22123
- const beginFooterDragRef = (0, import_react19.useRef)(() => {
22777
+ const beginFooterDragRef = (0, import_react20.useRef)(() => {
22124
22778
  });
22125
- const beginFooterDrag = (0, import_react19.useCallback)(
22779
+ const beginFooterDrag = (0, import_react20.useCallback)(
22126
22780
  (session) => {
22127
22781
  const rect = session.draggedEl.getBoundingClientRect();
22128
22782
  session.lastClientX = session.lastClientX || rect.left + rect.width / 2;
@@ -22142,7 +22796,7 @@ function OhhwellsBridge() {
22142
22796
  [refreshFooterDragVisuals]
22143
22797
  );
22144
22798
  beginFooterDragRef.current = beginFooterDrag;
22145
- const commitFooterDrag = (0, import_react19.useCallback)(
22799
+ const commitFooterDrag = (0, import_react20.useCallback)(
22146
22800
  (clientX, clientY) => {
22147
22801
  const session = footerDragRef.current;
22148
22802
  if (!session) {
@@ -22271,7 +22925,7 @@ function OhhwellsBridge() {
22271
22925
  [clearFooterDragVisuals, resolveHrefKeyElement, resyncSelectedNavigationItem]
22272
22926
  );
22273
22927
  commitFooterDragRef.current = commitFooterDrag;
22274
- const startFooterLinkDrag = (0, import_react19.useCallback)(
22928
+ const startFooterLinkDrag = (0, import_react20.useCallback)(
22275
22929
  (anchor, clientX, clientY, wasSelected) => {
22276
22930
  const hrefKey = anchor.getAttribute("data-ohw-href-key");
22277
22931
  if (!hrefKey) return false;
@@ -22307,7 +22961,7 @@ function OhhwellsBridge() {
22307
22961
  },
22308
22962
  [beginFooterDrag]
22309
22963
  );
22310
- const startFooterColumnDrag = (0, import_react19.useCallback)(
22964
+ const startFooterColumnDrag = (0, import_react20.useCallback)(
22311
22965
  (columnEl, clientX, clientY, wasSelected) => {
22312
22966
  const columns = listFooterColumns();
22313
22967
  const idx = columns.indexOf(columnEl);
@@ -22327,7 +22981,7 @@ function OhhwellsBridge() {
22327
22981
  },
22328
22982
  [beginFooterDrag]
22329
22983
  );
22330
- const persistButtonCollectionDrag = (0, import_react19.useCallback)(
22984
+ const persistButtonCollectionDrag = (0, import_react20.useCallback)(
22331
22985
  (button, clientX) => {
22332
22986
  const insertIndex = buttonDropInsertIndexRef.current;
22333
22987
  if (insertIndex != null) insertButtonAtCollectionIndex(button, insertIndex);
@@ -22351,7 +23005,7 @@ function OhhwellsBridge() {
22351
23005
  },
22352
23006
  [postToParent2]
22353
23007
  );
22354
- const refreshButtonDragVisuals = (0, import_react19.useCallback)((button, clientX, clientY) => {
23008
+ const refreshButtonDragVisuals = (0, import_react20.useCallback)((button, clientX, clientY) => {
22355
23009
  const collection = buttonCollectionOf(button);
22356
23010
  if (!collection) {
22357
23011
  setButtonDropSlots([]);
@@ -22368,7 +23022,7 @@ function OhhwellsBridge() {
22368
23022
  setDraggedItemRect(button.getBoundingClientRect());
22369
23023
  if (selectedElRef.current === button) setToolbarRect(button.getBoundingClientRect());
22370
23024
  }, []);
22371
- const handleItemDragStart = (0, import_react19.useCallback)(
23025
+ const handleItemDragStart = (0, import_react20.useCallback)(
22372
23026
  (e) => {
22373
23027
  const selected = selectedElRef.current;
22374
23028
  if (!selected) {
@@ -22399,7 +23053,7 @@ function OhhwellsBridge() {
22399
23053
  },
22400
23054
  [startFooterColumnDrag, startFooterLinkDrag, startNavLinkDrag, refreshButtonDragVisuals]
22401
23055
  );
22402
- const handleItemDragEnd = (0, import_react19.useCallback)(
23056
+ const handleItemDragEnd = (0, import_react20.useCallback)(
22403
23057
  (e) => {
22404
23058
  const collectionButton = buttonCollectionDragRef.current;
22405
23059
  if (collectionButton) {
@@ -22430,7 +23084,7 @@ function OhhwellsBridge() {
22430
23084
  },
22431
23085
  [commitFooterDrag, commitNavDrag, navDragRef, persistButtonCollectionDrag]
22432
23086
  );
22433
- const handleItemChromePointerDown = (0, import_react19.useCallback)((e) => {
23087
+ const handleItemChromePointerDown = (0, import_react20.useCallback)((e) => {
22434
23088
  if (e.button !== 0) return;
22435
23089
  const selected = selectedElRef.current;
22436
23090
  if (!selected) return;
@@ -22471,7 +23125,7 @@ function OhhwellsBridge() {
22471
23125
  }
22472
23126
  if (armNavPressFromChrome(selected, e.clientX, e.clientY, e.pointerId)) return;
22473
23127
  }, [armNavPressFromChrome]);
22474
- const handleItemChromeClick = (0, import_react19.useCallback)((clientX, clientY) => {
23128
+ const handleItemChromeClick = (0, import_react20.useCallback)((clientX, clientY) => {
22475
23129
  if (suppressNextClickRef.current || Date.now() < suppressClickUntilRef.current) {
22476
23130
  suppressNextClickRef.current = false;
22477
23131
  return;
@@ -22484,7 +23138,7 @@ function OhhwellsBridge() {
22484
23138
  }, []);
22485
23139
  reselectNavigationItemRef.current = reselectNavigationItem;
22486
23140
  commitNavigationTextEditRef.current = commitNavigationTextEdit;
22487
- const select = (0, import_react19.useCallback)((anchor) => {
23141
+ const select = (0, import_react20.useCallback)((anchor) => {
22488
23142
  if (!isNavigationItem2(anchor)) return;
22489
23143
  if (activeElRef.current) deactivate();
22490
23144
  aiSectionApiRef.current?.selectFromElement(anchor);
@@ -22546,7 +23200,7 @@ function OhhwellsBridge() {
22546
23200
  setLogoSizeDraft(null);
22547
23201
  }
22548
23202
  }, [deactivate, markSelected]);
22549
- const selectFrame = (0, import_react19.useCallback)((el) => {
23203
+ const selectFrame = (0, import_react20.useCallback)((el) => {
22550
23204
  if (!isNavigationContainer(el)) return;
22551
23205
  if (activeElRef.current) deactivate();
22552
23206
  aiSectionApiRef.current?.selectFromElement(el);
@@ -22587,7 +23241,7 @@ function OhhwellsBridge() {
22587
23241
  setFloatingPanelPos(null);
22588
23242
  setLogoSizeDraft(null);
22589
23243
  }, [deactivate, markSelected, postToParent2]);
22590
- const selectLogo = (0, import_react19.useCallback)(
23244
+ const selectLogo = (0, import_react20.useCallback)(
22591
23245
  (logoEl) => {
22592
23246
  if (activeElRef.current) deactivate();
22593
23247
  selectedElRef.current = logoEl;
@@ -22616,7 +23270,7 @@ function OhhwellsBridge() {
22616
23270
  },
22617
23271
  [deactivate, markSelected]
22618
23272
  );
22619
- const openLogoSizePanel = (0, import_react19.useCallback)((logoEl) => {
23273
+ const openLogoSizePanel = (0, import_react20.useCallback)((logoEl) => {
22620
23274
  const placement = getLogoPlacement(logoEl);
22621
23275
  const draft = readLogoSizeState(editContentRef.current, placement);
22622
23276
  setLogoSizeDraft(draft);
@@ -22629,7 +23283,7 @@ function OhhwellsBridge() {
22629
23283
  placement
22630
23284
  });
22631
23285
  }, []);
22632
- const openSocialsDisplayPanel = (0, import_react19.useCallback)((row) => {
23286
+ const openSocialsDisplayPanel = (0, import_react20.useCallback)((row) => {
22633
23287
  setFloatingPanelPos(null);
22634
23288
  setParentScrollSnap(parentScrollRef.current);
22635
23289
  setFloatingPanel({
@@ -22640,7 +23294,7 @@ function OhhwellsBridge() {
22640
23294
  row
22641
23295
  });
22642
23296
  }, []);
22643
- const rememberButtonTokens = (0, import_react19.useCallback)(
23297
+ const rememberButtonTokens = (0, import_react20.useCallback)(
22644
23298
  (content, tokens, nodes) => {
22645
23299
  if (nodes.length === 0) return content;
22646
23300
  const next = { ...content };
@@ -22651,7 +23305,7 @@ function OhhwellsBridge() {
22651
23305
  },
22652
23306
  [postToParent2]
22653
23307
  );
22654
- const tokensForButton = (0, import_react19.useCallback)(
23308
+ const tokensForButton = (0, import_react20.useCallback)(
22655
23309
  (el, persistFallback = false) => {
22656
23310
  const stored = readStoredStyleTokens(editContentRef.current);
22657
23311
  if (stored) return stored;
@@ -22666,7 +23320,7 @@ function OhhwellsBridge() {
22666
23320
  },
22667
23321
  [rememberButtonTokens]
22668
23322
  );
22669
- const openButtonStylePanel = (0, import_react19.useCallback)(
23323
+ const openButtonStylePanel = (0, import_react20.useCallback)(
22670
23324
  (anchor) => {
22671
23325
  const id = buttonId(anchor);
22672
23326
  if (!id) return;
@@ -22684,7 +23338,7 @@ function OhhwellsBridge() {
22684
23338
  },
22685
23339
  [tokensForButton]
22686
23340
  );
22687
- const applySelectedButtonStyle = (0, import_react19.useCallback)(
23341
+ const applySelectedButtonStyle = (0, import_react20.useCallback)(
22688
23342
  (patch) => {
22689
23343
  const panel = floatingPanelRef.current;
22690
23344
  const id = panel?.kind === "button-style" ? panel.buttonId : null;
@@ -22702,7 +23356,7 @@ function OhhwellsBridge() {
22702
23356
  },
22703
23357
  [postToParent2]
22704
23358
  );
22705
- (0, import_react19.useEffect)(() => {
23359
+ (0, import_react20.useEffect)(() => {
22706
23360
  const onDragOver = (e) => {
22707
23361
  const dragged = buttonCollectionDragRef.current;
22708
23362
  if (!dragged) return;
@@ -22721,11 +23375,11 @@ function OhhwellsBridge() {
22721
23375
  document.removeEventListener("drop", onDrop);
22722
23376
  };
22723
23377
  }, [refreshButtonDragVisuals]);
22724
- const isEditModeRef = (0, import_react19.useRef)(false);
22725
- const requestMissingSocialIconsRef = (0, import_react19.useRef)(() => {
23378
+ const isEditModeRef = (0, import_react20.useRef)(false);
23379
+ const requestMissingSocialIconsRef = (0, import_react20.useRef)(() => {
22726
23380
  });
22727
- const askedSocialIconsRef = (0, import_react19.useRef)(/* @__PURE__ */ new Set());
22728
- const requestMissingSocialIcons = (0, import_react19.useCallback)(() => {
23381
+ const askedSocialIconsRef = (0, import_react20.useRef)(/* @__PURE__ */ new Set());
23382
+ const requestMissingSocialIcons = (0, import_react20.useCallback)(() => {
22729
23383
  const items = Array.from(document.querySelectorAll(`[${SOCIALS_ROW_ATTR}]`)).filter((row) => socialsDisplayFor(row, editContentRef.current).icon).flatMap((row) => {
22730
23384
  const missing = socialsMissingIcons(row);
22731
23385
  listSocialItems(row).forEach((item) => ensureIconSlot(item));
@@ -22737,7 +23391,7 @@ function OhhwellsBridge() {
22737
23391
  }, []);
22738
23392
  requestMissingSocialIconsRef.current = requestMissingSocialIcons;
22739
23393
  isEditModeRef.current = isEditMode;
22740
- const changeSocialsDisplay = (0, import_react19.useCallback)(
23394
+ const changeSocialsDisplay = (0, import_react20.useCallback)(
22741
23395
  (row, next) => {
22742
23396
  if (next.icon) {
22743
23397
  const missing = socialsMissingIcons(row);
@@ -22761,19 +23415,19 @@ function OhhwellsBridge() {
22761
23415
  },
22762
23416
  []
22763
23417
  );
22764
- const closeFloatingPanelOnly = (0, import_react19.useCallback)(() => {
23418
+ const closeFloatingPanelOnly = (0, import_react20.useCallback)(() => {
22765
23419
  setFloatingPanel(null);
22766
23420
  setFloatingPanelPos(null);
22767
23421
  setLogoSizeDraft(null);
22768
23422
  }, []);
22769
23423
  closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
22770
- const closeFloatingPanelAndDeselect = (0, import_react19.useCallback)(() => {
23424
+ const closeFloatingPanelAndDeselect = (0, import_react20.useCallback)(() => {
22771
23425
  setFloatingPanel(null);
22772
23426
  setFloatingPanelPos(null);
22773
23427
  setLogoSizeDraft(null);
22774
23428
  deselectRef.current();
22775
23429
  }, []);
22776
- (0, import_react19.useEffect)(() => {
23430
+ (0, import_react20.useEffect)(() => {
22777
23431
  const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
22778
23432
  if (!session || !logoSizeDraft) {
22779
23433
  postToParentRef.current({ type: "ow:logo-size-panel", open: false });
@@ -22792,7 +23446,7 @@ function OhhwellsBridge() {
22792
23446
  max: LOGO_SIZE_MAX
22793
23447
  });
22794
23448
  }, [floatingPanel, logoSizeDraft, editorViewport]);
22795
- const persistLogoSizeDraft = (0, import_react19.useCallback)(
23449
+ const persistLogoSizeDraft = (0, import_react20.useCallback)(
22796
23450
  (placement, draft) => {
22797
23451
  const desktopKey = LOGO_SIZE_DESKTOP_KEYS[placement];
22798
23452
  const mobileKey = LOGO_SIZE_MOBILE_KEYS[placement];
@@ -22832,7 +23486,7 @@ function OhhwellsBridge() {
22832
23486
  },
22833
23487
  [postToParent2]
22834
23488
  );
22835
- const activate = (0, import_react19.useCallback)((el, options) => {
23489
+ const activate = (0, import_react20.useCallback)((el, options) => {
22836
23490
  if (activeElRef.current === el) return;
22837
23491
  document.querySelectorAll("[data-ohw-hovered]").forEach((hovered) => {
22838
23492
  hovered.removeAttribute("data-ohw-hovered");
@@ -22930,8 +23584,8 @@ function OhhwellsBridge() {
22930
23584
  openLogoSizePanelRef.current = openLogoSizePanel;
22931
23585
  deselectRef.current = deselect;
22932
23586
  closeFloatingPanelOnlyRef.current = closeFloatingPanelOnly;
22933
- const lastSiteWideScopeRef = (0, import_react19.useRef)(null);
22934
- (0, import_react19.useEffect)(() => {
23587
+ const lastSiteWideScopeRef = (0, import_react20.useRef)(null);
23588
+ (0, import_react20.useEffect)(() => {
22935
23589
  if (!isEditMode) {
22936
23590
  if (lastSiteWideScopeRef.current !== false) {
22937
23591
  lastSiteWideScopeRef.current = false;
@@ -22957,7 +23611,7 @@ function OhhwellsBridge() {
22957
23611
  isFooterFrameSelection,
22958
23612
  postToParent2
22959
23613
  ]);
22960
- (0, import_react19.useLayoutEffect)(() => {
23614
+ (0, import_react20.useLayoutEffect)(() => {
22961
23615
  if (!subdomain || isEditMode) {
22962
23616
  setFetchState("done");
22963
23617
  return;
@@ -22978,6 +23632,7 @@ function OhhwellsBridge() {
22978
23632
  }
22979
23633
  if (typeof content[STYLE_STORE_KEY] === "string") {
22980
23634
  stylesRef.current = content[STYLE_STORE_KEY];
23635
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
22981
23636
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
22982
23637
  }
22983
23638
  applyBrandChrome(content);
@@ -22986,12 +23641,12 @@ function OhhwellsBridge() {
22986
23641
  for (const [key, val] of Object.entries(content)) {
22987
23642
  if (key === "__ohw_sections") continue;
22988
23643
  if (key === AI_SECTIONS_KEY) continue;
23644
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
23645
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
22989
23646
  if (key === BRAND_KIT_KEY) continue;
22990
23647
  if (key === STYLE_STORE_KEY) continue;
22991
23648
  if (BRAND_CHROME_KEYS.has(key)) continue;
22992
- if (key === LOGO_PLACEHOLDER_KEY) continue;
22993
23649
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
22994
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
22995
23650
  if (applyVideoSettingNode(key, val)) continue;
22996
23651
  if (applyCarouselNode(key, val)) continue;
22997
23652
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -23081,7 +23736,7 @@ function OhhwellsBridge() {
23081
23736
  cancelled = true;
23082
23737
  };
23083
23738
  }, [subdomain, isEditMode]);
23084
- (0, import_react19.useEffect)(() => {
23739
+ (0, import_react20.useEffect)(() => {
23085
23740
  if (!isEditMode) return;
23086
23741
  const resolveIndex = (form, clientY) => {
23087
23742
  const wrappers = listFieldWrappers(form).filter((el) => fieldKeyOf(el) !== fieldDragRef.current?.key);
@@ -23122,7 +23777,7 @@ function OhhwellsBridge() {
23122
23777
  window.removeEventListener("drop", onDrop, true);
23123
23778
  };
23124
23779
  }, [buildFieldDropSlots, isEditMode, persistFields, selectField]);
23125
- (0, import_react19.useEffect)(() => {
23780
+ (0, import_react20.useEffect)(() => {
23126
23781
  if (!isEditMode) return;
23127
23782
  const mark = () => document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
23128
23783
  markFormFields(form);
@@ -23134,7 +23789,7 @@ function OhhwellsBridge() {
23134
23789
  });
23135
23790
  return () => observer.disconnect();
23136
23791
  }, [isEditMode, fetchState, pathname]);
23137
- (0, import_react19.useEffect)(() => {
23792
+ (0, import_react20.useEffect)(() => {
23138
23793
  if (!isEditMode) return;
23139
23794
  let saveTimer = null;
23140
23795
  const onInput = (e) => {
@@ -23156,14 +23811,14 @@ function OhhwellsBridge() {
23156
23811
  document.addEventListener("input", onInput, true);
23157
23812
  return () => document.removeEventListener("input", onInput, true);
23158
23813
  }, [isEditMode, persistFields]);
23159
- (0, import_react19.useEffect)(() => {
23814
+ (0, import_react20.useEffect)(() => {
23160
23815
  if (isEditMode || fetchState !== "done") return;
23161
23816
  const content = contentCache.get(subdomain) ?? {};
23162
23817
  document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
23163
23818
  reconcileFieldsFromContent(form, content);
23164
23819
  });
23165
23820
  }, [isEditMode, fetchState, subdomain]);
23166
- (0, import_react19.useEffect)(() => {
23821
+ (0, import_react20.useEffect)(() => {
23167
23822
  if (!isEditMode) return;
23168
23823
  const swallow = (e) => {
23169
23824
  const target = e.target;
@@ -23172,14 +23827,14 @@ function OhhwellsBridge() {
23172
23827
  document.addEventListener("submit", swallow, true);
23173
23828
  return () => document.removeEventListener("submit", swallow, true);
23174
23829
  }, [isEditMode]);
23175
- (0, import_react19.useEffect)(() => {
23830
+ (0, import_react20.useEffect)(() => {
23176
23831
  if (isEditMode || fetchState !== "done") return;
23177
23832
  console.log("env", process.env.NEXT_PUBLIC_FLOWOPS_API_URL);
23178
23833
  const apiUrl = process.env.NEXT_PUBLIC_FLOWOPS_API_URL ?? "https://flowops-backend-staging-2yfdh7pwpq-as.a.run.app";
23179
23834
  console.log({ apiUrl, subdomain });
23180
23835
  bindPublishedForms(apiUrl, subdomain, contentCache.get(subdomain) ?? {});
23181
23836
  }, [isEditMode, fetchState, subdomain]);
23182
- (0, import_react19.useEffect)(() => {
23837
+ (0, import_react20.useEffect)(() => {
23183
23838
  if (!subdomain || isEditMode) return;
23184
23839
  let debounceTimer = null;
23185
23840
  let observer = null;
@@ -23201,16 +23856,17 @@ function OhhwellsBridge() {
23201
23856
  applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
23202
23857
  }
23203
23858
  if (typeof content[STYLE_STORE_KEY] === "string") {
23859
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
23204
23860
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
23205
23861
  }
23206
23862
  for (const [key, val] of Object.entries(content)) {
23207
23863
  if (key === "__ohw_sections") continue;
23208
23864
  if (key === AI_SECTIONS_KEY) continue;
23865
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
23866
+ if (LOGO_IMAGE_KEYS.includes(key)) continue;
23209
23867
  if (key === BRAND_KIT_KEY) continue;
23210
23868
  if (key === STYLE_STORE_KEY) continue;
23211
23869
  if (BRAND_CHROME_KEYS.has(key)) continue;
23212
- if (key === LOGO_PLACEHOLDER_KEY) continue;
23213
- if (LOGO_IMAGE_KEYS.includes(key)) continue;
23214
23870
  if (applyVideoSettingNode(key, val)) continue;
23215
23871
  if (applyCarouselNode(key, val)) continue;
23216
23872
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -23280,16 +23936,16 @@ function OhhwellsBridge() {
23280
23936
  if (debounceTimer) clearTimeout(debounceTimer);
23281
23937
  };
23282
23938
  }, [subdomain, isEditMode, pathname]);
23283
- (0, import_react19.useLayoutEffect)(() => {
23939
+ (0, import_react20.useLayoutEffect)(() => {
23284
23940
  const el = document.getElementById("ohw-loader");
23285
23941
  if (!el) return;
23286
23942
  const visible = Boolean(subdomain) && fetchState !== "done";
23287
23943
  el.style.display = visible ? "flex" : "none";
23288
23944
  }, [subdomain, fetchState]);
23289
- (0, import_react19.useEffect)(() => {
23945
+ (0, import_react20.useEffect)(() => {
23290
23946
  postToParent2({ type: "ow:navigation", path: pathname });
23291
23947
  }, [pathname, postToParent2]);
23292
- (0, import_react19.useEffect)(() => {
23948
+ (0, import_react20.useEffect)(() => {
23293
23949
  if (!subdomain || isEditMode) return;
23294
23950
  const content = contentCache.get(subdomain);
23295
23951
  if (!content) return;
@@ -23305,7 +23961,7 @@ function OhhwellsBridge() {
23305
23961
  applyAiSectionsToDom(parseAiSectionsState(content[AI_SECTIONS_KEY]));
23306
23962
  }
23307
23963
  }, [pathname, subdomain, isEditMode]);
23308
- (0, import_react19.useEffect)(() => {
23964
+ (0, import_react20.useEffect)(() => {
23309
23965
  if (!isEditMode) return;
23310
23966
  if (linkPopoverSessionRef.current?.intent === "add-nav") return;
23311
23967
  if (document.querySelector("[data-ohw-section-picker]")) return;
@@ -23313,11 +23969,11 @@ function OhhwellsBridge() {
23313
23969
  deselectRef.current();
23314
23970
  deactivateRef.current();
23315
23971
  }, [pathname, isEditMode]);
23316
- (0, import_react19.useEffect)(() => {
23972
+ (0, import_react20.useEffect)(() => {
23317
23973
  if (!isEditMode) return;
23318
23974
  initSectionInstancesFromContent(editContentRef.current, pathname);
23319
23975
  }, [pathname, isEditMode]);
23320
- (0, import_react19.useEffect)(() => {
23976
+ (0, import_react20.useEffect)(() => {
23321
23977
  if (!isEditMode) return;
23322
23978
  const observer = new MutationObserver(() => {
23323
23979
  const drawer = document.querySelector("[data-ohw-nav-drawer]");
@@ -23328,7 +23984,7 @@ function OhhwellsBridge() {
23328
23984
  observer.observe(document.body, { childList: true, subtree: true });
23329
23985
  return () => observer.disconnect();
23330
23986
  }, [isEditMode, pathname]);
23331
- (0, import_react19.useEffect)(() => {
23987
+ (0, import_react20.useEffect)(() => {
23332
23988
  const contentForNav = () => {
23333
23989
  if (isEditMode) return editContentRef.current;
23334
23990
  if (!subdomain) return {};
@@ -23401,7 +24057,7 @@ function OhhwellsBridge() {
23401
24057
  observer?.disconnect();
23402
24058
  };
23403
24059
  }, [isEditMode, pathname, subdomain, fetchState, resyncSelectedNavigationItem]);
23404
- (0, import_react19.useEffect)(() => {
24060
+ (0, import_react20.useEffect)(() => {
23405
24061
  if (!isEditMode) return;
23406
24062
  let applying = false;
23407
24063
  let rafId = null;
@@ -23439,7 +24095,7 @@ function OhhwellsBridge() {
23439
24095
  observer.disconnect();
23440
24096
  };
23441
24097
  }, [isEditMode, pathname]);
23442
- (0, import_react19.useEffect)(() => {
24098
+ (0, import_react20.useEffect)(() => {
23443
24099
  if (!isEditMode) return;
23444
24100
  let lastPosted = 0;
23445
24101
  const measure = () => {
@@ -23461,29 +24117,14 @@ function OhhwellsBridge() {
23461
24117
  const t2 = setTimeout(measure, 500);
23462
24118
  const ro = new ResizeObserver(schedule);
23463
24119
  ro.observe(document.body);
23464
- let lastWidth = window.innerWidth;
23465
- let resizeTimers = [];
23466
- const clearResizeTimers = () => {
23467
- resizeTimers.forEach(clearTimeout);
23468
- resizeTimers = [];
23469
- };
23470
- const handleResize = () => {
23471
- if (window.innerWidth === lastWidth) return;
23472
- lastWidth = window.innerWidth;
23473
- clearResizeTimers();
23474
- resizeTimers = HEIGHT_SETTLE_DELAYS.map((delay) => setTimeout(measure, delay));
23475
- };
23476
- window.addEventListener("resize", handleResize);
23477
24120
  return () => {
23478
24121
  clearTimeout(t1);
23479
24122
  clearTimeout(t2);
23480
24123
  if (raf != null) cancelAnimationFrame(raf);
23481
24124
  ro.disconnect();
23482
- clearResizeTimers();
23483
- window.removeEventListener("resize", handleResize);
23484
24125
  };
23485
24126
  }, [pathname, isEditMode, postToParent2]);
23486
- (0, import_react19.useEffect)(() => {
24127
+ (0, import_react20.useEffect)(() => {
23487
24128
  if (!subdomainFromQuery || isEditMode) return;
23488
24129
  const handleClick = (e) => {
23489
24130
  const anchor = e.target.closest("a");
@@ -23499,7 +24140,7 @@ function OhhwellsBridge() {
23499
24140
  document.addEventListener("click", handleClick, true);
23500
24141
  return () => document.removeEventListener("click", handleClick, true);
23501
24142
  }, [subdomainFromQuery, isEditMode, router]);
23502
- (0, import_react19.useEffect)(() => {
24143
+ (0, import_react20.useEffect)(() => {
23503
24144
  if (!isEditMode) {
23504
24145
  editStylesRef.current?.base.remove();
23505
24146
  editStylesRef.current?.forceHover.remove();
@@ -23725,11 +24366,11 @@ function OhhwellsBridge() {
23725
24366
  footer [data-ohw-href-key] [data-ohw-editable][contenteditable],
23726
24367
  footer [data-ohw-href-key] [data-ohw-editable][contenteditable] * {
23727
24368
  outline: none !important;
23728
- caret-color: ${PRIMARY5} !important;
24369
+ caret-color: ${PRIMARY6} !important;
23729
24370
  cursor: text !important;
23730
24371
  }
23731
24372
  [data-ohw-editable][contenteditable]::selection,
23732
- [data-ohw-editable][contenteditable] *::selection { background: ${PRIMARY5}59 !important; }
24373
+ [data-ohw-editable][contenteditable] *::selection { background: ${PRIMARY6}59 !important; }
23733
24374
  [data-ohw-editable-state], [data-ohw-editable-state] * { pointer-events: none !important; }
23734
24375
  [data-ohw-editable-state][data-ohw-active-state] [data-ohw-editable] { pointer-events: auto !important; }
23735
24376
  [data-ohw-editable-state][data-ohw-active-state][data-ohw-editable] { pointer-events: auto !important; }
@@ -23775,6 +24416,13 @@ function OhhwellsBridge() {
23775
24416
  if (target.closest("[data-ohw-state-toggle]")) return;
23776
24417
  if (target.closest("[data-ohw-max-badge]")) return;
23777
24418
  if (isInsideLinkEditor(target)) return;
24419
+ if (isInsideFloatingPanel(target)) return;
24420
+ if (target.closest("[data-ohw-form-toolbar]")) return;
24421
+ if (target.closest(
24422
+ '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
24423
+ )) {
24424
+ return;
24425
+ }
23778
24426
  if (selectedMediaElRef.current && !selectedMediaElRef.current.contains(target) && !target.closest("[data-ohw-media-overlay], [data-ohw-edit-chrome], [data-ohw-item-interaction]")) {
23779
24427
  clearMediaSelectionRef.current();
23780
24428
  }
@@ -23795,13 +24443,6 @@ function OhhwellsBridge() {
23795
24443
  return;
23796
24444
  }
23797
24445
  }
23798
- if (isInsideFloatingPanel(target)) return;
23799
- if (target.closest("[data-ohw-form-toolbar]")) return;
23800
- if (target.closest(
23801
- '[data-ohw-field-toolbar], [data-ohw-field-type-picker], [data-radix-popper-content-wrapper], [role="menu"], [data-slot="dropdown-menu-content"]'
23802
- )) {
23803
- return;
23804
- }
23805
24446
  {
23806
24447
  const formEl = getFormElement(target);
23807
24448
  const onSuccessText = target.closest(`[${SUCCESS_TEXT_ATTR}]`);
@@ -24181,6 +24822,9 @@ function OhhwellsBridge() {
24181
24822
  setHoveredItemRect(null);
24182
24823
  hoveredNavContainerRef.current = null;
24183
24824
  setHoveredNavContainerRect(null);
24825
+ siblingHintElRef.current = null;
24826
+ setSiblingHintRect(null);
24827
+ setSiblingHintRects([]);
24184
24828
  return;
24185
24829
  }
24186
24830
  {
@@ -24301,7 +24945,6 @@ function OhhwellsBridge() {
24301
24945
  hoveredNavContainerRef.current = null;
24302
24946
  setHoveredNavContainerRect(null);
24303
24947
  hoveredItemElRef.current = editable;
24304
- setHoveredItemRect(isSelectedForHoverRef.current(editable) ? null : editable.getBoundingClientRect());
24305
24948
  }
24306
24949
  }
24307
24950
  }
@@ -25011,7 +25654,11 @@ function OhhwellsBridge() {
25011
25654
  };
25012
25655
  const handleMouseMove = (e) => {
25013
25656
  const { clientX, clientY } = e;
25014
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
25657
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
25658
+ dismissImageHover();
25659
+ clearImageHover();
25660
+ return;
25661
+ }
25015
25662
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) {
25016
25663
  document.querySelectorAll("[data-ohw-hovered]").forEach((el) => el.removeAttribute("data-ohw-hovered"));
25017
25664
  formHoverElRef.current = null;
@@ -25040,7 +25687,12 @@ function OhhwellsBridge() {
25040
25687
  setHoveredItemRect(null);
25041
25688
  hoveredNavContainerRef.current = null;
25042
25689
  setHoveredNavContainerRect(null);
25690
+ siblingHintElRef.current = null;
25691
+ setSiblingHintRect(null);
25692
+ setSiblingHintRects([]);
25043
25693
  dismissImageHover();
25694
+ clearImageHover();
25695
+ setSectionGap(null);
25044
25696
  return;
25045
25697
  }
25046
25698
  if (probeSocialsRowAt(clientX, clientY)) return;
@@ -25052,7 +25704,11 @@ function OhhwellsBridge() {
25052
25704
  if (e.data?.type !== "ow:pointer-sync") return;
25053
25705
  const { clientX, clientY } = e.data;
25054
25706
  if (typeof clientX !== "number" || typeof clientY !== "number") return;
25055
- if (pointOwnedByFloatingPanel(clientX, clientY)) return;
25707
+ if (pointOwnedByFloatingPanel(clientX, clientY)) {
25708
+ dismissImageHover();
25709
+ clearImageHover();
25710
+ return;
25711
+ }
25056
25712
  if (isNavDrawerOpen() && isPointOutsideOpenDrawer(clientX, clientY)) return;
25057
25713
  if (probeSocialsRowAt(clientX, clientY)) return;
25058
25714
  probeSectionGapAt(clientX, clientY);
@@ -25398,6 +26054,7 @@ function OhhwellsBridge() {
25398
26054
  }
25399
26055
  if (typeof content[STYLE_STORE_KEY] === "string") {
25400
26056
  stylesRef.current = content[STYLE_STORE_KEY];
26057
+ document.querySelectorAll('[data-ohw-editable="form"]').forEach((f) => markFormFields(f));
25401
26058
  applyStylesToDom(parseStyleStore(content[STYLE_STORE_KEY]));
25402
26059
  }
25403
26060
  applyBrandChrome(content);
@@ -25410,12 +26067,12 @@ function OhhwellsBridge() {
25410
26067
  continue;
25411
26068
  }
25412
26069
  if (key === AI_SECTIONS_KEY) continue;
26070
+ if (key === LOGO_PLACEHOLDER_KEY) continue;
26071
+ if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
25413
26072
  if (key === BRAND_KIT_KEY) continue;
25414
26073
  if (key === STYLE_STORE_KEY) continue;
25415
26074
  if (BRAND_CHROME_KEYS.has(key)) continue;
25416
- if (key === LOGO_PLACEHOLDER_KEY) continue;
25417
26075
  if (key === CUSTOM_CODE_AFTER_HEAD_KEY || key === CUSTOM_CODE_BEFORE_HEAD_KEY) continue;
25418
- if (LOGO_IMAGE_KEYS.includes(key) && !String(val ?? "").trim()) continue;
25419
26076
  if (applyVideoSettingNode(key, val)) continue;
25420
26077
  if (applyCarouselNode(key, val)) continue;
25421
26078
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
@@ -25861,6 +26518,12 @@ function OhhwellsBridge() {
25861
26518
  closeLinkPopoverRef.current();
25862
26519
  return;
25863
26520
  }
26521
+ if (floatingPanelOpenRef.current) {
26522
+ setFloatingPanelRef.current(null);
26523
+ deselectRef.current();
26524
+ deactivateRef.current();
26525
+ return;
26526
+ }
25864
26527
  deselectRef.current();
25865
26528
  deactivateRef.current();
25866
26529
  clearMediaSelectionRef.current();
@@ -26137,6 +26800,21 @@ function OhhwellsBridge() {
26137
26800
  type: "text",
26138
26801
  text: editContentRef.current[CUSTOM_CODE_AFTER_HEAD_KEY] ?? ""
26139
26802
  });
26803
+ nodes.push({
26804
+ key: BRAND_TITLE_KEY,
26805
+ type: "text",
26806
+ text: editContentRef.current[BRAND_TITLE_KEY] ?? ""
26807
+ });
26808
+ nodes.push({
26809
+ key: SITE_DESCRIPTION_KEY,
26810
+ type: "text",
26811
+ text: editContentRef.current[SITE_DESCRIPTION_KEY] ?? ""
26812
+ });
26813
+ nodes.push({
26814
+ key: SITE_OG_IMAGE_KEY,
26815
+ type: "text",
26816
+ text: editContentRef.current[SITE_OG_IMAGE_KEY] ?? ""
26817
+ });
26140
26818
  document.querySelectorAll('[data-ohw-editable="form"]').forEach((form) => {
26141
26819
  const formKey = formKeyOf(form);
26142
26820
  if (!formKey) return;
@@ -26593,17 +27271,17 @@ function OhhwellsBridge() {
26593
27271
  window.removeEventListener("message", handleDeleteSection);
26594
27272
  window.removeEventListener("message", handleDuplicateSection);
26595
27273
  window.removeEventListener("message", handleDeactivate);
26596
- document.documentElement.removeAttribute("data-ohw-panel-dragging");
26597
27274
  window.removeEventListener("message", handleToastAction);
26598
27275
  window.removeEventListener("message", handleFormCount);
26599
27276
  window.removeEventListener("message", handleUiEscape);
27277
+ document.documentElement.removeAttribute("data-ohw-panel-dragging");
26600
27278
  autoSaveTimers.current.forEach(clearTimeout);
26601
27279
  autoSaveTimers.current.clear();
26602
27280
  if (imageUnhoverTimerRef.current) clearTimeout(imageUnhoverTimerRef.current);
26603
27281
  if (imageShowTimerRef.current) clearTimeout(imageShowTimerRef.current);
26604
27282
  };
26605
27283
  }, [isEditMode, refreshStateRules]);
26606
- (0, import_react19.useEffect)(() => {
27284
+ (0, import_react20.useEffect)(() => {
26607
27285
  if (!isEditMode) return;
26608
27286
  const THRESHOLD = 10;
26609
27287
  const resolveWasSelected = (el) => {
@@ -26759,7 +27437,7 @@ function OhhwellsBridge() {
26759
27437
  unlockFooterDragInteraction();
26760
27438
  };
26761
27439
  }, [isEditMode]);
26762
- (0, import_react19.useEffect)(() => {
27440
+ (0, import_react20.useEffect)(() => {
26763
27441
  if (!isEditMode) return;
26764
27442
  const THRESHOLD = 10;
26765
27443
  const onPointerDown = (e) => {
@@ -26850,7 +27528,7 @@ function OhhwellsBridge() {
26850
27528
  document.removeEventListener("selectstart", blockSelectStart, true);
26851
27529
  };
26852
27530
  }, [isEditMode, persistButtonCollectionDrag, refreshButtonDragVisuals]);
26853
- (0, import_react19.useEffect)(() => {
27531
+ (0, import_react20.useEffect)(() => {
26854
27532
  const handler = (e) => {
26855
27533
  if (e.data?.type !== "ow:request-schedule-config") return;
26856
27534
  const insertAfterVal = e.data.insertAfter;
@@ -26866,7 +27544,7 @@ function OhhwellsBridge() {
26866
27544
  window.addEventListener("message", handler);
26867
27545
  return () => window.removeEventListener("message", handler);
26868
27546
  }, [processConfigRequest]);
26869
- (0, import_react19.useEffect)(() => {
27547
+ (0, import_react20.useEffect)(() => {
26870
27548
  if (!isEditMode) return;
26871
27549
  document.querySelectorAll("[data-ohw-active-state]").forEach((el) => {
26872
27550
  el.removeAttribute("data-ohw-active-state");
@@ -26890,7 +27568,7 @@ function OhhwellsBridge() {
26890
27568
  postToParent2({
26891
27569
  type: "ow:ready",
26892
27570
  version: "1",
26893
- bridgeVersion: "0.1.124",
27571
+ bridgeVersion: "0.1.126",
26894
27572
  path: pathname,
26895
27573
  nodes: collectEditableNodes(editContentRef.current),
26896
27574
  sections
@@ -26902,13 +27580,13 @@ function OhhwellsBridge() {
26902
27580
  clearTimeout(timer);
26903
27581
  };
26904
27582
  }, [pathname, isEditMode, refreshStateRules, postToParent2]);
26905
- (0, import_react19.useEffect)(() => {
27583
+ (0, import_react20.useEffect)(() => {
26906
27584
  scrollToHashSectionWhenReady();
26907
27585
  const onHashChange = () => scrollToHashSectionWhenReady();
26908
27586
  window.addEventListener("hashchange", onHashChange);
26909
27587
  return () => window.removeEventListener("hashchange", onHashChange);
26910
27588
  }, [pathname]);
26911
- const handleCommand = (0, import_react19.useCallback)((cmd) => {
27589
+ const handleCommand = (0, import_react20.useCallback)((cmd) => {
26912
27590
  const el = activeElRef.current;
26913
27591
  const selBefore = window.getSelection();
26914
27592
  let savedOffsets = null;
@@ -26944,7 +27622,7 @@ function OhhwellsBridge() {
26944
27622
  if (el) setToolbarRect(getEditMeasureEl(el).getBoundingClientRect());
26945
27623
  refreshActiveCommandsRef.current();
26946
27624
  }, []);
26947
- (0, import_react19.useEffect)(() => {
27625
+ (0, import_react20.useEffect)(() => {
26948
27626
  const session = floatingPanel && floatingPanel.kind === "logo-size" ? floatingPanel : null;
26949
27627
  if (!session || !logoSizeDraft) return;
26950
27628
  const onPanelAction = (e) => {
@@ -26982,7 +27660,7 @@ function OhhwellsBridge() {
26982
27660
  window.addEventListener("message", onPanelAction);
26983
27661
  return () => window.removeEventListener("message", onPanelAction);
26984
27662
  }, [floatingPanel, logoSizeDraft, editorViewport, persistLogoSizeDraft, closeFloatingPanelAndDeselect]);
26985
- const handleStateChange = (0, import_react19.useCallback)((state) => {
27663
+ const handleStateChange = (0, import_react20.useCallback)((state) => {
26986
27664
  if (!activeStateElRef.current) return;
26987
27665
  const el = activeStateElRef.current;
26988
27666
  if (state === "Default") {
@@ -26995,7 +27673,7 @@ function OhhwellsBridge() {
26995
27673
  }
26996
27674
  setToggleState((prev) => prev ? { ...prev, activeState: state } : null);
26997
27675
  }, [deactivate]);
26998
- const reselectAfterLinkPopover = (0, import_react19.useCallback)(
27676
+ const reselectAfterLinkPopover = (0, import_react20.useCallback)(
26999
27677
  (hrefKey) => {
27000
27678
  requestAnimationFrame(() => {
27001
27679
  const el = resolveHrefKeyElement(hrefKey);
@@ -27004,7 +27682,7 @@ function OhhwellsBridge() {
27004
27682
  },
27005
27683
  [resolveHrefKeyElement]
27006
27684
  );
27007
- const closeLinkPopover = (0, import_react19.useCallback)(() => {
27685
+ const closeLinkPopover = (0, import_react20.useCallback)(() => {
27008
27686
  const session = linkPopoverSessionRef.current;
27009
27687
  addNavAfterAnchorRef.current = null;
27010
27688
  setLinkPopover(null);
@@ -27012,9 +27690,9 @@ function OhhwellsBridge() {
27012
27690
  reselectAfterLinkPopover(session.key);
27013
27691
  }
27014
27692
  }, [reselectAfterLinkPopover]);
27015
- const closeLinkPopoverRef = (0, import_react19.useRef)(closeLinkPopover);
27693
+ const closeLinkPopoverRef = (0, import_react20.useRef)(closeLinkPopover);
27016
27694
  closeLinkPopoverRef.current = closeLinkPopover;
27017
- const openLinkPopoverForActive = (0, import_react19.useCallback)(() => {
27695
+ const openLinkPopoverForActive = (0, import_react20.useCallback)(() => {
27018
27696
  const hrefCtx = getHrefKeyFromElement(activeElRef.current);
27019
27697
  if (!hrefCtx) return;
27020
27698
  bumpLinkPopoverGrace();
@@ -27025,7 +27703,7 @@ function OhhwellsBridge() {
27025
27703
  });
27026
27704
  deactivate();
27027
27705
  }, [deactivate]);
27028
- const openLinkPopoverForSelected = (0, import_react19.useCallback)(() => {
27706
+ const openLinkPopoverForSelected = (0, import_react20.useCallback)(() => {
27029
27707
  const anchor = selectedElRef.current;
27030
27708
  if (!anchor) return;
27031
27709
  const key = anchor.getAttribute("data-ohw-href-key");
@@ -27042,7 +27720,7 @@ function OhhwellsBridge() {
27042
27720
  });
27043
27721
  deselect();
27044
27722
  }, [deselect]);
27045
- const handleSelectParent = (0, import_react19.useCallback)(() => {
27723
+ const handleSelectParent = (0, import_react20.useCallback)(() => {
27046
27724
  const selected = selectedElRef.current;
27047
27725
  if (!selected) return;
27048
27726
  if (toolbarVariantRef.current === "select-frame") {
@@ -27069,7 +27747,7 @@ function OhhwellsBridge() {
27069
27747
  }
27070
27748
  deselectRef.current();
27071
27749
  }, []);
27072
- const handleDuplicateSelected = (0, import_react19.useCallback)(() => {
27750
+ const handleDuplicateSelected = (0, import_react20.useCallback)(() => {
27073
27751
  const selected = selectedElRef.current;
27074
27752
  if (!selected || !isNavigationItem2(selected)) return;
27075
27753
  if (isCtaButton(selected)) {
@@ -27232,7 +27910,7 @@ function OhhwellsBridge() {
27232
27910
  });
27233
27911
  }
27234
27912
  }, [postToParent2, tokensForButton]);
27235
- const runPendingDeleteUndo = (0, import_react19.useCallback)(() => {
27913
+ const runPendingDeleteUndo = (0, import_react20.useCallback)(() => {
27236
27914
  const pending = pendingDeleteUndoRef.current;
27237
27915
  if (!pending) return false;
27238
27916
  pendingDeleteUndoRef.current = null;
@@ -27240,7 +27918,7 @@ function OhhwellsBridge() {
27240
27918
  enforceLinkHrefs();
27241
27919
  return true;
27242
27920
  }, []);
27243
- const handleDeleteSelected = (0, import_react19.useCallback)(() => {
27921
+ const handleDeleteSelected = (0, import_react20.useCallback)(() => {
27244
27922
  const selected = selectedElRef.current;
27245
27923
  if (!selected) return false;
27246
27924
  if (isCtaButton(selected)) {
@@ -27293,7 +27971,7 @@ function OhhwellsBridge() {
27293
27971
  }, [postToParent2]);
27294
27972
  handleDeleteSelectedRef.current = handleDeleteSelected;
27295
27973
  runPendingDeleteUndoRef.current = runPendingDeleteUndo;
27296
- const handleLinkPopoverSubmit = (0, import_react19.useCallback)(
27974
+ const handleLinkPopoverSubmit = (0, import_react20.useCallback)(
27297
27975
  (target) => {
27298
27976
  const session = linkPopoverSessionRef.current;
27299
27977
  if (!session) return;
@@ -27359,14 +28037,14 @@ function OhhwellsBridge() {
27359
28037
  const showEditLink = toolbarShowEditLink;
27360
28038
  const currentSections = sectionsByPath[pathname] ?? [];
27361
28039
  linkPopoverOpenRef.current = linkPopover !== null;
27362
- const handleMediaSelect = (0, import_react19.useCallback)((key) => {
28040
+ const handleMediaSelect = (0, import_react20.useCallback)((key) => {
27363
28041
  const el = hoveredImageRef.current?.dataset.ohwKey === key ? hoveredImageRef.current : Array.from(document.querySelectorAll(MEDIA_SELECTOR)).find(
27364
28042
  (m) => (m.dataset.ohwKey ?? "") === key
27365
28043
  ) ?? null;
27366
28044
  if (!el) return;
27367
28045
  selectMediaElementRef.current(el);
27368
28046
  }, []);
27369
- const handleMediaReplace = (0, import_react19.useCallback)(
28047
+ const handleMediaReplace = (0, import_react20.useCallback)(
27370
28048
  (key) => {
27371
28049
  postToParent2({
27372
28050
  type: "ow:image-pick",
@@ -27376,13 +28054,13 @@ function OhhwellsBridge() {
27376
28054
  },
27377
28055
  [postToParent2, mediaHover?.elementType, selectedMedia?.elementType]
27378
28056
  );
27379
- const handleEditCarousel = (0, import_react19.useCallback)(
28057
+ const handleEditCarousel = (0, import_react20.useCallback)(
27380
28058
  (key) => {
27381
28059
  postToParent2({ type: "ow:carousel-open", key, images: readCarouselValue(key) });
27382
28060
  },
27383
28061
  [postToParent2]
27384
28062
  );
27385
- const handleMediaFadeOutComplete = (0, import_react19.useCallback)((key) => {
28063
+ const handleMediaFadeOutComplete = (0, import_react20.useCallback)((key) => {
27386
28064
  setUploadingRects((prev) => {
27387
28065
  if (!(key in prev)) return prev;
27388
28066
  const next = { ...prev };
@@ -27390,7 +28068,7 @@ function OhhwellsBridge() {
27390
28068
  return next;
27391
28069
  });
27392
28070
  }, []);
27393
- const handleVideoSettingsChange = (0, import_react19.useCallback)(
28071
+ const handleVideoSettingsChange = (0, import_react20.useCallback)(
27394
28072
  (key, settings) => {
27395
28073
  document.querySelectorAll(`[data-ohw-key="${key}"]`).forEach((el) => {
27396
28074
  const video = getVideoEl2(el);
@@ -27412,14 +28090,14 @@ function OhhwellsBridge() {
27412
28090
  },
27413
28091
  [postToParent2]
27414
28092
  );
27415
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
27416
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { id: "ohw-loader", suppressHydrationWarning: true, style: { ...OHW_LOADER_STYLE, display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(OhwLoaderSpinner, {}) }),
27417
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: OHW_LOADER_PREHYDRATE_SCRIPT } }),
27418
- subdomain && !isEditMode && showBranding && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MadeWithOhhWells, {}),
28093
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
28094
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { id: "ohw-loader", suppressHydrationWarning: true, style: { ...OHW_LOADER_STYLE, display: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(OhwLoaderSpinner, {}) }),
28095
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: OHW_LOADER_PREHYDRATE_SCRIPT } }),
28096
+ subdomain && !isEditMode && showBranding && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MadeWithOhhWells, {}),
27419
28097
  bridgeRoot ? (0, import_react_dom5.createPortal)(
27420
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
27421
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
27422
- isEditMode && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28098
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
28099
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { ref: attachVisibleViewport, "data-ohw-visible-viewport": "", "aria-hidden": true }),
28100
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27423
28101
  AiSectionOverlay,
27424
28102
  {
27425
28103
  postToParent: postToParent2,
@@ -27427,7 +28105,7 @@ function OhhwellsBridge() {
27427
28105
  onSelectionChange: handleAiSectionSelectionChange
27428
28106
  }
27429
28107
  ),
27430
- isEditMode && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28108
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27431
28109
  AiMediaStripOverlay,
27432
28110
  {
27433
28111
  postToParent: postToParent2,
@@ -27436,7 +28114,7 @@ function OhhwellsBridge() {
27436
28114
  clearInteractionChromeRef
27437
28115
  }
27438
28116
  ),
27439
- isEditMode && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28117
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27440
28118
  AiPricingCardOverlay,
27441
28119
  {
27442
28120
  postToParent: postToParent2,
@@ -27444,12 +28122,21 @@ function OhhwellsBridge() {
27444
28122
  applyTreeLocalRef
27445
28123
  }
27446
28124
  ),
27447
- isSectionDragging && sectionDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28125
+ isEditMode && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28126
+ AiVideoOverlay,
28127
+ {
28128
+ postToParent: postToParent2,
28129
+ aiSectionsRef,
28130
+ applyTreeLocalRef,
28131
+ clearInteractionChromeRef
28132
+ }
28133
+ ),
28134
+ isSectionDragging && sectionDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27448
28135
  "div",
27449
28136
  {
27450
28137
  className: "pointer-events-none fixed z-2147483646",
27451
28138
  style: { left: slot.left, top: slot.y, width: slot.width, height: 3, transform: "translateY(-50%)" },
27452
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28139
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27453
28140
  DropIndicator,
27454
28141
  {
27455
28142
  direction: "horizontal",
@@ -27460,7 +28147,7 @@ function OhhwellsBridge() {
27460
28147
  },
27461
28148
  `section-drop-${slot.insertIndex}-${i}`
27462
28149
  )),
27463
- Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28150
+ Object.entries(uploadingRects).map(([key, { rect, fadingOut }]) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27464
28151
  MediaOverlay,
27465
28152
  {
27466
28153
  hover: { key, rect, elementType: "image", isDragOver: false, hasTextOverlap: false },
@@ -27471,7 +28158,7 @@ function OhhwellsBridge() {
27471
28158
  },
27472
28159
  `uploading-${key}`
27473
28160
  )),
27474
- mediaHover && !(mediaHover.key in uploadingRects) && mediaHover.key !== selectedMedia?.key && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28161
+ mediaHover && !(mediaHover.key in uploadingRects) && mediaHover.key !== selectedMedia?.key && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27475
28162
  MediaOverlay,
27476
28163
  {
27477
28164
  hover: mediaHover,
@@ -27482,7 +28169,7 @@ function OhhwellsBridge() {
27482
28169
  onVideoSettingsChange: handleVideoSettingsChange
27483
28170
  }
27484
28171
  ),
27485
- selectedMedia && !(selectedMedia.key in uploadingRects) && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28172
+ selectedMedia && !(selectedMedia.key in uploadingRects) && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27486
28173
  MediaOverlay,
27487
28174
  {
27488
28175
  hover: selectedMedia,
@@ -27494,7 +28181,7 @@ function OhhwellsBridge() {
27494
28181
  onVideoSettingsChange: handleVideoSettingsChange
27495
28182
  }
27496
28183
  ),
27497
- carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28184
+ carouselHover && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27498
28185
  CarouselOverlay,
27499
28186
  {
27500
28187
  hover: carouselHover,
@@ -27502,10 +28189,10 @@ function OhhwellsBridge() {
27502
28189
  cueOnly: !!carouselHover.fullBleedSectionId && carouselHover.fullBleedSectionId !== selectedAiSectionId
27503
28190
  }
27504
28191
  ),
27505
- siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
27506
- siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
27507
- isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && selectedElRef.current !== buttonCollectionDragRef.current && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
27508
- isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28192
+ siblingHintRect && !linkPopover && !isItemDragging && siblingHintRects.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect: siblingHintRect, state: "sibling-hint" }),
28193
+ siblingHintRects.length > 0 && !linkPopover && !isItemDragging && siblingHintRects.map((rect, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect, state: "sibling-hint" }, `sibling-hint-${i}`)),
28194
+ isItemDragging && draggedItemRect && selectedElRef.current !== footerDragRef.current?.draggedEl && selectedElRef.current !== navDragRef.current?.draggedEl && selectedElRef.current !== buttonCollectionDragRef.current && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect: draggedItemRect, state: "dragging" }),
28195
+ isItemDragging && footerDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27509
28196
  "div",
27510
28197
  {
27511
28198
  className: "pointer-events-none fixed z-2147483646",
@@ -27515,7 +28202,7 @@ function OhhwellsBridge() {
27515
28202
  width: slot.width,
27516
28203
  height: slot.height
27517
28204
  },
27518
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28205
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27519
28206
  DropIndicator,
27520
28207
  {
27521
28208
  direction: slot.direction,
@@ -27526,7 +28213,7 @@ function OhhwellsBridge() {
27526
28213
  },
27527
28214
  `footer-drop-${slot.direction}-${slot.columnIndex}-${slot.insertIndex}-${i}`
27528
28215
  )),
27529
- isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28216
+ isItemDragging && navDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27530
28217
  "div",
27531
28218
  {
27532
28219
  className: "pointer-events-none fixed z-2147483646",
@@ -27536,7 +28223,7 @@ function OhhwellsBridge() {
27536
28223
  width: slot.width,
27537
28224
  height: slot.height
27538
28225
  },
27539
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28226
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27540
28227
  DropIndicator,
27541
28228
  {
27542
28229
  direction: slot.direction,
@@ -27547,7 +28234,7 @@ function OhhwellsBridge() {
27547
28234
  },
27548
28235
  `nav-drop-${slot.direction}-${slot.parentId ?? "root"}-${slot.insertIndex}-${i}`
27549
28236
  )),
27550
- isItemDragging && buttonDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28237
+ isItemDragging && buttonDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27551
28238
  "div",
27552
28239
  {
27553
28240
  className: "pointer-events-none fixed z-2147483646",
@@ -27557,7 +28244,7 @@ function OhhwellsBridge() {
27557
28244
  width: slot.width,
27558
28245
  height: slot.height
27559
28246
  },
27560
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28247
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27561
28248
  DropIndicator,
27562
28249
  {
27563
28250
  direction: slot.direction,
@@ -27568,10 +28255,10 @@ function OhhwellsBridge() {
27568
28255
  },
27569
28256
  `button-drop-${slot.direction}-${slot.insertIndex}-${i}`
27570
28257
  )),
27571
- hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
27572
- hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
27573
- hoveredTextRect && !hoveredNavContainerRect && !hoveredItemRect && !isItemDragging && toolbarVariant !== "rich-text" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ItemInteractionLayer, { rect: hoveredTextRect, state: "hover" }),
27574
- formPickRect && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28258
+ hoveredNavContainerRect && (toolbarVariant !== "select-frame" || isFooterFrameSelection) && !linkPopover && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect: hoveredNavContainerRect, state: "hover" }),
28259
+ hoveredItemRect && !linkPopover && !hoveredNavContainerRect && !isItemDragging && hoveredItemElRef.current !== selectedElRef.current && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect: hoveredItemRect, state: "hover" }),
28260
+ hoveredTextRect && !hoveredNavContainerRect && !hoveredItemRect && !isItemDragging && toolbarVariant !== "rich-text" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ItemInteractionLayer, { rect: hoveredTextRect, state: "hover" }),
28261
+ formPickRect && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27575
28262
  ItemInteractionLayer,
27576
28263
  {
27577
28264
  rect: formPickRect,
@@ -27579,13 +28266,13 @@ function OhhwellsBridge() {
27579
28266
  itemDragSurface: false,
27580
28267
  toolbarAlign: "left",
27581
28268
  chromeGap: 24,
27582
- toolbar: fieldPickRect ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
28269
+ toolbar: fieldPickRect ? void 0 : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
27583
28270
  "div",
27584
28271
  {
27585
28272
  "data-ohw-form-toolbar": "",
27586
28273
  className: "pointer-events-auto flex items-center gap-0.5 whitespace-nowrap rounded-lg border border-border bg-background p-1 shadow-md",
27587
28274
  children: [
27588
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28275
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27589
28276
  "button",
27590
28277
  {
27591
28278
  type: "button",
@@ -27593,11 +28280,11 @@ function OhhwellsBridge() {
27593
28280
  className: "flex h-7 w-7 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted/80",
27594
28281
  onClick: () => setFieldTypePickerOpen((open) => !open),
27595
28282
  "data-ohw-add-field": "",
27596
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Plus, { size: 15, "aria-hidden": true })
28283
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.Plus, { size: 15, "aria-hidden": true })
27597
28284
  }
27598
28285
  ),
27599
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border" }),
27600
- /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
28286
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border" }),
28287
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
27601
28288
  "button",
27602
28289
  {
27603
28290
  type: "button",
@@ -27613,11 +28300,11 @@ function OhhwellsBridge() {
27613
28300
  });
27614
28301
  },
27615
28302
  children: [
27616
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Settings, { size: 14, "aria-hidden": true }),
28303
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.Settings, { size: 14, "aria-hidden": true }),
27617
28304
  "Form settings",
27618
28305
  formPickCount ? (
27619
28306
  // Counter pill, per the design — not a text suffix.
27620
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28307
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27621
28308
  "span",
27622
28309
  {
27623
28310
  "data-ohw-form-count": "",
@@ -27629,8 +28316,8 @@ function OhhwellsBridge() {
27629
28316
  ]
27630
28317
  }
27631
28318
  ),
27632
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border" }),
27633
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex items-center rounded-md bg-muted/70 p-0.5", children: ["default", "success"].map((state) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28319
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "mx-0.5 h-5 w-px bg-border" }),
28320
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex items-center rounded-md bg-muted/70 p-0.5", children: ["default", "success"].map((state) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27634
28321
  "button",
27635
28322
  {
27636
28323
  type: "button",
@@ -27661,7 +28348,7 @@ function OhhwellsBridge() {
27661
28348
  )
27662
28349
  }
27663
28350
  ),
27664
- formHoverRect && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28351
+ formHoverRect && !isItemDragging && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27665
28352
  ItemInteractionLayer,
27666
28353
  {
27667
28354
  rect: formHoverRect,
@@ -27669,7 +28356,7 @@ function OhhwellsBridge() {
27669
28356
  chromeGap: formHoverElRef.current && getFieldWrapper(formHoverElRef.current) ? 8 : 24
27670
28357
  }
27671
28358
  ),
27672
- fieldPickRect && fieldPickState && !isItemDragging && toolbarVariant !== "rich-text" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28359
+ fieldPickRect && fieldPickState && !isItemDragging && toolbarVariant !== "rich-text" && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27673
28360
  ItemInteractionLayer,
27674
28361
  {
27675
28362
  rect: fieldPickRect,
@@ -27681,7 +28368,7 @@ function OhhwellsBridge() {
27681
28368
  dragHandleLabel: "Reorder field",
27682
28369
  onDragHandleDragStart: handleFieldDragStart,
27683
28370
  onDragHandleDragEnd: handleFieldDragEnd,
27684
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28371
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27685
28372
  FormFieldToolbar,
27686
28373
  {
27687
28374
  type: fieldPickState.type,
@@ -27694,12 +28381,12 @@ function OhhwellsBridge() {
27694
28381
  )
27695
28382
  }
27696
28383
  ),
27697
- fieldDragging ? fieldDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28384
+ fieldDragging ? fieldDropSlots.map((slot, i) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27698
28385
  "div",
27699
28386
  {
27700
28387
  className: "pointer-events-none fixed z-[2147483644]",
27701
28388
  style: { top: slot.top, left: slot.left, width: slot.width },
27702
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28389
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27703
28390
  DropIndicator,
27704
28391
  {
27705
28392
  direction: "horizontal",
@@ -27712,7 +28399,7 @@ function OhhwellsBridge() {
27712
28399
  )) : null,
27713
28400
  fieldTypePickerOpen && formPickRect ? (() => {
27714
28401
  const toolbar = document.querySelector("[data-ohw-form-toolbar]")?.getBoundingClientRect();
27715
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28402
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27716
28403
  "div",
27717
28404
  {
27718
28405
  className: "pointer-events-none fixed z-[2147483645]",
@@ -27720,12 +28407,12 @@ function OhhwellsBridge() {
27720
28407
  top: toolbar ? toolbar.bottom + 6 : formPickRect.top + 16,
27721
28408
  left: toolbar ? toolbar.left : formPickRect.left + 24
27722
28409
  },
27723
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FieldTypePicker, { onPick: handleAddField })
28410
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FieldTypePicker, { onPick: handleAddField })
27724
28411
  }
27725
28412
  );
27726
28413
  })() : null,
27727
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
27728
- toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28414
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isNavbarLinksContainer2(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(NavbarContainerChrome, { rect: toolbarRect, onAdd: handleAddTopLevelNavItem }),
28415
+ toolbarVariant === "select-frame" && toolbarRect && !linkPopover && !isItemDragging && !isFooterFrameSelection && selectedElRef.current && isFooterLinksContainer(selectedElRef.current) && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27729
28416
  FooterContainerChrome,
27730
28417
  {
27731
28418
  rect: toolbarRect,
@@ -27733,7 +28420,7 @@ function OhhwellsBridge() {
27733
28420
  addDisabled: !canAddFooterColumn()
27734
28421
  }
27735
28422
  ),
27736
- toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28423
+ toolbarRect && !linkPopover && (toolbarVariant === "link-action" || toolbarVariant === "select-frame" || toolbarVariant === "logo") && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27737
28424
  ItemInteractionLayer,
27738
28425
  {
27739
28426
  rect: isItemDragging && draggedItemRect && (footerDragRef.current?.wasSelected || navDragRef.current?.wasSelected || selectedElRef.current === buttonCollectionDragRef.current) ? draggedItemRect : toolbarRect,
@@ -27753,7 +28440,7 @@ function OhhwellsBridge() {
27753
28440
  onItemPointerDown: toolbarVariant === "logo" ? void 0 : handleItemChromePointerDown,
27754
28441
  onItemClick: toolbarVariant === "logo" ? void 0 : handleItemChromeClick,
27755
28442
  itemDragSurface: toolbarVariant !== "logo" && !isFooterFrameSelection && !selectedIsSocialsRow,
27756
- toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28443
+ toolbar: toolbarVariant === "link-action" && !isItemDragging || toolbarVariant === "select-frame" && (isFooterFrameSelection || selectedIsSocialsRow) && !isItemDragging ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27757
28444
  ItemActionToolbar,
27758
28445
  {
27759
28446
  onEditLink: openLinkPopoverForSelected,
@@ -27804,8 +28491,8 @@ function OhhwellsBridge() {
27804
28491
  ) : void 0
27805
28492
  }
27806
28493
  ),
27807
- toolbarRect && toolbarVariant === "rich-text" && !linkPopover && !isRectOutsideClip(toolbarRect, getIframeVisibleClip(parentScrollRef.current)) && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
27808
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28494
+ toolbarRect && toolbarVariant === "rich-text" && !linkPopover && !isRectOutsideClip(toolbarRect, getIframeVisibleClip(parentScrollRef.current)) && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
28495
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27809
28496
  EditGlowChrome,
27810
28497
  {
27811
28498
  rect: toolbarRect,
@@ -27815,7 +28502,7 @@ function OhhwellsBridge() {
27815
28502
  hideHandle: isItemDragging
27816
28503
  }
27817
28504
  ),
27818
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28505
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27819
28506
  FloatingToolbar,
27820
28507
  {
27821
28508
  rect: toolbarRect,
@@ -27828,7 +28515,7 @@ function OhhwellsBridge() {
27828
28515
  }
27829
28516
  )
27830
28517
  ] }),
27831
- maxBadge && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
28518
+ maxBadge && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
27832
28519
  "div",
27833
28520
  {
27834
28521
  "data-ohw-max-badge": "",
@@ -27854,7 +28541,7 @@ function OhhwellsBridge() {
27854
28541
  ]
27855
28542
  }
27856
28543
  ),
27857
- toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28544
+ toggleState && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27858
28545
  StateToggle,
27859
28546
  {
27860
28547
  rect: toggleState.rect,
@@ -27863,15 +28550,15 @@ function OhhwellsBridge() {
27863
28550
  onStateChange: handleStateChange
27864
28551
  }
27865
28552
  ),
27866
- sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
28553
+ sectionGap && !linkPopover && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
27867
28554
  "div",
27868
28555
  {
27869
28556
  "data-ohw-section-insert-line": "",
27870
28557
  className: "fixed left-0 w-full z-2147483646 flex items-center pointer-events-none",
27871
28558
  style: { top: sectionGap.y, transform: "translateY(-50%)" },
27872
28559
  children: [
27873
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1 bg-bridge-primary", style: { height: 3 } }),
27874
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28560
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex-1 bg-bridge-primary", style: { height: 3 } }),
28561
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27875
28562
  Badge,
27876
28563
  {
27877
28564
  className: "px-8 py-1 bg-bridge-primary hover:bg-bridge-primary text-primary-foreground text-xs font-medium shrink-0 rounded-full cursor-pointer pointer-events-auto",
@@ -27888,11 +28575,11 @@ function OhhwellsBridge() {
27888
28575
  children: "Add Section"
27889
28576
  }
27890
28577
  ),
27891
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1 bg-bridge-primary", style: { height: 3 } })
28578
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex-1 bg-bridge-primary", style: { height: 3 } })
27892
28579
  ]
27893
28580
  }
27894
28581
  ),
27895
- linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28582
+ linkPopover && dialogPortalContainer ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27896
28583
  LinkPopover,
27897
28584
  {
27898
28585
  panelRef: linkPopoverPanelRef,
@@ -27909,7 +28596,7 @@ function OhhwellsBridge() {
27909
28596
  },
27910
28597
  linkPopover.key
27911
28598
  ) : null,
27912
- floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28599
+ floatingPanel && floatingPanel.kind === "socials-display" ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27913
28600
  FloatingPanel,
27914
28601
  {
27915
28602
  open: true,
@@ -27919,7 +28606,7 @@ function OhhwellsBridge() {
27919
28606
  onPositionChange: setFloatingPanelPos,
27920
28607
  parentScroll: parentScrollSnap ?? parentScrollRef.current,
27921
28608
  onClose: closeFloatingPanelOnly,
27922
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28609
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27923
28610
  SocialsDisplayPanel,
27924
28611
  {
27925
28612
  display: socialsDisplayFor(floatingPanel.row, editContentRef.current),
@@ -27940,19 +28627,19 @@ function OhhwellsBridge() {
27940
28627
  const tokens = tokensFromButton(button);
27941
28628
  const current = assignmentFor(button, editContentRef.current, tokens);
27942
28629
  void buttonStyleTick;
27943
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28630
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27944
28631
  FloatingPanel,
27945
28632
  {
27946
28633
  open: true,
27947
28634
  title: floatingPanel.title,
27948
28635
  context: floatingPanel.context,
27949
- icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_lucide_react20.Brush, { className: "size-4 shrink-0", "aria-hidden": true }),
28636
+ icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react21.Brush, { className: "size-4 shrink-0", "aria-hidden": true }),
27950
28637
  position: floatingPanelPos,
27951
28638
  onPositionChange: setFloatingPanelPos,
27952
28639
  parentScroll: parentScrollSnap ?? parentScrollRef.current,
27953
28640
  onClose: closeFloatingPanelOnly,
27954
28641
  bodyClassName: "gap-5",
27955
- children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
28642
+ children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
27956
28643
  ButtonStylePanel,
27957
28644
  {
27958
28645
  variants: tokens.variants,
@@ -27980,10 +28667,10 @@ function OhhwellsBridge() {
27980
28667
 
27981
28668
  // src/ui/EmptySection.tsx
27982
28669
  var import_link = __toESM(require("next/link"), 1);
27983
- var import_jsx_runtime37 = require("react/jsx-runtime");
28670
+ var import_jsx_runtime38 = require("react/jsx-runtime");
27984
28671
  function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey }) {
27985
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
27986
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28672
+ return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
28673
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
27987
28674
  "p",
27988
28675
  {
27989
28676
  style: {
@@ -27995,10 +28682,10 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
27995
28682
  color: "var(--brand-accent)",
27996
28683
  marginBottom: "1.5rem"
27997
28684
  },
27998
- children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_link.default, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
28685
+ children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_link.default, { href: homeHref, style: { color: "inherit" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { ...eyebrowKey ? { "data-ohw-editable": "text", "data-ohw-key": eyebrowKey } : {}, children: "Home" }) })
27999
28686
  }
28000
28687
  ),
28001
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28688
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
28002
28689
  "h1",
28003
28690
  {
28004
28691
  style: {
@@ -28013,7 +28700,7 @@ function EmptySection({ title, homeHref = "/", eyebrowKey, titleKey, subtitleKey
28013
28700
  children: title
28014
28701
  }
28015
28702
  ),
28016
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
28703
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
28017
28704
  "p",
28018
28705
  {
28019
28706
  style: {