@canonry/canonry 4.151.0 → 4.152.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/assets/assets/{AuditHistoryPanel-OMu-hEqT.js → AuditHistoryPanel-DK52bxkQ.js} +1 -1
  2. package/assets/assets/{BacklinksPage-qadojXWF.js → BacklinksPage-DYApSbsM.js} +1 -1
  3. package/assets/assets/{HistoryPage-DJQbxQr4.js → HistoryPage-CksKbEHx.js} +1 -1
  4. package/assets/assets/{MeasurementPropertyPage-3-oL5JIi.js → MeasurementPropertyPage-Ds5A7BiY.js} +1 -1
  5. package/assets/assets/{ProjectPage-D300FAEv.js → ProjectPage-LzCmnrO2.js} +9 -9
  6. package/assets/assets/{RunRow-CaCdexBB.js → RunRow-C0oX3797.js} +1 -1
  7. package/assets/assets/{RunsPage-Cx_sLTg5.js → RunsPage-0qr4V3pn.js} +1 -1
  8. package/assets/assets/{SettingsPage-Y1J2OIpj.js → SettingsPage-BLMy_cfR.js} +1 -1
  9. package/assets/assets/{TrafficPage-O4oT28EH.js → TrafficPage-CZj9XGfC.js} +1 -1
  10. package/assets/assets/{TrafficSourceDetailPage-De6Yq1Dk.js → TrafficSourceDetailPage-BfQAuIQM.js} +1 -1
  11. package/assets/assets/{arrow-left-PM9P2PAY.js → arrow-left-DdovB6GZ.js} +1 -1
  12. package/assets/assets/{extract-error-message-RWIQhk6G.js → extract-error-message-yI0U8t_A.js} +1 -1
  13. package/assets/assets/{index-CLt6zzLW.css → index-CiidhUL0.css} +1 -1
  14. package/assets/assets/{index-bcpm37b9.js → index-DP74nMja.js} +2 -2
  15. package/assets/assets/{refresh-cw-qn1tCFGx.js → refresh-cw-SR8k0mBu.js} +1 -1
  16. package/assets/assets/{trash-2-Bbp_L6NV.js → trash-2-DQF9iFSX.js} +1 -1
  17. package/assets/assets/v2-overview-adapter-Dz0UmhmS.js +1 -0
  18. package/assets/index.html +2 -2
  19. package/package.json +8 -8
  20. package/assets/assets/v2-overview-adapter-BHmxTmCf.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-D300FAEv.js","./vendor-tanstack-BjS7iY3g.js","./RunRow-CaCdexBB.js","./refresh-cw-qn1tCFGx.js","./ChartPrimitives-DXVLCdBi.js","./extract-error-message-RWIQhk6G.js","./vendor-recharts-33ACLxsD.js","./trash-2-Bbp_L6NV.js","./AuditHistoryPanel-OMu-hEqT.js","./v2-overview-adapter-BHmxTmCf.js","./vendor-radix-DnzzbllM.js","./vendor-markdown-CpDJch4G.js","./RunsPage-Cx_sLTg5.js","./HistoryPage-DJQbxQr4.js","./SettingsPage-Y1J2OIpj.js","./BacklinksPage-qadojXWF.js","./TrafficPage-O4oT28EH.js","./arrow-left-PM9P2PAY.js","./TrafficSourceDetailPage-De6Yq1Dk.js","./MeasurementPropertyPage-3-oL5JIi.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ProjectPage-LzCmnrO2.js","./vendor-tanstack-BjS7iY3g.js","./RunRow-C0oX3797.js","./refresh-cw-SR8k0mBu.js","./ChartPrimitives-DXVLCdBi.js","./extract-error-message-yI0U8t_A.js","./vendor-recharts-33ACLxsD.js","./trash-2-DQF9iFSX.js","./AuditHistoryPanel-DK52bxkQ.js","./v2-overview-adapter-Dz0UmhmS.js","./vendor-radix-DnzzbllM.js","./vendor-markdown-CpDJch4G.js","./RunsPage-0qr4V3pn.js","./HistoryPage-CksKbEHx.js","./SettingsPage-BLMy_cfR.js","./BacklinksPage-DYApSbsM.js","./TrafficPage-CZj9XGfC.js","./arrow-left-DdovB6GZ.js","./TrafficSourceDetailPage-BfQAuIQM.js","./MeasurementPropertyPage-Ds5A7BiY.js"])))=>i.map(i=>d[i]);
2
2
  import{c as e4,d as t4,r as B,j as m,Q as n4,M as a4,q as Ae,e as x2,L as We,a as i4,f as po,u as mn,h as s4,k as Iu,l as o4,m as r4,n as S2,O as mf,o as Mi,p as xs,s as l4,t as St,v as j2,x as Bi,y as c4,z as u4,A as d4}from"./vendor-tanstack-BjS7iY3g.js";import{S as m4,O as Qf,P as A2,C as Zf,a as N2,T as Ff,D as _2,R as C2}from"./vendor-radix-DnzzbllM.js";import{c as z2}from"./vendor-recharts-33ACLxsD.js";import{M as p4}from"./vendor-markdown-CpDJch4G.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(r){if(r.ep)return;r.ep=!0;const u=i(r);fetch(r.href,u)}})();var Op={exports:{}},Yr={},Rp={exports:{}},Mp={};var ub;function f4(){return ub||(ub=1,(function(e){function t(Q,oe){var me=Q.length;Q.push(oe);e:for(;0<me;){var Ce=me-1>>>1,ce=Q[Ce];if(0<r(ce,oe))Q[Ce]=oe,Q[me]=ce,me=Ce;else break e}}function i(Q){return Q.length===0?null:Q[0]}function s(Q){if(Q.length===0)return null;var oe=Q[0],me=Q.pop();if(me!==oe){Q[0]=me;e:for(var Ce=0,ce=Q.length,He=ce>>>1;Ce<He;){var ne=2*(Ce+1)-1,H=Q[ne],X=ne+1,ie=Q[X];if(0>r(H,me))X<ce&&0>r(ie,H)?(Q[Ce]=ie,Q[X]=me,Ce=X):(Q[Ce]=H,Q[ne]=me,Ce=ne);else if(X<ce&&0>r(ie,me))Q[Ce]=ie,Q[X]=me,Ce=X;else break e}}return oe}function r(Q,oe){var me=Q.sortIndex-oe.sortIndex;return me!==0?me:Q.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,g=d.now();e.unstable_now=function(){return d.now()-g}}var b=[],v=[],x=1,S=null,j=3,_=!1,T=!1,N=!1,C=!1,O=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function K(Q){for(var oe=i(v);oe!==null;){if(oe.callback===null)s(v);else if(oe.startTime<=Q)s(v),oe.sortIndex=oe.expirationTime,t(b,oe);else break;oe=i(v)}}function Z(Q){if(N=!1,K(Q),!T)if(i(b)!==null)T=!0,se||(se=!0,we());else{var oe=i(v);oe!==null&&ge(Z,oe.startTime-Q)}}var se=!1,R=-1,q=5,pe=-1;function ue(){return C?!0:!(e.unstable_now()-pe<q)}function fe(){if(C=!1,se){var Q=e.unstable_now();pe=Q;var oe=!0;try{e:{T=!1,N&&(N=!1,I(R),R=-1),_=!0;var me=j;try{t:{for(K(Q),S=i(b);S!==null&&!(S.expirationTime>Q&&ue());){var Ce=S.callback;if(typeof Ce=="function"){S.callback=null,j=S.priorityLevel;var ce=Ce(S.expirationTime<=Q);if(Q=e.unstable_now(),typeof ce=="function"){S.callback=ce,K(Q),oe=!0;break t}S===i(b)&&s(b),K(Q)}else s(b);S=i(b)}if(S!==null)oe=!0;else{var He=i(v);He!==null&&ge(Z,He.startTime-Q),oe=!1}}break e}finally{S=null,j=me,_=!1}oe=void 0}}finally{oe?we():se=!1}}}var we;if(typeof $=="function")we=function(){$(fe)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,it=Te.port2;Te.port1.onmessage=fe,we=function(){it.postMessage(null)}}else we=function(){O(fe,0)};function ge(Q,oe){R=O(function(){Q(e.unstable_now())},oe)}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(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return j},e.unstable_next=function(Q){switch(j){case 1:case 2:case 3:var oe=3;break;default:oe=j}var me=j;j=oe;try{return Q()}finally{j=me}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(Q,oe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var me=j;j=Q;try{return oe()}finally{j=me}},e.unstable_scheduleCallback=function(Q,oe,me){var Ce=e.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?Ce+me:Ce):me=Ce,Q){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=me+ce,Q={id:x++,callback:oe,priorityLevel:Q,startTime:me,expirationTime:ce,sortIndex:-1},me>Ce?(Q.sortIndex=me,t(v,Q),i(b)===null&&Q===i(v)&&(N?(I(R),R=-1):N=!0,ge(Z,me-Ce))):(Q.sortIndex=ce,t(b,Q),T||_||(T=!0,se||(se=!0,we()))),Q},e.unstable_shouldYield=ue,e.unstable_wrapCallback=function(Q){var oe=j;return function(){var me=j;j=oe;try{return Q.apply(this,arguments)}finally{j=me}}}})(Mp)),Mp}var db;function h4(){return db||(db=1,Rp.exports=f4()),Rp.exports}var mb;function g4(){if(mb)return Yr;mb=1;var e=h4(),t=e4(),i=t4();function s(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)a+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var a=n,o=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(o=a.return),n=a.return;while(n)}return a.tag===3?o:null}function d(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function g(n){if(n.tag===31){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function b(n){if(u(n)!==n)throw Error(s(188))}function v(n){var a=n.alternate;if(!a){if(a=u(n),a===null)throw Error(s(188));return a!==n?null:n}for(var o=n,l=a;;){var p=o.return;if(p===null)break;var f=p.alternate;if(f===null){if(l=p.return,l!==null){o=l;continue}break}if(p.child===f.child){for(f=p.child;f;){if(f===o)return b(p),n;if(f===l)return b(p),a;f=f.sibling}throw Error(s(188))}if(o.return!==l.return)o=p,l=f;else{for(var w=!1,A=p.child;A;){if(A===o){w=!0,o=p,l=f;break}if(A===l){w=!0,l=p,o=f;break}A=A.sibling}if(!w){for(A=f.child;A;){if(A===o){w=!0,o=f,l=p;break}if(A===l){w=!0,l=f,o=p;break}A=A.sibling}if(!w)throw Error(s(189))}}if(o.alternate!==l)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?n:a}function x(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=x(n),a!==null)return a;n=n.sibling}return null}var S=Object.assign,j=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),$=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),fe=Symbol.iterator;function we(n){return n===null||typeof n!="object"?null:(n=fe&&n[fe]||n["@@iterator"],typeof n=="function"?n:null)}var Te=Symbol.for("react.client.reference");function it(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Te?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case N:return"Fragment";case O:return"Profiler";case C:return"StrictMode";case Z:return"Suspense";case se:return"SuspenseList";case pe:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case T:return"Portal";case $:return n.displayName||"Context";case I:return(n._context.displayName||"Context")+".Consumer";case K:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case R:return a=n.displayName||null,a!==null?a:it(n.type)||"Memo";case q:a=n._payload,n=n._init;try{return it(n(a))}catch{}}return null}var ge=Array.isArray,Q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me={pending:!1,data:null,method:null,action:null},Ce=[],ce=-1;function He(n){return{current:n}}function ne(n){0>ce||(n.current=Ce[ce],Ce[ce]=null,ce--)}function H(n,a){ce++,Ce[ce]=n.current,n.current=a}var X=He(null),ie=He(null),re=He(null),ze=He(null);function ct(n,a){switch(H(re,a),H(ie,n),H(X,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?Oy(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=Oy(a),n=Ry(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ne(X),H(X,n)}function _e(){ne(X),ne(ie),ne(re)}function Qe(n){n.memoizedState!==null&&H(ze,n);var a=X.current,o=Ry(a,n.type);a!==o&&(H(ie,n),H(X,o))}function Xe(n){ie.current===n&&(ne(X),ne(ie)),ze.current===n&&(ne(ze),Hr._currentValue=me)}var Gt,In;function Qt(n){if(Gt===void 0)try{throw Error()}catch(o){var a=o.stack.trim().match(/\n( *(at )?)/);Gt=a&&a[1]||"",In=-1<o.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Gt+n+In}var Cs=!1;function zs(n,a){if(!n||Cs)return"";Cs=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(a){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(F){var G=F}Reflect.construct(n,[],te)}else{try{te.call()}catch(F){G=F}n.call(te.prototype)}}else{try{throw Error()}catch(F){G=F}(te=n())&&typeof te.catch=="function"&&te.catch(function(){})}}catch(F){if(F&&G&&typeof F.stack=="string")return[F.stack,G.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=l.DetermineComponentFrameRoot(),w=f[0],A=f[1];if(w&&A){var z=w.split(`
