@canonry/canonry 7.88.0 → 7.90.0

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 (154) hide show
  1. package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +16 -4
  2. package/assets/assets/{AgentSetupPage-DV06oPTd.js → AgentSetupPage-oSoM5flN.js} +6 -6
  3. package/assets/assets/AuditHistoryPanel-YrEggsyA.js +1 -0
  4. package/assets/assets/{BacklinksPage-Dw0wgYlg.js → BacklinksPage-vXUxxplH.js} +1 -1
  5. package/assets/assets/{ChartPrimitives-4D5wgAn5.js → ChartPrimitives-Cs2iavxU.js} +1 -1
  6. package/assets/assets/{Hint-CfeZmZig.js → Hint-uoVNfr0U.js} +1 -1
  7. package/assets/assets/{HistoryPage-DsDx15am.js → HistoryPage-VJ_JQ7R3.js} +1 -1
  8. package/assets/assets/{InfoTooltip-DrBIPuSU.js → InfoTooltip-CNLlIWeP.js} +1 -1
  9. package/assets/assets/MeasurementPropertyPage-BZKiS1V0.js +4 -0
  10. package/assets/assets/ProjectPage-p-rDlzSq.js +11 -0
  11. package/assets/assets/{RunsPage-BggqKbOG.js → RunsPage-CjkPCc9Z.js} +1 -1
  12. package/assets/assets/{SettingsPage-B7ns_ECx.js → SettingsPage-BNHMlx6C.js} +1 -1
  13. package/assets/assets/SiteHealthSection-BZhulwSy.js +2 -0
  14. package/assets/assets/{ToneBadge-B8hKcr8p.js → ToneBadge-B3rD6bDF.js} +6 -6
  15. package/assets/assets/TrafficPage-Dr8NTQpA.js +40 -0
  16. package/assets/assets/TrafficSourceDetailPage-C79eQilP.js +1 -0
  17. package/assets/assets/{account-context-pzV-boTi.js → account-context-GstYbqpX.js} +1 -1
  18. package/assets/assets/agent-trust-copy-Ca4ys8J2.js +1 -0
  19. package/assets/assets/{card-Mu_5i5fM.js → card-CgdGerYK.js} +1 -1
  20. package/assets/assets/{format-helpers-C8QYorwm.js → format-helpers-ByAY4dv0.js} +2 -2
  21. package/assets/assets/{index-BOUrrC9J.css → index-Bhpq6fUo.css} +1 -1
  22. package/assets/assets/index-BrHemYsG.js +60 -0
  23. package/assets/assets/query-client-DjRrRIsq.js +1 -0
  24. package/assets/assets/react-query-B8JD_K7g.js +1 -0
  25. package/assets/assets/{react-sigma_core.esm.min-BfnfPCis.js → react-sigma_core.esm.min-OHqBWE8n.js} +1 -1
  26. package/assets/assets/server-traffic-Bt9bexaP.js +1 -0
  27. package/assets/assets/{service-B85wjZQP.js → service-SgtD5EOS.js} +1 -1
  28. package/assets/assets/{vendor-lucide-CoTHJwai.js → vendor-lucide-Bo69m9KC.js} +1 -1
  29. package/assets/assets/{vendor-markdown-cQgSk2i0.js → vendor-markdown-BiRP51B0.js} +1 -1
  30. package/assets/assets/{vendor-radix-wS8sWIWE.js → vendor-radix-PQeN8gOe.js} +1 -1
  31. package/assets/assets/{vendor-recharts-AnNqECZW.js → vendor-recharts-CY6tH-r6.js} +1 -1
  32. package/assets/assets/{vendor-tanstack-q5SvZtcv.js → vendor-tanstack-tBjrfzKu.js} +1 -1
  33. package/assets/index.html +15 -15
  34. package/dist/{ads-4TAIMWZC.js → ads-6BAITIBY.js} +3 -3
  35. package/dist/{agent-C7NKP2TO.js → agent-BE3D65U4.js} +7 -7
  36. package/dist/{agent-ask-EPH5FDM6.js → agent-ask-TT6BAV2T.js} +3 -3
  37. package/dist/{agent-conversations-LPBBVRKK.js → agent-conversations-GJDAWU36.js} +3 -3
  38. package/dist/{agent-journeys-MBORINJA.js → agent-journeys-UEL27GNY.js} +3 -3
  39. package/dist/{agent-memory-NJIZO75R.js → agent-memory-PB74OP46.js} +3 -3
  40. package/dist/{agent-providers-ZQVUOCX6.js → agent-providers-5WFMNRRK.js} +3 -3
  41. package/dist/{agent-transcript-67HFY5GT.js → agent-transcript-IAGB3JXG.js} +3 -3
  42. package/dist/{analytics-TUO6BVB6.js → analytics-5BVE7KUN.js} +3 -3
  43. package/dist/{apply-V7A5O7YS.js → apply-YJJWQ4JX.js} +3 -3
  44. package/dist/{backfill-PGKYR6NA.js → backfill-6OLGZIEV.js} +10 -10
  45. package/dist/{backlinks-5GGPQNR4.js → backlinks-4JK26OIO.js} +3 -3
  46. package/dist/{bing-PQOLIW2X.js → bing-NZYYPB2M.js} +43 -8
  47. package/dist/{bootstrap-IH3XX6PI.js → bootstrap-6KHK63W3.js} +10 -10
  48. package/dist/{cdp-B3PFQ5RB.js → cdp-PTXWVX6T.js} +7 -7
  49. package/dist/{chunk-EL4HRIID.js → chunk-2UULABPI.js} +7 -3
  50. package/dist/{chunk-PZLEKWYA.js → chunk-7ASKZHS4.js} +1 -1
  51. package/dist/{chunk-R7K24KY7.js → chunk-7VJJXLRP.js} +3 -3
  52. package/dist/{chunk-4A4X7VXE.js → chunk-AFYKUX2X.js} +2 -2
  53. package/dist/{chunk-EYSQMZ6L.js → chunk-C2XWWIJZ.js} +413 -376
  54. package/dist/{chunk-2KL2XHS6.js → chunk-DF4B6OGX.js} +4 -4
  55. package/dist/{chunk-OKLDBQYW.js → chunk-DZO6CATO.js} +4 -4
  56. package/dist/{chunk-Q2SJRZA3.js → chunk-ETIIPSWL.js} +117 -6
  57. package/dist/{chunk-5WWEZ26Y.js → chunk-F442MSX2.js} +2 -2
  58. package/dist/{chunk-EGUJNHAZ.js → chunk-F6WNKKGG.js} +33 -7
  59. package/dist/{chunk-TL52ELES.js → chunk-GKX5F7NX.js} +1 -1
  60. package/dist/{chunk-LBZYPZAA.js → chunk-HUQDD26S.js} +7 -7
  61. package/dist/{chunk-N6AWKBLY.js → chunk-I7DAEE3L.js} +5 -5
  62. package/dist/{chunk-FNQFM3TK.js → chunk-L2MDMZFT.js} +3 -3
  63. package/dist/{chunk-DILCH7RL.js → chunk-LQWMNDZR.js} +1 -1
  64. package/dist/{chunk-FLJVGHTQ.js → chunk-LTZNUDSI.js} +3 -3
  65. package/dist/{chunk-PBOIN52J.js → chunk-N7LRPMWR.js} +2 -2
  66. package/dist/{chunk-E4DUE2PW.js → chunk-NKGQCCUS.js} +6 -6
  67. package/dist/{chunk-IR3MYKIA.js → chunk-NPX5SL54.js} +1 -1
  68. package/dist/{chunk-5KDJJO2N.js → chunk-OOVWMWMT.js} +1 -1
  69. package/dist/{chunk-DVWAA3ES.js → chunk-OVUFIG22.js} +89 -21
  70. package/dist/{chunk-FL76YWYN.js → chunk-PID3C4B7.js} +1 -1
  71. package/dist/{chunk-D354CQ6T.js → chunk-Q6EZEVXE.js} +1 -1
  72. package/dist/{chunk-UVXQQZB5.js → chunk-QLVTMPFW.js} +2 -2
  73. package/dist/{chunk-4T2VZPDG.js → chunk-QWNDNZJ3.js} +2 -2
  74. package/dist/{chunk-4VMHN5LL.js → chunk-SDXMG4VX.js} +1159 -899
  75. package/dist/{chunk-CYQCO5NY.js → chunk-TA4L7U2M.js} +1 -1
  76. package/dist/{chunk-MCQK432C.js → chunk-UG7TZJIG.js} +1 -1
  77. package/dist/{chunk-ZQGWB7VJ.js → chunk-USHY3SH6.js} +62 -1
  78. package/dist/{chunk-O7OZVZWR.js → chunk-WNDBACO7.js} +43 -13
  79. package/dist/{chunk-MEN27RAJ.js → chunk-WYMBWCG5.js} +3 -1
  80. package/dist/{chunk-BDLC3DFM.js → chunk-XCEA5OMI.js} +2 -2
  81. package/dist/{chunk-6DIDDYG6.js → chunk-YB2GAK32.js} +5 -5
  82. package/dist/{chunk-TAQHHXBC.js → chunk-YPJCZD5H.js} +4 -4
  83. package/dist/{chunk-IPOYH4WE.js → chunk-ZV6PMFF4.js} +1 -1
  84. package/dist/{citations-J3IGPX4L.js → citations-WX4VO6ZI.js} +3 -3
  85. package/dist/{cli-catalog-2PCRGKPH.js → cli-catalog-BTRNR2UP.js} +3 -3
  86. package/dist/{cli-commands-4MUJZCZO.js → cli-commands-5ISZA43S.js} +7 -7
  87. package/dist/cli.js +13 -13
  88. package/dist/{competitor-X7Q2AZGL.js → competitor-HZRZWCEN.js} +3 -3
  89. package/dist/{content-HTR3PJPX.js → content-NOZDHI3M.js} +3 -3
  90. package/dist/{dashboard-LSO57ZEE.js → dashboard-TZLWHXP4.js} +6 -6
  91. package/dist/{demo-P25N4SKK.js → demo-2PYBQD47.js} +1 -1
  92. package/dist/{demo-server-6Z5XSHFS.js → demo-server-JEQNGMMV.js} +12 -12
  93. package/dist/{discover-KE6TQPOC.js → discover-A2XFXHOC.js} +3 -3
  94. package/dist/{discover-eval-XKOYGCRW.js → discover-eval-A6SBUYXF.js} +3 -3
  95. package/dist/{doctor-RL2J54I3.js → doctor-GZACELPF.js} +3 -3
  96. package/dist/{evidence-CYJ4AKUZ.js → evidence-RVFMUWIL.js} +3 -3
  97. package/dist/{export-cmd-2YM3PXCW.js → export-cmd-X2TFZGNJ.js} +3 -3
  98. package/dist/{ga-XAB66MJO.js → ga-TOT3V67A.js} +3 -3
  99. package/dist/{gbp-CDGBLRVV.js → gbp-KP4YZU6S.js} +3 -3
  100. package/dist/{google-XHCUKQ3J.js → google-GCFSTV5N.js} +4 -4
  101. package/dist/{google-marketing-ZR6NTWEY.js → google-marketing-ANS65KQN.js} +1 -1
  102. package/dist/{health-cmd-VS3EIFJD.js → health-cmd-UKMNLU6D.js} +3 -3
  103. package/dist/{history-YIGYYNZJ.js → history-TWGYSAZZ.js} +3 -3
  104. package/dist/index.d.ts +402 -44
  105. package/dist/index.js +25 -25
  106. package/dist/{init-ST3BXHQF.js → init-K4623VOY.js} +12 -12
  107. package/dist/{insights-KZS6TYYL.js → insights-7IOC7WIR.js} +3 -3
  108. package/dist/intelligence-service-42Q3OVI5.js +16 -0
  109. package/dist/{journeys-USOPWGW5.js → journeys-NWKT45PT.js} +3 -3
  110. package/dist/{keys-XY7LSM3S.js → keys-ZZYZUHUK.js} +3 -3
  111. package/dist/{keyword-PKBFHHF5.js → keyword-F6EIX5KM.js} +3 -3
  112. package/dist/{logs-PROW5TQJ.js → logs-B45FXS6E.js} +3 -3
  113. package/dist/{mcp-OQGC62QU.js → mcp-WPNCNWA5.js} +4 -4
  114. package/dist/mcp.js +9 -9
  115. package/dist/{measurement-plan-AI4NNBTO.js → measurement-plan-QT5HJ3KC.js} +5 -5
  116. package/dist/{notify-6HRPNJZ5.js → notify-Z3LIF3SO.js} +3 -3
  117. package/dist/{organic-evidence-IXCSUGGY.js → organic-evidence-R5TM7XUB.js} +3 -3
  118. package/dist/{overview-2WS3CFHK.js → overview-6TZHJLQN.js} +4 -4
  119. package/dist/{project-ENUZG62V.js → project-VMPVOQ2A.js} +3 -3
  120. package/dist/{query-WE3ZWTIB.js → query-EXSH5QP7.js} +3 -3
  121. package/dist/{research-DZSD5UZ2.js → research-6R6BEL4X.js} +3 -3
  122. package/dist/{results-export-JMUMYNUE.js → results-export-ZJRL3ECU.js} +3 -3
  123. package/dist/{run-QXOO7CRK.js → run-C4VXAJE3.js} +4 -4
  124. package/dist/{schedule-3RJKGUDN.js → schedule-KC6ETWMO.js} +3 -3
  125. package/dist/{search-SGS4H7I4.js → search-SUR6BEQD.js} +3 -3
  126. package/dist/{serve-T24QKEUY.js → serve-TVODHNFU.js} +26 -26
  127. package/dist/{session-HPH2A4AZ.js → session-D42KUKCZ.js} +13 -13
  128. package/dist/{settings-K44RK2TW.js → settings-LTCG3D5B.js} +3 -3
  129. package/dist/sitemaps-YMTZLF5S.js +46 -0
  130. package/dist/{skills-HGPPGBXG.js → skills-THMG3L64.js} +2 -2
  131. package/dist/{snapshot-FEHHQRY3.js → snapshot-ZEVB3EE4.js} +3 -3
  132. package/dist/{src-4PAYI7GE.js → src-HPVSTXVF.js} +6 -2
  133. package/dist/{status-L5HVFWTS.js → status-LPCPTWKO.js} +4 -4
  134. package/dist/{technical-aeo-Z43UCW6E.js → technical-aeo-J6LNT45B.js} +3 -3
  135. package/dist/{telemetry-D47SSSG7.js → telemetry-BPY34GDV.js} +4 -4
  136. package/dist/{tools-WCWUY2ZJ.js → tools-K3G43ESI.js} +11 -11
  137. package/dist/{traffic-5KH62P43.js → traffic-BOIFAPAR.js} +5 -5
  138. package/dist/{trends-RMAXZKRO.js → trends-A2MDRSQQ.js} +3 -3
  139. package/dist/{users-WT54XNEI.js → users-VJOQODJK.js} +3 -3
  140. package/dist/{visibility-stats-HU62U5MA.js → visibility-stats-YNMJYASA.js} +3 -3
  141. package/dist/{wordpress-BDAKQ4MU.js → wordpress-BWG6D7VH.js} +3 -3
  142. package/package.json +1 -1
  143. package/assets/assets/AuditHistoryPanel-C1JnxBFK.js +0 -1
  144. package/assets/assets/MeasurementPropertyPage-Bkxt3QcY.js +0 -4
  145. package/assets/assets/ProjectPage-CzrD1lpf.js +0 -11
  146. package/assets/assets/SiteHealthSection-B2YibqCs.js +0 -2
  147. package/assets/assets/TrafficPage-DRTbgzKI.js +0 -40
  148. package/assets/assets/TrafficSourceDetailPage-sgLE2gdJ.js +0 -1
  149. package/assets/assets/agent-trust-copy-DBtiOpFu.js +0 -1
  150. package/assets/assets/extract-error-message-D_ptq0tW.js +0 -1
  151. package/assets/assets/index-fN5qDR8H.js +0 -60
  152. package/assets/assets/query-client-CdG4DC3B.js +0 -1
  153. package/assets/assets/react-query-CxeygwoL.js +0 -1
  154. package/dist/intelligence-service-LCTP5BC7.js +0 -16
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{st as t}from"./vendor-lucide-CoTHJwai.js";import{r as n}from"./vendor-markdown-cQgSk2i0.js";import{b as r,d as i,f as a}from"./vendor-tanstack-q5SvZtcv.js";import{Ct as o,Di as s,Ei as c,mt as l,r as u,wt as d}from"./ToneBadge-B8hKcr8p.js";import{y as f}from"./format-helpers-C8QYorwm.js";import{a as p}from"./query-client-CdG4DC3B.js";import{in as m,sn as h}from"./react-query-CxeygwoL.js";import{t as g}from"./card-Mu_5i5fM.js";import{E as _,it as v,mt as y,rt as b,v as x}from"./index-fN5qDR8H.js";var S=e(t(),1),C=n();function w({run:e,projectSlug:t}){return(0,C.jsxs)(`article`,{className:`run-row`,children:[(0,C.jsxs)(`div`,{className:`run-row-main`,children:[(0,C.jsxs)(`div`,{className:`run-row-head`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`run-row-title`,children:e.summary}),(0,C.jsxs)(`p`,{className:`run-row-subtitle`,children:[e.projectName,e.location?` · ${e.location}`:``,` · `,e.kindLabel]})]}),(0,C.jsx)(y,{status:e.status})]}),(0,C.jsx)(`p`,{className:`run-row-detail`,children:e.statusDetail})]}),(0,C.jsxs)(`dl`,{className:`run-row-meta`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Started`}),(0,C.jsx)(`dd`,{children:e.startedAt})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Duration`}),(0,C.jsx)(`dd`,{children:e.duration})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Trigger`}),(0,C.jsx)(`dd`,{children:e.triggerLabel})]})]}),(0,C.jsx)(u,{variant:`outline`,size:`sm`,asChild:!0,children:(0,C.jsx)(_,{run:e,projectName:t,children:e.opensSeoWorkspace?`View refresh`:`View run`})})]})}var T={"30d":{label:`Last 30 days`,days:30},"90d":{label:`Last 90 days`,days:90},"365d":{label:`Last year`,days:365}};function E(e){return new Date(Date.now()-T[e].days*24*60*60*1e3).toISOString()}function D(){let e=b()?.dashboard,t=a({strict:!1}),n=i(),_=Object.values(s).includes(t.runStatus)?t.runStatus:`all`,y=Object.values(c).includes(t.runKind)?t.runKind:`all`,D=t.runProject??`all`,O=Object.hasOwn(T,t.runWindow??``)?t.runWindow:`30d`,k=t.runQuery??``,A=(0,S.useMemo)(()=>E(O),[O]),j=r({...m({client:l}),initialData:e?.projects.map(({project:e})=>e),initialDataUpdatedAt:0}),M=r({...h({client:l,query:{limit:1e3,since:A}}),initialData:e?.runs,initialDataUpdatedAt:0,staleTime:p,refetchInterval:e=>e.state.data?.some(e=>e.status===`queued`||e.status===`running`)?3e3:p}),N=x(),P=(0,S.useMemo)(()=>new Map((j.data??[]).map(e=>[e.id,e.displayName||e.name])),[j.data]),F=(0,S.useMemo)(()=>(M.data??[]).map(e=>`projectName`in e?e:v(e,P.get(e.projectId)??`Unknown project`)),[P,M.data]),I=k.trim().toLowerCase(),L=F.filter(e=>_!==`all`&&e.status!==_||y!==`all`&&e.kind!==y||D!==`all`&&e.projectId!==D?!1:!I||[e.summary,e.projectName,e.kindLabel,e.statusDetail].some(e=>e.toLowerCase().includes(I))),R=_!==`all`||y!==`all`||D!==`all`||k.trim()!==``||O!==`30d`,z=e=>{n({to:`/runs`,search:t=>({...t,...e}),replace:!0})};if(j.isLoading||M.isLoading)return(0,C.jsxs)(`div`,{className:`page-skeleton`,children:[(0,C.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,C.jsx)(`div`,{className:`skeleton-text h-6 w-20`}),(0,C.jsx)(`div`,{className:`skeleton-text-sm w-72`})]}),(0,C.jsx)(`div`,{className:`space-y-2`,children:[1,2,3,4].map(e=>(0,C.jsxs)(`div`,{className:`material-base p-3 flex items-center gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,C.jsx)(`div`,{className:`skeleton-text w-40`}),(0,C.jsx)(`div`,{className:`skeleton-text-sm w-56`})]}),(0,C.jsx)(`div`,{className:`skeleton h-5 w-16 rounded-full`})]},e))})]});let B=async()=>{try{await N.mutateAsync(void 0)}catch{}};return(0,C.jsxs)(`div`,{className:`page-container`,children:[(0,C.jsxs)(`div`,{className:`page-header`,children:[(0,C.jsxs)(`div`,{className:`page-header-left`,children:[(0,C.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,C.jsx)(`p`,{className:`page-subtitle`,children:`Recent jobs across all projects.`})]}),!d()&&(o()?(0,C.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`AI Visibility checks are run by your Canonry team`}):(0,C.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,disabled:N.isPending,onClick:()=>void B(),children:N.isPending?`Queueing…`:`Run all projects`}))]}),(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`div`,{className:`filter-row`,role:`toolbar`,"aria-label":`Run filters`,children:[`all`,`queued`,`running`,`completed`,`partial`,`failed`,`cancelled`].map(e=>(0,C.jsx)(`button`,{className:`filter-chip ${_===e?`filter-chip-active`:``}`,type:`button`,"aria-pressed":_===e,onClick:()=>z({runStatus:e===`all`?void 0:e}),children:e===`all`?`All runs`:f(e)},e))}),(0,C.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-[minmax(12rem,1fr)_minmax(10rem,0.7fr)_minmax(9rem,0.6fr)_minmax(9rem,0.6fr)_auto]`,children:[(0,C.jsx)(`input`,{type:`search`,"aria-label":`Search runs`,value:k,onChange:e=>z({runQuery:e.target.value||void 0}),placeholder:`Search runs or projects`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,C.jsxs)(`select`,{"aria-label":`Filter runs by project`,value:D,onChange:e=>z({runProject:e.target.value===`all`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,C.jsx)(`option`,{value:`all`,children:`All projects`}),(j.data??[]).map(e=>(0,C.jsx)(`option`,{value:e.id,children:e.displayName||e.name},e.id))]}),(0,C.jsxs)(`select`,{"aria-label":`Filter runs by type`,value:y,onChange:e=>z({runKind:e.target.value===`all`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,C.jsx)(`option`,{value:`all`,children:`All run types`}),Object.values(c).map(e=>(0,C.jsx)(`option`,{value:e,children:f(e.replaceAll(`-`,` `))},e))]}),(0,C.jsx)(`select`,{"aria-label":`Filter runs by date range`,value:O,onChange:e=>z({runWindow:e.target.value===`30d`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:Object.entries(T).map(([e,t])=>(0,C.jsx)(`option`,{value:e,children:t.label},e))}),R?(0,C.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>z({runStatus:void 0,runKind:void 0,runProject:void 0,runWindow:void 0,runQuery:void 0}),children:`Clear`}):(0,C.jsx)(`span`,{})]}),M.isError?(0,C.jsxs)(g,{className:`surface-card empty-card`,children:[(0,C.jsx)(`h2`,{children:`Run history unavailable`}),(0,C.jsx)(`p`,{children:M.error instanceof Error?M.error.message:`Could not load run history.`})]}):null,(0,C.jsx)(`div`,{className:`run-list`,children:!M.isError&&L.length>0?L.map(e=>(0,C.jsx)(w,{run:e,projectSlug:j.data?.find(t=>t.id===e.projectId)?.name},e.id)):M.isError?null:(0,C.jsxs)(g,{className:`surface-card empty-card`,children:[(0,C.jsx)(`h2`,{children:`No runs match this filter`}),(0,C.jsx)(`p`,{children:`Change the project, type, status, or date range to widen the history.`})]})})]})]})}export{D as RunsPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ct as t}from"./vendor-lucide-Bo69m9KC.js";import{r as n}from"./vendor-markdown-BiRP51B0.js";import{b as r,d as i,f as a}from"./vendor-tanstack-tBjrfzKu.js";import{Ct as o,Di as s,Oi as c,mt as l,r as u,wt as d}from"./ToneBadge-B3rD6bDF.js";import{v as f}from"./format-helpers-ByAY4dv0.js";import{a as p}from"./query-client-DjRrRIsq.js";import{fn as m,hn as h}from"./react-query-B8JD_K7g.js";import{t as g}from"./card-CgdGerYK.js";import{E as _,it as v,mt as y,rt as b,v as x}from"./index-BrHemYsG.js";var S=e(t(),1),C=n();function w({run:e,projectSlug:t}){return(0,C.jsxs)(`article`,{className:`run-row`,children:[(0,C.jsxs)(`div`,{className:`run-row-main`,children:[(0,C.jsxs)(`div`,{className:`run-row-head`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`run-row-title`,children:e.summary}),(0,C.jsxs)(`p`,{className:`run-row-subtitle`,children:[e.projectName,e.location?` · ${e.location}`:``,` · `,e.kindLabel]})]}),(0,C.jsx)(y,{status:e.status})]}),(0,C.jsx)(`p`,{className:`run-row-detail`,children:e.statusDetail})]}),(0,C.jsxs)(`dl`,{className:`run-row-meta`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Started`}),(0,C.jsx)(`dd`,{children:e.startedAt})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Duration`}),(0,C.jsx)(`dd`,{children:e.duration})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:`Trigger`}),(0,C.jsx)(`dd`,{children:e.triggerLabel})]})]}),(0,C.jsx)(u,{variant:`outline`,size:`sm`,asChild:!0,children:(0,C.jsx)(_,{run:e,projectName:t,children:e.opensSeoWorkspace?`View refresh`:`View run`})})]})}var T={"30d":{label:`Last 30 days`,days:30},"90d":{label:`Last 90 days`,days:90},"365d":{label:`Last year`,days:365}};function E(e){return new Date(Date.now()-T[e].days*24*60*60*1e3).toISOString()}function D(){let e=b()?.dashboard,t=a({strict:!1}),n=i(),_=Object.values(c).includes(t.runStatus)?t.runStatus:`all`,y=Object.values(s).includes(t.runKind)?t.runKind:`all`,D=t.runProject??`all`,O=Object.hasOwn(T,t.runWindow??``)?t.runWindow:`30d`,k=t.runQuery??``,A=(0,S.useMemo)(()=>E(O),[O]),j=r({...m({client:l}),initialData:e?.projects.map(({project:e})=>e),initialDataUpdatedAt:0}),M=r({...h({client:l,query:{limit:1e3,since:A}}),initialData:e?.runs,initialDataUpdatedAt:0,staleTime:p,refetchInterval:e=>e.state.data?.some(e=>e.status===`queued`||e.status===`running`)?3e3:p}),N=x(),P=(0,S.useMemo)(()=>new Map((j.data??[]).map(e=>[e.id,e.displayName||e.name])),[j.data]),F=(0,S.useMemo)(()=>(M.data??[]).map(e=>`projectName`in e?e:v(e,P.get(e.projectId)??`Unknown project`)),[P,M.data]),I=k.trim().toLowerCase(),L=F.filter(e=>_!==`all`&&e.status!==_||y!==`all`&&e.kind!==y||D!==`all`&&e.projectId!==D?!1:!I||[e.summary,e.projectName,e.kindLabel,e.statusDetail].some(e=>e.toLowerCase().includes(I))),R=_!==`all`||y!==`all`||D!==`all`||k.trim()!==``||O!==`30d`,z=e=>{n({to:`/runs`,search:t=>({...t,...e}),replace:!0})};if(j.isLoading||M.isLoading)return(0,C.jsxs)(`div`,{className:`page-skeleton`,children:[(0,C.jsxs)(`div`,{className:`page-skeleton-header`,children:[(0,C.jsx)(`div`,{className:`skeleton-text h-6 w-20`}),(0,C.jsx)(`div`,{className:`skeleton-text-sm w-72`})]}),(0,C.jsx)(`div`,{className:`space-y-2`,children:[1,2,3,4].map(e=>(0,C.jsxs)(`div`,{className:`material-base p-3 flex items-center gap-3`,children:[(0,C.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,C.jsx)(`div`,{className:`skeleton-text w-40`}),(0,C.jsx)(`div`,{className:`skeleton-text-sm w-56`})]}),(0,C.jsx)(`div`,{className:`skeleton h-5 w-16 rounded-full`})]},e))})]});let B=async()=>{try{await N.mutateAsync(void 0)}catch{}};return(0,C.jsxs)(`div`,{className:`page-container`,children:[(0,C.jsxs)(`div`,{className:`page-header`,children:[(0,C.jsxs)(`div`,{className:`page-header-left`,children:[(0,C.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,C.jsx)(`p`,{className:`page-subtitle`,children:`Recent jobs across all projects.`})]}),!d()&&(o()?(0,C.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`AI Visibility checks are run by your Canonry team`}):(0,C.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,disabled:N.isPending,onClick:()=>void B(),children:N.isPending?`Queueing…`:`Run all projects`}))]}),(0,C.jsxs)(`section`,{children:[(0,C.jsx)(`div`,{className:`filter-row`,role:`toolbar`,"aria-label":`Run filters`,children:[`all`,`queued`,`running`,`completed`,`partial`,`failed`,`cancelled`].map(e=>(0,C.jsx)(`button`,{className:`filter-chip ${_===e?`filter-chip-active`:``}`,type:`button`,"aria-pressed":_===e,onClick:()=>z({runStatus:e===`all`?void 0:e}),children:e===`all`?`All runs`:f(e)},e))}),(0,C.jsxs)(`div`,{className:`mb-4 grid gap-2 sm:grid-cols-2 lg:grid-cols-[minmax(12rem,1fr)_minmax(10rem,0.7fr)_minmax(9rem,0.6fr)_minmax(9rem,0.6fr)_auto]`,children:[(0,C.jsx)(`input`,{type:`search`,"aria-label":`Search runs`,value:k,onChange:e=>z({runQuery:e.target.value||void 0}),placeholder:`Search runs or projects`,className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong placeholder-mono-400 focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`}),(0,C.jsxs)(`select`,{"aria-label":`Filter runs by project`,value:D,onChange:e=>z({runProject:e.target.value===`all`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,C.jsx)(`option`,{value:`all`,children:`All projects`}),(j.data??[]).map(e=>(0,C.jsx)(`option`,{value:e.id,children:e.displayName||e.name},e.id))]}),(0,C.jsxs)(`select`,{"aria-label":`Filter runs by type`,value:y,onChange:e=>z({runKind:e.target.value===`all`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,C.jsx)(`option`,{value:`all`,children:`All run types`}),Object.values(s).map(e=>(0,C.jsx)(`option`,{value:e,children:f(e.replaceAll(`-`,` `))},e))]}),(0,C.jsx)(`select`,{"aria-label":`Filter runs by date range`,value:O,onChange:e=>z({runWindow:e.target.value===`30d`?void 0:e.target.value}),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:Object.entries(T).map(([e,t])=>(0,C.jsx)(`option`,{value:e,children:t.label},e))}),R?(0,C.jsx)(u,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>z({runStatus:void 0,runKind:void 0,runProject:void 0,runWindow:void 0,runQuery:void 0}),children:`Clear`}):(0,C.jsx)(`span`,{})]}),M.isError?(0,C.jsxs)(g,{className:`surface-card empty-card`,children:[(0,C.jsx)(`h2`,{children:`Run history unavailable`}),(0,C.jsx)(`p`,{children:M.error instanceof Error?M.error.message:`Could not load run history.`})]}):null,(0,C.jsx)(`div`,{className:`run-list`,children:!M.isError&&L.length>0?L.map(e=>(0,C.jsx)(w,{run:e,projectSlug:j.data?.find(t=>t.id===e.projectId)?.name},e.id)):M.isError?null:(0,C.jsxs)(g,{className:`surface-card empty-card`,children:[(0,C.jsx)(`h2`,{children:`No runs match this filter`}),(0,C.jsx)(`p`,{children:`Change the project, type, status, or date range to widen the history.`})]})})]})]})}export{D as RunsPage};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{st as t}from"./vendor-lucide-CoTHJwai.js";import{r as n}from"./vendor-markdown-cQgSk2i0.js";import{u as r}from"./vendor-tanstack-q5SvZtcv.js";import{R as i,_ as a,g as o,gn as s,hn as c,qi as l,r as u,t as d,y as f,zt as p}from"./ToneBadge-B8hKcr8p.js";import{t as m}from"./async-handler-Bj3TnIRw.js";import{d as h}from"./query-client-CdG4DC3B.js";import{t as g}from"./card-Mu_5i5fM.js";import{$ as _,R as v,cn as y,h as b,in as x,nt as S,rt as C}from"./index-fN5qDR8H.js";var w=e(t(),1),T=n();function E({onSaved:e}){let[t,n]=(0,w.useState)(``),[r,i]=(0,w.useState)(``),[c,l]=(0,w.useState)(!1),[d,f]=(0,w.useState)(null),[g,_]=(0,w.useState)(!1),v=t.trim().length>0&&r.trim().length>0,y=typeof window>`u`?void 0:p(window.location,window.__CANONRY_CONFIG__?.basePath),b=y?a(y):void 0,x=y?o(y):void 0;async function S(){if(v){l(!0),f(null),_(!1);try{await s({clientId:t.trim(),clientSecret:r.trim()}),n(``),i(``),_(!0),h({title:`Google OAuth app updated`,detail:`Dashboard Google credentials were saved.`,tone:`positive`,dedupeKey:`settings:google-oauth`,dedupeMode:`replace`}),e()}catch(e){f(e instanceof Error?e.message:`Failed to update Google OAuth credentials`)}finally{l(!1)}}}return(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-id`,children:`Client ID`}),(0,T.jsxs)(`a`,{href:`https://console.cloud.google.com/apis/credentials`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:[`Google Cloud `,`↗`]})]}),(0,T.jsx)(`input`,{id:`google-client-id`,type:`text`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client ID`,value:t,onChange:e=>n(e.target.value)})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-secret`,children:`Client secret`}),(0,T.jsx)(`input`,{id:`google-client-secret`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client secret`,value:r,onChange:e=>i(e.target.value)})]}),b&&x&&(0,T.jsxs)(`div`,{className:`material-base px-3 py-2`,children:[(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Authorized redirect URIs`}),(0,T.jsxs)(`dl`,{className:`mt-1 space-y-2 text-label-12`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Search Console and Business Profile`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:b})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Google Ads and Tag Manager`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:x})})]})]})]}),d&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:d}),g&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Google OAuth credentials updated.`}),(0,T.jsx)(u,{type:`button`,size:`sm`,disabled:!v||c,onClick:m(S),children:c?`Saving...`:`Save Google OAuth app`})]})}function D(e){let t=e.replace(/^Error:\s*/,``).replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`Unknown error`}function O(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(null),[a,o]=(0,w.useState)(!1),[s,c]=(0,w.useState)(`localhost`),[p,_]=(0,w.useState)(`9222`),[v,y]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{i().then(e=>{t(e),r(null)}).catch(e=>{let t=l(e);t.includes(`501`)||r(t)})},[]),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Browser provider`}),(0,T.jsx)(`h2`,{children:`ChatGPT (CDP)`})]}),(0,T.jsx)(d,{tone:e?.connected?`positive`:`caution`,children:e?.connected?`Connected`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 ${n?`text-negative`:`text-secondary`}`,role:n?`alert`:void 0,children:n?(0,T.jsxs)(T.Fragment,{children:[`Could not check Chrome: `,D(n),`. Check that Chrome is running with remote debugging, then configure the endpoint.`]}):e?.connected?`Chrome is available for this provider.`:`Connect Chrome to enable this provider.`}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[e?.endpoint&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Endpoint`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:e.endpoint})]}),e?.browserVersion&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Browser`}),(0,T.jsx)(`dd`,{className:`text-label-12`,children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Tabs`}),(0,T.jsx)(`dd`,{children:e.targets.map(e=>(0,T.jsxs)(`span`,{className:`mr-2`,children:[e.name,`: `,e.alive?`● alive`:`○ idle`]},e.name))})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(!a),children:a?`Cancel`:e?.connected?`Update endpoint`:`Configure`})}),a&&(0,T.jsxs)(`form`,{className:`mt-3 flex flex-col gap-2`,onSubmit:m(async e=>{e.preventDefault(),y(!0);try{await f(s,parseInt(p,10)||9222);let e=await i();t(e),r(null),o(!1),h({title:`CDP endpoint saved`,detail:`${s}:${parseInt(p,10)||9222} is now configured.`,tone:`positive`,dedupeKey:`settings:cdp`,dedupeMode:`replace`})}catch(e){r(l(e))}finally{y(!1)}}),children:[(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(`input`,{className:`flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`localhost`,value:s,onChange:e=>c(e.target.value),"aria-label":`CDP host`}),(0,T.jsx)(`input`,{className:`w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`9222`,value:p,onChange:e=>_(e.target.value),"aria-label":`CDP port`})]}),(0,T.jsx)(`div`,{children:(0,T.jsx)(u,{type:`submit`,size:`sm`,disabled:v,children:v?`Saving…`:`Save endpoint`})})]})]})}var k={apiStatus:{label:`API`,state:`checking`,detail:`Checking service health`},workerStatus:{label:`Worker`,state:`checking`,detail:`Checking service health`}};function A(e){return e.name===`openrouter`||e.kind===`model-gateway`||e.kind===`answer-service`}function j(e){let t=e.displayName??e.name;return e.kind===`answer-service`?{connected:`${t} connected. Projects use it only where you choose its profiles.`,choose:`Choose project profiles`}:{connected:`${t} connected. Choose the models for each project.`,choose:`Choose project models`}}function M(){return(0,T.jsx)(v,{title:`Settings`,children:(0,T.jsx)(N,{})})}function N(){let e=C(),{dashboard:t}=S(),n=t?.settings??e?.dashboard?.settings,i=_(!e,e?.health).data??e?.health??k,[a,o]=(0,w.useState)(null),[s,l]=(0,w.useState)(new Set),[f,p]=(0,w.useState)(``),[v,D]=(0,w.useState)(!1),[M,N]=(0,w.useState)(!1),[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(!1);if(!n)return null;let H=t?.projects??e?.dashboard?.projects??[],U=f||H[0]?.project.name;return(0,T.jsxs)(`div`,{className:`page-container`,children:[(0,T.jsx)(`div`,{className:`page-header`,children:(0,T.jsxs)(`div`,{className:`page-header-left`,children:[(0,T.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,T.jsx)(`p`,{className:`page-subtitle`,children:`Connections and answer engines.`})]})}),(0,T.jsxs)(`section`,{className:`space-y-6`,children:[(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Answer engines`}),(0,T.jsx)(`h2`,{children:`Providers`})]})}),(0,T.jsx)(`div`,{className:`divide-y divide-default border-y border-default`,children:n.providerStatuses.map(e=>(0,T.jsxs)(`div`,{id:`provider-${e.name}`,className:`scroll-mt-24 py-4`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:e.displayName??e.name}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:e.detail})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(d,{tone:e.state===`ready`?`positive`:`caution`,children:e.state===`ready`?`Ready`:`Not connected`}),(0,T.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(a===e.name?null:e.name),children:a===e.name?`Cancel`:e.state===`ready`?`Update`:`Configure`})]})]}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[!A(e)&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Model`}),(0,T.jsxs)(`dd`,{className:`text-label-12-mono`,children:[e.model??e.defaultModel??`unknown`,!e.model&&e.defaultModel&&(0,T.jsx)(`span`,{className:`ml-1 font-sans text-muted`,children:`(default)`})]})]}),e.quota&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Concurrency`}),(0,T.jsx)(`dd`,{children:e.quota.maxConcurrency})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Rate limit`}),(0,T.jsxs)(`dd`,{children:[e.quota.maxRequestsPerMinute,`/min · `,e.quota.maxRequestsPerDay,`/day`]})]})]})]})]}),a===e.name&&(0,T.jsx)(b,{providerName:e.name,keyUrl:e.keyUrl,modelHint:e.modelHint,...e.kind?{kind:e.kind}:{},onSaved:()=>{o(null),A(e)&&l(t=>new Set([...t,e.name]))}}),A(e)&&(e.state===`ready`||s.has(e.name))&&(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-3`,children:[(0,T.jsx)(`p`,{role:s.has(e.name)?`status`:void 0,className:`w-full text-copy-14 text-secondary`,children:j(e).connected}),H.length>1&&(0,T.jsxs)(`label`,{className:`text-label-14 text-secondary`,children:[`Project`,(0,T.jsx)(`select`,{className:`setup-input ml-2`,value:U,onChange:e=>p(e.target.value),children:H.map(e=>(0,T.jsx)(`option`,{value:e.project.name,children:e.project.displayName??e.project.name},e.project.name))})]}),(0,T.jsx)(u,{type:`button`,variant:`outline`,asChild:!0,children:U?(0,T.jsx)(r,{to:`/projects/$projectName/settings`,params:{projectName:U},hash:`answer-engines`,children:j(e).choose}):(0,T.jsx)(r,{to:`/setup`,children:`Create a project`})})]})]},e.name))})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Connections`}),(0,T.jsx)(`h2`,{children:`Search and browser`})]})}),(0,T.jsxs)(`div`,{className:`settings-grid`,children:[(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Google`}),(0,T.jsx)(`h2`,{children:`Google OAuth`})]}),(0,T.jsx)(d,{tone:n.google.state===`ready`?`positive`:`caution`,children:n.google.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.google.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`One app credential set for Search Console, Business Profile, Google Ads, and Tag Manager`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>D(!v),children:v?`Cancel`:n.google.state===`ready`?`Update OAuth app`:`Configure Google OAuth`})}),v&&(0,T.jsx)(E,{onSaved:()=>{D(!1)}})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Bing`}),(0,T.jsx)(`h2`,{children:`Webmaster Tools`})]}),(0,T.jsx)(d,{tone:n.bing.state===`ready`?`positive`:`caution`,children:n.bing.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.bing.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`API key authentication. OAuth is not required.`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(u,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>N(!M),children:M?`Cancel`:n.bing.state===`ready`?`Update API key`:`Configure Bing`})}),M&&(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`bing-api-key`,children:`API key`}),(0,T.jsx)(`a`,{href:`https://www.bing.com/webmasters/`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:`Bing Webmaster Tools`})]}),(0,T.jsx)(`input`,{id:`bing-api-key`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Bing Webmaster Tools API key`,value:P,onChange:e=>F(e.target.value)})]}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Used for project-level Bing connections.`}),R&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:R}),B&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Bing API key updated.`}),(0,T.jsx)(u,{type:`button`,size:`sm`,disabled:!P.trim()||I,onClick:m(async()=>{if(P.trim()){L(!0),z(null),V(!1);try{await c(P.trim()),F(``),V(!0),N(!1),h({title:`Bing API key updated`,detail:`Dashboard Bing credentials were saved.`,tone:`positive`,dedupeKey:`settings:bing`,dedupeMode:`replace`})}catch(e){z(e instanceof Error?e.message:`Failed to update Bing API key`)}finally{L(!1)}}}),children:I?`Saving...`:`Save Bing API key`})]})]}),(0,T.jsx)(O,{})]})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Service health`}),(0,T.jsx)(`h2`,{children:`API and worker`})]})}),(0,T.jsxs)(`div`,{className:`compact-stack`,children:[(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`API`}),i.apiStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.apiStatus)})]}),(0,T.jsx)(d,{tone:y(i.apiStatus),title:x(i.apiStatus),children:i.apiStatus.state===`ok`?`Healthy`:`Attention`})]}),(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`Worker`}),i.workerStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.workerStatus)})]}),(0,T.jsx)(d,{tone:y(i.workerStatus),title:x(i.workerStatus),children:i.workerStatus.state===`ok`?`Healthy`:i.workerStatus.state===`disabled`?`Disabled`:`Attention`})]})]})]})]}),(0,T.jsxs)(`details`,{className:`page-section`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong`,children:`Self-hosting details`}),(0,T.jsxs)(g,{className:`surface-card mt-3`,children:[(0,T.jsx)(`ul`,{className:`detail-list`,children:n.selfHostNotes.map(e=>(0,T.jsx)(`li`,{children:e},e))}),(0,T.jsx)(`p`,{className:`supporting-copy`,children:n.bootstrapNote})]})]})]})}export{M as SettingsPage};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ct as t}from"./vendor-lucide-Bo69m9KC.js";import{r as n}from"./vendor-markdown-BiRP51B0.js";import{u as r}from"./vendor-tanstack-tBjrfzKu.js";import{Ji as i,_ as a,_n as o,b as s,gn as c,r as l,t as u,v as d,z as f,zt as p}from"./ToneBadge-B3rD6bDF.js";import{t as m}from"./async-handler-Bj3TnIRw.js";import{d as h}from"./query-client-DjRrRIsq.js";import{t as g}from"./card-CgdGerYK.js";import{$ as _,R as v,cn as y,h as b,in as x,nt as S,rt as C}from"./index-BrHemYsG.js";var w=e(t(),1),T=n();function E({onSaved:e}){let[t,n]=(0,w.useState)(``),[r,i]=(0,w.useState)(``),[s,c]=(0,w.useState)(!1),[u,f]=(0,w.useState)(null),[g,_]=(0,w.useState)(!1),v=t.trim().length>0&&r.trim().length>0,y=typeof window>`u`?void 0:p(window.location,window.__CANONRY_CONFIG__?.basePath),b=y?d(y):void 0,x=y?a(y):void 0;async function S(){if(v){c(!0),f(null),_(!1);try{await o({clientId:t.trim(),clientSecret:r.trim()}),n(``),i(``),_(!0),h({title:`Google OAuth app updated`,detail:`Dashboard Google credentials were saved.`,tone:`positive`,dedupeKey:`settings:google-oauth`,dedupeMode:`replace`}),e()}catch(e){f(e instanceof Error?e.message:`Failed to update Google OAuth credentials`)}finally{c(!1)}}}return(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-id`,children:`Client ID`}),(0,T.jsxs)(`a`,{href:`https://console.cloud.google.com/apis/credentials`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:[`Google Cloud `,`↗`]})]}),(0,T.jsx)(`input`,{id:`google-client-id`,type:`text`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client ID`,value:t,onChange:e=>n(e.target.value)})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`google-client-secret`,children:`Client secret`}),(0,T.jsx)(`input`,{id:`google-client-secret`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Google OAuth client secret`,value:r,onChange:e=>i(e.target.value)})]}),b&&x&&(0,T.jsxs)(`div`,{className:`material-base px-3 py-2`,children:[(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Authorized redirect URIs`}),(0,T.jsxs)(`dl`,{className:`mt-1 space-y-2 text-label-12`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Search Console and Business Profile`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:b})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{className:`text-muted`,children:`Google Ads and Tag Manager`}),(0,T.jsx)(`dd`,{children:(0,T.jsx)(`code`,{className:`block break-all text-strong`,children:x})})]})]})]}),u&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:u}),g&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Google OAuth credentials updated.`}),(0,T.jsx)(l,{type:`button`,size:`sm`,disabled:!v||s,onClick:m(S),children:s?`Saving...`:`Save Google OAuth app`})]})}function D(e){let t=e.replace(/^Error:\s*/,``).replace(/\s+/g,` `).trim();return t?t.length>140?`${t.slice(0,137)}...`:t:`Unknown error`}function O(){let[e,t]=(0,w.useState)(null),[n,r]=(0,w.useState)(null),[a,o]=(0,w.useState)(!1),[c,d]=(0,w.useState)(`localhost`),[p,_]=(0,w.useState)(`9222`),[v,y]=(0,w.useState)(!1);return(0,w.useEffect)(()=>{f().then(e=>{t(e),r(null)}).catch(e=>{let t=i(e);t.includes(`501`)||r(t)})},[]),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Browser provider`}),(0,T.jsx)(`h2`,{children:`ChatGPT (CDP)`})]}),(0,T.jsx)(u,{tone:e?.connected?`positive`:`caution`,children:e?.connected?`Connected`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 ${n?`text-negative`:`text-secondary`}`,role:n?`alert`:void 0,children:n?(0,T.jsxs)(T.Fragment,{children:[`Could not check Chrome: `,D(n),`. Check that Chrome is running with remote debugging, then configure the endpoint.`]}):e?.connected?`Chrome is available for this provider.`:`Connect Chrome to enable this provider.`}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[e?.endpoint&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Endpoint`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:e.endpoint})]}),e?.browserVersion&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Browser`}),(0,T.jsx)(`dd`,{className:`text-label-12`,children:e.browserVersion})]}),e?.targets&&e.targets.length>0&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Tabs`}),(0,T.jsx)(`dd`,{children:e.targets.map(e=>(0,T.jsxs)(`span`,{className:`mr-2`,children:[e.name,`: `,e.alive?`● alive`:`○ idle`]},e.name))})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(!a),children:a?`Cancel`:e?.connected?`Update endpoint`:`Configure`})}),a&&(0,T.jsxs)(`form`,{className:`mt-3 flex flex-col gap-2`,onSubmit:m(async e=>{e.preventDefault(),y(!0);try{await s(c,parseInt(p,10)||9222);let e=await f();t(e),r(null),o(!1),h({title:`CDP endpoint saved`,detail:`${c}:${parseInt(p,10)||9222} is now configured.`,tone:`positive`,dedupeKey:`settings:cdp`,dedupeMode:`replace`})}catch(e){r(i(e))}finally{y(!1)}}),children:[(0,T.jsxs)(`div`,{className:`flex gap-2`,children:[(0,T.jsx)(`input`,{className:`flex-1 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`localhost`,value:c,onChange:e=>d(e.target.value),"aria-label":`CDP host`}),(0,T.jsx)(`input`,{className:`w-24 rounded border border-strong bg-bg-elevated px-2 py-1 text-label-14 text-heading placeholder-mono-400 focus:outline-none focus:ring-1 focus:ring-mono-500`,placeholder:`9222`,value:p,onChange:e=>_(e.target.value),"aria-label":`CDP port`})]}),(0,T.jsx)(`div`,{children:(0,T.jsx)(l,{type:`submit`,size:`sm`,disabled:v,children:v?`Saving…`:`Save endpoint`})})]})]})}var k={apiStatus:{label:`API`,state:`checking`,detail:`Checking service health`},workerStatus:{label:`Worker`,state:`checking`,detail:`Checking service health`}};function A(e){return e.name===`openrouter`||e.kind===`model-gateway`||e.kind===`answer-service`}function j(e){let t=e.displayName??e.name;return e.kind===`answer-service`?{connected:`${t} connected. Projects use it only where you choose its profiles.`,choose:`Choose project profiles`}:{connected:`${t} connected. Choose the models for each project.`,choose:`Choose project models`}}function M(){return(0,T.jsx)(v,{title:`Settings`,children:(0,T.jsx)(N,{})})}function N(){let e=C(),{dashboard:t}=S(),n=t?.settings??e?.dashboard?.settings,i=_(!e,e?.health).data??e?.health??k,[a,o]=(0,w.useState)(null),[s,d]=(0,w.useState)(new Set),[f,p]=(0,w.useState)(``),[v,D]=(0,w.useState)(!1),[M,N]=(0,w.useState)(!1),[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(!1);if(!n)return null;let H=t?.projects??e?.dashboard?.projects??[],U=f||H[0]?.project.name;return(0,T.jsxs)(`div`,{className:`page-container`,children:[(0,T.jsx)(`div`,{className:`page-header`,children:(0,T.jsxs)(`div`,{className:`page-header-left`,children:[(0,T.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,T.jsx)(`p`,{className:`page-subtitle`,children:`Connections and answer engines.`})]})}),(0,T.jsxs)(`section`,{className:`space-y-6`,children:[(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Answer engines`}),(0,T.jsx)(`h2`,{children:`Providers`})]})}),(0,T.jsx)(`div`,{className:`divide-y divide-default border-y border-default`,children:n.providerStatuses.map(e=>(0,T.jsxs)(`div`,{id:`provider-${e.name}`,className:`scroll-mt-24 py-4`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:e.displayName??e.name}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:e.detail})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(u,{tone:e.state===`ready`?`positive`:`caution`,children:e.state===`ready`?`Ready`:`Not connected`}),(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>o(a===e.name?null:e.name),children:a===e.name?`Cancel`:e.state===`ready`?`Update`:`Configure`})]})]}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[!A(e)&&(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Model`}),(0,T.jsxs)(`dd`,{className:`text-label-12-mono`,children:[e.model??e.defaultModel??`unknown`,!e.model&&e.defaultModel&&(0,T.jsx)(`span`,{className:`ml-1 font-sans text-muted`,children:`(default)`})]})]}),e.quota&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Concurrency`}),(0,T.jsx)(`dd`,{children:e.quota.maxConcurrency})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Rate limit`}),(0,T.jsxs)(`dd`,{children:[e.quota.maxRequestsPerMinute,`/min · `,e.quota.maxRequestsPerDay,`/day`]})]})]})]})]}),a===e.name&&(0,T.jsx)(b,{providerName:e.name,keyUrl:e.keyUrl,modelHint:e.modelHint,...e.kind?{kind:e.kind}:{},onSaved:()=>{o(null),A(e)&&d(t=>new Set([...t,e.name]))}}),A(e)&&(e.state===`ready`||s.has(e.name))&&(0,T.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-3`,children:[(0,T.jsx)(`p`,{role:s.has(e.name)?`status`:void 0,className:`w-full text-copy-14 text-secondary`,children:j(e).connected}),H.length>1&&(0,T.jsxs)(`label`,{className:`text-label-14 text-secondary`,children:[`Project`,(0,T.jsx)(`select`,{className:`setup-input ml-2`,value:U,onChange:e=>p(e.target.value),children:H.map(e=>(0,T.jsx)(`option`,{value:e.project.name,children:e.project.displayName??e.project.name},e.project.name))})]}),(0,T.jsx)(l,{type:`button`,variant:`outline`,asChild:!0,children:U?(0,T.jsx)(r,{to:`/projects/$projectName/settings`,params:{projectName:U},hash:`answer-engines`,children:j(e).choose}):(0,T.jsx)(r,{to:`/setup`,children:`Create a project`})})]})]},e.name))})]}),(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Connections`}),(0,T.jsx)(`h2`,{children:`Search and browser`})]})}),(0,T.jsxs)(`div`,{className:`settings-grid`,children:[(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Google`}),(0,T.jsx)(`h2`,{children:`Google OAuth`})]}),(0,T.jsx)(u,{tone:n.google.state===`ready`?`positive`:`caution`,children:n.google.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.google.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`One app credential set for Search Console, Business Profile, Google Ads, and Tag Manager`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>D(!v),children:v?`Cancel`:n.google.state===`ready`?`Update OAuth app`:`Configure Google OAuth`})}),v&&(0,T.jsx)(E,{onSaved:()=>{D(!1)}})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsxs)(`div`,{className:`section-head`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Bing`}),(0,T.jsx)(`h2`,{children:`Webmaster Tools`})]}),(0,T.jsx)(u,{tone:n.bing.state===`ready`?`positive`:`caution`,children:n.bing.state===`ready`?`Ready`:`Not connected`})]}),(0,T.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:n.bing.detail}),(0,T.jsxs)(`details`,{className:`mt-3`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14 text-secondary hover:text-strong`,children:`Advanced`}),(0,T.jsxs)(`dl`,{className:`definition-list mt-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Auth model`}),(0,T.jsx)(`dd`,{children:`API key authentication. OAuth is not required.`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`dt`,{children:`Storage`}),(0,T.jsx)(`dd`,{className:`text-label-12-mono`,children:`~/.canonry/config.yaml`})]})]})]}),(0,T.jsx)(`div`,{className:`mt-2`,children:(0,T.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>N(!M),children:M?`Cancel`:n.bing.state===`ready`?`Update API key`:`Configure Bing`})}),M&&(0,T.jsxs)(`div`,{className:`mt-3 material-base p-3 space-y-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,T.jsx)(`label`,{className:`text-label-14 text-secondary`,htmlFor:`bing-api-key`,children:`API key`}),(0,T.jsx)(`a`,{href:`https://www.bing.com/webmasters/`,target:`_blank`,rel:`noopener noreferrer`,className:`text-label-14 text-secondary hover:text-neutral underline underline-offset-2`,children:`Bing Webmaster Tools`})]}),(0,T.jsx)(`input`,{id:`bing-api-key`,type:`password`,className:`mt-0.5 w-full rounded border border-strong bg-transparent px-2 py-1.5 text-label-14 text-strong placeholder-mono-400 focus:border-mono-500 focus:outline-none`,placeholder:`Bing Webmaster Tools API key`,value:P,onChange:e=>F(e.target.value)})]}),(0,T.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Used for project-level Bing connections.`}),R&&(0,T.jsx)(`p`,{className:`text-copy-14 text-negative-400`,children:R}),B&&(0,T.jsx)(`p`,{className:`text-copy-14 text-positive-400`,children:`Bing API key updated.`}),(0,T.jsx)(l,{type:`button`,size:`sm`,disabled:!P.trim()||I,onClick:m(async()=>{if(P.trim()){L(!0),z(null),V(!1);try{await c(P.trim()),F(``),V(!0),N(!1),h({title:`Bing API key updated`,detail:`Dashboard Bing credentials were saved.`,tone:`positive`,dedupeKey:`settings:bing`,dedupeMode:`replace`})}catch(e){z(e instanceof Error?e.message:`Failed to update Bing API key`)}finally{L(!1)}}}),children:I?`Saving...`:`Save Bing API key`})]})]}),(0,T.jsx)(O,{})]})]}),(0,T.jsxs)(g,{className:`surface-card`,children:[(0,T.jsx)(`div`,{className:`section-head`,children:(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Service health`}),(0,T.jsx)(`h2`,{children:`API and worker`})]})}),(0,T.jsxs)(`div`,{className:`compact-stack`,children:[(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`API`}),i.apiStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.apiStatus)})]}),(0,T.jsx)(u,{tone:y(i.apiStatus),title:x(i.apiStatus),children:i.apiStatus.state===`ok`?`Healthy`:`Attention`})]}),(0,T.jsxs)(`div`,{className:`health-row`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`run-row-title`,children:`Worker`}),i.workerStatus.state!==`ok`&&(0,T.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:x(i.workerStatus)})]}),(0,T.jsx)(u,{tone:y(i.workerStatus),title:x(i.workerStatus),children:i.workerStatus.state===`ok`?`Healthy`:i.workerStatus.state===`disabled`?`Disabled`:`Attention`})]})]})]})]}),(0,T.jsxs)(`details`,{className:`page-section`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer text-label-14-strong text-secondary hover:text-strong`,children:`Self-hosting details`}),(0,T.jsxs)(g,{className:`surface-card mt-3`,children:[(0,T.jsx)(`ul`,{className:`detail-list`,children:n.selfHostNotes.map(e=>(0,T.jsx)(`li`,{children:e},e))}),(0,T.jsx)(`p`,{className:`supporting-copy`,children:n.bootstrapNote})]})]})]})}export{M as SettingsPage};