@ainyc/canonry 4.103.0 → 4.104.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.
- package/README.md +7 -6
- package/assets/agent-workspace/skills/canonry/SKILL.md +5 -5
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +1 -1
- package/assets/assets/{BacklinksPage-CAzeiWX-.js → BacklinksPage-CixBvw--.js} +1 -1
- package/assets/assets/{ChartPrimitives-Cl91UJcT.js → ChartPrimitives-CjX4mQCy.js} +1 -1
- package/assets/assets/{ProjectPage-6n6qXa-G.js → ProjectPage-C09hcd6v.js} +1 -1
- package/assets/assets/{RunRow-DqumjxZP.js → RunRow-Bel7mWgu.js} +1 -1
- package/assets/assets/{RunsPage-DOdjY-ia.js → RunsPage-wqKWA2Ei.js} +1 -1
- package/assets/assets/{SettingsPage-DYW3Lfre.js → SettingsPage-esOqUkW5.js} +1 -1
- package/assets/assets/{TrafficPage-DX8A16LI.js → TrafficPage-V0iCV3l4.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-COLKpEny.js → TrafficSourceDetailPage-DUeuOh2v.js} +1 -1
- package/assets/assets/{arrow-left-DsQ3GWJh.js → arrow-left-CVZPxpW6.js} +1 -1
- package/assets/assets/{extract-error-message-DQEs2_vw.js → extract-error-message-BWAlA7ea.js} +1 -1
- package/assets/assets/{index-CY4Xe0F8.js → index-avJiga1P.js} +3 -3
- package/assets/assets/{trash-2-BARaYs9Y.js → trash-2-CA_L6uGC.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-BTJY73GW.js → chunk-GIKNEXFE.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/package.json +16 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-C09hcd6v.js","./vendor-tanstack-Be8JdV5M.js","./RunRow-Bel7mWgu.js","./ChartPrimitives-CjX4mQCy.js","./extract-error-message-BWAlA7ea.js","./vendor-recharts-C9EZkgbP.js","./trash-2-CA_L6uGC.js","./vendor-radix-CQ77EO2y.js","./vendor-markdown-6dwjPOKK.js","./RunsPage-wqKWA2Ei.js","./SettingsPage-esOqUkW5.js","./BacklinksPage-CixBvw--.js","./TrafficPage-V0iCV3l4.js","./arrow-left-CVZPxpW6.js","./TrafficSourceDetailPage-DUeuOh2v.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{c as Nw,d as kw,Q as Aw,M as _w,r as q,q as ze,j as f,L as st,a as Cw,e as ks,u as fn,f as zw,h as fc,k as Tw,l as Ew,m as dv,O as Sf,n as Wa,o as zi,p as Ow,s as Tt,t as Gf,v as Ps,x as Dw,y as Rw,z as Mw}from"./vendor-tanstack-Be8JdV5M.js";import{S as Bw,O as Hf,P as fv,C as Qf,a as pv,T as Kf,D as mv,R as hv}from"./vendor-radix-CQ77EO2y.js";import{c as gv}from"./vendor-recharts-C9EZkgbP.js";import{M as Lw}from"./vendor-markdown-6dwjPOKK.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();var ef={exports:{}},Kr={},tf={exports:{}},nf={};var Uy;function qw(){return Uy||(Uy=1,(function(e){function n($,W){var fe=$.length;$.push(W);e:for(;0<fe;){var je=fe-1>>>1,se=$[je];if(0<l(se,W))$[je]=W,$[fe]=se,fe=je;else break e}}function i($){return $.length===0?null:$[0]}function r($){if($.length===0)return null;var W=$[0],fe=$.pop();if(fe!==W){$[0]=fe;e:for(var je=0,se=$.length,Ye=se>>>1;je<Ye;){var J=2*(je+1)-1,ue=$[J],ee=J+1,de=$[ee];if(0>l(ue,fe))ee<se&&0>l(de,ue)?($[je]=de,$[ee]=fe,je=ee):($[je]=ue,$[J]=fe,je=J);else if(ee<se&&0>l(de,fe))$[je]=de,$[ee]=fe,je=ee;else break e}}return W}function l($,W){var fe=$.sortIndex-W.sortIndex;return fe!==0?fe:$.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,h=d.now();e.unstable_now=function(){return d.now()-h}}var g=[],v=[],S=1,x=null,N=3,_=!1,z=!1,k=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function Z($){for(var W=i(v);W!==null;){if(W.callback===null)r(v);else if(W.startTime<=$)r(v),W.sortIndex=W.expirationTime,n(g,W);else break;W=i(v)}}function X($){if(k=!1,Z($),!z)if(i(g)!==null)z=!0,F||(F=!0,Se());else{var W=i(v);W!==null&&pe(X,W.startTime-$)}}var F=!1,O=-1,M=5,oe=-1;function ke(){return E?!0:!(e.unstable_now()-oe<M)}function Oe(){if(E=!1,F){var $=e.unstable_now();oe=$;var W=!0;try{e:{z=!1,k&&(k=!1,I(O),O=-1),_=!0;var fe=N;try{t:{for(Z($),x=i(g);x!==null&&!(x.expirationTime>$&&ke());){var je=x.callback;if(typeof je=="function"){x.callback=null,N=x.priorityLevel;var se=je(x.expirationTime<=$);if($=e.unstable_now(),typeof se=="function"){x.callback=se,Z($),W=!0;break t}x===i(g)&&r(g),Z($)}else r(g);x=i(g)}if(x!==null)W=!0;else{var Ye=i(v);Ye!==null&&pe(X,Ye.startTime-$),W=!1}}break e}finally{x=null,N=fe,_=!1}W=void 0}}finally{W?Se():F=!1}}}var Se;if(typeof P=="function")Se=function(){P(Oe)};else if(typeof MessageChannel<"u"){var He=new MessageChannel,le=He.port2;He.port1.onmessage=Oe,Se=function(){le.postMessage(null)}}else Se=function(){R(Oe,0)};function pe($,W){O=R(function(){$(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function($){$.callback=null},e.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return N},e.unstable_next=function($){switch(N){case 1:case 2:case 3:var W=3;break;default:W=N}var fe=N;N=W;try{return $()}finally{N=fe}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function($,W){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var fe=N;N=$;try{return W()}finally{N=fe}},e.unstable_scheduleCallback=function($,W,fe){var je=e.unstable_now();switch(typeof fe=="object"&&fe!==null?(fe=fe.delay,fe=typeof fe=="number"&&0<fe?je+fe:je):fe=je,$){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=fe+se,$={id:S++,callback:W,priorityLevel:$,startTime:fe,expirationTime:se,sortIndex:-1},fe>je?($.sortIndex=fe,n(v,$),i(g)===null&&$===i(v)&&(k?(I(O),O=-1):k=!0,pe(X,fe-je))):($.sortIndex=se,n(g,$),z||_||(z=!0,F||(F=!0,Se()))),$},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function($){var W=N;return function(){var fe=N;N=W;try{return $.apply(this,arguments)}finally{N=fe}}}})(nf)),nf}var $y;function Uw(){return $y||($y=1,tf.exports=qw()),tf.exports}var Vy;function $w(){if(Vy)return Kr;Vy=1;var e=Uw(),n=Nw(),i=kw();function r(t){var a="https://react.dev/errors/"+t;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var a=t,s=t;if(t.alternate)for(;a.return;)a=a.return;else{t=a;do a=t,(a.flags&4098)!==0&&(s=a.return),t=a.return;while(t)}return a.tag===3?s:null}function d(t){if(t.tag===13){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function h(t){if(t.tag===31){var a=t.memoizedState;if(a===null&&(t=t.alternate,t!==null&&(a=t.memoizedState)),a!==null)return a.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function v(t){var a=t.alternate;if(!a){if(a=c(t),a===null)throw Error(r(188));return a!==t?null:t}for(var s=t,o=a;;){var u=s.return;if(u===null)break;var m=u.alternate;if(m===null){if(o=u.return,o!==null){s=o;continue}break}if(u.child===m.child){for(m=u.child;m;){if(m===s)return g(u),t;if(m===o)return g(u),a;m=m.sibling}throw Error(r(188))}if(s.return!==o.return)s=u,o=m;else{for(var b=!1,j=u.child;j;){if(j===s){b=!0,s=u,o=m;break}if(j===o){b=!0,o=u,s=m;break}j=j.sibling}if(!b){for(j=m.child;j;){if(j===s){b=!0,s=m,o=u;break}if(j===o){b=!0,o=m,s=u;break}j=j.sibling}if(!b)throw Error(r(189))}}if(s.alternate!==o)throw Error(r(190))}if(s.tag!==3)throw Error(r(188));return s.stateNode.current===s?t:a}function S(t){var a=t.tag;if(a===5||a===26||a===27||a===6)return t;for(t=t.child;t!==null;){if(a=S(t),a!==null)return a;t=t.sibling}return null}var x=Object.assign,N=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),P=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),Oe=Symbol.iterator;function Se(t){return t===null||typeof t!="object"?null:(t=Oe&&t[Oe]||t["@@iterator"],typeof t=="function"?t:null)}var He=Symbol.for("react.client.reference");function le(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===He?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case X:return"Suspense";case F:return"SuspenseList";case oe:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case z:return"Portal";case P:return t.displayName||"Context";case I:return(t._context.displayName||"Context")+".Consumer";case Z:var a=t.render;return t=t.displayName,t||(t=a.displayName||a.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case O:return a=t.displayName||null,a!==null?a:le(t.type)||"Memo";case M:a=t._payload,t=t._init;try{return le(t(a))}catch{}}return null}var pe=Array.isArray,$=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe={pending:!1,data:null,method:null,action:null},je=[],se=-1;function Ye(t){return{current:t}}function J(t){0>se||(t.current=je[se],je[se]=null,se--)}function ue(t,a){se++,je[se]=t.current,t.current=a}var ee=Ye(null),de=Ye(null),ae=Ye(null),Ne=Ye(null);function tt(t,a){switch(ue(ae,a),ue(de,t),ue(ee,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?ly(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=ly(a),t=cy(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}J(ee),ue(ee,t)}function xe(){J(ee),J(de),J(ae)}function $e(t){t.memoizedState!==null&&ue(Ne,t);var a=ee.current,s=cy(a,t.type);a!==s&&(ue(de,t),ue(ee,s))}function Qe(t){de.current===t&&(J(ee),J(de)),Ne.current===t&&(J(Ne),Pr._currentValue=fe)}var Dt,Un;function Rt(t){if(Dt===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);Dt=a&&a[1]||"",Un=-1<s.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+Dt+t+Un}var er=!1;function Ri(t,a){if(!t||er)return"";er=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(a){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(V){var U=V}Reflect.construct(t,[],Y)}else{try{Y.call()}catch(V){U=V}t.call(Y.prototype)}}else{try{throw Error()}catch(V){U=V}(Y=t())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(V){if(V&&U&&typeof V.stack=="string")return[V.stack,U.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),b=m[0],j=m[1];if(b&&j){var C=b.split(`
|
|
@@ -61,7 +61,7 @@ ${JSON.stringify(r.raw,null,2)}`):n.push(l)}return n.length>0?n.join(`
|
|
|
61
61
|
`)){if(!I.startsWith("data:"))continue;const P=I.slice(5).trim();if(P)try{h(JSON.parse(P))}catch{}}E=N.indexOf(`
|
|
62
62
|
|
|
63
63
|
`)}}}finally{d?.removeEventListener("abort",_);try{S.releaseLock()}catch{}}}function NS(e){return!e||e.role!=="assistant"?"":e.content.filter(n=>n.type==="text").map(n=>n.text).join("")}const KR=[{label:"Status",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{label:"Top insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{label:"Last failed run",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{label:"Schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"}],ZR=[{command:"/status",label:"Status",hint:"Latest runs, health, anything unusual",prompt:"Quick status overview for this project — latest runs, current health, anything unusual."},{command:"/insights",label:"Top insights",hint:"Walk through the most severe active insights",prompt:"Walk me through the 3 most severe active insights and what to do about each."},{command:"/last-run",label:"Last run",hint:"Summarize the latest sweep",prompt:"Summarize the latest run for this project — provider mix, visibility changes, and anything that moved."},{command:"/last-failed",label:"Last failed run",hint:"Diagnose the most recent failure",prompt:"If the latest run failed, dig into it and tell me what went wrong plus how to fix it."},{command:"/run-sweep",label:"Run sweep now",hint:"Trigger a new visibility sweep",prompt:"Run a new answer-visibility sweep for this project now and tell me when it lands."},{command:"/schedule",label:"Schedule",hint:"Review the sweep schedule",prompt:"What is the current sweep schedule, and is it appropriate given recent volatility?"},{command:"/queries",label:"Queries",hint:"List tracked queries",prompt:"List the tracked queries for this project and flag any that are obvious duplicates or underperformers."},{command:"/competitors",label:"Competitors",hint:"List tracked competitors",prompt:"List this project's tracked competitors and call out which ones are showing up in answer citations."},{command:"/clear",label:"Clear conversation",hint:"Wipe transcript and start fresh",action:"clear"}],Il=e=>`canonry:aero:provider:${e}`,Kb=e=>`canonry:aero:scope:${e}`;function YR({projectName:e}){const[n,i]=q.useState(!1),[r,l]=q.useState(!1),[c,d]=q.useState([]),[h,g]=q.useState(""),[v,S]=q.useState(!1),[x,N]=q.useState([]),[_,z]=q.useState(""),[k,E]=q.useState(null),[R,I]=q.useState(()=>typeof window>"u"?null:window.localStorage.getItem(Il(e))??null),[P,Z]=q.useState(()=>typeof window>"u"?"read-only":window.localStorage.getItem(Kb(e))==="all"?"all":"read-only"),X=q.useRef(null),{ref:F}=PR([c,_,x]),O=q.useRef(null),[M,oe]=q.useState(0),ke=q.useMemo(()=>{const J=h.trimStart();if(!J.startsWith("/"))return[];if(/\s/.test(J))return[];const ue=J.toLowerCase();return ZR.filter(ee=>ee.command.startsWith(ue)||ee.label.toLowerCase().includes(ue.slice(1)))},[h]);q.useEffect(()=>{oe(J=>ke.length===0?0:Math.min(J,ke.length-1))},[ke.length]);const Oe=fn({...q4({client:te,path:{name:e}}),enabled:n,staleTime:6e4}),Se=q.useMemo(()=>{const J=Oe.data?.providers??[];if(R){const ee=J.find(de=>de.id===R&&de.configured);if(ee)return ee}const ue=Oe.data?.defaultProvider;return ue?J.find(ee=>ee.id===ue)??null:null},[R,Oe.data]);q.useEffect(()=>{if(!Oe.data||!R)return;Oe.data.providers.find(ue=>ue.id===R&&ue.configured)||(I(null),window.localStorage.removeItem(Il(e)))},[Oe.data,R,e]);const He=q.useCallback(J=>{I(J),!(typeof window>"u")&&(J?window.localStorage.setItem(Il(e),J):window.localStorage.removeItem(Il(e)))},[e]),le=q.useCallback(()=>{Z(J=>{const ue=J==="all"?"read-only":"all";return typeof window<"u"&&window.localStorage.setItem(Kb(e),ue),ue})},[e]);q.useEffect(()=>{if(!n)return;const J=ue=>{ue.key==="Escape"&&(r?l(!1):i(!1))};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n,r]),q.useEffect(()=>{if(!n)return;let J=!1;E(null);const ue=()=>{J||v||Qb(e).then(ae=>{J||d(ae.messages)}).catch(ae=>{J||E(ae instanceof Error?ae.message:"Failed to load transcript")})};ue();const de=window.setInterval(ue,15e3);return()=>{J=!0,window.clearInterval(de)}},[n,e,v]),q.useEffect(()=>()=>{X.current?.abort()},[e]);async function pe(J){const ue=J.trim();if(!ue||v)return;E(null),g(""),S(!0),z(""),N([]);const ee={role:"user",content:ue,timestamp:Date.now()};d(ae=>[...ae,ee]);const de=new AbortController;X.current=de;try{await QR({project:e,prompt:ue,provider:R??void 0,scope:P,signal:de.signal,onEvent:$});const ae=await Qb(e);d(ae.messages)}catch(ae){ae.name!=="AbortError"&&E(ae instanceof Error?ae.message:"Prompt failed")}finally{S(!1),z(""),X.current=null}}function $(J){switch(J.type){case"message_update":z(NS(J.message));break;case"message_end":J.message.role==="assistant"&&z("");break;case"tool_execution_start":N(ue=>[...ue,{id:J.toolCallId,name:J.toolName,args:J.args,startedAt:Date.now()}]);break;case"tool_execution_end":N(ue=>ue.map(ee=>ee.id===J.toolCallId?{...ee,endedAt:Date.now(),isError:J.isError,result:J.result}:ee));break;case"error":E(J.message);break}}async function W(){X.current?.abort();try{await HR(e),d([]),E(null)}catch(J){E(J instanceof Error?J.message:"Reset failed")}}const fe=c.length===0,je=n&&r?"pointer-events-auto fixed inset-0 z-40 flex items-stretch justify-center bg-zinc-950/70 p-4 sm:p-8 backdrop-blur-sm":"pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center p-3",se=r?"pointer-events-auto flex h-full w-full max-w-5xl flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-2xl":"pointer-events-auto w-full max-w-3xl",Ye=r?"flex-1 overflow-y-auto px-6 py-5 text-sm text-zinc-200":"max-h-[40vh] min-h-[120px] overflow-y-auto px-4 py-3 text-sm text-zinc-200";return f.jsx("div",{className:je,onClick:J=>{r&&J.target===J.currentTarget&&l(!1)},children:f.jsx("div",{className:se,children:n?f.jsxs("div",{className:r?"flex h-full flex-col":"flex flex-col overflow-hidden rounded-2xl border border-zinc-800/80 bg-zinc-950/95 shadow-xl backdrop-blur",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-zinc-800/70 px-4 py-2.5",children:[f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx(Fy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),f.jsx("span",{className:"text-sm font-medium text-zinc-100",children:"Aero"}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:v?"working…":e})]}),f.jsxs("div",{className:"flex items-center gap-1",children:[f.jsx(XR,{providers:Oe.data?.providers??[],active:Se,override:R,onPick:He,disabled:v}),f.jsx("button",{type:"button",onClick:Nn(W),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Reset conversation",title:"Reset conversation",children:f.jsx(Mv,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>l(J=>!J),className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":r?"Collapse":"Expand",title:r?"Collapse":"Expand",children:r?f.jsx(MA,{className:"h-3.5 w-3.5","aria-hidden":"true"}):f.jsx(EA,{className:"h-3.5 w-3.5","aria-hidden":"true"})}),f.jsx("button",{type:"button",onClick:()=>{l(!1),i(!1)},className:"rounded-md p-1.5 text-zinc-500 transition hover:bg-zinc-800/60 hover:text-zinc-200","aria-label":"Close Aero",children:f.jsx(Hs,{className:"h-4 w-4","aria-hidden":"true"})})]})]}),f.jsxs("div",{ref:F,className:Ye,children:[k&&f.jsx("div",{className:"mb-2 rounded-md border border-rose-700/40 bg-rose-950/40 px-3 py-2 text-xs text-rose-200",children:k}),fe&&!v&&f.jsxs("div",{className:"flex flex-col gap-3 py-2",children:[f.jsxs("p",{className:"text-xs text-zinc-500",children:["Ask anything about ",f.jsx("span",{className:"text-zinc-300",children:e}),", or start with:"]}),f.jsx("div",{className:"flex flex-wrap gap-1.5",children:KR.map(J=>f.jsx("button",{type:"button",onClick:()=>{pe(J.prompt)},className:"rounded-full border border-zinc-800 bg-zinc-900/70 px-3 py-1 text-xs text-zinc-300 transition hover:border-zinc-700 hover:bg-zinc-800/70 hover:text-zinc-100",children:J.label},J.label))})]}),tM(c,e,R,P),x.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:x.map(J=>f.jsx(kS,{trail:J},J.id))}),v&&_&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(AS,{content:_})]}),v&&!_&&x.every(J=>J.endedAt!==void 0)&&f.jsx(sM,{})]}),f.jsx(JR,{projectName:e,activeProvider:Se,scope:P,onToggleScope:le,disabled:v}),f.jsxs("div",{className:"relative",children:[ke.length>0&&f.jsx(FR,{matches:ke,selectedIndex:M,onHover:oe,onPick:J=>{g(""),O.current?.focus(),J.action==="clear"?W():pe(J.prompt)}}),f.jsxs("form",{className:"flex items-end gap-2 border-t border-zinc-800/70 bg-zinc-950/80 px-3 py-2.5",onSubmit:J=>{if(J.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?W():pe(ue.prompt);return}pe(h)},children:[f.jsx("textarea",{ref:O,value:h,onChange:J=>g(J.target.value),onKeyDown:J=>{if(ke.length>0){if(J.key==="ArrowDown"){J.preventDefault(),oe(ue=>(ue+1)%ke.length);return}if(J.key==="ArrowUp"){J.preventDefault(),oe(ue=>(ue-1+ke.length)%ke.length);return}if(J.key==="Tab"){J.preventDefault();const ue=ke[M];g(`${ue.command} `);return}if(J.key==="Escape"){J.preventDefault(),g("");return}}if(J.key==="Enter"&&!J.shiftKey)if(J.preventDefault(),ke.length>0){const ue=ke[M];g(""),ue.action==="clear"?W():pe(ue.prompt)}else pe(h)},placeholder:"Ask Aero, or / for commands…",disabled:v,rows:r?3:1,className:"flex-1 resize-none bg-transparent text-sm text-zinc-100 placeholder:text-zinc-600 focus:outline-none disabled:opacity-60"}),f.jsx("button",{type:"submit",disabled:v||!h.trim(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md bg-emerald-500 text-zinc-950 transition hover:bg-emerald-400 disabled:opacity-40","aria-label":"Send",children:f.jsx(cA,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]}):f.jsxs("button",{type:"button",onClick:()=>i(!0),className:"flex w-full items-center justify-between rounded-full border border-zinc-800/80 bg-zinc-950/95 px-4 py-2 text-left text-sm text-zinc-400 shadow-lg backdrop-blur transition hover:border-zinc-700 hover:bg-zinc-900/90 hover:text-zinc-200",children:[f.jsxs("span",{className:"flex items-center gap-2",children:[f.jsx(Fy,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Ask Aero about ",e,"…"]}),f.jsx("span",{className:"text-[10px] uppercase tracking-wider text-zinc-600",children:"Enter"})]})})})}function XR({providers:e,active:n,override:i,onPick:r,disabled:l}){const[c,d]=q.useState(!1),h=q.useRef(null);if(q.useEffect(()=>{if(!c)return;const S=N=>{h.current?.contains(N.target)||d(!1)},x=N=>{N.key==="Escape"&&d(!1)};return window.addEventListener("mousedown",S),window.addEventListener("keydown",x),()=>{window.removeEventListener("mousedown",S),window.removeEventListener("keydown",x)}},[c]),e.length===0)return null;const g=n?.label.replace(/\s+\(.+\)$/,"")??"No provider",v=n?.defaultModel;return f.jsxs("div",{ref:h,className:"relative",children:[f.jsxs("button",{type:"button",onClick:()=>d(S=>!S),disabled:l,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] text-zinc-400 transition hover:bg-zinc-800/60 hover:text-zinc-200 disabled:opacity-50","aria-label":"Switch agent model","aria-haspopup":"listbox","aria-expanded":c,title:n?`${n.label} · ${n.defaultModel}`:"Pick a provider",children:[f.jsx("span",{className:"font-medium text-zinc-200",children:g}),v&&f.jsx("span",{className:"hidden font-mono text-[10px] text-zinc-500 sm:inline",children:v}),f.jsx(mA,{className:"h-3 w-3","aria-hidden":"true"})]}),c&&f.jsxs("div",{role:"listbox",className:"absolute right-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950 shadow-xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-2 text-[10px] uppercase tracking-wider text-zinc-500",children:"Aero provider"}),f.jsx("ul",{className:"max-h-72 overflow-y-auto py-1",children:e.map(S=>{const x=n?.id===S.id,N=i===S.id;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":x,disabled:!S.configured,onClick:()=>{S.configured&&(r(N?null:S.id),d(!1))},className:"flex w-full items-start gap-2 px-3 py-2 text-left text-xs transition enabled:hover:bg-zinc-900 disabled:cursor-not-allowed disabled:opacity-50",children:[f.jsx("span",{className:"mt-0.5 flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:x?f.jsx(Rv,{className:"h-3 w-3 text-emerald-400","aria-hidden":"true"}):null}),f.jsxs("span",{className:"flex-1",children:[f.jsxs("span",{className:"flex items-center gap-1.5",children:[f.jsx("span",{className:"font-medium text-zinc-100",children:S.label}),N&&f.jsx("span",{className:"rounded-full border border-emerald-800/60 bg-emerald-950/60 px-1.5 text-[9px] uppercase tracking-wider text-emerald-300",children:"Pinned"}),!S.configured&&f.jsx("span",{className:"rounded-full border border-zinc-800 px-1.5 text-[9px] uppercase tracking-wider text-zinc-500",children:"Key missing"})]}),f.jsx("span",{className:"mt-0.5 block font-mono text-[10px] text-zinc-500",children:S.defaultModel}),S.keySource==="env"&&f.jsx("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:"via env var"}),!S.configured&&f.jsxs("span",{className:"mt-0.5 block text-[10px] text-zinc-600",children:["Add key in config.yaml or export"," ",f.jsx("code",{className:"font-mono text-zinc-400",children:WR(S.id)})]})]})]})},S.id)})}),i&&f.jsx("button",{type:"button",onClick:()=>{r(null),d(!1)},className:"w-full border-t border-zinc-800/60 px-3 py-2 text-left text-[11px] text-zinc-400 transition hover:bg-zinc-900 hover:text-zinc-100",children:"Reset to auto-detected default"})]})]})}function JR({projectName:e,activeProvider:n,scope:i,onToggleScope:r,disabled:l}){const c=n?.label.replace(/\s+\(.+\)$/,"")??null,d=i==="all";return f.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-zinc-800/70 bg-zinc-950/80 px-3 pt-2",children:[f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"project"}),f.jsx("span",{className:"font-medium text-zinc-200",children:e})]}),c&&f.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-zinc-800 bg-zinc-900/70 px-2 py-0.5 text-[10px] text-zinc-400",children:[f.jsx("span",{className:"text-zinc-600",children:"model"}),f.jsx("span",{className:"font-medium text-zinc-200",children:c})]}),f.jsxs("button",{type:"button",onClick:r,disabled:l,className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] transition disabled:opacity-50 ${d?"border-amber-800/60 bg-amber-950/40 text-amber-300 hover:border-amber-700 hover:text-amber-200":"border-zinc-800 bg-zinc-900/70 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200"}`,title:d?"Aero can invoke write tools (run sweep, dismiss insight, etc). Click to restrict.":"Aero is restricted to read-only tools. Click to allow writes.",children:[f.jsx("span",{className:d?"text-amber-500":"text-zinc-600",children:"scope"}),f.jsx("span",{className:"font-medium",children:d?"all tools":"read-only"})]})]})}function FR({matches:e,selectedIndex:n,onHover:i,onPick:r}){return f.jsxs("div",{className:"absolute inset-x-3 bottom-full mb-2 overflow-hidden rounded-lg border border-zinc-800 bg-zinc-950/98 shadow-2xl",children:[f.jsx("div",{className:"border-b border-zinc-800/60 px-3 py-1.5 text-[10px] uppercase tracking-wider text-zinc-500",children:"Commands"}),f.jsx("ul",{role:"listbox",className:"max-h-72 overflow-y-auto py-1",children:e.map((l,c)=>{const d=c===n;return f.jsx("li",{children:f.jsxs("button",{type:"button",role:"option","aria-selected":d,onMouseEnter:()=>i(c),onClick:()=>r(l),className:`flex w-full items-center gap-3 px-3 py-1.5 text-left text-xs transition ${d?"bg-zinc-900 text-zinc-100":"text-zinc-300 hover:bg-zinc-900/60"}`,children:[f.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:l.command}),f.jsx("span",{className:"font-medium",children:l.label}),f.jsx("span",{className:"ml-auto text-[10px] text-zinc-500",children:l.hint})]})},l.command)})}),f.jsxs("div",{className:"border-t border-zinc-800/60 px-3 py-1.5 text-[10px] text-zinc-600",children:[f.jsx("span",{className:"mr-3",children:"↑↓ to select"}),f.jsx("span",{className:"mr-3",children:"Enter to run"}),f.jsx("span",{children:"Tab to autocomplete"})]})]})}function WR(e){switch(e){case"claude":return"ANTHROPIC_API_KEY";case"openai":return"OPENAI_API_KEY";case"gemini":return"GOOGLE_API_KEY";case"zai":return"ZAI_API_KEY";case"deepinfra":return"DEEPINFRA_TOKEN"}}function eM(e,n){const i=e.timestamp??0;return`${e.role}:${i}:${n}`}function tM(e,n,i,r){const l=[];for(let c=0;c<e.length;c++){const d=e[c],h=eM(d,c);if(d.role==="user"){const g=typeof d.content=="string"?d.content:JSON.stringify(d.content);if(g.startsWith("[system]"))continue;l.push(f.jsx(nM,{text:g,projectName:n,providerOverride:i,scope:r},h));continue}if(d.role==="assistant"){const g=new Map;let v=c+1;for(;v<e.length&&e[v].role==="toolResult";){const N=e[v];g.set(N.toolCallId,N),v++}const S=iM(d,g,d.timestamp??0),x=NS(d);l.push(f.jsxs(q.Fragment,{children:[S.length>0&&f.jsx("div",{className:"mt-3 space-y-1.5",children:S.map(N=>f.jsx(kS,{trail:N},N.id))}),x.trim()&&f.jsxs("div",{className:"mt-3",children:[f.jsx("div",{className:"mb-0.5 text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsx(AS,{content:x})]})]},h)),c=v-1;continue}}return l}function nM({text:e,projectName:n,providerOverride:i,scope:r}){const[l,c]=q.useState(!1),d=q.useMemo(()=>aM(n,e,i,r),[n,e,i,r]);async function h(){try{await navigator.clipboard.writeText(d),c(!0),window.setTimeout(()=>c(!1),1500)}catch{}}return f.jsxs("div",{className:"group relative mt-3 rounded-md bg-zinc-900/60 px-3 py-2 text-zinc-200",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-zinc-500",children:"You"}),f.jsx("button",{type:"button",onClick:Nn(h),className:"inline-flex items-center gap-1 rounded border border-zinc-800/70 bg-zinc-950/60 px-1.5 py-0.5 text-[10px] text-zinc-400 opacity-0 transition hover:border-zinc-700 hover:text-zinc-100 group-hover:opacity-100 focus:opacity-100","aria-label":"Copy as CLI command",title:d,children:l?f.jsxs(f.Fragment,{children:[f.jsx(Rv,{className:"h-2.5 w-2.5 text-emerald-400","aria-hidden":"true"}),"Copied"]}):f.jsxs(f.Fragment,{children:[f.jsx(yA,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Copy as CLI"]})})]}),f.jsx("div",{className:"whitespace-pre-wrap",children:e})]})}function aM(e,n,i,r){const l=["canonry","agent","ask",Zb(e),Zb(n)];return i&&l.push("--provider",i),r==="read-only"&&l.push("--scope","read-only"),l.join(" ")}function Zb(e){return`'${e.replace(/'/g,"'\\''")}'`}function iM(e,n,i){const r=[];for(const l of e.content){if(l.type!=="toolCall")continue;const c=l,d=n.get(c.id);r.push({id:c.id,name:c.name,args:c.arguments,startedAt:i,endedAt:d?.timestamp,isError:d?.isError,result:d?.content})}return r}function kS({trail:e}){const[n,i]=q.useState(!1),r=e.endedAt===void 0,l=!r&&e.isError===!0,c=e.endedAt!=null?e.endedAt-e.startedAt:null,d=c==null||c<0?null:c<1e3?`${c}ms`:`${(c/1e3).toFixed(1)}s`,h=l?"border-rose-800/50":r?"border-emerald-800/50":"border-zinc-800/70",g=l?"bg-rose-950/20":r?"bg-emerald-950/20":"bg-zinc-900/40";return f.jsxs("div",{className:`rounded-md border ${h} ${g} font-mono`,children:[f.jsxs("button",{type:"button",onClick:()=>i(v=>!v),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left","aria-expanded":n,children:[f.jsx("span",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:r?f.jsx(zA,{className:"h-3 w-3 animate-spin text-emerald-400","aria-hidden":"true"}):l?f.jsx(Bv,{className:"h-3 w-3 text-rose-400","aria-hidden":"true"}):f.jsx(JA,{className:"h-3 w-3 text-zinc-500","aria-hidden":"true"})}),f.jsx("span",{className:"text-[11px] font-semibold text-zinc-100",children:e.name}),f.jsxs("span",{className:"ml-auto flex items-center gap-2 text-[10px] text-zinc-500",children:[r?f.jsx("span",{className:"text-emerald-400",children:"running…"}):f.jsxs(f.Fragment,{children:[f.jsx("span",{children:l?"failed":"ok"}),d&&f.jsx("span",{children:d})]}),f.jsx(Ff,{className:`h-3 w-3 transition-transform ${n?"rotate-90":""}`,"aria-hidden":"true"})]})]}),n&&f.jsxs("div",{className:"border-t border-zinc-800/60 px-2.5 py-2 text-[11px] text-zinc-400",children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:"Args"}),f.jsx("pre",{className:"mb-2 overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Yb(e.args)}),!r&&e.result!==void 0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"mb-1 text-[9px] uppercase tracking-wider text-zinc-600",children:l?"Error":"Result"}),f.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[10px] text-zinc-300",children:Yb(e.result)})]})]})]})}function Yb(e){try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);return n.length>2e3?`${n.slice(0,2e3)}
|
|
64
|
-
… (${n.length-2e3} more chars)`:n}catch{return String(e)}}function AS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Lw,{components:{h1:n=>f.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:n=>f.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:n=>f.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:n=>f.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:n=>f.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>f.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>f.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>f.jsx("li",{...n,className:"marker:text-zinc-600"}),strong:n=>f.jsx("strong",{...n,className:"font-semibold text-zinc-50"}),em:n=>f.jsx("em",{...n,className:"text-zinc-200"}),code:({children:n,...i})=>f.jsx("code",{...i,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:n}),pre:n=>f.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:n=>f.jsx("a",{...n,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>f.jsx("thead",{...n,className:"border-b border-zinc-800"}),th:n=>f.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:n=>f.jsx("tr",{...n,className:"border-b border-zinc-900"}),td:n=>f.jsx("td",{...n,className:"px-2 py-1 text-zinc-200"}),blockquote:n=>f.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>f.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function sM(){return f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[f.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),f.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),f.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function rM(){const e=dv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=fn({...xc({client:te}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(YR,{projectName:c.name},c.name):null}function Ka(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function ro(e,n,i){switch(e.invalidateQueries({queryKey:wp({client:te})}),e.invalidateQueries({queryKey:Ei({client:te})}),Ka(e,"getApiV1ProjectsByNameRuns"),n){case Ae["answer-visibility"]:case Ae["site-audit"]:case Ae["backlink-extract"]:return;case Ae["gsc-sync"]:case Ae["inspect-sitemap"]:Ka(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ae["ga-sync"]:Ka(e,"getApiV1ProjectsByNameGa");return;case Ae["traffic-sync"]:Ka(e,"getApiV1ProjectsByNameGa"),Ka(e,"getApiV1ProjectsByNameTraffic");return;case Ae["bing-inspect"]:case Ae["bing-inspect-sitemap"]:Ka(e,"getApiV1ProjectsByNameBing");return;case Ae["aeo-discover-seed"]:case Ae["aeo-discover-probe"]:return;case Ae["gbp-sync"]:Ka(e,"getApiV1ProjectsByNameGbp");return;case Ae["ads-sync"]:Ka(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Xb=[{label:"GitHub",href:"https://github.com/AINYC/canonry",Icon:xA},{label:"Docs",href:"https://github.com/AINYC/canonry/tree/main/docs",Icon:dA},{label:"Changelog",href:"https://github.com/AINYC/canonry/releases",Icon:vA}],Jb=e=>({label:e,state:"checking",detail:"Checking service health"}),oM={apiStatus:Jb("API"),workerStatus:Jb("Worker")};function _S(e){switch(e){case Ae["answer-visibility"]:return"Visibility sweep";case Ae["gsc-sync"]:return"GSC sync";case Ae["inspect-sitemap"]:return"Sitemap inspection";case Ae["ga-sync"]:return"GA sync";case Ae["traffic-sync"]:return"Traffic sync";case Ae["bing-inspect"]:return"Bing URL inspection";case Ae["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ae["site-audit"]:return"Site audit";case Ae["backlink-extract"]:return"Backlink extract";case Ae["aeo-discover-seed"]:return"Discovery (seed phase)";case Ae["aeo-discover-probe"]:return"Discovery (probe phase)";case Ae["gbp-sync"]:return"Business Profile sync";case Ae["ads-sync"]:return"ChatGPT ads sync"}}function lM(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function cM(e){const n=_S(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function uM(e,n){return e.error?`${n}: ${op(e.error)}`:e.location?`${n} · ${e.location}`:n}function Fb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function dM(e,n){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function fM(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function pM(){const e=Wa(),n=q.useSyncExternalStore(K4,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=fn({...K0({client:te}),enabled:i,staleTime:ao,refetchInterval:3e3}),l=fn({...xc({client:te}),enabled:i}),c=q.useRef({}),d=q.useCallback(()=>{r.refetch()},[r.refetch]);return q.useEffect(()=>{i&&d()},[i,d]),q.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),q.useEffect(()=>{const h=r.data??[],g=l.data??[],v=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=v[x.runId];if(!N||!X4(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const z=g.find(E=>E.id===N.projectId);if(z&&ro(e,N.kind,z.name),x.sourceAction==="run-all"){uf(N.id);continue}const k=Fb(N.projectId,x.projectLabel,g);tn({title:cM(N),detail:uM(N,k),tone:lM(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),uf(N.id)}if(r.data!==void 0){const x=new Set(h.map(_=>_.id)),N=F4(Object.values(n.runs),x,Date.now(),J4);for(const _ of N){const z=g.find(k=>k.id===_.projectId);z&&ro(e,_.kind,z.name),_.sourceAction!=="run-all"&&tn({title:`${_S(_.kind)} status unavailable`,detail:Fb(_.projectId,_.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${_.runId}`,dedupeMode:"replace"}),uf(_.runId)}}for(const x of Object.values(n.batches)){const N=W4(x.runIds,v);N.finished&&(tn({title:"Run-all batch finished",detail:dM(N,x.skippedCount),tone:fM(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),Y4(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function mM(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=kc(),d=_p(!e,e?.health).data??e?.health??oM,h=dv(),{runId:g,evidenceId:v,closeDrawer:S}=Cp(),[x,N]=q.useState(!1),[_,z]=q.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=q.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@ainyc/canonry",upgradeCommand:"npm install -g @ainyc/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==_,I=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}z(E.latest)}},P=UR(g),Z=P.data??null,X=P.isLoading;q.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),q.useEffect(()=>{N(!1)},[h.pathname]),q.useEffect(()=>{if(typeof window>"u"||!g&&!v)return;const le=pe=>{pe.key==="Escape"&&S()};return window.addEventListener("keydown",le),()=>{window.removeEventListener("keydown",le)}},[g,v,S]);const F=n??e?.dashboard??null,O=h.pathname==="/setup"&&F!==null&&F.portfolioOverview.projects.length===0,M=g&&F?fR(F,g):void 0,oe=q.useMemo(()=>rR(h.pathname,F),[h.pathname,F]),{commandCenter:ke}=BR(oe),Oe=q.useMemo(()=>{if(v)return mR(ke,F,v)},[v,ke,F]),Se=(()=>{const le=h.pathname;if(le==="/")return"Portfolio";if(le==="/projects")return"Projects";if(le==="/runs")return"Runs";if(le==="/settings")return"Settings";if(le==="/setup")return"Setup";if(le==="/backlinks")return"Backlinks";if(le==="/traffic"||le.startsWith("/traffic/"))return"Server traffic";if(le.startsWith("/projects/")){const $=le.split("/").filter(Boolean)[1];if($&&F){const W=F.projects.find(fe=>fe.project.id===$);if(W)return W.project.name}return"Project"}return"Not found"})(),He=q.useMemo(()=>pk(),[]);if(He){const le=!He.views||He.views.includes(GD(h.pathname));return f.jsxs("div",{className:"app-shell app-shell-embed",style:KD(He.theme),children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),f.jsx("main",{id:"content",className:"page-shell",children:le?f.jsx(Sf,{}):f.jsx("div",{className:"embed-view-unavailable",role:"status",children:"This view is not available in embed mode."})})]})}return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx($b,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:I})}),f.jsxs("nav",{className:"sidebar-nav",children:[f.jsxs(st,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(kA,{className:"sidebar-icon"}),f.jsx("span",{children:"Overview"})]}),f.jsxs(st,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(jA,{className:"sidebar-icon"}),f.jsx("span",{children:"Projects"})]}),f.jsxs(st,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(LA,{className:"sidebar-icon"}),f.jsx("span",{children:"Runs"})]}),f.jsxs(st,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx($A,{className:"sidebar-icon"}),f.jsx("span",{children:"Server traffic"})]}),f.jsxs(st,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(_A,{className:"sidebar-icon"}),f.jsx("span",{children:"Backlinks"})]}),f.jsxs(st,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(ZA,{className:"sidebar-icon"}),f.jsx("span",{children:"Settings"})]}),i?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(le=>f.jsxs("div",{className:"sidebar-skeleton-item",children:[f.jsx("span",{className:"skeleton-circle size-2"}),f.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+le*15}%`}})]},le))]}):F&&F.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),F.projects.map(le=>{const pe=le.visibilitySummary.tone;return f.jsxs(st,{to:"/projects/$projectName",params:{projectName:le.project.name},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${pe}`}),f.jsx("span",{children:le.project.displayName||le.project.name})]},le.project.id)})]}):i?null:f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Resources"}),f.jsxs(st,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(PA,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Xb.map(({label:le,href:pe,Icon:$})=>f.jsx("a",{className:"sidebar-footer-icon",href:pe,target:"_blank",rel:"noopener noreferrer",title:le,"aria-label":le,children:f.jsx($,{className:"size-4"})},pe))})]}),f.jsxs("div",{className:"main-area",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("div",{className:"topbar-left",children:[f.jsx("div",{className:"topbar-brand-mobile",children:f.jsx($b,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(st,{to:"/",children:"Home"}),f.jsx(Ff,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:Se})]})]}),f.jsxs("div",{className:"topbar-actions",children:[f.jsxs("div",{className:"health-pill-row",children:[f.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,title:$s(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:$s(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(Ue,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(le=>!le),children:[f.jsx(DA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(Ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Hs,{className:"size-5"}),f.jsx("span",{className:"sr-only",children:"Close navigation"})]}),f.jsx(st,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),f.jsx(st,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),f.jsx(st,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),f.jsx(st,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),f.jsx(st,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),F&&F.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),F.projects.map(le=>f.jsx(st,{to:"/projects/$projectName",params:{projectName:le.project.name},className:"mobile-nav-link",children:le.project.name},le.project.id))]}):null]}),f.jsx("main",{id:"content",className:"page-shell",children:i&&!e?f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-40"}),f.jsx("div",{className:"skeleton-text-sm w-72"})]}),f.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(le=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text w-full"}),f.jsx("div",{className:"skeleton-text-sm w-3/4"})]},le))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(le=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-20"}),f.jsx("div",{className:"space-y-2",children:[1,2,3].map(pe=>f.jsx("div",{className:"skeleton-text-sm w-full"},pe))})]},le))})]}):f.jsx(Sf,{})}),f.jsxs("footer",{className:"footer",children:[f.jsxs("span",{className:"footer-brand",children:[f.jsx("span",{children:f.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),d.apiStatus.version&&d.apiStatus.version!=="unknown"?f.jsxs("span",{className:"footer-version",children:["v",d.apiStatus.version]}):null]}),f.jsx("div",{className:"footer-links",children:Xb.map(({label:le,href:pe,Icon:$})=>f.jsx("a",{href:pe,target:"_blank",rel:"noopener noreferrer",title:le,"aria-label":le,className:"footer-icon",children:f.jsx($,{className:"size-3.5"})},pe))})]})]}),M?f.jsxs(W3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(kp,{status:M.status}),f.jsx("span",{className:"text-zinc-400",children:M.startedAt}),f.jsx("span",{className:"text-zinc-500",children:M.duration}),f.jsx("span",{className:"text-zinc-600",children:M.triggerLabel})]}),M.status==="failed"&&M.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:M.statusDetail}),f.jsxs("div",{className:"mt-4",children:[f.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),X?f.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(le=>f.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[f.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:le.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Q3,{provider:le.provider}),f.jsx(mS,{variant:le.citationState===sc.cited?"success":"neutral",children:le.citationState})]})]}),le.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:le.model}),le.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",le.citedDomains.join(", ")]}),le.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",le.competitorOverlap.join(", ")]}),le.groundingSources&&le.groundingSources.length>0&&f.jsxs("details",{className:"mt-2",children:[f.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[le.groundingSources.length," grounding source",le.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:le.groundingSources.map((pe,$)=>{const W=Rf(pe.uri),fe=pe.title||pe.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:W?f.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:fe}):f.jsx("span",{children:fe})},$)})})]}),le.answerText&&f.jsxs("details",{className:"mt-1",children:[f.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),f.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:le.answerText})]})]},le.id)),Z.status==="running"&&f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):Z&&Z.status==="running"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):Z&&Z.status==="queued"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):Z&&Z.error?f.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[f.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),f.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:VD(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,Oe?f.jsx(aR,{evidence:Oe.evidence,project:Oe.project,onClose:S}):null,f.jsx(pM,{}),f.jsx(IR,{}),f.jsx(rM,{})]})}class hM extends q.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?f.jsx("div",{className:"page-container",children:f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[f.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:f.jsx(Bv,{className:"size-6 text-rose-400"})}),f.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),f.jsxs("div",{className:"flex gap-3 mt-2",children:[f.jsxs(Ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Mv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(Ue,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const kn=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));kn.displayName="Card";const Mf=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("flex flex-col gap-1.5 p-5",e),...n}));Mf.displayName="CardHeader";const Bf=q.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Tn("font-medium tracking-tight text-zinc-50",e),...n}));Bf.displayName="CardTitle";const Lf=q.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Tn("text-sm text-zinc-500",e),...n}));Lf.displayName="CardDescription";const Yl=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("p-5 pt-0",e),...n}));Yl.displayName="CardContent";function gM({points:e,tone:n}){const i=q.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,v=l-c*2,S=r-c*2,x=e.map((N,_)=>{const z=c+_/Math.max(e.length-1,1)*v,k=c+(1-(N-d)/g)*S;return`${z},${k}`}).join(" ");return f.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[f.jsx("defs",{children:f.jsx("clipPath",{id:i,children:f.jsx("rect",{x:c,y:c,width:v,height:S,rx:"8"})})}),f.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),f.jsx("polyline",{clipPath:`url(#${i})`,points:x,vectorEffect:"non-scaling-stroke"})]})}function yM({project:e}){return f.jsxs(st,{to:"/projects/$projectName",params:{projectName:e.project.name},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(gM,{points:e.trend,tone:Y0(e.lastRun.status)})}),f.jsxs("div",{className:"project-row-primary",children:[f.jsxs("div",{children:[f.jsx("p",{className:"project-name",children:e.project.name}),f.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),f.jsx("p",{className:"project-insight",children:e.insight})]}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),e.providerCoverage&&f.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),f.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel})]})}),f.jsx("span",{className:"project-row-link",children:f.jsx(Ff,{className:"h-4 w-4 text-zinc-500"})})]})}function bM(){const e=uo(),{dashboard:n,isLoading:i}=kc(),r=n??e?.dashboard;if(!r||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-32"}),f.jsx("div",{className:"skeleton-text-sm w-64"})]}),f.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 space-y-2",children:[f.jsx("div",{className:"skeleton-text w-36"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},S))})]});const l=r.portfolioOverview,h=_p(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=$4(l.systemHealth,h,r.settings),{openRun:v}=Cp();return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Portfolio"}),f.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),f.jsx("div",{className:"page-header-right",children:f.jsx("p",{className:"text-[11px] text-zinc-600",children:l.lastUpdatedAt})})]}),l.projects.length>0?f.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(S=>f.jsx(yM,{project:S},S.project.id))}):f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),f.jsx(Ue,{size:"sm",asChild:!0,children:f.jsx(st,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),f.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),f.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),f.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(S=>S.href?f.jsxs(st,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id))})]}),f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),f.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),f.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>v(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(kp,{status:S.status})]},S.id)):f.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),f.jsxs("section",{className:"page-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),f.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),f.jsx("div",{className:"health-grid",children:g.map(S=>f.jsxs(kn,{className:"surface-card compact-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Bn,{tone:S.tone,title:S.id==="api"?$s(h.apiStatus):S.id==="worker"?$s(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Op=Symbol.for("yaml.alias"),qf=Symbol.for("yaml.document"),Xa=Symbol.for("yaml.map"),CS=Symbol.for("yaml.pair"),Qn=Symbol.for("yaml.scalar"),Xs=Symbol.for("yaml.seq"),Cn=Symbol.for("yaml.node.type"),Di=e=>!!e&&typeof e=="object"&&e[Cn]===Op,Ac=e=>!!e&&typeof e=="object"&&e[Cn]===qf,fo=e=>!!e&&typeof e=="object"&&e[Cn]===Xa,xt=e=>!!e&&typeof e=="object"&&e[Cn]===CS,nt=e=>!!e&&typeof e=="object"&&e[Cn]===Qn,po=e=>!!e&&typeof e=="object"&&e[Cn]===Xs;function bt(e){if(e&&typeof e=="object")switch(e[Cn]){case Xa:case Xs:return!0}return!1}function St(e){if(e&&typeof e=="object")switch(e[Cn]){case Op:case Xa:case Qn:case Xs:return!0}return!1}const zS=e=>(nt(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),vM=Symbol("skip children"),to=Symbol("remove node");function Js(e,n){const i=SM(n);Ac(e)?Es(null,e.contents,i,Object.freeze([e]))===to&&(e.contents=null):Es(null,e,i,Object.freeze([]))}Js.BREAK=ji;Js.SKIP=vM;Js.REMOVE=to;function Es(e,n,i,r){const l=xM(e,n,i,r);if(St(l)||xt(l))return wM(e,r,l),Es(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Es(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===to&&(n.items.splice(c,1),c-=1)}}}else if(xt(n)){r=Object.freeze(r.concat(n));const c=Es("key",n.key,i,r);if(c===ji)return ji;c===to&&(n.key=null);const d=Es("value",n.value,i,r);if(d===ji)return ji;d===to&&(n.value=null)}}return l}function SM(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function xM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(fo(n))return i.Map?.(e,n,r);if(po(n))return i.Seq?.(e,n,r);if(xt(n))return i.Pair?.(e,n,r);if(nt(n))return i.Scalar?.(e,n,r);if(Di(n))return i.Alias?.(e,n,r)}function wM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(xt(r))e==="key"?r.key=i:r.value=i;else if(Ac(r))r.contents=i;else{const l=Di(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const jM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},NM=e=>e.replace(/[!,[\]{}]/g,n=>jM[n]);class Ht{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ht.defaultYaml,n),this.tags=Object.assign({},Ht.defaultTags,i)}clone(){const n=new Ht(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Ht(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ht.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ht.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+NM(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&St(n.contents)){const c={};Js(n.contents,(d,h)=>{St(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
|
|
64
|
+
… (${n.length-2e3} more chars)`:n}catch{return String(e)}}function AS({content:e}){return f.jsx("div",{className:"aero-markdown text-zinc-100",children:f.jsx(Lw,{components:{h1:n=>f.jsx("h1",{...n,className:"mt-3 mb-2 text-base font-semibold text-zinc-50"}),h2:n=>f.jsx("h2",{...n,className:"mt-3 mb-2 text-sm font-semibold text-zinc-50"}),h3:n=>f.jsx("h3",{...n,className:"mt-3 mb-1.5 text-sm font-semibold text-zinc-100"}),h4:n=>f.jsx("h4",{...n,className:"mt-2 mb-1 text-xs font-semibold uppercase tracking-wide text-zinc-300"}),p:n=>f.jsx("p",{...n,className:"mb-2 leading-relaxed"}),ul:n=>f.jsx("ul",{...n,className:"mb-2 ml-4 list-disc space-y-1"}),ol:n=>f.jsx("ol",{...n,className:"mb-2 ml-4 list-decimal space-y-1"}),li:n=>f.jsx("li",{...n,className:"marker:text-zinc-600"}),strong:n=>f.jsx("strong",{...n,className:"font-semibold text-zinc-50"}),em:n=>f.jsx("em",{...n,className:"text-zinc-200"}),code:({children:n,...i})=>f.jsx("code",{...i,className:"rounded bg-zinc-800/70 px-1 py-0.5 font-mono text-[12px] text-emerald-200",children:n}),pre:n=>f.jsx("pre",{...n,className:"mb-2 overflow-x-auto rounded-md border border-zinc-800 bg-zinc-900/70 p-3 font-mono text-xs text-zinc-200"}),a:n=>f.jsx("a",{...n,className:"text-emerald-400 underline decoration-emerald-700 hover:decoration-emerald-400",target:"_blank",rel:"noopener noreferrer"}),table:n=>f.jsx("div",{className:"mb-2 overflow-x-auto",children:f.jsx("table",{...n,className:"w-full border-collapse text-xs"})}),thead:n=>f.jsx("thead",{...n,className:"border-b border-zinc-800"}),th:n=>f.jsx("th",{...n,className:"px-2 py-1 text-left font-semibold text-zinc-300"}),tr:n=>f.jsx("tr",{...n,className:"border-b border-zinc-900"}),td:n=>f.jsx("td",{...n,className:"px-2 py-1 text-zinc-200"}),blockquote:n=>f.jsx("blockquote",{...n,className:"mb-2 border-l-2 border-zinc-700 pl-3 italic text-zinc-400"}),hr:()=>f.jsx("hr",{className:"my-3 border-zinc-800"})},children:e})})}function sM(){return f.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[f.jsx("div",{className:"text-[10px] uppercase tracking-wider text-emerald-400",children:"Aero"}),f.jsxs("div",{className:"flex items-center gap-1","aria-label":"Aero is thinking",children:[f.jsx("span",{className:"aero-dot h-1.5 w-1.5 rounded-full bg-emerald-400/80"}),f.jsx("span",{className:"aero-dot aero-dot-2 h-1.5 w-1.5 rounded-full bg-emerald-400/60"}),f.jsx("span",{className:"aero-dot aero-dot-3 h-1.5 w-1.5 rounded-full bg-emerald-400/40"})]})]})}function rM(){const e=dv(),n=/^\/projects\/([^/]+)/.exec(e.pathname),i=n?decodeURIComponent(n[1]):null,r=fn({...xc({client:te}),enabled:i!==null,staleTime:6e4});if(!i)return null;const l=r.data??[],c=l.find(d=>d.id===i)??l.find(d=>d.name===i);return c?f.jsx(YR,{projectName:c.name},c.name):null}function Ka(e,n){e.invalidateQueries({predicate:i=>{const r=i.queryKey[0];return typeof r?._id=="string"&&r._id.startsWith(n)}})}function ro(e,n,i){switch(e.invalidateQueries({queryKey:wp({client:te})}),e.invalidateQueries({queryKey:Ei({client:te})}),Ka(e,"getApiV1ProjectsByNameRuns"),n){case Ae["answer-visibility"]:case Ae["site-audit"]:case Ae["backlink-extract"]:return;case Ae["gsc-sync"]:case Ae["inspect-sitemap"]:Ka(e,"getApiV1ProjectsByNameGoogleGsc");return;case Ae["ga-sync"]:Ka(e,"getApiV1ProjectsByNameGa");return;case Ae["traffic-sync"]:Ka(e,"getApiV1ProjectsByNameGa"),Ka(e,"getApiV1ProjectsByNameTraffic");return;case Ae["bing-inspect"]:case Ae["bing-inspect-sitemap"]:Ka(e,"getApiV1ProjectsByNameBing");return;case Ae["aeo-discover-seed"]:case Ae["aeo-discover-probe"]:return;case Ae["gbp-sync"]:Ka(e,"getApiV1ProjectsByNameGbp");return;case Ae["ads-sync"]:Ka(e,"getApiV1ProjectsByNameAds");return;default:return n}}const Xb=[{label:"GitHub",href:"https://github.com/Canonry/canonry",Icon:xA},{label:"Docs",href:"https://github.com/Canonry/canonry/tree/main/docs",Icon:dA},{label:"Changelog",href:"https://github.com/Canonry/canonry/releases",Icon:vA}],Jb=e=>({label:e,state:"checking",detail:"Checking service health"}),oM={apiStatus:Jb("API"),workerStatus:Jb("Worker")};function _S(e){switch(e){case Ae["answer-visibility"]:return"Visibility sweep";case Ae["gsc-sync"]:return"GSC sync";case Ae["inspect-sitemap"]:return"Sitemap inspection";case Ae["ga-sync"]:return"GA sync";case Ae["traffic-sync"]:return"Traffic sync";case Ae["bing-inspect"]:return"Bing URL inspection";case Ae["bing-inspect-sitemap"]:return"Bing sitemap inspection";case Ae["site-audit"]:return"Site audit";case Ae["backlink-extract"]:return"Backlink extract";case Ae["aeo-discover-seed"]:return"Discovery (seed phase)";case Ae["aeo-discover-probe"]:return"Discovery (probe phase)";case Ae["gbp-sync"]:return"Business Profile sync";case Ae["ads-sync"]:return"ChatGPT ads sync"}}function lM(e){return e==="completed"?"positive":e==="partial"?"caution":"negative"}function cM(e){const n=_S(e.kind);return e.status==="completed"?`${n} completed`:e.status==="partial"?`${n} completed with partial results`:e.status==="cancelled"?`${n} cancelled`:`${n} failed`}function uM(e,n){return e.error?`${n}: ${op(e.error)}`:e.location?`${n} · ${e.location}`:n}function Fb(e,n,i){if(n)return n;const r=i.find(l=>l.id===e);return r?.displayName||r?.name||e}function dM(e,n){return[e.completed>0?`${e.completed} completed`:null,e.partial>0?`${e.partial} partial`:null,e.failed>0?`${e.failed} failed`:null,e.cancelled>0?`${e.cancelled} cancelled`:null,n>0?`${n} skipped at queue time`:null].filter(Boolean).join(", ")}function fM(e){return e.failed>0||e.cancelled>0?"negative":e.partial>0?"caution":"positive"}function pM(){const e=Wa(),n=q.useSyncExternalStore(K4,_i,_i),i=Object.keys(n.runs).length>0||Object.keys(n.batches).length>0,r=fn({...K0({client:te}),enabled:i,staleTime:ao,refetchInterval:3e3}),l=fn({...xc({client:te}),enabled:i}),c=q.useRef({}),d=q.useCallback(()=>{r.refetch()},[r.refetch]);return q.useEffect(()=>{i&&d()},[i,d]),q.useEffect(()=>{if(!i||typeof window>"u")return;const h=()=>{document.visibilityState==="visible"&&d()};return window.addEventListener("focus",d),document.addEventListener("visibilitychange",h),()=>{window.removeEventListener("focus",d),document.removeEventListener("visibilitychange",h)}},[i,d]),q.useEffect(()=>{const h=r.data??[],g=l.data??[],v=Object.fromEntries(h.map(x=>[x.id,x])),S=Object.fromEntries(h.map(x=>[x.id,x.status]));for(const x of Object.values(n.runs)){const N=v[x.runId];if(!N||!X4(N.status)||(c.current[N.id]??x.lastAnnouncedStatus)===N.status)continue;const z=g.find(E=>E.id===N.projectId);if(z&&ro(e,N.kind,z.name),x.sourceAction==="run-all"){uf(N.id);continue}const k=Fb(N.projectId,x.projectLabel,g);tn({title:cM(N),detail:uM(N,k),tone:lM(N.status),dedupeKey:`run:${N.id}`,dedupeMode:"replace",cta:{label:"View run",intent:"open-run-drawer",runId:N.id}}),uf(N.id)}if(r.data!==void 0){const x=new Set(h.map(_=>_.id)),N=F4(Object.values(n.runs),x,Date.now(),J4);for(const _ of N){const z=g.find(k=>k.id===_.projectId);z&&ro(e,_.kind,z.name),_.sourceAction!=="run-all"&&tn({title:`${_S(_.kind)} status unavailable`,detail:Fb(_.projectId,_.projectLabel,g),tone:"neutral",dedupeKey:`run-stale:${_.runId}`,dedupeMode:"replace"}),uf(_.runId)}}for(const x of Object.values(n.batches)){const N=W4(x.runIds,v);N.finished&&(tn({title:"Run-all batch finished",detail:dM(N,x.skippedCount),tone:fM(N),dedupeKey:`batch:${x.batchId}`,dedupeMode:"replace",cta:{label:"View runs",intent:"go-to-runs"}}),Y4(x.batchId))}c.current=S},[l.data,r.data,n,e]),null}function mM(){const e=uo(),{dashboard:n,isLoading:i,refetch:r}=kc(),d=_p(!e,e?.health).data??e?.health??oM,h=dv(),{runId:g,evidenceId:v,closeDrawer:S}=Cp(),[x,N]=q.useState(!1),[_,z]=q.useState(()=>{if(typeof window>"u")return null;try{return window.localStorage.getItem("canonry:dismissedUpdateVersion")}catch{return null}}),[k]=q.useState(()=>typeof window>"u"?null:new URLSearchParams(window.location.search).get("force-update")),E=k?{current:d.apiStatus.version??"0.0.0",latest:k,url:"https://www.npmjs.com/package/@canonry/canonry",upgradeCommand:"npm install -g @canonry/canonry"}:d.apiStatus.updateAvailable,R=E&&E.latest!==_,I=()=>{if(E){try{window.localStorage.setItem("canonry:dismissedUpdateVersion",E.latest)}catch{}z(E.latest)}},P=UR(g),Z=P.data??null,X=P.isLoading;q.useEffect(()=>{Z&&Z.status!=="running"&&Z.status!=="queued"&&r()},[Z?.status,r]),q.useEffect(()=>{N(!1)},[h.pathname]),q.useEffect(()=>{if(typeof window>"u"||!g&&!v)return;const le=pe=>{pe.key==="Escape"&&S()};return window.addEventListener("keydown",le),()=>{window.removeEventListener("keydown",le)}},[g,v,S]);const F=n??e?.dashboard??null,O=h.pathname==="/setup"&&F!==null&&F.portfolioOverview.projects.length===0,M=g&&F?fR(F,g):void 0,oe=q.useMemo(()=>rR(h.pathname,F),[h.pathname,F]),{commandCenter:ke}=BR(oe),Oe=q.useMemo(()=>{if(v)return mR(ke,F,v)},[v,ke,F]),Se=(()=>{const le=h.pathname;if(le==="/")return"Portfolio";if(le==="/projects")return"Projects";if(le==="/runs")return"Runs";if(le==="/settings")return"Settings";if(le==="/setup")return"Setup";if(le==="/backlinks")return"Backlinks";if(le==="/traffic"||le.startsWith("/traffic/"))return"Server traffic";if(le.startsWith("/projects/")){const $=le.split("/").filter(Boolean)[1];if($&&F){const W=F.projects.find(fe=>fe.project.id===$);if(W)return W.project.name}return"Project"}return"Not found"})(),He=q.useMemo(()=>pk(),[]);if(He){const le=!He.views||He.views.includes(GD(h.pathname));return f.jsxs("div",{className:"app-shell app-shell-embed",style:KD(He.theme),children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),f.jsx("main",{id:"content",className:"page-shell",children:le?f.jsx(Sf,{}):f.jsx("div",{className:"embed-view-unavailable",role:"status",children:"This view is not available in embed mode."})})]})}return f.jsxs("div",{className:`app-shell ${O?"app-shell-focus":""}`,children:[f.jsx("a",{className:"skip-link",href:"#content",children:"Skip to content"}),!O&&f.jsxs("aside",{className:"sidebar","aria-label":"Primary navigation",children:[f.jsx("div",{className:"sidebar-brand",children:f.jsx($b,{version:d.apiStatus.version,updateAvailable:R?E:null,onDismissUpdate:I})}),f.jsxs("nav",{className:"sidebar-nav",children:[f.jsxs(st,{to:"/",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(kA,{className:"sidebar-icon"}),f.jsx("span",{children:"Overview"})]}),f.jsxs(st,{to:"/projects",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx(jA,{className:"sidebar-icon"}),f.jsx("span",{children:"Projects"})]}),f.jsxs(st,{to:"/runs",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(LA,{className:"sidebar-icon"}),f.jsx("span",{children:"Runs"})]}),f.jsxs(st,{to:"/traffic",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!1},children:[f.jsx($A,{className:"sidebar-icon"}),f.jsx("span",{children:"Server traffic"})]}),f.jsxs(st,{to:"/backlinks",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(_A,{className:"sidebar-icon"}),f.jsx("span",{children:"Backlinks"})]}),f.jsxs(st,{to:"/settings",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(ZA,{className:"sidebar-icon"}),f.jsx("span",{children:"Settings"})]}),i?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),[1,2,3].map(le=>f.jsxs("div",{className:"sidebar-skeleton-item",children:[f.jsx("span",{className:"skeleton-circle size-2"}),f.jsx("span",{className:"skeleton-text flex-1",style:{width:`${50+le*15}%`}})]},le))]}):F&&F.projects.length>0?f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Projects"}),F.projects.map(le=>{const pe=le.visibilitySummary.tone;return f.jsxs(st,{to:"/projects/$projectName",params:{projectName:le.project.name},className:"sidebar-project",activeProps:{className:"sidebar-project sidebar-project-active"},children:[f.jsx("span",{className:`sidebar-dot sidebar-dot-${pe}`}),f.jsx("span",{children:le.project.displayName||le.project.name})]},le.project.id)})]}):i?null:f.jsxs(f.Fragment,{children:[f.jsx("p",{className:"sidebar-section-title",children:"Resources"}),f.jsxs(st,{to:"/setup",className:"sidebar-link",activeProps:{className:"sidebar-link sidebar-link-active"},activeOptions:{exact:!0},children:[f.jsx(PA,{className:"sidebar-icon"}),f.jsx("span",{children:"Setup"})]})]})]}),f.jsx("div",{className:"sidebar-footer",children:Xb.map(({label:le,href:pe,Icon:$})=>f.jsx("a",{className:"sidebar-footer-icon",href:pe,target:"_blank",rel:"noopener noreferrer",title:le,"aria-label":le,children:f.jsx($,{className:"size-4"})},pe))})]}),f.jsxs("div",{className:"main-area",children:[f.jsxs("header",{className:"topbar",children:[f.jsxs("div",{className:"topbar-left",children:[f.jsx("div",{className:"topbar-brand-mobile",children:f.jsx($b,{compact:!0})}),f.jsxs("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:[f.jsx(st,{to:"/",children:"Home"}),f.jsx(Ff,{className:"breadcrumb-sep size-3"}),f.jsx("span",{className:"breadcrumb-current",children:Se})]})]}),f.jsxs("div",{className:"topbar-actions",children:[f.jsxs("div",{className:"health-pill-row",children:[f.jsxs("span",{className:`health-pill health-pill-${d.apiStatus.state}`,title:$s(d.apiStatus),children:["API ",d.apiStatus.state==="ok"?"ok":d.apiStatus.state]}),f.jsxs("span",{className:`health-pill health-pill-${d.workerStatus.state}`,title:$s(d.workerStatus),children:["Worker ",d.workerStatus.state==="ok"?"ok":d.workerStatus.state]})]}),f.jsxs(Ue,{className:"nav-toggle",variant:"secondary",size:"icon",type:"button","aria-expanded":x,"aria-controls":"mobile-nav",onClick:()=>N(le=>!le),children:[f.jsx(DA,{className:"size-4"}),f.jsx("span",{className:"sr-only",children:"Open navigation"})]})]})]}),f.jsxs("div",{id:"mobile-nav",className:`mobile-nav ${x?"mobile-nav-open":""}`,children:[f.jsxs(Ue,{className:"mobile-nav-close",variant:"ghost",size:"icon",type:"button",onClick:()=>N(!1),children:[f.jsx(Hs,{className:"size-5"}),f.jsx("span",{className:"sr-only",children:"Close navigation"})]}),f.jsx(st,{to:"/",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Overview"}),f.jsx(st,{to:"/projects",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Projects"}),f.jsx(st,{to:"/runs",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Runs"}),f.jsx(st,{to:"/traffic",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!1},children:"Server traffic"}),f.jsx(st,{to:"/settings",className:"mobile-nav-link",activeProps:{className:"mobile-nav-link mobile-nav-link-active"},activeOptions:{exact:!0},children:"Settings"}),F&&F.projects.length>0?f.jsxs("div",{className:"mobile-nav-section",children:[f.jsx("p",{className:"mobile-nav-section-title",children:"Projects"}),F.projects.map(le=>f.jsx(st,{to:"/projects/$projectName",params:{projectName:le.project.name},className:"mobile-nav-link",children:le.project.name},le.project.id))]}):null]}),f.jsx("main",{id:"content",className:"page-shell",children:i&&!e?f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-40"}),f.jsx("div",{className:"skeleton-text-sm w-72"})]}),f.jsx("div",{className:"page-skeleton-grid",children:[1,2,3].map(le=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-24"}),f.jsx("div",{className:"skeleton-text w-full"}),f.jsx("div",{className:"skeleton-text-sm w-3/4"})]},le))}),f.jsx("div",{className:"page-skeleton-grid",style:{gridTemplateColumns:"1fr 1fr"},children:[1,2].map(le=>f.jsxs("div",{className:"page-skeleton-card",children:[f.jsx("div",{className:"skeleton-text w-20"}),f.jsx("div",{className:"space-y-2",children:[1,2,3].map(pe=>f.jsx("div",{className:"skeleton-text-sm w-full"},pe))})]},le))})]}):f.jsx(Sf,{})}),f.jsxs("footer",{className:"footer",children:[f.jsxs("span",{className:"footer-brand",children:[f.jsx("span",{children:f.jsx("a",{href:"https://canonry.ai",children:"Canonry"})}),d.apiStatus.version&&d.apiStatus.version!=="unknown"?f.jsxs("span",{className:"footer-version",children:["v",d.apiStatus.version]}):null]}),f.jsx("div",{className:"footer-links",children:Xb.map(({label:le,href:pe,Icon:$})=>f.jsx("a",{href:pe,target:"_blank",rel:"noopener noreferrer",title:le,"aria-label":le,className:"footer-icon",children:f.jsx($,{className:"size-3.5"})},pe))})]})]}),M?f.jsxs(W3,{open:!0,title:M.summary,subtitle:`${M.projectName} · ${M.kindLabel}`,onClose:S,children:[f.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-sm",children:[f.jsx(kp,{status:M.status}),f.jsx("span",{className:"text-zinc-400",children:M.startedAt}),f.jsx("span",{className:"text-zinc-500",children:M.duration}),f.jsx("span",{className:"text-zinc-600",children:M.triggerLabel})]}),M.status==="failed"&&M.statusDetail&&f.jsx("p",{className:"text-sm text-rose-300/80 mt-2",children:M.statusDetail}),f.jsxs("div",{className:"mt-4",children:[f.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-zinc-500 mb-2",children:"Activity Log"}),X?f.jsx("p",{className:"text-sm text-zinc-500",children:"Loading run details..."}):Z?.snapshots&&Z.snapshots.length>0?f.jsxs("div",{className:"space-y-2",children:[Z.snapshots.map(le=>f.jsxs("div",{className:"rounded-lg border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[f.jsx("p",{className:"text-sm font-medium text-zinc-200 truncate",children:le.query??"Unknown query"}),f.jsxs("div",{className:"flex items-center gap-1.5",children:[f.jsx(Q3,{provider:le.provider}),f.jsx(mS,{variant:le.citationState===sc.cited?"success":"neutral",children:le.citationState})]})]}),le.model&&f.jsx("p",{className:"text-[11px] text-zinc-500 font-mono",children:le.model}),le.citedDomains.length>0&&f.jsxs("p",{className:"text-xs text-zinc-500 mt-1",children:[f.jsx("span",{className:"text-zinc-400",children:"Sources:"})," ",le.citedDomains.join(", ")]}),le.competitorOverlap.length>0&&f.jsxs("p",{className:"text-xs text-rose-400/80 mt-0.5",children:["Competitor cited: ",le.competitorOverlap.join(", ")]}),le.groundingSources&&le.groundingSources.length>0&&f.jsxs("details",{className:"mt-2",children:[f.jsxs("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:[le.groundingSources.length," grounding source",le.groundingSources.length!==1?"s":""]}),f.jsx("ul",{className:"mt-1 space-y-0.5",children:le.groundingSources.map((pe,$)=>{const W=Rf(pe.uri),fe=pe.title||pe.uri;return f.jsx("li",{className:"text-xs text-zinc-500 truncate",children:W?f.jsx("a",{href:W,target:"_blank",rel:"noopener noreferrer",className:"hover:text-zinc-300",children:fe}):f.jsx("span",{children:fe})},$)})})]}),le.answerText&&f.jsxs("details",{className:"mt-1",children:[f.jsx("summary",{className:"text-xs text-zinc-500 cursor-pointer hover:text-zinc-400",children:"Answer preview"}),f.jsx("p",{className:"mt-1 text-xs text-zinc-400 leading-relaxed whitespace-pre-wrap",children:le.answerText})]})]},le.id)),Z.status==="running"&&f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Running remaining queries..."]})]}):Z&&Z.status==="running"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),"Waiting for first query result..."]}):Z&&Z.status==="queued"?f.jsxs("div",{className:"flex items-center gap-2 p-3 text-sm text-zinc-500",children:[f.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-zinc-500 animate-pulse"}),"Run queued, waiting for execution slot..."]}):Z&&Z.error?f.jsxs("div",{className:"rounded-lg border border-rose-800/40 bg-rose-950/20 p-3",children:[f.jsx("p",{className:"text-sm font-medium text-rose-300 mb-2",children:"Run failed"}),f.jsx("pre",{className:"text-xs text-rose-300/80 whitespace-pre-wrap break-words max-h-48 overflow-y-auto font-mono leading-5",children:VD(Z.error)})]}):f.jsx("p",{className:"text-sm text-zinc-500",children:"No snapshot data available."})]})]}):null,Oe?f.jsx(aR,{evidence:Oe.evidence,project:Oe.project,onClose:S}):null,f.jsx(pM,{}),f.jsx(IR,{}),f.jsx(rM,{})]})}class hM extends q.Component{state={error:null};static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,i){console.error("[ErrorBoundary]",n,i.componentStack)}handleReset=()=>{this.setState({error:null})};render(){return this.state.error?f.jsx("div",{className:"page-container",children:f.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 py-20 text-center",children:[f.jsx("div",{className:"rounded-full bg-rose-950/40 p-3",children:f.jsx(Bv,{className:"size-6 text-rose-400"})}),f.jsx("h2",{className:"text-lg font-semibold text-zinc-100",children:"Something went wrong"}),f.jsx("p",{className:"text-sm text-zinc-400 max-w-md",children:this.state.error.message||"An unexpected error occurred while rendering this page."}),f.jsxs("div",{className:"flex gap-3 mt-2",children:[f.jsxs(Ue,{variant:"secondary",size:"sm",onClick:this.handleReset,children:[f.jsx(Mv,{className:"size-3.5 mr-1.5"}),"Try again"]}),f.jsx(Ue,{variant:"secondary",size:"sm",onClick:()=>{const n=window.__CANONRY_CONFIG__?.basePath?.replace(/\/$/,"")??"";window.location.href=n||"/"},children:"Go home"})]})]})}):this.props.children}}const kn=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("rounded-xl border border-zinc-800 bg-zinc-950/75 shadow-[0_0_0_1px_rgba(255,255,255,0.01)]",e),...n}));kn.displayName="Card";const Mf=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("flex flex-col gap-1.5 p-5",e),...n}));Mf.displayName="CardHeader";const Bf=q.forwardRef(({className:e,...n},i)=>f.jsx("h3",{ref:i,className:Tn("font-medium tracking-tight text-zinc-50",e),...n}));Bf.displayName="CardTitle";const Lf=q.forwardRef(({className:e,...n},i)=>f.jsx("p",{ref:i,className:Tn("text-sm text-zinc-500",e),...n}));Lf.displayName="CardDescription";const Yl=q.forwardRef(({className:e,...n},i)=>f.jsx("div",{ref:i,className:Tn("p-5 pt-0",e),...n}));Yl.displayName="CardContent";function gM({points:e,tone:n}){const i=q.useId();if(e.length===0)return null;const r=42,l=132,c=5,d=Math.min(...e),g=Math.max(...e)-d||1,v=l-c*2,S=r-c*2,x=e.map((N,_)=>{const z=c+_/Math.max(e.length-1,1)*v,k=c+(1-(N-d)/g)*S;return`${z},${k}`}).join(" ");return f.jsxs("svg",{className:`sparkline sparkline-${n}`,viewBox:`0 0 ${l} ${r}`,"aria-hidden":"true",children:[f.jsx("defs",{children:f.jsx("clipPath",{id:i,children:f.jsx("rect",{x:c,y:c,width:v,height:S,rx:"8"})})}),f.jsx("line",{className:"sparkline-guide",x1:c,x2:l-c,y1:r-c,y2:r-c}),f.jsx("polyline",{clipPath:`url(#${i})`,points:x,vectorEffect:"non-scaling-stroke"})]})}function yM({project:e}){return f.jsxs(st,{to:"/projects/$projectName",params:{projectName:e.project.name},className:"project-row cursor-pointer",children:[f.jsx("div",{className:"project-row-chart",children:f.jsx(gM,{points:e.trend,tone:Y0(e.lastRun.status)})}),f.jsxs("div",{className:"project-row-primary",children:[f.jsxs("div",{children:[f.jsx("p",{className:"project-name",children:e.project.name}),f.jsx("p",{className:"project-domain",children:e.project.canonicalDomain})]}),f.jsx("p",{className:"project-insight",children:e.insight})]}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Mentioned"}),f.jsx("p",{className:`metric-inline-value ${e.mentionTone==="caution"?"text-amber-400":""}`,children:e.mentionScore}),f.jsx("p",{className:"metric-inline-delta",children:e.mentionDelta}),e.providerCoverage&&f.jsx("p",{className:"text-[10px] font-medium text-amber-400/80",children:e.providerCoverage})]})}),f.jsx("div",{className:"project-row-stat",children:f.jsxs("div",{className:"metric-inline-block",children:[f.jsx("p",{className:"metric-inline-label",children:"Competitor Pressure"}),f.jsx("p",{className:"metric-inline-value",children:e.competitorPressureLabel})]})}),f.jsx("span",{className:"project-row-link",children:f.jsx(Ff,{className:"h-4 w-4 text-zinc-500"})})]})}function bM(){const e=uo(),{dashboard:n,isLoading:i}=kc(),r=n??e?.dashboard;if(!r||i)return f.jsxs("div",{className:"page-skeleton",children:[f.jsxs("div",{className:"page-skeleton-header",children:[f.jsx("div",{className:"skeleton-text h-6 w-32"}),f.jsx("div",{className:"skeleton-text-sm w-64"})]}),f.jsx("div",{className:"space-y-3",children:[1,2,3].map(S=>f.jsxs("div",{className:"rounded-xl border border-zinc-800/60 bg-zinc-900/30 p-4 flex items-center gap-4",children:[f.jsxs("div",{className:"flex-1 space-y-2",children:[f.jsx("div",{className:"skeleton-text w-36"}),f.jsx("div",{className:"skeleton-text-sm w-48"})]}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton-text w-16"}),f.jsx("div",{className:"skeleton h-8 w-20 rounded"})]},S))})]});const l=r.portfolioOverview,h=_p(!e,e?.health).data??e?.health??{apiStatus:{label:"API",state:"checking",detail:"Checking service health"},workerStatus:{label:"Worker",state:"checking",detail:"Checking service health"}},g=$4(l.systemHealth,h,r.settings),{openRun:v}=Cp();return f.jsxs("div",{className:"page-container",children:[f.jsxs("div",{className:"page-header",children:[f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Portfolio"}),f.jsx("p",{className:"page-subtitle",children:"Visibility and execution state across all projects"})]}),f.jsx("div",{className:"page-header-right",children:f.jsx("p",{className:"text-[11px] text-zinc-600",children:l.lastUpdatedAt})})]}),l.projects.length>0?f.jsx("div",{className:"project-list project-list-scrollable",children:l.projects.map(S=>f.jsx(yM,{project:S},S.project.id))}):f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h3",{children:l.emptyState?.title??"No projects yet"}),f.jsx("p",{className:"supporting-copy",children:l.emptyState?.detail}),f.jsx(Ue,{size:"sm",asChild:!0,children:f.jsx(st,{to:l.emptyState?.ctaHref==="/setup"||!l.emptyState?.ctaHref?"/setup":"/",children:l.emptyState?.ctaLabel??"Launch setup"})})]}),f.jsxs("div",{className:"overview-secondary-grid",children:[l.attentionItems.length>0&&f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Needs attention"}),f.jsx("h2",{className:"section-title-sm",children:"What changed"})]})}),f.jsx("div",{className:"attention-list attention-list-scrollable",children:l.attentionItems.map(S=>S.href?f.jsxs(st,{to:S.href,className:`attention-item attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id):f.jsxs("div",{className:`attention-item attention-item-static attention-item-${S.tone}`,children:[f.jsxs("div",{children:[f.jsx("p",{className:"attention-title",children:S.title}),f.jsx("p",{className:"attention-detail",children:S.detail})]}),S.actionLabel&&f.jsx("span",{className:"attention-action",children:S.actionLabel})]},S.id))})]}),f.jsxs("section",{className:"overview-secondary-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Recent runs"}),f.jsx("h2",{className:"section-title-sm",children:"Activity"})]})}),f.jsx("div",{className:"compact-stack compact-stack-scrollable",children:l.recentRuns.length>0?l.recentRuns.map(S=>f.jsxs("button",{className:"compact-run",type:"button",onClick:()=>v(S.id),children:[f.jsxs("div",{children:[f.jsx("p",{className:"compact-run-title",children:S.projectName}),f.jsx("p",{className:"compact-run-detail",children:S.summary})]}),f.jsx(kp,{status:S.status})]},S.id)):f.jsx("p",{className:"supporting-copy",children:"Run history appears here after the first launch."})})]})]}),f.jsxs("section",{className:"page-section",children:[f.jsx("div",{className:"section-head section-head-inline",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"System health"}),f.jsx("h2",{className:"section-title-sm",children:"Infrastructure"})]})}),f.jsx("div",{className:"health-grid",children:g.map(S=>f.jsxs(kn,{className:"surface-card compact-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:S.label}),f.jsx("h3",{children:S.detail})]}),f.jsx(Bn,{tone:S.tone,title:S.id==="api"?$s(h.apiStatus):S.id==="worker"?$s(h.workerStatus):void 0,children:S.label})]}),f.jsx("p",{className:"supporting-copy",children:S.meta})]},S.id))})]})]})}const Op=Symbol.for("yaml.alias"),qf=Symbol.for("yaml.document"),Xa=Symbol.for("yaml.map"),CS=Symbol.for("yaml.pair"),Qn=Symbol.for("yaml.scalar"),Xs=Symbol.for("yaml.seq"),Cn=Symbol.for("yaml.node.type"),Di=e=>!!e&&typeof e=="object"&&e[Cn]===Op,Ac=e=>!!e&&typeof e=="object"&&e[Cn]===qf,fo=e=>!!e&&typeof e=="object"&&e[Cn]===Xa,xt=e=>!!e&&typeof e=="object"&&e[Cn]===CS,nt=e=>!!e&&typeof e=="object"&&e[Cn]===Qn,po=e=>!!e&&typeof e=="object"&&e[Cn]===Xs;function bt(e){if(e&&typeof e=="object")switch(e[Cn]){case Xa:case Xs:return!0}return!1}function St(e){if(e&&typeof e=="object")switch(e[Cn]){case Op:case Xa:case Qn:case Xs:return!0}return!1}const zS=e=>(nt(e)||bt(e))&&!!e.anchor,ji=Symbol("break visit"),vM=Symbol("skip children"),to=Symbol("remove node");function Js(e,n){const i=SM(n);Ac(e)?Es(null,e.contents,i,Object.freeze([e]))===to&&(e.contents=null):Es(null,e,i,Object.freeze([]))}Js.BREAK=ji;Js.SKIP=vM;Js.REMOVE=to;function Es(e,n,i,r){const l=xM(e,n,i,r);if(St(l)||xt(l))return wM(e,r,l),Es(e,l,i,r);if(typeof l!="symbol"){if(bt(n)){r=Object.freeze(r.concat(n));for(let c=0;c<n.items.length;++c){const d=Es(c,n.items[c],i,r);if(typeof d=="number")c=d-1;else{if(d===ji)return ji;d===to&&(n.items.splice(c,1),c-=1)}}}else if(xt(n)){r=Object.freeze(r.concat(n));const c=Es("key",n.key,i,r);if(c===ji)return ji;c===to&&(n.key=null);const d=Es("value",n.value,i,r);if(d===ji)return ji;d===to&&(n.value=null)}}return l}function SM(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function xM(e,n,i,r){if(typeof i=="function")return i(e,n,r);if(fo(n))return i.Map?.(e,n,r);if(po(n))return i.Seq?.(e,n,r);if(xt(n))return i.Pair?.(e,n,r);if(nt(n))return i.Scalar?.(e,n,r);if(Di(n))return i.Alias?.(e,n,r)}function wM(e,n,i){const r=n[n.length-1];if(bt(r))r.items[e]=i;else if(xt(r))e==="key"?r.key=i:r.value=i;else if(Ac(r))r.contents=i;else{const l=Di(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${l} parent`)}}const jM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},NM=e=>e.replace(/[!,[\]{}]/g,n=>jM[n]);class Ht{constructor(n,i){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ht.defaultYaml,n),this.tags=Object.assign({},Ht.defaultTags,i)}clone(){const n=new Ht(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new Ht(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ht.defaultTags);break}return n}add(n,i){this.atNextDocument&&(this.yaml={explicit:Ht.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ht.defaultTags),this.atNextDocument=!1);const r=n.trim().split(/[ \t]+/),l=r.shift();switch(l){case"%TAG":{if(r.length!==2&&(i(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[c,d]=r;return this.tags[c]=d,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return i(0,"%YAML directive should contain exactly one part"),!1;const[c]=r;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const d=/^\d+\.\d+$/.test(c);return i(6,`Unsupported YAML version ${c}`,d),!1}}default:return i(0,`Unknown directive ${l}`,!0),!1}}tagName(n,i){if(n==="!")return"!";if(n[0]!=="!")return i(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const d=n.slice(2,-1);return d==="!"||d==="!!"?(i(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&i("Verbatim tags must end with a >"),d)}const[,r,l]=n.match(/^(.*!)([^!]*)$/s);l||i(`The ${n} tag has no suffix`);const c=this.tags[r];if(c)try{return c+decodeURIComponent(l)}catch(d){return i(String(d)),null}return r==="!"?n:(i(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[i,r]of Object.entries(this.tags))if(n.startsWith(r))return i+NM(n.substring(r.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const i=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let l;if(n&&r.length>0&&St(n.contents)){const c={};Js(n.contents,(d,h)=>{St(h)&&h.tag&&(c[h.tag]=!0)}),l=Object.keys(c)}else l=[];for(const[c,d]of r)c==="!!"&&d==="tag:yaml.org,2002:"||(!n||l.some(h=>h.startsWith(d)))&&i.push(`%TAG ${c} ${d}`);return i.join(`
|
|
65
65
|
`)}}Ht.defaultYaml={explicit:!1,version:"1.2"};Ht.defaultTags={"!!":"tag:yaml.org,2002:"};function TS(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const i=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(i)}return!0}function ES(e){const n=new Set;return Js(e,{Value(i,r){r.anchor&&n.add(r.anchor)}}),n}function OS(e,n){for(let i=1;;++i){const r=`${e}${i}`;if(!n.has(r))return r}}function kM(e,n){const i=[],r=new Map;let l=null;return{onAnchor:c=>{i.push(c),l??(l=ES(e));const d=OS(n,l);return l.add(d),d},setAnchors:()=>{for(const c of i){const d=r.get(c);if(typeof d=="object"&&d.anchor&&(nt(d.node)||bt(d.node)))d.node.anchor=d.anchor;else{const h=new Error("Failed to resolve repeated object (this should not happen)");throw h.source=c,h}}},sourceObjects:r}}function Os(e,n,i,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let l=0,c=r.length;l<c;++l){const d=r[l],h=Os(e,r,String(l),d);h===void 0?delete r[l]:h!==d&&(r[l]=h)}else if(r instanceof Map)for(const l of Array.from(r.keys())){const c=r.get(l),d=Os(e,r,l,c);d===void 0?r.delete(l):d!==c&&r.set(l,d)}else if(r instanceof Set)for(const l of Array.from(r)){const c=Os(e,r,l,l);c===void 0?r.delete(l):c!==l&&(r.delete(l),r.add(c))}else for(const[l,c]of Object.entries(r)){const d=Os(e,r,l,c);d===void 0?delete r[l]:d!==c&&(r[l]=d)}return e.call(n,i,r)}function _n(e,n,i){if(Array.isArray(e))return e.map((r,l)=>_n(r,String(l),i));if(e&&typeof e.toJSON=="function"){if(!i||!zS(e))return e.toJSON(n,i);const r={aliasCount:0,count:1,res:void 0};i.anchors.set(e,r),i.onCreate=c=>{r.res=c,delete i.onCreate};const l=e.toJSON(n,i);return i.onCreate&&i.onCreate(l),l}return typeof e=="bigint"&&!i?.keep?Number(e):e}class Dp{constructor(n){Object.defineProperty(this,Cn,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:i,maxAliasCount:r,onAnchor:l,reviver:c}={}){if(!Ac(n))throw new TypeError("A document argument is required");const d={anchors:new Map,doc:n,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=_n(this,"",d);if(typeof l=="function")for(const{count:g,res:v}of d.anchors.values())l(v,g);return typeof c=="function"?Os(c,{"":h},"",h):h}}class Rp extends Dp{constructor(n){super(Op),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,i){let r;i?.aliasResolveCache?r=i.aliasResolveCache:(r=[],Js(n,{Node:(c,d)=>{(Di(d)||zS(d))&&r.push(d)}}),i&&(i.aliasResolveCache=r));let l;for(const c of r){if(c===this)break;c.anchor===this.source&&(l=c)}return l}toJSON(n,i){if(!i)return{source:this.source};const{anchors:r,doc:l,maxAliasCount:c}=i,d=this.resolve(l,i);if(!d){const g=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(g)}let h=r.get(d);if(h||(_n(d,null,i),h=r.get(d)),h?.res===void 0){const g="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(g)}if(c>=0&&(h.count+=1,h.aliasCount===0&&(h.aliasCount=Xl(l,d,r)),h.count*h.aliasCount>c)){const g="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(g)}return h.res}toString(n,i,r){const l=`*${this.source}`;if(n){if(TS(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${l} `}return l}}function Xl(e,n,i){if(Di(n)){const r=n.resolve(e),l=i&&r&&i.get(r);return l?l.count*l.aliasCount:0}else if(bt(n)){let r=0;for(const l of n.items){const c=Xl(e,l,i);c>r&&(r=c)}return r}else if(xt(n)){const r=Xl(e,n.key,i),l=Xl(e,n.value,i);return Math.max(r,l)}return 1}const DS=e=>!e||typeof e!="function"&&typeof e!="object";class Ce extends Dp{constructor(n){super(Qn),this.value=n}toJSON(n,i){return i?.keep?this.value:_n(this.value,n,i)}toString(){return String(this.value)}}Ce.BLOCK_FOLDED="BLOCK_FOLDED";Ce.BLOCK_LITERAL="BLOCK_LITERAL";Ce.PLAIN="PLAIN";Ce.QUOTE_DOUBLE="QUOTE_DOUBLE";Ce.QUOTE_SINGLE="QUOTE_SINGLE";const AM="tag:yaml.org,2002:";function _M(e,n,i){if(n){const r=i.filter(c=>c.tag===n),l=r.find(c=>!c.format)??r[0];if(!l)throw new Error(`Tag ${n} not found`);return l}return i.find(r=>r.identify?.(e)&&!r.format)}function oo(e,n,i){if(Ac(e)&&(e=e.contents),St(e))return e;if(xt(e)){const x=i.schema[Xa].createNode?.(i.schema,null,i);return x.items.push(e),x}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:l,onTagObj:c,schema:d,sourceObjects:h}=i;let g;if(r&&e&&typeof e=="object"){if(g=h.get(e),g)return g.anchor??(g.anchor=l(e)),new Rp(g.anchor);g={anchor:null,node:null},h.set(e,g)}n?.startsWith("!!")&&(n=AM+n.slice(2));let v=_M(e,n,d.tags);if(!v){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const x=new Ce(e);return g&&(g.node=x),x}v=e instanceof Map?d[Xa]:Symbol.iterator in Object(e)?d[Xs]:d[Xa]}c&&(c(v),delete i.onTagObj);const S=v?.createNode?v.createNode(i.schema,e,i):typeof v?.nodeClass?.from=="function"?v.nodeClass.from(i.schema,e,i):new Ce(e);return n?S.tag=n:v.default||(S.tag=v.tag),g&&(g.node=S),S}function uc(e,n,i){let r=i;for(let l=n.length-1;l>=0;--l){const c=n[l];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const d=[];d[c]=r,r=d}else r=new Map([[c,r]])}return oo(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const eo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class RS extends Dp{constructor(n,i){super(n),Object.defineProperty(this,"schema",{value:i,configurable:!0,enumerable:!1,writable:!0})}clone(n){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(i.schema=n),i.items=i.items.map(r=>St(r)||xt(r)?r.clone(n):r),this.range&&(i.range=this.range.slice()),i}addIn(n,i){if(eo(n))this.add(i);else{const[r,...l]=n,c=this.get(r,!0);if(bt(c))c.addIn(l,i);else if(c===void 0&&this.schema)this.set(r,uc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}deleteIn(n){const[i,...r]=n;if(r.length===0)return this.delete(i);const l=this.get(i,!0);if(bt(l))return l.deleteIn(r);throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}getIn(n,i){const[r,...l]=n,c=this.get(r,!0);return l.length===0?!i&&nt(c)?c.value:c:bt(c)?c.getIn(l,i):void 0}hasAllNullValues(n){return this.items.every(i=>{if(!xt(i))return!1;const r=i.value;return r==null||n&&nt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(n){const[i,...r]=n;if(r.length===0)return this.has(i);const l=this.get(i,!0);return bt(l)?l.hasIn(r):!1}setIn(n,i){const[r,...l]=n;if(l.length===0)this.set(r,i);else{const c=this.get(r,!0);if(bt(c))c.setIn(l,i);else if(c===void 0&&this.schema)this.set(r,uc(this.schema,l,i));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${l}`)}}}const CM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ha(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Ni=(e,n,i)=>e.endsWith(`
|
|
66
66
|
`)?ha(i,n):i.includes(`
|
|
67
67
|
`)?`
|
|
@@ -207,4 +207,4 @@ spec:
|
|
|
207
207
|
`);$(rt)}}catch(ie){Qe(ie instanceof Error?ie.message:"Failed to generate queries")}finally{xe(!1)}}},Ui=async()=>{if(!oe)return;const ie=_t;if(ie.length!==0){Mi(!0),go(null);try{await Ak(oe,ie),er(!0),await r(),N(4)}catch(rt){go(rt instanceof Error?rt.message:"Failed to save competitors")}finally{Mi(!1)}}},$i=async()=>{const ie=va.trim();if(ie){wo(!0),Sa(null);try{await Tk("gemini",{apiKey:ie}),tn({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),xo(""),await r()}catch(rt){Sa(rt instanceof Error?rt.message:"Failed to save Gemini key")}finally{wo(!1)}}},Zn=async()=>{if(oe){bo(!0);try{const ie=await vo.mutateAsync({projectName:oe,projectLabel:k||_||oe,sourceAction:"setup-launch"});qc(ie.id),nr(!0),await r()}catch{}finally{bo(!1)}}},pn=()=>N(ie=>Math.max(0,ie-1)),ai=(()=>{switch(x){case 0:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsx("div",{className:"section-head",children:f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),f.jsx("h2",{children:"System ready"})]})}),f.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),f.jsx("div",{className:"compact-stack",children:v.healthChecks.map(ie=>f.jsxs("div",{className:"health-check-row",children:[f.jsxs("div",{children:[f.jsx("p",{className:"run-row-title",children:ie.label}),f.jsx("p",{className:"supporting-copy",children:ie.detail}),ie.id==="provider"&&ie.state!=="ready"&&f.jsxs("div",{className:"mt-3 rounded-md border border-zinc-800/60 bg-zinc-900/40 p-3 space-y-2",children:[f.jsxs("p",{className:"text-xs text-zinc-400",children:["Paste a Gemini key to enable visibility checks (free at"," ",f.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"aistudio.google.com"}),")."]}),f.jsxs("div",{className:"flex items-center gap-2",children:[f.jsx("input",{type:"password",value:va,onChange:rt=>xo(rt.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-zinc-800 bg-zinc-950 px-2.5 py-1.5 text-sm text-zinc-100 placeholder:text-zinc-600 focus:border-zinc-600 focus:outline-none font-mono",disabled:Li}),f.jsx(Ue,{type:"button",size:"sm",disabled:Li||!va.trim(),onClick:Nn($i),children:Li?"Saving...":"Save"})]}),jo&&f.jsx("p",{className:"text-xs text-rose-400",children:jo}),f.jsxs("p",{className:"text-[11px] text-zinc-600",children:["Other providers (OpenAI, Claude, Perplexity) configurable later via"," ",f.jsx(st,{to:"/settings",className:"text-zinc-500 hover:text-zinc-300 underline underline-offset-2",children:"/settings"}),"."]})]})]}),f.jsx(Bn,{tone:ie.state==="ready"?"positive":"caution",title:ie.id==="api"?$s(g.apiStatus):ie.id==="worker"?$s(g.workerStatus):ie.detail,children:ie.state==="ready"?"Ready":"Attention"})]},ie.id))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",disabled:!Uc,onClick:()=>N(1),children:"Continue"})]})]});case 1:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),f.jsx("h2",{children:"Create project"})]}),oe?f.jsx(Bn,{tone:"positive",children:"Created"}):null]}),oe?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Project ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe})," created successfully."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(2),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),f.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:_,onChange:ie=>z(ie.target.value)}),ht&&ht!==_?f.jsxs("p",{className:"supporting-copy",children:["Slug: ",ht]}):null]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),f.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:k,onChange:ie=>E(ie.target.value)})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),f.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:R,onChange:ie=>I(ie.target.value)})]}),f.jsxs("div",{className:"setup-field-row",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),f.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:P,onChange:ie=>Z(ie.target.value.toUpperCase())})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),f.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:X,onChange:ie=>F(ie.target.value.toLowerCase())})]})]}),f.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 cursor-pointer hover:border-zinc-700",children:[f.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-zinc-700 bg-zinc-950",checked:O,onChange:ie=>M(ie.target.checked)}),f.jsxs("span",{className:"flex-1",children:[f.jsx("span",{className:"block text-sm text-zinc-100",children:"Auto-extract backlinks"}),f.jsxs("span",{className:"block text-xs text-zinc-500 mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",f.jsx(st,{to:"/backlinks",className:"text-emerald-400 hover:text-emerald-300 underline underline-offset-2",children:"Manage backlinks"})]})]})]}),Oe?f.jsx("p",{className:"text-rose-400 text-sm",children:Oe}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:!ht||!R||He,onClick:Nn($c),children:He?"Creating...":"Create project"})]})]})]});case 2:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),f.jsx("h2",{children:"Add queries"})]}),W?f.jsxs(Bn,{tone:"positive",children:[Mt.length," saved"]}):f.jsxs(Bn,{tone:"neutral",children:[Mt.length," quer",Mt.length!==1?"ies":"y"]})]}),f.jsx("p",{className:"supporting-copy",children:"Enter the search queries you want to track. One per line."}),W?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:Mt.map(ie=>f.jsx("li",{children:ie},ie))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(3),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[ue.length>0?f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"auto-generate",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"flex items-end gap-2",children:[f.jsxs("div",{className:"setup-field flex-1",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),f.jsx("select",{id:"gen-provider",className:"setup-input",value:ee,onChange:ie=>de(ie.target.value),children:ue.map(ie=>f.jsxs("option",{value:ie.name,children:[ie.displayName??ie.name,ie.model?` (${ie.model})`:""]},ie.name))})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),f.jsx("select",{id:"gen-count",className:"setup-input",value:ae,onChange:ie=>Ne(Number(ie.target.value)),children:[3,5,10,15,20].map(ie=>f.jsx("option",{value:ie,children:ie},ie))})]}),f.jsx(Ue,{type:"button",variant:"outline",disabled:tt||!ee,onClick:Nn(qi),children:tt?"Analyzing site...":"Generate"})]}),$e?f.jsx("p",{className:"text-rose-400 text-sm",children:$e}):null]}):null,f.jsxs("div",{className:"flex items-center gap-2 text-zinc-500 text-xs uppercase tracking-wide",children:[f.jsx("span",{className:"flex-1 border-t border-zinc-800"}),"or type manually",f.jsx("span",{className:"flex-1 border-t border-zinc-800"})]}),f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),f.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
|
|
208
208
|
best invisalign downtown brooklyn
|
|
209
209
|
pediatric dentist brooklyn heights`,value:pe,onChange:ie=>$(ie.target.value)})]}),je?f.jsx("p",{className:"text-rose-400 text-sm",children:je}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:Mt.length===0||Ye,onClick:Nn(Vc),children:Ye?"Saving...":`Save ${Mt.length} quer${Mt.length!==1?"ies":"y"}`})]})]})]});case 3:return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),f.jsx("h2",{children:"Add competitors"})]}),Rt?f.jsx(Bn,{tone:"positive",children:"Saved"}):null]}),f.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Rt?f.jsxs("div",{className:"compact-stack",children:[f.jsx("ul",{className:"detail-list",children:_t.map(ie=>f.jsx("li",{children:ie},ie))}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",onClick:()=>N(4),children:"Continue"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("div",{className:"setup-field",children:[f.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),f.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
|
|
210
|
-
competitor2.com`,value:Dt,onChange:ie=>Un(ie.target.value)})]}),Ri?f.jsx("p",{className:"text-rose-400 text-sm",children:Ri}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:_t.length===0||tr,onClick:Nn(Ui),children:tr?"Saving...":`Save ${_t.length} competitor${_t.length!==1?"s":""}`})]})]})]})]});case 4:{const ie=So.data,rt=ie?.status==="completed"||ie?.status==="partial"||ie?.status==="failed"||ie?.status==="cancelled",Yn=ie?.snapshots??[],ii=Yn.filter($n=>$n.citationState==="cited").length,Ic=Yn.filter($n=>$n.answerMentioned===!0).length,ar=new Set(Yn.map($n=>$n.query).filter($n=>!!$n)).size,No=Bi?rt&&(ie?.status==="completed"||ie?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):rt?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),No]}),Bi?rt?ie?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Ic,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[ii,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:Yn.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ie?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:yo,onClick:Nn(Zn),children:yo?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx(BB,{current:x,labels:MB}),f.jsx("section",{className:"setup-wizard",children:ai})]})}function qB(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Ue,{asChild:!0,children:f.jsx(st,{to:"/",children:"Return to overview"})})]})})})}const ba=Ps(()=>Gs(()=>import("./ProjectPage-6n6qXa-G.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),UB=Ps(()=>Gs(()=>import("./RunsPage-DOdjY-ia.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),$B=Ps(()=>Gs(()=>import("./SettingsPage-DYW3Lfre.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),VB=Ps(()=>Gs(()=>import("./BacklinksPage-CAzeiWX-.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),IB=Ps(()=>Gs(()=>import("./TrafficPage-DX8A16LI.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),PB=Ps(()=>Gs(()=>import("./TrafficSourceDetailPage-COLKpEny.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function GB(){return f.jsx(hM,{children:f.jsx(mM,{})})}const nn=Ow()({component:GB,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),HB=Tt({getParentRoute:()=>nn,path:"/",component:bM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ei({client:te}));if(n&&n.length===0)throw Gf({to:"/setup"})}}),QB=Tt({getParentRoute:()=>nn,path:"/projects",component:TB}),KB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kn=Tt({getParentRoute:()=>nn,path:"/projects/$projectName",component:()=>f.jsx(Sf,{}),beforeLoad:async({context:e,params:n,location:i})=>{const r=n.projectName;if(!KB.test(r))return;let l=e.queryClient.getQueryData(Ei({client:te}));if(!l)try{l=await e.queryClient.ensureQueryData(xc({client:te}))}catch{return}const c=l.find(d=>d.id===r);if(c)throw Gf({to:i.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(c.name)}`),replace:!0})}}),ZB=Tt({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),YB=Tt({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),XB=Tt({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),JB=Tt({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),FB=Tt({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),WB=Tt({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),e5=Tt({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),t5=Tt({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),n5=Tt({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),a5=Tt({getParentRoute:()=>nn,path:"/runs",component:UB}),i5=Tt({getParentRoute:()=>nn,path:"/settings",component:$B,beforeLoad:({context:e})=>{}}),s5=Tt({getParentRoute:()=>nn,path:"/setup",component:LB,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ei({client:te}));if(n&&n.length>0)throw Gf({to:"/"})}}),r5=Tt({getParentRoute:()=>nn,path:"/backlinks",component:VB}),o5=Tt({getParentRoute:()=>nn,path:"/traffic",component:IB}),l5=Tt({getParentRoute:()=>nn,path:"/traffic/$projectName/$sourceId",component:PB}),c5=Tt({getParentRoute:()=>nn,path:"*",component:qB}),u5=nn.addChildren([HB,QB,Kn.addChildren([ZB,YB,XB,JB,FB,WB,e5,t5,n5]),a5,i5,s5,r5,o5,l5,c5]);function d5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const uv=d5(),f5=uv==="/"?"":uv.replace(/\/$/,"");function p5(e,n){return Dw({routeTree:u5,basepath:f5||"/",context:{queryClient:e},...n?.initialEntries})}const m5=6e4;function h5(){const[e,n]=q.useState(sf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,v]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),_=q.useRef(null),z=()=>{if(!N.current){const R=Fk();_.current=R,N.current=p5(R)}return{queryClient:_.current,router:N.current}};q.useEffect(()=>{if(sf())return;let R=!1;return Qy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||sf())return;const R=setInterval(()=>{Qy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},m5);return Hy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Hy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}v(!0),h(null);try{if(!(await Ck(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Setup failed")}finally{v(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){v(!0),h(null);try{if(!(await zk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Authentication failed")}finally{v(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=z();return f.jsx(Rw,{client:R,children:f.jsx(Mw,{router:I})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(kn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Yl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Mf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Bf,{children:"Create a dashboard password"}),f.jsx(Lf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Yl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:Nn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Mf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Bf,{children:"Sign in to Canonry"}),f.jsx(Lf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Yl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:Nn(E),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const f1=document.getElementById("root");if(!f1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(f1).render(f.jsx(q.StrictMode,{children:f.jsx(h5,{})}));export{m6 as $,KL as A,Ue as B,sc as C,E5 as D,FL as E,e6 as F,TL as G,t6 as H,Xr as I,V5 as J,$5 as K,P5 as L,tn as M,F5 as N,i6 as O,Q3 as P,s6 as Q,H5 as R,$D as S,Bn as T,n6 as U,a6 as V,WL as W,I5 as X,Q5 as Y,r6 as Z,o6 as _,L6 as a,D5 as a$,u6 as a0,f6 as a1,d6 as a2,p6 as a3,$k as a4,F0 as a5,Ae as a6,c6 as a7,K4 as a8,_i as a9,Z5 as aA,Ei as aB,Y5 as aC,wp as aD,R6 as aE,B6 as aF,M6 as aG,K5 as aH,mA as aI,Bv as aJ,R4 as aK,B4 as aL,M4 as aM,ML as aN,k6 as aO,RL as aP,rL as aQ,H6 as aR,qL as aS,BL as aT,UL as aU,$L as aV,DL as aW,LL as aX,C5 as aY,_5 as aZ,A5 as a_,l6 as aa,fE as ab,pE as ac,OL as ad,EL as ae,AL as af,yL as ag,jL as ah,NL as ai,Hn as aj,kL as ak,S5 as al,zA as am,HL as an,_A as ao,LA as ap,X4 as aq,Wl as ar,CL as as,_L as at,kf as au,A6 as av,G5 as aw,E6 as ax,O6 as ay,D6 as az,Ff as b,yS as b$,XL as b0,zb as b1,YL as b2,R5 as b3,M5 as b4,ZL as b5,B5 as b6,L5 as b7,U5 as b8,q5 as b9,g6 as bA,GL as bB,W5 as bC,eL as bD,tL as bE,iL as bF,kc as bG,$6 as bH,kp as bI,Tk as bJ,O5 as bK,X5 as bL,J5 as bM,_p as bN,sL as bO,$s as bP,Tb as bQ,hL as bR,bL as bS,SL as bT,xL as bU,gL as bV,vL as bW,wL as bX,K3 as bY,gS as bZ,F3 as b_,uo as ba,xc as bb,BR as bc,RB as bd,Qt as be,wk as bf,z5 as bg,j5 as bh,N5 as bi,T5 as bj,U6 as bk,xk as bl,Ak as bm,w5 as bn,x5 as bo,Nk as bp,k5 as bq,G6 as br,e4 as bs,h6 as bt,y6 as bu,Rk as bv,b6 as bw,aL as bx,nL as by,v6 as bz,et as c,bS as c0,jA as c1,mL as c2,Jy as c3,z6 as c4,VL as c5,IL as c6,xp as c7,JL as c8,Hs as c9,_6 as ca,T6 as cb,pL as cc,dL as cd,fL as ce,uL as cf,C6 as cg,$T as d,q6 as e,QL as f,kn as g,Vb as h,Nn as i,zL as j,S6 as k,te as l,x6 as m,w6 as n,N6 as o,j6 as p,oL as q,cL as r,lL as s,ID as t,Cp as u,V6 as v,I6 as w,P6 as x,Rf as y,PL as z};
|
|
210
|
+
competitor2.com`,value:Dt,onChange:ie=>Un(ie.target.value)})]}),Ri?f.jsx("p",{className:"text-rose-400 text-sm",children:Ri}):null,f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsxs("div",{className:"flex gap-2",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>N(4),children:"Skip"}),f.jsx(Ue,{type:"button",disabled:_t.length===0||tr,onClick:Nn(Ui),children:tr?"Saving...":`Save ${_t.length} competitor${_t.length!==1?"s":""}`})]})]})]})]});case 4:{const ie=So.data,rt=ie?.status==="completed"||ie?.status==="partial"||ie?.status==="failed"||ie?.status==="cancelled",Yn=ie?.snapshots??[],ii=Yn.filter($n=>$n.citationState==="cited").length,Ic=Yn.filter($n=>$n.answerMentioned===!0).length,ar=new Set(Yn.map($n=>$n.query).filter($n=>!!$n)).size,No=Bi?rt&&(ie?.status==="completed"||ie?.status==="partial")?f.jsx(Bn,{tone:"positive",children:"Complete"}):rt?f.jsx(Bn,{tone:"negative",children:"Failed"}):f.jsx(Bn,{tone:"caution",children:"Running"}):null;return f.jsxs(kn,{className:"surface-card step-card",children:[f.jsxs("div",{className:"section-head",children:[f.jsxs("div",{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),f.jsx("h2",{children:"Launch first run"})]}),No]}),Bi?rt?ie?.status==="failed"?f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-rose-400",children:"Sweep failed. Inspect the run on the project page for the provider error and retry from there."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"text-zinc-300",children:["Sweep complete. Your first answer-visibility snapshot for"," ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),":"]}),f.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Mentioned"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[Ic,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with brand in answer"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Cited"}),f.jsxs("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:[ii,f.jsxs("span",{className:"text-zinc-600 text-lg",children:[" / ",ar]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"queries with domain in sources"})]}),f.jsxs("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3",children:[f.jsx("p",{className:"text-[10px] uppercase tracking-wide text-zinc-500",children:"Snapshots"}),f.jsx("p",{className:"text-2xl font-bold tabular-nums text-zinc-50 mt-1",children:Yn.length}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-0.5",children:"total (query × provider)"})]})]}),f.jsx("p",{className:"text-[11px] text-zinc-500 mt-1",children:"Full evidence, per-provider breakdown, and suggested next queries on the project dashboard."}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Open project dashboard →"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsx("p",{className:"text-zinc-300",children:"Sweep running — typically 30-60s. Polling every 2s…"}),f.jsx("div",{className:"rounded-md border border-zinc-800/60 bg-zinc-900/30 p-3 text-xs text-zinc-500",children:f.jsxs("p",{children:["Status: ",f.jsx("span",{className:"text-zinc-300",children:ie?.status??"queued"})]})}),f.jsxs("div",{className:"setup-nav",children:[f.jsx("span",{}),f.jsx(Ue,{type:"button",variant:"outline",onClick:()=>{S({to:oe?`/projects/${encodeURIComponent(oe)}`:"/"})},children:"Watch on project page"})]})]}):f.jsxs("div",{className:"compact-stack",children:[f.jsxs("p",{className:"supporting-copy",children:["Everything is configured. Launch an answer-visibility sweep to start tracking citations for ",f.jsx("span",{className:"text-zinc-100 font-medium",children:oe}),"."]}),f.jsxs("div",{className:"setup-nav",children:[f.jsx(Ue,{type:"button",variant:"outline",onClick:pn,children:"Back"}),f.jsx(Ue,{type:"button",disabled:yo,onClick:Nn(Zn),children:yo?"Launching...":"Launch visibility sweep"})]})]})]})}default:return null}})();return f.jsxs("div",{className:"page-container",children:[f.jsx("div",{className:"page-header",children:f.jsxs("div",{className:"page-header-left",children:[f.jsx("h1",{className:"page-title",children:"Setup"}),f.jsx("p",{className:"page-subtitle",children:"Create a project, add queries, add competitors, and launch the first run."})]})}),f.jsx(BB,{current:x,labels:MB}),f.jsx("section",{className:"setup-wizard",children:ai})]})}function qB(){return f.jsx("div",{className:"page-container",children:f.jsx("section",{className:"page-section",children:f.jsxs(kn,{className:"surface-card empty-card",children:[f.jsx("h1",{children:"Route not found"}),f.jsx("p",{children:"The current path does not map to a dashboard view."}),f.jsx(Ue,{asChild:!0,children:f.jsx(st,{to:"/",children:"Return to overview"})})]})})})}const ba=Ps(()=>Gs(()=>import("./ProjectPage-C09hcd6v.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url),"ProjectPage"),UB=Ps(()=>Gs(()=>import("./RunsPage-wqKWA2Ei.js"),__vite__mapDeps([9,1,2,7,5,8]),import.meta.url),"RunsPage"),$B=Ps(()=>Gs(()=>import("./SettingsPage-esOqUkW5.js"),__vite__mapDeps([10,1,7,5,8]),import.meta.url),"SettingsPage"),VB=Ps(()=>Gs(()=>import("./BacklinksPage-CixBvw--.js"),__vite__mapDeps([11,1,6,7,5,8]),import.meta.url),"BacklinksPage"),IB=Ps(()=>Gs(()=>import("./TrafficPage-V0iCV3l4.js"),__vite__mapDeps([12,1,4,13,7,5,8]),import.meta.url),"TrafficPage"),PB=Ps(()=>Gs(()=>import("./TrafficSourceDetailPage-DUeuOh2v.js"),__vite__mapDeps([14,1,4,3,5,13,7,8]),import.meta.url),"TrafficSourceDetailPage");function GB(){return f.jsx(hM,{children:f.jsx(mM,{})})}const nn=Ow()({component:GB,validateSearch:e=>({runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0})}),HB=Tt({getParentRoute:()=>nn,path:"/",component:bM,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ei({client:te}));if(n&&n.length===0)throw Gf({to:"/setup"})}}),QB=Tt({getParentRoute:()=>nn,path:"/projects",component:TB}),KB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Kn=Tt({getParentRoute:()=>nn,path:"/projects/$projectName",component:()=>f.jsx(Sf,{}),beforeLoad:async({context:e,params:n,location:i})=>{const r=n.projectName;if(!KB.test(r))return;let l=e.queryClient.getQueryData(Ei({client:te}));if(!l)try{l=await e.queryClient.ensureQueryData(xc({client:te}))}catch{return}const c=l.find(d=>d.id===r);if(c)throw Gf({to:i.pathname.replace(`/projects/${r}`,`/projects/${encodeURIComponent(c.name)}`),replace:!0})}}),ZB=Tt({getParentRoute:()=>Kn,path:"/",component:()=>f.jsx(ba,{tab:"overview"})}),YB=Tt({getParentRoute:()=>Kn,path:"/search-console",component:()=>f.jsx(ba,{tab:"search-console"})}),XB=Tt({getParentRoute:()=>Kn,path:"/local",component:()=>f.jsx(ba,{tab:"local"})}),JB=Tt({getParentRoute:()=>Kn,path:"/discovery",component:()=>f.jsx(ba,{tab:"discovery"})}),FB=Tt({getParentRoute:()=>Kn,path:"/report",component:()=>f.jsx(ba,{tab:"report"})}),WB=Tt({getParentRoute:()=>Kn,path:"/activity",component:()=>f.jsx(ba,{tab:"activity"})}),e5=Tt({getParentRoute:()=>Kn,path:"/backlinks",component:()=>f.jsx(ba,{tab:"backlinks"})}),t5=Tt({getParentRoute:()=>Kn,path:"/technical-aeo",component:()=>f.jsx(ba,{tab:"technical-aeo"})}),n5=Tt({getParentRoute:()=>Kn,path:"/settings",component:()=>f.jsx(ba,{tab:"settings"})}),a5=Tt({getParentRoute:()=>nn,path:"/runs",component:UB}),i5=Tt({getParentRoute:()=>nn,path:"/settings",component:$B,beforeLoad:({context:e})=>{}}),s5=Tt({getParentRoute:()=>nn,path:"/setup",component:LB,beforeLoad:({context:e})=>{const n=e.queryClient.getQueryData(Ei({client:te}));if(n&&n.length>0)throw Gf({to:"/"})}}),r5=Tt({getParentRoute:()=>nn,path:"/backlinks",component:VB}),o5=Tt({getParentRoute:()=>nn,path:"/traffic",component:IB}),l5=Tt({getParentRoute:()=>nn,path:"/traffic/$projectName/$sourceId",component:PB}),c5=Tt({getParentRoute:()=>nn,path:"*",component:qB}),u5=nn.addChildren([HB,QB,Kn.addChildren([ZB,YB,XB,JB,FB,WB,e5,t5,n5]),a5,i5,s5,r5,o5,l5,c5]);function d5(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const uv=d5(),f5=uv==="/"?"":uv.replace(/\/$/,"");function p5(e,n){return Dw({routeTree:u5,basepath:f5||"/",context:{queryClient:e},...n?.initialEntries})}const m5=6e4;function h5(){const[e,n]=q.useState(sf()?"ready":"checking"),[i,r]=q.useState(""),[l,c]=q.useState(""),[d,h]=q.useState(null),[g,v]=q.useState(!1),[S,x]=q.useState(!1),N=q.useRef(null),_=q.useRef(null),z=()=>{if(!N.current){const R=Fk();_.current=R,N.current=p5(R)}return{queryClient:_.current,router:N.current}};q.useEffect(()=>{if(sf())return;let R=!1;return Qy().then(I=>{R||(I.authenticated?n("ready"):n(I.setupRequired?"setup":"login"))}).catch(I=>{R||(h(I instanceof Error?I.message:"Failed to reach the Canonry API"),n("login"))}),()=>{R=!0}},[]),q.useEffect(()=>{if(e!=="ready"||sf())return;const R=setInterval(()=>{Qy().then(I=>{I.authenticated||(x(!0),n(I.setupRequired?"setup":"login"))}).catch(()=>{})},m5);return Hy(()=>{x(!0),n("login")}),()=>{clearInterval(R),Hy(null)}},[e]);const k=async R=>{if(R.preventDefault(),!i.trim()||i.trim().length<8){h("Password must be at least 8 characters");return}if(i!==l){h("Passwords do not match");return}v(!0),h(null);try{if(!(await Ck(i.trim())).authenticated){h("Setup failed");return}r(""),c(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Setup failed")}finally{v(!1)}},E=async R=>{if(R.preventDefault(),!!i.trim()){v(!0),h(null);try{if(!(await zk(i.trim())).authenticated){h("Incorrect password");return}r(""),x(!1),n("ready")}catch(I){h(I instanceof Hn||I instanceof Error?I.message:"Authentication failed")}finally{v(!1)}}};if(e==="ready"){const{queryClient:R,router:I}=z();return f.jsx(Rw,{client:R,children:f.jsx(Mw,{router:I})})}return f.jsx("div",{className:"min-h-screen bg-zinc-950 px-4 py-8",children:f.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:f.jsx(kn,{className:"surface-card w-full",children:e==="checking"?f.jsx(Yl,{className:"py-8",children:f.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="setup"?f.jsxs(f.Fragment,{children:[f.jsxs(Mf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),f.jsx(Bf,{children:"Create a dashboard password"}),f.jsx(Lf,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),f.jsx(Yl,{children:f.jsxs("form",{className:"space-y-4",onSubmit:Nn(k),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"At least 8 characters"})]}),f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Confirm password"}),f.jsx("input",{className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:l,onChange:R=>c(R.target.value),placeholder:"Re-enter password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim()||!l.trim(),children:g?"Setting up…":"Create password & open dashboard"})]})})]}):f.jsxs(f.Fragment,{children:[f.jsxs(Mf,{children:[f.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),f.jsx(Bf,{children:"Sign in to Canonry"}),f.jsx(Lf,{children:"Enter your dashboard password to continue."})]}),f.jsxs(Yl,{children:[S?f.jsx("p",{className:"mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-300",children:"Your session expired — please sign in again."}):null,f.jsxs("form",{className:"space-y-4",onSubmit:Nn(E),children:[f.jsxs("label",{className:"block space-y-1.5",children:[f.jsx("span",{className:"text-xs font-medium text-zinc-400",children:"Password"}),f.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-zinc-800 bg-zinc-950 px-3 py-2 text-sm text-zinc-100 outline-none transition focus:border-zinc-600",type:"password",value:i,onChange:R=>r(R.target.value),placeholder:"Dashboard password"})]}),d?f.jsx("p",{className:"text-sm text-rose-400",children:d}):null,f.jsx(Ue,{type:"submit",disabled:g||!i.trim(),children:g?"Signing in…":"Open dashboard"})]})]})]})})})})}const f1=document.getElementById("root");if(!f1)throw new Error("Expected #root element for web app bootstrap.");Iw.createRoot(f1).render(f.jsx(q.StrictMode,{children:f.jsx(h5,{})}));export{m6 as $,KL as A,Ue as B,sc as C,E5 as D,FL as E,e6 as F,TL as G,t6 as H,Xr as I,V5 as J,$5 as K,P5 as L,tn as M,F5 as N,i6 as O,Q3 as P,s6 as Q,H5 as R,$D as S,Bn as T,n6 as U,a6 as V,WL as W,I5 as X,Q5 as Y,r6 as Z,o6 as _,L6 as a,D5 as a$,u6 as a0,f6 as a1,d6 as a2,p6 as a3,$k as a4,F0 as a5,Ae as a6,c6 as a7,K4 as a8,_i as a9,Z5 as aA,Ei as aB,Y5 as aC,wp as aD,R6 as aE,B6 as aF,M6 as aG,K5 as aH,mA as aI,Bv as aJ,R4 as aK,B4 as aL,M4 as aM,ML as aN,k6 as aO,RL as aP,rL as aQ,H6 as aR,qL as aS,BL as aT,UL as aU,$L as aV,DL as aW,LL as aX,C5 as aY,_5 as aZ,A5 as a_,l6 as aa,fE as ab,pE as ac,OL as ad,EL as ae,AL as af,yL as ag,jL as ah,NL as ai,Hn as aj,kL as ak,S5 as al,zA as am,HL as an,_A as ao,LA as ap,X4 as aq,Wl as ar,CL as as,_L as at,kf as au,A6 as av,G5 as aw,E6 as ax,O6 as ay,D6 as az,Ff as b,yS as b$,XL as b0,zb as b1,YL as b2,R5 as b3,M5 as b4,ZL as b5,B5 as b6,L5 as b7,U5 as b8,q5 as b9,g6 as bA,GL as bB,W5 as bC,eL as bD,tL as bE,iL as bF,kc as bG,$6 as bH,kp as bI,Tk as bJ,O5 as bK,X5 as bL,J5 as bM,_p as bN,sL as bO,$s as bP,Tb as bQ,hL as bR,bL as bS,SL as bT,xL as bU,gL as bV,vL as bW,wL as bX,K3 as bY,gS as bZ,F3 as b_,uo as ba,xc as bb,BR as bc,RB as bd,Qt as be,wk as bf,z5 as bg,j5 as bh,N5 as bi,T5 as bj,U6 as bk,xk as bl,Ak as bm,w5 as bn,x5 as bo,Nk as bp,k5 as bq,G6 as br,e4 as bs,h6 as bt,y6 as bu,Rk as bv,b6 as bw,aL as bx,nL as by,v6 as bz,et as c,bS as c0,jA as c1,mL as c2,Jy as c3,z6 as c4,VL as c5,IL as c6,xp as c7,JL as c8,Hs as c9,_6 as ca,T6 as cb,pL as cc,dL as cd,fL as ce,uL as cf,C6 as cg,$T as d,q6 as e,QL as f,kn as g,Vb as h,Nn as i,zL as j,S6 as k,te as l,x6 as m,w6 as n,N6 as o,j6 as p,oL as q,cL as r,lL as s,ID as t,Cp as u,V6 as v,I6 as w,P6 as x,Rf as y,PL as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./index-
|
|
1
|
+
import{c}from"./index-avJiga1P.js";const a=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],h=c("circle-check",a);const e=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],n=c("circle-question-mark",e);const o=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],s=c("download",o);const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r=c("trash-2",t);export{h as C,s as D,r as T,n as a};
|
package/assets/index.html
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32.png" />
|
|
13
13
|
<link rel="apple-touch-icon" href="./apple-touch-icon.png" />
|
|
14
14
|
<title>Canonry</title>
|
|
15
|
-
<script type="module" crossorigin src="./assets/index-
|
|
15
|
+
<script type="module" crossorigin src="./assets/index-avJiga1P.js"></script>
|
|
16
16
|
<link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-Be8JdV5M.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="./assets/vendor-radix-CQ77EO2y.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="./assets/vendor-recharts-C9EZkgbP.js">
|
|
@@ -337,7 +337,7 @@ function trackEvent(event, properties, options) {
|
|
|
337
337
|
import { createRequire as createRequire2 } from "module";
|
|
338
338
|
var _require2 = createRequire2(import.meta.url);
|
|
339
339
|
var { version: PKG_VERSION } = _require2("../package.json");
|
|
340
|
-
var PKG_NAME = "@
|
|
340
|
+
var PKG_NAME = "@canonry/canonry";
|
|
341
341
|
var NPM_DIST_TAGS_URL = `https://registry.npmjs.org/-/package/${PKG_NAME}/dist-tags`;
|
|
342
342
|
var NPM_PACKAGE_URL = `https://www.npmjs.com/package/${PKG_NAME}`;
|
|
343
343
|
var FETCH_TIMEOUT_MS = 1500;
|
package/dist/cli.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
setTelemetrySource,
|
|
30
30
|
showFirstRunNotice,
|
|
31
31
|
trackEvent
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-GIKNEXFE.js";
|
|
33
33
|
import {
|
|
34
34
|
CliError,
|
|
35
35
|
EXIT_SYSTEM_ERROR,
|
|
@@ -9209,7 +9209,7 @@ function formatSnapshotMarkdown(report) {
|
|
|
9209
9209
|
lines.push("");
|
|
9210
9210
|
}
|
|
9211
9211
|
lines.push("---");
|
|
9212
|
-
lines.push(`*Generated by [Canonry](https://github.com/
|
|
9212
|
+
lines.push(`*Generated by [Canonry](https://github.com/Canonry/canonry)*`);
|
|
9213
9213
|
return lines.join("\n");
|
|
9214
9214
|
}
|
|
9215
9215
|
function formatSnapshotText(report) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainyc/canonry",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.104.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent-first open-source AEO operating platform - track how answer engines cite your domain",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
7
7
|
"homepage": "https://canonry.ai",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/Canonry/canonry.git",
|
|
11
11
|
"directory": "packages/canonry"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/Canonry/canonry/issues"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
15
18
|
},
|
|
16
19
|
"bin": {
|
|
17
20
|
"canonry": "./bin/canonry.mjs",
|
|
@@ -62,27 +65,27 @@
|
|
|
62
65
|
"@types/node-cron": "^3.0.11",
|
|
63
66
|
"tsup": "^8.5.1",
|
|
64
67
|
"tsx": "^4.19.0",
|
|
65
|
-
"@ainyc/canonry-api-client": "0.0.0",
|
|
66
68
|
"@ainyc/canonry-api-routes": "0.0.0",
|
|
67
|
-
"@ainyc/canonry-
|
|
68
|
-
"@ainyc/canonry-db": "0.0.0",
|
|
69
|
-
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
69
|
+
"@ainyc/canonry-api-client": "0.0.0",
|
|
70
70
|
"@ainyc/canonry-config": "0.0.0",
|
|
71
|
-
"@ainyc/canonry-
|
|
72
|
-
"@ainyc/canonry-
|
|
71
|
+
"@ainyc/canonry-db": "0.0.0",
|
|
72
|
+
"@ainyc/canonry-contracts": "0.0.0",
|
|
73
73
|
"@ainyc/canonry-integration-cloud-run": "0.0.0",
|
|
74
|
+
"@ainyc/canonry-integration-openai-ads": "0.0.0",
|
|
75
|
+
"@ainyc/canonry-integration-bing": "0.0.0",
|
|
74
76
|
"@ainyc/canonry-integration-commoncrawl": "0.0.0",
|
|
75
77
|
"@ainyc/canonry-integration-google-business-profile": "0.0.0",
|
|
76
78
|
"@ainyc/canonry-integration-google-places": "0.0.0",
|
|
79
|
+
"@ainyc/canonry-integration-google": "0.0.0",
|
|
77
80
|
"@ainyc/canonry-integration-wordpress": "0.0.0",
|
|
78
|
-
"@ainyc/canonry-intelligence": "0.0.0",
|
|
79
81
|
"@ainyc/canonry-provider-cdp": "0.0.0",
|
|
80
|
-
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
81
|
-
"@ainyc/canonry-provider-gemini": "0.0.0",
|
|
82
82
|
"@ainyc/canonry-integration-traffic": "0.0.0",
|
|
83
|
+
"@ainyc/canonry-intelligence": "0.0.0",
|
|
84
|
+
"@ainyc/canonry-provider-claude": "0.0.0",
|
|
83
85
|
"@ainyc/canonry-provider-local": "0.0.0",
|
|
86
|
+
"@ainyc/canonry-provider-openai": "0.0.0",
|
|
84
87
|
"@ainyc/canonry-provider-perplexity": "0.0.0",
|
|
85
|
-
"@ainyc/canonry-provider-
|
|
88
|
+
"@ainyc/canonry-provider-gemini": "0.0.0"
|
|
86
89
|
},
|
|
87
90
|
"scripts": {
|
|
88
91
|
"build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
|