@@ -210,4 +210,4 @@ spec:
210
210
  `);Gt(Me),Wo(!0)}}catch(W){Il(W instanceof Error?W.message:"Failed to generate queries"),S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.blocked",step:"queries",action:"generate_queries",reasonCode:y2(W,"unknown")},"onboarding.blocked:queries:generate")}finally{tr(!1)}}},$l=async()=>{if(!ie)return;const W=Na;if(W.length!==0){Pl(!0),ta(null);try{await vA(ie,W),Hi(!0),await s(),S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:"competitors",method:"manual",countBucket:xa(W.length)},"onboarding.step_completed:competitors"),ue(4)}catch(Me){ta(Me instanceof Error?Me.message:"Failed to save competitors"),S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.blocked",step:"competitors",action:"save",reasonCode:"unknown"},"onboarding.blocked:competitors:save")}finally{Pl(!1)}}},Yi=async()=>{const W=Fi.trim();if(W){ir(!0),or(null);try{await jA("gemini",{apiKey:W}),pn({title:"Gemini configured",detail:"Provider is ready — continuing setup.",tone:"positive",dedupeKey:"setup:gemini:configured",dedupeMode:"drop"}),ti(""),await s(),Es(r.providerStatuses.find(Me=>Me.name.toLowerCase()==="gemini")?.name??"gemini"),S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:"system",method:"inline"},"onboarding.step_completed:system")}catch(Me){or(Me instanceof Error?Me.message:"Failed to save Gemini key"),S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.blocked",step:"system",action:"configure_provider",reasonCode:"provider_save_failed"},"onboarding.blocked:system:provider_save_failed")}finally{ir(!1)}}},Ts=async()=>{if(!ie||tn){na(tn??"Complete setup before launching the first sweep.");const W=yt??(ie?ni===0?"no_queries":"run_rejected":"unknown");S({flowVersion:Ct,onboardingSessionId:v,event:"run.requested",origin:"dashboard_setup",result:"rejected",providerCountBucket:xa(sn.length),queryCountBucket:xa(ni),reasonCode:W});return}Qi(!0),na(null);try{const W=await xd.mutateAsync({projectName:ie,projectLabel:ge||Te||ie,sourceAction:"setup-launch"});Zi(W.id),wd(!0),S({flowVersion:Ct,onboardingSessionId:v,event:"run.requested",origin:"dashboard_setup",result:"queued",providerCountBucket:xa(sn.length),queryCountBucket:xa(ni)}),await s()}catch(W){na(W instanceof Error?W.message:"Failed to queue the visibility sweep. Retry when the instance is ready."),S({flowVersion:Ct,onboardingSessionId:v,event:"run.requested",origin:"dashboard_setup",result:"rejected",providerCountBucket:xa(sn.length),queryCountBucket:xa(ni),reasonCode:y2(W,"run_rejected")})}finally{Qi(!1)}},on=()=>ue(W=>Math.max(0,W-1)),ya=(W,Me,bn)=>{S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:W,method:"existing",...bn===void 0?{}:{countBucket:xa(bn)}},`onboarding.step_completed:${W}`),ue(Me)},ai=()=>{S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:"queries",method:"skipped",countBucket:"0"},"onboarding.step_completed:queries"),ue(3)},ii=()=>{S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:"competitors",method:"skipped",countBucket:"0"},"onboarding.step_completed:competitors"),ue(4)},Rt=(()=>{switch(pe){case 0:return m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsx("div",{className:"section-head",children:m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 1 of 5"}),m.jsx("h2",{children:"System check"})]})}),m.jsx("p",{className:"supporting-copy",children:"Checking that your Canonry instance is configured and reachable."}),m.jsx("div",{className:"compact-stack",children:g.healthChecks.map(W=>m.jsxs("div",{className:"health-check-row",children:[m.jsxs("div",{children:[m.jsx("p",{className:"run-row-title",children:W.label}),m.jsx("p",{className:"supporting-copy",children:W.detail}),W.id==="provider"&&W.state!=="ready"&&m.jsxs("div",{className:"mt-3 rounded-md border border-default bg-bg-elevated/40 p-3 space-y-2",children:[m.jsxs("p",{className:"text-xs text-secondary",children:["Paste a Gemini key to enable visibility checks (free at"," ",m.jsx("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noreferrer",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"aistudio.google.com"}),")."]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("input",{type:"password",value:Fi,onChange:Me=>ti(Me.target.value),placeholder:"AI... (paste here)",className:"flex-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-sm text-heading placeholder:text-faint focus:border-mono-600 focus:outline-none font-mono",disabled:ar}),m.jsx(De,{type:"button",size:"sm",disabled:ar||!Fi.trim(),onClick:nn(Yi),children:ar?"Saving...":"Save"})]}),sr&&m.jsxs("div",{role:"alert",className:"space-y-1 text-xs text-negative",children:[m.jsx("p",{children:sr}),m.jsx("p",{children:"Check that the key is complete, then retry Save."})]}),m.jsxs("p",{className:"text-sm text-secondary",children:["Connect more answer engines later in"," ",m.jsx(We,{to:"/settings",className:"text-link hover:underline",children:"Settings"}),"."]})]})]}),m.jsx(An,{tone:W.state==="ready"?"positive":"caution",title:W.id==="api"?qo(d.apiStatus):W.id==="worker"?qo(d.workerStatus):W.detail,children:W.state==="ready"?"Ready":"Attention"})]},W.id))}),m.jsxs("div",{className:"setup-nav",children:[g.launchState.blockedReason?m.jsx("p",{role:"status",className:"supporting-copy text-negative",children:g.launchState.blockedReason}):m.jsx("span",{}),m.jsx(De,{type:"button",disabled:!g.launchState.enabled,title:g.launchState.blockedReason,onClick:()=>{S({flowVersion:Ct,onboardingSessionId:v,event:"onboarding.step_completed",step:"system",method:"automatic"},"onboarding.step_completed:system"),ue(q)},children:"Continue"})]})]});case 1:return m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsxs("div",{className:"section-head",children:[m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 2 of 5"}),m.jsx("h2",{children:"Create project"})]}),ie?m.jsx(An,{tone:"positive",children:"Created"}):null]}),ie?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"text-neutral",children:["Project ",m.jsx("span",{className:"text-heading font-medium",children:ie})," created successfully."]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",onClick:()=>ya("project",2),children:"Continue"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"project-name",children:"Project name"}),m.jsx("input",{id:"project-name",className:"setup-input",type:"text",placeholder:"my-website",value:Te,onChange:W=>it(W.target.value)}),aa&&aa!==Te?m.jsxs("p",{className:"supporting-copy",children:["Slug: ",aa]}):null]}),m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"display-name",children:"Display name (optional)"}),m.jsx("input",{id:"display-name",className:"setup-input",type:"text",placeholder:"My Website",value:ge,onChange:W=>Q(W.target.value)})]}),m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"domain",children:"Canonical domain"}),m.jsx("input",{id:"domain",className:"setup-input",type:"text",placeholder:"example.com",value:oe,onChange:W=>me(W.target.value)})]}),m.jsxs("div",{className:"setup-field-row",children:[m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"country",children:"Country"}),m.jsx("input",{id:"country",className:"setup-input",type:"text",placeholder:"US",maxLength:2,value:Ce,onChange:W=>ce(W.target.value.toUpperCase())})]}),m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"language",children:"Language"}),m.jsx("input",{id:"language",className:"setup-input",type:"text",placeholder:"en",maxLength:5,value:He,onChange:W=>ne(W.target.value.toLowerCase())})]})]}),m.jsxs("label",{className:"flex items-start gap-3 rounded-md border border-default bg-surface p-3 cursor-pointer hover:border-strong",children:[m.jsx("input",{type:"checkbox",className:"mt-0.5 h-4 w-4 rounded border-strong bg-bg",checked:H,onChange:W=>X(W.target.checked)}),m.jsxs("span",{className:"flex-1",children:[m.jsx("span",{className:"block text-sm text-heading",children:"Auto-extract backlinks"}),m.jsxs("span",{className:"block text-xs text-muted mt-0.5",children:["When a new Common Crawl release syncs, automatically extract backlinks for this project."," ",m.jsx(We,{to:"/backlinks",className:"text-positive-400 hover:text-positive underline underline-offset-2",children:"Manage backlinks"})]})]})]}),ze?m.jsx("p",{className:"text-negative-400 text-sm",children:ze}):null,m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",disabled:!aa||!oe||_e,onClick:nn(rr),children:_e?"Creating...":"Create project"})]})]})]});case 2:return m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsxs("div",{className:"section-head",children:[m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 3 of 5"}),m.jsx("h2",{children:"Add queries"})]}),C.isError?m.jsx(An,{tone:"negative",children:"Load failed"}):In?m.jsxs(An,{tone:"positive",children:[yn.length," saved"]}):m.jsxs(An,{tone:"neutral",children:[yn.length," quer",yn.length!==1?"ies":"y"]})]}),m.jsx("p",{className:"supporting-copy",children:"Enter the queries you want to track, one per line. A rough first list is fine: you can edit them, research more, and add to them at any time from the project."}),m.jsxs("div",{className:"rounded-md border border-base bg-bg-elevated p-3 text-sm",children:[m.jsx("p",{className:"m-0 font-medium text-heading",children:"Tracking more than one location or property?"}),m.jsx("p",{className:"mt-1 mb-2 text-secondary",children:"Queries attach to each property separately in Advanced measurement, so there is nothing useful to add here. Skip this and set it up on the project."}),m.jsx(De,{type:"button",variant:"outline",size:"sm",onClick:()=>{ai(),b({to:ie?`/projects/${encodeURIComponent(ie)}/portfolio`:"/"})},children:"Set up Advanced measurement instead"})]}),C.isError?m.jsxs("div",{className:"compact-stack",children:[m.jsx("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:"Saved queries could not be loaded. Retry before changing the query basket."}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",onClick:()=>{C.refetch()},children:"Retry loading queries"})]})]}):In?m.jsxs("div",{className:"compact-stack",children:[m.jsx("ul",{className:"detail-list",children:yn.map(W=>m.jsx("li",{children:W},W))}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",onClick:()=>ya("queries",3,yn.length),children:"Continue"})]})]}):m.jsxs("div",{className:"compact-stack",children:[sn.length>0?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[m.jsx("span",{className:"flex-1 border-t border-base"}),"auto-generate",m.jsx("span",{className:"flex-1 border-t border-base"})]}),m.jsxs("div",{className:"flex items-end gap-2",children:[m.jsxs("div",{className:"setup-field flex-1",children:[m.jsx("label",{className:"setup-label",htmlFor:"gen-provider",children:"Provider"}),m.jsx("select",{id:"gen-provider",className:"setup-input",value:Ja,onChange:W=>Es(W.target.value),children:sn.map(W=>m.jsxs("option",{value:W.name,children:[W.displayName??W.name,W.model?` (${W.model})`:""]},W.name))})]}),m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"gen-count",children:"Count"}),m.jsx("select",{id:"gen-count",className:"setup-input",value:Jt,onChange:W=>vd(Number(W.target.value)),children:[3,5,10,15,20].map(W=>m.jsx("option",{value:W,children:W},W))})]}),m.jsx(De,{type:"button",variant:"outline",disabled:er||!Ja,onClick:nn(jd),children:er?"Analyzing site...":"Generate"})]}),Gi?m.jsx("p",{className:"text-negative-400 text-sm",children:Gi}):null]}):null,m.jsxs("div",{className:"flex items-center gap-2 text-muted text-xs uppercase tracking-wide",children:[m.jsx("span",{className:"flex-1 border-t border-base"}),"or type manually",m.jsx("span",{className:"flex-1 border-t border-base"})]}),m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"queries",children:"Queries (one per line)"}),m.jsx("textarea",{id:"queries",className:"setup-textarea",rows:6,placeholder:`emergency dentist brooklyn
