sanity-plugin-seo-copilot 0.2.15 → 0.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +63 -50
  2. package/dist/index.js +841 -782
  3. package/dist/index.mjs +763 -704
  4. package/package.json +62 -64
  5. package/dist/index.js.map +0 -1
  6. package/dist/index.mjs.map +0 -1
  7. package/sanity.json +0 -3
  8. package/src/components/ChatPanel.tsx +0 -311
  9. package/src/components/ConfigContext.tsx +0 -22
  10. package/src/components/FeedbackButton.tsx +0 -218
  11. package/src/components/KeywordBadge.tsx +0 -50
  12. package/src/components/KeywordPanel.tsx +0 -1234
  13. package/src/components/OnboardingPopup.tsx +0 -108
  14. package/src/components/PlacementIndicators.tsx +0 -80
  15. package/src/components/ReportProblemButton.tsx +0 -212
  16. package/src/components/SEOCopilotPanel.tsx +0 -1287
  17. package/src/components/ScoreDonut.tsx +0 -158
  18. package/src/components/SeedKeywordInput.tsx +0 -128
  19. package/src/components/ShimmerLoader.tsx +0 -123
  20. package/src/components/TabBar.tsx +0 -373
  21. package/src/components/styles.ts +0 -158
  22. package/src/components/tabs/AEOTab.tsx +0 -585
  23. package/src/components/tabs/LinkingTab.tsx +0 -446
  24. package/src/components/tabs/MetaTab.tsx +0 -431
  25. package/src/components/tabs/SummaryTab.tsx +0 -405
  26. package/src/components/tabs/TechnicalTab.tsx +0 -933
  27. package/src/hooks/useDocumentContent.ts +0 -48
  28. package/src/hooks/useKeywordAnalysis.ts +0 -292
  29. package/src/hooks/useSEOChat.ts +0 -254
  30. package/src/index.ts +0 -18
  31. package/src/inspector.ts +0 -58
  32. package/src/lib/api.ts +0 -262
  33. package/src/lib/apiKey.ts +0 -30
  34. package/src/lib/documentExtract.ts +0 -422
  35. package/src/lib/geoAnalysis.ts +0 -122
  36. package/src/lib/persistence.ts +0 -69
  37. package/src/lib/scoring.ts +0 -197
  38. package/src/lib/summary.ts +0 -645
  39. package/src/lib/types.ts +0 -212
  40. package/src/lib/utils.ts +0 -35
  41. package/v2-incompatible.js +0 -10
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { definePlugin } from "sanity";
5
5
  import { createElement } from "react";
6
6
 
7
7
  // src/components/SEOCopilotPanel.tsx
8
- import { useState as useState17, useRef as useRef12, useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo5, Suspense } from "react";
8
+ import { useState as useState18, useRef as useRef12, useCallback as useCallback5, useEffect as useEffect12, useMemo as useMemo5, Suspense } from "react";
9
9
  import { useWorkspace } from "sanity";
10
10
  import { createPortal } from "react-dom";
11
11
 
@@ -466,19 +466,6 @@ async function lookupKeywords(apiUrl, keywords, signal) {
466
466
  }
467
467
  return response.json();
468
468
  }
469
- async function loadChatHistory(apiUrl, userId, documentId) {
470
- try {
471
- const res = await fetch(
472
- `${apiUrl}/api/seo-copilot/chat-history?userId=${encodeURIComponent(userId)}&documentId=${encodeURIComponent(documentId)}`,
473
- { headers: authHeaders() }
474
- );
475
- if (!res.ok) return [];
476
- const data = await res.json();
477
- return data.messages || [];
478
- } catch {
479
- return [];
480
- }
481
- }
482
469
  async function fetchContentSuggestions(apiUrl, content, primaryKeyword, publication, signal) {
483
470
  const empty = { keyTakeaways: [], infographicOpportunities: [], bulletListItems: [] };
484
471
  try {
@@ -533,16 +520,6 @@ async function checkLinks(apiUrl, urls) {
533
520
  return [];
534
521
  }
535
522
  }
536
- async function saveChatHistory(apiUrl, userId, documentId, messages, publication) {
537
- try {
538
- await fetch(`${apiUrl}/api/seo-copilot/chat-history`, {
539
- method: "POST",
540
- headers: jsonHeaders(),
541
- body: JSON.stringify({ userId, documentId, messages, publication })
542
- });
543
- } catch {
544
- }
545
- }
546
523
 
547
524
  // src/hooks/useKeywordAnalysis.ts
548
525
  function mergeVolumes(analysis, volumeMap) {
@@ -774,21 +751,6 @@ function useKeywordAnalysis(text, apiUrl, publication, seedKeywords, documentFie
774
751
 
775
752
  // src/hooks/useSEOChat.ts
776
753
  import { useState as useState3, useCallback as useCallback2, useEffect as useEffect3, useRef as useRef3 } from "react";
777
- import { useCurrentUser } from "sanity";
778
- function getLocalUserId() {
779
- if (typeof window === "undefined") return "anonymous";
780
- const key = "seo-copilot-user-id";
781
- try {
782
- let id = localStorage.getItem(key);
783
- if (!id) {
784
- id = `user-${Math.random().toString(36).slice(2)}-${Date.now()}`;
785
- localStorage.setItem(key, id);
786
- }
787
- return id;
788
- } catch {
789
- return "anonymous";
790
- }
791
- }
792
754
  function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documentId) {
793
755
  const chatCacheKey = documentId ? `seo-copilot-chat-${documentId}` : "seo-copilot-chat-default";
794
756
  const loadCachedMessages = useCallback2(() => {
@@ -805,14 +767,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
805
767
  setMessagesRaw(msgs);
806
768
  }, []);
807
769
  const [isStreaming, setIsStreaming] = useState3(false);
808
- const [historyLoaded, setHistoryLoaded] = useState3(false);
809
- const sanityUser = useCurrentUser();
810
- const userId = useRef3(sanityUser?.id || getLocalUserId());
811
- useEffect3(() => {
812
- if (sanityUser?.id && userId.current !== sanityUser.id) {
813
- userId.current = sanityUser.id;
814
- }
815
- }, [sanityUser?.id]);
816
770
  useEffect3(() => {
817
771
  messagesRef.current = messages;
818
772
  }, [messages]);
@@ -829,10 +783,8 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
829
783
  useEffect3(() => {
830
784
  return () => {
831
785
  streamAbortRef.current?.abort();
832
- if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
833
786
  };
834
787
  }, []);
835
- const saveTimerRef = useRef3(null);
836
788
  const opVersionRef = useRef3(0);
837
789
  const didInitRef = useRef3(false);
838
790
  useEffect3(() => {
@@ -845,34 +797,7 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
845
797
  streamAbortRef.current = null;
846
798
  setMessagesRaw(loadCachedMessages());
847
799
  setIsStreaming(false);
848
- setHistoryLoaded(false);
849
- if (saveTimerRef.current) {
850
- clearTimeout(saveTimerRef.current);
851
- saveTimerRef.current = null;
852
- }
853
800
  }, [documentId, loadCachedMessages]);
854
- useEffect3(() => {
855
- if (!documentId || historyLoaded) return;
856
- const myVersion = opVersionRef.current;
857
- let cancelled = false;
858
- loadChatHistory(apiUrl, userId.current, documentId).then((loaded) => {
859
- if (cancelled || opVersionRef.current !== myVersion) return;
860
- if (loaded.length > 0) {
861
- setMessages((current) => current.length === 0 ? loaded : current);
862
- }
863
- setHistoryLoaded(true);
864
- });
865
- return () => {
866
- cancelled = true;
867
- };
868
- }, [apiUrl, documentId, historyLoaded]);
869
- const scheduleSave = useCallback2((msgs) => {
870
- if (!documentId) return;
871
- if (saveTimerRef.current) clearTimeout(saveTimerRef.current);
872
- saveTimerRef.current = setTimeout(() => {
873
- saveChatHistory(apiUrl, userId.current, documentId, msgs, publication);
874
- }, 800);
875
- }, [apiUrl, documentId, publication]);
876
801
  const sendMessage = useCallback2(
877
802
  async (text) => {
878
803
  const myVersion = opVersionRef.current;
@@ -941,13 +866,6 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
941
866
  }
942
867
  }
943
868
  }
944
- if (opVersionRef.current === myVersion) {
945
- const finalMessages = [
946
- ...updatedMessages,
947
- { role: "assistant", content: assistantContent }
948
- ];
949
- scheduleSave(finalMessages);
950
- }
951
869
  } catch (err) {
952
870
  if (err instanceof Error && err.name === "AbortError") {
953
871
  setIsStreaming(false);
@@ -965,14 +883,11 @@ function useSEOChat(apiUrl, documentText, publication, keywordPanelData, documen
965
883
  }
966
884
  if (opVersionRef.current === myVersion) setIsStreaming(false);
967
885
  },
968
- [apiUrl, documentText, publication, keywordPanelData, scheduleSave]
886
+ [apiUrl, documentText, publication, keywordPanelData]
969
887
  );
970
888
  const clearChat = useCallback2(() => {
971
889
  setMessages([]);
972
- if (documentId) {
973
- saveChatHistory(apiUrl, userId.current, documentId, [], publication);
974
- }
975
- }, [apiUrl, documentId, publication]);
890
+ }, [setMessages]);
976
891
  return { messages, isStreaming, sendMessage, clearChat };
977
892
  }
978
893
 
@@ -1025,7 +940,7 @@ function IndicatorDot({ letter, active, tooltip }) {
1025
940
  lineHeight: 1,
1026
941
  cursor: "default",
1027
942
  flexShrink: 0,
1028
- // Inactive = a solid WHITE disc (was a near-invisible faint-grey ring on
943
+ // Inactive = a solid white disc (was a near-invisible faint-grey ring on
1029
944
  // transparent) so each indicator reads clearly on the warm panel; a light
1030
945
  // edge + soft lift keep it defined even on a white card. Active = green.
1031
946
  background: active ? "#16a34a" : "#ffffff",
@@ -1310,20 +1225,24 @@ function SeedKeywordInput({ seeds, onSeedsChange }) {
1310
1225
 
1311
1226
  // src/components/FeedbackButton.tsx
1312
1227
  import { useState as useState6, useRef as useRef5, useEffect as useEffect4 } from "react";
1313
- import { useCurrentUser as useCurrentUser2 } from "sanity";
1228
+ import { useCurrentUser } from "sanity";
1314
1229
  import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1315
1230
  function FeedbackButton({ suggestionType, suggestionText, documentId, publication }) {
1316
1231
  const { apiUrl } = useConfig();
1317
- const sanityUser = useCurrentUser2();
1232
+ const sanityUser = useCurrentUser();
1318
1233
  const [vote, setVote] = useState6(null);
1319
1234
  const [showReasonPopup, setShowReasonPopup] = useState6(false);
1320
1235
  const [reason, setReason] = useState6("");
1321
1236
  const [submitted, setSubmitted] = useState6(false);
1237
+ const [failed, setFailed] = useState6(false);
1322
1238
  const popupRef = useRef5(null);
1323
1239
  const inputRef = useRef5(null);
1324
1240
  const submitTimerRef = useRef5(null);
1241
+ const downVoteUnsentRef = useRef5(false);
1242
+ const mounted = useRef5(true);
1325
1243
  useEffect4(() => {
1326
1244
  return () => {
1245
+ mounted.current = false;
1327
1246
  if (submitTimerRef.current) clearTimeout(submitTimerRef.current);
1328
1247
  };
1329
1248
  }, []);
@@ -1332,6 +1251,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1332
1251
  const handler = (e) => {
1333
1252
  if (popupRef.current && !popupRef.current.contains(e.target)) {
1334
1253
  setShowReasonPopup(false);
1254
+ if (downVoteUnsentRef.current) setVote(null);
1335
1255
  }
1336
1256
  };
1337
1257
  document.addEventListener("mousedown", handler);
@@ -1342,56 +1262,69 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1342
1262
  setTimeout(() => inputRef.current?.focus(), 50);
1343
1263
  }
1344
1264
  }, [showReasonPopup]);