211
211
  best invisalign downtown brooklyn
212
212
  pediatric dentist brooklyn heights`,value:Xe,onChange:W=>Gt(W.target.value)})]}),Cs?m.jsx("p",{className:"text-negative-400 text-sm",children:Cs}):null,m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",variant:"ghost",onClick:ai,children:"Skip for now"}),m.jsx(De,{type:"button",disabled:yn.length===0||ql,onClick:nn(Sd),children:ql?"Saving...":`Save ${yn.length} quer${yn.length!==1?"ies":"y"}`})]})]})]});case 3:return m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsxs("div",{className:"section-head",children:[m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 4 of 5"}),m.jsx("h2",{children:"Add competitors"})]}),Ll?m.jsx(An,{tone:"positive",children:"Saved"}):null]}),m.jsx("p",{className:"supporting-copy",children:"Domains that compete for the same queries. One per line."}),Ll?m.jsxs("div",{className:"compact-stack",children:[m.jsx("ul",{className:"detail-list",children:Na.map(W=>m.jsx("li",{children:W},W))}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",onClick:()=>ya("competitors",4,Na.length),children:"Continue"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("div",{className:"setup-field",children:[m.jsx("label",{className:"setup-label",htmlFor:"competitors",children:"Competitor domains (one per line)"}),m.jsx("textarea",{id:"competitors",className:"setup-textarea",rows:4,placeholder:`competitor1.com
213
- competitor2.com`,value:nr,onChange:W=>kd(W.target.value)})]}),Wt?m.jsx("p",{className:"text-negative-400 text-sm",children:Wt}):null,m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(De,{type:"button",variant:"outline",onClick:ii,children:"Skip"}),m.jsx(De,{type:"button",disabled:Na.length===0||en,onClick:nn($l),children:en?"Saving...":`Save ${Na.length} competitor${Na.length!==1?"s":""}`})]})]})]})]});case 4:{const W=ga.data,Me=W?.status??(ei===K?.id?K.status:void 0),bn=Me==="completed"||Me==="partial"||Me==="failed"||Me==="cancelled",_n=W?.snapshots??[],Ad=_n.filter(Mt=>Mt.citationState==="cited").length,Ul=_n.filter(Mt=>Mt.answerMentioned===!0).length,lr=new Set(_n.map(Mt=>Mt.query).filter(Mt=>!!Mt)).size,Vl=Me?b2(Me,_n.length):!1,Xi=Z&&!Wa,Ds=ha??(W?.error?uB(W.error):Me==="cancelled"?"The sweep was cancelled before it produced a baseline.":(Me==="completed"||Me==="partial")&&_n.length===0?"The sweep finished without producing any snapshots. Confirm the query set and provider configuration, then retry.":K?.statusDetail||"The sweep did not produce a baseline. Review provider configuration, then retry.");let rn=null;return Xi||Vl?rn=m.jsx(An,{tone:"positive",children:"Complete"}):ha&&!Wa?rn=m.jsx(An,{tone:"negative",children:"Failed"}):bn?rn=m.jsx(An,{tone:"negative",children:Me==="cancelled"?"Cancelled":"Failed"}):Wa&&(rn=m.jsx(An,{tone:"caution",children:"Running"})),m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsxs("div",{className:"section-head",children:[m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),m.jsx("h2",{children:"Launch first run"})]}),rn]}),Xi?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"text-secondary",children:["Setup is complete. ",m.jsx("span",{className:"text-strong font-medium",children:ie})," already has a successful answer-visibility baseline."]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Open project dashboard →"})]})]}):Wa?bn?Vl?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"text-neutral",children:["Sweep complete. Your first answer-visibility snapshot for"," ",m.jsx("span",{className:"text-heading font-medium",children:ie}),":"]}),m.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Mentioned"}),m.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[Ul,m.jsxs("span",{className:"text-faint text-lg",children:[" / ",lr]})]}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries naming your brand"})]}),m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Cited"}),m.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[Ad,m.jsxs("span",{className:"text-faint text-lg",children:[" / ",lr]})]}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries citing your site"})]}),m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Results"}),m.jsx("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:_n.length}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"completed engine checks"})]})]}),m.jsx("p",{className:"mt-1 text-sm text-secondary",children:"Open the project to review the evidence."}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Open project dashboard →"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:Ds}),m.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Fix provider or query configuration if needed, then retry without leaving setup."})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",asChild:!0,children:m.jsx(We,{to:"/settings",children:"Configure providers"})}),m.jsx(De,{type:"button",disabled:Aa||!!tn,onClick:nn(Ts),children:Aa?"Retrying...":"Retry visibility sweep"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsx("p",{className:"text-neutral",children:"Sweep running — typically 30-60s. Polling every 2s…"}),m.jsx("div",{className:"rounded-md border border-default bg-surface p-3 text-xs text-muted",children:m.jsxs("p",{children:["Status: ",m.jsx("span",{className:"text-neutral",children:Me??"queued"})]})}),ga.isError&&m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:ga.error instanceof Error?ga.error.message:"Could not refresh the sweep status."}),m.jsx(De,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>{ga.refetch()},children:"Retry status check"})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",variant:"outline",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Watch on project page"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"supporting-copy",children:["Setup is done. You can run a first sweep now to get a baseline for"," ",m.jsx("span",{className:"text-heading font-medium",children:ie}),", or finish and run it later from the project. A sweep calls the answer engines, so it costs provider usage."]}),(tn||ha)&&m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:ha??tn}),m.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Resolve the blocker above, then retry the sweep here."})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",variant:"ghost",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Finish without running"}),m.jsx(De,{type:"button",disabled:Aa||!!tn,title:tn,onClick:nn(Ts),children:Aa?"Launching...":ha?"Retry visibility sweep":"Launch visibility sweep"})]})]})]})}default:return null}})();return m.jsxs("div",{className:"page-container",children:[m.jsx("div",{className:"page-header",children:m.jsxs("div",{className:"page-header-left",children:[m.jsx("h1",{className:"page-title",children:"Setup"}),m.jsx("p",{className:"page-subtitle",children:"Create a project and run its first visibility check."})]})}),m.jsx(L$,{current:pe,labels:I$}),m.jsx("section",{className:"setup-wizard",children:Rt})]})}function V$(){return m.jsx("div",{className:"page-container",children:m.jsx("section",{className:"page-section",children:m.jsxs(Zn,{className:"surface-card empty-card",children:[m.jsx("h1",{children:"Route not found"}),m.jsx("p",{children:"The current path does not map to a dashboard view."}),m.jsx(De,{asChild:!0,children:m.jsx(We,{to:"/",children:"Return to overview"})})]})})})}const fa=Bi(()=>qi(()=>import("./ProjectPage-D300FAEv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),"ProjectPage"),K$=Bi(()=>qi(()=>import("./RunsPage-Cx_sLTg5.js"),__vite__mapDeps([12,1,2,10,6,11]),import.meta.url),"RunsPage"),G$=Bi(()=>qi(()=>import("./HistoryPage-DJQbxQr4.js"),__vite__mapDeps([13,1,8,10,6,11]),import.meta.url),"HistoryPage"),H$=Bi(()=>qi(()=>import("./SettingsPage-Y1J2OIpj.js"),__vite__mapDeps([14,1,10,6,11]),import.meta.url),"SettingsPage"),Q$=Bi(()=>qi(()=>import("./BacklinksPage-qadojXWF.js"),__vite__mapDeps([15,1,7,10,6,11]),import.meta.url),"BacklinksPage"),Z$=Bi(()=>qi(()=>import("./TrafficPage-O4oT28EH.js"),__vite__mapDeps([16,1,5,17,10,6,11]),import.meta.url),"TrafficPage"),F$=Bi(()=>qi(()=>import("./TrafficSourceDetailPage-De6Yq1Dk.js"),__vite__mapDeps([18,1,5,4,3,6,17,10,11]),import.meta.url),"TrafficSourceDetailPage"),Y$=Bi(()=>qi(()=>import("./MeasurementPropertyPage-3-oL5JIi.js"),__vite__mapDeps([19,1,4,9,17,10,6,11]),import.meta.url),"MeasurementPropertyPage");function X$(){return m.jsx(oP,{children:m.jsx(sP,{})})}const hn=l4()({component:X$,validateSearch:e=>({manageQueries:e.manageQueries===!0||e.manageQueries==="true"?!0:void 0,runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0,runStatus:typeof e.runStatus=="string"?e.runStatus:void 0,runKind:typeof e.runKind=="string"?e.runKind:void 0,runProject:typeof e.runProject=="string"?e.runProject:void 0,runWindow:typeof e.runWindow=="string"?e.runWindow:void 0,runQuery:typeof e.runQuery=="string"?e.runQuery:void 0,scope:typeof e.scope=="string"?e.scope:void 0,class:typeof e.class=="string"?e.class:void 0})}),J$=St({getParentRoute:()=>hn,path:"/",component:dP,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ho({client:le}));if(t&&t.length===0)throw j2({to:"/setup"})}}),W$=St({getParentRoute:()=>hn,path:"/projects",component:S$}),eU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qn=St({getParentRoute:()=>hn,path:"/projects/$projectName",component:()=>m.jsx(mf,{}),beforeLoad:async({context:e,params:t,location:i})=>{const s=t.projectName;if(!eU.test(s))return;let r=e.queryClient.getQueryData(Ho({client:le}));if(!r)try{r=await e.queryClient.ensureQueryData(nd({client:le}))}catch{return}const u=r.find(d=>d.id===s);if(u)throw j2({to:i.pathname.replace(`/projects/${s}`,`/projects/${encodeURIComponent(u.name)}`),replace:!0})}}),tU=St({getParentRoute:()=>qn,path:"/",component:()=>m.jsx(fa,{tab:"overview"})}),nU=St({getParentRoute:()=>qn,path:"/portfolio",component:()=>m.jsx(fa,{tab:"portfolio"})}),aU=St({getParentRoute:()=>qn,path:"/search-console",component:()=>m.jsx(fa,{tab:"search-console"})}),iU=St({getParentRoute:()=>qn,path:"/local",component:()=>m.jsx(fa,{tab:"local"})}),sU=St({getParentRoute:()=>qn,path:"/discovery",component:()=>m.jsx(fa,{tab:"discovery"})}),oU=St({getParentRoute:()=>qn,path:"/properties/$targetKey",component:()=>m.jsx(Y$,{})}),rU=St({getParentRoute:()=>qn,path:"/report",component:()=>m.jsx(fa,{tab:"report"})}),lU=St({getParentRoute:()=>qn,path:"/activity",component:()=>m.jsx(fa,{tab:"activity"})}),cU=St({getParentRoute:()=>qn,path:"/backlinks",component:()=>m.jsx(fa,{tab:"backlinks"})}),uU=St({getParentRoute:()=>qn,path:"/technical-aeo",component:()=>m.jsx(fa,{tab:"technical-aeo"})}),dU=St({getParentRoute:()=>qn,path:"/history",component:()=>m.jsx(fa,{tab:"history"})}),mU=St({getParentRoute:()=>qn,path:"/settings",component:()=>m.jsx(fa,{tab:"settings"})}),pU=St({getParentRoute:()=>hn,path:"/runs",component:K$}),fU=St({getParentRoute:()=>hn,path:"/history",component:G$}),hU=St({getParentRoute:()=>hn,path:"/settings",component:H$,beforeLoad:({context:e})=>{}}),gU=St({getParentRoute:()=>hn,path:"/setup",component:P$}),yU=St({getParentRoute:()=>hn,path:"/backlinks",component:Q$}),bU=St({getParentRoute:()=>hn,path:"/traffic",component:Z$}),vU=St({getParentRoute:()=>hn,path:"/traffic/$projectName/$sourceId",component:F$}),kU=St({getParentRoute:()=>hn,path:"*",component:V$}),wU=hn.addChildren([J$,W$,qn.addChildren([tU,nU,aU,iU,sU,oU,rU,lU,cU,uU,dU,mU]),pU,fU,hU,gU,yU,bU,vU,kU]);function xU(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const w2=xU(),SU=w2==="/"?"":w2.replace(/\/$/,"");function jU(e,t){return c4({routeTree:wU,basepath:SU||"/",context:{queryClient:e},...t?.initialEntries})}const AU=6e4;function NU(){const[e,t]=B.useState(qp()?"ready":"checking"),[i,s]=B.useState(null),[r,u]=B.useState(!1),[d,g]=B.useState(""),[b,v]=B.useState(""),[x,S]=B.useState(""),[j,_]=B.useState(null),[T,N]=B.useState(!1),[C,O]=B.useState(!1),I=B.useRef(null),$=B.useRef(null),K=B.useRef(null),Z=()=>{const ue=i?`${i.name}:${i.role}`:"no-accounts";if(!I.current||K.current!==ue){$.current?.clear();const fe=HA();$.current=fe,I.current=jU(fe),K.current=ue}return{queryClient:$.current,router:I.current}},se=ue=>ue.authRequired?(u(!0),s(ue.user),t(ue.user?"ready":"account-login"),!0):!1;B.useEffect(()=>{if(qp())return;let ue=!1;return Promise.allSettled([bb(),yb()]).then(([fe,we])=>{if(ue||fe.status==="fulfilled"&&se(fe.value))return;if(we.status==="rejected"){const it=we.reason;_(it instanceof Error?it.message:"Failed to reach the Canonry API"),t("login");return}const Te=we.value;Te.authenticated?t("ready"):t(Te.setupRequired?"setup":"login")}),()=>{ue=!0}},[]),B.useEffect(()=>{if(e!=="ready"||qp())return;const ue=setInterval(()=>{if(r){bb().then(fe=>{fe.authRequired&&!fe.user&&(O(!0),s(null),t("account-login"))}).catch(()=>{});return}yb().then(fe=>{fe.authenticated||(O(!0),t(fe.setupRequired?"setup":"login"))}).catch(()=>{})},AU);return gb(()=>{O(!0),s(null),t(r?"account-login":"login")}),()=>{clearInterval(ue),gb(null)}},[e,r]);const R=async ue=>{if(ue.preventDefault(),!b.trim()||b.trim().length<8){_("Password must be at least 8 characters");return}if(b!==x){_("Passwords do not match");return}N(!0),_(null);try{if(!(await wA(b.trim())).authenticated){_("Setup failed");return}v(""),S(""),O(!1),t("ready")}catch(fe){_(fe instanceof Mn||fe instanceof Error?fe.message:"Setup failed")}finally{N(!1)}},q=async ue=>{if(ue.preventDefault(),!!b.trim()){N(!0),_(null);try{if(!(await xA(b.trim())).authenticated){_("Incorrect password");return}v(""),O(!1),t("ready")}catch(fe){_(fe instanceof Mn||fe instanceof Error?fe.message:"Authentication failed")}finally{N(!1)}}},pe=async ue=>{if(ue.preventDefault(),!(!d.trim()||!b)){N(!0),_(null);try{const fe=await SA(d.trim(),b);if(!fe.user){_("Incorrect name or password.");return}v(""),O(!1),s(fe.user),t("ready")}catch(fe){_(fe instanceof Mn?fe.message:"Incorrect name or password.")}finally{N(!1)}}};if(e==="ready"){const{queryClient:ue,router:fe}=Z();return m.jsx(qA,{account:i,children:m.jsx(u4,{client:ue,children:m.jsx(d4,{router:fe})})})}return m.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:m.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:m.jsx(Zn,{className:"surface-card w-full",children:e==="checking"?m.jsx(ko,{className:"py-8",children:m.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="account-login"?m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),m.jsx(dl,{children:"Sign in to Canonry"}),m.jsx(ml,{children:"Enter the name and password for your account."})]}),m.jsxs(ko,{children:[C?m.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"You were signed out — please sign in again."}):null,m.jsxs("form",{className:"space-y-4",onSubmit:nn(pe),children:[m.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-name",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Name"}),m.jsx("input",{autoFocus:!0,id:"account-name",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"text",autoComplete:"username",value:d,onChange:ue=>g(ue.target.value)})]}),m.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-password",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{id:"account-password",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",autoComplete:"current-password",value:b,onChange:ue=>v(ue.target.value)})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!d.trim()||!b,children:T?"Signing in…":"Sign in"})]})]})]}):e==="setup"?m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),m.jsx(dl,{children:"Create a dashboard password"}),m.jsx(ml,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),m.jsx(ko,{children:m.jsxs("form",{className:"space-y-4",onSubmit:nn(R),children:[m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:b,onChange:ue=>v(ue.target.value),placeholder:"At least 8 characters"})]}),m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Confirm password"}),m.jsx("input",{className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:x,onChange:ue=>S(ue.target.value),placeholder:"Re-enter password"})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!b.trim()||!x.trim(),children:T?"Setting up…":"Create password & open dashboard"})]})})]}):m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),m.jsx(dl,{children:"Sign in to Canonry"}),m.jsx(ml,{children:"Enter your dashboard password to continue."})]}),m.jsxs(ko,{children:[C?m.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,m.jsxs("form",{className:"space-y-4",onSubmit:nn(q),children:[m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:b,onChange:ue=>v(ue.target.value),placeholder:"Dashboard password"})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!b.trim(),children:T?"Signing in…":"Open dashboard"})]})]})]})})})})}const H3=document.getElementById("root");if(!H3)throw new Error("Expected #root element for web app bootstrap.");b4.createRoot(H3).render(m.jsx(B.StrictMode,{children:m.jsx(NU,{})}));export{WK as $,jK as A,De as B,n0 as C,xK as D,AK as E,lV as F,oK as G,ZK as H,nl as I,YK as J,XK as K,bV as L,yV as M,zV as N,pn as O,MI as P,eG as Q,tG as R,KN as S,An as T,SV as U,nG as V,jV as W,$o as X,kV as Y,xV as Z,JK as _,RG as a,ZU as a$,FK as a0,vV as a1,aG as a2,uG as a3,oG as a4,lG as a5,rG as a6,cG as a7,RA as a8,W0 as a9,SB as aA,UB as aB,PK as aC,UK as aD,$K as aE,kK as aF,wK as aG,CG as aH,zG as aI,EG as aJ,AV as aK,Ho as aL,NV as aM,X0 as aN,TG as aO,OG as aP,DG as aQ,BB as aR,LG as aS,nk as aT,sk as aU,xG as aV,HK as aW,de as aX,XU as aY,YU as aZ,FU as a_,Oe as aa,sG as ab,Rx as ac,Ya as ad,iG as ae,cD as af,uD as ag,cK as ah,lK as ai,FV as aj,tK as ak,nK as al,Mn as am,aK as an,WU as ao,ak as ap,uB as aq,xN as ar,MN as as,Lq as at,ku as au,iK as av,yf as aw,SG as ax,wV as ay,rK as az,Tu as b,BG as b$,GU as b0,KU as b1,QU as b2,HU as b3,VU as b4,UU as b5,MU as b6,BU as b7,$U as b8,PU as b9,_K as bA,dV as bB,mV as bC,NK as bD,pV as bE,fV as bF,gV as bG,hV as bH,Dl as bI,nd as bJ,AL as bK,xl as bL,G2 as bM,EK as bN,TK as bO,UG as bP,E$ as bQ,VK as bR,QK as bS,DK as bT,RK as bU,BK as bV,OK as bW,dn as bX,hA as bY,hB as bZ,qG as b_,LU as ba,qU as bb,IU as bc,RU as bd,OU as be,DU as bf,TU as bg,$4 as bh,mK as bi,wG as bj,dK as bk,qV as bl,VG as bm,hK as bn,pK as bo,gK as bp,yK as bq,uK as br,fK as bs,oV as bt,sV as bu,iV as bv,IV as bw,uV as bx,CK as by,Ov as bz,tt as c,VV as c$,tV as c0,nV as c1,eV as c2,yA as c3,aV as c4,xB as c5,rV as c6,dG as c7,pG as c8,zA as c9,BV as cA,qo as cB,Mv as cC,QV as cD,YV as cE,JV as cF,WV as cG,ZV as cH,XV as cI,eK as cJ,BI as cK,Jx as cL,$I as cM,Wx as cN,e3 as cO,gN as cP,HV as cQ,jb as cR,NG as cS,tN as cT,vK as cU,H0 as cV,zK as cW,jG as cX,_G as cY,GV as cZ,bK as c_,RV as ca,fG as cb,hG as cc,mG as cd,SK as ce,EV as cf,TV as cg,DV as ch,MV as ci,OV as cj,zo as ck,J0 as cl,IG as cm,od as cn,nh as co,KK as cp,GK as cq,jA as cr,lA as cs,JU as ct,cV as cu,_V as cv,CV as cw,j$ as cx,rd as cy,ah as cz,jz as d,KV as d0,UV as d1,AG as d2,oE as d3,qK as d4,MK as d5,LK as d6,IK as d7,MG as e,Zn as f,Sa as g,Hv as h,iA as i,nn as j,sK as k,gG as l,le as m,yG as n,bG as o,kG as p,vG as q,LV as r,$V as s,mB as t,ih as u,PV as v,cB as w,PG as x,$G as y,Lf as z};
213
+ competitor2.com`,value:nr,onChange:W=>kd(W.target.value)})]}),Wt?m.jsx("p",{className:"text-negative-400 text-sm",children:Wt}):null,m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsxs("div",{className:"flex gap-2",children:[m.jsx(De,{type:"button",variant:"outline",onClick:ii,children:"Skip"}),m.jsx(De,{type:"button",disabled:Na.length===0||en,onClick:nn($l),children:en?"Saving...":`Save ${Na.length} competitor${Na.length!==1?"s":""}`})]})]})]})]});case 4:{const W=ga.data,Me=W?.status??(ei===K?.id?K.status:void 0),bn=Me==="completed"||Me==="partial"||Me==="failed"||Me==="cancelled",_n=W?.snapshots??[],Ad=_n.filter(Mt=>Mt.citationState==="cited").length,Ul=_n.filter(Mt=>Mt.answerMentioned===!0).length,lr=new Set(_n.map(Mt=>Mt.query).filter(Mt=>!!Mt)).size,Vl=Me?b2(Me,_n.length):!1,Xi=Z&&!Wa,Ds=ha??(W?.error?uB(W.error):Me==="cancelled"?"The sweep was cancelled before it produced a baseline.":(Me==="completed"||Me==="partial")&&_n.length===0?"The sweep finished without producing any snapshots. Confirm the query set and provider configuration, then retry.":K?.statusDetail||"The sweep did not produce a baseline. Review provider configuration, then retry.");let rn=null;return Xi||Vl?rn=m.jsx(An,{tone:"positive",children:"Complete"}):ha&&!Wa?rn=m.jsx(An,{tone:"negative",children:"Failed"}):bn?rn=m.jsx(An,{tone:"negative",children:Me==="cancelled"?"Cancelled":"Failed"}):Wa&&(rn=m.jsx(An,{tone:"caution",children:"Running"})),m.jsxs(Zn,{className:"surface-card step-card",children:[m.jsxs("div",{className:"section-head",children:[m.jsxs("div",{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Step 5 of 5"}),m.jsx("h2",{children:"Launch first run"})]}),rn]}),Xi?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"text-secondary",children:["Setup is complete. ",m.jsx("span",{className:"text-strong font-medium",children:ie})," already has a successful answer-visibility baseline."]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Open project dashboard →"})]})]}):Wa?bn?Vl?m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"text-neutral",children:["Sweep complete. Your first answer-visibility snapshot for"," ",m.jsx("span",{className:"text-heading font-medium",children:ie}),":"]}),m.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-1",children:[m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Mentioned"}),m.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[Ul,m.jsxs("span",{className:"text-faint text-lg",children:[" / ",lr]})]}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries naming your brand"})]}),m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Cited"}),m.jsxs("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:[Ad,m.jsxs("span",{className:"text-faint text-lg",children:[" / ",lr]})]}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"queries citing your site"})]}),m.jsxs("div",{className:"rounded-md border border-default bg-surface p-3",children:[m.jsx("p",{className:"text-xs font-medium text-secondary",children:"Results"}),m.jsx("p",{className:"text-2xl font-bold tabular-nums text-primary mt-1",children:_n.length}),m.jsx("p",{className:"mt-0.5 text-sm text-secondary",children:"completed engine checks"})]})]}),m.jsx("p",{className:"mt-1 text-sm text-secondary",children:"Open the project to review the evidence."}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Open project dashboard →"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:Ds}),m.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Fix provider or query configuration if needed, then retry without leaving setup."})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",asChild:!0,children:m.jsx(We,{to:"/settings",children:"Configure providers"})}),m.jsx(De,{type:"button",disabled:Aa||!!tn,onClick:nn(Ts),children:Aa?"Retrying...":"Retry visibility sweep"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsx("p",{className:"text-neutral",children:"Sweep running — typically 30-60s. Polling every 2s…"}),m.jsx("div",{className:"rounded-md border border-default bg-surface p-3 text-xs text-muted",children:m.jsxs("p",{children:["Status: ",m.jsx("span",{className:"text-neutral",children:Me??"queued"})]})}),ga.isError&&m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:ga.error instanceof Error?ga.error.message:"Could not refresh the sweep status."}),m.jsx(De,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>{ga.refetch()},children:"Retry status check"})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx("span",{}),m.jsx(De,{type:"button",variant:"outline",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Watch on project page"})]})]}):m.jsxs("div",{className:"compact-stack",children:[m.jsxs("p",{className:"supporting-copy",children:["Setup is done. You can run a first sweep now to get a baseline for"," ",m.jsx("span",{className:"text-heading font-medium",children:ie}),", or finish and run it later from the project. A sweep calls the answer engines, so it costs provider usage."]}),(tn||ha)&&m.jsxs("div",{role:"alert",className:"rounded-md border border-negative bg-negative-soft p-3 text-sm text-negative",children:[m.jsx("p",{children:ha??tn}),m.jsx("p",{className:"mt-1 text-xs text-secondary",children:"Resolve the blocker above, then retry the sweep here."})]}),m.jsxs("div",{className:"setup-nav",children:[m.jsx(De,{type:"button",variant:"outline",onClick:on,children:"Back"}),m.jsx(De,{type:"button",variant:"ghost",onClick:()=>{b({to:ie?`/projects/${encodeURIComponent(ie)}`:"/"})},children:"Finish without running"}),m.jsx(De,{type:"button",disabled:Aa||!!tn,title:tn,onClick:nn(Ts),children:Aa?"Launching...":ha?"Retry visibility sweep":"Launch visibility sweep"})]})]})]})}default:return null}})();return m.jsxs("div",{className:"page-container",children:[m.jsx("div",{className:"page-header",children:m.jsxs("div",{className:"page-header-left",children:[m.jsx("h1",{className:"page-title",children:"Setup"}),m.jsx("p",{className:"page-subtitle",children:"Create a project and run its first visibility check."})]})}),m.jsx(L$,{current:pe,labels:I$}),m.jsx("section",{className:"setup-wizard",children:Rt})]})}function V$(){return m.jsx("div",{className:"page-container",children:m.jsx("section",{className:"page-section",children:m.jsxs(Zn,{className:"surface-card empty-card",children:[m.jsx("h1",{children:"Route not found"}),m.jsx("p",{children:"The current path does not map to a dashboard view."}),m.jsx(De,{asChild:!0,children:m.jsx(We,{to:"/",children:"Return to overview"})})]})})})}const fa=Bi(()=>qi(()=>import("./ProjectPage-LzCmnrO2.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),"ProjectPage"),K$=Bi(()=>qi(()=>import("./RunsPage-0qr4V3pn.js"),__vite__mapDeps([12,1,2,10,6,11]),import.meta.url),"RunsPage"),G$=Bi(()=>qi(()=>import("./HistoryPage-CksKbEHx.js"),__vite__mapDeps([13,1,8,10,6,11]),import.meta.url),"HistoryPage"),H$=Bi(()=>qi(()=>import("./SettingsPage-BLMy_cfR.js"),__vite__mapDeps([14,1,10,6,11]),import.meta.url),"SettingsPage"),Q$=Bi(()=>qi(()=>import("./BacklinksPage-DYApSbsM.js"),__vite__mapDeps([15,1,7,10,6,11]),import.meta.url),"BacklinksPage"),Z$=Bi(()=>qi(()=>import("./TrafficPage-CZj9XGfC.js"),__vite__mapDeps([16,1,5,17,10,6,11]),import.meta.url),"TrafficPage"),F$=Bi(()=>qi(()=>import("./TrafficSourceDetailPage-BfQAuIQM.js"),__vite__mapDeps([18,1,5,4,3,6,17,10,11]),import.meta.url),"TrafficSourceDetailPage"),Y$=Bi(()=>qi(()=>import("./MeasurementPropertyPage-Ds5A7BiY.js"),__vite__mapDeps([19,1,4,9,17,10,6,11]),import.meta.url),"MeasurementPropertyPage");function X$(){return m.jsx(oP,{children:m.jsx(sP,{})})}const hn=l4()({component:X$,validateSearch:e=>({manageQueries:e.manageQueries===!0||e.manageQueries==="true"?!0:void 0,runId:typeof e.runId=="string"?e.runId:void 0,evidenceId:typeof e.evidenceId=="string"?e.evidenceId:void 0,runStatus:typeof e.runStatus=="string"?e.runStatus:void 0,runKind:typeof e.runKind=="string"?e.runKind:void 0,runProject:typeof e.runProject=="string"?e.runProject:void 0,runWindow:typeof e.runWindow=="string"?e.runWindow:void 0,runQuery:typeof e.runQuery=="string"?e.runQuery:void 0,scope:typeof e.scope=="string"?e.scope:void 0,class:typeof e.class=="string"?e.class:void 0})}),J$=St({getParentRoute:()=>hn,path:"/",component:dP,beforeLoad:({context:e})=>{const t=e.queryClient.getQueryData(Ho({client:le}));if(t&&t.length===0)throw j2({to:"/setup"})}}),W$=St({getParentRoute:()=>hn,path:"/projects",component:S$}),eU=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qn=St({getParentRoute:()=>hn,path:"/projects/$projectName",component:()=>m.jsx(mf,{}),beforeLoad:async({context:e,params:t,location:i})=>{const s=t.projectName;if(!eU.test(s))return;let r=e.queryClient.getQueryData(Ho({client:le}));if(!r)try{r=await e.queryClient.ensureQueryData(nd({client:le}))}catch{return}const u=r.find(d=>d.id===s);if(u)throw j2({to:i.pathname.replace(`/projects/${s}`,`/projects/${encodeURIComponent(u.name)}`),replace:!0})}}),tU=St({getParentRoute:()=>qn,path:"/",component:()=>m.jsx(fa,{tab:"overview"})}),nU=St({getParentRoute:()=>qn,path:"/portfolio",component:()=>m.jsx(fa,{tab:"portfolio"})}),aU=St({getParentRoute:()=>qn,path:"/search-console",component:()=>m.jsx(fa,{tab:"search-console"})}),iU=St({getParentRoute:()=>qn,path:"/local",component:()=>m.jsx(fa,{tab:"local"})}),sU=St({getParentRoute:()=>qn,path:"/discovery",component:()=>m.jsx(fa,{tab:"discovery"})}),oU=St({getParentRoute:()=>qn,path:"/properties/$targetKey",component:()=>m.jsx(Y$,{})}),rU=St({getParentRoute:()=>qn,path:"/report",component:()=>m.jsx(fa,{tab:"report"})}),lU=St({getParentRoute:()=>qn,path:"/activity",component:()=>m.jsx(fa,{tab:"activity"})}),cU=St({getParentRoute:()=>qn,path:"/backlinks",component:()=>m.jsx(fa,{tab:"backlinks"})}),uU=St({getParentRoute:()=>qn,path:"/technical-aeo",component:()=>m.jsx(fa,{tab:"technical-aeo"})}),dU=St({getParentRoute:()=>qn,path:"/history",component:()=>m.jsx(fa,{tab:"history"})}),mU=St({getParentRoute:()=>qn,path:"/settings",component:()=>m.jsx(fa,{tab:"settings"})}),pU=St({getParentRoute:()=>hn,path:"/runs",component:K$}),fU=St({getParentRoute:()=>hn,path:"/history",component:G$}),hU=St({getParentRoute:()=>hn,path:"/settings",component:H$,beforeLoad:({context:e})=>{}}),gU=St({getParentRoute:()=>hn,path:"/setup",component:P$}),yU=St({getParentRoute:()=>hn,path:"/backlinks",component:Q$}),bU=St({getParentRoute:()=>hn,path:"/traffic",component:Z$}),vU=St({getParentRoute:()=>hn,path:"/traffic/$projectName/$sourceId",component:F$}),kU=St({getParentRoute:()=>hn,path:"*",component:V$}),wU=hn.addChildren([J$,W$,qn.addChildren([tU,nU,aU,iU,sU,oU,rU,lU,cU,uU,dU,mU]),pU,fU,hU,gU,yU,bU,vU,kU]);function xU(){return typeof window<"u"&&window.__CANONRY_CONFIG__?.basePath?window.__CANONRY_CONFIG__.basePath:"/"}const w2=xU(),SU=w2==="/"?"":w2.replace(/\/$/,"");function jU(e,t){return c4({routeTree:wU,basepath:SU||"/",context:{queryClient:e},...t?.initialEntries})}const AU=6e4;function NU(){const[e,t]=B.useState(qp()?"ready":"checking"),[i,s]=B.useState(null),[r,u]=B.useState(!1),[d,g]=B.useState(""),[b,v]=B.useState(""),[x,S]=B.useState(""),[j,_]=B.useState(null),[T,N]=B.useState(!1),[C,O]=B.useState(!1),I=B.useRef(null),$=B.useRef(null),K=B.useRef(null),Z=()=>{const ue=i?`${i.name}:${i.role}`:"no-accounts";if(!I.current||K.current!==ue){$.current?.clear();const fe=HA();$.current=fe,I.current=jU(fe),K.current=ue}return{queryClient:$.current,router:I.current}},se=ue=>ue.authRequired?(u(!0),s(ue.user),t(ue.user?"ready":"account-login"),!0):!1;B.useEffect(()=>{if(qp())return;let ue=!1;return Promise.allSettled([bb(),yb()]).then(([fe,we])=>{if(ue||fe.status==="fulfilled"&&se(fe.value))return;if(we.status==="rejected"){const it=we.reason;_(it instanceof Error?it.message:"Failed to reach the Canonry API"),t("login");return}const Te=we.value;Te.authenticated?t("ready"):t(Te.setupRequired?"setup":"login")}),()=>{ue=!0}},[]),B.useEffect(()=>{if(e!=="ready"||qp())return;const ue=setInterval(()=>{if(r){bb().then(fe=>{fe.authRequired&&!fe.user&&(O(!0),s(null),t("account-login"))}).catch(()=>{});return}yb().then(fe=>{fe.authenticated||(O(!0),t(fe.setupRequired?"setup":"login"))}).catch(()=>{})},AU);return gb(()=>{O(!0),s(null),t(r?"account-login":"login")}),()=>{clearInterval(ue),gb(null)}},[e,r]);const R=async ue=>{if(ue.preventDefault(),!b.trim()||b.trim().length<8){_("Password must be at least 8 characters");return}if(b!==x){_("Passwords do not match");return}N(!0),_(null);try{if(!(await wA(b.trim())).authenticated){_("Setup failed");return}v(""),S(""),O(!1),t("ready")}catch(fe){_(fe instanceof Mn||fe instanceof Error?fe.message:"Setup failed")}finally{N(!1)}},q=async ue=>{if(ue.preventDefault(),!!b.trim()){N(!0),_(null);try{if(!(await xA(b.trim())).authenticated){_("Incorrect password");return}v(""),O(!1),t("ready")}catch(fe){_(fe instanceof Mn||fe instanceof Error?fe.message:"Authentication failed")}finally{N(!1)}}},pe=async ue=>{if(ue.preventDefault(),!(!d.trim()||!b)){N(!0),_(null);try{const fe=await SA(d.trim(),b);if(!fe.user){_("Incorrect name or password.");return}v(""),O(!1),s(fe.user),t("ready")}catch(fe){_(fe instanceof Mn?fe.message:"Incorrect name or password.")}finally{N(!1)}}};if(e==="ready"){const{queryClient:ue,router:fe}=Z();return m.jsx(qA,{account:i,children:m.jsx(u4,{client:ue,children:m.jsx(d4,{router:fe})})})}return m.jsx("div",{className:"min-h-screen bg-bg px-4 py-8",children:m.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-md items-center justify-center",children:m.jsx(Zn,{className:"surface-card w-full",children:e==="checking"?m.jsx(ko,{className:"py-8",children:m.jsx("p",{className:"supporting-copy text-center",children:"Connecting to Canonry…"})}):e==="account-login"?m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),m.jsx(dl,{children:"Sign in to Canonry"}),m.jsx(ml,{children:"Enter the name and password for your account."})]}),m.jsxs(ko,{children:[C?m.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"You were signed out — please sign in again."}):null,m.jsxs("form",{className:"space-y-4",onSubmit:nn(pe),children:[m.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-name",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Name"}),m.jsx("input",{autoFocus:!0,id:"account-name",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"text",autoComplete:"username",value:d,onChange:ue=>g(ue.target.value)})]}),m.jsxs("label",{className:"block space-y-1.5",htmlFor:"account-password",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{id:"account-password",className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",autoComplete:"current-password",value:b,onChange:ue=>v(ue.target.value)})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!d.trim()||!b,children:T?"Signing in…":"Sign in"})]})]})]}):e==="setup"?m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"First-time setup"}),m.jsx(dl,{children:"Create a dashboard password"}),m.jsx(ml,{children:"Choose a password to protect the Canonry dashboard. You will use this to sign in on future visits."})]}),m.jsx(ko,{children:m.jsxs("form",{className:"space-y-4",onSubmit:nn(R),children:[m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:b,onChange:ue=>v(ue.target.value),placeholder:"At least 8 characters"})]}),m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Confirm password"}),m.jsx("input",{className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:x,onChange:ue=>S(ue.target.value),placeholder:"Re-enter password"})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!b.trim()||!x.trim(),children:T?"Setting up…":"Create password & open dashboard"})]})})]}):m.jsxs(m.Fragment,{children:[m.jsxs(ul,{children:[m.jsx("p",{className:"eyebrow eyebrow-soft",children:"Dashboard access"}),m.jsx(dl,{children:"Sign in to Canonry"}),m.jsx(ml,{children:"Enter your dashboard password to continue."})]}),m.jsxs(ko,{children:[C?m.jsx("p",{className:"mb-4 rounded-md border border-caution bg-caution-soft px-3 py-2 text-sm text-caution",children:"Your session expired — please sign in again."}):null,m.jsxs("form",{className:"space-y-4",onSubmit:nn(q),children:[m.jsxs("label",{className:"block space-y-1.5",children:[m.jsx("span",{className:"text-xs font-medium text-secondary",children:"Password"}),m.jsx("input",{autoFocus:!0,className:"w-full rounded-md border border-base bg-bg px-3 py-2 text-sm text-heading outline-none transition focus:border-mono-600",type:"password",value:b,onChange:ue=>v(ue.target.value),placeholder:"Dashboard password"})]}),j?m.jsx("p",{className:"text-sm text-negative-400",children:j}):null,m.jsx(De,{type:"submit",disabled:T||!b.trim(),children:T?"Signing in…":"Open dashboard"})]})]})]})})})})}const H3=document.getElementById("root");if(!H3)throw new Error("Expected #root element for web app bootstrap.");b4.createRoot(H3).render(m.jsx(B.StrictMode,{children:m.jsx(NU,{})}));export{WK as $,jK as A,De as B,n0 as C,xK as D,AK as E,lV as F,oK as G,ZK as H,nl as I,YK as J,XK as K,bV as L,yV as M,zV as N,pn as O,MI as P,eG as Q,tG as R,KN as S,An as T,SV as U,nG as V,jV as W,$o as X,kV as Y,xV as Z,JK as _,RG as a,ZU as a$,FK as a0,vV as a1,aG as a2,uG as a3,oG as a4,lG as a5,rG as a6,cG as a7,RA as a8,W0 as a9,SB as aA,UB as aB,PK as aC,UK as aD,$K as aE,kK as aF,wK as aG,CG as aH,zG as aI,EG as aJ,AV as aK,Ho as aL,NV as aM,X0 as aN,TG as aO,OG as aP,DG as aQ,BB as aR,LG as aS,nk as aT,sk as aU,xG as aV,HK as aW,de as aX,XU as aY,YU as aZ,FU as a_,Oe as aa,sG as ab,Rx as ac,Ya as ad,iG as ae,cD as af,uD as ag,cK as ah,lK as ai,FV as aj,tK as ak,nK as al,Mn as am,aK as an,WU as ao,ak as ap,uB as aq,xN as ar,MN as as,Lq as at,ku as au,iK as av,yf as aw,SG as ax,wV as ay,rK as az,Tu as b,BG as b$,GU as b0,KU as b1,QU as b2,HU as b3,VU as b4,UU as b5,MU as b6,BU as b7,$U as b8,PU as b9,_K as bA,dV as bB,mV as bC,NK as bD,pV as bE,fV as bF,gV as bG,hV as bH,Dl as bI,nd as bJ,AL as bK,xl as bL,G2 as bM,EK as bN,TK as bO,UG as bP,E$ as bQ,VK as bR,QK as bS,DK as bT,RK as bU,BK as bV,OK as bW,dn as bX,hA as bY,hB as bZ,qG as b_,LU as ba,qU as bb,IU as bc,RU as bd,OU as be,DU as bf,TU as bg,$4 as bh,mK as bi,wG as bj,dK as bk,qV as bl,VG as bm,hK as bn,pK as bo,gK as bp,yK as bq,uK as br,fK as bs,oV as bt,sV as bu,iV as bv,IV as bw,uV as bx,CK as by,Ov as bz,tt as c,VV as c$,tV as c0,nV as c1,eV as c2,yA as c3,aV as c4,xB as c5,rV as c6,dG as c7,pG as c8,zA as c9,BV as cA,qo as cB,Mv as cC,QV as cD,YV as cE,JV as cF,WV as cG,ZV as cH,XV as cI,eK as cJ,BI as cK,Jx as cL,$I as cM,Wx as cN,e3 as cO,gN as cP,HV as cQ,jb as cR,NG as cS,tN as cT,vK as cU,H0 as cV,zK as cW,jG as cX,_G as cY,GV as cZ,bK as c_,RV as ca,fG as cb,hG as cc,mG as cd,SK as ce,EV as cf,TV as cg,DV as ch,MV as ci,OV as cj,zo as ck,J0 as cl,IG as cm,od as cn,nh as co,KK as cp,GK as cq,jA as cr,lA as cs,JU as ct,cV as cu,_V as cv,CV as cw,j$ as cx,rd as cy,ah as cz,jz as d,KV as d0,UV as d1,AG as d2,oE as d3,qK as d4,MK as d5,LK as d6,IK as d7,MG as e,Zn as f,Sa as g,Hv as h,iA as i,nn as j,sK as k,gG as l,le as m,yG as n,bG as o,kG as p,vG as q,LV as r,$V as s,mB as t,ih as u,PV as v,cB as w,PG as x,$G as y,Lf as z};
@@ -1 +1 @@
1
- import{c as e}from"./index-bcpm37b9.js";const o=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],a=e("chevron-left",o);const t=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],h=e("refresh-cw",t);export{a as C,h as R};
1
+ import{c as e}from"./index-DP74nMja.js";const o=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],a=e("chevron-left",o);const t=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],h=e("refresh-cw",t);export{a as C,h as R};
@@ -1 +1 @@
1
- import{c as a}from"./index-bcpm37b9.js";const t=[["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"}]],h=a("circle-question-mark",t);const e=[["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"}]],d=a("download",e);const o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a("external-link",o);const c=[["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"}]],s=a("trash-2",c);export{h as C,d as D,p as E,s as T};
1
+ import{c as a}from"./index-DP74nMja.js";const t=[["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"}]],h=a("circle-question-mark",t);const e=[["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"}]],d=a("download",e);const o=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],p=a("external-link",o);const c=[["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"}]],s=a("trash-2",c);export{h as C,d as D,p as E,s as T};
@@ -0,0 +1 @@
1
+ function E(e){const r=e[0];return r?e.every(a=>a.mode===r.mode&&a.scope.kind===r.scope.kind&&a.scope.key===r.scope.key&&a.queryClass===r.queryClass&&a.measurement.displayedRunId===r.measurement.displayedRunId):!0}function o(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator}}function k(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function K(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function $(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function C(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function I(e,r,a){const u=new Map;if(!r)return u;const i=new Map(e.usageEdges.map(n=>[C(n),n.targetKey])),m=new Map(e.assignments.map(n=>[`${n.targetKey}:${n.queryId}`,n.queryClass])),g=new Map(e.usageEdges.map(n=>[C(n),m.get(`${n.targetKey}:${n.queryId}`)]));for(const n of r.evidence){if(a&&g.get(n.usageEdgeId)!==a)continue;const l=i.get(n.usageEdgeId);if(!l)continue;const p=u.get(l)??[];p.push({id:`${n.observationId}:${n.expectedSlotId}:${n.usageEdgeId}:${n.sourceUrl}`,kind:K(n.classification),query:n.queryText,provider:n.provider,location:n.location,url:n.sourceUrl,tone:$(n.classification),historical:n.historical||n.bridged}),u.set(l,p)}return u}function T(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(a=>a.state==="unavailable").map(a=>a.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function M(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function S(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function x(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function R({overview:e,activePlan:r,report:a,reportState:u=a?"ready":"loading"}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=r.plan,m=new Map(i.targets.map(t=>[t.stableKey,t])),g=new Map(i.querySnapshots.map(t=>[t.queryId,t.queryText])),n=new Map;for(const t of i.assignments){if(e.queryClass!=="all"&&t.queryClass!==e.queryClass)continue;const s=g.get(t.queryId);if(!s)continue;const d=n.get(t.targetKey)??new Set;d.add(s),n.set(t.targetKey,d)}const l=a?.revision===r.revision&&a.run?.id===e.measurement.displayedRunId?a:null,p=e.measurement.displayedRunId===void 0||l?"ready":u==="error"||a!=null?"error":"loading",h=I(i,l,e.queryClass==="all"?void 0:e.queryClass),f=new Map;for(const t of i.groups)for(const s of t.targetKeys)f.has(s)||f.set(s,t.label);const y=e.properties.items.map(t=>{const s=m.get(t.targetKey),d=h.get(t.targetKey)??[];return{id:t.targetKey,name:t.label,mentionCoverage:o(t.mentionCoverage),citationCoverage:o(t.citationCoverage),status:T(t),providers:t.providers?.map(c=>({provider:c.provider,mentionCoverage:o(c.mentionCoverage),citationCoverage:o(c.citationCoverage)})),market:f.get(t.targetKey),assignedQueries:[...n.get(t.targetKey)??[]],urls:s?.urlMatchers.map(k)??[],evidence:d,evidenceState:p,historical:d.some(c=>c.historical)}}),b=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),q=e.properties.items.flatMap(t=>t.flags>0?[{id:`property:${t.targetKey}`,property:t.label,summary:`${t.flags} ${t.flags===1?"result needs":"results need"} review.`,tone:"caution",count:t.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:M(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:S(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:o(e.metrics.propertiesMentioned),mentionCoverage:o(e.metrics.mentionCoverage),citationCoverage:o(e.metrics.citationCoverage)},properties:y,...b?{shareOfVoice:b}:{}},propertyTotal:e.properties.totalEstimate??y.length,nextCursor:e.properties.nextCursor},availableGroups:i.groups.map(t=>({id:t.stableKey,label:t.label})),...x(e)?{nextActionText:x(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:q}}export{E as a,R as b,k as m};
package/assets/index.html CHANGED
@@ -12,12 +12,12 @@
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-bcpm37b9.js"></script>
15
+ <script type="module" crossorigin src="./assets/index-DP74nMja.js"></script>
16
16
  <link rel="modulepreload" crossorigin href="./assets/vendor-tanstack-BjS7iY3g.js">
17
17
  <link rel="modulepreload" crossorigin href="./assets/vendor-radix-DnzzbllM.js">
18
18
  <link rel="modulepreload" crossorigin href="./assets/vendor-recharts-33ACLxsD.js">
19
19
  <link rel="modulepreload" crossorigin href="./assets/vendor-markdown-CpDJch4G.js">
20
- <link rel="stylesheet" crossorigin href="./assets/index-CLt6zzLW.css">
20
+ <link rel="stylesheet" crossorigin href="./assets/index-CiidhUL0.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonry/canonry",
3
- "version": "4.151.0",
3
+ "version": "4.152.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",
@@ -68,25 +68,25 @@
68
68
  "tsx": "^4.19.0",
69
69
  "@ainyc/canonry-api-client": "0.0.0",
70
70
  "@ainyc/canonry-api-routes": "0.0.0",
71
- "@ainyc/canonry-config": "0.0.0",
72
- "@ainyc/canonry-contracts": "0.0.0",
73
71
  "@ainyc/canonry-db": "0.0.0",
72
+ "@ainyc/canonry-contracts": "0.0.0",
73
+ "@ainyc/canonry-config": "0.0.0",
74
74
  "@ainyc/canonry-integration-bing": "0.0.0",
75
75
  "@ainyc/canonry-integration-openai-ads": "0.0.0",
76
+ "@ainyc/canonry-integration-cloud-run": "0.0.0",
76
77
  "@ainyc/canonry-integration-commoncrawl": "0.0.0",
77
78
  "@ainyc/canonry-integration-google-business-profile": "0.0.0",
78
79
  "@ainyc/canonry-integration-google": "0.0.0",
79
- "@ainyc/canonry-integration-google-places": "0.0.0",
80
80
  "@ainyc/canonry-integration-traffic": "0.0.0",
81
- "@ainyc/canonry-integration-cloud-run": "0.0.0",
82
81
  "@ainyc/canonry-integration-wordpress": "0.0.0",
83
82
  "@ainyc/canonry-intelligence": "0.0.0",
83
+ "@ainyc/canonry-integration-google-places": "0.0.0",
84
84
  "@ainyc/canonry-provider-cdp": "0.0.0",
85
85
  "@ainyc/canonry-provider-gemini": "0.0.0",
86
- "@ainyc/canonry-provider-local": "0.0.0",
87
86
  "@ainyc/canonry-provider-claude": "0.0.0",
88
- "@ainyc/canonry-provider-perplexity": "0.0.0",
89
- "@ainyc/canonry-provider-openai": "0.0.0"
87
+ "@ainyc/canonry-provider-local": "0.0.0",
88
+ "@ainyc/canonry-provider-openai": "0.0.0",
89
+ "@ainyc/canonry-provider-perplexity": "0.0.0"
90
90
  },
91
91
  "scripts": {
92
92
  "build": "tsx scripts/copy-agent-assets.ts && tsup && tsx build-web.ts",
@@ -1 +0,0 @@
1
- function S(e){const r=e[0];return r?e.every(a=>a.mode===r.mode&&a.scope.kind===r.scope.kind&&a.scope.key===r.scope.key&&a.queryClass===r.queryClass&&a.measurement.displayedRunId===r.measurement.displayedRunId):!0}function l(e){return e.state==="unavailable"?{numerator:null,denominator:null,reason:e.reason}:e.numerator===void 0||e.denominator===void 0||e.denominator<=0?{numerator:null,denominator:null,reason:"not_applicable"}:{numerator:e.numerator,denominator:e.denominator}}function q(e){return e.kind==="exact"?e.url:e.kind==="prefix"?`https://${e.host}${e.pathPrefix}/*`:`https://${e.host}/*`}function k(e){return e==="assigned"?"this-property":e==="sibling"?"another-property":e==="ownedUnmapped"?"owned-unassigned":e==="external"?"external":e==="ambiguous"?"multiple-properties":"invalid-url"}function $(e){return e==="assigned"?"positive":e==="external"?"neutral":e==="invalid"?"negative":"caution"}function y(e){return`target:${e.targetKey}:${e.queryId}:${e.executionNodeKey}`}function K(e,r,a){const s=new Map;if(!r)return s;const i=new Map(e.usageEdges.map(n=>[y(n),n.targetKey])),p=new Map(e.assignments.map(n=>[`${n.targetKey}:${n.queryId}`,n.queryClass])),m=new Map(e.usageEdges.map(n=>[y(n),p.get(`${n.targetKey}:${n.queryId}`)]));for(const n of r.evidence){if(a&&m.get(n.usageEdgeId)!==a)continue;const o=i.get(n.usageEdgeId);if(!o)continue;const d=s.get(o)??[];d.push({id:`${n.observationId}:${n.expectedSlotId}:${n.usageEdgeId}:${n.sourceUrl}`,kind:k(n.classification),query:n.queryText,provider:n.provider,location:n.location,url:n.sourceUrl,tone:$(n.classification),historical:n.historical||n.bridged}),s.set(o,d)}return s}function I(e){if(e.flags>0)return{label:"Review",tone:"caution"};const r=[e.mentionCoverage,e.citationCoverage].filter(a=>a.state==="unavailable").map(a=>a.reason);return r.includes("no_completed_run")?{label:"Not measured",tone:"neutral"}:r.includes("plan_v1")?{label:"Update setup",tone:"caution"}:r.includes("evidence_incomplete")?{label:"Evidence incomplete",tone:"caution"}:r.includes("no_population")?{label:"No queries",tone:"neutral"}:r.includes("not_applicable")?{label:"Not applicable",tone:"neutral"}:{label:"Complete",tone:"positive"}}function T(e){return e==="complete"?{label:"Complete",tone:"positive"}:e==="partial"?{label:"Partial",tone:"caution"}:e==="queued"?{label:"Queued",tone:"neutral"}:e==="running"?{label:"Running",tone:"neutral"}:e==="failed"?{label:"Failed",tone:"negative"}:{label:"Not measured",tone:"neutral"}}function M(e){if(!e)return"";const r=new Date(e);return Number.isFinite(r.getTime())?r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"}):""}function b(e){const r=e.nextAction.count??e.flags.total;if(e.nextAction.kind==="review_flags")return`${r} flagged ${r===1?"result needs":"results need"} review.`;if(e.nextAction.kind==="complete_setup")return"Finish setup.";if(e.nextAction.kind==="republish_setup")return"Setup update required.";if(e.nextAction.kind==="run_measurement")return"Ready to measure."}function E({overview:e,activePlan:r,report:a,reportState:s=a?"ready":"loading"}){if(r.plan.schemaVersion!==2||e.mode!=="active-v2")throw new Error("The current overview requires an active version-two setup.");if(e.scope.kind!=="all"&&e.scope.kind!=="group")throw new Error("The current overview requires an All Properties or group scope.");const i=r.plan,p=new Map(i.targets.map(t=>[t.stableKey,t])),m=new Map(i.querySnapshots.map(t=>[t.queryId,t.queryText])),n=new Map;for(const t of i.assignments){if(e.queryClass!=="all"&&t.queryClass!==e.queryClass)continue;const c=m.get(t.queryId);if(!c)continue;const u=n.get(t.targetKey)??new Set;u.add(c),n.set(t.targetKey,u)}const o=a?.revision===r.revision&&a.run?.id===e.measurement.displayedRunId?a:null,d=e.measurement.displayedRunId===void 0||o?"ready":s==="error"||a!=null?"error":"loading",x=K(i,o,e.queryClass==="all"?void 0:e.queryClass),g=e.properties.items.map(t=>{const c=p.get(t.targetKey),u=x.get(t.targetKey)??[];return{id:t.targetKey,name:t.label,mentionCoverage:l(t.mentionCoverage),citationCoverage:l(t.citationCoverage),status:I(t),assignedQueries:[...n.get(t.targetKey)??[]],urls:c?.urlMatchers.map(q)??[],evidence:u,evidenceState:d,historical:u.some(h=>h.historical)}}),f=e.namedShareOfVoice?.entries.map(t=>({name:t.label,coverage:{numerator:t.credits,denominator:e.namedShareOfVoice.denominator}})),C=e.properties.items.flatMap(t=>t.flags>0?[{id:`property:${t.targetKey}`,property:t.label,summary:`${t.flags} ${t.flags===1?"result needs":"results need"} review.`,tone:"caution",count:t.flags}]:[]);return{classReporting:"available",latestMeasurement:{status:T(e.measurement.state),completedSlots:e.measurement.completed,totalSlots:e.measurement.expected,date:M(e.measurement.completedAt),includesBridgedHistory:e.measurement.includesHistoricalData===!0},currentView:{scope:e.scope.kind==="group"?{kind:"group",...e.scope.key?{key:e.scope.key}:{}}:{kind:"all"},queryClass:e.queryClass,aggregate:{metrics:{propertiesMentioned:l(e.metrics.propertiesMentioned),mentionCoverage:l(e.metrics.mentionCoverage),citationCoverage:l(e.metrics.citationCoverage)},properties:g,...f?{shareOfVoice:f}:{}},propertyTotal:e.properties.totalEstimate??g.length,nextCursor:e.properties.nextCursor},availableGroups:i.groups.map(t=>({id:t.stableKey,label:t.label})),...b(e)?{nextActionText:b(e)}:{},flaggedResultsTotal:e.flags.total,flaggedResults:C}}export{S as a,E as b,q as m};