1265
+ const send = async (type, text, v) => {
1266
+ try {
1267
+ await submitFeedback(apiUrl, {
1268
+ suggestion_type: type,
1269
+ suggestion_text: text,
1270
+ vote: v,
1271
+ document_id: documentId,
1272
+ publication,
1273
+ user_id: sanityUser?.id
1274
+ });
1275
+ return true;
1276
+ } catch (e) {
1277
+ console.error("[SEO Copilot] failed to send feedback:", e);
1278
+ return false;
1279
+ }
1280
+ };
1345
1281
  const handleVote = async (v) => {
1282
+ setFailed(false);
1346
1283
  if (v === "down" && vote !== "down") {
1347
1284
  setVote("down");
1348
1285
  setShowReasonPopup(true);
1349
1286
  setSubmitted(false);
1350
- try {
1351
- await submitFeedback(apiUrl, {
1352
- suggestion_type: suggestionType,
1353
- suggestion_text: suggestionText,
1354
- vote: "down",
1355
- document_id: documentId,
1356
- publication,
1357
- user_id: sanityUser?.id
1358
- });
1359
- } catch {
1360
- }
1287
+ downVoteUnsentRef.current = true;
1288
+ const ok = await send(suggestionType, suggestionText, "down");
1289
+ if (ok) downVoteUnsentRef.current = false;
1290
+ else if (mounted.current) setFailed(true);
1361
1291
  return;
1362
1292
  }
1363
1293
  const newVote = vote === v ? null : v;
1364
1294
  setVote(newVote);
1365
1295
  setShowReasonPopup(false);
1366
1296
  if (newVote) {
1367
- try {
1368
- await submitFeedback(apiUrl, {
1369
- suggestion_type: suggestionType,
1370
- suggestion_text: suggestionText,
1371
- vote: newVote,
1372
- document_id: documentId,
1373
- publication,
1374
- user_id: sanityUser?.id
1375
- });
1376
- } catch {
1297
+ const ok = await send(suggestionType, suggestionText, newVote);
1298
+ if (!ok && mounted.current) {
1299
+ setVote(null);
1300
+ setFailed(true);
1377
1301
  }
1378
1302
  }
1379
1303
  };
1304
+ const handleSkip = () => {
1305
+ setShowReasonPopup(false);
1306
+ setReason("");
1307
+ if (downVoteUnsentRef.current) setVote(null);
1308
+ };
1380
1309
  const handleSubmitReason = async () => {
1381
1310
  const trimmed = reason.trim();
1311
+ setFailed(false);
1312
+ if (downVoteUnsentRef.current) {
1313
+ const ok = await send(suggestionType, suggestionText, "down");
1314
+ if (!ok) {
1315
+ if (mounted.current) setFailed(true);
1316
+ return;
1317
+ }
1318
+ downVoteUnsentRef.current = false;
1319
+ }
1382
1320
  if (trimmed) {
1383
- try {
1384
- await submitFeedback(apiUrl, {
1385
- suggestion_type: suggestionType + "_reason",
1386
- suggestion_text: suggestionText + " | REASON: " + trimmed,
1387
- vote: "down",
1388
- document_id: documentId,
1389
- publication,
1390
- user_id: sanityUser?.id
1391
- });
1392
- } catch {
1321
+ const ok = await send(suggestionType + "_reason", suggestionText + " | REASON: " + trimmed, "down");
1322
+ if (!ok) {
1323
+ if (mounted.current) setFailed(true);
1324
+ return;
1393
1325
  }
1394
1326
  }
1327
+ if (!mounted.current) return;
1395
1328
  setSubmitted(true);
1396
1329
  submitTimerRef.current = setTimeout(() => {
1397
1330
  setShowReasonPopup(false);
@@ -1437,6 +1370,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1437
1370
  children: /* @__PURE__ */ jsx4("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx4("path", { d: "M19 11.75a1.25 1.25 0 11-2.5 0v-7.5a1.25 1.25 0 112.5 0v7.5zM9 17v1.3c0 .268-.14.526-.395.607A2 2 0 016 17c0-.995.182-1.948.514-2.826.204-.54-.166-1.174-.744-1.174H3.25c-1.243 0-2.261-1.01-2.146-2.247a23.864 23.864 0 011.341-5.974A1.637 1.637 0 014 3.75h9.5V12.5L9 17z" }) })
1438
1371
  }
1439
1372
  ),
1373
+ failed && !showReasonPopup && /* @__PURE__ */ jsx4("span", { role: "alert", style: { fontSize: 10, color: "#dc2626", fontWeight: 600, whiteSpace: "nowrap", marginLeft: 2 }, children: "Couldn't send - try again" }),
1440
1374
  showReasonPopup && /* @__PURE__ */ jsx4(
1441
1375
  "div",
1442
1376
  {
@@ -1455,7 +1389,9 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1455
1389
  border: "1px solid #e5e7eb"
1456
1390
  },
1457
1391
  children: submitted ? /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, color: "#16a34a", textAlign: "center", padding: "4px 0" }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ jsxs3(Fragment, { children: [
1458
- /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom: 6 }, children: "Sorry! What went wrong?" }),
1392
+ /* @__PURE__ */ jsx4("div", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937", marginBottom: 3 }, children: "Sorry! What went wrong?" }),
1393
+ /* @__PURE__ */ jsx4("div", { style: { fontSize: 10, color: "#6b7280", marginBottom: 6, lineHeight: 1.45 }, children: "Sends your vote, this suggestion and your note, plus your user ID, document ID and publication when available." }),
1394
+ failed && /* @__PURE__ */ jsx4("div", { role: "alert", style: { fontSize: 10.5, color: "#dc2626", marginBottom: 6, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - try again" }),
1459
1395
  /* @__PURE__ */ jsx4(
1460
1396
  "input",
1461
1397
  {
@@ -1483,10 +1419,7 @@ function FeedbackButton({ suggestionType, suggestionText, documentId, publicatio
1483
1419
  /* @__PURE__ */ jsx4(
1484
1420
  "button",
1485
1421
  {
1486
- onClick: () => {
1487
- setShowReasonPopup(false);
1488
- setReason("");
1489
- },
1422
+ onClick: handleSkip,
1490
1423
  style: {
1491
1424
  padding: "3px 8px",
1492
1425
  fontSize: 10,
@@ -1564,6 +1497,165 @@ function usePersistentState(key, initial) {
1564
1497
  return [val, set];
1565
1498
  }
1566
1499
 
1500
+ // src/lib/keywordAnchor.ts
1501
+ function keywordAnchorId(term) {
1502
+ const key = term.toLowerCase().trim();
1503
+ const slug = key.replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
1504
+ let hash = 5381;
1505
+ for (let i = 0; i < key.length; i++) hash = (hash * 33 ^ key.charCodeAt(i)) >>> 0;
1506
+ return `anchor-kw-${slug}-${hash.toString(36)}`;
1507
+ }
1508
+
1509
+ // src/lib/format.ts
1510
+ function abbrevVol(v) {
1511
+ if (v == null) return "";
1512
+ if (v === 0) return "N/A";
1513
+ if (v >= 1e4) return Math.round(v / 1e3) + "K";
1514
+ if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
1515
+ return String(v);
1516
+ }
1517
+
1518
+ // src/lib/scoring.ts
1519
+ function countWholeMatches(haystack, needle) {
1520
+ if (!needle) return 0;
1521
+ const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1522
+ const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
1523
+ return m ? m.length : 0;
1524
+ }
1525
+ function isKeywordInText(text, term) {
1526
+ return text.toLowerCase().includes(term.toLowerCase());
1527
+ }
1528
+ function calculateContentScoreDetailed(content, analysis, documentFields) {
1529
+ if (!content || !analysis) {
1530
+ return { total: 0, components: [] };
1531
+ }
1532
+ const lowerContent = content.toLowerCase();
1533
+ const words = content.split(/\s+/).filter(Boolean).length;
1534
+ const components = [];
1535
+ const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
1536
+ if (primaryTerm) {
1537
+ const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
1538
+ const phraseCount = countWholeMatches(lowerContent, primaryTerm);
1539
+ let occurrences = phraseCount;
1540
+ let viaTokens = false;
1541
+ if (phraseCount === 0 && tokens.length > 0) {
1542
+ const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
1543
+ if (counts.every((c) => c > 0)) {
1544
+ occurrences = Math.min(...counts);
1545
+ viaTokens = true;
1546
+ }
1547
+ }
1548
+ const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
1549
+ let pts = 0;
1550
+ let detail;
1551
+ if (occurrences === 0) {
1552
+ detail = `Primary keyword "${primaryTerm}" not found in content`;
1553
+ } else {
1554
+ pts += 12;
1555
+ const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
1556
+ if (density >= 0.5 && density <= 2.5) {
1557
+ pts += 13;
1558
+ detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
1559
+ } else if (density < 0.5) {
1560
+ pts += 7;
1561
+ detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
1562
+ } else if (viaTokens && density <= 6) {
1563
+ pts += 11;
1564
+ detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
1565
+ } else {
1566
+ pts += 4;
1567
+ detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
1568
+ }
1569
+ if (viaTokens) {
1570
+ detail = `Exact phrase "${analysis.primaryKeyword.term}" is not in the article - its words appear separately`;
1571
+ }
1572
+ }
1573
+ components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
1574
+ } else {
1575
+ components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
1576
+ }
1577
+ const supportingKws = analysis.supportingKeywords || [];
1578
+ if (supportingKws.length > 0) {
1579
+ const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
1580
+ const coverageRatio = inContentCount / supportingKws.length;
1581
+ const pts = Math.round(coverageRatio * 25);
1582
+ components.push({
1583
+ label: "Supporting keyword coverage",
1584
+ points: pts,
1585
+ max: 25,
1586
+ detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
1587
+ });
1588
+ } else {
1589
+ components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
1590
+ }
1591
+ let wcPts = 0;
1592
+ let wcDetail;
1593
+ if (words >= 1500) {
1594
+ wcPts = 15;
1595
+ wcDetail = `${words} words - strong length for clinical content`;
1596
+ } else if (words >= 450) {
1597
+ wcPts = 11;
1598
+ wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
1599
+ } else if (words >= 200) {
1600
+ wcPts = 5;
1601
+ wcDetail = `${words} words - below the 450-word floor`;
1602
+ } else {
1603
+ wcDetail = `${words} words - start writing`;
1604
+ }
1605
+ components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
1606
+ let hasH1orTitle;
1607
+ let hasSubheadings;
1608
+ if (documentFields) {
1609
+ hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
1610
+ const det = documentFields.headingsDetailed;
1611
+ const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
1612
+ hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
1613
+ } else {
1614
+ hasH1orTitle = /^#\s|<h1/im.test(content);
1615
+ hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
1616
+ }
1617
+ const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
1618
+ const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
1619
+ components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
1620
+ const suggested = [];
1621
+ const seen = /* @__PURE__ */ new Set();
1622
+ for (const kw of [...analysis.supportingKeywords || [], ...analysis.missingKeywords || []]) {
1623
+ if (kw == null || typeof kw.term !== "string") continue;
1624
+ const key = kw.term.toLowerCase();
1625
+ if (seen.has(key)) continue;
1626
+ seen.add(key);
1627
+ suggested.push({ term: kw.term, volume: kw.volume ?? null });
1628
+ }
1629
+ const withVolume = suggested.filter((kw) => kw.volume != null && kw.volume > 0);
1630
+ const pool = withVolume.length > 0 ? withVolume : suggested;
1631
+ const stillMissing = pool.filter((kw) => !isKeywordInText(content, kw.term)).sort((a, b) => (b.volume ?? 0) - (a.volume ?? 0));
1632
+ let mPts = 0;
1633
+ let mDetail;
1634
+ if (stillMissing.length === 0) {
1635
+ mPts = 15;
1636
+ mDetail = "No missing keywords - every suggestion is in your article";
1637
+ } else {
1638
+ const usedShare = (pool.length - stillMissing.length) / pool.length;
1639
+ mPts = usedShare >= 0.75 ? 15 : usedShare >= 0.5 ? 10 : usedShare >= 0.25 ? 5 : 0;
1640
+ mDetail = "Suggested keywords not in your article yet";
1641
+ }
1642
+ components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail, missingKeywords: stillMissing });
1643
+ let qCount;
1644
+ if (documentFields) {
1645
+ qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
1646
+ } else {
1647
+ qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
1648
+ }
1649
+ let aeoPts = 0;
1650
+ if (qCount >= 3) aeoPts = 10;
1651
+ else if (qCount === 2) aeoPts = 7;
1652
+ else if (qCount === 1) aeoPts = 4;
1653
+ const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
1654
+ components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
1655
+ const total = components.reduce((sum, c) => sum + c.points, 0);
1656
+ return { total: Math.min(100, Math.max(0, total)), components };
1657
+ }
1658
+
1567
1659
  // src/components/KeywordPanel.tsx
1568
1660
  import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1569
1661
  function loadLocalArray(key) {
@@ -1584,29 +1676,21 @@ var cardStyle = {
1584
1676
  boxShadow: "inset 0 0 0 1px rgba(255,255,255,0.85), inset 1.5px 2px 1px -1px rgba(255,255,255,1), inset -2px -3px 2px -1px rgba(255,255,255,0.6), 0 2px 6px rgba(0,0,0,0.07), 0 10px 26px rgba(0,0,0,0.08)",
1585
1677
  padding: "14px"
1586
1678
  };
1587
- function abbrevVol(v) {
1588
- if (v == null) return "";
1589
- if (v === 0) return "N/A";
1590
- if (v >= 1e4) return Math.round(v / 1e3) + "K";
1591
- if (v >= 1e3) return (v / 1e3).toFixed(1) + "K";
1592
- return String(v);
1593
- }
1594
1679
  function placementCount(p) {
1595
1680
  if (!p) return 0;
1596
1681
  return [p.inBody, p.inTitle, p.inMetaDescription, p.inImages, p.inUrl].filter(Boolean).length;
1597
1682
  }
1598
1683
  function buildSuggestedKeywords(supporting, missing, documentText, documentFields) {
1599
1684
  const merged = [];
1600
- const lowerText = documentText.toLowerCase();
1601
1685
  for (const kw of supporting) {
1602
1686
  if (kw == null || typeof kw.term !== "string") continue;
1603
- const actuallyInContent = lowerText.includes(kw.term.toLowerCase());
1687
+ const actuallyInContent = isKeywordInText(documentText, kw.term);
1604
1688
  const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
1605
1689
  merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, placement: livePlacement });
1606
1690
  }
1607
1691
  for (const kw of missing) {
1608
1692
  if (kw == null || typeof kw.term !== "string") continue;
1609
- const actuallyInContent = lowerText.includes(kw.term.toLowerCase());
1693
+ const actuallyInContent = isKeywordInText(documentText, kw.term);
1610
1694
  const livePlacement = computePlacementClient(kw.term, documentText, documentFields);
1611
1695
  merged.push({ term: kw.term, volume: kw.volume ?? 0, inContent: actuallyInContent, reason: kw.reason, placement: livePlacement });
1612
1696
  }
@@ -1890,7 +1974,8 @@ function SuggestedKeywordsCard({
1890
1974
  documentId,
1891
1975
  secondaryKeyword,
1892
1976
  onSelectSecondary,
1893
- primaryTerm
1977
+ primaryTerm,
1978
+ focusKeyword
1894
1979
  }) {
1895
1980
  const docScope = documentId || "default";
1896
1981
  const [helpData, setHelpData] = usePersistentState(
@@ -2015,6 +2100,24 @@ function SuggestedKeywordsCard({
2015
2100
  return next;
2016
2101
  });
2017
2102
  };
2103
+ useEffect6(() => {
2104
+ if (!focusKeyword) return;
2105
+ const reveal = setTimeout(() => {
2106
+ setExpanded(true);
2107
+ setActiveFilters(/* @__PURE__ */ new Set());
2108
+ }, 0);
2109
+ const scroll = setTimeout(() => {
2110
+ const el = typeof document !== "undefined" ? document.getElementById(keywordAnchorId(focusKeyword.term)) : null;
2111
+ if (!el) return;
2112
+ el.scrollIntoView({ behavior: "smooth", block: "center" });
2113
+ el.classList.add("seo-copilot-flash");
2114
+ setTimeout(() => el.classList.remove("seo-copilot-flash"), 1400);
2115
+ }, 80);
2116
+ return () => {
2117
+ clearTimeout(reveal);
2118
+ clearTimeout(scroll);
2119
+ };
2120
+ }, [focusKeyword?.nonce]);
2018
2121
  let filtered = keywords;
2019
2122
  if (activeFilters.size > 0) {
2020
2123
  const hasNoneFilter = activeFilters.has("none");
@@ -2353,7 +2456,7 @@ function SuggestedKeywordsCard({
2353
2456
  }
2354
2457
  )
2355
2458
  ] }),
2356
- /* @__PURE__ */ jsx5("div", { children: visible.map((kw, i) => /* @__PURE__ */ jsxs4("div", { children: [
2459
+ /* @__PURE__ */ jsx5("div", { children: visible.map((kw, i) => /* @__PURE__ */ jsxs4("div", { id: keywordAnchorId(kw.term), children: [
2357
2460
  /* @__PURE__ */ jsxs4("div", { style: {
2358
2461
  display: "flex",
2359
2462
  alignItems: "center",
@@ -2483,7 +2586,8 @@ function KeywordPanel({
2483
2586
  onSelectSecondary,
2484
2587
  documentFields,
2485
2588
  documentId,
2486
- externalAnalysis
2589
+ externalAnalysis,
2590
+ focusKeyword
2487
2591
  }) {
2488
2592
  const { apiUrl } = useConfig();
2489
2593
  const { analysis, isLoading, error, deepAnalysis, isDeepLoading, runDeepAnalysis } = externalAnalysis;
@@ -2584,7 +2688,8 @@ function KeywordPanel({
2584
2688
  documentId,
2585
2689
  secondaryKeyword,
2586
2690
  onSelectSecondary,
2587
- primaryTerm: activeTerm
2691
+ primaryTerm: activeTerm,
2692
+ focusKeyword
2588
2693
  },
2589
2694
  documentId || "default"
2590
2695
  ),
@@ -3040,7 +3145,7 @@ function TabBar({ tabs, activeTab, onTabChange }) {
3040
3145
  WebkitBackdropFilter: "blur(16px) saturate(170%)",
3041
3146
  // Beveled glass: top-left light edge + bottom-right inner shadow + a soft blue glow.
3042
3147
  boxShadow: "inset 1px 1px 3px rgba(255,255,255,0.4), inset -1px -1px 5px rgba(0,0,0,0.28), 0 0 14px rgba(0,93,172,0.40), 0 2px 8px rgba(0,0,0,0.15)",
3043
- // Always a DEFINED transition (never "none") - that's what keeps every
3148
+ // Always a defined transition (never "none") - that's what keeps every
3044
3149
  // click animating. Normally: a real slide with a gentle bounce that lands
3045
3150
  // on arrival (ease-out-back), for the distance-scaled duration so long
3046
3151
  // jumps glide instead of darting. While resizing: 0ms = track instantly
@@ -3270,11 +3375,11 @@ function OnboardingCard({ onDismiss, closing }) {
3270
3375
 
3271
3376
  // src/components/ReportProblemButton.tsx
3272
3377
  import { useState as useState11, useRef as useRef10, useEffect as useEffect9 } from "react";
3273
- import { useCurrentUser as useCurrentUser3 } from "sanity";
3378
+ import { useCurrentUser as useCurrentUser2 } from "sanity";
3274
3379
  import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3275
3380
  function ReportProblemButton({ activeTab, publication, documentId, documentType, primaryKeyword }) {
3276
3381
  const { apiUrl } = useConfig();
3277
- const sanityUser = useCurrentUser3();
3382
+ const sanityUser = useCurrentUser2();
3278
3383
  const [open, setOpen] = useState11(false);
3279
3384
  const [text, setText] = useState11("");
3280
3385
  const [submitting, setSubmitting] = useState11(false);
@@ -3397,7 +3502,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
3397
3502
  },
3398
3503
  children: submitted ? /* @__PURE__ */ jsx9("div", { style: { fontSize: 12, color: "#16a34a", textAlign: "center", padding: "6px 0", fontWeight: 600 }, children: "Thanks - we got it." }) : /* @__PURE__ */ jsxs8(Fragment5, { children: [
3399
3504
  /* @__PURE__ */ jsx9("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 3 }, children: "Report a problem" }),
3400
- /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also note which tab you're on to help us track it down." }),
3505
+ /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#6b7280", marginBottom: 8, lineHeight: 1.45 }, children: "Beta - tell us what went wrong. We also include your Sanity user ID, the tab, document and keyword you're working on, the page URL and basic browser details to help us track it down." }),
3401
3506
  failed && /* @__PURE__ */ jsx9("div", { style: { fontSize: 10.5, color: "#dc2626", marginBottom: 8, lineHeight: 1.45, fontWeight: 600 }, children: "Couldn't send - please try again." }),
3402
3507
  /* @__PURE__ */ jsx9(
3403
3508
  "textarea",
@@ -3476,7 +3581,7 @@ function ReportProblemButton({ activeTab, publication, documentId, documentType,
3476
3581
  }
3477
3582
 
3478
3583
  // src/components/tabs/SummaryTab.tsx
3479
- import { useMemo, useState as useState13 } from "react";
3584
+ import { useMemo, useState as useState14 } from "react";
3480
3585
 
3481
3586
  // src/components/ShimmerLoader.tsx
3482
3587
  import { useEffect as useEffect10, useState as useState12 } from "react";
@@ -3577,134 +3682,6 @@ var DEFAULT_GENERATE_ALL_MESSAGES = [
3577
3682
  "Compiling summary"
3578
3683
  ];
3579
3684
 
3580
- // src/lib/scoring.ts
3581
- function countWholeMatches(haystack, needle) {
3582
- if (!needle) return 0;
3583
- const esc = needle.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3584
- const m = haystack.match(new RegExp(`\\b${esc}\\b`, "g"));
3585
- return m ? m.length : 0;
3586
- }
3587
- function calculateContentScoreDetailed(content, analysis, documentFields) {
3588
- if (!content || !analysis) {
3589
- return { total: 0, components: [] };
3590
- }
3591
- const lowerContent = content.toLowerCase();
3592
- const words = content.split(/\s+/).filter(Boolean).length;
3593
- const components = [];
3594
- const primaryTerm = (analysis.primaryKeyword?.term || "").toLowerCase();
3595
- if (primaryTerm) {
3596
- const tokens = primaryTerm.split(/\s+/).filter((t) => t.length > 1);
3597
- const phraseCount = countWholeMatches(lowerContent, primaryTerm);
3598
- let occurrences = phraseCount;
3599
- let viaTokens = false;
3600
- if (phraseCount === 0 && tokens.length > 0) {
3601
- const counts = tokens.map((t) => countWholeMatches(lowerContent, t));
3602
- if (counts.every((c) => c > 0)) {
3603
- occurrences = Math.min(...counts);
3604
- viaTokens = true;
3605
- }
3606
- }
3607
- const primaryWordCount = Math.max(1, primaryTerm.split(/\s+/).filter(Boolean).length);
3608
- let pts = 0;
3609
- let detail;
3610
- if (occurrences === 0) {
3611
- detail = `Primary keyword "${primaryTerm}" not found in content`;
3612
- } else {
3613
- pts += 12;
3614
- const density = words > 0 ? (viaTokens ? occurrences : occurrences * primaryWordCount) / words * 100 : 0;
3615
- if (density >= 0.5 && density <= 2.5) {
3616
- pts += 13;
3617
- detail = `Primary keyword present, density ${density.toFixed(2)}% (ideal range)`;
3618
- } else if (density < 0.5) {
3619
- pts += 7;
3620
- detail = `Primary keyword present but density only ${density.toFixed(2)}% - aim for 0.5-2.5%`;
3621
- } else if (viaTokens && density <= 6) {
3622
- pts += 11;
3623
- detail = `Primary keyword strongly represented (${density.toFixed(2)}%)`;
3624
- } else {
3625
- pts += 4;
3626
- detail = `Primary keyword over-used at ${density.toFixed(2)}% density - reduce to 0.5-2.5%`;
3627
- }
3628
- }
3629
- components.push({ label: "Primary keyword usage", points: pts, max: 25, detail });
3630
- } else {
3631
- components.push({ label: "Primary keyword usage", points: 0, max: 25, detail: "No primary keyword identified yet" });
3632
- }
3633
- const supportingKws = analysis.supportingKeywords || [];
3634
- if (supportingKws.length > 0) {
3635
- const inContentCount = supportingKws.filter((kw) => kw != null && typeof kw.term === "string" && lowerContent.includes(kw.term.toLowerCase())).length;
3636
- const coverageRatio = inContentCount / supportingKws.length;
3637
- const pts = Math.round(coverageRatio * 25);
3638
- components.push({
3639
- label: "Supporting keyword coverage",
3640
- points: pts,
3641
- max: 25,
3642
- detail: `${inContentCount} of ${supportingKws.length} supporting keywords present (${Math.round(coverageRatio * 100)}%)`
3643
- });
3644
- } else {
3645
- components.push({ label: "Supporting keyword coverage", points: 0, max: 25, detail: "No supporting keywords yet" });
3646
- }
3647
- let wcPts = 0;
3648
- let wcDetail;
3649
- if (words >= 1500) {
3650
- wcPts = 15;
3651
- wcDetail = `${words} words - strong length for clinical content`;
3652
- } else if (words >= 450) {
3653
- wcPts = 11;
3654
- wcDetail = `${words} words - above the 450 floor; 1,500+ is the clinical target`;
3655
- } else if (words >= 200) {
3656
- wcPts = 5;
3657
- wcDetail = `${words} words - below the 450-word floor`;
3658
- } else {
3659
- wcDetail = `${words} words - start writing`;
3660
- }
3661
- components.push({ label: "Word count", points: wcPts, max: 15, detail: wcDetail });
3662
- let hasH1orTitle;
3663
- let hasSubheadings;
3664
- if (documentFields) {
3665
- hasH1orTitle = !!(documentFields.title && documentFields.title.trim());
3666
- const det = documentFields.headingsDetailed;
3667
- const detHasSub = Array.isArray(det) && det.some((h) => h.level >= 2);
3668
- hasSubheadings = detHasSub || (documentFields.headings?.length || 0) > 0;
3669
- } else {
3670
- hasH1orTitle = /^#\s|<h1/im.test(content);
3671
- hasSubheadings = /^##\s|^###\s|<h2|<h3/im.test(content);
3672
- }
3673
- const structurePts = (hasH1orTitle ? 5 : 0) + (hasSubheadings ? 5 : 0);
3674
- const structureDetail = !hasH1orTitle && !hasSubheadings ? "No title or subheadings detected" : !hasSubheadings ? "Has a title but no H2/H3 subheadings - add section headings" : !hasH1orTitle ? "Has subheadings but no title" : "Title and subheadings present";
3675
- components.push({ label: "Heading structure", points: structurePts, max: 10, detail: structureDetail });
3676
- const missingCount = (analysis.missingKeywords || []).length;
3677
- let mPts = 0;
3678
- let mDetail;
3679
- if (missingCount === 0) {
3680
- mPts = 15;
3681
- mDetail = "No missing keywords flagged";
3682
- } else if (missingCount <= 2) {
3683
- mPts = 10;
3684
- mDetail = `${missingCount} suggested keywords missing - quick add`;
3685
- } else if (missingCount <= 4) {
3686
- mPts = 5;
3687
- mDetail = `${missingCount} suggested keywords missing`;
3688
- } else {
3689
- mDetail = `${missingCount} suggested keywords missing - significant gaps`;
3690
- }
3691
- components.push({ label: "Missing keyword gap", points: mPts, max: 15, detail: mDetail });
3692
- let qCount;
3693
- if (documentFields) {
3694
- qCount = (documentFields.headings || []).filter((h) => h.trim().endsWith("?")).length;
3695
- } else {
3696
- qCount = (content.match(/^#{1,6}\s+.*\?$/gm) || []).length + (content.match(/<h[1-6][^>]*>.*\?<\/h[1-6]>/gi) || []).length;
3697
- }
3698
- let aeoPts = 0;
3699
- if (qCount >= 3) aeoPts = 10;
3700
- else if (qCount === 2) aeoPts = 7;
3701
- else if (qCount === 1) aeoPts = 4;
3702
- const aeoDetail = qCount === 0 ? "No question-style headings - AI answer engines favor them" : `${qCount} question heading${qCount === 1 ? "" : "s"}`;
3703
- components.push({ label: "AEO signals", points: aeoPts, max: 10, detail: aeoDetail });
3704
- const total = components.reduce((sum, c) => sum + c.points, 0);
3705
- return { total: Math.min(100, Math.max(0, total)), components };
3706
- }
3707
-
3708
3685
  // src/lib/utils.ts
3709
3686
  function containsKeywordTokens(haystack, needle) {
3710
3687
  if (!needle) return true;
@@ -4060,7 +4037,7 @@ function buildSummaryItems(input) {
4060
4037
  category: "images",
4061
4038
  severity: "warning",
4062
4039
  label: `${missingTitles} image${missingTitles === 1 ? "" : "s"} missing a title`,
4063
- description: "The title attribute shows on hover and sends an SEO signal.",
4040
+ description: "The title attribute shows on hover and helps readers.",
4064
4041
  howToFix: "Add a descriptive title attribute (2-5 keywords) to each image that's missing one.",
4065
4042
  jumpTo: { tab: "technical", anchorId: "anchor-image-titles" }
4066
4043
  });
@@ -4222,9 +4199,9 @@ function buildSummaryItems(input) {
4222
4199
  id: `deep-gap-${i}`,
4223
4200
  category: "content",
4224
4201
  severity: "opportunity",
4225
- label: "Competitive gap",
4202
+ label: "Possible gap",
4226
4203
  description: note,
4227
- howToFix: "Add a section covering this topic so the article matches what competing pages offer.",
4204
+ howToFix: "Consider adding a section on this topic if it fits the article.",
4228
4205
  jumpTo: { tab: "summary" }
4229
4206
  });
4230
4207
  });
@@ -4249,8 +4226,77 @@ function buildSummaryItems(input) {
4249
4226
  return items;
4250
4227
  }
4251
4228
 
4229
+ // src/components/tabs/MissingKeywordsDetail.tsx
4230
+ import { useState as useState13 } from "react";
4231
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
4232
+ function MissingKeywordsDetail({ detail, keywords, onKeywordClick }) {
4233
+ const [open, setOpen] = useState13(false);
4234
+ if (keywords.length === 0) {
4235
+ return /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: detail });
4236
+ }
4237
+ return /* @__PURE__ */ jsxs10("div", { children: [
4238
+ /* @__PURE__ */ jsxs10(
4239
+ "button",
4240
+ {
4241
+ type: "button",
4242
+ onClick: () => setOpen((o) => !o),
4243
+ "aria-expanded": open,
4244
+ style: {
4245
+ display: "flex",
4246
+ alignItems: "baseline",
4247
+ gap: 5,
4248
+ padding: 0,
4249
+ margin: 0,
4250
+ background: "none",
4251
+ border: "none",
4252
+ cursor: "pointer",
4253
+ textAlign: "left",
4254
+ fontSize: 10.5,
4255
+ color: "#4b5563",
4256
+ lineHeight: 1.4,
4257
+ fontFamily: "inherit"
4258
+ },
4259
+ children: [
4260
+ /* @__PURE__ */ jsx11("span", { "aria-hidden": "true", style: { fontSize: 9, width: 8, flexShrink: 0, color: "#1f2937" }, children: open ? "\u25BE" : "\u25B8" }),
4261
+ /* @__PURE__ */ jsx11("span", { children: detail })
4262
+ ]
4263
+ }
4264
+ ),
4265
+ open && /* @__PURE__ */ jsx11("ul", { style: { listStyle: "none", margin: "4px 0 0 13px", padding: 0, display: "flex", flexDirection: "column", gap: 1 }, children: keywords.map((kw) => /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsxs10(
4266
+ "button",
4267
+ {
4268
+ type: "button",
4269
+ onClick: () => onKeywordClick(kw.term),
4270
+ title: "Show on the Keywords tab",
4271
+ style: {
4272
+ display: "flex",
4273
+ alignItems: "baseline",
4274
+ justifyContent: "space-between",
4275
+ gap: 8,
4276
+ width: "100%",
4277
+ padding: "3px 0",
4278
+ margin: 0,
4279
+ background: "none",
4280
+ border: "none",
4281
+ cursor: "pointer",
4282
+ textAlign: "left",
4283
+ fontSize: 11,
4284
+ fontFamily: "inherit"
4285
+ },
4286
+ children: [
4287
+ /* @__PURE__ */ jsx11("span", { style: { color: MJH_BLUE, fontWeight: 500 }, children: kw.term }),
4288
+ kw.volume != null && kw.volume > 0 && /* @__PURE__ */ jsxs10("span", { style: { fontSize: 10.5, fontWeight: 600, color: "#1f2937", flexShrink: 0 }, children: [
4289
+ abbrevVol(kw.volume),
4290
+ "/mo"
4291
+ ] })
4292
+ ]
4293
+ }
4294
+ ) }, kw.term)) })
4295
+ ] });
4296
+ }
4297
+
4252
4298
  // src/components/tabs/SummaryTab.tsx
4253
- import { Fragment as Fragment6, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
4299
+ import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4254
4300
  var cardStyle2 = {
4255
4301
  borderRadius: 14,
4256
4302
  background: "rgba(255,255,255,0.55)",
@@ -4277,11 +4323,11 @@ function componentTier(pct) {
4277
4323
  if (pct >= 40) return { label: "OK", color: "#8B7310", bar: "#E6C01B" };
4278
4324
  return { label: "Low", color: "#dc2626", bar: "#dc2626" };
4279
4325
  }
4280
- function ScoreBadge({ score, breakdown }) {
4326
+ function ScoreBadge({ score, breakdown, onKeywordClick }) {
4281
4327
  const c = scoreColors(score);
4282
- return /* @__PURE__ */ jsxs10("div", { style: cardStyle2, children: [
4283
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
4284
- /* @__PURE__ */ jsx11(
4328
+ return /* @__PURE__ */ jsxs11("div", { style: cardStyle2, children: [
4329
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
4330
+ /* @__PURE__ */ jsx12(
4285
4331
  "div",
4286
4332
  {
4287
4333
  style: {
@@ -4294,24 +4340,24 @@ function ScoreBadge({ score, breakdown }) {
4294
4340
  justifyContent: "center",
4295
4341
  flexShrink: 0
4296
4342
  },
4297
- children: /* @__PURE__ */ jsx11("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
4343
+ children: /* @__PURE__ */ jsx12("div", { style: { width: 22, height: 22, borderRadius: "50%", background: c.text, opacity: 0.9 } })
4298
4344
  }
4299
4345
  ),
4300
- /* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
4301
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
4302
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
4346
+ /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4347
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, marginBottom: 2 }, children: "Content Score" }),
4348
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 16, fontWeight: 700, color: c.text }, children: c.label })
4303
4349
  ] })
4304
4350
  ] }),
4305
- breakdown.length > 0 && /* @__PURE__ */ jsx11("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
4351
+ breakdown.length > 0 && /* @__PURE__ */ jsx12("div", { style: { marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }, children: breakdown.map((comp, i) => {
4306
4352
  const pct = comp.max > 0 ? comp.points / comp.max * 100 : 0;
4307
4353
  const tier = componentTier(pct);
4308
- return /* @__PURE__ */ jsxs10("div", { children: [
4309
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
4310
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
4311
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
4354
+ return /* @__PURE__ */ jsxs11("div", { children: [
4355
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 3 }, children: [
4356
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, fontWeight: 600, color: "#1f2937" }, children: comp.label }),
4357
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 9.5, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.04em", color: tier.color }, children: tier.label })
4312
4358
  ] }),
4313
- /* @__PURE__ */ jsx11("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ jsx11("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
4314
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
4359
+ /* @__PURE__ */ jsx12("div", { style: { height: 4, background: "#f1f5f9", borderRadius: 99, overflow: "hidden", marginBottom: 4 }, children: /* @__PURE__ */ jsx12("div", { style: { width: `${pct}%`, height: "100%", background: tier.bar, transition: "width 200ms" } }) }),
4360
+ comp.missingKeywords ? /* @__PURE__ */ jsx12(MissingKeywordsDetail, { detail: comp.detail, keywords: comp.missingKeywords, onKeywordClick }) : /* @__PURE__ */ jsx12("div", { style: { fontSize: 10.5, color: "#4b5563", lineHeight: 1.4 }, children: comp.detail })
4315
4361
  ] }, i);
4316
4362
  }) })
4317
4363
  ] });
@@ -4325,7 +4371,7 @@ function ItemCard({ item, onClick }) {
4325
4371
  const v = severityVisual(item.severity);
4326
4372
  const tab = item.jumpTo.tab;
4327
4373
  const tabLabel = TAB_LABEL[tab] ?? tab.charAt(0).toUpperCase() + tab.slice(1);
4328
- return /* @__PURE__ */ jsxs10(
4374
+ return /* @__PURE__ */ jsxs11(
4329
4375
  "div",
4330
4376
  {
4331
4377
  onClick,
@@ -4342,8 +4388,8 @@ function ItemCard({ item, onClick }) {
4342
4388
  cursor: "pointer"
4343
4389
  },
4344
4390
  children: [
4345
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4346
- /* @__PURE__ */ jsx11(
4391
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", gap: 9 }, children: [
4392
+ /* @__PURE__ */ jsx12(
4347
4393
  "div",
4348
4394
  {
4349
4395
  style: {
@@ -4356,12 +4402,12 @@ function ItemCard({ item, onClick }) {
4356
4402
  }
4357
4403
  }
4358
4404
  ),
4359
- /* @__PURE__ */ jsxs10("div", { style: { flex: 1, minWidth: 0 }, children: [
4360
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4361
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4405
+ /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4406
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", marginBottom: 2 }, children: item.label }),
4407
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#374151", lineHeight: 1.5 }, children: item.description })
4362
4408
  ] })
4363
4409
  ] }),
4364
- /* @__PURE__ */ jsxs10(
4410
+ /* @__PURE__ */ jsxs11(
4365
4411
  "div",
4366
4412
  {
4367
4413
  style: {
@@ -4373,12 +4419,12 @@ function ItemCard({ item, onClick }) {
4373
4419
  lineHeight: 1.55
4374
4420
  },
4375
4421
  children: [
4376
- /* @__PURE__ */ jsx11("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4422
+ /* @__PURE__ */ jsx12("span", { style: { fontWeight: 700, color: "#4b5563", letterSpacing: "0.04em", fontSize: 9.5, textTransform: "uppercase", marginRight: 6 }, children: "Fix" }),
4377
4423
  item.howToFix
4378
4424
  ]
4379
4425
  }
4380
4426
  ),
4381
- item.jumpTo.tab !== "summary" && /* @__PURE__ */ jsx11("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs10("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4427
+ item.jumpTo.tab !== "summary" && /* @__PURE__ */ jsx12("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ jsxs11("span", { style: { fontSize: 10, fontWeight: 700, color: MJH_BLUE }, children: [
4382
4428
  "Go to ",
4383
4429
  tabLabel,
4384
4430
  " \u203A"
@@ -4394,7 +4440,7 @@ function FilterChip({
4394
4440
  count,
4395
4441
  dotColor
4396
4442
  }) {
4397
- return /* @__PURE__ */ jsxs10(
4443
+ return /* @__PURE__ */ jsxs11(
4398
4444
  "button",
4399
4445
  {
4400
4446
  onClick,
@@ -4413,9 +4459,9 @@ function FilterChip({
4413
4459
  transition: "all 150ms"
4414
4460
  },
4415
4461
  children: [
4416
- dotColor && /* @__PURE__ */ jsx11("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4417
- /* @__PURE__ */ jsx11("span", { children: label }),
4418
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4462
+ dotColor && /* @__PURE__ */ jsx12("span", { style: { width: 6, height: 6, borderRadius: "50%", background: dotColor, display: "inline-block" } }),
4463
+ /* @__PURE__ */ jsx12("span", { children: label }),
4464
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, opacity: 0.8 }, children: count })
4419
4465
  ]
4420
4466
  }
4421
4467
  );
@@ -4431,7 +4477,8 @@ function SummaryTab({
4431
4477
  secondaryKeyword,
4432
4478
  isAnyLoading,
4433
4479
  onGenerateAll,
4434
- onItemClick
4480
+ onItemClick,
4481
+ onKeywordClick
4435
4482
  }) {
4436
4483
  const scoreDetail = useMemo(() => {
4437
4484
  if (!analysis) return null;
@@ -4453,7 +4500,7 @@ function SummaryTab({
4453
4500
  }),
4454
4501
  [analysis, deepAnalysis, documentFields, score, linkingSuggestions, linkCheckResults, text, primaryKeyword, secondaryKeyword]
4455
4502
  );
4456
- const [filter, setFilter] = useState13("all");
4503
+ const [filter, setFilter] = useState14("all");
4457
4504
  const counts = useMemo(
4458
4505
  () => ({
4459
4506
  all: items.length,
@@ -4465,15 +4512,15 @@ function SummaryTab({
4465
4512
  );
4466
4513
  const filtered = filter === "all" ? items : items.filter((i) => i.severity === filter);
4467
4514
  if (!analysis) {
4468
- return /* @__PURE__ */ jsxs10("div", { style: { padding: 24, textAlign: "center" }, children: [
4469
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4470
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4515
+ return /* @__PURE__ */ jsxs11("div", { style: { padding: 24, textAlign: "center" }, children: [
4516
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Start with the Keywords tab" }),
4517
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Once keywords are analyzed, the summary appears here." })
4471
4518
  ] });
4472
4519
  }
4473
- return /* @__PURE__ */ jsxs10("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4474
- score != null && scoreDetail && /* @__PURE__ */ jsx11(ScoreBadge, { score, breakdown: scoreDetail.components }),
4475
- /* @__PURE__ */ jsxs10("div", { style: cardStyle2, children: [
4476
- isAnyLoading ? /* @__PURE__ */ jsx11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ jsx11(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ jsx11(
4520
+ return /* @__PURE__ */ jsxs11("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4521
+ score != null && scoreDetail && /* @__PURE__ */ jsx12(ScoreBadge, { score, breakdown: scoreDetail.components, onKeywordClick }),
4522
+ /* @__PURE__ */ jsxs11("div", { style: cardStyle2, children: [
4523
+ isAnyLoading ? /* @__PURE__ */ jsx12("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 0" }, children: /* @__PURE__ */ jsx12(ShimmerLoader, { messages: DEFAULT_GENERATE_ALL_MESSAGES }) }) : /* @__PURE__ */ jsx12(
4477
4524
  "button",
4478
4525
  {
4479
4526
  onClick: onGenerateAll,
@@ -4501,24 +4548,24 @@ function SummaryTab({
4501
4548
  children: "Run all analyses"
4502
4549
  }
4503
4550
  ),
4504
- /* @__PURE__ */ jsxs10("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4551
+ /* @__PURE__ */ jsxs11("div", { style: { fontSize: 10.5, color: "#4b5563", marginTop: 8, lineHeight: 1.5 }, children: [
4505
4552
  "Runs the analyses that fill the ",
4506
- /* @__PURE__ */ jsx11("strong", { children: "AEO/GEO" }),
4553
+ /* @__PURE__ */ jsx12("strong", { children: "AEO/GEO" }),
4507
4554
  ", ",
4508
- /* @__PURE__ */ jsx11("strong", { children: "Linking" }),
4555
+ /* @__PURE__ */ jsx12("strong", { children: "Linking" }),
4509
4556
  ", and ",
4510
- /* @__PURE__ */ jsx11("strong", { children: "Other Recs" }),
4557
+ /* @__PURE__ */ jsx12("strong", { children: "Other Recs" }),
4511
4558
  " tabs. New issues they find appear in this Summary as each one finishes."
4512
4559
  ] })
4513
4560
  ] }),
4514
- /* @__PURE__ */ jsxs10("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4515
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4516
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4517
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4518
- /* @__PURE__ */ jsx11(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4561
+ /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexWrap: "wrap", gap: 6 }, children: [
4562
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "all", onClick: () => setFilter("all"), label: "All", count: counts.all }),
4563
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "error", onClick: () => setFilter("error"), label: "Errors", count: counts.error, dotColor: "#dc2626" }),
4564
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "warning", onClick: () => setFilter("warning"), label: "Warnings", count: counts.warning, dotColor: "#E6C01B" }),
4565
+ /* @__PURE__ */ jsx12(FilterChip, { active: filter === "opportunity", onClick: () => setFilter("opportunity"), label: "Opportunities", count: counts.opportunity, dotColor: MJH_BLUE })
4519
4566
  ] }),
4520
- /* @__PURE__ */ jsx11("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ jsx11("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ jsxs10(Fragment6, { children: [
4521
- /* @__PURE__ */ jsx11(
4567
+ /* @__PURE__ */ jsx12("div", { id: "anchor-summary-issues", style: { display: "flex", flexDirection: "column", gap: 8 }, children: filtered.length === 0 ? /* @__PURE__ */ jsx12("div", { style: { ...cardStyle2, textAlign: "center", padding: "20px 14px" }, children: items.length === 0 ? /* @__PURE__ */ jsxs11(Fragment6, { children: [
4568
+ /* @__PURE__ */ jsx12(
4522
4569
  "div",
4523
4570
  {
4524
4571
  style: {
@@ -4531,21 +4578,21 @@ function SummaryTab({
4531
4578
  justifyContent: "center",
4532
4579
  margin: "0 auto 8px"
4533
4580
  },
4534
- children: /* @__PURE__ */ jsx11("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ jsx11("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) })
4581
+ children: /* @__PURE__ */ jsx12("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "#16a34a", children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) })
4535
4582
  }
4536
4583
  ),
4537
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4538
- /* @__PURE__ */ jsx11("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4539
- ] }) : /* @__PURE__ */ jsx11("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ jsx11(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4540
- isAnyLoading && items.length > 0 && /* @__PURE__ */ jsxs10("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4541
- /* @__PURE__ */ jsx11(LoadingBars, { size: "xs", color: MJH_BLUE }),
4542
- /* @__PURE__ */ jsx11("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4584
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 13, color: "#16a34a", fontWeight: 700 }, children: "Looking good" }),
4585
+ /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 2 }, children: "No issues found for this article." })
4586
+ ] }) : /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, color: "#4b5563" }, children: "Nothing in this category." }) }) : filtered.map((item) => /* @__PURE__ */ jsx12(ItemCard, { item, onClick: () => onItemClick(item) }, item.id)) }),
4587
+ isAnyLoading && items.length > 0 && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 6, padding: "4px 0" }, children: [
4588
+ /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: MJH_BLUE }),
4589
+ /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, color: "#4b5563" }, children: "Still checking..." })
4543
4590
  ] })
4544
4591
  ] });
4545
4592
  }
4546
4593
 
4547
4594
  // src/components/tabs/AEOTab.tsx
4548
- import { useEffect as useEffect11, useMemo as useMemo2, useRef as useRef11, useState as useState14 } from "react";
4595
+ import { useEffect as useEffect11, useMemo as useMemo2, useRef as useRef11, useState as useState15 } from "react";
4549
4596
 
4550
4597
  // src/lib/geoAnalysis.ts
4551
4598
  var FACT_PATTERN = /\d+(?:\.\d+)?\s*%|\b\d{1,3}(?:,\d{3})+\b|\bn\s*=\s*\d+\b|\bp\s*[<=]\s*0?\.\d+\b|\b\d+(?:\.\d+)?\s*(?:patients|participants|subjects|cases|deaths|adverse events|mg|mcg|hours|days|weeks|months|years|fold|x)\b|\b(?:NEJM|JAMA|FDA|EMA|CDC|WHO|NIH|ACC|ASCO|ASH|ESMO|AHA|ACS)\b|\bet al\.?\b|\b(?:phase|stage)\s+(?:I{1,3}V?|1|2|3|4)\b/i;
@@ -4619,7 +4666,7 @@ function analyzeGEO(text, headings) {
4619
4666
  }
4620
4667
 
4621
4668
  // src/components/tabs/AEOTab.tsx
4622
- import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
4669
+ import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
4623
4670
  var AEO_PURPLE = "#005DAC";
4624
4671
  var GEO_TEAL = "#C9A716";
4625
4672
  var cardStyle3 = {
@@ -4631,7 +4678,7 @@ var cardStyle3 = {
4631
4678
  padding: "14px"
4632
4679
  };
4633
4680
  function AiPill() {
4634
- return /* @__PURE__ */ jsx12(
4681
+ return /* @__PURE__ */ jsx13(
4635
4682
  "span",
4636
4683
  {
4637
4684
  style: {
@@ -4650,14 +4697,14 @@ function AiPill() {
4650
4697
  );
4651
4698
  }
4652
4699
  function SectionHeader2({ label, iconColor, ai }) {
4653
- return /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4654
- /* @__PURE__ */ jsx12("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4655
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4656
- ai && /* @__PURE__ */ jsx12(AiPill, {})
4700
+ return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 4 }, children: [
4701
+ /* @__PURE__ */ jsx13("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
4702
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
4703
+ ai && /* @__PURE__ */ jsx13(AiPill, {})
4657
4704
  ] });
4658
4705
  }
4659
4706
  function CopyButton({ text }) {
4660
- const [copied, setCopied] = useState14(false);
4707
+ const [copied, setCopied] = useState15(false);
4661
4708
  const copyTimerRef = useRef11(null);
4662
4709
  useEffect11(() => {
4663
4710
  return () => {
@@ -4672,7 +4719,7 @@ function CopyButton({ text }) {
4672
4719
  } catch {
4673
4720
  }
4674
4721
  };
4675
- return /* @__PURE__ */ jsx12(
4722
+ return /* @__PURE__ */ jsx13(
4676
4723
  "button",
4677
4724
  {
4678
4725
  onClick: handleCopy,
@@ -4691,9 +4738,9 @@ function CopyButton({ text }) {
4691
4738
  transition: "color 150ms"
4692
4739
  },
4693
4740
  title: copied ? "Copied!" : "Copy to clipboard",
4694
- children: copied ? /* @__PURE__ */ jsx12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }) : /* @__PURE__ */ jsxs11("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4695
- /* @__PURE__ */ jsx12("path", { d: "M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" }),
4696
- /* @__PURE__ */ jsx12("path", { d: "M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" })
4741
+ children: copied ? /* @__PURE__ */ jsx13("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx13("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }) : /* @__PURE__ */ jsxs12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", children: [
4742
+ /* @__PURE__ */ jsx13("path", { d: "M7 3.5A1.5 1.5 0 018.5 2h3.879a1.5 1.5 0 011.06.44l3.122 3.12A1.5 1.5 0 0117 6.622V12.5a1.5 1.5 0 01-1.5 1.5h-1v-3.379a3 3 0 00-.879-2.121L10.5 5.379A3 3 0 008.379 4.5H7v-1z" }),
4743
+ /* @__PURE__ */ jsx13("path", { d: "M4.5 6A1.5 1.5 0 003 7.5v9A1.5 1.5 0 004.5 18h7a1.5 1.5 0 001.5-1.5v-5.879a1.5 1.5 0 00-.44-1.06L9.44 6.439A1.5 1.5 0 008.378 6H4.5z" })
4697
4744
  ] })
4698
4745
  }
4699
4746
  );
@@ -4708,13 +4755,13 @@ function GEOCard({ geo, publication }) {
4708
4755
  const fdBg = effectiveStatus === "strong" ? "rgba(22,163,74,0.1)" : effectiveStatus === "moderate" ? "rgba(230,192,27,0.15)" : "rgba(220,38,38,0.08)";
4709
4756
  const goodCount = geo.headingAudit.filter((h) => h.status === "good").length;
4710
4757
  const totalHeadings = geo.headingAudit.length;
4711
- return /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4712
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4713
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4714
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4758
+ return /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
4759
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 4 }, children: [
4760
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "AI Citation Readiness", iconColor: GEO_TEAL }),
4761
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "geo_summary", suggestionText: `facts/1k: ${fd.factsPerThousandWords}; short-answer headings: ${goodCount}/${totalHeadings}`, publication })
4715
4762
  ] }),
4716
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }, children: "How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite." }),
4717
- /* @__PURE__ */ jsxs11(
4763
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10, lineHeight: 1.5 }, children: "How easy this article is for ChatGPT, Perplexity, Gemini, and Google's AI Overviews to cite." }),
4764
+ /* @__PURE__ */ jsxs12(
4718
4765
  "div",
4719
4766
  {
4720
4767
  style: {
@@ -4727,7 +4774,7 @@ function GEOCard({ geo, publication }) {
4727
4774
  marginBottom: 8
4728
4775
  },
4729
4776
  children: [
4730
- /* @__PURE__ */ jsxs11(
4777
+ /* @__PURE__ */ jsxs12(
4731
4778
  "div",
4732
4779
  {
4733
4780
  style: {
@@ -4743,17 +4790,17 @@ function GEOCard({ geo, publication }) {
4743
4790
  boxShadow: "0 1px 2px rgba(0,0,0,0.06)"
4744
4791
  },
4745
4792
  children: [
4746
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4747
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4793
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 18, fontWeight: 700, color: fdColor, lineHeight: 1 }, children: fd.factsPerThousandWords }),
4794
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 7.5, fontWeight: 700, color: fdColor, opacity: 0.75, letterSpacing: "0.05em", marginTop: 2 }, children: "PER 1K" })
4748
4795
  ]
4749
4796
  }
4750
4797
  ),
4751
- /* @__PURE__ */ jsxs11("div", { style: { flex: 1, minWidth: 0 }, children: [
4752
- /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4798
+ /* @__PURE__ */ jsxs12("div", { style: { flex: 1, minWidth: 0 }, children: [
4799
+ /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, fontWeight: 700, color: fdColor, marginBottom: 2 }, children: [
4753
4800
  "Fact density: ",
4754
4801
  fdLabel
4755
4802
  ] }),
4756
- /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4803
+ /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.45 }, children: [
4757
4804
  fd.factCount,
4758
4805
  " specific stat",
4759
4806
  fd.factCount === 1 ? "" : "s",
@@ -4769,7 +4816,7 @@ function GEOCard({ geo, publication }) {
4769
4816
  ]
4770
4817
  }
4771
4818
  ),
4772
- fd.driftPassages > 0 && /* @__PURE__ */ jsxs11(
4819
+ fd.driftPassages > 0 && /* @__PURE__ */ jsxs12(
4773
4820
  "div",
4774
4821
  {
4775
4822
  style: {
@@ -4783,15 +4830,15 @@ function GEOCard({ geo, publication }) {
4783
4830
  lineHeight: 1.45
4784
4831
  },
4785
4832
  children: [
4786
- /* @__PURE__ */ jsx12("strong", { children: fd.driftPassages }),
4833
+ /* @__PURE__ */ jsx13("strong", { children: fd.driftPassages }),
4787
4834
  " passage",
4788
4835
  fd.driftPassages === 1 ? "" : "s",
4789
4836
  " over 200 words with no specific stats or citations. AI engines tend to skip these."
4790
4837
  ]
4791
4838
  }
4792
4839
  ),
4793
- totalHeadings > 0 && /* @__PURE__ */ jsxs11("div", { style: { marginTop: 4 }, children: [
4794
- /* @__PURE__ */ jsxs11(
4840
+ totalHeadings > 0 && /* @__PURE__ */ jsxs12("div", { style: { marginTop: 4 }, children: [
4841
+ /* @__PURE__ */ jsxs12(
4795
4842
  "button",
4796
4843
  {
4797
4844
  onClick: () => setShowDetails((v) => !v),
@@ -4810,22 +4857,22 @@ function GEOCard({ geo, publication }) {
4810
4857
  color: GEO_TEAL
4811
4858
  },
4812
4859
  children: [
4813
- /* @__PURE__ */ jsxs11("span", { children: [
4860
+ /* @__PURE__ */ jsxs12("span", { children: [
4814
4861
  "Short-answer paragraphs: ",
4815
4862
  goodCount,
4816
4863
  "/",
4817
4864
  totalHeadings,
4818
4865
  " headings have one"
4819
4866
  ] }),
4820
- /* @__PURE__ */ jsx12("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx12("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
4867
+ /* @__PURE__ */ jsx13("svg", { width: "11", height: "11", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: showDetails ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx13("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
4821
4868
  ]
4822
4869
  }
4823
4870
  ),
4824
- showDetails && /* @__PURE__ */ jsxs11("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4825
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 4 }, children: "Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract." }),
4871
+ showDetails && /* @__PURE__ */ jsxs12("div", { style: { marginTop: 6, display: "flex", flexDirection: "column", gap: 4 }, children: [
4872
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 4 }, children: "Aim for a 40-60 word answer right after each heading. That's the chunk AI engines extract." }),
4826
4873
  geo.headingAudit.map((h, i) => {
4827
4874
  const c = h.status === "good" ? { bg: "rgba(22,163,74,0.08)", color: "#16a34a", label: `${h.words} words \u2713` } : h.status === "too-short" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - too short` } : h.status === "too-long" ? { bg: "rgba(230,192,27,0.12)", color: "#8B7310", label: `${h.words} words - condense to 40-60` } : { bg: "rgba(220,38,38,0.06)", color: "#dc2626", label: "no body content" };
4828
- return /* @__PURE__ */ jsxs11(
4875
+ return /* @__PURE__ */ jsxs12(
4829
4876
  "div",
4830
4877
  {
4831
4878
  style: {
@@ -4839,8 +4886,8 @@ function GEOCard({ geo, publication }) {
4839
4886
  gap: 8
4840
4887
  },
4841
4888
  children: [
4842
- /* @__PURE__ */ jsx12("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4843
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4889
+ /* @__PURE__ */ jsx13("span", { style: { flex: 1, minWidth: 0, color: "#1f2937", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: h.heading }),
4890
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 10, fontWeight: 600, color: c.color, flexShrink: 0 }, children: c.label })
4844
4891
  ]
4845
4892
  },
4846
4893
  i
@@ -4877,8 +4924,8 @@ function AEOTab({
4877
4924
  originalHeading: void 0,
4878
4925
  rationale: h.rationale
4879
4926
  })) ?? [];
4880
- return /* @__PURE__ */ jsxs11("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4881
- aeoContentChanged && /* @__PURE__ */ jsxs11(
4927
+ return /* @__PURE__ */ jsxs12("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: [
4928
+ aeoContentChanged && /* @__PURE__ */ jsxs12(
4882
4929
  "div",
4883
4930
  {
4884
4931
  onClick: runDeepAnalysis,
@@ -4901,30 +4948,30 @@ function AEOTab({
4901
4948
  cursor: "pointer"
4902
4949
  },
4903
4950
  children: [
4904
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4905
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4951
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, color: "#92400e" }, children: "Content has changed since this was generated." }),
4952
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, fontWeight: 600, color: AEO_PURPLE, textDecoration: "underline" }, children: "Update" })
4906
4953
  ]
4907
4954
  }
4908
4955
  ),
4909
- hasEnoughTextForGEO && /* @__PURE__ */ jsx12(GEOCard, { geo, publication }),
4910
- hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ jsx12("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsxs11("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4911
- /* @__PURE__ */ jsx12("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4956
+ hasEnoughTextForGEO && /* @__PURE__ */ jsx13(GEOCard, { geo, publication }),
4957
+ hasEnoughText && !hasEnoughTextForGEO && /* @__PURE__ */ jsx13("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsxs12("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: [
4958
+ /* @__PURE__ */ jsx13("strong", { style: { color: "#C9A716" }, children: "AI citation analysis" }),
4912
4959
  " needs at least 150 words to read fact density.",
4913
- /* @__PURE__ */ jsx12("br", {}),
4914
- /* @__PURE__ */ jsxs11("span", { style: { color: "#4b5563" }, children: [
4960
+ /* @__PURE__ */ jsx13("br", {}),
4961
+ /* @__PURE__ */ jsxs12("span", { style: { color: "#4b5563" }, children: [
4915
4962
  "Current: ",
4916
4963
  geoWordCount,
4917
4964
  " word",
4918
4965
  geoWordCount === 1 ? "" : "s"
4919
4966
  ] })
4920
4967
  ] }) }),
4921
- !deepAnalysis && isDeepLoading && /* @__PURE__ */ jsxs11("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4922
- /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4923
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4968
+ !deepAnalysis && isDeepLoading && /* @__PURE__ */ jsxs12("div", { style: { ...cardStyle3, display: "flex", alignItems: "center", justifyContent: "center", gap: 8 }, children: [
4969
+ /* @__PURE__ */ jsx13(LoadingBars, { size: "xs", color: AEO_PURPLE }),
4970
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Generating AEO insights..." })
4924
4971
  ] }),
4925
- !deepAnalysis && !isDeepLoading && /* @__PURE__ */ jsxs11("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4926
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4927
- /* @__PURE__ */ jsx12(
4972
+ !deepAnalysis && !isDeepLoading && /* @__PURE__ */ jsxs12("div", { style: { ...cardStyle3, textAlign: "center" }, children: [
4973
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 12, color: "#4b5563" }, children: "AI citation readiness and question-style heading suggestions appear here once analysis runs." }),
4974
+ /* @__PURE__ */ jsx13(
4928
4975
  "button",
4929
4976
  {
4930
4977
  onClick: runDeepAnalysis,
@@ -4944,11 +4991,11 @@ function AEOTab({
4944
4991
  }
4945
4992
  )
4946
4993
  ] }),
4947
- deepAnalysis && !aeo && /* @__PURE__ */ jsx12("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4948
- questionHeadings.length > 0 && /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4949
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4950
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4951
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ jsxs11(
4994
+ deepAnalysis && !aeo && /* @__PURE__ */ jsx13("div", { style: { ...cardStyle3, textAlign: "center" }, children: /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#4b5563" }, children: "No insights came back. Try again - the analysis may have timed out." }) }),
4995
+ questionHeadings.length > 0 && /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
4996
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "Question-Style Headings", iconColor: AEO_PURPLE }),
4997
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 8 }, children: "Rewrites of your existing headings as questions. Google often pulls these into featured snippets." }),
4998
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: questionHeadings.map((h, i) => /* @__PURE__ */ jsxs12(
4952
4999
  "div",
4953
5000
  {
4954
5001
  style: {
@@ -4958,26 +5005,26 @@ function AEOTab({
4958
5005
  borderLeft: `3px solid ${AEO_PURPLE}`
4959
5006
  },
4960
5007
  children: [
4961
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
4962
- /* @__PURE__ */ jsxs11("div", { style: { flex: 1 }, children: [
4963
- h.originalHeading && /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
4964
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
5008
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5009
+ /* @__PURE__ */ jsxs12("div", { style: { flex: 1 }, children: [
5010
+ h.originalHeading && /* @__PURE__ */ jsx13("div", { style: { fontSize: 11, color: "#4b5563", textDecoration: "line-through", marginBottom: 2 }, children: h.originalHeading }),
5011
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE, lineHeight: 1.5 }, children: h.heading })
4965
5012
  ] }),
4966
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
4967
- /* @__PURE__ */ jsx12(CopyButton, { text: h.heading }),
4968
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
5013
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5014
+ /* @__PURE__ */ jsx13(CopyButton, { text: h.heading }),
5015
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_heading", suggestionText: h.heading, publication })
4969
5016
  ] })
4970
5017
  ] }),
4971
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
5018
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 4, fontStyle: "italic" }, children: h.rationale })
4972
5019
  ]
4973
5020
  },
4974
5021
  i
4975
5022
  )) })
4976
5023
  ] }),
4977
- /* @__PURE__ */ jsxs11("div", { style: cardStyle3, children: [
4978
- /* @__PURE__ */ jsx12(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
4979
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10 }, children: "Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points." }),
4980
- !contentSuggestions && !isCSLoading && /* @__PURE__ */ jsx12(
5024
+ /* @__PURE__ */ jsxs12("div", { style: cardStyle3, children: [
5025
+ /* @__PURE__ */ jsx13(SectionHeader2, { label: "Content Block Suggestions", iconColor: AEO_PURPLE }),
5026
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 10 }, children: "Short, citable blocks to use inside or alongside the article - takeaways, infographic ideas, and bullet points." }),
5027
+ !contentSuggestions && !isCSLoading && /* @__PURE__ */ jsx13(
4981
5028
  "button",
4982
5029
  {
4983
5030
  onClick: loadContentSuggestions,
@@ -5001,15 +5048,15 @@ function AEOTab({
5001
5048
  children: "Generate suggestions"
5002
5049
  }
5003
5050
  ),
5004
- isCSLoading && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
5005
- /* @__PURE__ */ jsx12(LoadingBars, { size: "xs", color: AEO_PURPLE }),
5006
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
5051
+ isCSLoading && /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "8px 0" }, children: [
5052
+ /* @__PURE__ */ jsx13(LoadingBars, { size: "xs", color: AEO_PURPLE }),
5053
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Generating content suggestions..." })
5007
5054
  ] }),
5008
- csError && /* @__PURE__ */ jsx12("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
5009
- contentSuggestions && /* @__PURE__ */ jsxs11("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
5010
- contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5011
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
5012
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ jsxs11(
5055
+ csError && /* @__PURE__ */ jsx13("div", { style: { marginTop: 6, fontSize: 11, color: "#dc2626" }, children: csError }),
5056
+ contentSuggestions && /* @__PURE__ */ jsxs12("div", { style: { display: "flex", flexDirection: "column", gap: 14, marginTop: 8 }, children: [
5057
+ contentSuggestions.keyTakeaways.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5058
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Key Takeaways" }),
5059
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.keyTakeaways.map((kt, i) => /* @__PURE__ */ jsxs12(
5013
5060
  "div",
5014
5061
  {
5015
5062
  style: {
@@ -5022,19 +5069,19 @@ function AEOTab({
5022
5069
  alignItems: "flex-start"
5023
5070
  },
5024
5071
  children: [
5025
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
5026
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5027
- /* @__PURE__ */ jsx12(CopyButton, { text: kt }),
5028
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
5072
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, flex: 1 }, children: kt }),
5073
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5074
+ /* @__PURE__ */ jsx13(CopyButton, { text: kt }),
5075
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_takeaway", suggestionText: kt, publication })
5029
5076
  ] })
5030
5077
  ]
5031
5078
  },
5032
5079
  i
5033
5080
  )) })
5034
5081
  ] }),
5035
- contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5036
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
5037
- /* @__PURE__ */ jsx12("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ jsxs11(
5082
+ contentSuggestions.infographicOpportunities.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5083
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Infographic Ideas" }),
5084
+ /* @__PURE__ */ jsx13("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: contentSuggestions.infographicOpportunities.map((io, i) => /* @__PURE__ */ jsxs12(
5038
5085
  "div",
5039
5086
  {
5040
5087
  style: {
@@ -5044,23 +5091,23 @@ function AEOTab({
5044
5091
  borderLeft: `2px solid ${AEO_PURPLE}`
5045
5092
  },
5046
5093
  children: [
5047
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5048
- /* @__PURE__ */ jsx12("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
5049
- /* @__PURE__ */ jsx12(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
5094
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5095
+ /* @__PURE__ */ jsx13("span", { style: { fontSize: 12, fontWeight: 700, color: AEO_PURPLE }, children: io.concept }),
5096
+ /* @__PURE__ */ jsx13(FeedbackButton, { suggestionType: "aeo_infographic", suggestionText: io.concept, publication })
5050
5097
  ] }),
5051
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
5098
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.5, marginTop: 3 }, children: io.description })
5052
5099
  ]
5053
5100
  },
5054
5101
  i
5055
5102
  )) })
5056
5103
  ] }),
5057
- contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ jsxs11("div", { children: [
5058
- /* @__PURE__ */ jsx12("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
5059
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5060
- /* @__PURE__ */ jsx12("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ jsx12("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
5061
- /* @__PURE__ */ jsxs11("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5062
- /* @__PURE__ */ jsx12(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
5063
- /* @__PURE__ */ jsx12(
5104
+ contentSuggestions.bulletListItems.length > 0 && /* @__PURE__ */ jsxs12("div", { children: [
5105
+ /* @__PURE__ */ jsx13("div", { style: { fontSize: 10, fontWeight: 700, textTransform: "uppercase", letterSpacing: "0.06em", color: AEO_PURPLE, marginBottom: 6 }, children: "Bullets for Featured Snippets" }),
5106
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: 8 }, children: [
5107
+ /* @__PURE__ */ jsx13("ul", { style: { margin: 0, paddingLeft: 18, flex: 1 }, children: contentSuggestions.bulletListItems.map((b, i) => /* @__PURE__ */ jsx13("li", { style: { fontSize: 12, color: "#1f2937", lineHeight: 1.55, marginBottom: 4 }, children: b }, i)) }),
5108
+ /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
5109
+ /* @__PURE__ */ jsx13(CopyButton, { text: contentSuggestions.bulletListItems.map((b) => "- " + b).join("\n") }),
5110
+ /* @__PURE__ */ jsx13(
5064
5111
  FeedbackButton,
5065
5112
  {
5066
5113
  suggestionType: "aeo_bullets",
@@ -5071,7 +5118,7 @@ function AEOTab({
5071
5118
  ] })
5072
5119
  ] })
5073
5120
  ] }),
5074
- /* @__PURE__ */ jsx12(
5121
+ /* @__PURE__ */ jsx13(
5075
5122
  "button",
5076
5123
  {
5077
5124
  onClick: loadContentSuggestions,
@@ -5100,8 +5147,8 @@ function AEOTab({
5100
5147
  }
5101
5148
 
5102
5149
  // src/components/ScoreDonut.tsx
5103
- import { useState as useState15 } from "react";
5104
- import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
5150
+ import { useState as useState16 } from "react";
5151
+ import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
5105
5152
  var W = { topic: 0.6, freshness: 0.25, sectionFit: 0.15 };
5106
5153
  var COLORS = { topic: MJH_BLUE, freshness: MJH_GOLD, sectionFit: "#9B59B6" };
5107
5154
  var TRACK = "#eef2f7";
@@ -5113,7 +5160,7 @@ function ScoreDonut({
5113
5160
  sectionFit,
5114
5161
  composite
5115
5162
  }) {
5116
- const [hovered, setHovered] = useState15(false);
5163
+ const [hovered, setHovered] = useState16(false);
5117
5164
  const radius = (size - strokeWidth) / 2;
5118
5165
  const circumference = 2 * Math.PI * radius;
5119
5166
  const cTopic = topic * W.topic;
@@ -5126,7 +5173,7 @@ function ScoreDonut({
5126
5173
  const topicLen = seg(cTopic);
5127
5174
  const freshLen = seg(cFresh);
5128
5175
  const sectionLen = seg(cSection);
5129
- const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ jsx13(
5176
+ const Slice = ({ color, fullLen, offset }) => /* @__PURE__ */ jsx14(
5130
5177
  "circle",
5131
5178
  {
5132
5179
  cx: size / 2,
@@ -5140,20 +5187,20 @@ function ScoreDonut({
5140
5187
  strokeDashoffset: -offset
5141
5188
  }
5142
5189
  );
5143
- return /* @__PURE__ */ jsxs12(
5190
+ return /* @__PURE__ */ jsxs13(
5144
5191
  "div",
5145
5192
  {
5146
5193
  style: { position: "relative", width: size, height: size, flexShrink: 0 },
5147
5194
  onMouseEnter: () => setHovered(true),
5148
5195
  onMouseLeave: () => setHovered(false),
5149
5196
  children: [
5150
- /* @__PURE__ */ jsxs12("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
5151
- /* @__PURE__ */ jsx13("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
5152
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
5153
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
5154
- /* @__PURE__ */ jsx13(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
5197
+ /* @__PURE__ */ jsxs13("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, style: { transform: "rotate(-90deg)" }, children: [
5198
+ /* @__PURE__ */ jsx14("circle", { cx: size / 2, cy: size / 2, r: radius, fill: "none", stroke: TRACK, strokeWidth }),
5199
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.topic, fullLen: topicLen, offset: 0 }),
5200
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.freshness, fullLen: freshLen, offset: topicLen }),
5201
+ /* @__PURE__ */ jsx14(Slice, { color: COLORS.sectionFit, fullLen: sectionLen, offset: topicLen + freshLen })
5155
5202
  ] }),
5156
- /* @__PURE__ */ jsxs12(
5203
+ /* @__PURE__ */ jsxs13(
5157
5204
  "div",
5158
5205
  {
5159
5206
  style: {
@@ -5167,15 +5214,15 @@ function ScoreDonut({
5167
5214
  lineHeight: 1
5168
5215
  },
5169
5216
  children: [
5170
- /* @__PURE__ */ jsxs12("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
5217
+ /* @__PURE__ */ jsxs13("span", { style: { fontSize: Math.max(11, size / 5.5), fontWeight: 700, color: "#1f2937" }, children: [
5171
5218
  compositeValue,
5172
5219
  "%"
5173
5220
  ] }),
5174
- /* @__PURE__ */ jsx13("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
5221
+ /* @__PURE__ */ jsx14("span", { style: { fontSize: Math.max(7, size / 11), fontWeight: 700, color: "#4b5563", letterSpacing: "0.05em", marginTop: 1 }, children: "MATCH" })
5175
5222
  ]
5176
5223
  }
5177
5224
  ),
5178
- hovered && /* @__PURE__ */ jsxs12(
5225
+ hovered && /* @__PURE__ */ jsxs13(
5179
5226
  "div",
5180
5227
  {
5181
5228
  role: "tooltip",
@@ -5196,9 +5243,9 @@ function ScoreDonut({
5196
5243
  pointerEvents: "none"
5197
5244
  },
5198
5245
  children: [
5199
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
5200
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
5201
- /* @__PURE__ */ jsx13(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
5246
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.topic, label: "Topic", value: topic }),
5247
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.freshness, label: "Freshness", value: freshness }),
5248
+ /* @__PURE__ */ jsx14(SubScoreRow, { color: COLORS.sectionFit, label: "Section fit", value: sectionFit })
5202
5249
  ]
5203
5250
  }
5204
5251
  )
@@ -5207,31 +5254,31 @@ function ScoreDonut({
5207
5254
  );
5208
5255
  }
5209
5256
  function SubScoreRow({ color, label, value }) {
5210
- return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
5211
- /* @__PURE__ */ jsx13("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
5212
- /* @__PURE__ */ jsx13("span", { style: { flex: 1 }, children: label }),
5213
- /* @__PURE__ */ jsxs12("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
5257
+ return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
5258
+ /* @__PURE__ */ jsx14("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block", flexShrink: 0 } }),
5259
+ /* @__PURE__ */ jsx14("span", { style: { flex: 1 }, children: label }),
5260
+ /* @__PURE__ */ jsxs13("span", { style: { fontWeight: 700, fontVariantNumeric: "tabular-nums" }, children: [
5214
5261
  Math.round(value),
5215
5262
  "/100"
5216
5263
  ] })
5217
5264
  ] });
5218
5265
  }
5219
5266
  function ScoreDonutLegend() {
5220
- return /* @__PURE__ */ jsxs12("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
5221
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
5222
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
5223
- /* @__PURE__ */ jsx13(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
5267
+ return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", gap: 10, fontSize: 9, color: "rgba(0,0,0,0.55)", alignItems: "center", flexWrap: "wrap" }, children: [
5268
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.topic, label: "Topic match (60% of score)" }),
5269
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.freshness, label: "Freshness (25%)" }),
5270
+ /* @__PURE__ */ jsx14(LegendDot, { color: COLORS.sectionFit, label: "Section fit (15%)" })
5224
5271
  ] });
5225
5272
  }
5226
5273
  function LegendDot({ color, label }) {
5227
- return /* @__PURE__ */ jsxs12("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5228
- /* @__PURE__ */ jsx13("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
5274
+ return /* @__PURE__ */ jsxs13("span", { style: { display: "inline-flex", alignItems: "center", gap: 4 }, children: [
5275
+ /* @__PURE__ */ jsx14("span", { style: { width: 7, height: 7, borderRadius: "50%", background: color, display: "inline-block" } }),
5229
5276
  label
5230
5277
  ] });
5231
5278
  }
5232
5279
 
5233
5280
  // src/components/tabs/LinkingTab.tsx
5234
- import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
5281
+ import { Fragment as Fragment7, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5235
5282
  function buildLiveUrl(publication, slug) {
5236
5283
  if (!slug) return null;
5237
5284
  const pub = (publication || "").trim().toLowerCase();
@@ -5247,7 +5294,7 @@ function buildSanityUrl(baseUrl, id, type) {
5247
5294
  return `${base}/intent/edit/id=${encodeURIComponent(cleanId)}${typePart}/`;
5248
5295
  }
5249
5296
  function LinkChip({ href, label, color }) {
5250
- return /* @__PURE__ */ jsxs13(
5297
+ return /* @__PURE__ */ jsxs14(
5251
5298
  "a",
5252
5299
  {
5253
5300
  href,
@@ -5269,16 +5316,16 @@ function LinkChip({ href, label, color }) {
5269
5316
  },
5270
5317
  children: [
5271
5318
  label,
5272
- /* @__PURE__ */ jsxs13("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5273
- /* @__PURE__ */ jsx14("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5274
- /* @__PURE__ */ jsx14("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5319
+ /* @__PURE__ */ jsxs14("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5320
+ /* @__PURE__ */ jsx15("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5321
+ /* @__PURE__ */ jsx15("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5275
5322
  ] })
5276
5323
  ]
5277
5324
  }
5278
5325
  );
5279
5326
  }
5280
5327
  function ClickableBadge({ clickable }) {
5281
- return /* @__PURE__ */ jsxs13(
5328
+ return /* @__PURE__ */ jsxs14(
5282
5329
  "span",
5283
5330
  {
5284
5331
  style: {
@@ -5295,7 +5342,7 @@ function ClickableBadge({ clickable }) {
5295
5342
  color: clickable ? "#16a34a" : "#9ca3af"
5296
5343
  },
5297
5344
  children: [
5298
- /* @__PURE__ */ jsx14("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
5345
+ /* @__PURE__ */ jsx15("span", { style: { width: 5, height: 5, borderRadius: "50%", background: "currentColor" } }),
5299
5346
  clickable ? "Clickable link" : "No live link"
5300
5347
  ]
5301
5348
  }
@@ -5310,7 +5357,7 @@ var cardStyle4 = {
5310
5357
  padding: "14px"
5311
5358
  };
5312
5359
  function AiPill2() {
5313
- return /* @__PURE__ */ jsx14(
5360
+ return /* @__PURE__ */ jsx15(
5314
5361
  "span",
5315
5362
  {
5316
5363
  style: {
@@ -5334,10 +5381,10 @@ function SectionHeader3({
5334
5381
  ai,
5335
5382
  action
5336
5383
  }) {
5337
- return /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
5338
- /* @__PURE__ */ jsx14("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
5339
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
5340
- ai && /* @__PURE__ */ jsx14(AiPill2, {}),
5384
+ return /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 7, marginBottom: 8 }, children: [
5385
+ /* @__PURE__ */ jsx15("div", { style: { width: 7, height: 7, borderRadius: "50%", background: iconColor, flexShrink: 0 } }),
5386
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600, flex: 1 }, children: label }),
5387
+ ai && /* @__PURE__ */ jsx15(AiPill2, {}),
5341
5388
  action
5342
5389
  ] });
5343
5390
  }
@@ -5358,7 +5405,7 @@ function freshnessChip(label, score) {
5358
5405
  };
5359
5406
  const c = map[label];
5360
5407
  if (!c) return null;
5361
- return /* @__PURE__ */ jsx14(
5408
+ return /* @__PURE__ */ jsx15(
5362
5409
  "span",
5363
5410
  {
5364
5411
  style: {
@@ -5378,8 +5425,8 @@ function freshnessChip(label, score) {
5378
5425
  );
5379
5426
  }
5380
5427
  function RefreshIcon({ spinning }) {
5381
- if (spinning) return /* @__PURE__ */ jsx14(LoadingBars, { size: "xs", color: "#9ca3af" });
5382
- return /* @__PURE__ */ jsx14("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx14("path", { fillRule: "evenodd", d: "M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H4.598a.75.75 0 00-.75.75v3.634a.75.75 0 001.5 0v-2.033l.312.311a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm-10.624-2.85a5.5 5.5 0 019.201-2.466l.312.311h-2.433a.75.75 0 000 1.5h3.634a.75.75 0 00.75-.75V3.535a.75.75 0 00-1.5 0v2.033l-.312-.311A7 7 0 002.628 8.395a.75.75 0 001.449.39z", clipRule: "evenodd" }) });
5428
+ if (spinning) return /* @__PURE__ */ jsx15(LoadingBars, { size: "xs", color: "#9ca3af" });
5429
+ return /* @__PURE__ */ jsx15("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx15("path", { fillRule: "evenodd", d: "M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H4.598a.75.75 0 00-.75.75v3.634a.75.75 0 001.5 0v-2.033l.312.311a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm-10.624-2.85a5.5 5.5 0 019.201-2.466l.312.311h-2.433a.75.75 0 000 1.5h3.634a.75.75 0 00.75-.75V3.535a.75.75 0 00-1.5 0v2.033l-.312-.311A7 7 0 002.628 8.395a.75.75 0 001.449.39z", clipRule: "evenodd" }) });
5383
5430
  }
5384
5431
  function LinkingTab({
5385
5432
  analysis,
@@ -5395,21 +5442,21 @@ function LinkingTab({
5395
5442
  documentType
5396
5443
  }) {
5397
5444
  if (!analysis) {
5398
- return /* @__PURE__ */ jsxs13("div", { style: { padding: 24, textAlign: "center" }, children: [
5399
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5400
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes." })
5445
+ return /* @__PURE__ */ jsxs14("div", { style: { padding: 24, textAlign: "center" }, children: [
5446
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Waiting for keyword analysis" }),
5447
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Linking reads the article keywords and topic to find related published articles. It starts on its own once the Keywords tab finishes." })
5401
5448
  ] });
5402
5449
  }
5403
5450
  const wordCount2 = text ? text.split(/\s+/).filter(Boolean).length : 0;
5404
5451
  const recommendedMin = Math.max(1, Math.round(wordCount2 / 1e3 * 2));
5405
5452
  const recommendedMax = Math.max(2, Math.round(wordCount2 / 1e3 * 5));
5406
- return /* @__PURE__ */ jsx14("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ jsxs13("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5407
- /* @__PURE__ */ jsx14(
5453
+ return /* @__PURE__ */ jsx15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 12 }, children: /* @__PURE__ */ jsxs14("div", { id: "anchor-linking-suggestions", style: cardStyle4, children: [
5454
+ /* @__PURE__ */ jsx15(
5408
5455
  SectionHeader3,
5409
5456
  {
5410
5457
  label: "Suggested Links",
5411
5458
  iconColor: MJH_BLUE,
5412
- action: /* @__PURE__ */ jsx14(
5459
+ action: /* @__PURE__ */ jsx15(
5413
5460
  "button",
5414
5461
  {
5415
5462
  onClick: onRefresh,
@@ -5424,20 +5471,20 @@ function LinkingTab({
5424
5471
  fontSize: 10
5425
5472
  },
5426
5473
  title: "Refresh",
5427
- children: /* @__PURE__ */ jsx14(RefreshIcon, { spinning: isLoading })
5474
+ children: /* @__PURE__ */ jsx15(RefreshIcon, { spinning: isLoading })
5428
5475
  }
5429
5476
  )
5430
5477
  }
5431
5478
  ),
5432
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5479
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 8, lineHeight: 1.55 }, children: [
5433
5480
  "Other articles on this site that fit this topic.",
5434
- wordCount2 > 0 && /* @__PURE__ */ jsxs13(Fragment7, { children: [
5481
+ wordCount2 > 0 && /* @__PURE__ */ jsxs14(Fragment7, { children: [
5435
5482
  " ",
5436
5483
  "For a ",
5437
5484
  wordCount2.toLocaleString(),
5438
5485
  "-word article, aim for",
5439
5486
  " ",
5440
- /* @__PURE__ */ jsxs13("strong", { children: [
5487
+ /* @__PURE__ */ jsxs14("strong", { children: [
5441
5488
  recommendedMin,
5442
5489
  "-",
5443
5490
  recommendedMax,
@@ -5446,17 +5493,17 @@ function LinkingTab({
5446
5493
  "."
5447
5494
  ] })
5448
5495
  ] }),
5449
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5496
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 10, color: "#4b5563", marginBottom: 6, lineHeight: 1.5 }, children: [
5450
5497
  "Each suggestion gets a 0-100% match score from three signals - ",
5451
- /* @__PURE__ */ jsx14("strong", { children: "topic match" }),
5498
+ /* @__PURE__ */ jsx15("strong", { children: "topic match" }),
5452
5499
  ", ",
5453
- /* @__PURE__ */ jsx14("strong", { children: "freshness" }),
5500
+ /* @__PURE__ */ jsx15("strong", { children: "freshness" }),
5454
5501
  ", and ",
5455
- /* @__PURE__ */ jsx14("strong", { children: "section fit" }),
5502
+ /* @__PURE__ */ jsx15("strong", { children: "section fit" }),
5456
5503
  " (where in your article the link belongs). The percentage on each card is the weighted total:"
5457
5504
  ] }),
5458
- /* @__PURE__ */ jsx14("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ jsx14(ScoreDonutLegend, {}) }),
5459
- isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ jsxs13(
5505
+ /* @__PURE__ */ jsx15("div", { style: { marginBottom: 10 }, children: /* @__PURE__ */ jsx15(ScoreDonutLegend, {}) }),
5506
+ isStale && suggestions.length > 0 && !isLoading && /* @__PURE__ */ jsxs14(
5460
5507
  "div",
5461
5508
  {
5462
5509
  role: "button",
@@ -5481,16 +5528,16 @@ function LinkingTab({
5481
5528
  cursor: "pointer"
5482
5529
  },
5483
5530
  children: [
5484
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5485
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5531
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, color: "#92400e" }, children: "Your article changed since these were generated." }),
5532
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, fontWeight: 700, color: "#8B7310", textDecoration: "underline", flexShrink: 0 }, children: "Refresh" })
5486
5533
  ]
5487
5534
  }
5488
5535
  ),
5489
- isLoading && suggestions.length === 0 && /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5490
- /* @__PURE__ */ jsx14(LoadingBars, { size: "xs", color: MJH_BLUE }),
5491
- /* @__PURE__ */ jsx14("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5536
+ isLoading && suggestions.length === 0 && /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
5537
+ /* @__PURE__ */ jsx15(LoadingBars, { size: "xs", color: MJH_BLUE }),
5538
+ /* @__PURE__ */ jsx15("span", { style: { fontSize: 11, color: "#4b5563" }, children: "Ranking candidates..." })
5492
5539
  ] }),
5493
- !isLoading && error && /* @__PURE__ */ jsxs13(
5540
+ !isLoading && error && /* @__PURE__ */ jsxs14(
5494
5541
  "div",
5495
5542
  {
5496
5543
  style: {
@@ -5501,9 +5548,9 @@ function LinkingTab({
5501
5548
  textAlign: "center"
5502
5549
  },
5503
5550
  children: [
5504
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5505
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5506
- /* @__PURE__ */ jsx14(
5551
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 11.5, color: "#b91c1c", fontWeight: 600, marginBottom: 2 }, children: "Couldn't load suggestions" }),
5552
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 10.5, color: "#4b5563", marginBottom: 8 }, children: error }),
5553
+ /* @__PURE__ */ jsx15(
5507
5554
  "button",
5508
5555
  {
5509
5556
  onClick: onRefresh,
@@ -5523,14 +5570,14 @@ function LinkingTab({
5523
5570
  ]
5524
5571
  }
5525
5572
  ),
5526
- !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", padding: "10px 12px", lineHeight: 1.55, background: "rgba(0,93,172,0.04)", borderRadius: 8, border: "1px solid rgba(0,93,172,0.12)" }, children: [
5527
- /* @__PURE__ */ jsx14("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5528
- /* @__PURE__ */ jsx14("div", { style: { color: "#4b5563" }, children: "Linking searched your publication for articles on this topic and did not find a strong match. As more related content is published, suggestions will appear here." })
5573
+ !isLoading && !error && suggestions.length === 0 && /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", padding: "10px 12px", lineHeight: 1.55, background: "rgba(0,93,172,0.04)", borderRadius: 8, border: "1px solid rgba(0,93,172,0.12)" }, children: [
5574
+ /* @__PURE__ */ jsx15("div", { style: { fontWeight: 700, marginBottom: 4, color: "#1f2937" }, children: "No closely related articles found." }),
5575
+ /* @__PURE__ */ jsx15("div", { style: { color: "#4b5563" }, children: "Linking checked related and recent articles from your publication and did not find a strong match. As more related content is published, suggestions will appear here." })
5529
5576
  ] }),
5530
- suggestions.length > 0 && /* @__PURE__ */ jsx14("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
5577
+ suggestions.length > 0 && /* @__PURE__ */ jsx15("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: suggestions.map((s) => {
5531
5578
  const liveUrl = buildLiveUrl(publication, s.slug);
5532
5579
  const sanityUrl = buildSanityUrl(sanityBaseUrl, s._id);
5533
- return /* @__PURE__ */ jsxs13(
5580
+ return /* @__PURE__ */ jsxs14(
5534
5581
  "div",
5535
5582
  {
5536
5583
  style: {
@@ -5543,7 +5590,7 @@ function LinkingTab({
5543
5590
  alignItems: "flex-start"
5544
5591
  },
5545
5592
  children: [
5546
- /* @__PURE__ */ jsx14(
5593
+ /* @__PURE__ */ jsx15(
5547
5594
  ScoreDonut,
5548
5595
  {
5549
5596
  size: 64,
@@ -5553,27 +5600,27 @@ function LinkingTab({
5553
5600
  composite: Math.max(0, Math.min(100, s.compositeScore))
5554
5601
  }
5555
5602
  ),
5556
- /* @__PURE__ */ jsxs13("div", { style: { flex: 1, minWidth: 0 }, children: [
5557
- /* @__PURE__ */ jsxs13("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5603
+ /* @__PURE__ */ jsxs14("div", { style: { flex: 1, minWidth: 0 }, children: [
5604
+ /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 3, flexWrap: "wrap" }, children: [
5558
5605
  freshnessChip(s.freshnessLabel, s.freshnessScore),
5559
- s.publishedAt && /* @__PURE__ */ jsx14("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
5560
- /* @__PURE__ */ jsx14(ClickableBadge, { clickable: !!liveUrl })
5606
+ s.publishedAt && /* @__PURE__ */ jsx15("span", { style: { fontSize: 10, color: "#4b5563" }, children: formatDate(s.publishedAt) }),
5607
+ /* @__PURE__ */ jsx15(ClickableBadge, { clickable: !!liveUrl })
5561
5608
  ] }),
5562
- /* @__PURE__ */ jsx14("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5563
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5609
+ /* @__PURE__ */ jsx15("div", { style: { fontSize: 12, fontWeight: 700, color: "#1f2937", lineHeight: 1.4, marginBottom: 2 }, children: s.title }),
5610
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", marginBottom: 6 }, children: [
5564
5611
  "/",
5565
5612
  s.slug
5566
5613
  ] }),
5567
- (liveUrl || sanityUrl) && /* @__PURE__ */ jsxs13("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5568
- sanityUrl && /* @__PURE__ */ jsx14(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5569
- liveUrl && /* @__PURE__ */ jsx14(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5614
+ (liveUrl || sanityUrl) && /* @__PURE__ */ jsxs14("div", { style: { display: "flex", flexWrap: "wrap", gap: 6, marginBottom: 6 }, children: [
5615
+ sanityUrl && /* @__PURE__ */ jsx15(LinkChip, { href: sanityUrl, label: "Inside Sanity", color: MJH_BLUE }),
5616
+ liveUrl && /* @__PURE__ */ jsx15(LinkChip, { href: liveUrl, label: "Live site", color: "#4b5563" })
5570
5617
  ] }),
5571
- s.relevanceReason && /* @__PURE__ */ jsxs13("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5572
- /* @__PURE__ */ jsx14("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5618
+ s.relevanceReason && /* @__PURE__ */ jsxs14("div", { style: { fontSize: 11, color: "#1f2937", marginBottom: 6, lineHeight: 1.45 }, children: [
5619
+ /* @__PURE__ */ jsx15("span", { style: { fontWeight: 700, color: "#4b5563" }, children: "Why it fits:" }),
5573
5620
  " ",
5574
- /* @__PURE__ */ jsx14("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5621
+ /* @__PURE__ */ jsx15("span", { style: { fontStyle: "italic" }, children: s.relevanceReason })
5575
5622
  ] }),
5576
- s.anchorQuote && /* @__PURE__ */ jsxs13(
5623
+ s.anchorQuote && /* @__PURE__ */ jsxs14(
5577
5624
  "div",
5578
5625
  {
5579
5626
  style: {
@@ -5587,21 +5634,21 @@ function LinkingTab({
5587
5634
  lineHeight: 1.5
5588
5635
  },
5589
5636
  children: [
5590
- /* @__PURE__ */ jsxs13("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5637
+ /* @__PURE__ */ jsxs14("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginBottom: 3 }, children: [
5591
5638
  "Where to link from - paragraph ",
5592
5639
  s.anchorParagraph
5593
5640
  ] }),
5594
- /* @__PURE__ */ jsxs13("div", { style: { fontStyle: "italic" }, children: [
5641
+ /* @__PURE__ */ jsxs14("div", { style: { fontStyle: "italic" }, children: [
5595
5642
  '"',
5596
5643
  s.anchorQuote,
5597
5644
  '"'
5598
5645
  ] }),
5599
- s.anchorReason && /* @__PURE__ */ jsx14("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5646
+ s.anchorReason && /* @__PURE__ */ jsx15("div", { style: { fontSize: 10, color: "#4b5563", marginTop: 3, lineHeight: 1.45 }, children: s.anchorReason })
5600
5647
  ]
5601
5648
  }
5602
5649
  )
5603
5650
  ] }),
5604
- /* @__PURE__ */ jsx14("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx14(
5651
+ /* @__PURE__ */ jsx15("div", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx15(
5605
5652
  FeedbackButton,
5606
5653
  {
5607
5654
  suggestionType: "internal_link",
@@ -5620,10 +5667,10 @@ function LinkingTab({
5620
5667
 
5621
5668
  // src/components/tabs/MetaTab.tsx
5622
5669
  import { useMemo as useMemo3 } from "react";
5623
- import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
5670
+ import { Fragment as Fragment8, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
5624
5671
  var GOOGLE_EEAT_URL = "https://developers.google.com/search/docs/fundamentals/creating-helpful-content#eat";
5625
5672
  function ExternalLinkChip({ href, label }) {
5626
- return /* @__PURE__ */ jsxs14(
5673
+ return /* @__PURE__ */ jsxs15(
5627
5674
  "a",
5628
5675
  {
5629
5676
  href,
@@ -5646,16 +5693,16 @@ function ExternalLinkChip({ href, label }) {
5646
5693
  },
5647
5694
  children: [
5648
5695
  label,
5649
- /* @__PURE__ */ jsxs14("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5650
- /* @__PURE__ */ jsx15("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5651
- /* @__PURE__ */ jsx15("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5696
+ /* @__PURE__ */ jsxs15("svg", { width: "9", height: "9", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", children: [
5697
+ /* @__PURE__ */ jsx16("path", { d: "M12.5 2a.75.75 0 000 1.5h2.44l-6.97 6.97a.75.75 0 101.06 1.06L16 4.56V7a.75.75 0 001.5 0V2.75A.75.75 0 0016.75 2H12.5z" }),
5698
+ /* @__PURE__ */ jsx16("path", { d: "M4.75 4.5A2.75 2.75 0 002 7.25v8A2.75 2.75 0 004.75 18h8A2.75 2.75 0 0015.5 15.25v-3a.75.75 0 00-1.5 0v3c0 .69-.56 1.25-1.25 1.25h-8c-.69 0-1.25-.56-1.25-1.25v-8c0-.69.56-1.25 1.25-1.25h3a.75.75 0 000-1.5h-3z" })
5652
5699
  ] })
5653
5700
  ]
5654
5701
  }
5655
5702
  );
5656
5703
  }
5657
5704
  function FreshnessNotice() {
5658
- return /* @__PURE__ */ jsxs14(
5705
+ return /* @__PURE__ */ jsxs15(
5659
5706
  "div",
5660
5707
  {
5661
5708
  style: {
@@ -5669,11 +5716,11 @@ function FreshnessNotice() {
5669
5716
  lineHeight: 1.5
5670
5717
  },
5671
5718
  children: [
5672
- /* @__PURE__ */ jsx15("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
5719
+ /* @__PURE__ */ jsx16("span", { style: { fontWeight: 700, color: MJH_BLUE }, children: "Keep it fresh. " }),
5673
5720
  "Planning to update this article after it's published? Set the ",
5674
- /* @__PURE__ */ jsx15("strong", { children: "Updated on" }),
5721
+ /* @__PURE__ */ jsx16("strong", { children: "Updated on" }),
5675
5722
  " date in Sanity (e.g. \u201CUpdated: February 19, 2026\u201D). It surfaces the article in ",
5676
- /* @__PURE__ */ jsx15("strong", { children: "Latest Updated Articles" }),
5723
+ /* @__PURE__ */ jsx16("strong", { children: "Latest Updated Articles" }),
5677
5724
  " and increases its visibility in search engine results."
5678
5725
  ]
5679
5726
  }
@@ -5694,7 +5741,7 @@ function StatusBadge({ status }) {
5694
5741
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
5695
5742
  };
5696
5743
  const c = map[status];
5697
- return /* @__PURE__ */ jsx15(
5744
+ return /* @__PURE__ */ jsx16(
5698
5745
  "span",
5699
5746
  {
5700
5747
  style: {
@@ -5713,12 +5760,12 @@ function StatusBadge({ status }) {
5713
5760
  );
5714
5761
  }
5715
5762
  function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5716
- return /* @__PURE__ */ jsxs14("div", { id: anchorId, style: cardStyle5, children: [
5717
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5718
- /* @__PURE__ */ jsx15("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5719
- /* @__PURE__ */ jsx15(StatusBadge, { status })
5763
+ return /* @__PURE__ */ jsxs15("div", { id: anchorId, style: cardStyle5, children: [
5764
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
5765
+ /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
5766
+ /* @__PURE__ */ jsx16(StatusBadge, { status })
5720
5767
  ] }),
5721
- /* @__PURE__ */ jsx15(
5768
+ /* @__PURE__ */ jsx16(
5722
5769
  "div",
5723
5770
  {
5724
5771
  style: {
@@ -5731,7 +5778,7 @@ function AuditCard({ label, value, status, recommendation, anchorId, footer }) {
5731
5778
  children: value
5732
5779
  }
5733
5780
  ),
5734
- recommendation && /* @__PURE__ */ jsx15(
5781
+ recommendation && /* @__PURE__ */ jsx16(
5735
5782
  "div",
5736
5783
  {
5737
5784
  style: {
@@ -5880,7 +5927,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5880
5927
  } else {
5881
5928
  items.push({ label: "Author Byline", value: `${author}, ${creds}`, status: "good" });
5882
5929
  }
5883
- items[0].footer = /* @__PURE__ */ jsx15(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
5930
+ items[0].footer = /* @__PURE__ */ jsx16(ExternalLinkChip, { href: GOOGLE_EEAT_URL, label: "Google's E-E-A-T guidelines" });
5884
5931
  const factChecker = documentFields?.factCheckerName;
5885
5932
  const factCheckerRef = documentFields?.factCheckerIsReference;
5886
5933
  if (factChecker) {
@@ -5905,7 +5952,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5905
5952
  if (days <= 14) {
5906
5953
  items.push({ label: "Content Freshness", value, status: "good", recommendation: "Recent content gets cited and ranked more. Re-set the Updated-on date whenever you revise to keep it fresh." });
5907
5954
  } else if (days <= 90) {
5908
- items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Content older than two weeks gets cited less by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
5955
+ items.push({ label: "Content Freshness", value, status: "warning", recommendation: "Recently updated content tends to be cited more by AI search. If it's still accurate, refresh a stat and set the Updated-on date in Sanity." });
5909
5956
  } else {
5910
5957
  items.push({ label: "Content Freshness", value, status: "error", recommendation: "Over 90 days old. Review the facts, update what's stale, and set the Updated-on date in Sanity." });
5911
5958
  }
@@ -5915,21 +5962,21 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5915
5962
  const publishDateItem = useMemo3(() => {
5916
5963
  const published = documentFields?.publishedAt;
5917
5964
  const daysPub = daysSince(published);
5918
- if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Required for healthcare content to be cited by Google and AI search." };
5965
+ if (!published) return { label: "Publish Date", value: "Missing", status: "error", recommendation: "Add a visible publish date. Helps search engines and AI search judge how current the article is." };
5919
5966
  if (daysPub === null) return { label: "Publish Date", value: "Unrecognized format", status: "warning", recommendation: "A publish date is set but couldn't be read as a valid date. Check the field value." };
5920
5967
  return { label: "Publish Date", value: formatDateShort(published), status: "good" };
5921
5968
  }, [documentFields]);
5922
5969
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.metaDescription !== void 0 || documentFields.slug !== void 0);
5923
5970
  if (isLoading && !hasAnyField) {
5924
- return /* @__PURE__ */ jsxs14("div", { style: { padding: 24, textAlign: "center" }, children: [
5925
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5926
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5971
+ return /* @__PURE__ */ jsxs15("div", { style: { padding: 24, textAlign: "center" }, children: [
5972
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
5973
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
5927
5974
  ] });
5928
5975
  }
5929
5976
  const auditAnchors = ["anchor-meta-title", "anchor-meta-description"];
5930
- return /* @__PURE__ */ jsxs14("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5931
- /* @__PURE__ */ jsx15(FreshnessNotice, {}),
5932
- /* @__PURE__ */ jsx15(
5977
+ return /* @__PURE__ */ jsxs15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
5978
+ /* @__PURE__ */ jsx16(FreshnessNotice, {}),
5979
+ /* @__PURE__ */ jsx16(
5933
5980
  AuditCard,
5934
5981
  {
5935
5982
  anchorId: "anchor-publish-date",
@@ -5939,7 +5986,7 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5939
5986
  recommendation: publishDateItem.recommendation
5940
5987
  }
5941
5988
  ),
5942
- audits.map((a, i) => /* @__PURE__ */ jsx15(
5989
+ audits.map((a, i) => /* @__PURE__ */ jsx16(
5943
5990
  AuditCard,
5944
5991
  {
5945
5992
  anchorId: auditAnchors[i],
@@ -5950,14 +5997,14 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5950
5997
  },
5951
5998
  i
5952
5999
  )),
5953
- eeatItems.length > 0 && /* @__PURE__ */ jsxs14(Fragment8, { children: [
5954
- /* @__PURE__ */ jsxs14("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
5955
- /* @__PURE__ */ jsx15("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
5956
- /* @__PURE__ */ jsx15("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
5957
- /* @__PURE__ */ jsx15("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
6000
+ eeatItems.length > 0 && /* @__PURE__ */ jsxs15(Fragment8, { children: [
6001
+ /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: 8, margin: "6px 4px 0" }, children: [
6002
+ /* @__PURE__ */ jsx16("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } }),
6003
+ /* @__PURE__ */ jsx16("span", { style: { fontSize: 10, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.08em" }, children: "Author & Freshness" }),
6004
+ /* @__PURE__ */ jsx16("div", { style: { height: 1, flex: 1, background: "rgba(0,0,0,0.06)" } })
5958
6005
  ] }),
5959
- /* @__PURE__ */ jsx15("div", { style: { fontSize: 10, color: "#4b5563", padding: "0 4px", marginTop: -4 }, children: "Google looks for a named author with credentials and recent updates on healthcare content." }),
5960
- eeatItems.map((item, i) => /* @__PURE__ */ jsx15(
6006
+ /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", padding: "0 4px", marginTop: -4 }, children: "Google looks for a named author with credentials and recent updates on healthcare content." }),
6007
+ eeatItems.map((item, i) => /* @__PURE__ */ jsx16(
5961
6008
  AuditCard,
5962
6009
  {
5963
6010
  label: item.label,
@@ -5973,8 +6020,8 @@ function MetaTab({ documentFields, primaryKeyword, secondaryKeyword, isLoading }
5973
6020
  }
5974
6021
 
5975
6022
  // src/components/tabs/TechnicalTab.tsx
5976
- import { useMemo as useMemo4, useState as useState16 } from "react";
5977
- import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
6023
+ import { useMemo as useMemo4, useState as useState17 } from "react";
6024
+ import { Fragment as Fragment9, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
5978
6025
  function urlAudit(slug, primaryKeyword, secondaryKeyword) {
5979
6026
  const SHORT_DESC = "Keep the URL short and descriptive - concise URLs are easier to read - and avoid trailing, duplicate, or excessive spaces.";
5980
6027
  if (!slug) {
@@ -6009,28 +6056,28 @@ function urlAudit(slug, primaryKeyword, secondaryKeyword) {
6009
6056
  return { label: "URL Slug", value: `/${slug}`, status: "good" };
6010
6057
  }
6011
6058
  function SlugRedirectNotice() {
6012
- const [expanded, setExpanded] = useState16(false);
6013
- return /* @__PURE__ */ jsx16("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ jsxs15("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
6014
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
6015
- /* @__PURE__ */ jsx16("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
6016
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
6059
+ const [expanded, setExpanded] = useState17(false);
6060
+ return /* @__PURE__ */ jsx17("div", { style: { marginTop: 10, paddingTop: 10, borderTop: "1px solid rgba(0,0,0,0.07)" }, children: /* @__PURE__ */ jsxs16("div", { style: { padding: "8px 10px", background: "rgba(245,158,11,0.08)", borderLeft: "2px solid #f59e0b", borderRadius: 6 }, children: [
6061
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: 6, marginBottom: 4 }, children: [
6062
+ /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "#f59e0b", "aria-hidden": "true", children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z", clipRule: "evenodd" }) }),
6063
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, fontWeight: 700, color: "#b45309", textTransform: "uppercase", letterSpacing: "0.06em" }, children: "Changing a URL?" })
6017
6064
  ] }),
6018
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you MUST add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
6019
- /* @__PURE__ */ jsxs15(
6065
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: "If the page has been published and indexed, you must add a 301 redirect from the old slug to the new one before changing it. For a brand-new page that's never been published, no redirect needed." }),
6066
+ /* @__PURE__ */ jsxs16(
6020
6067
  "button",
6021
6068
  {
6022
6069
  onClick: () => setExpanded((v) => !v),
6023
6070
  style: { display: "flex", alignItems: "center", gap: 3, marginTop: 6, padding: 0, background: "none", border: "none", cursor: "pointer", fontSize: 10.5, fontWeight: 700, color: "#b45309", fontFamily: "inherit" },
6024
6071
  children: [
6025
6072
  expanded ? "Show less" : "Learn more",
6026
- /* @__PURE__ */ jsx16("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx16("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
6073
+ /* @__PURE__ */ jsx17("svg", { width: "10", height: "10", viewBox: "0 0 20 20", fill: "currentColor", style: { transform: expanded ? "rotate(180deg)" : "none", transition: "transform 150ms" }, children: /* @__PURE__ */ jsx17("path", { fillRule: "evenodd", d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z", clipRule: "evenodd" }) })
6027
6074
  ]
6028
6075
  }
6029
6076
  ),
6030
- expanded && /* @__PURE__ */ jsxs15("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
6031
- /* @__PURE__ */ jsx16("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
6032
- /* @__PURE__ */ jsx16("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
6033
- /* @__PURE__ */ jsx16("li", { children: "Set this up using vanity redirects in Sanity." })
6077
+ expanded && /* @__PURE__ */ jsxs16("ul", { style: { margin: "6px 0 0", paddingLeft: 16, fontSize: 11, color: "#1f2937", lineHeight: 1.55 }, children: [
6078
+ /* @__PURE__ */ jsx17("li", { children: "Without the 301, the page loses every search ranking and every external link to it breaks." }),
6079
+ /* @__PURE__ */ jsx17("li", { children: "A 301 preserves the rankings and link equity built up on the old URL." }),
6080
+ /* @__PURE__ */ jsx17("li", { children: "Set this up using vanity redirects in Sanity." })
6034
6081
  ] })
6035
6082
  ] }) });
6036
6083
  }
@@ -6049,7 +6096,7 @@ function StatusBadge2({ status }) {
6049
6096
  error: { bg: "rgba(220,38,38,0.1)", color: "#dc2626", label: "Fix" }
6050
6097
  };
6051
6098
  const c = map[status];
6052
- return /* @__PURE__ */ jsx16(
6099
+ return /* @__PURE__ */ jsx17(
6053
6100
  "span",
6054
6101
  {
6055
6102
  style: {
@@ -6075,12 +6122,12 @@ function AuditCard2({
6075
6122
  anchorId,
6076
6123
  footer
6077
6124
  }) {
6078
- return /* @__PURE__ */ jsxs15("div", { id: anchorId, style: cardStyle6, children: [
6079
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6080
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
6081
- /* @__PURE__ */ jsx16(StatusBadge2, { status })
6125
+ return /* @__PURE__ */ jsxs16("div", { id: anchorId, style: cardStyle6, children: [
6126
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6127
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: label }),
6128
+ /* @__PURE__ */ jsx17(StatusBadge2, { status })
6082
6129
  ] }),
6083
- /* @__PURE__ */ jsx16(
6130
+ /* @__PURE__ */ jsx17(
6084
6131
  "div",
6085
6132
  {
6086
6133
  style: {
@@ -6093,7 +6140,7 @@ function AuditCard2({
6093
6140
  children: value
6094
6141
  }
6095
6142
  ),
6096
- recommendation && /* @__PURE__ */ jsx16(
6143
+ recommendation && /* @__PURE__ */ jsx17(
6097
6144
  "div",
6098
6145
  {
6099
6146
  style: {
@@ -6207,7 +6254,7 @@ function imageTitleAudit(titles, imageCount) {
6207
6254
  label: "Image Titles",
6208
6255
  value: `${withTitle} of ${imageCount} image${imageCount === 1 ? "" : "s"} ${withTitle === 1 ? "has" : "have"} a title`,
6209
6256
  status: "warning",
6210
- recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and sends an SEO signal.`
6257
+ recommendation: `Add a descriptive title attribute (2-5 keywords) to the ${missing} image${missing === 1 ? "" : "s"} without one. The title appears on hover and helps readers.`
6211
6258
  };
6212
6259
  }
6213
6260
  const sparse = titles.filter((t) => t.trim().split(/\s+/).filter(Boolean).length < 2);
@@ -6335,7 +6382,7 @@ function HealthBadge({ result }) {
6335
6382
  error: { color: "#dc2626", label: "ERR" }
6336
6383
  };
6337
6384
  const c = map[result.category];
6338
- return /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.04em", padding: "2px 6px", borderRadius: 99, background: "#ffffff", color: c.color, fontVariantNumeric: "tabular-nums", flexShrink: 0, marginTop: 1 }, children: c.label });
6385
+ return /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, fontWeight: 700, letterSpacing: "0.04em", padding: "2px 6px", borderRadius: 99, background: "#ffffff", color: c.color, fontVariantNumeric: "tabular-nums", flexShrink: 0, marginTop: 1 }, children: c.label });
6339
6386
  }
6340
6387
  function LinkCheckCard({
6341
6388
  urls,
@@ -6346,7 +6393,7 @@ function LinkCheckCard({
6346
6393
  hasRun,
6347
6394
  onCheck
6348
6395
  }) {
6349
- const [openBucket, setOpenBucket] = useState16(null);
6396
+ const [openBucket, setOpenBucket] = useState17(null);
6350
6397
  const haveTypes = !!linksDetailed;
6351
6398
  const detailByUrl = useMemo4(
6352
6399
  () => new Map((linksDetailed || []).map((d) => [d.url, d])),
@@ -6370,7 +6417,7 @@ function LinkCheckCard({
6370
6417
  const renderLinkRow = (url) => {
6371
6418
  const d = detailByUrl.get(url);
6372
6419
  const r = resultByUrl.get(url);
6373
- return /* @__PURE__ */ jsxs15(
6420
+ return /* @__PURE__ */ jsxs16(
6374
6421
  "a",
6375
6422
  {
6376
6423
  href: url,
@@ -6378,37 +6425,37 @@ function LinkCheckCard({
6378
6425
  rel: "noopener noreferrer",
6379
6426
  style: { display: "flex", gap: 8, alignItems: "flex-start", padding: "6px 8px", background: "rgba(0,0,0,0.025)", borderRadius: 6, textDecoration: "none", marginTop: 4 },
6380
6427
  children: [
6381
- r && /* @__PURE__ */ jsx16(HealthBadge, { result: r }),
6382
- /* @__PURE__ */ jsxs15("div", { style: { minWidth: 0, flex: 1 }, children: [
6383
- d?.anchorText && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
6428
+ r && /* @__PURE__ */ jsx17(HealthBadge, { result: r }),
6429
+ /* @__PURE__ */ jsxs16("div", { style: { minWidth: 0, flex: 1 }, children: [
6430
+ d?.anchorText && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: "#1f2937", fontWeight: 600, lineHeight: 1.3, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: [
6384
6431
  "\u201C",
6385
6432
  d.anchorText,
6386
6433
  "\u201D"
6387
6434
  ] }),
6388
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
6435
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#4b5563", fontFamily: "ui-monospace, SFMono-Regular, monospace", wordBreak: "break-all", lineHeight: 1.35 }, children: url })
6389
6436
  ] })
6390
6437
  ]
6391
6438
  },
6392
6439
  url
6393
6440
  );
6394
6441
  };
6395
- return /* @__PURE__ */ jsxs15("div", { id: "anchor-link-check", style: cardStyle6, children: [
6396
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6397
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
6398
- hasRun && !isLoading && /* @__PURE__ */ jsx16("button", { onClick: onCheck, style: { background: "none", border: "none", fontSize: 10, fontWeight: 600, color: MJH_BLUE, cursor: "pointer", padding: "2px 4px" }, title: "Run again", children: "Re-check" })
6442
+ return /* @__PURE__ */ jsxs16("div", { id: "anchor-link-check", style: cardStyle6, children: [
6443
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8, marginBottom: 6 }, children: [
6444
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 10.5, textTransform: "uppercase", letterSpacing: "0.06em", color: "#4b5563", fontWeight: 600 }, children: "Link Health" }),
6445
+ hasRun && !isLoading && /* @__PURE__ */ jsx17("button", { onClick: onCheck, style: { background: "none", border: "none", fontSize: 10, fontWeight: 600, color: MJH_BLUE, cursor: "pointer", padding: "2px 4px" }, title: "Run again", children: "Re-check" })
6399
6446
  ] }),
6400
- urls.length === 0 ? /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ jsxs15(Fragment9, { children: [
6401
- /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
6447
+ urls.length === 0 ? /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5 }, children: "No links found in the body." }) : /* @__PURE__ */ jsxs16(Fragment9, { children: [
6448
+ /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: "#4b5563", lineHeight: 1.5, marginBottom: 10 }, children: [
6402
6449
  urls.length,
6403
6450
  " link",
6404
6451
  urls.length === 1 ? "" : "s",
6405
6452
  " in the body.",
6406
6453
  tiles.length > 0 ? " Tap a box to see which." : ""
6407
6454
  ] }),
6408
- tiles.length > 0 && /* @__PURE__ */ jsx16("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
6455
+ tiles.length > 0 && /* @__PURE__ */ jsx17("div", { style: { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 6 }, children: tiles.map((t) => {
6409
6456
  const empty = t.urls.length === 0;
6410
6457
  const active = openBucket === t.key && !empty;
6411
- return /* @__PURE__ */ jsxs15(
6458
+ return /* @__PURE__ */ jsxs16(
6412
6459
  "button",
6413
6460
  {
6414
6461
  type: "button",
@@ -6425,24 +6472,24 @@ function LinkCheckCard({
6425
6472
  opacity: empty ? 0.5 : 1
6426
6473
  },
6427
6474
  children: [
6428
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
6429
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
6475
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 18, fontWeight: 700, color: t.color, fontVariantNumeric: "tabular-nums", lineHeight: 1 }, children: t.urls.length }),
6476
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 9, fontWeight: 700, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.05em", marginTop: 4 }, children: t.label })
6430
6477
  ]
6431
6478
  },
6432
6479
  t.key
6433
6480
  );
6434
6481
  }) }),
6435
- open && open.urls.length > 0 && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 8 }, children: [
6436
- open.note && /* @__PURE__ */ jsx16("div", { style: { fontSize: 10.5, color: "#92400e", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, padding: "6px 9px", lineHeight: 1.45, marginBottom: 2 }, children: open.note }),
6482
+ open && open.urls.length > 0 && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8 }, children: [
6483
+ open.note && /* @__PURE__ */ jsx17("div", { style: { fontSize: 10.5, color: "#92400e", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, padding: "6px 9px", lineHeight: 1.45, marginBottom: 2 }, children: open.note }),
6437
6484
  open.urls.map(renderLinkRow)
6438
6485
  ] }),
6439
- hasRun && blockedUrls.length > 0 && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 8, padding: "6px 10px", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, fontSize: 10.5, color: "#92400e", lineHeight: 1.45 }, children: [
6486
+ hasRun && blockedUrls.length > 0 && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 8, padding: "6px 10px", background: "rgba(245,158,11,0.08)", border: "1px solid rgba(245,158,11,0.25)", borderRadius: 6, fontSize: 10.5, color: "#92400e", lineHeight: 1.45 }, children: [
6440
6487
  blockedUrls.length,
6441
6488
  " link",
6442
6489
  blockedUrls.length === 1 ? "" : "s",
6443
6490
  " couldn't be auto-checked (the destination blocks our checker) - open them to confirm."
6444
6491
  ] }),
6445
- !hasRun && !isLoading && /* @__PURE__ */ jsxs15(
6492
+ !hasRun && !isLoading && /* @__PURE__ */ jsxs16(
6446
6493
  "button",
6447
6494
  {
6448
6495
  onClick: onCheck,
@@ -6456,9 +6503,9 @@ function LinkCheckCard({
6456
6503
  ]
6457
6504
  }
6458
6505
  ),
6459
- isLoading && /* @__PURE__ */ jsxs15("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
6460
- /* @__PURE__ */ jsx16(LoadingBars, { size: "xs", color: MJH_BLUE }),
6461
- /* @__PURE__ */ jsxs15("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
6506
+ isLoading && /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", gap: 8, padding: "16px 0" }, children: [
6507
+ /* @__PURE__ */ jsx17(LoadingBars, { size: "xs", color: MJH_BLUE }),
6508
+ /* @__PURE__ */ jsxs16("span", { style: { fontSize: 11, color: "#4b5563" }, children: [
6462
6509
  "Checking ",
6463
6510
  urls.length,
6464
6511
  " link",
@@ -6466,9 +6513,9 @@ function LinkCheckCard({
6466
6513
  "..."
6467
6514
  ] })
6468
6515
  ] }),
6469
- error && !isLoading && /* @__PURE__ */ jsxs15("div", { style: { marginTop: 10, padding: "10px 12px", background: "rgba(220,38,38,0.04)", border: "1px solid rgba(220,38,38,0.18)", borderRadius: 8, fontSize: 11, color: "#b91c1c", lineHeight: 1.5 }, children: [
6516
+ error && !isLoading && /* @__PURE__ */ jsxs16("div", { style: { marginTop: 10, padding: "10px 12px", background: "rgba(220,38,38,0.04)", border: "1px solid rgba(220,38,38,0.18)", borderRadius: 8, fontSize: 11, color: "#b91c1c", lineHeight: 1.5 }, children: [
6470
6517
  error,
6471
- /* @__PURE__ */ jsx16("button", { onClick: onCheck, style: { display: "block", marginTop: 6, padding: "4px 10px", fontSize: 11, fontWeight: 700, color: "#ffffff", background: "#dc2626", border: "none", borderRadius: 5, cursor: "pointer" }, children: "Try again" })
6518
+ /* @__PURE__ */ jsx17("button", { onClick: onCheck, style: { display: "block", marginTop: 6, padding: "4px 10px", fontSize: 11, fontWeight: 700, color: "#ffffff", background: "#dc2626", border: "none", borderRadius: 5, cursor: "pointer" }, children: "Try again" })
6472
6519
  ] })
6473
6520
  ] })
6474
6521
  ] });
@@ -6542,13 +6589,13 @@ function TechnicalTab({
6542
6589
  const bodyLinksDetailed = documentFields?.bodyLinksDetailed;
6543
6590
  const hasAnyField = !!documentFields && (documentFields.title !== void 0 || documentFields.headings && documentFields.headings.length > 0 || documentFields.imageNames && documentFields.imageNames.length > 0 || wordCount2 > 0);
6544
6591
  if (isLoading && !hasAnyField) {
6545
- return /* @__PURE__ */ jsxs15("div", { style: { padding: 24, textAlign: "center" }, children: [
6546
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6547
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6592
+ return /* @__PURE__ */ jsxs16("div", { style: { padding: 24, textAlign: "center" }, children: [
6593
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 13, color: "#4b5563", fontWeight: 500 }, children: "Reading document fields..." }),
6594
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 11, color: "#4b5563", marginTop: 4 }, children: "Audit will run once content loads" })
6548
6595
  ] });
6549
6596
  }
6550
- return /* @__PURE__ */ jsxs15("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6551
- /* @__PURE__ */ jsx16(
6597
+ return /* @__PURE__ */ jsxs16("div", { style: { padding: 12, display: "flex", flexDirection: "column", gap: 10 }, children: [
6598
+ /* @__PURE__ */ jsx17(
6552
6599
  AuditCard2,
6553
6600
  {
6554
6601
  anchorId: "anchor-url-slug",
@@ -6556,10 +6603,10 @@ function TechnicalTab({
6556
6603
  value: urlSlugAudit.value,
6557
6604
  status: urlSlugAudit.status,
6558
6605
  recommendation: urlSlugAudit.recommendation,
6559
- footer: /* @__PURE__ */ jsx16(SlugRedirectNotice, {})
6606
+ footer: /* @__PURE__ */ jsx17(SlugRedirectNotice, {})
6560
6607
  }
6561
6608
  ),
6562
- /* @__PURE__ */ jsx16(
6609
+ /* @__PURE__ */ jsx17(
6563
6610
  LinkCheckCard,
6564
6611
  {
6565
6612
  urls: bodyLinks,
@@ -6571,7 +6618,7 @@ function TechnicalTab({
6571
6618
  onCheck: onCheckLinks
6572
6619
  }
6573
6620
  ),
6574
- wordAudit && /* @__PURE__ */ jsx16(
6621
+ wordAudit && /* @__PURE__ */ jsx17(
6575
6622
  AuditCard2,
6576
6623
  {
6577
6624
  anchorId: "anchor-word-count",
@@ -6585,7 +6632,7 @@ function TechnicalTab({
6585
6632
  const structIdx = structureAudits.findIndex(
6586
6633
  (a) => a.label !== "Keywords in Headings" && a.label !== "Looks Like a Heading"
6587
6634
  );
6588
- return structureAudits.map((a, i) => /* @__PURE__ */ jsx16(
6635
+ return structureAudits.map((a, i) => /* @__PURE__ */ jsx17(
6589
6636
  AuditCard2,
6590
6637
  {
6591
6638
  anchorId: a.label === "Keywords in Headings" ? "anchor-headings-keyword" : a.label === "Looks Like a Heading" ? "anchor-headings-unstyled" : i === structIdx ? "anchor-headings-structure" : void 0,
@@ -6597,17 +6644,17 @@ function TechnicalTab({
6597
6644
  `structure-${i}`
6598
6645
  ));
6599
6646
  })(),
6600
- (headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ jsxs15("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6601
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6602
- /* @__PURE__ */ jsxs15("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6603
- documentFields?.title && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
6604
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
6647
+ (headings.length > 0 || !!documentFields?.title) && /* @__PURE__ */ jsxs16("div", { id: "anchor-headings-outline", style: { ...cardStyle6, padding: "8px 14px" }, children: [
6648
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#4b5563", textTransform: "uppercase", letterSpacing: "0.06em", fontWeight: 600, marginBottom: 6 }, children: "Heading Outline" }),
6649
+ /* @__PURE__ */ jsxs16("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
6650
+ documentFields?.title && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 11, color: MJH_BLUE, fontWeight: 700, lineHeight: 1.4 }, children: [
6651
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, fontWeight: 700, color: MJH_BLUE, marginRight: 6 }, children: "H1" }),
6605
6652
  documentFields.title,
6606
- /* @__PURE__ */ jsx16("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
6653
+ /* @__PURE__ */ jsx17("span", { style: { fontSize: 9, color: "#6b7280", fontWeight: 500, marginLeft: 6 }, children: "(article title)" })
6607
6654
  ] }),
6608
6655
  (headingsDetailed ? headingsDetailed.slice(0, 12) : headings.slice(0, 12).map((h) => ({ text: h, level: 2 }))).map((h, i) => {
6609
6656
  const isH1 = h.level === 1;
6610
- return /* @__PURE__ */ jsxs15(
6657
+ return /* @__PURE__ */ jsxs16(
6611
6658
  "div",
6612
6659
  {
6613
6660
  style: {
@@ -6619,7 +6666,7 @@ function TechnicalTab({
6619
6666
  paddingLeft: Math.max(0, (h.level - 2) * 12)
6620
6667
  },
6621
6668
  children: [
6622
- /* @__PURE__ */ jsxs15("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
6669
+ /* @__PURE__ */ jsxs16("span", { style: { fontSize: 9, fontWeight: 700, color: isH1 ? MJH_BLUE : "#4b5563", marginRight: 6 }, children: [
6623
6670
  "H",
6624
6671
  h.level
6625
6672
  ] }),
@@ -6629,15 +6676,15 @@ function TechnicalTab({
6629
6676
  i
6630
6677
  );
6631
6678
  }),
6632
- (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ jsxs15("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6679
+ (headingsDetailed ?? headings).length > 12 && /* @__PURE__ */ jsxs16("div", { style: { fontSize: 10, color: "#4b5563" }, children: [
6633
6680
  "+ ",
6634
6681
  (headingsDetailed ?? headings).length - 12,
6635
6682
  " more"
6636
6683
  ] })
6637
6684
  ] }),
6638
- /* @__PURE__ */ jsx16("div", { style: { fontSize: 10, color: "#6b7280", marginTop: 8, lineHeight: 1.4 }, children: headings.length > 0 ? "The title above is your H1; the tool scans the H2-H6 tags below it. Tip: work your primary and/or secondary keyword into a header where it reads naturally." : "The title above is your H1, and there are no H2-H6 subheadings yet. Tip: work your primary and/or secondary keyword into the title where it reads naturally." })
6685
+ /* @__PURE__ */ jsx17("div", { style: { fontSize: 10, color: "#6b7280", marginTop: 8, lineHeight: 1.4 }, children: headings.length > 0 ? "The title above is your H1; the tool scans the H2-H6 tags below it. Tip: work your primary and/or secondary keyword into a header where it reads naturally." : "The title above is your H1, and there are no H2-H6 subheadings yet. Tip: work your primary and/or secondary keyword into the title where it reads naturally." })
6639
6686
  ] }),
6640
- imagesAudit && /* @__PURE__ */ jsx16(
6687
+ imagesAudit && /* @__PURE__ */ jsx17(
6641
6688
  AuditCard2,
6642
6689
  {
6643
6690
  anchorId: "anchor-images",
@@ -6647,7 +6694,7 @@ function TechnicalTab({
6647
6694
  recommendation: imagesAudit.recommendation
6648
6695
  }
6649
6696
  ),
6650
- filenameAudit && /* @__PURE__ */ jsx16(
6697
+ filenameAudit && /* @__PURE__ */ jsx17(
6651
6698
  AuditCard2,
6652
6699
  {
6653
6700
  anchorId: "anchor-image-filenames",
@@ -6657,7 +6704,7 @@ function TechnicalTab({
6657
6704
  recommendation: filenameAudit.recommendation
6658
6705
  }
6659
6706
  ),
6660
- altTextAudit && /* @__PURE__ */ jsx16(
6707
+ altTextAudit && /* @__PURE__ */ jsx17(
6661
6708
  AuditCard2,
6662
6709
  {
6663
6710
  anchorId: "anchor-image-alt",
@@ -6667,7 +6714,7 @@ function TechnicalTab({
6667
6714
  recommendation: altTextAudit.recommendation
6668
6715
  }
6669
6716
  ),
6670
- imgTitleAudit && /* @__PURE__ */ jsx16(
6717
+ imgTitleAudit && /* @__PURE__ */ jsx17(
6671
6718
  AuditCard2,
6672
6719
  {
6673
6720
  anchorId: "anchor-image-titles",
@@ -6681,12 +6728,12 @@ function TechnicalTab({
6681
6728
  }
6682
6729
 
6683
6730
  // src/components/SEOCopilotPanel.tsx
6684
- import { Fragment as Fragment10, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
6731
+ import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
6685
6732
  function LogoIcon2() {
6686
- return /* @__PURE__ */ jsxs16("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6687
- /* @__PURE__ */ jsx17("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6688
- /* @__PURE__ */ jsx17("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6689
- /* @__PURE__ */ jsx17("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6733
+ return /* @__PURE__ */ jsxs17("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: [
6734
+ /* @__PURE__ */ jsx18("rect", { x: "1", y: "3", width: "4", height: "10", rx: "1", fill: MJH_GOLD, opacity: "1" }),
6735
+ /* @__PURE__ */ jsx18("rect", { x: "6", y: "1", width: "4", height: "14", rx: "1", fill: MJH_GOLD, opacity: "0.85" }),
6736
+ /* @__PURE__ */ jsx18("rect", { x: "11", y: "5", width: "4", height: "8", rx: "1", fill: MJH_GOLD, opacity: "0.6" })
6690
6737
  ] });
6691
6738
  }
6692
6739
  function PanelContent({
@@ -6758,8 +6805,8 @@ function PanelContent({
6758
6805
  const onboardSite = publication || "default";
6759
6806
  const onboardKey = `seo-copilot-onboarded-${onboardSite}`;
6760
6807
  const onboardSessionKey = `seo-copilot-onboard-shown-${onboardSite}`;
6761
- const [popupMode, setPopupMode] = useState17("hidden");
6762
- const [popupClosing, setPopupClosing] = useState17(false);
6808
+ const [popupMode, setPopupMode] = useState18("hidden");
6809
+ const [popupClosing, setPopupClosing] = useState18(false);
6763
6810
  const onboardTimerRef = useRef12(null);
6764
6811
  const onboardFadeRef = useRef12(null);
6765
6812
  useEffect12(() => {
@@ -6834,7 +6881,7 @@ function PanelContent({
6834
6881
  { id: "meta", label: "Meta", beta: true },
6835
6882
  { id: "technical", label: "Other Recs", beta: true, loading: technicalOps.isLinkCheckLoading }
6836
6883
  ];
6837
- return /* @__PURE__ */ jsxs16(
6884
+ return /* @__PURE__ */ jsxs17(
6838
6885
  "div",
6839
6886
  {
6840
6887
  className: "seo-copilot-panel",
@@ -6849,9 +6896,9 @@ function PanelContent({
6849
6896
  position: "relative"
6850
6897
  },
6851
6898
  children: [
6852
- /* @__PURE__ */ jsx17("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6853
- popupMode !== "hidden" && /* @__PURE__ */ jsx17(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6854
- /* @__PURE__ */ jsxs16(
6899
+ /* @__PURE__ */ jsx18("style", { dangerouslySetInnerHTML: { __html: INJECTED_CSS } }),
6900
+ popupMode !== "hidden" && /* @__PURE__ */ jsx18(OnboardingCard, { onDismiss: dismissPopup, closing: popupClosing }),
6901
+ /* @__PURE__ */ jsxs17(
6855
6902
  "div",
6856
6903
  {
6857
6904
  onMouseDown: isFloating ? onDragStart : void 0,
@@ -6869,16 +6916,16 @@ function PanelContent({
6869
6916
  flexShrink: 0
6870
6917
  },
6871
6918
  children: [
6872
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6873
- /* @__PURE__ */ jsx17(LogoIcon2, {}),
6874
- /* @__PURE__ */ jsxs16("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6875
- /* @__PURE__ */ jsx17("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6876
- /* @__PURE__ */ jsx17("span", { style: { color: MJH_SLATE }, children: " copilot" })
6919
+ /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
6920
+ /* @__PURE__ */ jsx18(LogoIcon2, {}),
6921
+ /* @__PURE__ */ jsxs17("span", { style: { fontWeight: 700, fontSize: 15, letterSpacing: "-0.01em" }, children: [
6922
+ /* @__PURE__ */ jsx18("span", { style: { color: MJH_GOLD }, children: "SEO" }),
6923
+ /* @__PURE__ */ jsx18("span", { style: { color: MJH_SLATE }, children: " copilot" })
6877
6924
  ] })
6878
6925
  ] }),
6879
- /* @__PURE__ */ jsxs16("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6880
- /* @__PURE__ */ jsx17(OnboardingInfoButton, { onClick: openPopupPersistent }),
6881
- /* @__PURE__ */ jsx17(
6926
+ /* @__PURE__ */ jsxs17("div", { style: { display: "flex", alignItems: "center", gap: isFloating ? 4 : 6 }, children: [
6927
+ /* @__PURE__ */ jsx18(OnboardingInfoButton, { onClick: openPopupPersistent }),
6928
+ /* @__PURE__ */ jsx18(
6882
6929
  ReportProblemButton,
6883
6930
  {
6884
6931
  activeTab,
@@ -6888,7 +6935,7 @@ function PanelContent({
6888
6935
  primaryKeyword: effectivePrimary
6889
6936
  }
6890
6937
  ),
6891
- isFloating && onToggleFullscreen && /* @__PURE__ */ jsx17(
6938
+ isFloating && onToggleFullscreen && /* @__PURE__ */ jsx18(
6892
6939
  "button",
6893
6940
  {
6894
6941
  onClick: (e) => {
@@ -6910,16 +6957,16 @@ function PanelContent({
6910
6957
  fontWeight: 600,
6911
6958
  transition: "all 150ms"
6912
6959
  },
6913
- children: isFullscreen ? /* @__PURE__ */ jsxs16(Fragment10, { children: [
6914
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M3.28 2.22a.75.75 0 00-1.06 1.06L5.44 6.5H3.75a.75.75 0 000 1.5h4.5A.75.75 0 009 7.25v-4.5a.75.75 0 00-1.5 0v1.69L4.28 1.22a.75.75 0 00-1 1zM16.72 17.78a.75.75 0 001.06-1.06L14.56 13.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5a.75.75 0 001.5 0v-1.69l3.22 3.22z" }) }),
6960
+ children: isFullscreen ? /* @__PURE__ */ jsxs17(Fragment10, { children: [
6961
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M3.28 2.22a.75.75 0 00-1.06 1.06L5.44 6.5H3.75a.75.75 0 000 1.5h4.5A.75.75 0 009 7.25v-4.5a.75.75 0 00-1.5 0v1.69L4.28 1.22a.75.75 0 00-1 1zM16.72 17.78a.75.75 0 001.06-1.06L14.56 13.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5a.75.75 0 001.5 0v-1.69l3.22 3.22z" }) }),
6915
6962
  "Exit fullscreen"
6916
- ] }) : /* @__PURE__ */ jsxs16(Fragment10, { children: [
6917
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M13.28 7.78l3.22-3.22v1.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h1.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25a.75.75 0 001.5 0v-1.69l3.22 3.22a.75.75 0 001.06-1.06L4.56 14.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5z" }) }),
6963
+ ] }) : /* @__PURE__ */ jsxs17(Fragment10, { children: [
6964
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M13.28 7.78l3.22-3.22v1.69a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h1.69l-3.22 3.22a.75.75 0 001.06 1.06zM2 17.25a.75.75 0 001.5 0v-1.69l3.22 3.22a.75.75 0 001.06-1.06L4.56 14.5h1.69a.75.75 0 000-1.5h-4.5a.75.75 0 00-.75.75v4.5z" }) }),
6918
6965
  "Fullscreen"
6919
6966
  ] })
6920
6967
  }
6921
6968
  ),
6922
- isFloating && onToggleFloat && /* @__PURE__ */ jsxs16(
6969
+ isFloating && onToggleFloat && /* @__PURE__ */ jsxs17(
6923
6970
  "button",
6924
6971
  {
6925
6972
  onClick: (e) => {
@@ -6942,7 +6989,7 @@ function PanelContent({
6942
6989
  transition: "all 150ms"
6943
6990
  },
6944
6991
  children: [
6945
- /* @__PURE__ */ jsx17("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17(
6992
+ /* @__PURE__ */ jsx18("svg", { width: "12", height: "12", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18(
6946
6993
  "path",
6947
6994
  {
6948
6995
  fillRule: "evenodd",
@@ -6954,7 +7001,7 @@ function PanelContent({
6954
7001
  ]
6955
7002
  }
6956
7003
  ),
6957
- !isFloating && onToggleFloat && /* @__PURE__ */ jsx17(
7004
+ !isFloating && onToggleFloat && /* @__PURE__ */ jsx18(
6958
7005
  "button",
6959
7006
  {
6960
7007
  onClick: (e) => {
@@ -6973,13 +7020,13 @@ function PanelContent({
6973
7020
  transition: "color 150ms"
6974
7021
  },
6975
7022
  title: "Pop out",
6976
- children: /* @__PURE__ */ jsxs16("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
6977
- /* @__PURE__ */ jsx17("path", { d: "M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z" }),
6978
- /* @__PURE__ */ jsx17("path", { d: "M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z" })
7023
+ children: /* @__PURE__ */ jsxs17("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: [
7024
+ /* @__PURE__ */ jsx18("path", { d: "M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z" }),
7025
+ /* @__PURE__ */ jsx18("path", { d: "M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z" })
6979
7026
  ] })
6980
7027
  }
6981
7028
  ),
6982
- isLoading && /* @__PURE__ */ jsx17(
7029
+ isLoading && /* @__PURE__ */ jsx18(
6983
7030
  "div",
6984
7031
  {
6985
7032
  style: {
@@ -6991,7 +7038,7 @@ function PanelContent({
6991
7038
  }
6992
7039
  }
6993
7040
  ),
6994
- onClose && /* @__PURE__ */ jsx17(
7041
+ onClose && /* @__PURE__ */ jsx18(
6995
7042
  "button",
6996
7043
  {
6997
7044
  onClick: (e) => {
@@ -7010,11 +7057,11 @@ function PanelContent({
7010
7057
  transition: "color 150ms"
7011
7058
  },
7012
7059
  title: "Close",
7013
- children: /* @__PURE__ */ jsx17("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx17("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
7060
+ children: /* @__PURE__ */ jsx18("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ jsx18("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) })
7014
7061
  }
7015
7062
  )
7016
7063
  ] }),
7017
- /* @__PURE__ */ jsx17(
7064
+ /* @__PURE__ */ jsx18(
7018
7065
  "div",
7019
7066
  {
7020
7067
  style: {
@@ -7033,8 +7080,8 @@ function PanelContent({
7033
7080
  ]
7034
7081
  }
7035
7082
  ),
7036
- /* @__PURE__ */ jsx17(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
7037
- /* @__PURE__ */ jsx17(
7083
+ /* @__PURE__ */ jsx18(TabBar, { tabs: tabDefs, activeTab, onTabChange: handleTabChange }),
7084
+ /* @__PURE__ */ jsx18(
7038
7085
  "div",
7039
7086
  {
7040
7087
  style: {
@@ -7050,8 +7097,8 @@ function PanelContent({
7050
7097
  children: "Recommendations are generated by AI. Verify details before publishing."
7051
7098
  }
7052
7099
  ),
7053
- /* @__PURE__ */ jsxs16("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
7054
- /* @__PURE__ */ jsxs16(
7100
+ /* @__PURE__ */ jsxs17("div", { ref: containerRef, style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
7101
+ /* @__PURE__ */ jsxs17(
7055
7102
  "div",
7056
7103
  {
7057
7104
  style: {
@@ -7062,7 +7109,7 @@ function PanelContent({
7062
7109
  background: RECS_ZONE_BG
7063
7110
  },
7064
7111
  children: [
7065
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7112
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "keywords" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7066
7113
  KeywordPanel,
7067
7114
  {
7068
7115
  text,
@@ -7074,11 +7121,12 @@ function PanelContent({
7074
7121
  onSelectSecondary,
7075
7122
  documentFields,
7076
7123
  documentId,
7077
- externalAnalysis: keywordAnalysisState
7124
+ externalAnalysis: keywordAnalysisState,
7125
+ focusKeyword: summaryOps.focusKeyword
7078
7126
  },
7079
7127
  documentId || "default"
7080
7128
  ) }),
7081
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7129
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "summary" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7082
7130
  SummaryTab,
7083
7131
  {
7084
7132
  text,
@@ -7091,10 +7139,11 @@ function PanelContent({
7091
7139
  linkCheckResults: technicalOps.linkCheckResults,
7092
7140
  isAnyLoading: summaryOps.isAnyLoading,
7093
7141
  onGenerateAll: summaryOps.onGenerateAll,
7094
- onItemClick: summaryOps.onItemClick
7142
+ onItemClick: summaryOps.onItemClick,
7143
+ onKeywordClick: summaryOps.onKeywordClick
7095
7144
  }
7096
7145
  ) }),
7097
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7146
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "aeo" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7098
7147
  AEOTab,
7099
7148
  {
7100
7149
  text,
@@ -7110,7 +7159,7 @@ function PanelContent({
7110
7159
  loadContentSuggestions: aeoOps.loadContentSuggestions
7111
7160
  }
7112
7161
  ) }),
7113
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7162
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "linking" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7114
7163
  LinkingTab,
7115
7164
  {
7116
7165
  analysis: keywordAnalysisState.analysis,
@@ -7126,8 +7175,8 @@ function PanelContent({
7126
7175
  documentType
7127
7176
  }
7128
7177
  ) }),
7129
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
7130
- /* @__PURE__ */ jsx17("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ jsx17(
7178
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "meta" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(MetaTab, { documentFields, primaryKeyword: effectivePrimary, secondaryKeyword: effectiveSecondary, isLoading: docLoading }) }),
7179
+ /* @__PURE__ */ jsx18("div", { style: { display: activeTab === "technical" ? "block" : "none" }, children: /* @__PURE__ */ jsx18(
7131
7180
  TechnicalTab,
7132
7181
  {
7133
7182
  text,
@@ -7145,7 +7194,7 @@ function PanelContent({
7145
7194
  ]
7146
7195
  }
7147
7196
  ),
7148
- chatOpen && /* @__PURE__ */ jsx17(
7197
+ chatOpen && /* @__PURE__ */ jsx18(
7149
7198
  "div",
7150
7199
  {
7151
7200
  onMouseDown,
@@ -7158,10 +7207,10 @@ function PanelContent({
7158
7207
  justifyContent: "center",
7159
7208
  flexShrink: 0
7160
7209
  },
7161
- children: /* @__PURE__ */ jsx17("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
7210
+ children: /* @__PURE__ */ jsx18("div", { style: { width: 32, height: 2, borderRadius: 1, background: "#d1d5db" } })
7162
7211
  }
7163
7212
  ),
7164
- /* @__PURE__ */ jsxs16(
7213
+ /* @__PURE__ */ jsxs17(
7165
7214
  "div",
7166
7215
  {
7167
7216
  style: {
@@ -7174,7 +7223,7 @@ function PanelContent({
7174
7223
  background: CHAT_ZONE_BG
7175
7224
  },
7176
7225
  children: [
7177
- /* @__PURE__ */ jsxs16(
7226
+ /* @__PURE__ */ jsxs17(
7178
7227
  "button",
7179
7228
  {
7180
7229
  onClick: () => onChatOpenChange(!chatOpen),
@@ -7195,7 +7244,7 @@ function PanelContent({
7195
7244
  flexShrink: 0
7196
7245
  },
7197
7246
  children: [
7198
- /* @__PURE__ */ jsx17(
7247
+ /* @__PURE__ */ jsx18(
7199
7248
  "span",
7200
7249
  {
7201
7250
  style: {
@@ -7208,7 +7257,7 @@ function PanelContent({
7208
7257
  children: "Chat"
7209
7258
  }
7210
7259
  ),
7211
- /* @__PURE__ */ jsx17(
7260
+ /* @__PURE__ */ jsx18(
7212
7261
  "svg",
7213
7262
  {
7214
7263
  width: "12",
@@ -7216,7 +7265,7 @@ function PanelContent({
7216
7265
  viewBox: "0 0 20 20",
7217
7266
  fill: "rgba(0,0,0,0.55)",
7218
7267
  style: { transform: chatOpen ? "rotate(0deg)" : "rotate(-90deg)", transition: "transform 200ms" },
7219
- children: /* @__PURE__ */ jsx17(
7268
+ children: /* @__PURE__ */ jsx18(
7220
7269
  "path",
7221
7270
  {
7222
7271
  fillRule: "evenodd",
@@ -7229,7 +7278,7 @@ function PanelContent({
7229
7278
  ]
7230
7279
  }
7231
7280
  ),
7232
- /* @__PURE__ */ jsx17(
7281
+ /* @__PURE__ */ jsx18(
7233
7282
  "div",
7234
7283
  {
7235
7284
  style: {
@@ -7239,7 +7288,7 @@ function PanelContent({
7239
7288
  flexDirection: "column",
7240
7289
  minHeight: 0
7241
7290
  },
7242
- children: /* @__PURE__ */ jsx17(
7291
+ children: /* @__PURE__ */ jsx18(
7243
7292
  ChatPanel,
7244
7293
  {
7245
7294
  messages: chatState.messages,
@@ -7292,7 +7341,7 @@ function SEOCopilotInner({ config, onClose }) {
7292
7341
  }
7293
7342
  return [];
7294
7343
  }, [seedCacheKey]);
7295
- const [seedKeywords, setSeedKeywordsRaw] = useState17(loadSeedsFromCache);
7344
+ const [seedKeywords, setSeedKeywordsRaw] = useState18(loadSeedsFromCache);
7296
7345
  const setSeedKeywords = useCallback5(
7297
7346
  (seeds) => {
7298
7347
  setSeedKeywordsRaw(seeds);
@@ -7316,7 +7365,13 @@ function SEOCopilotInner({ config, onClose }) {
7316
7365
  }
7317
7366
  setSeedKeywordsRaw(loadSeedsFromCache());
7318
7367
  }, [documentId, loadSeedsFromCache]);
7319
- const [activeTab, setActiveTab] = useState17("keywords");
7368
+ const [activeTab, setActiveTab] = useState18("keywords");
7369
+ const [focusKeyword, setFocusKeyword] = useState18(void 0);
7370
+ const [focusDoc, setFocusDoc] = useState18(documentId);
7371
+ if (focusDoc !== documentId) {
7372
+ setFocusDoc(documentId);
7373
+ setFocusKeyword(void 0);
7374
+ }
7320
7375
  const [chatOpen, setChatOpen] = usePersistentState("seo-copilot-ui-chat-open-v35", false);
7321
7376
  const [splitPercent, setSplitPercent] = usePersistentState("seo-copilot-ui-split", 70);
7322
7377
  const keywordAnalysisState = useKeywordAnalysis(text, apiUrl, effectivePublication, seedKeywords, documentFields, selectedPrimary, documentId, selectedSecondary);
@@ -7344,8 +7399,8 @@ function SEOCopilotInner({ config, onClose }) {
7344
7399
  const chatHookState = useSEOChat(apiUrl, text, effectivePublication, keywordPanelData, documentId);
7345
7400
  const contentSuggestionsKey = documentId ? `seo-copilot-content-suggestions-${documentId}` : "seo-copilot-content-suggestions-default";
7346
7401
  const [contentSuggestions, setContentSuggestions] = usePersistentState(contentSuggestionsKey, null);
7347
- const [isCSLoading, setIsCSLoading] = useState17(false);
7348
- const [csError, setCsError] = useState17(null);
7402
+ const [isCSLoading, setIsCSLoading] = useState18(false);
7403
+ const [csError, setCsError] = useState18(null);
7349
7404
  const aeoOpVersionRef = useRef12(0);
7350
7405
  const csAbortRef = useRef12(null);
7351
7406
  const didInitAeoRef = useRef12(false);
@@ -7383,9 +7438,9 @@ function SEOCopilotInner({ config, onClose }) {
7383
7438
  }, [apiUrl, text, effectivePrimary, effectivePublication]);
7384
7439
  const linkingKey = documentId ? `seo-copilot-linking-${documentId}` : "seo-copilot-linking-default";
7385
7440
  const [linkingSuggestions, setLinkingSuggestions] = usePersistentState(linkingKey, []);
7386
- const [isLinkingLoading, setIsLinkingLoading] = useState17(false);
7387
- const [linkingError, setLinkingError] = useState17(null);
7388
- const [linkingFetchedText, setLinkingFetchedText] = useState17("");
7441
+ const [isLinkingLoading, setIsLinkingLoading] = useState18(false);
7442
+ const [linkingError, setLinkingError] = useState18(null);
7443
+ const [linkingFetchedText, setLinkingFetchedText] = useState18("");
7389
7444
  const linkingVersionRef = useRef12(0);
7390
7445
  const linkingAbortRef = useRef12(null);
7391
7446
  const didInitLinkingRef = useRef12(false);
@@ -7454,8 +7509,8 @@ function SEOCopilotInner({ config, onClose }) {
7454
7509
  const linkCheckKey = documentId ? `seo-copilot-link-check-${documentId}` : "seo-copilot-link-check-default";
7455
7510
  const [linkCheckResults, setLinkCheckResults] = usePersistentState(linkCheckKey, []);
7456
7511
  const [hasRunLinkCheck, setHasRunLinkCheck] = usePersistentState(`${linkCheckKey}-ran`, false);
7457
- const [isLinkCheckLoading, setIsLinkCheckLoading] = useState17(false);
7458
- const [linkCheckError, setLinkCheckError] = useState17(null);
7512
+ const [isLinkCheckLoading, setIsLinkCheckLoading] = useState18(false);
7513
+ const [linkCheckError, setLinkCheckError] = useState18(null);
7459
7514
  const linkCheckVersionRef = useRef12(0);
7460
7515
  const didInitLinkCheckRef = useRef12(false);
7461
7516
  useEffect12(() => {
@@ -7585,7 +7640,7 @@ function SEOCopilotInner({ config, onClose }) {
7585
7640
  },
7586
7641
  [floatSize]
7587
7642
  );
7588
- const panelContent = /* @__PURE__ */ jsx17(
7643
+ const panelContent = /* @__PURE__ */ jsx18(
7589
7644
  PanelContent,
7590
7645
  {
7591
7646
  initialPublication: effectivePublication,
@@ -7652,6 +7707,11 @@ function SEOCopilotInner({ config, onClose }) {
7652
7707
  summaryOps: {
7653
7708
  isAnyLoading: keywordAnalysisState.isLoading || keywordAnalysisState.isVolumesLoading || keywordAnalysisState.isDeepLoading || isCSLoading || isLinkingLoading || isLinkCheckLoading,
7654
7709
  onGenerateAll: runAllAnalyses,
7710
+ focusKeyword,
7711
+ onKeywordClick: (term) => {
7712
+ setActiveTab("keywords");
7713
+ setFocusKeyword((prev) => ({ term, nonce: (prev?.nonce ?? 0) + 1 }));
7714
+ },
7655
7715
  onItemClick: (item) => {
7656
7716
  setActiveTab(item.jumpTo.tab);
7657
7717
  const id = item.jumpTo.anchorId;
@@ -7667,7 +7727,7 @@ function SEOCopilotInner({ config, onClose }) {
7667
7727
  }
7668
7728
  }
7669
7729
  );
7670
- const floatingPanel = /* @__PURE__ */ jsxs16(
7730
+ const floatingPanel = /* @__PURE__ */ jsxs17(
7671
7731
  "div",
7672
7732
  {
7673
7733
  style: {
@@ -7685,7 +7745,7 @@ function SEOCopilotInner({ config, onClose }) {
7685
7745
  },
7686
7746
  children: [
7687
7747
  panelContent,
7688
- !isFullscreen && /* @__PURE__ */ jsx17(
7748
+ !isFullscreen && /* @__PURE__ */ jsx18(
7689
7749
  "div",
7690
7750
  {
7691
7751
  onMouseDown: handleResizeStart,
@@ -7700,9 +7760,9 @@ function SEOCopilotInner({ config, onClose }) {
7700
7760
  alignItems: "center",
7701
7761
  justifyContent: "center"
7702
7762
  },
7703
- children: /* @__PURE__ */ jsxs16("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7704
- /* @__PURE__ */ jsx17("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7705
- /* @__PURE__ */ jsx17("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7763
+ children: /* @__PURE__ */ jsxs17("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "#9ca3af", children: [
7764
+ /* @__PURE__ */ jsx18("path", { d: "M9 1v8H1", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" }),
7765
+ /* @__PURE__ */ jsx18("path", { d: "M9 5v4H5", fill: "none", stroke: "#9ca3af", strokeWidth: "1.5", strokeLinecap: "round" })
7706
7766
  ] })
7707
7767
  }
7708
7768
  )
@@ -7710,8 +7770,8 @@ function SEOCopilotInner({ config, onClose }) {
7710
7770
  }
7711
7771
  );
7712
7772
  if (isFloating) {
7713
- return /* @__PURE__ */ jsxs16(Fragment10, { children: [
7714
- /* @__PURE__ */ jsx17(
7773
+ return /* @__PURE__ */ jsxs17(Fragment10, { children: [
7774
+ /* @__PURE__ */ jsx18(
7715
7775
  "div",
7716
7776
  {
7717
7777
  style: {
@@ -7721,30 +7781,30 @@ function SEOCopilotInner({ config, onClose }) {
7721
7781
  alignItems: "center",
7722
7782
  justifyContent: "center"
7723
7783
  },
7724
- children: /* @__PURE__ */ jsx17("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7784
+ children: /* @__PURE__ */ jsx18("span", { style: { fontSize: 12, color: "rgba(0,0,0,0.5)" }, children: "SEO Copilot is floating" })
7725
7785
  }
7726
7786
  ),
7727
7787
  typeof document !== "undefined" && createPortal(floatingPanel, document.body)
7728
7788
  ] });
7729
7789
  }
7730
- return /* @__PURE__ */ jsx17("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7790
+ return /* @__PURE__ */ jsx18("div", { style: { height: "100%", background: PANEL_BG, position: "relative", zIndex: 1 }, children: panelContent });
7731
7791
  }
7732
7792
  function SEOCopilotPanel({ config, onClose }) {
7733
- return /* @__PURE__ */ jsx17(
7793
+ return /* @__PURE__ */ jsx18(
7734
7794
  Suspense,
7735
7795
  {
7736
- fallback: /* @__PURE__ */ jsxs16("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7737
- /* @__PURE__ */ jsx17(LoadingBars, {}),
7738
- /* @__PURE__ */ jsx17("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7796
+ fallback: /* @__PURE__ */ jsxs17("div", { style: { padding: 16, display: "flex", alignItems: "center", gap: 12 }, children: [
7797
+ /* @__PURE__ */ jsx18(LoadingBars, {}),
7798
+ /* @__PURE__ */ jsx18("span", { style: { fontSize: 12, color: "#4b5563" }, children: "Loading SEO Copilot..." })
7739
7799
  ] }),
7740
- children: /* @__PURE__ */ jsx17(ConfigProvider, { config, children: /* @__PURE__ */ jsx17(SEOCopilotInner, { config, onClose }) })
7800
+ children: /* @__PURE__ */ jsx18(ConfigProvider, { config, children: /* @__PURE__ */ jsx18(SEOCopilotInner, { config, onClose }) })
7741
7801
  }
7742
7802
  );
7743
7803
  }
7744
7804
  function LoadingBars({ size = "sm", color = MJH_GOLD }) {
7745
7805
  const barWidth = size === "xs" ? 4 : 6;
7746
7806
  const containerHeight = size === "xs" ? 10 : 14;
7747
- return /* @__PURE__ */ jsx17("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx17(
7807
+ return /* @__PURE__ */ jsx18("div", { style: { display: "inline-flex", alignItems: "flex-end", gap: 2, height: containerHeight }, children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx18(
7748
7808
  "div",
7749
7809
  {
7750
7810
  style: {
@@ -7805,9 +7865,9 @@ function seoCopilotInspector(config) {
7805
7865
  icon: SEOIcon,
7806
7866
  // Toolbar placement test: showAsAction renders this as a button in the document
7807
7867
  // toolbar (where editors expect it). The original crash came from passing
7808
- // showAsAction WITHOUT a tone; pairing it with a valid string tone is how Sanity's
7868
+ // showAsAction without a tone; pairing it with a valid string tone is how Sanity's
7809
7869
  // own built-in inspectors (Validation, etc.) keep their toolbar button safely.
7810
- // If this still crashes in Nick's studio, remove these two lines to fall back to
7870
+ // If this still crashes in the production Studio, remove these two lines to fall back to
7811
7871
  // the "..." overflow menu (the known-safe placement).
7812
7872
  showAsAction: true,
7813
7873
  tone: "default"
@@ -7832,4 +7892,3 @@ var seoCopilot = definePlugin((config) => {
7832
7892
  export {
7833
7893
  seoCopilot
7834
7894
  };
7835
- //# sourceMappingURL=index.mjs.map