@canonry/canonry 7.90.0 → 7.90.1
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/assets/assets/{AgentSetupPage-oSoM5flN.js → AgentSetupPage-BSfsbQXZ.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-BHPa2zdE.js +4 -0
- package/assets/assets/{ProjectPage-p-rDlzSq.js → ProjectPage-C1AI_aAQ.js} +7 -7
- package/assets/assets/{RunsPage-CjkPCc9Z.js → RunsPage-DKIktkY1.js} +1 -1
- package/assets/assets/SettingsPage-CTXfqNZs.js +1 -0
- package/assets/assets/{SiteHealthSection-BZhulwSy.js → SiteHealthSection-CRwvLfHd.js} +2 -2
- package/assets/assets/{TrafficPage-Dr8NTQpA.js → TrafficPage-C4R3X5lf.js} +4 -4
- package/assets/assets/index-DdG9gR0r.js +60 -0
- package/assets/assets/{react-sigma_core.esm.min-OHqBWE8n.js → react-sigma_core.esm.min-BoCIEnkF.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-YPJCZD5H.js → chunk-CHTADAEC.js} +1 -1
- package/dist/{chunk-C2XWWIJZ.js → chunk-T7OH3YPX.js} +3 -3
- package/dist/{chunk-OVUFIG22.js → chunk-YFZHRYCM.js} +6 -1
- package/dist/{cli-commands-5ISZA43S.js → cli-commands-EXWAMK7Z.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +21 -21
- package/dist/index.js +1 -1
- package/dist/{init-K4623VOY.js → init-2WZWYSDW.js} +1 -1
- package/dist/{serve-TVODHNFU.js → serve-VVG3VYMU.js} +1 -1
- package/package.json +1 -1
- package/assets/assets/MeasurementPropertyPage-BZKiS1V0.js +0 -4
- package/assets/assets/SettingsPage-BNHMlx6C.js +0 -1
- package/assets/assets/index-BrHemYsG.js +0 -60
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./react-sigma_core.esm.min-
|
|
2
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{A as r,C as i,F as a,J as o,N as s,V as c,X as l,Y as u,Z as d,b as f,ct as p,g as m,h,n as g,p as _,rt as v,s as y,st as b,w as x}from"./vendor-lucide-Bo69m9KC.js";import{r as S}from"./vendor-markdown-BiRP51B0.js";import{b as C,g as ee}from"./vendor-tanstack-tBjrfzKu.js";import{c as te,f as ne,i as re,m as ie,r as ae,s as oe,t as se}from"./vendor-recharts-CY6tH-r6.js";import{An as ce,Di as le,Hi as w,St as T,Tt as ue,_i as de,bi as E,ci as fe,hi as pe,i as D,li as me,lr as he,mi as ge,mt as O,qi as _e,r as k,t as A,vi as j,wi as ve,wn as M,wt as ye,xi as N,yi as P}from"./ToneBadge-B3rD6bDF.js";import{r as be}from"./account-context-GstYbqpX.js";import{d as xe,o as Se}from"./query-client-DjRrRIsq.js";import{$t as Ce,Et as we,Gt as Te,Jt as Ee,Kt as De,Qt as Oe,Wt as F,Xt as ke,Yt as I,Zt as Ae,_t as je,en as Me,nn as Ne,qt as Pe,rn as Fe,tn as Ie,un as Le}from"./react-query-B8JD_K7g.js";import{a as Re,d as ze,f as L,g as Be,h as R,i as Ve,l as He,m as Ue,n as We,o as z,p as Ge,r as Ke,s as qe,t as Je,u as Ye}from"./ChartPrimitives-Cs2iavxU.js";import{t as B}from"./InfoTooltip-CNLlIWeP.js";import{t as Xe}from"./card-CgdGerYK.js";import{B as Ze,S as Qe,U as $e,V as et,d as tt,en as nt,f as rt,g as it,m as at,nn as V,p as ot,pn as st,t as ct,w as lt,z as ut}from"./index-BrHemYsG.js";var H=t(p(),1),dt=/^www\./i;function ft(e){if(!e)return null;try{return new URL(e).hostname}catch{return null}}function pt(e){return e.trim().toLowerCase().replace(dt,``)}function mt(e,t){if(!t)return!1;try{return pt(new URL(e).hostname)===pt(t)}catch{return!1}}function U(e,t){if(!e)return``;if(!mt(e,t))return e;let n=new URL(e),r=`${n.pathname}${n.search}${n.hash}`;return r===``?`/`:r}function ht(e,t){return U(e.url,t)||e.path||`/`}var gt=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),_t=gt();function vt(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var W=vt;typeof Object.assign==`function`&&(W=Object.assign);function G(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function K(e){return typeof e==`object`&&!!e}function yt(e){let t;for(t in e)return!1;return!0}function bt(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function xt(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function St(e){return!(!K(e)||e.attributes&&!Array.isArray(e.attributes))}function Ct(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function wt(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done)t=null;else break}while(1);return r}}}function Tt(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var Et=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},q=class e extends Et{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},J=class e extends Et{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},Y=class e extends Et{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function Dt(e,t){this.key=e,this.attributes=t,this.clear()}Dt.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ot(e,t){this.key=e,this.attributes=t,this.clear()}Ot.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function kt(e,t){this.key=e,this.attributes=t,this.clear()}kt.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function At(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}At.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},At.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];a===void 0?(i[r]=this,this.undirected&&n===r||(this.target[t][n]=this)):(a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this)},At.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},At.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var jt=0,Mt=1,Nt=2,Pt=3;function Ft(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===jt){if(s=e._nodes.get(r),!s)throw new J(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===Pt){if(i=``+i,c=e._edges.get(i),!c)throw new J(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new J(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new J(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===Mt?c.source:c.target,l=i,u=a}return[s,l,u]}function It(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return a.attributes[o]}}function Lt(e,t,n){e.prototype[t]=function(e,r){let[i]=Ft(this,t,n,e,r);return i.attributes}}function Rt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function zt(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Ft(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Bt(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Ft(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new q(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Vt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function Ht(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(!K(o))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function Ut(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(!K(o))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return W(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function Wt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(typeof o!=`function`)throw new q(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var Gt=[{name:e=>`get${e}Attribute`,attacher:It},{name:e=>`get${e}Attributes`,attacher:Lt},{name:e=>`has${e}Attribute`,attacher:Rt},{name:e=>`set${e}Attribute`,attacher:zt},{name:e=>`update${e}Attribute`,attacher:Bt},{name:e=>`remove${e}Attribute`,attacher:Vt},{name:e=>`replace${e}Attributes`,attacher:Ht},{name:e=>`merge${e}Attributes`,attacher:Ut},{name:e=>`update${e}Attributes`,attacher:Wt}];function Kt(e){Gt.forEach(function({name:t,attacher:n}){n(e,t(`Node`),jt),n(e,t(`Source`),Mt),n(e,t(`Target`),Nt),n(e,t(`Opposite`),Pt)})}function qt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function Jt(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=G(this,i,a,n),!r)throw new J(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Yt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function Xt(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=G(this,o,s,n),!a)throw new J(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Zt(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=G(this,o,s,n),!a)throw new J(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new q(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Qt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function $t(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!K(r))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function en(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!K(r))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return W(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function tn(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new q(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var nn=[{name:e=>`get${e}Attribute`,attacher:qt},{name:e=>`get${e}Attributes`,attacher:Jt},{name:e=>`has${e}Attribute`,attacher:Yt},{name:e=>`set${e}Attribute`,attacher:Xt},{name:e=>`update${e}Attribute`,attacher:Zt},{name:e=>`remove${e}Attribute`,attacher:Qt},{name:e=>`replace${e}Attributes`,attacher:$t},{name:e=>`merge${e}Attributes`,attacher:en},{name:e=>`update${e}Attributes`,attacher:tn}];function rn(e){nn.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var an=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function X(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function on(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function sn(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function cn(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function ln(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function un(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function dn(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function fn(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function pn(e,t){if(e.size===0)return Tt();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function mn(e,t,n,r,i,a){let o=t?on:X,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function hn(e,t,n,r){let i=[];return mn(!1,e,t,n,r,function(e){i.push(e)}),i}function gn(e,t,n){let r=Tt();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=wt(r,sn(n.in))),t!==`in`&&n.out!==void 0&&(r=wt(r,sn(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=wt(r,sn(n.undirected))),r}function _n(e,t,n,r,i,a,o){let s=n?ln:cn,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function vn(e,t,n,r,i){let a=[];return _n(!1,e,t,n,r,i,function(e){a.push(e)}),a}function yn(e,t,n,r){let i=Tt();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=wt(i,un(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=wt(i,un(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=wt(i,un(n.undirected,r))),i}function bn(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return dn(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${n}: could not find the "${e}" node in the graph.`);return hn(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new J(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${n}: could not find the "${t}" target node in the graph.`);return vn(r,this.multi,i,a,t)}throw new q(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function xn(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r===`mixed`||this.type===`mixed`||r===this.type){if(arguments.length===1)return n=e,fn(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return mn(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return _n(!1,r,this.multi,i,o,t,n)}throw new q(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new q(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function Sn(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,fn(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return mn(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return _n(!0,r,this.multi,i,o,t,n)}throw new q(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function Cn(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Tt();if(!arguments.length)return pn(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return gn(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return yn(r,i,n,t)}throw new q(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function wn(e){an.forEach(t=>{bn(e,t),xn(e,t),Sn(e,t),Cn(e,t)})}var Tn=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function En(){this.A=null,this.B=null}En.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},En.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Dn(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function On(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return Dn(e,null,r,r.undirected,i);if(typeof n==`string`)return Dn(e,null,r,r[n],i)}let a=new En,o;if(t!==`undirected`){if(n!==`out`){if(o=Dn(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=Dn(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=Dn(e,a,r,r.undirected,i),e&&o))return o}function kn(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return On(!1,e,t,n,function(e){r.push(e)}),r}function An(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;o=c===t?l:c,e&&e.has(o.key)&&(o=null)}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function jn(e,t,n){if(e!==`mixed`){if(e===`undirected`)return An(null,n,n.undirected);if(typeof t==`string`)return An(null,n,n[t])}let r=Tt(),i=new En;return e!==`undirected`&&(t!==`out`&&(r=wt(r,An(i,n,n.in))),t!==`in`&&(r=wt(r,An(i,n,n.out)))),e!==`directed`&&(r=wt(r,An(i,n,n.undirected))),r}function Mn(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${n}: could not find the "${e}" node in the graph.`);return kn(r===`mixed`?this.type:r,i,t)}}function Nn(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);On(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function Pn(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new J(`Graph.${o}: could not find the "${e}" node in the graph.`);return On(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function Fn(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Tt();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return jn(r===`mixed`?this.type:r,i,t)}}function In(e){Tn.forEach(t=>{Mn(e,t),Nn(e,t),Pn(e,t),Fn(e,t)})}function Ln(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function Rn(e,t){let n={key:e};return yt(t.attributes)||(n.attributes=W({},t.attributes)),n}function zn(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return yt(n.attributes)||(r.attributes=W({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function Bn(e){if(!K(e))throw new q(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new q(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!K(e.attributes)||e.attributes===null))throw new q(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function Vn(e){if(!K(e))throw new q(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new q(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new q(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!K(e.attributes)||e.attributes===null))throw new q(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new q(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var Hn=Ct(),Un=new Set([`directed`,`undirected`,`mixed`]),Wn=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),Gn=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],Kn={allowSelfLoops:!0,multi:!1,type:`mixed`};function qn(e,t,n){if(n&&!K(n))throw new q(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new Y(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Jn(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Yn(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new Y(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new Y(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!K(s))throw new q(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new Y(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new J(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new J(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new Y(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new Y(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new At(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function Xn(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new Y(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new Y(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new q(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!K(s))throw new q(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new Y(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new Y(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else W(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new Y(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=Jn(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=Jn(e,o,{}),g=!0),f=new At(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function Zn(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var Z=class e extends _t.EventEmitter{constructor(e){if(super(),e=W({},Kn,e),typeof e.multi!=`boolean`)throw new q(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Un.has(e.type))throw new q(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new q(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?Dt:e.type===`directed`?Ot:kt;bt(this,`NodeDataClass`,t);let n=`geid_`+Hn()+`_`,r=0;bt(this,`_attributes`,{}),bt(this,`_nodes`,new Map),bt(this,`_edges`,new Map),bt(this,`_directedSize`,0),bt(this,`_undirectedSize`,0),bt(this,`_directedSelfLoopCount`,0),bt(this,`_undirectedSelfLoopCount`,0),bt(this,`_edgeKeyGenerator`,()=>{let e;do e=n+r++;while(this._edges.has(e));return e}),bt(this,`_options`,e),Wn.forEach(e=>bt(this,e,this[e])),xt(this,`order`,()=>this._nodes.size),xt(this,`size`,()=>this._edges.size),xt(this,`directedSize`,()=>this._directedSize),xt(this,`undirectedSize`,()=>this._undirectedSize),xt(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),xt(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),xt(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),xt(this,`multi`,this._options.multi),xt(this,`type`,this._options.type),xt(this,`allowSelfLoops`,this._options.allowSelfLoops),xt(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new Y(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new J(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new Y(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new J(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new Y(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`directed`&&t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new J(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new J(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new J(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return qn(this,e,t).key}mergeNode(e,t){if(t&&!K(t))throw new q(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(W(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new q(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do Zn(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do Zn(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do Zn(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=G(this,e,n,this.type),!t)throw new J(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new J(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Zn(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new Y(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new Y(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=G(this,e,t,`directed`);if(!n)throw new J(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Zn(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new Y(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new Y(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=G(this,e,t,`undirected`);if(!n)throw new J(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Zn(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new q(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!K(e))throw new q(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!K(e))throw new q(`Graph.mergeAttributes: provided attributes are not a plain object.`);return W(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new q(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new q(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!St(t))throw new q(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new q(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!St(t))throw new q(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new q(`Graph.forEachAdjacencyEntry: expecting a callback.`);Ln(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new q(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);Ln(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new q(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);Ln(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new q(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);Ln(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new q(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new q(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new q(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new q(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new q(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new q(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new q(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new q(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=Rn(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=zn(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!K(t))throw new q(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!K(t.attributes))throw new q(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new q(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],Bn(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new q(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],Vn(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(W({},this._options,t));return n.replaceAttributes(W({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=W({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new Y(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new Y(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Y(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,Yn(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,W({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!Wn.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,bt(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(Z.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Z.prototype.inspect),Gn.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?Yn:Xn;e.generateKey?Z.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:Z.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),Kt(Z),rn(Z),wn(Z),In(Z);var Qn=class extends Z{constructor(e){let t=W({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new q(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new q(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},$n=class extends Z{constructor(e){let t=W({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new q(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new q(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},er=class extends Z{constructor(e){let t=W({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},tr=class extends Z{constructor(e){let t=W({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new q(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},nr=class extends Z{constructor(e){let t=W({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new q(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function rr(e){e.from=function(t,n){let r=new e(W({},t.options,n));return r.import(t),r}}rr(Z),rr(Qn),rr($n),rr(er),rr(tr),rr(nr),Z.Graph=Z,Z.DirectedGraph=Qn,Z.UndirectedGraph=$n,Z.MultiGraph=er,Z.MultiDirectedGraph=tr,Z.MultiUndirectedGraph=nr,Z.InvalidArgumentsGraphError=q,Z.NotFoundGraphError=J,Z.UsageGraphError=Y;var ir={eligible:{property:`--chart-site-health-eligible`,fallback:`#56b4e9`},hidden:{property:`--chart-site-health-hidden`,fallback:`#e69f00`},resource:{property:`--chart-site-health-resource`,fallback:`#d4d4d8`},redirect:{property:`--chart-site-health-redirect`,fallback:`#9aa7b8`},failed:{property:`--chart-site-health-failed`,fallback:`#d55e00`},unchecked:{property:`--chart-site-health-unchecked`,fallback:`#a1a1aa`}},ar={property:`--chart-neutral-text-dim`,fallback:`#71717a`},or=2.5,sr=200,cr=3,lr=1.6;function ur(e){let t=sr/Math.max(sr,e);return Math.max(cr,9*t**.25)}function dr(e){return ur(e)*lr}var fr={eligible:ir.eligible,hidden:ir.hidden,resource:ir.resource,redirect:ir.redirect,failed:ir.failed,unchecked:ir.unchecked,dimmedNode:{property:`--chart-neutral-text-dim`,fallback:`#71717a`},edge:ar,edgeDimmed:{property:`--chart-neutral-text-faint`,fallback:`#52525b`},edgeActive:{property:`--chart-neutral-text`,fallback:`#a1a1aa`},label:{property:`--chart-tooltip-label`,fallback:`#e4e4e7`},background:{property:`--chart-tooltip-bg`,fallback:`#18181b`}},pr=/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i,mr=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/;function hr(e){return pr.test(e)||mr.test(e)}var gr=50,_r=.75,vr=[{maxRatio:.2,budget:1/0},{maxRatio:.45,budget:60},{maxRatio:_r,budget:24}];function yr(e){for(let t of vr)if(e<=t.maxRatio)return t.budget;return 1}function br(e){return Math.max(0,Math.min(1,(e.linkScoreNormalized??0)/100))}function xr(e){return e.healthState?e.healthState:N(e)}function Sr(e){switch(e){case`eligible`:return`Indexable`;case`hidden`:return`Hidden`;case`resource`:return`Not a page`;case`redirect`:return`Moved`;case`failed`:return`Broken`;case`unchecked`:return`Not checked`}}function Cr(e){switch(e){case`eligible`:return`Indexable`;case`hidden`:return`Hidden or points elsewhere`;case`resource`:return`Not a page`;case`redirect`:return`Moved`;case`failed`:return`Broken`;case`unchecked`:return`Not checked`}}function wr(e){switch(e){case`eligible`:return`AI and search engines are allowed to index this page`;case`hidden`:return`This page tells them not to index it, or points them to another page`;case`resource`:return`A file rather than a page, such as a text file or a PDF. Answer engines can still read it`;case`redirect`:return`This address sends visitors to another page`;case`failed`:return`This page could not be loaded`;case`unchecked`:return`This page was found but not checked`}}function Tr(e){switch(e){case`eligible`:return`●`;case`hidden`:return`◆`;case`resource`:return`▪`;case`redirect`:return`↗`;case`failed`:return`×`;case`unchecked`:return`○`}}function Er(e,t){return!!t&&e.nodeKey===t}function Dr(e,t=!1,n=1){let r=ur(n),i=or+Math.sqrt(br(e))*(r-or);return t?Math.max(dr(n),i):i}function Or(e,t){switch(e){case`eligible`:return t.eligible;case`hidden`:return t.hidden;case`resource`:return t.resource;case`redirect`:return t.redirect;case`failed`:return t.failed;case`unchecked`:return t.unchecked}}function kr(e){return .35+Math.min(1.65,Math.log2(Math.max(1,e)+1)*.28)}function Ar(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function jr(e,t,n,r=null){let i=new tr({allowSelfLoops:!0}),a=new Map;for(let t of e)a.has(t.nodeKey)||a.set(t.nodeKey,t);for(let e of[...a.values()].sort((e,t)=>_e(e.nodeKey,t.nodeKey))){if(!Ar(e))continue;let t=xr(e),o=Or(t,n),s=Tr(t),c=Er(e,r);i.addNode(e.nodeKey,{x:e.x,y:e.y,size:Dr(e,c,a.size),color:o,baseColor:o,label:`${s} ${e.path||`/`}`,nodeKey:e.nodeKey,url:e.url,path:e.path,depth:e.depth,status:t,glyph:s,labelVisibility:c||e.depth===0||e.path.trim()===`/`?`visible`:`auto`,zIndex:c?2:+(e.depth===0),isRoot:c})}let o=new Set;for(let e of[...t].sort((e,t)=>_e(e.edgeKey,t.edgeKey)))!o.has(e.edgeKey)&&e.targetNodeKey&&i.hasNode(e.sourceNodeKey)&&i.hasNode(e.targetNodeKey)&&(o.add(e.edgeKey),i.addDirectedEdgeWithKey(e.edgeKey,e.sourceNodeKey,e.targetNodeKey,{size:kr(e.occurrences),color:n.edge,baseColor:n.edge,followable:e.followable,occurrences:e.occurrences,isTemplate:e.isTemplate===!0,type:`line`,zIndex:0}));return{graph:i,layoutAvailable:e.length===0||i.order>0,omittedNodes:Math.max(0,e.length-i.order),omittedEdges:Math.max(0,t.length-i.size)}}function Mr(e,t,n=gr){let r=t.trim().toLocaleLowerCase(),i=Math.max(0,Math.min(gr,Math.floor(n)));return[...e].sort((e,t)=>_e(e.path||e.url,t.path||t.url)||_e(e.nodeKey,t.nodeKey)).filter(e=>Ar(e)?!r||`${e.path}\n${e.url}\n${e.nodeKey}`.toLocaleLowerCase().includes(r):!1).slice(0,i)}function Nr(e,t,n,r,i=!0){let a=t&&e.hasNode(t)?t:null,o=typeof n==`function`?n:()=>n,s=e.nodes().sort((t,n)=>{let r=e.getNodeAttributes(t),i=e.getNodeAttributes(n);return Number(i.isRoot)-Number(r.isRoot)||i.size-r.size||(r.depth??2**53-1)-(i.depth??2**53-1)||_e(r.path,i.path)||_e(t,n)}),c=new Map(s.map((e,t)=>[e,t])),l=new Set(a?e.neighbors(a).filter(e=>e!==a).sort((e,t)=>(c.get(e)??0)-(c.get(t)??0)).slice(0,8):[]);return{nodeReducer:(t,n)=>{let i={x:n.x,y:n.y,size:n.size,color:n.color,label:n.label,labelVisibility:n.labelVisibility,zIndex:n.zIndex},s=o(),u=s>_r;if(n.isRoot)return t===a?{...i,size:n.size*1.35,labelVisibility:`visible`,zIndex:3}:{...i,labelVisibility:`visible`};if(a)return t===a?{...i,size:n.size*1.35,labelVisibility:`visible`,zIndex:3}:e.areNeighbors(t,a)?u?l.has(t)?{...i,labelVisibility:`auto`}:{...i,labelVisibility:`auto`,label:``}:i:{...i,color:r.dimmedNode,labelVisibility:`auto`,label:``,zIndex:0};let d=yr(s);return d===1/0?i:(c.get(t)??2**53-1)<d?{...i,labelVisibility:`visible`}:{...i,labelVisibility:`auto`,label:``}},edgeReducer:(t,n)=>{let s={size:n.size,color:n.color,zIndex:n.zIndex};if(n.isTemplate&&!i)return{...s,visibility:`hidden`};let c=o()>_r,[l,u]=e.extremities(t);return a&&(l===a||u===a)?{...s,color:r.edgeActive,size:Math.max(1.4,n.size),zIndex:2}:c?{...s,visibility:`hidden`}:a?{...s,color:r.edgeDimmed,size:Math.min(.45,n.size),zIndex:0}:s}}}var Q=S(),Pr={"layout-failed":{heading:`Map could not be built`,detail:`The map could not be created for this scan. Run a new scan to try again.`},"no-crawl":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"legacy-snapshot":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"details-unavailable":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"empty-crawl":{heading:`No pages to map`,detail:`This scan found no pages to put on a map. Run a new scan to try again.`}};function Fr(e){return(e&&Pr[e])??Pr[`no-crawl`]}var Ir=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[SiteGraphSigma] the map failed to render`,e,t.componentStack),M({kind:`render`,error:e,component:`site-graph`})}componentDidUpdate(e){this.state.failed&&e.resetToken!==this.props.resetToken&&this.setState({failed:!1})}render(){return this.state.failed?this.props.fallback:this.props.children}},Lr=220;function Rr(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:Lr}function zr(e,t,n=`${t}s`){return`${e.toLocaleString()} ${e===1?t:n}`}function Br(e,t,n){let r=window.getComputedStyle(e).getPropertyValue(t).trim();if(r&&!r.includes(`var(`)&&hr(r))return r;let i=document.createElement(`span`);i.style.position=`absolute`,i.style.visibility=`hidden`,i.style.color=`var(${t})`,e.appendChild(i);let a=window.getComputedStyle(i).color.trim();return i.remove(),a&&!a.includes(`var(`)&&hr(a)?a:n}function Vr(e){let t=t=>{let n=fr[t];return Br(e,n.property,n.fallback)};return{eligible:t(`eligible`),hidden:t(`hidden`),resource:t(`resource`),redirect:t(`redirect`),failed:t(`failed`),unchecked:t(`unchecked`),dimmedNode:t(`dimmedNode`),edge:t(`edge`),edgeDimmed:t(`edgeDimmed`),edgeActive:t(`edgeActive`),label:t(`label`),background:t(`background`)}}function Hr(){if(typeof document>`u`)return!1;try{return!!document.createElement(`canvas`).getContext(`webgl2`)}catch{return!1}}function Ur({onOpenInventory:e}){return(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`Interactive map unavailable`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`This browser could not start WebGL. The page inventory remains available for the complete crawl.`}),e&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:e,children:`Open page inventory`})]})})}function Wr({onRetry:e}){return(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,role:`alert`,children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`The map could not be drawn`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Something went wrong while drawing this map. The page inventory below is unaffected.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:e,children:`Try again`})]})})}function Gr({setReducers:e,reactSigma:t,graph:n,theme:r,selectedNodeKey:i,showTemplateLinks:a,onSelectNodeKey:o,onHoverNode:s,onCameraReady:c}){let{useSigma:l,useRegisterEvents:u,useCamera:d}=t,f=l(),p=u(),{zoomIn:m,zoomOut:h,reset:g,gotoNode:_}=d(),[v,y]=(0,H.useState)(null),b=v??i,x=(0,H.useRef)(null),S=(0,H.useRef)({overview:!0,budget:NaN});return(0,H.useEffect)(()=>()=>{x.current!==null&&cancelAnimationFrame(x.current)},[]),(0,H.useEffect)(()=>{let e=Rr();return c({zoomIn:()=>m({duration:e}),zoomOut:()=>h({duration:e}),reset:()=>g({duration:e}),gotoNode:t=>_(t,{duration:e})}),()=>c(null)},[_,c,g,m,h]),(0,H.useEffect)(()=>{p({enterNode:({node:e,event:t})=>{y(e),s({nodeKey:e,left:Number.isFinite(t.x)?t.x+14:20,top:Number.isFinite(t.y)?t.y+14:20})},leaveNode:()=>{y(null),s(null)},clickNode:({node:e})=>o(e),clickStage:()=>s(null),updated:()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=f.getCamera().getState().ratio>_r,t=yr(f.getCamera().getState().ratio);(e!==S.current.overview||t!==S.current.budget)&&(S.current={overview:e,budget:t},f.refresh())}))}})},[s,o,p,f]),(0,H.useEffect)(()=>{if(f.getGraph()!==n)return;e(Nr(n,b,()=>f.getCamera().getState().ratio,r,a));let t=f.getCamera().getState().ratio;S.current={overview:t>_r,budget:yr(t)},f.refresh()},[b,n,a,f,r,e]),null}function Kr({nodes:e,edges:t,layoutState:n=`ready`,layoutUnavailableReason:a,rootNodeKey:o=null,showTemplateLinks:c=!0,selectedNodeKey:l,onSelectNode:u,onOpenInventory:d,ariaLabel:f,className:p}){let m=(0,H.useRef)(null),g=(0,H.useRef)(null),_=(0,H.useRef)(null),v=(0,H.useId)(),y=(0,H.useId)(),b=(0,H.useId)(),[x,S]=(0,H.useState)(null),[C,ee]=(0,H.useState)(null),[te,ne]=(0,H.useState)(`checking`),[re,ie]=(0,H.useState)(!1),[ae,oe]=(0,H.useState)(null),[se,ce]=(0,H.useState)(null),[le,w]=(0,H.useState)(``),[T,ue]=(0,H.useState)(!1),[E,fe]=(0,H.useState)(0),[pe,me]=(0,H.useState)(``),[he,ge]=(0,H.useState)(0),O=(0,H.useRef)(null),_e=(0,H.useDeferredValue)(le),A=l===void 0?ae:l,j=(0,H.useMemo)(()=>new Map(e.map(e=>[e.nodeKey,e])),[e]),ve=(0,H.useMemo)(()=>ft(o?j.get(o)?.url:null),[j,o]),M=(0,H.useCallback)(e=>ht(e,ve),[ve]),ye=A?j.get(A)??null:null,N=se?j.get(se.nodeKey)??null:null,P=(0,H.useMemo)(()=>Mr(e,_e),[_e,e]),be=e.some(e=>Number.isFinite(e.x)&&Number.isFinite(e.y)),xe=(0,H.useMemo)(()=>x?jr(e,t,x,o):null,[t,e,o,x]),Se=(0,H.useMemo)(()=>{if(!x||!xe)return null;let e=Nr(xe.graph,null,1,x,!1);return{options:{nodeReducer:(t,n,r)=>e.nodeReducer(t,r),edgeReducer:(t,n,r)=>e.edgeReducer(t,r),settings:{allowInvalidContainer:!0,enableCameraPanning:!0,enableCameraZooming:!0,enableCameraRotation:!1,enableEdgeEvents:!1,hideEdgesOnMove:!0,hideLabelsOnMove:!0,itemSizesReference:`screen`,labelDensity:.07,labelGridCellSize:140,labelRenderedSizeThreshold:8,maxCameraRatio:12,minCameraRatio:.04,minEdgeThickness:.35,renderEdgeLabels:!1,renderLabels:!0,stagePadding:42},styles:{nodes:{x:{attribute:`x`},y:{attribute:`y`},size:{attribute:`size`},label:{attribute:`label`},depth:{whenState:`isHovered`,then:`topNodes`,else:`nodes`},visibility:`visible`,backdropVisibility:{whenState:`isHovered`,then:`visible`,else:`hidden`},color:{attribute:`color`,defaultValue:x.unchecked},labelColor:x.label,labelFont:`600 Geist Variable, Geist, sans-serif`,labelSize:13,labelPosition:`right`,backdropColor:x.background,backdropBorderColor:x.edgeActive,backdropBorderWidth:1.5,backdropPadding:3,backdropCornerRadius:5,backdropLabelPadding:8},edges:{size:{attribute:`size`},depth:`edges`,visibility:`visible`,color:{attribute:`color`,defaultValue:x.edge},path:`straight`}}},setReducers:t=>{e=t}}},[xe,x]);(0,H.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>S(Vr(e));if(t(),typeof MutationObserver>`u`)return;let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-theme`,`style`]}),()=>n.disconnect()},[]),(0,H.useEffect)(()=>{e.length===0||n===`unavailable`||!be?ne(`checking`):ne(Hr()?`ready`:`unavailable`)},[be,n,e.length]),(0,H.useEffect)(()=>{if(te!==`ready`){ee(null);return}let e=!0;return ct(()=>import(`./react-sigma_core.esm.min-OHqBWE8n.js`).then(t=>{e&&ee(t)}),__vite__mapDeps([0,1,2]),import.meta.url).catch(()=>{e&&ne(`unavailable`)}),()=>{e=!1}},[te]),(0,H.useEffect)(()=>{fe(0)},[_e]);let Ce=(0,H.useCallback)(e=>{_.current=e,ie(!!e)},[]),we=(0,H.useCallback)(e=>{ce(e)},[]),Te=(0,H.useCallback)((e,t)=>{let n=j.get(e);n&&(l===void 0&&oe(e),u?.(n),t&&_.current?.gotoNode(e),me(`Focused ${M(n)}`))},[j,u,M,l]),Ee=(0,H.useCallback)(e=>{Te(e,!1)},[Te]);(0,H.useEffect)(()=>{!re||!l||!j.has(l)?l||(O.current=null):O.current!==l&&(_.current?.gotoNode(l),O.current=l)},[re,j,l]);let De=e=>{Te(e.nodeKey,!0),w(M(e)),ue(!1)},Oe=()=>{window.setTimeout(()=>{document.activeElement!==g.current&&ue(!1)},0)},F=`Interactive site map showing ${zr(e.length,`page`)} and ${zr(t.length,`internal link`)}`,ke=e=>`${y}-${e.replaceAll(/[^\w-]/g,`-`)}`,I=Fr(a);if(n===`unavailable`)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:I.heading}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:I.detail}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});if(e.length===0)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No page graph is available for this scan.`}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});if(!be)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:I.heading}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:I.detail}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});let Ae=P.at(E),je=(0,Q.jsx)(Wr,{onRetry:()=>ge(e=>e+1)}),Me=C?.SigmaContainer;return(0,Q.jsxs)(`section`,{ref:m,role:`group`,"aria-label":f??F,"aria-describedby":b,className:D(`flex h-[clamp(460px,62vh,680px)] min-h-[460px] flex-col overflow-hidden material-base`,p),children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-subtle bg-bg-elevated/70 px-3 py-2`,children:[(0,Q.jsx)(`label`,{htmlFor:v,className:`sr-only`,children:`Focus a page in the site map`}),(0,Q.jsxs)(`div`,{className:`relative min-w-56 max-w-lg flex-1`,children:[(0,Q.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`input`,{id:v,ref:g,role:`combobox`,type:`search`,autoComplete:`off`,"aria-label":`Focus a page in the site map`,"aria-autocomplete":`list`,"aria-controls":y,"aria-expanded":T,"aria-activedescendant":T&&Ae?ke(Ae.nodeKey):void 0,value:le,placeholder:ye?`Focused: ${M(ye)}`:`Find a page`,className:`h-10 w-full rounded-md border border-base bg-bg py-2 pl-9 pr-3 text-label-14 text-primary placeholder-mono-400 outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onFocus:()=>ue(!0),onBlur:Oe,onChange:e=>{w(e.target.value),ue(!0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),ue(!0),fe(e=>Math.max(0,Math.min(P.length-1,e+1)))):e.key===`ArrowUp`?(e.preventDefault(),fe(e=>Math.max(0,e-1))):e.key===`Enter`&&T&&Ae?(e.preventDefault(),De(Ae)):e.key===`Escape`&&ue(!1)}}),T&&(0,Q.jsxs)(`div`,{className:`absolute left-0 right-0 top-[calc(100%+0.25rem)] z-30 overflow-hidden material-menu`,children:[(0,Q.jsx)(`div`,{id:y,role:`listbox`,"aria-label":`Matching pages`,className:`max-h-72 overflow-auto py-1`,children:P.length>0?P.map((e,t)=>{let n=xr(e);return(0,Q.jsxs)(`button`,{id:ke(e.nodeKey),type:`button`,role:`option`,"aria-selected":t===E,tabIndex:-1,className:D(`flex min-h-11 w-full items-center justify-between gap-3 px-3 py-2 text-left text-button-14 outline-none`,t===E?`bg-surface-active text-primary`:`text-secondary hover:bg-surface-hover hover:text-primary`),onPointerDown:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>fe(t),onClick:()=>De(e),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:M(e)}),(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-label-13 text-muted`,children:[(0,Q.jsx)(`span`,{className:`text-label-13-mono-strong`,style:{color:`var(${ir[n].property})`},"aria-hidden":`true`,children:Tr(n)}),(0,Q.jsx)(`span`,{title:wr(n),children:Sr(n)})]})]},e.nodeKey)}):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-secondary`,children:`No rendered pages match.`})}),P.length===50&&(0,Q.jsx)(`p`,{className:`border-t border-subtle px-3 py-2 text-copy-13 text-muted`,children:`First 50 matches. Refine the search or use the full page inventory.`})]})]}),(0,Q.jsxs)(`span`,{className:`text-label-13 tabular-nums text-muted`,children:[zr(e.length,`page`),` · `,zr(t.length,`link`)]})]}),(0,Q.jsx)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:te===`unavailable`?(0,Q.jsx)(Ur,{onOpenInventory:d}):te===`checking`||!x||!xe||!Se||!C||!Me?(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,role:`status`,children:(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Preparing the interactive site map...`})}):(0,Q.jsxs)(Ir,{fallback:je,resetToken:he,children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-0`,children:(0,Q.jsx)(Me,{graph:xe.graph,className:`relative size-full bg-bg [&_.sigma-container]:size-full`,style:{width:`100%`,height:`100%`,background:x.background},options:Se.options,children:(0,Q.jsx)(Gr,{setReducers:Se.setReducers,reactSigma:C,graph:xe.graph,theme:x,selectedNodeKey:A,showTemplateLinks:c,onSelectNodeKey:Ee,onHoverNode:we,onCameraReady:Ce})})}),(0,Q.jsxs)(`div`,{className:`absolute right-3 top-3 z-20 flex flex-col overflow-hidden material-menu`,children:[(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none border-b border-subtle`,"aria-label":`Zoom in`,disabled:!re,onClick:()=>_.current?.zoomIn(),children:(0,Q.jsx)(i,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none border-b border-subtle`,"aria-label":`Zoom out`,disabled:!re,onClick:()=>_.current?.zoomOut(),children:(0,Q.jsx)(r,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none`,"aria-label":`Fit site map`,disabled:!re,onClick:()=>_.current?.reset(),children:(0,Q.jsx)(s,{className:`size-4`,"aria-hidden":`true`})})]}),N&&se&&(0,Q.jsxs)(`div`,{role:`tooltip`,className:`pointer-events-none absolute z-20 max-w-64 material-tooltip px-3 py-2`,style:{left:se.left,top:se.top},children:[(0,Q.jsx)(`p`,{className:`truncate text-copy-13-mono-strong text-heading`,children:M(N)}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13-strong text-heading`,children:Sr(xr(N))}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-copy-13 text-secondary`,children:wr(xr(N))}),N.depth!=null&&(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-13 text-secondary`,children:[zr(N.depth,`click`),` from home`]}),N.auditScore!=null&&(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-13 tabular-nums text-heading`,children:[`Score `,Math.round(N.auditScore),`/100`]})]})]})}),(0,Q.jsxs)(`div`,{"aria-label":`Site map legend`,className:`flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-subtle bg-bg-elevated/50 px-3 py-2 text-label-13 text-secondary`,children:[de.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:wr(e),children:[(0,Q.jsx)(`span`,{className:`w-3 text-center font-mono text-label-16-strong`,style:{color:`var(${ir[e].property})`},"aria-hidden":`true`,children:Tr(e)}),Cr(e)]},e)),(0,Q.jsx)(`span`,{className:`ml-auto`,children:`Bigger = more linked`}),xe&&(xe.omittedNodes>0||xe.omittedEdges>0)&&(0,Q.jsx)(`span`,{className:`text-caution`,children:`Some records lacked valid layout data.`})]}),(0,Q.jsx)(`p`,{id:b,className:`sr-only`,children:`The WebGL map supports pointer, wheel, and touch navigation. Use the page search to focus a rendered page. Use the full page inventory for an accessible list of every crawled page and its links.`}),(0,Q.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:pe})]})}var qr={"geographic-signals":`Checks whether pages say where your business operates: your address, service areas, map coordinates, and location details that search engines can read. Useful for businesses serving specific places. Off by default; enabling it adds this check to the health score.`,"agent-skill-exposure":`Checks whether AI agents can understand your forms, discover actions such as site search, and find links to tools or APIs. Reads page information only; it does not submit forms or run actions. Included in the health score by default.`};function Jr(e,t){return`Worth ${fe(e,w.percent)} of the ${t} score`}function Yr(e){return e>=70?`positive`:e>=40?`caution`:`negative`}function Xr(e){return e>=70?`pass`:e>=40?`partial`:`fail`}function Zr(e){return e===`pass`?`positive`:e===`partial`?`caution`:`negative`}function Qr(e){return e===`pass`?`Pass`:e===`partial`?`Partial`:`Fail`}function $r({audit:e,isLoading:t,error:n,onRetry:r}){return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`site-health-page-audit-heading`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`h3`,{id:`site-health-page-audit-heading`,className:`text-heading-16 text-heading`,children:`Findings and fixes for this page`})}),t?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,role:`status`,children:`Loading findings...`}):n?(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-y border-negative bg-negative-soft px-4 py-3`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-negative`,children:`Findings could not be loaded.`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:r,children:`Try again`})]}):e?e.state===`no-crawl`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`No Site Health scan is available.`}):e.state===`details-unavailable`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`This scan saved its summary, but not the findings for each page.`}):e.state===`not-found`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`This page is not present in the selected scan.`}):e.state===`not-audited`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:e.auditState===`url-version`?`This address is a URL version of another page, so it was not scored.`:`This page was found, but it was not scored.`}):(0,Q.jsx)(ei,{audit:e}):(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`No findings are available for this page.`})]})}function ei({audit:e}){let t=e.factors.filter(e=>e.applicable!==!1&&(e.status!==`pass`||e.findings.some(e=>e.type===`missing`||e.type===`timeout`||e.type===`unreachable`)));return(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsxs)(`span`,{"aria-label":`Score ${Math.round(e.auditScore)} out of 100`,className:`text-heading-24 tabular-nums text-heading`,children:[Math.round(e.auditScore),(0,Q.jsx)(`span`,{className:`text-label-14 text-muted`,children:`/100`})]}),(0,Q.jsx)(A,{tone:Yr(e.auditScore),children:Qr(Xr(e.auditScore))})]}),e.evidenceState===`scores-only`&&(0,Q.jsx)(`p`,{className:`mt-3 border border-caution bg-caution-soft px-3 py-2 text-copy-14 text-caution`,children:`This older scan saved only the scores, not the findings or fixes.`}),e.criticalDefects.length>0&&(0,Q.jsxs)(`section`,{className:`mt-5`,"aria-labelledby":`site-health-critical-defects-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`h4`,{id:`site-health-critical-defects-heading`,className:`text-heading-14 text-heading`,children:`Problems outside the score`}),(0,Q.jsx)(A,{tone:e.criticalDefects.some(e=>e.severity===`critical`)?`negative`:`caution`,children:e.criticalDefects.length}),(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Not counted in the score`})]}),(0,Q.jsx)(`ul`,{className:`mt-2 divide-y divide-default border-y border-default`,children:e.criticalDefects.map(e=>(0,Q.jsxs)(`li`,{className:`py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:e.detail}),(0,Q.jsx)(A,{tone:e.severity===`critical`?`negative`:`caution`,children:e.severity===`critical`?`Critical`:`Warning`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:[(0,Q.jsx)(`span`,{className:`text-copy-14-strong text-heading`,children:`Fix:`}),` `,e.recommendation]})]},e.id))})]}),t.length>0?(0,Q.jsx)(`div`,{className:`mt-5 divide-y divide-default border-y border-default`,children:t.map(t=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsxs)(`details`,{className:`group min-w-0 flex-1 py-1`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-12 cursor-pointer list-none items-center justify-between gap-3 rounded-sm px-1 py-2 outline-none marker:hidden focus-visible:ring-2 focus-visible:ring-mono-400 [&::-webkit-details-marker]:hidden`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-14-strong text-heading`,children:[(0,Q.jsx)(o,{className:`size-4 shrink-0 text-muted transition-transform group-open:rotate-90`,"aria-hidden":`true`}),t.name]}),(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-label-14 tabular-nums text-heading`,children:[Math.round(t.score),`/100`]}),(0,Q.jsx)(A,{tone:Zr(t.status),children:Qr(t.status)})]})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 px-1 pb-4 pt-1 md:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h5`,{className:`text-heading-14 normal-case text-muted`,children:`Evidence`}),t.findings.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-label-14 text-secondary`,children:t.findings.map((e,t)=>(0,Q.jsx)(`li`,{children:e.message},`${e.code}:${t}`))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:e.evidenceState===`scores-only`?`This scan did not save the findings here.`:`Nothing to report here.`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h5`,{className:`text-heading-14 normal-case text-muted`,children:`Recommended fix`}),t.recommendations.length>0?(0,Q.jsx)(`ol`,{className:`mt-2 list-decimal space-y-1.5 pl-5 text-label-14 text-secondary marker:text-muted`,children:t.recommendations.map(e=>(0,Q.jsx)(`li`,{children:e},e))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:e.evidenceState===`scores-only`?`This scan did not save a fix here.`:`No fix suggested here.`}),typeof t.sharePct==`number`?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:Jr(t.sharePct,`page`)}):null]})]})]}),qr[t.id]&&(0,Q.jsx)(`div`,{className:`flex min-h-14 items-center`,children:(0,Q.jsx)(B,{text:qr[t.id],placement:`bottom`})})]},t.id))}):e.criticalDefects.length===0&&e.evidenceState===`complete`?(0,Q.jsx)(`p`,{className:`mt-4 border-y border-positive bg-positive-soft px-4 py-3 text-copy-14 text-positive`,children:`Nothing needs attention on this page.`}):e.criticalDefects.length===0?(0,Q.jsx)(`p`,{className:`mt-4 border-y border-default px-4 py-3 text-copy-14 text-secondary`,children:`This scan saved only the score. Run a new scan to see findings.`}):null]})}function ti(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function ni(e){let t=e;try{t=decodeURIComponent(e.replace(/\+/g,` `))}catch{}let n=``,r=e.indexOf(`?`);return r>=0&&new URLSearchParams(e.slice(r+1)).forEach((e,t)=>{n+=` ${t} ${e}`}),`${e} ${t}${n}`}function ri(e,t=36,n=18){let r=[...e];return r.length<=t+n+1?e:`${r.slice(0,t).join(``)}…${r.slice(-n).join(``)}`}function ii({value:e,headLength:t,tailLength:n,className:r,title:i}){let a=ri(e,t,n);return(0,Q.jsx)(`span`,{className:r,title:i??e,children:a===e?e:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:e}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:a})]})})}function ai({rows:e,getSearchText:t,pageSize:n=25}){let[r,i]=(0,H.useState)(``),[a,o]=(0,H.useState)(1),s=(0,H.useMemo)(()=>ti(r),[r]),c=(0,H.useMemo)(()=>s.length===0||!t?e:e.filter(e=>{let n=t(e).toLocaleLowerCase();return s.every(e=>n.includes(e))}),[t,e,s]),l=Math.max(1,Math.ceil(c.length/n)),u=Math.min(Math.max(1,a),l),d=(u-1)*n,f=(0,H.useMemo)(()=>c.slice(d,d+n),[c,n,d]);return{query:r,setQuery:(0,H.useCallback)(e=>{i(e),o(1)},[]),page:u,setPage:(0,H.useCallback)(e=>{o(Math.max(1,e))},[]),rows:f,filteredRows:c,totalRows:c.length,totalPages:l,pageSize:n,rangeStart:c.length===0?0:d+1,rangeEnd:d+f.length,hasQuery:r.trim().length>0}}function oi({value:e,onChange:t,label:n,placeholder:r=`Filter rows`,className:i}){return(0,Q.jsxs)(`div`,{className:`relative ${i??``}`,children:[(0,Q.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted`}),(0,Q.jsx)(`input`,{type:`search`,value:e,onChange:e=>{ce(e.target.value),t(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&ce(e.currentTarget.value,!0)},"aria-label":n,placeholder:r,autoComplete:`off`,spellCheck:!1,className:`h-9 w-full rounded-md border border-default bg-surface/50 pl-9 pr-9 text-label-14 text-strong placeholder:text-muted outline-none transition focus:border-mono-500 focus:ring-1 focus:ring-mono-500 [&::-webkit-search-cancel-button]:appearance-none`}),e.trim().length>0?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":`Clear ${n.toLocaleLowerCase()}`,className:`absolute right-2 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded text-muted transition-colors hover:bg-surface-hover hover:text-strong focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-mono-500`,children:(0,Q.jsx)(g,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function si({page:e,pageSize:t=25,visibleRows:n,totalRows:r,hasNextPage:i,onPageChange:a,itemLabel:s=`rows`,className:c,disabled:l=!1}){if(n===0)return null;let d=(e-1)*t+1,f=d+n-1,p=r===void 0?void 0:Math.max(1,Math.ceil(r/t)),m=i??(p!==void 0&&e<p),h=e>1||m;return(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 text-label-12 text-secondary ${c??``}`,children:[(0,Q.jsxs)(`p`,{className:`tabular-nums`,children:[d.toLocaleString(`en-US`),` to `,f.toLocaleString(`en-US`),r===void 0?`${m?`+`:``} ${s}`:` of ${r.toLocaleString(`en-US`)} ${s}`]}),h?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(e-1),disabled:l||e<=1,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[(0,Q.jsx)(u,{"aria-hidden":`true`,className:`size-3.5`}),`Previous`]}),(0,Q.jsx)(`span`,{className:`tabular-nums`,children:p===void 0?`Page ${e}`:`Page ${e} of ${p}`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(e+1),disabled:l||!m,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[`Next`,(0,Q.jsx)(o,{"aria-hidden":`true`,className:`size-3.5`})]})]}):null]})}var ci=[``,`sm:grid-cols-1`,`sm:grid-cols-2`,`sm:grid-cols-3`],li=[``,`lg:grid-cols-1`,`lg:grid-cols-2`,`lg:grid-cols-3`,`lg:grid-cols-4`,`lg:grid-cols-5`,`lg:grid-cols-6`],ui=14,di=Re[1],fi={current:`current`,previous:`previous`},pi=e=>e.series?.filter(e=>e.current!==null).length??0,mi=e=>e.interactive??pi(e)>=2,hi=e=>e!=null;function gi(e){return e.charAt(0).toLowerCase()+e.slice(1)}function _i(e){if(!e)return``;if(e.kind===`note`)return gi(e.text);if(e.direction===`flat`)return`no change ${e.basis}`;let t=e.tone===`better`?`, an improvement`:e.tone===`worse`?`, a decline`:``;return`${e.direction} ${e.amount} ${e.basis}${t}`}function vi({date:e,observedAt:t}){return t?Ge(R(t)):Ye(e)}function yi({date:e,observedAt:t}){return t?Be(R(t)):Number(e.slice(0,4))}function bi(e){return e.label??vi(e)}function xi(e,t){if(!e)return;let n=`since ${bi(e.basis)}`;if(e.difference===0)return{kind:`delta`,amount:t===`fraction`?`0 pts`:`0`,direction:`flat`,tone:`neutral`,basis:n};let r=Math.abs(e.difference);return{kind:`delta`,amount:t===`fraction`?`${me(r).magnitude} pts`:r.toLocaleString(),direction:e.difference>0?`up`:`down`,tone:e.tone,basis:n}}function Si(e){let t=new Set(e.map(e=>e.change?bi(e.change.basis):null)),[n]=[...t];return t.size===1&&n?`since ${n}`:void 0}function Ci(e){return e.series.map(e=>({date:e.observedAt??e.date,current:e.value,...e.label?{label:e.label}:{}}))}function wi(e,t){if(e.label&&t.label)return e.label===t.label?e.label:`${e.label} to ${t.label}`;let n=(e,t)=>t?`${vi(e)}, ${yi(e)}`:vi(e);return`${n(e,yi(e)!==yi(t))} to ${n(t,!0)}`}function Ti({change:e,hideBasis:t}){if(!e)return null;if(e.kind===`note`)return(0,Q.jsx)(`span`,{className:`block min-h-5 text-label-13 text-secondary`,children:e.text});if(e.direction===`flat`)return(0,Q.jsxs)(`span`,{className:`block min-h-5 text-label-13 text-secondary`,children:[`No change`,t?``:` ${e.basis}`]});let n=e.direction===`up`?v:b,r=e.tone===`better`?`text-positive`:e.tone===`worse`?`text-negative`:`text-secondary`;return(0,Q.jsxs)(`span`,{className:`flex min-h-5 flex-wrap items-center gap-x-1 text-label-13 tabular-nums`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-label-13-strong ${r}`,children:[(0,Q.jsx)(n,{"aria-hidden":`true`,className:`size-3.5`,strokeWidth:2.5}),e.amount]}),!t&&(0,Q.jsx)(`span`,{className:`text-secondary`,children:e.basis})]})}function Ei({figure:e,active:t}){return e.stateValue?(0,Q.jsx)(`span`,{className:`flex min-h-10 items-center text-label-14 text-secondary`,children:e.value}):(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-heading-32 tabular-nums transition-colors duration-150 ${t?`text-primary`:`text-strong`}`,title:e.exactValue,children:e.value}),e.detail&&(0,Q.jsx)(`span`,{className:`text-label-13 text-secondary`,children:e.detail})]})}function Di(e,t){return e.formatExact?.(t)??e.formatValue?.(t)??t.toLocaleString()}function Oi({active:e,payload:t,figure:n,previousLabel:r,rowLabel:i}){let a=t?.[0]?.payload;if(!e||!a)return null;let o=e=>hi(e)?Di(n,e):`—`;return(0,Q.jsxs)(`div`,{className:`material-tooltip min-w-48 px-3 py-2 text-label-13`,children:[(0,Q.jsx)(`p`,{className:`mb-1 text-copy-13-strong text-heading`,children:n.label}),(0,Q.jsxs)(`p`,{className:`flex items-center justify-between gap-6`,children:[(0,Q.jsx)(`span`,{className:`text-secondary`,children:i(a)}),(0,Q.jsx)(`span`,{className:`tabular-nums text-primary`,children:a.current===null?`Not recorded`:o(a.current)})]}),r&&a.previous!==void 0&&(0,Q.jsxs)(`p`,{className:`flex items-center justify-between gap-6`,children:[(0,Q.jsx)(`span`,{className:`text-secondary`,children:a.previousDate?He(a.previousDate):r}),(0,Q.jsx)(`span`,{className:`tabular-nums text-secondary`,children:o(a.previous)})]})]})}function ki({name:e,groups:t,mode:n=`single`,selected:r,onSelect:i,span:a,cadence:o=`day`,instants:s=!1,currentLabel:c,previous:u,chart:d,legendExtra:f,controls:p,notice:m,emptyChartMessage:h,refreshing:g=!1,chartHeight:_=240,frame:v=`card`}){let y=(0,H.useId)().replace(/:/g,``),b=e=>s?L(R(e)):He(e),x=e=>e.label??b(e.date),S=e=>Ue(R(new Date(e).toISOString())),[C,ee]=(0,H.useState)(new Set),ce=!Ze(),le=t.flatMap(e=>e.figures),w=n===`single`?le.find(e=>e.key===r[0]&&mi(e)):void 0,T=w?.series??[],ue=s?T.map(e=>({...e,at:Date.parse(e.date)})):T,de=new Map(T.flatMap(e=>e.label?[[e.date,e.label]]:[])),E=!!u?.available&&T.some(e=>hi(e.previous)),fe=T.some(e=>e.current!==null||E&&hi(e.previous)),pe=!E||!C.has(fi.current),D=E&&!C.has(fi.previous),me=pi(w??{key:``,label:``,value:``})<ui?`linear`:`monotone`,he=o===`day`?`per day`:o===`scan`?`per scan`:`per release`,ge=w?`${w.label} ${he}, ${c?gi(c):a??``}${E?` and the previous period`:``}`:``,O=le.filter(mi).map(e=>e.key),_e=O.includes(r[0]??``)?r[0]:O[0],k=e=>{i(e),document.getElementById(`${y}-tab-${e}`)?.focus()},A=(e,t)=>{let n=O.indexOf(t),r=O.length-1,i=e.key===`ArrowRight`?n===r?0:n+1:e.key===`ArrowLeft`?n<=0?r:n-1:e.key===`Home`?0:e.key===`End`?r:null;i!==null&&(e.preventDefault(),k(O[i]))},j=e=>ee(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),ve=(e,t,a)=>{let o=mi(e),s=o&&r.includes(e.key),c=!!t.basis,u=[`${e.label} ${e.spokenValue??e.value}${e.detail?` ${e.detail}`:``}`,_i(e.change)].filter(Boolean).join(`, `),d=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[n===`compare`&&o&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block size-2.5 shrink-0 rounded-full`,style:{backgroundColor:s?e.color:`transparent`,border:`1.5px solid ${e.color}`}}),e.picker?(0,Q.jsxs)(`span`,{className:`relative inline-flex max-w-full items-center`,children:[(0,Q.jsx)(`select`,{"aria-label":e.picker.ariaLabel,value:e.picker.value,onChange:t=>e.picker.onChange(t.target.value),className:`max-w-full cursor-pointer appearance-none truncate rounded-sm bg-transparent py-0.5 pr-5 text-label-14-strong [field-sizing:content] transition-colors duration-150 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 ${s?`text-link`:`text-secondary`}`,children:e.picker.options.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,Q.jsx)(l,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 size-3.5 ${s?`text-link`:`text-muted`}`})]}):(0,Q.jsx)(`span`,{className:`text-label-14-strong ${s?n===`single`?`text-link`:`text-heading`:`text-secondary`}`,children:e.label}),e.help&&(0,Q.jsx)(B,{text:e.help})]});return a?(0,Q.jsxs)(`div`,{className:`relative flex min-w-0 flex-col px-4 pb-4 pt-3 transition-colors duration-150 ${s?`bg-surface-active`:o?`hover:bg-surface-hover`:``}`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-0 h-[3px] transition-opacity duration-200 ${n===`single`?`bg-link`:``} ${s?`opacity-100`:`opacity-0`}`,style:n===`compare`?{backgroundColor:e.color}:void 0}),d,(0,Q.jsxs)(`button`,{type:`button`,id:`${y}-tab-${e.key}`,...n===`single`?{role:`tab`,"aria-selected":s,"aria-controls":`${y}-panel`,"aria-disabled":!o||void 0,tabIndex:o&&e.key===_e?0:-1,onKeyDown:t=>A(t,e.key)}:{"aria-pressed":s},"aria-label":u,disabled:n===`compare`&&(e.disabled||!o),onClick:o?()=>i(e.key):void 0,className:`mt-auto block w-full rounded-sm pt-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 ${o?``:`cursor-default`} ${e.disabled?`disabled:cursor-not-allowed disabled:opacity-50`:``}`,children:[(0,Q.jsx)(Ei,{figure:e,active:s}),(0,Q.jsx)(Ti,{change:e.change,hideBasis:c})]})]},e.slot??e.key):(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col px-4 pb-4 pt-3`,children:[(0,Q.jsx)(`dt`,{children:d}),(0,Q.jsxs)(`dd`,{className:`mt-auto pt-1`,children:[(0,Q.jsx)(Ei,{figure:e,active:!1}),(0,Q.jsx)(Ti,{change:e.change,hideBasis:c}),e.change&&(0,Q.jsx)(`span`,{className:`sr-only`,children:_i(e.change)})]})]},e.slot??e.key)};return(0,Q.jsxs)(`div`,{className:`${v===`card`?`overflow-hidden material-base`:`-mx-4`} transition-opacity duration-200 ${g?`opacity-60`:``}`,children:[(0,Q.jsx)(`div`,{className:`flex flex-col lg:flex-row`,children:t.map((t,r)=>{let i=t.figures.some(mi),a=`${y}-group-${t.key}`,o=`grid grid-cols-2 ${ci[Math.min(t.figures.length,3)]} ${li[Math.min(t.figures.length,6)]}`;return(0,Q.jsxs)(`div`,{role:t.label?`group`:void 0,"aria-labelledby":t.label?a:void 0,className:`min-w-0 lg:basis-0 ${r>0?`border-t border-default lg:border-l lg:border-t-0`:``}`,style:{flexGrow:t.figures.length},children:[(t.label||t.basis)&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 px-4 pt-3`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{id:a,className:`text-label-13 text-secondary`,children:t.label}),t.help&&(0,Q.jsx)(B,{text:t.help})]}),t.basis&&(0,Q.jsx)(`span`,{className:`text-label-13 text-secondary`,children:t.basis})]}),i?(0,Q.jsx)(`div`,{role:n===`single`?`tablist`:void 0,"aria-label":n===`single`?e:void 0,className:o,children:t.figures.map(e=>ve(e,t,!0))}):(0,Q.jsx)(`dl`,{className:o,children:t.figures.map(e=>ve(e,t,!1))})]},t.key)})}),(0,Q.jsxs)(`div`,{id:`${y}-panel`,...n===`single`&&w?{role:`tabpanel`,"aria-labelledby":`${y}-tab-${w.key}`}:{role:`region`,"aria-label":`${e} chart`},className:`border-t border-default px-4 pb-3 pt-4`,children:[m&&(0,Q.jsx)(`div`,{className:`mb-3 text-copy-14 text-secondary`,children:m}),n===`compare`?d:!w||!fe?(0,Q.jsx)(`p`,{className:`flex h-32 items-center justify-center px-6 text-center text-copy-14 text-secondary`,children:h}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{role:`img`,"aria-label":ge,style:{height:_},children:(0,Q.jsx)(ie,{width:`100%`,height:`100%`,children:(0,Q.jsxs)(se,{data:[...ue],margin:{top:8,right:0,bottom:0,left:4},children:[(0,Q.jsx)(te,{stroke:Ke,vertical:!1}),s?(0,Q.jsx)(re,{dataKey:`at`,type:`number`,scale:`time`,domain:[`dataMin`,`dataMax`],tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:S,minTickGap:32,padding:{left:12,right:12}}):(0,Q.jsx)(re,{dataKey:`date`,tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:e=>de.get(e)??ze(e),minTickGap:32,padding:de.size>0?{left:40,right:40}:{left:12,right:12}}),(0,Q.jsx)(ae,{orientation:`right`,tick:We,tickLine:!1,axisLine:!1,width:52,allowDecimals:w.allowDecimals??!1,tickFormatter:e=>w.formatValue?.(e)??e.toLocaleString()}),(0,Q.jsx)(ne,{cursor:{stroke:Ve.textFaint,strokeWidth:1},wrapperStyle:{outline:`none`},content:(0,Q.jsx)(Oi,{figure:w,previousLabel:E?u?.label:void 0,rowLabel:x})}),D&&(0,Q.jsx)(oe,{type:me,dataKey:fi.previous,stroke:di,strokeOpacity:.65,strokeWidth:1.5,strokeDasharray:`4 4`,dot:!1,activeDot:{r:3,strokeWidth:0,fill:di},connectNulls:!1,isAnimationActive:ce,animationDuration:320,animationEasing:`ease-out`}),pe&&(0,Q.jsx)(oe,{type:me,dataKey:fi.current,stroke:di,strokeWidth:2.25,dot:me===`linear`&&{r:3,strokeWidth:0,fill:di},activeDot:{r:5,strokeWidth:2,stroke:di,fill:`var(--color-bg)`},connectNulls:!1,isAnimationActive:ce,animationDuration:320,animationEasing:`ease-out`})]})})}),(0,Q.jsx)(`div`,{className:`sr-only`,children:(0,Q.jsxs)(`table`,{children:[(0,Q.jsx)(`caption`,{children:ge}),(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:T.some(e=>e.label)?`Release`:`Date`}),(0,Q.jsx)(`th`,{scope:`col`,children:w.label}),E&&(0,Q.jsx)(`th`,{scope:`col`,children:u.label})]})}),(0,Q.jsx)(`tbody`,{children:T.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`row`,children:x(e)}),(0,Q.jsx)(`td`,{children:e.current===null?`Not recorded`:Di(w,e.current)}),E&&(0,Q.jsx)(`td`,{children:hi(e.previous)?Di(w,e.previous):`No data`})]},e.date))})]})})]}),n===`single`&&w&&fe&&c||f||a||p?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-x-6 gap-y-1`,children:[(0,Q.jsxs)(`fieldset`,{className:`flex flex-wrap gap-x-5 text-label-13 text-secondary`,children:[(0,Q.jsx)(`legend`,{className:`sr-only`,children:w?`${w.label} series`:`${e} options`}),n===`single`&&w&&fe&&c&&u&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ai,{label:c,checked:pe,disabled:!E||pe&&!D,onChange:()=>j(fi.current),dash:void 0}),(0,Q.jsx)(Ai,{label:E?u.label:`${u.label}: no earlier data`,checked:D,disabled:!E||D&&!pe,onChange:()=>j(fi.previous),dash:`4 3`})]}),f]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[a&&(0,Q.jsx)(`p`,{className:`text-copy-13 text-secondary`,children:a}),p]})]}):null]})]})}function Ai({label:e,checked:t,disabled:n,onChange:r,dash:i}){return(0,Q.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2 pointer-coarse:min-h-11`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-mono-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,checked:t,disabled:n,onChange:r}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,width:`18`,height:`10`,viewBox:`0 0 18 10`,className:`shrink-0`,children:(0,Q.jsx)(`line`,{x1:`0`,y1:`5`,x2:`18`,y2:`5`,stroke:di,strokeWidth:i?1.5:2.5,strokeDasharray:i})}),e]})}var ji=`Not recorded by this scan`,Mi=100,Ni=12,Pi=[];function Fi(e){return ni(e.url)}function Ii(e){return e>=70?`positive`:e>=40?`caution`:`negative`}function Li(e){return e>=70?`text-positive-400`:e>=40?`text-caution-400`:`text-negative-400`}function Ri(e){return e===j.pass?`positive`:e===j.partial?`caution`:`negative`}var zi={[j.pass]:`Pass`,[j.partial]:`Partial`,[j.fail]:`Fail`},Bi=`Score is the average across audited pages. Status reflects the worst page: fail if any page scores below 40, partial if any page scores 40–69, otherwise pass. Share is how much of the site score the factor controls; the shares add up to 100%, and a dash means the scan did not record them.`;function Vi(e){return e>=70?`Pass`:e>=40?`Partial`:`Fail`}function Hi(e){return Ue(R(String(e)))}function Ui(e){return L(R(String(e)))}function Wi({projectName:e,projectId:t,runId:n,integrated:r=!1,compactCopy:i=!1,afterSummary:s,unavailableFooter:c}){let{isAdmin:u}=be(),d=T(le[`site-audit`])&&!u,[p,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(null),[v,b]=(0,H.useState)(null),S=n===void 0?v:n,[ee,ce]=(0,H.useState)(!1),ue=(0,H.useRef)(null),de=C(Ae({client:O,path:{name:e},...S?{query:{runId:S}}:{}})),E=C({...Fe({client:O,path:{name:e},query:{limit:30}}),enabled:!r}),pe=C({...Le({client:O,path:{name:e},query:{surface:`site-health`}}),enabled:r}),D=C(Oe({client:O,path:{name:e},query:{limit:Mi,sort:`score-asc`,...S?{runId:S}:{}}})),me=C({...we({client:O,path:{name:e},query:{kind:le[`site-audit`],limit:10}}),enabled:!r,refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.some(e=>e.status===`queued`||e.status===`running`)?3e3:1e4}),he=Qe(),ge=(0,H.useSyncExternalStore)(V,nt,nt),_e=Object.values(ge.runs).find(e=>e.kind===le[`site-audit`]&&e.projectId===t),j=me.data??[],ve=j.find(e=>e.status===`queued`||e.status===`running`),M=j.at(-1),N=he.isPending||!!_e||!!ve,P=he.isPending?`starting`:ve?.status??_e?.lastAnnouncedStatus,Se=(0,H.useCallback)(async()=>{r&&pe.refetch();let e=await Promise.all([de.refetch(),D.refetch(),...r?[]:[E.refetch()]]),t=e.find(e=>e.error);if(t?.error)throw t.error;return e[0]},[r,D.refetch,de.refetch,E.refetch,pe.refetch]);(0,H.useEffect)(()=>{r||S||!M||M.status!==`completed`&&M.status!==`partial`||de.data?.runId!==M.id&&ue.current!==M.id&&(ue.current=M.id,Se().catch(t=>{xe({title:`Technical AEO auto-refresh failed`,detail:t instanceof Error?t.message:`Could not load the completed audit.`,tone:`negative`,dedupeKey:`technical-aeo:auto-refresh:${e}`,dedupeMode:`replace`})}))},[S,r,M?.id,M?.status,e,Se,de.data?.runId]);let Ce=async()=>{ce(!0);try{let t=await Se();xe({title:`Technical AEO refreshed`,detail:N?`The audit is still running. This view will refresh again when it finishes.`:t.data?.hasData?`Latest score is ${t.data.aggregateScore}/100 from ${t.data.pagesAudited} audited page${t.data.pagesAudited===1?``:`s`}.`:`No audit data yet. Run an audit to crawl the sitemap.`,tone:t.data?.hasData?`positive`:`caution`,dedupeKey:`technical-aeo:refresh:${e}`,dedupeMode:`replace`})}catch(t){xe({title:`Technical AEO refresh failed`,detail:t instanceof Error?t.message:`Could not reload technical audit data.`,tone:`negative`,dedupeKey:`technical-aeo:refresh:${e}`,dedupeMode:`replace`})}finally{ce(!1)}},Ee=()=>{(!T(le[`site-audit`])||u)&&he.mutate({projectName:e,projectId:t})},De=P===`running`?`Audit running`:P===`queued`?`Audit queued`:`Starting audit`,F=de.data,ke=D.data?.pages??Pi,I=i?ke.find(e=>e.status===`success`&&e.overallScore<70)??ke.find(e=>e.status===`success`):void 0,je=!!(I&&I.overallScore<70),Me=C({...Te({client:O,path:{name:e},query:{...S?{runId:S}:{},url:I?.url??``}}),enabled:i&&!!I}),Ne=(F?.pagesErrored??0)>0,Pe=p&&Ne,Ie=ai({rows:(0,H.useMemo)(()=>Pe?ke.filter(e=>e.status===`error`):ke,[ke,Pe]),getSearchText:Fi}),Re=F?F.pagesAudited>ke.length:!1;if((0,H.useEffect)(()=>{h(!1),_(null)},[i,S,r]),de.isLoading)return(0,Q.jsxs)(`div`,{className:`flex min-h-40 items-center justify-center gap-2 text-label-14 text-secondary ${r?``:`mt-6`}`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page health...`]});if(de.error)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-md border border-negative bg-negative-soft px-5 py-5 sm:flex-row sm:items-center sm:justify-between ${r?``:`mt-6`}`,role:`alert`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,Q.jsx)(y,{className:`mt-0.5 size-4 shrink-0 text-negative`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[r?(0,Q.jsx)(`h3`,{className:`text-heading-14 text-negative`,children:`Page health could not load`}):(0,Q.jsx)(`h2`,{className:`text-heading-14 text-negative`,children:`Page health could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`The saved audit could not be read. Try loading it again.`})]})]}),(0,Q.jsxs)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`shrink-0`,onClick:()=>void Ce(),disabled:ee,children:[(0,Q.jsx)(f,{className:`size-4 ${ee?`motion-safe:animate-spin`:``}`,"aria-hidden":`true`}),ee?`Trying again...`:`Try again`]})]}),c]});if(!F||!F.hasData)return r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`material-base px-5 py-7 text-center`,children:[(0,Q.jsx)(m,{className:`mx-auto size-7 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`h2`,{className:`mt-3 text-heading-16 text-heading`,children:`Page health unavailable`}),(0,Q.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-copy-14 text-secondary`,children:d?et:`Run a new Site Health scan to calculate page-level technical findings.`})]}),c]}):(0,Q.jsxs)(Xe,{className:`surface-card mt-6 p-8 text-center`,children:[(0,Q.jsx)(m,{className:`mx-auto mb-3 h-8 w-8 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:`No Technical AEO audit yet`}),(0,Q.jsx)(`p`,{className:`supporting-copy mx-auto mt-2 max-w-md`,children:`A technical AEO audit crawls your sitemap and scores every page for structured data, AI-readable content, crawler access, freshness, and more, then rolls it up into one site score.`}),!ye()&&!d&&(0,Q.jsx)(`div`,{className:`mt-5 flex items-center justify-center gap-3`,children:(0,Q.jsxs)(ut,{type:`button`,onClick:Ee,disabled:N,children:[N?(0,Q.jsx)(a,{className:`mr-1.5 h-4 w-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`mr-1.5 h-4 w-4`,"aria-hidden":`true`}),N?De:`Run first audit`]})}),N?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,role:`status`,"aria-live":`polite`,children:`The dashboard will refresh automatically when the audit finishes.`}):null]});let ze=F.deltaScore==null?null:`${F.deltaScore>=0?`+`:``}${F.deltaScore} vs previous`,L=F.trend===`up`?`positive`:F.trend===`down`?`negative`:`neutral`,Be=E.data?.points??[],R=Be.map(e=>({runId:e.runId,date:e.auditedAt,score:e.aggregateScore})),Ve=n===void 0&&v!==null,He=ke.filter(e=>e.status===`success`),Ue=F.factors.filter(e=>e.pagesPartial+e.pagesFailing>0).length,Ge=F.runStatus===`partial`,Ye=F.crossCuttingIssues.some(e=>e.topRecommendations.length>0);function Ze(e){let t=[];for(let n of He){let r=n.factors.find(t=>t.id===e);r&&r.score<70&&t.push({url:n.url,score:r.score})}return t.sort((e,t)=>e.score-t.score)}return(0,Q.jsxs)(`div`,{className:r?``:`mt-6`,children:[r?(0,Q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-default pb-5 sm:flex-row sm:items-end sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-secondary`,children:Ge?`Score so far`:`Site score`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`span`,{"aria-label":Ge?`Score so far ${F.aggregateScore} out of 100, from a scan that did not cover the whole site`:`Site score ${F.aggregateScore} out of 100`,className:`inline-flex items-baseline gap-1 font-mono tabular-nums ${Li(F.aggregateScore)}`,children:[(0,Q.jsx)(`span`,{className:`text-heading-32`,children:F.aggregateScore}),(0,Q.jsx)(`span`,{className:`text-label-14 text-muted`,children:`/100`})]}),(0,Q.jsx)(A,{tone:Ii(F.aggregateScore),children:Vi(F.aggregateScore)}),Ge?(0,Q.jsx)(A,{tone:`caution`,children:`Part of the site`}):null,ze?(0,Q.jsx)(A,{tone:L,children:ze}):null]})]}),(0,Q.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-copy-14 tabular-nums text-secondary`,children:[(0,Q.jsxs)(`span`,{children:[F.pagesAudited,` page`,F.pagesAudited===1?``:`s`,` checked`]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-faint`,children:`·`}),(0,Q.jsxs)(`span`,{children:[Ue,` check`,Ue===1?``:`s`,` with pages below pass`]}),F.pagesErrored>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-faint`,children:`·`}),(0,Q.jsxs)(`span`,{className:`text-negative`,children:[F.pagesErrored,` crawl error`,F.pagesErrored===1?``:`s`]})]}):null]})]}):(0,Q.jsxs)(`section`,{className:`surface-card flex flex-wrap items-start justify-between gap-6 material-base p-6`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:Ve?`Technical AEO history`:`Technical AEO`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-baseline gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-heading-40 tabular-nums ${Li(F.aggregateScore)}`,children:F.aggregateScore}),(0,Q.jsx)(`span`,{className:`text-label-18 text-muted`,children:`/ 100`}),(0,Q.jsx)(A,{tone:Ii(F.aggregateScore),children:Vi(F.aggregateScore)}),ze?(0,Q.jsx)(A,{tone:L,children:ze}):null,N?(0,Q.jsx)(A,{tone:`neutral`,children:De}):null]}),(0,Q.jsxs)(`p`,{className:`supporting-copy mt-2 tabular-nums`,children:[F.pagesDiscovered,` URL`,F.pagesDiscovered===1?``:`s`,` in sitemap · `,F.pagesAudited,` audited · `,F.pagesSkipped,` skipped · `,F.pagesErrored,` errored`]}),(0,Q.jsxs)(`p`,{className:`mt-1 flex flex-wrap items-center gap-x-1.5 text-copy-13 text-muted`,children:[(0,Q.jsx)(`span`,{className:`text-faint`,children:`Sitemap:`}),(0,Q.jsx)(`a`,{href:F.sitemapUrl??`#`,target:`_blank`,rel:`noreferrer`,className:`max-w-[22rem] truncate text-secondary underline decoration-mono-700 underline-offset-2 hover:text-strong`,children:F.sitemapUrl}),(0,Q.jsx)(B,{text:"Every audit re-reads this sitemap, so pages you add or remove are picked up on the next run. Discovered/audited counts and the score reflect the sitemap at the time of the latest run. Override it with `canonry technical-aeo run <project> --sitemap-url <url>`."})]}),F.auditedAt?(0,Q.jsxs)(`p`,{className:`mt-0.5 text-copy-13 text-faint`,children:[`Audited `,new Date(F.auditedAt).toLocaleString()]}):null,N?(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13 text-muted`,role:`status`,"aria-live":`polite`,children:`Results refresh automatically when this audit finishes.`}):null]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[n===void 0&&Be.length>1?(0,Q.jsxs)(`select`,{"aria-label":`View a Technical AEO audit`,value:v??``,onChange:e=>b(e.target.value||null),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:`Latest Technical AEO audit`}),[...Be].reverse().slice(1).map(e=>(0,Q.jsxs)(`option`,{value:e.runId,children:[new Date(e.auditedAt).toLocaleDateString(),` · `,e.aggregateScore,`/100`]},e.runId))]}):null,(0,Q.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Ce(),disabled:ee,children:[(0,Q.jsx)(f,{className:`mr-1.5 h-4 w-4 ${ee?`motion-safe:animate-spin`:``}`,"aria-hidden":`true`}),ee?`Refreshing…`:`Refresh`]}),!ye()&&!d&&(0,Q.jsxs)(ut,{type:`button`,size:`sm`,onClick:Ee,disabled:N,children:[N?(0,Q.jsx)(a,{className:`mr-1.5 h-4 w-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`mr-1.5 h-4 w-4`,"aria-hidden":`true`}),N?De:`Re-run audit`]})]})]}),s,r?(0,Q.jsx)(Gi,{trend:pe.data}):null,!r&&R.length>=2?(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Trend`}),(0,Q.jsx)(`h2`,{children:`Site score over time`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 h-56`,children:[(0,Q.jsxs)(`p`,{className:`sr-only`,children:[`Technical AEO scores range from `,Math.min(...R.map(e=>e.score)),` to `,Math.max(...R.map(e=>e.score)),` across `,R.length,` audits. Use the audit selector to inspect a previous scorecard.`]}),(0,Q.jsx)(`div`,{className:`h-full`,"aria-hidden":`true`,children:(0,Q.jsx)(ie,{width:`100%`,height:`100%`,children:(0,Q.jsxs)(se,{data:R,margin:{top:8,right:8,bottom:0,left:0},children:[(0,Q.jsx)(te,{stroke:Ke,vertical:!1}),(0,Q.jsx)(re,{dataKey:`date`,tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:Hi,minTickGap:24}),(0,Q.jsx)(ae,{domain:[0,100],ticks:[0,25,50,75,100],tick:We,tickLine:!1,axisLine:!1,width:32}),(0,Q.jsx)(ne,{...qe,cursor:{stroke:Je,strokeWidth:1},labelFormatter:Ui,formatter:e=>[`${e}/100`,`Site score`]}),(0,Q.jsx)(oe,{type:`monotone`,dataKey:`score`,name:`score`,stroke:z.positive,strokeWidth:2.5,dot:{r:2.5,fill:z.positive,strokeWidth:0},isAnimationActive:!1})]})})})]})]}):null,(0,Q.jsxs)(`section`,{className:r?`pt-5`:`page-section-divider`,children:[r?(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`h3`,{className:`text-heading-16 text-heading`,children:i?`Checks`:`Technical findings`}),(0,Q.jsx)(B,{text:Bi})]}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-copy-14 text-secondary`,children:i?Ye?`Open a check to see affected pages and recommended fixes.`:I?je?`Open a check to see affected pages. Page-level evidence for the first page to fix appears below.`:`Open a check to see affected pages. Page-level evidence for one audited page appears below.`:`Open a check to see affected pages and score details.`:Ye?`Select a check to see affected pages and recommended fixes.`:`Select a check to see affected pages and score details.`})]}):(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Scorecard`}),(0,Q.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5`,children:[`Ranking factors`,(0,Q.jsx)(B,{text:Bi})]})]}),(0,Q.jsx)(`div`,{className:`evidence-table-wrap mt-3`,children:(0,Q.jsxs)(`table`,{className:`evidence-table ${r?`min-w-[42rem]`:``}`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{children:r?`Technical check`:`Factor`}),r?null:(0,Q.jsx)(`th`,{className:`text-right`,children:`Share`}),(0,Q.jsx)(`th`,{className:`text-right`,children:r?`Score`:`Avg`}),(0,Q.jsx)(`th`,{children:`Status`}),(0,Q.jsx)(`th`,{children:r?`Pages affected`:`Pass / Partial / Fail`})]})}),(0,Q.jsx)(`tbody`,{children:F.factors.map(e=>{let t=g===e.id,n=F.crossCuttingIssues.find(t=>t.factorId===e.id),i=t?Ze(e.id):[],s=e.pagesPartial+e.pagesFailing,c=e.pagesPassing+s,u=!!n?.topRecommendations.length,d=u&&s>0;return(0,Q.jsxs)(H.Fragment,{children:[(0,Q.jsxs)(`tr`,{className:t?`bg-surface-subtle`:void 0,children:[(0,Q.jsx)(`td`,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 text-left text-button-14 text-strong outline-none hover:text-primary focus-visible:text-primary focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-mono-400`,"aria-expanded":t,onClick:()=>_(t?null:e.id),children:[t?(0,Q.jsx)(l,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}):(0,Q.jsx)(o,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}),e.name]}),qr[e.id]&&(0,Q.jsx)(B,{text:qr[e.id],placement:`bottom`})]})}),r?null:(0,Q.jsx)(`td`,{className:`text-right tabular-nums text-muted`,children:typeof e.sharePct==`number`?fe(e.sharePct,w.percent):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:fe(null)}),(0,Q.jsx)(`span`,{className:`sr-only`,children:ji})]})}),(0,Q.jsxs)(`td`,{className:`text-right font-mono tabular-nums text-strong`,children:[e.avgScore,r?(0,Q.jsx)(`span`,{className:`text-muted`,children:`/100`}):null]}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(A,{tone:Ri(e.status),children:zi[e.status]})}),r?(0,Q.jsxs)(`td`,{className:`tabular-nums ${s>0?`text-strong`:`text-muted`}`,children:[s,` of `,c]}):(0,Q.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,Q.jsx)(`span`,{className:`text-positive-400`,children:e.pagesPassing}),` / `,(0,Q.jsx)(`span`,{className:`text-caution-400`,children:e.pagesPartial}),` / `,(0,Q.jsx)(`span`,{className:`text-negative-400`,children:e.pagesFailing})]})]}),t?(0,Q.jsx)(`tr`,{className:`bg-surface-subtle`,children:(0,Q.jsx)(`td`,{colSpan:r?4:5,className:`px-4 pb-5 pt-0`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 border-t border-subtle pt-4 ${d?`lg:grid-cols-2`:``}`,children:[u&&n?(0,Q.jsxs)(`section`,{"aria-labelledby":`technical-finding-${e.id}-fixes`,children:[(0,Q.jsx)(`h4`,{id:`technical-finding-${e.id}-fixes`,className:`text-heading-14 text-heading`,children:`Recommended fixes`}),(0,Q.jsx)(`ol`,{className:`mt-2 list-decimal space-y-1.5 pl-5 marker:text-muted`,children:n.topRecommendations.map((e,t)=>(0,Q.jsx)(`li`,{className:`pl-1 text-label-14 text-secondary`,children:e},t))}),r&&typeof e.sharePct==`number`?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:Jr(e.sharePct,`site`)}):null]}):s===0?(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Every audited page passes this check.`}):null,s>0?(0,Q.jsxs)(`section`,{"aria-labelledby":`technical-finding-${e.id}-pages`,children:[(0,Q.jsxs)(`h4`,{id:`technical-finding-${e.id}-pages`,className:`text-heading-14 text-heading`,children:[`Affected pages (`,s,`)`]}),r&&D.isLoading?(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading affected pages...`]}):r&&D.error?(0,Q.jsxs)(`div`,{className:`mt-3`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-negative`,children:`Affected pages could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Try the page-level audit read again.`}),(0,Q.jsxs)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-3`,onClick:()=>void D.refetch(),disabled:D.isFetching,children:[D.isFetching?(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(f,{className:`size-4`,"aria-hidden":`true`}),D.isFetching?`Retrying affected pages...`:`Retry affected pages`]})]}):i.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:i.slice(0,Ni).map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-label-14`,children:[(0,Q.jsx)(`span`,{className:`w-8 shrink-0 text-right font-mono tabular-nums ${Li(e.score)}`,children:e.score}),(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`min-w-0 truncate text-link outline-none hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,title:e.url,children:e.url})]},e.url))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:`Page details are not available in the loaded audit sample.`}),i.length>Ni?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-muted`,children:[`+ `,i.length-Ni,` more below pass`]}):null,Re&&(!r||!D.isLoading&&!D.error)?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-muted`,children:[`Showing the worst `,ke.length,` audited pages.`]}):null]}):null]})})}):null]},e.id)})})]})})]}),i&&I?(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`onboarding-page-evidence-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-3 sm:flex-row sm:items-start`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h3`,{id:`onboarding-page-evidence-heading`,className:`text-heading-16 text-heading`,children:je?`First page to fix`:`Example audited page`}),(0,Q.jsx)(`a`,{href:I.url,target:`_blank`,rel:`noreferrer`,className:`mt-1 block max-w-2xl truncate text-label-14-mono text-link outline-none hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,title:I.url,children:I.url})]}),(0,Q.jsxs)(A,{tone:Ii(I.overallScore),children:[Math.round(I.overallScore),`/100`]})]}),(0,Q.jsx)($r,{audit:Me.data,isLoading:Me.isLoading,error:Me.error,onRetry:()=>{Me.refetch()}})]}):null,!r&&F.crossCuttingIssues.length>0?(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Opportunities`}),(0,Q.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5`,children:[`Prioritized fixes`,(0,Q.jsx)(B,{text:`Factors scoring below pass across the most pages, ranked by site-wide impact. Fixing one of these typically lifts many pages at once.`})]})]}),(0,Q.jsx)(`div`,{className:`mt-3 divide-y divide-mono-800/60 overflow-hidden material-base`,children:F.crossCuttingIssues.map(e=>(0,Q.jsxs)(`div`,{className:`p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:e.factorName}),(0,Q.jsx)(A,{tone:Ii(e.avgScore),children:Vi(e.avgScore)}),(0,Q.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`avg `,e.avgScore,` · affects `,e.affectedPages,` of `,e.totalPages,` pages (`,fe(e.affectedPct,w.percent),`)`]})]}),e.topRecommendations.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1`,children:e.topRecommendations.map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2 text-label-14 text-secondary`,children:[(0,Q.jsx)(`span`,{className:`select-none text-faint`,children:`→`}),(0,Q.jsx)(`span`,{children:e})]},t))}):null]},e.factorId))})]}):null,r?null:(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Pages`}),(0,Q.jsx)(`h2`,{children:`Per-page breakdown`})]}),Ne?(0,Q.jsxs)(`div`,{className:`segmented`,role:`group`,"aria-label":`Filter pages`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{h(!1),Ie.setPage(1)},"aria-pressed":!Pe,className:`segmented-option min-h-11 tabular-nums ${Pe?``:`segmented-option-active`}`,children:[`All `,F.pagesAudited]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{h(!0),Ie.setPage(1)},"aria-pressed":Pe,className:`segmented-option min-h-11 tabular-nums ${Pe?`segmented-option-active text-negative`:``}`,children:[`Errors `,F.pagesErrored]})]}):null]}),ke.length>0?(0,Q.jsx)(oi,{value:Ie.query,onChange:Ie.setQuery,label:`Filter audited page URLs`,placeholder:`Filter page URL or query parameters`,className:`mt-3 max-w-md`}):null,Ie.totalRows===0?(0,Q.jsx)(`p`,{className:`supporting-copy mt-3`,children:Ie.hasQuery?`No pages match this filter.`:`No pages recorded.`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`evidence-table-wrap mt-3`,children:(0,Q.jsxs)(`table`,{className:`evidence-table`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{className:`text-right`,children:`Score`}),(0,Q.jsx)(`th`,{children:`Status`}),(0,Q.jsx)(`th`,{className:`w-full`,children:`URL`})]})}),(0,Q.jsx)(`tbody`,{children:Ie.rows.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`text-right tabular-nums`,children:e.status===`error`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-negative-400`,children:[(0,Q.jsx)(y,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`err`]}):(0,Q.jsx)(`span`,{className:Li(e.overallScore),children:e.overallScore})}),(0,Q.jsx)(`td`,{children:e.status===`error`?(0,Q.jsx)(A,{tone:`negative`,children:`Error`}):(0,Q.jsx)(A,{tone:Ii(e.overallScore),children:Vi(e.overallScore)})}),(0,Q.jsx)(`td`,{className:`w-full max-w-0`,children:(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`block truncate text-neutral hover:text-heading`,title:e.status===`error`?e.error??e.url:e.url,children:(0,Q.jsx)(ii,{value:e.url,headLength:54,tailLength:20,title:e.status===`error`?e.error??e.url:e.url})})})]},e.url))})]})}),(0,Q.jsx)(si,{page:Ie.page,pageSize:Ie.pageSize,visibleRows:Ie.rows.length,totalRows:Ie.totalRows,onPageChange:Ie.setPage,itemLabel:Ie.hasQuery?`matches`:`rows`}),Re?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-faint`,children:[`Showing the worst `,ke.length,` of `,F.pagesAudited,` audited pages.`]}):null]})]})]})}function Gi({trend:e}){let[t,n]=(0,H.useState)(`score`),r=e?.groups.find(e=>e.key===`site-health`);if(!r)return null;let i=r.figures.map(e=>({key:e.key,label:e.label,value:e.value===null?`—`:e.value.toLocaleString(),detail:e.unit===he.score&&e.value!==null?`/100`:void 0,change:xi(e.change,e.unit),series:Ci(e)})),a=r.figures.find(e=>e.key===`score`),o=a?.series[0],s=a?.series.at(-1);return!o||!s||!i.some(e=>e.key===`score`&&mi(e))?null:(0,Q.jsx)(`section`,{"aria-label":`Site Health over time`,className:`border-b border-default py-5`,children:(0,Q.jsx)(ki,{name:`Site Health figures`,groups:[{key:`site-health`,label:`Every scan`,basis:Si(r.figures),figures:i}],selected:[t],onSelect:n,cadence:`scan`,instants:!0,span:wi(o,s)})})}var Ki=e({LivePageHealthFindings:()=>xo,PAGE_INTERNAL_LINKS_HELP:()=>Ra,SiteHealthSection:()=>Co,emptyLinkCopy:()=>qa}),qi=[{id:`map`,label:`Map`},{id:`inventory`,label:`Pages`},{id:`technical`,label:`Page health`}],Ji={map:`Explore how pages, site sections, and internal links fit together.`,inventory:`Review discovered pages and the links that shape their visibility.`,technical:`Prioritize audit findings and inspect the pages that need work.`},Yi=[{id:`all`,label:`All`,healthState:void 0},{id:`hidden`,label:`Hidden pages`,healthState:E.hidden}];function Xi(e,t,n){let r=U(e,n)||t,i=r.indexOf(`?`);if(i<0)return{path:r,query:null};let a=r.slice(i),o=a;try{o=decodeURIComponent(a.replaceAll(`+`,` `))}catch{o=a}return{path:r.slice(0,i),query:o}}function Zi(e){return e?e.urlVersions+(e.urlVersionsNotFetched??0):null}function Qi(e){let t=`${$(e)} URL version${e===1?``:`s`} skipped`;return{label:t,text:`${t}. These addresses add parameters, such as a filter, to a page and name that page as canonical, so they are copies of it. The audit does not score them or list them here.`}}var $i={[P.metaRobotsNoindex]:`Hidden by meta robots tag`,[P.xRobotsNoindex]:`Hidden by X-Robots-Tag header`,[P.robotsDisallow]:`Blocked by robots.txt`,[P.redirectTerminal]:`Redirects to another page`,[P.canonicalToOther]:`Points to another page as canonical`,[P.notHtmlOrUnavailable]:`Not an HTML page, so it was not scored`},ea=new Map(Object.entries($i));function ta(e){return ea.get(e)??e}var na=20,ra=200,ia=100,aa=100,oa=50,sa=pe,ca=ge,la=2e4,ua=3,da=new Intl.NumberFormat,fa=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}),pa={eligible:`positive`,hidden:`caution`,resource:`neutral`,redirect:`neutral`,failed:`negative`,unchecked:`neutral`};function ma(e){if(!e)return`Date unavailable`;let t=new Date(e);return Number.isNaN(t.getTime())?`Date unavailable`:fa.format(t)}function ha(e){return e.replaceAll(`_`,` `).replaceAll(`-`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ga(e){let t=xr(e);return{label:Sr(t),tone:pa[t]}}function _a(e){return e==null?`Not scored`:fe(e,w.percent)}function va(e){return e.auditScore==null?`Not checked`:`${Math.round(e.auditScore)}/100`}function $(e){return e==null?`Not available`:da.format(e)}var ya={clicksFromHome:`How many clicks it takes to reach this page from the home page, following links.`,linksIn:`How many other pages link to this page.`,linksOut:`How many other pages this page links to.`,linkImportance:`How much link value flows to this page, based on how many pages link to it and how important those pages are. Shown relative to the highest page on this site, which is 100%.`,technicalScore:`How well this page is set up for AI and search engines to read, from 0 to 100. Open a page to see what it is marked down for.`,linkTimes:`How many times this link appears on the page it comes from.`,pagesFound:`How many pages this scan discovered, whether or not it could load them.`,pagesChecked:`How many of the pages it found this scan actually loaded.`,internalLinks:`How many links between pages on this site the scan recorded.`},ba=new Set([`clicksFromHome`,`linkImportance`,`internalLinks`,`pagesFound`,`pagesChecked`]);function xa(e,t){let n=ya[e];return ba.has(e)?`${n} This always counts every link, including menu and footer.`:e===`technicalScore`||e===`linkTimes`?n:t?`${n} Right now this counts only links written in your page text. Menu and footer links are hidden.`:`${n} This counts every link, including menu and footer.`}function Sa(e,t){return`${da.format(e)} ${t}${e===1?``:`s`}`}function Ca(e,t){if(!e||!t)return null;try{let n=new URL(e),r=new URL(t),i=e=>e.hostname.toLowerCase().replace(/\.$/,``).replace(/^www\./,``);return i(n)===i(r)?null:{requested:n.host,effective:r.host}}catch{return null}}function wa(e){return e===`completed`?`positive`:e===`partial`||e===`queued`||e===`running`?`caution`:e===`failed`||e===`cancelled`?`negative`:`neutral`}var Ta=`Latest scan`,Ea=`Shows the most complete scan from the latest day with results. Choose a dated entry to view another scan.`;function Da(e){let t=ma(e.finishedAt??e.startedAt??e.createdAt),n=e.hasCrawlData?``:` · Score only`;return`${t} · ${ha(e.status)}${n}`}var Oa=new Map(Object.entries({complete:`This scan finished on its own.`,unknown:`This scan stopped before it checked every page it found.`,"max-pages":`This scan stopped at the page limit, so some pages were not checked.`,"max-edges":`This scan stopped at the link limit, so some links are missing.`,"max-fetches":`This scan stopped after checking as many pages as it could.`,"max-duration":`This scan ran out of time, so some pages were not checked.`,"max-bytes":`This scan stopped at the data limit, so some pages were not checked.`,"max-page-bytes":`This scan skipped a page that was too large to read.`,"max-depth":`This scan stopped at the depth limit, so deeper pages were not checked.`,"max-links-per-page":`This scan stopped reading links on pages that had too many.`,"max-query-variants":`This scan stopped at the limit for pages that differ only by a query string.`,"max-sitemap-fanout":`This scan stopped at the sitemap limit, so some sitemaps were not read.`,"max-sitemap-urls":`This scan stopped at the sitemap page limit, so some pages were not found.`,"root-host-redirect":`The site moved to another address during this scan.`})),ka=rt,Aa=[{value:null,label:`Default (10 clicks)`},{value:1,label:`1 click from the home page`},{value:2,label:`2 clicks`},{value:3,label:`3 clicks`},{value:5,label:`5 clicks`},{value:20,label:`20 clicks`},{value:50,label:`50 clicks`},{value:100,label:`100 clicks (maximum)`}],ja={"max-pages":`Raise the page budget in Scan settings.`,"max-edges":`Raise the page budget in Scan settings.`,"max-fetches":`Raise the page budget in Scan settings.`,"max-duration":`Try a smaller scan in Scan settings.`,"max-depth":`Raise the crawl depth in Scan settings.`};function Ma(e,t=!1){if(!e)return null;let n=ja[e]??null;return n&&t?`${n.replace(/ in Scan settings\.$/,``)} in Site Health's Scan settings after setup.`:n}function Na(e){return e?Oa.get(e)??`This scan stopped early: ${e}.`:`This scan stopped before it checked every page it found.`}var Pa={applied:`This scan told menu and footer links apart by how often the same link repeats across pages. It cannot spot a link written into the page text when its wording matches the menu. Run a new scan to read the page layout instead.`,"applied-placement":`This scan read where each link sits in the page, so links in the page text are separated from the menu, header, and footer even when they use the same wording.`,"applied-placement-with-ubiquity":`This scan read where each link sits in the page. Some pages mark out no menu or main area, so those links fall back to how often the link repeats across pages, which can miss a link written into the page text.`,"applied-placement-partial":`This scan read where each link sits in the page. Some pages mark out no menu or main area, and this scan found fewer than 15 pages, so nothing could tell those links apart. They are counted as links in your page text, which is what a link no rule marked as menu, header, or footer means here.`,"unavailable-too-few-pages":`This scan found fewer than 15 pages and did not read where each link sits in the page. On a site that small every link is on most pages, so menu and footer links cannot be told apart from the rest.`,"unavailable-legacy-scan":`This scan ran before menu and footer links were separated. Run a new scan to split them out.`},Fa=new Map(Object.entries(Pa));function Ia(e){return e===null?``:Fa.get(e)??Pa[`unavailable-legacy-scan`]}var La=`Scroll to zoom. Click a page to inspect it.`,Ra=`Observed links to and from this page in the selected scan.`,za=`Page positions on this map were set before menu and footer links were separated. Run a new scan to update them.`;function Ba(e){if(e.filterUnavailable)return`All ${Sa(e.totalEdgeCount,`link`)} shown.`;let t=`${da.format(e.contentEdgeCount)} link${e.contentEdgeCount===1?``:`s`} in your page text`,n=da.format(e.templateEdgeCount);return e.showTemplateLinks?`${t}, ${n} menu and footer.`:`${t}. ${n} menu and footer link${e.templateEdgeCount===1?``:`s`} hidden.`}var Va=`Menu, header, and footer links repeat on every page, so they say nothing about which pages relate to each other. Links written in your page text do.`;function Ha(e,t){let n=[Va,Ia(e)];return t.staleLayout&&n.push(za),n.filter(Boolean).join(` `)}function Ua(e,t,n){if(e===`disabled`)return{label:`Broken links: not checked`,tone:`neutral`};let r=n??0,i=r>0?`, ${da.format(r)} unchecked`:``;return e===`complete`?t?{label:`Broken links: ${da.format(t)} found${i}`,tone:`negative`}:r>0?{label:`Broken links: none found, ${da.format(r)} unchecked`,tone:`caution`}:{label:`Broken links: none found`,tone:`positive`}:e===`partial`?{label:`Broken links: ${da.format(t??0)} found so far${i}`,tone:`caution`}:{label:`Broken links: not checked`,tone:`neutral`}}function Wa(e){return e.showTemplateLinks||!e.known?{value:$(e.total),hiddenNote:null,filtered:!1}:{filtered:!0,value:e.truncated?`${$(e.visible)}+`:$(e.visible),hiddenNote:e.hidden===0?null:e.truncated?`At least ${$(e.hidden)} menu and footer hidden`:`${$(e.hidden)} menu and footer hidden`}}function Ga({label:e,value:t,hiddenNote:n,help:r}){return(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[e,(0,Q.jsx)(B,{text:r})]}),(0,Q.jsx)(`dd`,{className:`mt-1 text-label-14-strong tabular-nums text-heading`,children:t}),n&&(0,Q.jsx)(`dd`,{className:`mt-0.5 text-label-12 text-muted`,children:n})]})}function Ka({page:e,inbound:t,outbound:n}){return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`dl`,{className:`grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsx)(Ga,{label:`Clicks from home`,value:String(e.depth??`Not reached`),help:xa(`clicksFromHome`,!1)}),(0,Q.jsx)(Ga,{label:`Links in`,value:t.value,hiddenNote:t.hiddenNote,help:xa(`linksIn`,t.filtered)}),(0,Q.jsx)(Ga,{label:`Links out`,value:n.value,hiddenNote:n.hiddenNote,help:xa(`linksOut`,n.filtered)}),(0,Q.jsx)(Ga,{label:`Link importance`,value:_a(e.linkScoreNormalized),help:xa(`linkImportance`,!1)})]})})}function qa(e,t,n){return t===0?e===`inbound`?`Nothing links to this page.`:`This page links to nothing.`:`${e===`inbound`?`No links in the page text point here.`:`No links in the page text lead away from here.`} ${n?`At least ${$(t)} menu and footer links hidden.`:`${Sa(t,`menu and footer link`)} hidden.`}`}function Ja({label:e,metric:t}){return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,(0,Q.jsx)(B,{text:xa(t,!1)})]})}function Ya({direction:e,edges:t,truncated:n,rootHost:r,hiddenTemplateCount:i}){let a=e===`inbound`?`Links in`:`Links out`;return(0,Q.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`site-health-${e}-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`h4`,{id:`site-health-${e}-heading`,className:`text-heading-14 text-heading`,children:[a,` (`,$(t.length),`)`]}),n&&(0,Q.jsxs)(`span`,{className:`text-label-12 text-muted`,children:[`First `,aa]})]}),t.length===0?(0,Q.jsx)(`p`,{className:`material-base px-3 py-4 text-copy-14 text-secondary`,children:qa(e,i,n)}):(0,Q.jsx)(`div`,{className:`evidence-table-wrap max-h-64 overflow-auto`,children:(0,Q.jsxs)(`table`,{className:`evidence-table site-health-table min-w-[420px]`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:`Page`}),(0,Q.jsx)(`th`,{scope:`col`,children:`Anchor text`}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Times`,metric:`linkTimes`})})]})}),(0,Q.jsx)(`tbody`,{children:t.map(t=>{let n=e===`inbound`?t.sourceUrl:t.targetUrl;return(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`max-w-64 truncate font-mono`,title:n,children:U(n,r)}),(0,Q.jsx)(`td`,{className:`max-w-52 truncate`,title:t.anchors.join(`, `)||void 0,children:t.anchors.join(`, `)||`No anchor text`}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(t.occurrences)})]},t.edgeKey)})})]})})]})}function Xa(e){return e&&`indexabilityReasons`in e?e.indexabilityReasons:[]}function Za({page:e,isLoading:t,error:n,inbound:r,outbound:i,inboundTruncated:o,outboundTruncated:s,audit:l,auditLoading:u,auditError:d,onRetryAudit:f,rootHost:p,reasonSource:m,reasonsState:h,onRetryReasons:g,showTemplateLinks:_}){if(!e)return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-label":`Selected page details`,children:[(0,Q.jsx)(`h3`,{className:`text-heading-16 text-heading`,children:`Page links`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Select a page to inspect its internal links and crawl signals.`})]});let v=ga(e),y=Xa(m??e),b=m?.urlVersionOf??null,x=_?r:r.filter(e=>!e.isTemplate),S=_?i:i.filter(e=>!e.isTemplate),C=!t&&!n,ee=r.length-x.length,te=i.length-S.length,ne=Wa({total:e.inboundUniqueEdges,visible:x.length,hidden:ee,truncated:o,showTemplateLinks:_,known:C}),re=Wa({total:e.outboundUniqueEdges,visible:S.length,hidden:te,truncated:s,showTemplateLinks:_,known:C});return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`site-health-page-inspector-title`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-3 sm:flex-row sm:items-start`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`h3`,{id:`site-health-page-inspector-title`,className:`break-words font-mono text-heading-16 text-heading`,children:e.path}),(0,Q.jsx)(A,{tone:v.tone,children:v.label})]}),(0,Q.jsx)(`p`,{className:`mt-1 break-all text-copy-14 text-secondary`,children:e.url}),h===`loading`?(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,role:`status`,children:`Loading page details...`}):h===`error`?(0,Q.jsxs)(`p`,{className:`mt-2 flex flex-wrap items-center gap-2 text-copy-14 text-negative`,role:`alert`,children:[`Page details could not be loaded, so any reason this page is hidden is unknown.`,(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:g,children:`Try again`})]}):y.length>0||b?(0,Q.jsxs)(`ul`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-label-14 text-secondary`,"aria-label":`Why this page is hidden`,children:[b&&(0,Q.jsx)(`li`,{children:`URL version of ${U(b,p)}, not scored`}),y.map(e=>(0,Q.jsx)(`li`,{children:ta(e)},e))]}):null]}),(0,Q.jsx)(k,{asChild:!0,variant:`secondary`,size:`sm`,children:(0,Q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:[`Open page `,(0,Q.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})]})})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)($r,{audit:l,isLoading:u,error:d,onRetry:f})}),(0,Q.jsxs)(`section`,{className:`mt-5 border-t border-default pt-5`,"aria-labelledby":`site-health-page-links-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`h3`,{id:`site-health-page-links-heading`,className:`text-heading-16 text-heading`,children:`Internal links`}),(0,Q.jsx)(B,{text:Ra})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ka,{page:e,inbound:ne,outbound:re})}),(0,Q.jsx)(`div`,{className:`mt-5`,children:t?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-label-14 text-secondary`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page links...`]}):n?(0,Q.jsx)(`p`,{className:`rounded-md border border-negative bg-negative-soft px-4 py-3 text-copy-14 text-negative`,role:`alert`,children:`Page links could not be loaded.`}):(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(Ya,{direction:`inbound`,edges:x,truncated:o,rootHost:p,hiddenTemplateCount:ee}),(0,Q.jsx)(Ya,{direction:`outbound`,edges:S,truncated:s,rootHost:p,hiddenTemplateCount:te})]})})]})]})}function Qa({pages:e,total:t,skippedUrlVersions:n,rootHost:r,selectedNodeKey:i,onSelect:o,hasNextPage:s,isFetchingNextPage:c,onLoadMore:l,filter:u,onFilterChange:d,filterUnavailable:f}){let[p,m]=(0,H.useState)(``),g=p.trim().toLowerCase(),_=(0,H.useMemo)(()=>g?e.filter(e=>`${e.path} ${e.url}`.toLowerCase().includes(g)):e,[g,e]),v=g.length>0&&(s||e.length<t);return(0,Q.jsxs)(`section`,{"aria-labelledby":`site-health-inventory-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col justify-between gap-3 sm:flex-row sm:items-end`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{id:`site-health-inventory-heading`,className:`text-heading-16 text-heading`,children:`Pages`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:u===`all`?`Showing ${$(e.length)} of ${$(t)} pages found.`:`Showing ${$(e.length)} of ${$(t)} hidden pages.`}),n!=null&&n>0&&(0,Q.jsx)(B,{...Qi(n)})]})]}),(0,Q.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:`Search loaded pages`}),(0,Q.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`input`,{type:`search`,value:p,onChange:e=>m(e.target.value),placeholder:`Search loaded pages`,className:`h-9 w-full rounded-md border border-base bg-bg pl-9 pr-3 text-label-14 text-primary outline-none placeholder-mono-400 focus:border-strong focus:ring-2 focus:ring-mono-600`})]})]}),(0,Q.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-2`,role:`group`,"aria-label":`Filter pages`,children:Yi.map(e=>(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>d(e.id),className:`filter-chip ${u===e.id?`filter-chip-active`:``}`,children:e.label},e.id))}),(0,Q.jsx)(`div`,{className:`evidence-table-wrap`,children:(0,Q.jsxs)(`table`,{className:`evidence-table site-health-table min-w-[800px]`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:`Page`}),(0,Q.jsx)(`th`,{scope:`col`,title:wr(`eligible`),children:`Status`}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Clicks from home`,metric:`clicksFromHome`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Links in`,metric:`linksIn`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Links out`,metric:`linksOut`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Link importance`,metric:`linkImportance`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Score`,metric:`technicalScore`})})]})}),(0,Q.jsx)(`tbody`,{children:_.map(e=>{let t=ga(e),n=Xi(e.url,e.path,r);return(0,Q.jsxs)(`tr`,{className:i===e.nodeKey?`bg-surface-active`:void 0,children:[(0,Q.jsx)(`td`,{className:`max-w-80`,children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>o(e.nodeKey),className:`block max-w-full rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,title:e.url,children:[(0,Q.jsx)(`span`,{className:`block truncate font-mono text-button-14 text-link`,children:n.path}),n.query&&(0,Q.jsx)(`span`,{className:`line-clamp-2 [overflow-wrap:anywhere] text-label-12-mono text-secondary`,children:n.query})]})}),(0,Q.jsx)(`td`,{title:wr(xr(e)),children:(0,Q.jsx)(A,{tone:t.tone,children:t.label})}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:e.depth??`Not reached`}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(e.inboundUniqueEdges)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(e.outboundUniqueEdges)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:_a(e.linkScoreNormalized)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:va(e)})]},e.nodeKey)})})]})}),_.length===0&&(0,Q.jsx)(`p`,{className:`border-x border-b border-default px-4 py-8 text-center text-copy-14 text-secondary`,children:g.length===0?f?`This scan cannot be filtered. Run a new scan to filter its pages.`:u===`hidden`?`No hidden pages were found in this scan.`:`No pages are available.`:v?`No matches in the ${$(e.length)} loaded pages. Load more pages to continue searching.`:`No pages match this search.`}),s&&(0,Q.jsx)(`div`,{className:`flex justify-center border-x border-b border-default px-4 py-3`,children:(0,Q.jsxs)(k,{variant:`secondary`,size:`sm`,disabled:c,onClick:l,children:[c&&(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),c?`Loading more pages`:`Load more pages`]})})]})}function $a({projectName:e,runId:t,section:n,onSelect:r}){let[i,a]=(0,H.useState)(!1),s=n.pageCount-+!!n.hasPage>0;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`div`,{className:`flex min-h-11 items-center gap-1 px-2 py-1`,children:[s?(0,Q.jsx)(`button`,{type:`button`,"aria-label":`${i?`Collapse`:`Expand`} ${n.path}`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex size-8 shrink-0 items-center justify-center rounded-sm text-muted outline-none hover:bg-surface-hover hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,children:i?(0,Q.jsx)(l,{className:`size-3.5`,"aria-hidden":`true`}):(0,Q.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})}):(0,Q.jsx)(`span`,{className:`block size-8 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>r(n.path),className:`min-w-0 flex-1 break-all rounded-sm py-2 text-left font-mono text-button-14 text-heading outline-none hover:text-link focus-visible:ring-2 focus-visible:ring-mono-400`,children:n.path}),(0,Q.jsx)(`span`,{className:`shrink-0 px-2 text-label-12-mono text-muted`,children:$(n.pageCount)})]}),i&&(0,Q.jsx)(`div`,{className:`ml-6 border-l border-default pl-1`,children:(0,Q.jsx)(to,{projectName:e,runId:t,parentPath:n.path,onSelect:r})})]})}function eo({page:e,onSelect:t}){return(0,Q.jsx)(`li`,{className:`bg-surface-subtle`,children:(0,Q.jsxs)(`div`,{className:`flex min-h-11 items-center gap-1 px-2 py-1`,children:[(0,Q.jsx)(`span`,{className:`block size-8 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>t(e.nodeKey),className:`min-w-0 flex-1 break-all rounded-sm py-2 text-left font-mono text-button-14 text-heading outline-none hover:text-link focus-visible:ring-2 focus-visible:ring-mono-400`,children:e.path||`/`}),(0,Q.jsx)(`span`,{className:`shrink-0 px-2 text-label-12-mono text-muted`,children:$(1)})]})})}function to({projectName:e,runId:t,parentPath:n,onSelect:r,rootPage:i,onSelectRootPage:o}){let s={client:O,path:{name:e},query:{runId:t,parentPath:n,limit:ia}},c=ee({...Ne(s),initialPageParam:s,getNextPageParam:e=>e.nextCursor?{path:s.path,query:{...s.query,cursor:e.nextCursor}}:void 0}),l=c.data?.pages.flatMap(e=>e.children)??[];return c.isLoading?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),` Loading sections...`]}):c.error?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-negative`,role:`alert`,children:`Site sections could not be loaded.`}):l.length===0&&!i?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-secondary`,children:`No nested sections were found.`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`ul`,{className:`divide-y divide-default`,children:[i&&o&&(0,Q.jsx)(eo,{page:i,onSelect:o}),l.map(n=>(0,Q.jsx)($a,{projectName:e,runId:t,section:n,onSelect:r},n.path))]}),c.hasNextPage&&(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsx)(k,{variant:`ghost`,size:`sm`,disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:c.isFetchingNextPage?`Loading more sections`:`Load more sections`})})]})}function no(){return(0,Q.jsx)(`div`,{role:`status`,className:`flex min-h-[420px] items-center justify-center material-base px-6 text-center lg:min-h-[520px]`,children:(0,Q.jsxs)(`div`,{className:`max-w-sm`,children:[(0,Q.jsx)(a,{className:`mx-auto size-5 motion-safe:animate-spin text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{className:`mt-3 text-copy-14-strong text-heading`,children:`Preparing the interactive site map`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Page and link data is ready for the graph renderer.`})]})})}function ro(e){return e===`discovering`?`Discovering pages`:e===`checking`?`Checking pages`:e===`arranging-map`?`Arranging map`:e===`queued`?`Waiting to start`:`Preparing scan`}var io=3;function ao(e){return e===`checking`?1:e===`arranging-map`?2:0}function oo({phase:e,pagesChecked:t,pageLimit:n,finalStep:r}){let i=ao(e),a=i===1&&t!==null&&n?Math.min(1,t/n):null,o=[`Find pages`,i===1&&t!==null?`Check pages · ${$(t)}${n?` of up to ${$(n)}`:``}`:`Check pages`,r];return(0,Q.jsxs)(`div`,{className:`mt-4`,role:`progressbar`,"aria-label":`Scan progress`,"aria-valuemin":0,"aria-valuemax":io,"aria-valuenow":i+(a??0),"aria-valuetext":o[i],children:[(0,Q.jsx)(`div`,{className:`grid grid-cols-[1fr_2fr_1fr] gap-1.5`,"aria-hidden":`true`,children:o.map((e,t)=>(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-inset`,children:t<i?(0,Q.jsx)(`div`,{className:`h-full w-full rounded-full bg-positive-400`}):t===i&&a!==null?(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-positive-400 transition-[width] duration-500`,style:{width:`${Math.max(4,a*100)}%`}}):t===i?(0,Q.jsx)(`div`,{className:`h-full w-full rounded-full bg-positive-400/40 motion-safe:animate-pulse`}):null},e))}),(0,Q.jsx)(`div`,{className:`mt-2 grid grid-cols-[1fr_2fr_1fr] gap-1.5 text-label-14`,"aria-hidden":`true`,children:o.map((e,t)=>(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate ${t===i?`text-label-14-strong text-heading`:t<i?`text-secondary`:`text-muted`}`,children:[t<i?(0,Q.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):null,(0,Q.jsx)(`span`,{className:`truncate`,children:e})]},e))})]})}function so(e){return e!==`completed`&&e!==`partial`&&e!==`failed`&&e!==`cancelled`}function co(e){return e===`queued`||e===`discovering`||e===`checking`||e===`arranging-map`}function lo(e){return e===`completed`||e===`partial`||e===`failed`||e===`cancelled`}function uo(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.code==`string`)return t.code;if(t.error&&typeof t.error==`object`){let e=t.error;return typeof e.code==`string`?e.code:null}return null}function fo(e){if(!e)return null;let t=Date.parse(e);return!Number.isFinite(t)||t>Date.now()?null:t+la}function po({active:e,runId:t,createdAt:n}){let r=fo(n),[i,a]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t||r==null){a(null);return}let n=r-Date.now();if(n<=0){a({runId:t,deadline:r});return}a(null);let i=window.setTimeout(()=>a({runId:t,deadline:r}),n);return()=>window.clearTimeout(i)},[e,r,t]),e&&t!=null&&r!=null&&(Date.now()>=r||i?.runId===t&&i.deadline===r)}function mo({onContinueOnboarding:e,onSkipOnboarding:t}){return(0,Q.jsxs)(`section`,{"aria-labelledby":`site-health-continuation-heading`,className:`mt-5 flex flex-col gap-3 border-t border-default pt-5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{id:`site-health-continuation-heading`,className:`text-heading-16 text-heading`,children:`Continue while Site Health finishes`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Canonry will finish this scan locally. Saved results will appear in Site Health.`})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsx)(k,{type:`button`,onClick:e,children:`Set up AI Visibility`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,onClick:t,children:`Skip for now`})]})]})}function ho({view:e,tabbed:t=!0,children:n}){return(0,Q.jsx)(`div`,{id:t?`site-health-${e}-panel`:void 0,role:t?`tabpanel`:void 0,"aria-labelledby":t?`site-health-${e}-tab`:void 0,className:`min-w-0`,children:n})}function go({status:e,progress:t,progressError:n,onRetryProgress:r,pageHealthDestination:i=!1,firstLook:a=!1,boundedPageLimit:o,livePageHealthPreview:s,livePageHealthError:c=!1,livePageHealthRunId:l=null,continuation:u}){let d=t?.attempt??null,f=t?.phase??e,p=f===`arranging-map`;return(0,Q.jsxs)(`section`,{"aria-label":`Current scan progress`,className:`material-base px-5 py-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-6 items-center gap-2`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:p&&i?`Preparing page health`:p?`Preparing site map`:a?`Checking your site`:`Scanning site`}),a?(0,Q.jsx)(B,{text:o?`A quick scan to find your first fixes. Reads up to ${o} pages, or stops sooner at the time limit, so results come back fast. You can run a larger scan from Site Health later.`:`A quick scan to find your first fixes. Stops at its page budget or the time limit, so results come back fast. You can run a larger scan from Site Health later.`}):null]}),(0,Q.jsx)(`p`,{"aria-atomic":`true`,"aria-label":`Current scan progress`,"aria-live":`polite`,role:`status`,className:`sr-only`,children:i?p?`Finalizing page health. The scan is complete and its findings are being published.`:`${ro(f)}. Page health appears after the scan finishes.`:p?`Arranging map. The scan is complete and its map is being published.`:`${ro(f)}. The map appears after the scan finishes.`}),(0,Q.jsx)(oo,{phase:f,pagesChecked:d?.pagesFetched??null,pageLimit:o??null,finalStep:i?`Build report`:`Build map`}),(0,Q.jsxs)(`dl`,{"aria-label":`Live scan counters`,className:`mt-5 grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages found`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesDiscovered):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages checked`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesFetched):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Links found`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.edgesDiscovered):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages failed`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesErrored):`—`})]})]}),n&&(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,Q.jsx)(`span`,{children:p?i?`Page health publishing status could not load.`:`Map publishing status could not load.`:`Live scan counts could not load. The scan is still running.`}),r&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:r,children:`Retry progress`})]}),i?(0,Q.jsx)(xo,{runId:l,preview:s,error:c}):null,u]})}function _o(){return Array.from({length:ua},()=>null)}function vo(e,t){return e===t||e!=null&&t!=null&&e.nodeKey===t.nodeKey&&e.url===t.url&&e.auditScore===t.auditScore&&e.checksNeedingAttention===t.checksNeedingAttention}function yo(e,t){return e.length===t.length&&e.every((e,n)=>vo(e,t[n]??null))}function bo(e,t){let n=[...e];for(let e of t){let t=n.findIndex(t=>t?.nodeKey===e.nodeKey);if(t>=0){n[t]=e;continue}let r=n.findIndex(e=>e==null);if(r<0)break;n[r]=e}return n}function xo({runId:e,preview:t,error:n=!1}){let[r,i]=(0,H.useState)(()=>({runId:e,slots:_o()})),a=t?.state===`terminal`,o=a||r.runId!==e?_o():r.slots;(0,H.useEffect)(()=>{i(n=>{let r=n.runId===e?n.slots:_o(),i=a?_o():bo(r,t?.examples??[]);return n.runId===e&&yo(n.slots,i)?n:{runId:e,slots:i}})},[t?.examples,e,a]);let s=t?.pagesAudited??0,c=o.some(e=>e!=null);return(0,Q.jsxs)(`section`,{"aria-labelledby":`live-page-health-findings-heading`,className:`mt-5 border-t border-default pt-5`,children:[(0,Q.jsx)(`h3`,{id:`live-page-health-findings-heading`,className:`text-heading-16 text-heading`,children:`Findings so far`}),(0,Q.jsxs)(`div`,{className:`relative mt-1 min-h-[5.25rem] text-label-14 text-secondary sm:min-h-[3.5rem]`,children:[(0,Q.jsxs)(`p`,{children:[`Based on `,da.format(s),` audited pages. Results may change until the scan finishes.`]}),(0,Q.jsx)(`p`,{className:D(`absolute bottom-0 text-caution`,n?`visible`:`invisible`),children:`Live findings paused. The scan is still running.`})]}),(0,Q.jsx)(`ul`,{"aria-label":`Live Page Health findings`,className:`mt-3 grid h-[10.5rem] grid-rows-3 divide-y divide-default overflow-hidden material-base`,children:o.map((e,t)=>{let n=e==null&&t===0&&!c;return(0,Q.jsx)(`li`,{"aria-hidden":e==null&&!n||void 0,"data-testid":`live-page-health-slot`,className:`grid h-14 min-h-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-4 sm:gap-4`,children:e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-label-14-strong text-strong`,title:e.url,children:e.url}),(0,Q.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap text-label-14 tabular-nums text-secondary`,children:[(0,Q.jsxs)(`span`,{"aria-hidden":`true`,className:`sm:hidden`,children:[da.format(e.checksNeedingAttention),` checks`]}),(0,Q.jsxs)(`span`,{className:`hidden sm:inline`,children:[da.format(e.checksNeedingAttention),` checks need attention`]}),(0,Q.jsxs)(`span`,{className:`sr-only sm:hidden`,children:[da.format(e.checksNeedingAttention),` checks need attention`]})]})]}):n?(0,Q.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Checks that need attention will appear here.`}):null},`live-page-health-slot-${t}`)})})]})}function So({phase:e,progress:t,onRunAgain:n,pageHealthDestination:r=!1}){let i=e===`cancelled`,a=t?.error??t?.attempt?.error;return(0,Q.jsxs)(`section`,{"aria-label":`Site scan recovery`,role:`alert`,className:`rounded-md border border-negative bg-negative-soft px-5 py-6`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-negative`,children:i?`Scan cancelled`:`Scan failed`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:r?i?`The scan was cancelled before Canonry could publish page health results.`:`The scan did not complete, so page health results are unavailable.`:i?`The scan was cancelled before Canonry could publish a site map.`:`The scan did not complete, so there is no site map for this run.`}),a&&(0,Q.jsx)(`p`,{className:`mt-3 text-copy-14 text-negative`,children:a}),n&&(0,Q.jsx)(k,{type:`button`,className:`mt-4`,onClick:n,children:`Run scan again`})]})}function Co({projectName:e,projectId:t,initialRunId:n,onReleaseInitialRun:r,showOnboardingActions:i=!1,onContinueOnboarding:o,onSkipOnboarding:s}){let c=(0,H.useId)(),[l,u]=(0,H.useState)(`map`),d=(0,H.useRef)([]),[f,p]=(0,H.useState)(()=>n??null),[m,h]=(0,H.useState)(null),g=(0,H.useRef)(n),[v,b]=(0,H.useState)(null),[S,te]=(0,H.useState)(!1),[ne,re]=(0,H.useState)(!1),[ie,ae]=(0,H.useState)(!0),[oe,se]=(0,H.useState)(null),[ce,w]=(0,H.useState)(null),[de,E]=(0,H.useState)(!1),[fe,pe]=(0,H.useState)(`all`),[me,he]=(0,H.useState)(!1),ge=ye(),{isAdmin:_e}=be(),j=ue(),M=(j||T(le[`site-audit`]))&&!_e,N=i&&!ge,P=Qe(),xe=!N&&!ge&&!M,we=C({...je({client:O,path:{name:e}}),enabled:xe,staleTime:Se});(0,H.useEffect)(()=>{let e=g.current;e!==n&&(g.current=n,p(t=>n??(t===e?null:t)),b(null))},[n]);let Oe=C({...Ie({client:O,path:{name:e},query:{limit:na}}),refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.scans.some(e=>e.status===`queued`||e.status===`running`)?3e3:15e3}),Ae=Oe.data?.scans??[],Ne=Ae.find(e=>e.status===`queued`||e.status===`running`),Fe=Ae.find(e=>e.status===`completed`||e.status===`partial`),Le=N?P.data?.runId??null:null,Re=N?null:P.data?.runId??null,ze=Re&&Re!==m&&Ae.some(e=>e.runId===Re&&(e.status===`completed`||e.status===`partial`))?Re:null,L=f??(N?Le??Ne?.runId??Fe?.runId:ze??Oe.data?.preferredRunId??Fe?.runId??Ne?.runId)??null,Be=Ne?.runId===L?Ne:null,R=L?Ae.find(e=>e.runId===L):void 0,Ve=!!(n&&L===n),He=!!(Le&&L===Le),Ue=He&&!R,We=Be?.runId??(Ve||Ue?L:null),z=C({...Me({client:O,path:{name:e,runId:We??``}}),enabled:!!We,refetchInterval:e=>so(e.state.data?.phase)?3e3:!1,refetchIntervalInBackground:!0});(0,H.useEffect)(()=>{Ve&&z.isError&&uo(z.error)===`NOT_FOUND`&&(p(null),b(null),r?.())},[z.error,z.isError,Ve,r]);let Ge=co(z.data?.phase),Ke=lo(z.data?.phase)?null:Be,qe=!!(We&&z.isPending),Je=!(!Ve&&!He||R||!z.isError),Ye=!!(N&&We&&(Ke?.runId===We||Ge)),Xe=C({...Ce({client:O,path:{name:e,runId:We??``}}),enabled:Ye,refetchInterval:e=>e.state.data?.state!==`terminal`&&3e3,refetchIntervalInBackground:!0}),Ze=!!(Ke||Ge||qe||Je),nt=z.data?.phase===`failed`||z.data?.phase===`cancelled`?z.data.phase:(Ve||He)&&(R?.status===`failed`||R?.status===`cancelled`)?R.status:null,rt=C({...F({client:O,path:{name:e},...L?{query:{runId:L}}:{}}),enabled:!Ze}),V=rt.data,ct=L??V?.runId??null,dt=!!(ct&&V?.hasCrawlData&&V.detailsAvailable),pt=dt&&!N,mt=ct?{runId:ct}:{},U=C({...I({client:O,path:{name:e},query:{...mt,maxNodes:sa,maxEdges:ca}}),enabled:pt&&!Ze}),ht=Yi.find(e=>e.id===fe)?.healthState,gt={client:O,path:{name:e},query:{...mt,...ht?{healthState:ht}:{},urlVersions:`exclude`,limit:ra,sort:`path`}},_t=ee({...De(gt),enabled:pt,initialPageParam:gt,getNextPageParam:e=>e.nextCursor?{path:gt.path,query:{...gt.query,cursor:e.nextCursor}}:void 0}),vt=pt&&(V?.deadLinks.state===`complete`||V?.deadLinks.state===`partial`),W=C({...Ee({client:O,path:{name:e},query:{...mt,limit:oa}}),enabled:vt}),G=U.data?.nodes??[],K=U.data?.layout.state===`ready`?U.data.totalEdges:null,yt=U.data?.edges??[],bt=(0,H.useMemo)(()=>yt.filter(e=>e.isTemplate).length,[yt]),xt=yt.length-bt,St=U.data?.templateDetection??null,Ct=St===null||!ve(St),wt=(0,H.useMemo)(()=>me||Ct?yt:yt.filter(e=>!e.isTemplate),[yt,me,Ct]),Tt=U.data?.layout.state===`ready`&&!U.data.layout.templateLinksExcluded,Et=(0,H.useMemo)(()=>_t.data?.pages.flatMap(e=>e.pages)??[],[_t.data]),q=_t.data?.pages[0]?.total??Et.length,J=(0,H.useMemo)(()=>Et.find(e=>e.nodeKey===v)??null,[Et,v]),Y=!!(dt&&v&&!J),Dt=C({...Pe({client:O,path:{name:e},query:{...mt,...ht?{healthState:ht}:{},nodeKey:v??void 0,limit:1}}),enabled:Y}),Ot=J??Dt.data?.pages[0]??null,kt=!!(v&&ht&&Y&&Dt.isSuccess&&Dt.data.healthStateFilter===`applied`&&Dt.data.pages.length===0);(0,H.useEffect)(()=>{kt&&b(null)},[kt]);let At=(0,H.useMemo)(()=>kt?null:G.find(e=>e.nodeKey===v)??Ot,[G,Ot,v,kt]),jt=At?.nodeKey??null;st(e,{view:`site-health`,page:{...ct?{runId:ct}:{},...jt?{nodeKey:jt}:{}}});let Mt=At?Ot?`ready`:Dt.isError?`error`:Y&&Dt.isLoading?`loading`:`ready`:`idle`,Nt=C({...ke({client:O,path:{name:e},query:{...mt,nodeKey:jt??void 0,limit:aa}}),enabled:pt&&!!jt}),Pt=C({...Te({client:O,path:{name:e},query:{...mt,nodeKey:jt??void 0}}),enabled:pt&&!!jt}),Ft=(0,H.useMemo)(()=>{let e=Ae.filter(e=>e.status===`completed`||e.status===`partial`),t=f?Ae.find(e=>e.runId===f):void 0;return t&&!e.some(e=>e.runId===t.runId)?[t,...e]:e},[Ae,f]),It=Ae[0]?.status??null,Lt=ct?R:void 0,Rt=Ke?Ke.status:Ge?z.data?.status??null:nt??V?.runStatus??Lt?.status??null,zt=Rt===`running`?`Scan running`:Rt===`queued`?`Scan queued`:Rt===`partial`?`Partial scan`:Rt===`completed`?`Complete`:Rt===`failed`?`Scan failed`:Rt===`cancelled`?`Scan cancelled`:`No scan`,Bt=W.data,Vt=Bt&&`found`in Bt?Bt:V?.deadLinks&&`found`in V.deadLinks?V.deadLinks:void 0,Ht=Ua(Bt?.state??V?.deadLinks?.state??`unavailable`,Vt?.found,Vt?.unverified),Ut=Ca(V?.requestedRootUrl??null,V?.rootUrl??null),Wt=ft(V?.rootUrl??null),Gt=U.data?.rootNodeKey??null,Kt=C({...Pe({client:O,path:{name:e},query:{...mt,nodeKey:Gt??void 0,limit:1}}),enabled:!!(dt&&Gt)}),qt=(0,H.useMemo)(()=>G.find(e=>e.nodeKey===Gt)??Kt.data?.pages[0]??null,[G,Gt,Kt.data]),Jt=Ne&&Ne.runId!==L?Ne:null,Yt=P.isPending||!!Ke||!!Jt||Ge||qe,Xt=Ze||N&&P.isPending,Zt=R?.status===`queued`||R?.status===`running`,Qt=po({active:N&&Xt&&!!(o&&s)&&!!(Zt||We===L&&Ge),runId:L,createdAt:R?.createdAt}),$t=N&&!L&&!Oe.isSuccess,en=N&&Oe.isSuccess&&Ae.length===0&&!L&&!P.isPending,tn=en&<(e),nn=$t?Oe.isError?`Scan history could not be loaded`:`Checking scan history…`:en?tn?`Site scan skipped`:`No site scan yet`:`Page health results unavailable`,rn=$t?`Scan status is not confirmed. Check scan history before starting a scan.`:en?`No scan has been started for this project. Run a first scan or continue without scanning.`:`This scan did not produce page health results. Run it again to continue setup.`,an=!(!V?.hasCrawlData||Xt||nt),X=N?an?`technical`:`map`:l,on=X===`technical`?`map`:X,sn=e=>{p(e||null),h(Re),b(null)},cn=()=>{(!j&&!T(le[`site-audit`])||_e)&&(p(null),b(null),n&&r?.(),N&&E(!0),P.mutate({projectName:e,projectId:t,body:{checkDeadLinks:N||S,...ne?{includeGeo:!0}:{},...ie?{}:{includeAgentSkills:!1},...N?{maxPages:100}:oe===null?{}:{maxPages:oe},...N||ce===null?{}:{maxDepth:ce}}}))},ln=e=>{let t=G.find(t=>t.path===e||t.path.startsWith(`${e}/`));t&&b(t.nodeKey)},un=e=>u(e),dn=(e,t)=>{let n=null;e.key===`ArrowRight`||e.key===`ArrowDown`?n=(t+1)%qi.length:e.key===`ArrowLeft`||e.key===`ArrowUp`?n=(t-1+qi.length)%qi.length:e.key===`Home`?n=0:e.key===`End`&&(n=qi.length-1),n!=null&&(e.preventDefault(),un(qi[n].id),d.current[n]?.focus())};return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[N?(0,Q.jsx)(it,{current:an?`fixes`:`site`}):null,!N&&(0,Q.jsxs)(`header`,{className:`flex flex-col justify-between gap-4 lg:flex-row lg:items-start`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-20 text-heading`,children:`Site Health`}),(0,Q.jsx)(B,{text:Ji[X]}),(0,Q.jsx)(A,{tone:wa(Rt),children:zt}),Lt&&(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:ma(Lt.finishedAt??Lt.startedAt)})]})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1 text-label-12 text-muted`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:c,children:`Scan history`}),(0,Q.jsx)(B,{text:Ea,placement:`bottom`})]}),(0,Q.jsxs)(`select`,{id:c,"aria-label":`View a Site Health scan`,value:f??ze??``,onChange:e=>sn(e.target.value),className:`h-9 min-w-48 rounded-md border border-base bg-bg px-3 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:Ta}),Ft.map(e=>(0,Q.jsx)(`option`,{value:e.runId,children:Da(e)},e.runId))]})]}),!ge&&!M&&(0,Q.jsxs)(`div`,{className:`flex items-end gap-2 pt-5`,children:[(0,Q.jsxs)(`details`,{className:`group relative`,children:[(0,Q.jsxs)(`summary`,{className:`flex h-9 cursor-pointer list-none items-center gap-2 rounded-md border border-base bg-bg px-3 text-label-14-strong text-heading outline-none hover:bg-bg-elevated focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,Q.jsx)(_,{className:`size-4`,"aria-hidden":`true`}),`Scan settings`]}),(0,Q.jsxs)(`div`,{className:`absolute left-0 z-20 mt-2 w-72 material-menu p-4 sm:left-auto sm:right-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Check dead links`,(0,Q.jsx)(B,{text:`Adds dead-link analysis to this scan. Slower on a large site.`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Check dead links`,checked:S,disabled:Yt,onChange:e=>te(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Geographic signals`,(0,Q.jsx)(B,{text:qr[`geographic-signals`],placement:`bottom`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Geographic signals`,checked:ne,disabled:Yt,onChange:e=>re(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Agent integrations`,(0,Q.jsx)(B,{text:qr[`agent-skill-exposure`],placement:`bottom`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Agent integrations`,checked:ie,disabled:Yt,onChange:e=>ae(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong text-heading`,children:[`Page budget`,(0,Q.jsx)(B,{text:tt,placement:`bottom`})]}),(0,Q.jsxs)(`select`,{"aria-label":`Page budget`,value:oe===null?``:String(oe),disabled:Yt,onChange:e=>se(e.target.value===``?null:Number(e.target.value)),className:`mt-1 h-9 w-full rounded-md border border-base bg-bg px-2 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:at(we.data)}),[...ot(we.data)?[ot(we.data)]:[],...ka].map(e=>(0,Q.jsx)(`option`,{value:String(e.value),children:e.label},e.value))]})]}),(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong text-heading`,children:[`Crawl depth`,(0,Q.jsx)(B,{text:`How far from the home page to follow links. A smaller scan is what fixes a scan that ran out of time.`})]}),(0,Q.jsx)(`select`,{"aria-label":`Crawl depth`,value:ce===null?``:String(ce),disabled:Yt,onChange:e=>w(e.target.value===``?null:Number(e.target.value)),className:`mt-1 h-9 w-full rounded-md border border-base bg-bg px-2 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:Aa.map(e=>(0,Q.jsx)(`option`,{value:e.value===null?``:String(e.value),children:e.label},String(e.value)))})]})]})]}),(0,Q.jsxs)(ut,{onClick:cn,disabled:Yt,children:[Yt?(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),Ne?.status===`running`?`Scan running`:Ne?.status===`queued`?`Scan queued`:`Run scan`]})]})]})]}),M&&(0,Q.jsx)($e,{projectName:e,kind:le[`site-audit`],loadSchedule:!j}),V?.hasCrawlData&&X!==`technical`&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Pages found`,(0,Q.jsx)(B,{text:xa(`pagesFound`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesDiscovered)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Pages checked`,(0,Q.jsx)(B,{text:xa(`pagesChecked`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesFetched)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`div`,{className:`text-label-12 text-muted`,title:wr(`eligible`),children:`Indexable`}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesEligible)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Internal links`,(0,Q.jsx)(B,{text:xa(`internalLinks`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(K)})]})]}),!N&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-default`,children:[(0,Q.jsx)(`div`,{role:`tablist`,"aria-label":`Site Health views`,"aria-orientation":`horizontal`,className:`flex min-w-0 gap-5`,children:qi.map((e,t)=>(0,Q.jsx)(`button`,{type:`button`,role:`tab`,id:`site-health-${e.id}-tab`,"aria-selected":X===e.id,"aria-controls":`site-health-${e.id}-panel`,tabIndex:X===e.id?0:-1,ref:e=>{d.current[t]=e},onClick:()=>un(e.id),onKeyDown:e=>dn(e,t),className:`min-h-11 border-b-2 px-0.5 text-button-14 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-mono-400 disabled:cursor-not-allowed disabled:opacity-50 ${X===e.id?`border-strong text-heading`:`border-transparent text-secondary hover:border-base hover:text-primary`}`,children:e.label},e.id))}),V?.hasCrawlData&&X!==`technical`&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 pb-2`,children:[(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Dead-link check`}),(0,Q.jsx)(A,{tone:Ht.tone,children:Ht.label})]})]}),!f&&Ne&&!Ke&&(0,Q.jsx)(`div`,{className:`rounded-md border border-caution bg-caution-soft px-4 py-3 text-label-14 text-caution`,role:`status`,children:`A newer scan is running. The latest published result remains available until it finishes.`}),Ut&&(0,Q.jsxs)(`div`,{className:`material-base px-4 py-3 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:`Site address changed during this scan.`}),` `,`The scan started at `,(0,Q.jsx)(`span`,{className:`font-mono text-primary`,children:Ut.requested}),` and continued at`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-primary`,children:Ut.effective}),`.`,` `,N?`Page health uses the new address.`:`The map and inventory use the new address.`]}),V?.hasCrawlData&&!V.complete&&(0,Q.jsxs)(`div`,{className:`rounded-md border border-caution bg-caution-soft px-4 py-3 text-label-14 text-caution`,role:`status`,children:[Na(V.termination),` `,!ge&&!M?Ma(V.termination,N):null]}),!Ne&&It===`failed`&&!f&&(0,Q.jsxs)(`div`,{className:`flex gap-3 rounded-md border border-negative bg-negative-soft px-4 py-3 text-label-14 text-negative`,role:`alert`,children:[(0,Q.jsx)(y,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{children:`The latest scan failed. The previous completed results remain available.`})]}),nt?(0,Q.jsx)(ho,{view:on,tabbed:!N,children:(0,Q.jsx)(So,{phase:nt,progress:z.data,onRunAgain:M?void 0:cn,pageHealthDestination:N})}):Xt?(0,Q.jsx)(ho,{view:on,tabbed:!N,children:(0,Q.jsx)(go,{status:z.data?.phase??(Ke?.status===`running`?`running`:`queued`),progress:z.data,progressError:z.isError,onRetryProgress:()=>{z.refetch()},pageHealthDestination:N,firstLook:N,boundedPageLimit:N&&de?100:void 0,livePageHealthPreview:Xe.data,livePageHealthError:Xe.isError,livePageHealthRunId:We,continuation:Qt?(0,Q.jsx)(mo,{onContinueOnboarding:o,onSkipOnboarding:s}):null})}):X===`technical`?(0,Q.jsxs)(`div`,{id:`site-health-technical-panel`,role:N?void 0:`tabpanel`,"aria-labelledby":N?void 0:`site-health-technical-tab`,className:`min-w-0 space-y-6`,children:[N?(0,Q.jsx)(`h2`,{className:`text-heading-20 text-heading`,children:`Page health`}):null,(0,Q.jsx)(Wi,{projectName:e,projectId:t,runId:ct,integrated:!0,compactCopy:N,afterSummary:N&&an?(0,Q.jsxs)(`section`,{"aria-labelledby":`ai-visibility-next-heading`,className:`flex flex-col gap-3 border-b border-default py-5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{id:`ai-visibility-next-heading`,className:`text-heading-16 text-heading`,children:`Next: Set up AI Visibility`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`See whether answer engines mention your brand and cite your pages.`})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsx)(k,{type:`button`,onClick:o,children:`Set up AI Visibility`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,onClick:s,children:`Skip for now`})]})]}):void 0,unavailableFooter:N&&an&&!M?(0,Q.jsx)(`section`,{"aria-label":`Page health recovery`,className:`mt-4`,children:(0,Q.jsx)(k,{type:`button`,disabled:Yt,onClick:()=>{u(`map`),cn()},children:`Run site audit again`})}):void 0})]}):rt.isLoading?(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`div`,{className:`flex min-h-72 items-center justify-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading site health...`]})}):rt.error?(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`rounded-md border border-negative bg-negative-soft px-5 py-6`,role:`alert`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-14 text-negative`,children:`Site Health could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-negative`,children:`Try loading the crawl again.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:()=>void rt.refetch(),children:`Try again`})]})}):V?.hasCrawlData?V.detailsAvailable?X===`inventory`?(0,Q.jsxs)(`div`,{id:`site-health-inventory-panel`,role:`tabpanel`,"aria-labelledby":`site-health-inventory-tab`,className:`space-y-5`,children:[_t.isLoading?(0,Q.jsxs)(`div`,{className:`flex min-h-56 items-center justify-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page inventory...`]}):_t.error?(0,Q.jsx)(`p`,{className:`rounded-md border border-negative bg-negative-soft px-4 py-3 text-copy-14 text-negative`,role:`alert`,children:`The page inventory could not be loaded.`}):(0,Q.jsx)(Qa,{pages:Et,total:q,skippedUrlVersions:Zi(_t.data?.pages[0]?.inventorySummary),rootHost:Wt,filterUnavailable:_t.data?.pages[0]?.healthStateFilter===`unavailable-legacy-scan`,selectedNodeKey:jt,onSelect:b,hasNextPage:!!_t.hasNextPage,isFetchingNextPage:_t.isFetchingNextPage,onLoadMore:()=>void _t.fetchNextPage(),filter:fe,onFilterChange:pe}),(0,Q.jsx)(Za,{page:At,isLoading:Nt.isLoading&&!!At,error:Nt.error,inbound:Nt.data?.inbound??[],outbound:Nt.data?.outbound??[],inboundTruncated:Nt.data?.inboundTruncated??!1,outboundTruncated:Nt.data?.outboundTruncated??!1,audit:Pt.data,auditLoading:Pt.isLoading&&!!At,auditError:Pt.error,onRetryAudit:()=>{Pt.refetch()},rootHost:Wt,reasonSource:Ot,reasonsState:Mt,onRetryReasons:()=>{Dt.refetch()},showTemplateLinks:me||Ct})]}):(0,Q.jsxs)(`div`,{id:`site-health-map-panel`,role:`tabpanel`,"aria-labelledby":`site-health-map-tab`,className:`space-y-5`,children:[(0,Q.jsxs)(`section`,{"aria-labelledby":`site-map-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col justify-between gap-2 sm:flex-row sm:items-end`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`h2`,{id:`site-map-heading`,className:`text-heading-16 text-heading`,children:`Site map`}),(0,Q.jsx)(B,{text:La})]})}),U.data?.sampled&&(0,Q.jsxs)(`span`,{className:`text-label-12 text-muted`,children:[`Showing `,$(U.data.nodes.length),` of `,$(U.data.totalNodes),` pages`,` · `,$(U.data.edges.length),` of `,$(U.data.totalEdges),` links`]})]}),U.data?.layout.state===`ready`&&yt.length>0&&(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col gap-1.5 material-base px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-copy-14 text-secondary`,"data-testid":`site-map-link-counts`,children:[Ba({filterUnavailable:Ct,showTemplateLinks:me,contentEdgeCount:xt,templateEdgeCount:bt,totalEdgeCount:yt.length}),(0,Q.jsx)(B,{text:Ha(St,{staleLayout:Tt&&!Ct})})]}),(0,Q.jsxs)(`label`,{className:D(`flex shrink-0 items-center gap-2 text-label-14`,Ct?`cursor-not-allowed text-muted`:`cursor-pointer text-heading`),title:Ct?Ia(St):`Menu and footer links are drawn on top. Pages do not move, because the map was laid out from the links in your page text.`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:me&&!Ct,disabled:Ct,onChange:e=>he(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`}),`Show menu and footer links`]})]}),(0,Q.jsxs)(`div`,{id:`site-health-map-explorer`,className:`grid gap-4 lg:grid-cols-[minmax(14rem,18rem)_minmax(0,1fr)]`,children:[(0,Q.jsxs)(`aside`,{className:`material-base`,"aria-labelledby":`site-sections-heading`,children:[(0,Q.jsxs)(`div`,{className:`border-b border-default px-4 py-3`,children:[(0,Q.jsx)(`h3`,{id:`site-sections-heading`,className:`text-heading-14 text-heading`,children:`Site sections`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13 text-muted`,children:`Folders in this scan`})]}),(0,Q.jsx)(`div`,{className:`max-h-[468px] overflow-auto`,children:ct&&(0,Q.jsx)(to,{projectName:e,runId:ct,parentPath:`/`,onSelect:ln,rootPage:qt,onSelectRootPage:b})})]}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:U.isLoading?(0,Q.jsx)(no,{}):U.error?(0,Q.jsx)(`div`,{className:`flex min-h-[420px] items-center justify-center rounded-md border border-negative bg-negative-soft px-6 text-center lg:min-h-[520px]`,role:`alert`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-negative`,children:`The interactive map could not be loaded.`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`The page inventory and technical findings remain available.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:()=>u(`inventory`),children:`Open page inventory`})]})}):(0,Q.jsx)(Kr,{nodes:U.data?.nodes??[],edges:yt,showTemplateLinks:me||Ct,layoutState:U.data?.layout.state??`unavailable`,layoutUnavailableReason:U.data?.layout.state===`unavailable`?U.data.layout.reason:null,rootNodeKey:U.data?.rootNodeKey??null,selectedNodeKey:jt,onSelectNode:e=>b(e.nodeKey),onOpenInventory:()=>u(`inventory`),ariaLabel:`Interactive site map showing ${$(U.data?.nodes.length??0)} pages and ${$(wt.length)} internal links`})})]})]}),(0,Q.jsx)(Za,{page:At,isLoading:Nt.isLoading&&!!At,error:Nt.error,inbound:Nt.data?.inbound??[],outbound:Nt.data?.outbound??[],inboundTruncated:Nt.data?.inboundTruncated??!1,outboundTruncated:Nt.data?.outboundTruncated??!1,audit:Pt.data,auditLoading:Pt.isLoading&&!!At,auditError:Pt.error,onRetryAudit:()=>{Pt.refetch()},rootHost:Wt,reasonSource:Ot,reasonsState:Mt,onRetryReasons:()=>{Dt.refetch()},showTemplateLinks:me||Ct})]}):(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`rounded-md border border-caution bg-caution-soft px-5 py-6`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-14 text-caution`,children:N?`Page health results unavailable`:`Page details unavailable`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-caution`,children:M&&N?`This scan did not publish page-level results.`:N?`This scan did not publish page-level results. Run it again to continue setup.`:`Summary metrics are preserved for this scan, but its page graph cannot be opened.`}),N&&!M?(0,Q.jsx)(k,{type:`button`,size:`sm`,className:`mt-4`,onClick:cn,children:`Run scan again`}):null]})}):(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`material-base px-5 py-8 text-center`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:N?nn:`Full-site map not available`}),(0,Q.jsx)(`p`,{className:`mx-auto mt-2 max-w-xl text-copy-14 text-secondary`,children:M?et:N?rn:V?.legacyAuditAvailable?`Existing page health results are preserved. Run a new scan to build the page and internal-link map.`:ge?`A full-site scan has not been run for this project.`:`Run a scan to discover pages, site sections, and internal links.`}),N&&!$t?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:[`First scan: up to `,100,` pages.`]}):null,(V?.legacyAuditAvailable||N)&&(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-center gap-2`,children:[V?.legacyAuditAvailable&&!N&&(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,onClick:()=>u(`technical`),children:`View page health`}),$t&&Oe.isError?(0,Q.jsx)(k,{type:`button`,size:`sm`,onClick:()=>{Oe.refetch()},children:`Retry scan history`}):null,N&&!$t&&!M&&(0,Q.jsx)(k,{type:`button`,size:`sm`,disabled:Yt,onClick:cn,children:en?`Run first scan`:`Run scan again`}),N&&o?(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:o,children:$t?`Continue setup`:`Continue without scanning`}):null,N&&s?(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:s,children:`Skip for now`}):null]})]})})]})}export{xi as a,wi as c,ii as d,ni as f,gt as h,mi as i,si as l,Z as m,Ki as n,Si as o,ai as p,ki as r,Ci as s,Co as t,oi as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./react-sigma_core.esm.min-BoCIEnkF.js","./rolldown-runtime-XKyaHtl9.js","./vendor-lucide-Bo69m9KC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{A as r,C as i,F as a,J as o,N as s,V as c,X as l,Y as u,Z as d,b as f,ct as p,g as m,h,n as g,p as _,rt as v,s as y,st as b,w as x}from"./vendor-lucide-Bo69m9KC.js";import{r as S}from"./vendor-markdown-BiRP51B0.js";import{b as C,g as ee}from"./vendor-tanstack-tBjrfzKu.js";import{c as te,f as ne,i as re,m as ie,r as ae,s as oe,t as se}from"./vendor-recharts-CY6tH-r6.js";import{An as ce,Di as le,Hi as w,St as T,Tt as ue,_i as de,bi as E,ci as fe,hi as pe,i as D,li as me,lr as he,mi as ge,mt as O,qi as _e,r as k,t as A,vi as j,wi as ve,wn as M,wt as ye,xi as N,yi as P}from"./ToneBadge-B3rD6bDF.js";import{r as be}from"./account-context-GstYbqpX.js";import{d as xe,o as Se}from"./query-client-DjRrRIsq.js";import{$t as Ce,Et as we,Gt as Te,Jt as Ee,Kt as De,Qt as Oe,Wt as F,Xt as ke,Yt as I,Zt as Ae,_t as je,en as Me,nn as Ne,qt as Pe,rn as Fe,tn as Ie,un as Le}from"./react-query-B8JD_K7g.js";import{a as Re,d as ze,f as L,g as Be,h as R,i as Ve,l as He,m as Ue,n as We,o as z,p as Ge,r as Ke,s as qe,t as Je,u as Ye}from"./ChartPrimitives-Cs2iavxU.js";import{t as B}from"./InfoTooltip-CNLlIWeP.js";import{t as Xe}from"./card-CgdGerYK.js";import{H as Ze,S as Qe,V as $e,W as et,d as tt,f as nt,g as rt,m as it,mn as at,p as ot,rn as st,t as V,tn as ct,w as lt,z as ut}from"./index-DdG9gR0r.js";var H=t(p(),1),dt=/^www\./i;function ft(e){if(!e)return null;try{return new URL(e).hostname}catch{return null}}function pt(e){return e.trim().toLowerCase().replace(dt,``)}function mt(e,t){if(!t)return!1;try{return pt(new URL(e).hostname)===pt(t)}catch{return!1}}function U(e,t){if(!e)return``;if(!mt(e,t))return e;let n=new URL(e),r=`${n.pathname}${n.search}${n.hash}`;return r===``?`/`:r}function ht(e,t){return U(e.url,t)||e.path||`/`}var gt=n(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),_t=gt();function vt(){let e=arguments[0];for(let t=1,n=arguments.length;t<n;t++)if(arguments[t])for(let n in arguments[t])e[n]=arguments[t][n];return e}var W=vt;typeof Object.assign==`function`&&(W=Object.assign);function G(e,t,n,r){let i=e._nodes.get(t),a=null;return i&&(a=r===`mixed`?i.out&&i.out[n]||i.undirected&&i.undirected[n]:r===`directed`?i.out&&i.out[n]:i.undirected&&i.undirected[n]),a}function K(e){return typeof e==`object`&&!!e}function yt(e){let t;for(t in e)return!1;return!0}function bt(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function xt(e,t,n){let r={enumerable:!0,configurable:!0};typeof n==`function`?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function St(e){return!(!K(e)||e.attributes&&!Array.isArray(e.attributes))}function Ct(){let e=Math.floor(Math.random()*256)&255;return()=>e++}function wt(){let e=arguments,t=null,n=-1;return{[Symbol.iterator](){return this},next(){let r=null;do{if(t===null){if(n++,n>=e.length)return{done:!0};t=e[n][Symbol.iterator]()}if(r=t.next(),r.done)t=null;else break}while(1);return r}}}function Tt(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}var Et=class extends Error{constructor(e){super(),this.name=`GraphError`,this.message=e}},q=class e extends Et{constructor(t){super(t),this.name=`InvalidArgumentsGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},J=class e extends Et{constructor(t){super(t),this.name=`NotFoundGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}},Y=class e extends Et{constructor(t){super(t),this.name=`UsageGraphError`,typeof Error.captureStackTrace==`function`&&Error.captureStackTrace(this,e.prototype.constructor)}};function Dt(e,t){this.key=e,this.attributes=t,this.clear()}Dt.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ot(e,t){this.key=e,this.attributes=t,this.clear()}Ot.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function kt(e,t){this.key=e,this.attributes=t,this.clear()}kt.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function At(e,t,n,r,i){this.key=t,this.attributes=i,this.undirected=e,this.source=n,this.target=r}At.prototype.attach=function(){let e=`out`,t=`in`;this.undirected&&(e=t=`undirected`);let n=this.source.key,r=this.target.key;this.source[e][r]=this,!(this.undirected&&n===r)&&(this.target[t][n]=this)},At.prototype.attachMulti=function(){let e=`out`,t=`in`,n=this.source.key,r=this.target.key;this.undirected&&(e=t=`undirected`);let i=this.source[e],a=i[r];a===void 0?(i[r]=this,this.undirected&&n===r||(this.target[t][n]=this)):(a.previous=this,this.next=a,i[r]=this,this.target[t][n]=this)},At.prototype.detach=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),delete this.source[n][t],delete this.target[r][e]},At.prototype.detachMulti=function(){let e=this.source.key,t=this.target.key,n=`out`,r=`in`;this.undirected&&(n=r=`undirected`),this.previous===void 0?this.next===void 0?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};var jt=0,Mt=1,Nt=2,Pt=3;function Ft(e,t,n,r,i,a,o){let s,c,l,u;if(r=``+r,n===jt){if(s=e._nodes.get(r),!s)throw new J(`Graph.${t}: could not find the "${r}" node in the graph.`);l=i,u=a}else if(n===Pt){if(i=``+i,c=e._edges.get(i),!c)throw new J(`Graph.${t}: could not find the "${i}" edge in the graph.`);let n=c.source.key,d=c.target.key;if(r===n)s=c.target;else if(r===d)s=c.source;else throw new J(`Graph.${t}: the "${r}" node is not attached to the "${i}" edge (${n}, ${d}).`);l=a,u=o}else{if(c=e._edges.get(r),!c)throw new J(`Graph.${t}: could not find the "${r}" edge in the graph.`);s=n===Mt?c.source:c.target,l=i,u=a}return[s,l,u]}function It(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return a.attributes[o]}}function Lt(e,t,n){e.prototype[t]=function(e,r){let[i]=Ft(this,t,n,e,r);return i.attributes}}function Rt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return a.attributes.hasOwnProperty(o)}}function zt(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Ft(this,t,n,e,r,i,a);return o.attributes[s]=c,this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Bt(e,t,n){e.prototype[t]=function(e,r,i,a){let[o,s,c]=Ft(this,t,n,e,r,i,a);if(typeof c!=`function`)throw new q(`Graph.${t}: updater should be a function.`);let l=o.attributes;return l[s]=c(l[s]),this.emit(`nodeAttributesUpdated`,{key:o.key,type:`set`,attributes:o.attributes,name:s}),this}}function Vt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);return delete a.attributes[o],this.emit(`nodeAttributesUpdated`,{key:a.key,type:`remove`,attributes:a.attributes,name:o}),this}}function Ht(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(!K(o))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return a.attributes=o,this.emit(`nodeAttributesUpdated`,{key:a.key,type:`replace`,attributes:a.attributes}),this}}function Ut(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(!K(o))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return W(a.attributes,o),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`merge`,attributes:a.attributes,data:o}),this}}function Wt(e,t,n){e.prototype[t]=function(e,r,i){let[a,o]=Ft(this,t,n,e,r,i);if(typeof o!=`function`)throw new q(`Graph.${t}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit(`nodeAttributesUpdated`,{key:a.key,type:`update`,attributes:a.attributes}),this}}var Gt=[{name:e=>`get${e}Attribute`,attacher:It},{name:e=>`get${e}Attributes`,attacher:Lt},{name:e=>`has${e}Attribute`,attacher:Rt},{name:e=>`set${e}Attribute`,attacher:zt},{name:e=>`update${e}Attribute`,attacher:Bt},{name:e=>`remove${e}Attribute`,attacher:Vt},{name:e=>`replace${e}Attributes`,attacher:Ht},{name:e=>`merge${e}Attributes`,attacher:Ut},{name:e=>`update${e}Attributes`,attacher:Wt}];function Kt(e){Gt.forEach(function({name:t,attacher:n}){n(e,t(`Node`),jt),n(e,t(`Source`),Mt),n(e,t(`Target`),Nt),n(e,t(`Opposite`),Pt)})}function qt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes[r]}}function Jt(e,t,n){e.prototype[t]=function(e){let r;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let i=``+e,a=``+arguments[1];if(r=G(this,i,a,n),!r)throw new J(`Graph.${t}: could not find an edge for the given path ("${i}" - "${a}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,r=this._edges.get(e),!r)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Yt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return i.attributes.hasOwnProperty(r)}}function Xt(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=G(this,o,s,n),!a)throw new J(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]=i,this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Zt(e,t,n){e.prototype[t]=function(e,r,i){let a;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let o=``+e,s=``+r;if(r=arguments[2],i=arguments[3],a=G(this,o,s,n),!a)throw new J(`Graph.${t}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,a=this._edges.get(e),!a)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof i!=`function`)throw new q(`Graph.${t}: updater should be a function.`);return a.attributes[r]=i(a.attributes[r]),this.emit(`edgeAttributesUpdated`,{key:a.key,type:`set`,attributes:a.attributes,name:r}),this}}function Qt(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}return delete i.attributes[r],this.emit(`edgeAttributesUpdated`,{key:i.key,type:`remove`,attributes:i.attributes,name:r}),this}}function $t(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!K(r))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return i.attributes=r,this.emit(`edgeAttributesUpdated`,{key:i.key,type:`replace`,attributes:i.attributes}),this}}function en(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(!K(r))throw new q(`Graph.${t}: provided attributes are not a plain object.`);return W(i.attributes,r),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`merge`,attributes:i.attributes,data:r}),this}}function tn(e,t,n){e.prototype[t]=function(e,r){let i;if(this.type!==`mixed`&&n!==`mixed`&&n!==this.type)throw new Y(`Graph.${t}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Y(`Graph.${t}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);let a=``+e,o=``+r;if(r=arguments[2],i=G(this,a,o,n),!i)throw new J(`Graph.${t}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!==`mixed`)throw new Y(`Graph.${t}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=``+e,i=this._edges.get(e),!i)throw new J(`Graph.${t}: could not find the "${e}" edge in the graph.`)}if(typeof r!=`function`)throw new q(`Graph.${t}: provided updater is not a function.`);return i.attributes=r(i.attributes),this.emit(`edgeAttributesUpdated`,{key:i.key,type:`update`,attributes:i.attributes}),this}}var nn=[{name:e=>`get${e}Attribute`,attacher:qt},{name:e=>`get${e}Attributes`,attacher:Jt},{name:e=>`has${e}Attribute`,attacher:Yt},{name:e=>`set${e}Attribute`,attacher:Xt},{name:e=>`update${e}Attribute`,attacher:Zt},{name:e=>`remove${e}Attribute`,attacher:Qt},{name:e=>`replace${e}Attributes`,attacher:$t},{name:e=>`merge${e}Attributes`,attacher:en},{name:e=>`update${e}Attributes`,attacher:tn}];function rn(e){nn.forEach(function({name:t,attacher:n}){n(e,t(`Edge`),`mixed`),n(e,t(`DirectedEdge`),`directed`),n(e,t(`UndirectedEdge`),`undirected`)})}var an=[{name:`edges`,type:`mixed`},{name:`inEdges`,type:`directed`,direction:`in`},{name:`outEdges`,type:`directed`,direction:`out`},{name:`inboundEdges`,type:`mixed`,direction:`in`},{name:`outboundEdges`,type:`mixed`,direction:`out`},{name:`directedEdges`,type:`directed`},{name:`undirectedEdges`,type:`undirected`}];function X(e,t,n,r){let i=!1;for(let a in t){if(a===r)continue;let o=t[a];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&i)return o.key}}function on(e,t,n,r){let i,a,o,s=!1;for(let c in t)if(c!==r){i=t[c];do{if(a=i.source,o=i.target,s=n(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected),e&&s)return i.key;i=i.next}while(i!==void 0)}}function sn(e,t){let n=Object.keys(e),r=n.length,i,a=0;return{[Symbol.iterator](){return this},next(){do if(i)i=i.next;else{if(a>=r)return{done:!0};let o=n[a++];if(o===t){i=void 0;continue}i=e[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}}}}function cn(e,t,n,r){let i=t[n];if(!i)return;let a=i.source,o=i.target;if(r(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected)&&e)return i.key}function ln(e,t,n,r){let i=t[n];if(!i)return;let a=!1;do{if(a=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&a)return i.key;i=i.next}while(i!==void 0)}function un(e,t){let n=e[t];if(n.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!n)return{done:!0};let e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}}};let r=!1;return{[Symbol.iterator](){return this},next(){return r===!0?{done:!0}:(r=!0,{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}})}}}function dn(e,t){if(e.size===0)return[];if(t===`mixed`||t===e.type)return Array.from(e._edges.keys());let n=t===`undirected`?e.undirectedSize:e.directedSize,r=Array(n),i=t===`undirected`,a=e._edges.values(),o=0,s,c;for(;s=a.next(),s.done!==!0;)c=s.value,c.undirected===i&&(r[o++]=c.key);return r}function fn(e,t,n,r){if(t.size===0)return;let i=n!==`mixed`&&n!==t.type,a=n===`undirected`,o,s,c=!1,l=t._edges.values();for(;o=l.next(),o.done!==!0;){if(s=o.value,i&&s.undirected!==a)continue;let{key:t,attributes:n,source:l,target:u}=s;if(c=r(t,n,l.key,u.key,l.attributes,u.attributes,s.undirected),e&&c)return t}}function pn(e,t){if(e.size===0)return Tt();let n=t!==`mixed`&&t!==e.type,r=t===`undirected`,i=e._edges.values();return{[Symbol.iterator](){return this},next(){let e,t;for(;;){if(e=i.next(),e.done)return e;if(t=e.value,!(n&&t.undirected!==r))break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}}}function mn(e,t,n,r,i,a){let o=t?on:X,s;if(n!==`undirected`&&(r!==`out`&&(s=o(e,i.in,a),e&&s)||r!==`in`&&(s=o(e,i.out,a,r?void 0:i.key),e&&s))||n!==`directed`&&(s=o(e,i.undirected,a),e&&s))return s}function hn(e,t,n,r){let i=[];return mn(!1,e,t,n,r,function(e){i.push(e)}),i}function gn(e,t,n){let r=Tt();return e!==`undirected`&&(t!==`out`&&n.in!==void 0&&(r=wt(r,sn(n.in))),t!==`in`&&n.out!==void 0&&(r=wt(r,sn(n.out,t?void 0:n.key)))),e!==`directed`&&n.undirected!==void 0&&(r=wt(r,sn(n.undirected))),r}function _n(e,t,n,r,i,a,o){let s=n?ln:cn,c;if(t!==`undirected`&&(i.in!==void 0&&r!==`out`&&(c=s(e,i.in,a,o),e&&c)||i.out!==void 0&&r!==`in`&&(r||i.key!==a)&&(c=s(e,i.out,a,o),e&&c))||t!==`directed`&&i.undirected!==void 0&&(c=s(e,i.undirected,a,o),e&&c))return c}function vn(e,t,n,r,i){let a=[];return _n(!1,e,t,n,r,i,function(e){a.push(e)}),a}function yn(e,t,n,r){let i=Tt();return e!==`undirected`&&(n.in!==void 0&&t!==`out`&&r in n.in&&(i=wt(i,un(n.in,r))),n.out!==void 0&&t!==`in`&&r in n.out&&(t||n.key!==r)&&(i=wt(i,un(n.out,r)))),e!==`directed`&&n.undirected!==void 0&&r in n.undirected&&(i=wt(i,un(n.undirected,r))),i}function bn(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];if(!arguments.length)return dn(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${n}: could not find the "${e}" node in the graph.`);return hn(this.multi,r===`mixed`?this.type:r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let a=this._nodes.get(e);if(!a)throw new J(`Graph.${n}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${n}: could not find the "${t}" target node in the graph.`);return vn(r,this.multi,i,a,t)}throw new q(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function xn(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r===`mixed`||this.type===`mixed`||r===this.type){if(arguments.length===1)return n=e,fn(!1,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return mn(!1,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return _n(!1,r,this.multi,i,o,t,n)}throw new q(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n;if(e.length===0){let i=0;r!==`directed`&&(i+=this.undirectedSize),r!==`undirected`&&(i+=this.directedSize),n=Array(i);let a=0;e.push((e,r,i,o,s,c,l)=>{n[a++]=t(e,r,i,o,s,c,l)})}else n=[],e.push((e,r,i,a,o,s,c)=>{n.push(t(e,r,i,a,o,s,c))});return this[a].apply(this,e),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((e,r,i,a,o,s,c)=>{t(e,r,i,a,o,s,c)&&n.push(e)}),this[a].apply(this,e),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){let e=Array.prototype.slice.call(arguments);if(e.length<2||e.length>4)throw new q(`Graph.${c}: invalid number of arguments (expecting 2, 3 or 4 and got ${e.length}).`);if(typeof e[e.length-1]==`function`&&typeof e[e.length-2]!=`function`)throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let t,n;e.length===2?(t=e[0],n=e[1],e=[]):e.length===3?(t=e[1],n=e[2],e=[e[0]]):e.length===4&&(t=e[2],n=e[3],e=[e[0],e[1]]);let r=n;return e.push((e,n,i,a,o,s,c)=>{r=t(r,e,n,i,a,o,s,c)}),this[a].apply(this,e),r}}function Sn(e,t){let{name:n,type:r,direction:i}=t,a=`find`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t,n){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return!1;if(arguments.length===1)return n=e,fn(!0,this,r,n);if(arguments.length===2){e=``+e,n=t;let o=this._nodes.get(e);if(o===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return mn(!0,this.multi,r===`mixed`?this.type:r,i,o,n)}if(arguments.length===3){e=``+e,t=``+t;let o=this._nodes.get(e);if(!o)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return _n(!0,r,this.multi,i,o,t,n)}throw new q(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};let o=`some`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>t(e,n,r,i,a,o,s)),!!this[a].apply(this,e)};let s=`every`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=function(){let e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((e,n,r,i,a,o,s)=>!t(e,n,r,i,a,o,s)),!this[a].apply(this,e)}}function Cn(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Tt();if(!arguments.length)return pn(this,r);if(arguments.length===1){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return gn(r,i,t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.${a}: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.${a}: could not find the "${t}" target node in the graph.`);return yn(r,i,n,t)}throw new q(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function wn(e){an.forEach(t=>{bn(e,t),xn(e,t),Sn(e,t),Cn(e,t)})}var Tn=[{name:`neighbors`,type:`mixed`},{name:`inNeighbors`,type:`directed`,direction:`in`},{name:`outNeighbors`,type:`directed`,direction:`out`},{name:`inboundNeighbors`,type:`mixed`,direction:`in`},{name:`outboundNeighbors`,type:`mixed`,direction:`out`},{name:`directedNeighbors`,type:`directed`},{name:`undirectedNeighbors`,type:`undirected`}];function En(){this.A=null,this.B=null}En.prototype.wrap=function(e){this.A===null?this.A=e:this.B===null&&(this.B=e)},En.prototype.has=function(e){return this.A!==null&&e in this.A||this.B!==null&&e in this.B};function Dn(e,t,n,r,i){for(let a in r){let o=r[a],s=o.source,c=o.target,l=s===n?c:s;if(t&&t.has(l.key))continue;let u=i(l.key,l.attributes);if(e&&u)return l.key}}function On(e,t,n,r,i){if(t!==`mixed`){if(t===`undirected`)return Dn(e,null,r,r.undirected,i);if(typeof n==`string`)return Dn(e,null,r,r[n],i)}let a=new En,o;if(t!==`undirected`){if(n!==`out`){if(o=Dn(e,null,r,r.in,i),e&&o)return o;a.wrap(r.in)}if(n!==`in`){if(o=Dn(e,a,r,r.out,i),e&&o)return o;a.wrap(r.out)}}if(t!==`directed`&&(o=Dn(e,a,r,r.undirected,i),e&&o))return o}function kn(e,t,n){if(e!==`mixed`){if(e===`undirected`)return Object.keys(n.undirected);if(typeof t==`string`)return Object.keys(n[t])}let r=[];return On(!1,e,t,n,function(e){r.push(e)}),r}function An(e,t,n){let r=Object.keys(n),i=r.length,a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=i)return e&&e.wrap(n),{done:!0};let s=n[r[a++]],c=s.source,l=s.target;o=c===t?l:c,e&&e.has(o.key)&&(o=null)}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function jn(e,t,n){if(e!==`mixed`){if(e===`undirected`)return An(null,n,n.undirected);if(typeof t==`string`)return An(null,n,n[t])}let r=Tt(),i=new En;return e!==`undirected`&&(t!==`out`&&(r=wt(r,An(i,n,n.in))),t!==`in`&&(r=wt(r,An(i,n,n.out)))),e!==`directed`&&(r=wt(r,An(i,n,n.undirected))),r}function Mn(e,t){let{name:n,type:r,direction:i}=t;e.prototype[n]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return[];e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${n}: could not find the "${e}" node in the graph.`);return kn(r===`mixed`?this.type:r,i,t)}}function Nn(e,t){let{name:n,type:r,direction:i}=t,a=`forEach`+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);On(!1,r===`mixed`?this.type:r,i,n,t)};let o=`map`+n[0].toUpperCase()+n.slice(1);e.prototype[o]=function(e,t){let n=[];return this[a](e,(e,r)=>{n.push(t(e,r))}),n};let s=`filter`+n[0].toUpperCase()+n.slice(1);e.prototype[s]=function(e,t){let n=[];return this[a](e,(e,r)=>{t(e,r)&&n.push(e)}),n};let c=`reduce`+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new q(`Graph.${c}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let r=n;return this[a](e,(e,n)=>{r=t(r,e,n)}),r}}function Pn(e,t){let{name:n,type:r,direction:i}=t,a=n[0].toUpperCase()+n.slice(1,-1),o=`find`+a;e.prototype[o]=function(e,t){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return;e=``+e;let n=this._nodes.get(e);if(n===void 0)throw new J(`Graph.${o}: could not find the "${e}" node in the graph.`);return On(!0,r===`mixed`?this.type:r,i,n,t)};let s=`some`+a;e.prototype[s]=function(e,t){return!!this[o](e,t)};let c=`every`+a;e.prototype[c]=function(e,t){return!this[o](e,(e,n)=>!t(e,n))}}function Fn(e,t){let{name:n,type:r,direction:i}=t,a=n.slice(0,-1)+`Entries`;e.prototype[a]=function(e){if(r!==`mixed`&&this.type!==`mixed`&&r!==this.type)return Tt();e=``+e;let t=this._nodes.get(e);if(t===void 0)throw new J(`Graph.${a}: could not find the "${e}" node in the graph.`);return jn(r===`mixed`?this.type:r,i,t)}}function In(e){Tn.forEach(t=>{Mn(e,t),Nn(e,t),Pn(e,t),Fn(e,t)})}function Ln(e,t,n,r,i){let a=r._nodes.values(),o=r.type,s,c,l,u,d,f,p;for(;s=a.next(),s.done!==!0;){let r=!1;if(c=s.value,o!==`undirected`)for(l in u=c.out,u){d=u[l];do{if(f=d.target,r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}if(o!==`directed`){for(l in u=c.undirected,u)if(!(t&&c.key>l)){d=u[l];do{if(f=d.target,f.key!==l&&(f=d.source),r=!0,p=i(c.key,f.key,c.attributes,f.attributes,d.key,d.attributes,d.undirected),e&&p)return d;d=d.next}while(d)}}if(n&&!r&&(p=i(c.key,null,c.attributes,null,null,null,null),e&&p))return null}}function Rn(e,t){let n={key:e};return yt(t.attributes)||(n.attributes=W({},t.attributes)),n}function zn(e,t,n){let r={key:t,source:n.source.key,target:n.target.key};return yt(n.attributes)||(r.attributes=W({},n.attributes)),e===`mixed`&&n.undirected&&(r.undirected=!0),r}function Bn(e){if(!K(e))throw new q(`Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.`);if(!(`key`in e))throw new q(`Graph.import: serialized node is missing its key.`);if(`attributes`in e&&(!K(e.attributes)||e.attributes===null))throw new q(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`)}function Vn(e){if(!K(e))throw new q(`Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.`);if(!(`source`in e))throw new q(`Graph.import: serialized edge is missing its source.`);if(!(`target`in e))throw new q(`Graph.import: serialized edge is missing its target.`);if(`attributes`in e&&(!K(e.attributes)||e.attributes===null))throw new q(`Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.`);if(`undirected`in e&&typeof e.undirected!=`boolean`)throw new q(`Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.`)}var Hn=Ct(),Un=new Set([`directed`,`undirected`,`mixed`]),Wn=new Set([`domain`,`_events`,`_eventsCount`,`_maxListeners`]),Gn=[{name:e=>`${e}Edge`,generateKey:!0},{name:e=>`${e}DirectedEdge`,generateKey:!0,type:`directed`},{name:e=>`${e}UndirectedEdge`,generateKey:!0,type:`undirected`},{name:e=>`${e}EdgeWithKey`},{name:e=>`${e}DirectedEdgeWithKey`,type:`directed`},{name:e=>`${e}UndirectedEdgeWithKey`,type:`undirected`}],Kn={allowSelfLoops:!0,multi:!1,type:`mixed`};function qn(e,t,n){if(n&&!K(n))throw new q(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(t=``+t,n||={},e._nodes.has(t))throw new Y(`Graph.addNode: the "${t}" node already exist in the graph.`);let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Jn(e,t,n){let r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit(`nodeAdded`,{key:t,attributes:n}),r}function Yn(e,t,n,r,i,a,o,s){if(!r&&e.type===`undirected`)throw new Y(`Graph.${t}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new Y(`Graph.${t}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!K(s))throw new q(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`);if(a=``+a,o=``+o,s||={},!e.allowSelfLoops&&a===o)throw new Y(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let c=e._nodes.get(a),l=e._nodes.get(o);if(!c)throw new J(`Graph.${t}: source node "${a}" not found.`);if(!l)throw new J(`Graph.${t}: target node "${o}" not found.`);let u={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new Y(`Graph.${t}: the "${i}" edge already exists in the graph.`);if(!e.multi&&(r?c.undirected[o]!==void 0:c.out[o]!==void 0))throw new Y(`Graph.${t}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);let d=new At(r,i,c,l,s);e._edges.set(i,d);let f=a===o;return r?(c.undirectedDegree++,l.undirectedDegree++,f&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,l.inDegree++,f&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?d.attachMulti():d.attach(),r?e._undirectedSize++:e._directedSize++,u.key=i,e.emit(`edgeAdded`,u),i}function Xn(e,t,n,r,i,a,o,s,c){if(!r&&e.type===`undirected`)throw new Y(`Graph.${t}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&e.type===`directed`)throw new Y(`Graph.${t}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(c){if(typeof s!=`function`)throw new q(`Graph.${t}: invalid updater function. Expecting a function but got "${s}"`)}else if(!K(s))throw new q(`Graph.${t}: invalid attributes. Expecting an object but got "${s}"`)}a=``+a,o=``+o;let l;if(c&&(l=s,s=void 0),!e.allowSelfLoops&&a===o)throw new Y(`Graph.${t}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=e._nodes.get(a),d=e._nodes.get(o),f,p;if(!n&&(f=e._edges.get(i),f)){if((f.source.key!==a||f.target.key!==o)&&(!r||f.source.key!==o||f.target.key!==a))throw new Y(`Graph.${t}: inconsistency detected when attempting to merge the "${i}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!e.multi&&u&&(p=r?u.undirected[o]:u.out[o]),p){let t=[p.key,!1,!1,!1];if(c?!l:!s)return t;if(c){let t=p.attributes;p.attributes=l(t),e.emit(`edgeAttributesUpdated`,{type:`replace`,key:p.key,attributes:p.attributes})}else W(p.attributes,s),e.emit(`edgeAttributesUpdated`,{type:`merge`,key:p.key,attributes:p.attributes,data:s});return t}s||={},c&&l&&(s=l(s));let m={key:null,undirected:r,source:a,target:o,attributes:s};if(n)i=e._edgeKeyGenerator();else if(i=``+i,e._edges.has(i))throw new Y(`Graph.${t}: the "${i}" edge already exists in the graph.`);let h=!1,g=!1;u||(u=Jn(e,a,{}),h=!0,a===o&&(d=u,g=!0)),d||(d=Jn(e,o,{}),g=!0),f=new At(r,i,u,d,s),e._edges.set(i,f);let _=a===o;return r?(u.undirectedDegree++,d.undirectedDegree++,_&&(u.undirectedLoops++,e._undirectedSelfLoopCount++)):(u.outDegree++,d.inDegree++,_&&(u.directedLoops++,e._directedSelfLoopCount++)),e.multi?f.attachMulti():f.attach(),r?e._undirectedSize++:e._directedSize++,m.key=i,e.emit(`edgeAdded`,m),[i,!0,h,g]}function Zn(e,t){e._edges.delete(t.key);let{source:n,target:r,attributes:i}=t,a=t.undirected,o=n===r;a?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),a?e._undirectedSize--:e._directedSize--,e.emit(`edgeDropped`,{key:t.key,attributes:i,source:n.key,target:r.key,undirected:a})}var Z=class e extends _t.EventEmitter{constructor(e){if(super(),e=W({},Kn,e),typeof e.multi!=`boolean`)throw new q(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!Un.has(e.type))throw new q(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!=`boolean`)throw new q(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);let t=e.type===`mixed`?Dt:e.type===`directed`?Ot:kt;bt(this,`NodeDataClass`,t);let n=`geid_`+Hn()+`_`,r=0;bt(this,`_attributes`,{}),bt(this,`_nodes`,new Map),bt(this,`_edges`,new Map),bt(this,`_directedSize`,0),bt(this,`_undirectedSize`,0),bt(this,`_directedSelfLoopCount`,0),bt(this,`_undirectedSelfLoopCount`,0),bt(this,`_edgeKeyGenerator`,()=>{let e;do e=n+r++;while(this._edges.has(e));return e}),bt(this,`_options`,e),Wn.forEach(e=>bt(this,e,this[e])),xt(this,`order`,()=>this._nodes.size),xt(this,`size`,()=>this._edges.size),xt(this,`directedSize`,()=>this._directedSize),xt(this,`undirectedSize`,()=>this._undirectedSize),xt(this,`selfLoopCount`,()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),xt(this,`directedSelfLoopCount`,()=>this._directedSelfLoopCount),xt(this,`undirectedSelfLoopCount`,()=>this._undirectedSelfLoopCount),xt(this,`multi`,this._options.multi),xt(this,`type`,this._options.type),xt(this,`allowSelfLoops`,this._options.allowSelfLoops),xt(this,`implementation`,()=>`graphology`)}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(``+e)}hasDirectedEdge(e,t){if(this.type===`undirected`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&!n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type===`directed`)return!1;if(arguments.length===1){let t=``+e,n=this._edges.get(t);return!!n&&n.undirected}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){let t=``+e;return this._edges.has(t)}if(arguments.length===2){e=``+e,t=``+t;let n=this._nodes.get(e);return n?n.out!==void 0&&n.out.hasOwnProperty(t)||n.undirected!==void 0&&n.undirected.hasOwnProperty(t):!1}throw new q(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type===`undirected`)return;if(e=``+e,t=``+t,this.multi)throw new Y(`Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new J(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||void 0;if(r)return r.key}undirectedEdge(e,t){if(this.type===`directed`)return;if(e=``+e,t=``+t,this.multi)throw new Y(`Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.`);let n=this._nodes.get(e);if(!n)throw new J(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);let r=n.undirected&&n.undirected[t]||void 0;if(r)return r.key}edge(e,t){if(this.multi)throw new Y(`Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.`);e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new J(`Graph.edge: could not find the "${t}" target node in the graph.`);let r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type===`undirected`?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out}areInNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in}areUndirectedNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`directed`&&t in n.undirected}areNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&(t in n.in||t in n.out)||this.type!==`directed`&&t in n.undirected}areInboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.in||this.type!==`directed`&&t in n.undirected}areOutboundNeighbors(e,t){e=``+e,t=``+t;let n=this._nodes.get(e);if(!n)throw new J(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!==`undirected`&&t in n.out||this.type!==`directed`&&t in n.undirected}inDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree}outDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree}directedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree}undirectedDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree}inboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree),n}outboundDegree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.outDegree),n}degree(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!==`directed`&&(n+=t.undirectedDegree),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`undirected`?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type===`directed`?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree,r+=t.directedLoops),n-r}outboundDegreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.outDegree,r+=t.directedLoops),n-r}degreeWithoutSelfLoops(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,r=0;return this.type!==`directed`&&(n+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!==`undirected`&&(n+=t.inDegree+t.outDegree,r+=t.directedLoops*2),n-r}source(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=``+e,t=``+t;let n=this._edges.get(t);if(!n)throw new J(`Graph.opposite: could not find the "${t}" edge in the graph.`);let r=n.source.key,i=n.target.key;if(e===r)return i;if(e===i)return r;throw new J(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${r}, ${i}).`)}hasExtremity(e,t){e=``+e,t=``+t;let n=this._edges.get(e);if(!n)throw new J(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=``+e;let t=this._edges.get(e);if(!t)throw new J(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return qn(this,e,t).key}mergeNode(e,t){if(t&&!K(t))throw new q(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=``+e,t||={};let n=this._nodes.get(e);return n?(t&&(W(n.attributes,t),this.emit(`nodeAttributesUpdated`,{type:`merge`,key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!=`function`)throw new q(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=``+e;let n=this._nodes.get(e);if(n){if(t){let r=n.attributes;n.attributes=t(r),this.emit(`nodeAttributesUpdated`,{type:`replace`,key:e,attributes:n.attributes})}return[e,!1]}let r=t?t({}):{};return n=new this.NodeDataClass(e,r),this._nodes.set(e,n),this.emit(`nodeAdded`,{key:e,attributes:r}),[e,!0]}dropNode(e){e=``+e;let t=this._nodes.get(e);if(!t)throw new J(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!==`undirected`){for(let e in t.out){n=t.out[e];do Zn(this,n),n=n.next;while(n)}for(let e in t.in){n=t.in[e];do Zn(this,n),n=n.next;while(n)}}if(this.type!==`directed`)for(let e in t.undirected){n=t.undirected[e];do Zn(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit(`nodeDropped`,{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){let e=``+arguments[0],n=``+arguments[1];if(t=G(this,e,n,this.type),!t)throw new J(`Graph.dropEdge: could not find the "${e}" -> "${n}" edge in the graph.`)}else if(e=``+e,t=this._edges.get(e),!t)throw new J(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Zn(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new Y(`Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new Y(`Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);e=``+e,t=``+t;let n=G(this,e,t,`directed`);if(!n)throw new J(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Zn(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new Y(`Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.`);if(this.multi)throw new Y(`Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.`);let n=G(this,e,t,`undirected`);if(!n)throw new J(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return Zn(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit(`cleared`)}clearEdges(){let e=this._nodes.values(),t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit(`edgesCleared`)}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!=`function`)throw new q(`Graph.updateAttribute: updater should be a function.`);let n=this._attributes[e];return this._attributes[e]=t(n),this.emit(`attributesUpdated`,{type:`set`,attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit(`attributesUpdated`,{type:`remove`,attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!K(e))throw new q(`Graph.replaceAttributes: provided attributes are not a plain object.`);return this._attributes=e,this.emit(`attributesUpdated`,{type:`replace`,attributes:this._attributes}),this}mergeAttributes(e){if(!K(e))throw new q(`Graph.mergeAttributes: provided attributes are not a plain object.`);return W(this._attributes,e),this.emit(`attributesUpdated`,{type:`merge`,attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!=`function`)throw new q(`Graph.updateAttributes: provided updater is not a function.`);return this._attributes=e(this._attributes),this.emit(`attributesUpdated`,{type:`update`,attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!=`function`)throw new q(`Graph.updateEachNodeAttributes: expecting an updater function.`);if(t&&!St(t))throw new q(`Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._nodes.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,i.attributes=e(i.key,i.attributes);this.emit(`eachNodeAttributesUpdated`,{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!=`function`)throw new q(`Graph.updateEachEdgeAttributes: expecting an updater function.`);if(t&&!St(t))throw new q(`Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}`);let n=this._edges.values(),r,i,a,o;for(;r=n.next(),r.done!==!0;)i=r.value,a=i.source,o=i.target,i.attributes=e(i.key,i.attributes,a.key,o.key,a.attributes,o.attributes,i.undirected);this.emit(`eachEdgeAttributesUpdated`,{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!=`function`)throw new q(`Graph.forEachAdjacencyEntry: expecting a callback.`);Ln(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new q(`Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.`);Ln(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=`function`)throw new q(`Graph.forEachAssymetricAdjacencyEntry: expecting a callback.`);Ln(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!=`function`)throw new q(`Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.`);Ln(!1,!0,!0,this,e)}nodes(){return Array.from(this._nodes.keys())}forEachNode(e){if(typeof e!=`function`)throw new q(`Graph.forEachNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)}findNode(e){if(typeof e!=`function`)throw new q(`Graph.findNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return r.key}mapNodes(e){if(typeof e!=`function`)throw new q(`Graph.mapNode: expecting a callback.`);let t=this._nodes.values(),n,r,i=Array(this.order),a=0;for(;n=t.next(),n.done!==!0;)r=n.value,i[a++]=e(r.key,r.attributes);return i}someNode(e){if(typeof e!=`function`)throw new q(`Graph.someNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,e(r.key,r.attributes))return!0;return!1}everyNode(e){if(typeof e!=`function`)throw new q(`Graph.everyNode: expecting a callback.`);let t=this._nodes.values(),n,r;for(;n=t.next(),n.done!==!0;)if(r=n.value,!e(r.key,r.attributes))return!1;return!0}filterNodes(e){if(typeof e!=`function`)throw new q(`Graph.filterNodes: expecting a callback.`);let t=this._nodes.values(),n,r,i=[];for(;n=t.next(),n.done!==!0;)r=n.value,e(r.key,r.attributes)&&i.push(r.key);return i}reduceNodes(e,t){if(typeof e!=`function`)throw new q(`Graph.reduceNodes: expecting a callback.`);if(arguments.length<2)throw new q(`Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let n=t,r=this._nodes.values(),i,a;for(;i=r.next(),i.done!==!0;)a=i.value,n=e(n,a.key,a.attributes);return n}nodeEntries(){let e=this._nodes.values();return{[Symbol.iterator](){return this},next(){let t=e.next();if(t.done)return t;let n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}}}export(){let e=Array(this._nodes.size),t=0;this._nodes.forEach((n,r)=>{e[t++]=Rn(r,n)});let n=Array(this._edges.size);return t=0,this._edges.forEach((e,r)=>{n[t++]=zn(this.type,r,e)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(t,n=!1){if(t instanceof e)return t.forEachNode((e,t)=>{n?this.mergeNode(e,t):this.addNode(e,t)}),t.forEachEdge((e,t,r,i,a,o,s)=>{n?s?this.mergeUndirectedEdgeWithKey(e,r,i,t):this.mergeDirectedEdgeWithKey(e,r,i,t):s?this.addUndirectedEdgeWithKey(e,r,i,t):this.addDirectedEdgeWithKey(e,r,i,t)}),this;if(!K(t))throw new q(`Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.`);if(t.attributes){if(!K(t.attributes))throw new q(`Graph.import: invalid attributes. Expecting a plain object.`);n?this.mergeAttributes(t.attributes):this.replaceAttributes(t.attributes)}let r,i,a,o,s;if(t.nodes){if(a=t.nodes,!Array.isArray(a))throw new q(`Graph.import: invalid nodes. Expecting an array.`);for(r=0,i=a.length;r<i;r++){o=a[r],Bn(o);let{key:e,attributes:t}=o;n?this.mergeNode(e,t):this.addNode(e,t)}}if(t.edges){let e=!1;if(this.type===`undirected`&&(e=!0),a=t.edges,!Array.isArray(a))throw new q(`Graph.import: invalid edges. Expecting an array.`);for(r=0,i=a.length;r<i;r++){s=a[r],Vn(s);let{source:t,target:i,attributes:o,undirected:c=e}=s,l;`key`in s?(l=n?c?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:c?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,l.call(this,s.key,t,i,o)):(l=n?c?this.mergeUndirectedEdge:this.mergeDirectedEdge:c?this.addUndirectedEdge:this.addDirectedEdge,l.call(this,t,i,o))}}return this}nullCopy(t){let n=new e(W({},this._options,t));return n.replaceAttributes(W({},this.getAttributes())),n}emptyCopy(e){let t=this.nullCopy(e);return this._nodes.forEach((e,n)=>{let r=W({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)}),t}copy(e){if(e||={},typeof e.type==`string`&&e.type!==this.type&&e.type!==`mixed`)throw new Y(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi==`boolean`&&e.multi!==this.multi&&e.multi!==!0)throw new Y(`Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.`);if(typeof e.allowSelfLoops==`boolean`&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Y(`Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.`);let t=this.emptyCopy(e),n=this._edges.values(),r,i;for(;r=n.next(),r.done!==!0;)i=r.value,Yn(t,`copy`,!1,i.undirected,i.key,i.source.key,i.target.key,W({},i.attributes));return t}toJSON(){return this.export()}toString(){return`[object Graph]`}inspect(){let e={};this._nodes.forEach((t,n)=>{e[n]=t.attributes});let t={},n={};this._edges.forEach((e,r)=>{let i=e.undirected?`--`:`->`,a=``,o=e.source.key,s=e.target.key,c;e.undirected&&o>s&&(c=o,o=s,s=c);let l=`(${o})${i}(${s})`;r.startsWith(`geid_`)?this.multi&&(n[l]===void 0?n[l]=0:n[l]++,a+=`${n[l]}. `):a+=`[${r}]: `,a+=l,t[a]=e.attributes});let r={};for(let e in this)this.hasOwnProperty(e)&&!Wn.has(e)&&typeof this[e]!=`function`&&typeof e!=`symbol`&&(r[e]=this[e]);return r.attributes=this._attributes,r.nodes=e,r.edges=t,bt(r,`constructor`,this.constructor),r}};typeof Symbol<`u`&&(Z.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=Z.prototype.inspect),Gn.forEach(e=>{[`add`,`merge`,`update`].forEach(t=>{let n=e.name(t),r=t===`add`?Yn:Xn;e.generateKey?Z.prototype[n]=function(i,a,o){return r(this,n,!0,(e.type||this.type)===`undirected`,null,i,a,o,t===`update`)}:Z.prototype[n]=function(i,a,o,s){return r(this,n,!1,(e.type||this.type)===`undirected`,i,a,o,s,t===`update`)}})}),Kt(Z),rn(Z),wn(Z),In(Z);var Qn=class extends Z{constructor(e){let t=W({type:`directed`},e);if(`multi`in t&&t.multi!==!1)throw new q(`DirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`directed`)throw new q(`DirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},$n=class extends Z{constructor(e){let t=W({type:`undirected`},e);if(`multi`in t&&t.multi!==!1)throw new q(`UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!`);if(t.type!==`undirected`)throw new q(`UndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},er=class extends Z{constructor(e){let t=W({multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiGraph.from: inconsistent indication that the graph should be simple in given options!`);super(t)}},tr=class extends Z{constructor(e){let t=W({type:`directed`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`directed`)throw new q(`MultiDirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}},nr=class extends Z{constructor(e){let t=W({type:`undirected`,multi:!0},e);if(`multi`in t&&t.multi!==!0)throw new q(`MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!`);if(t.type!==`undirected`)throw new q(`MultiUndirectedGraph.from: inconsistent "`+t.type+`" type in given options!`);super(t)}};function rr(e){e.from=function(t,n){let r=new e(W({},t.options,n));return r.import(t),r}}rr(Z),rr(Qn),rr($n),rr(er),rr(tr),rr(nr),Z.Graph=Z,Z.DirectedGraph=Qn,Z.UndirectedGraph=$n,Z.MultiGraph=er,Z.MultiDirectedGraph=tr,Z.MultiUndirectedGraph=nr,Z.InvalidArgumentsGraphError=q,Z.NotFoundGraphError=J,Z.UsageGraphError=Y;var ir={eligible:{property:`--chart-site-health-eligible`,fallback:`#56b4e9`},hidden:{property:`--chart-site-health-hidden`,fallback:`#e69f00`},resource:{property:`--chart-site-health-resource`,fallback:`#d4d4d8`},redirect:{property:`--chart-site-health-redirect`,fallback:`#9aa7b8`},failed:{property:`--chart-site-health-failed`,fallback:`#d55e00`},unchecked:{property:`--chart-site-health-unchecked`,fallback:`#a1a1aa`}},ar={property:`--chart-neutral-text-dim`,fallback:`#71717a`},or=2.5,sr=200,cr=3,lr=1.6;function ur(e){let t=sr/Math.max(sr,e);return Math.max(cr,9*t**.25)}function dr(e){return ur(e)*lr}var fr={eligible:ir.eligible,hidden:ir.hidden,resource:ir.resource,redirect:ir.redirect,failed:ir.failed,unchecked:ir.unchecked,dimmedNode:{property:`--chart-neutral-text-dim`,fallback:`#71717a`},edge:ar,edgeDimmed:{property:`--chart-neutral-text-faint`,fallback:`#52525b`},edgeActive:{property:`--chart-neutral-text`,fallback:`#a1a1aa`},label:{property:`--chart-tooltip-label`,fallback:`#e4e4e7`},background:{property:`--chart-tooltip-bg`,fallback:`#18181b`}},pr=/^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i,mr=/^rgba?\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}(?:\s*,\s*(?:0|1|0?\.\d+))?\s*\)$/;function hr(e){return pr.test(e)||mr.test(e)}var gr=50,_r=.75,vr=[{maxRatio:.2,budget:1/0},{maxRatio:.45,budget:60},{maxRatio:_r,budget:24}];function yr(e){for(let t of vr)if(e<=t.maxRatio)return t.budget;return 1}function br(e){return Math.max(0,Math.min(1,(e.linkScoreNormalized??0)/100))}function xr(e){return e.healthState?e.healthState:N(e)}function Sr(e){switch(e){case`eligible`:return`Indexable`;case`hidden`:return`Hidden`;case`resource`:return`Not a page`;case`redirect`:return`Moved`;case`failed`:return`Broken`;case`unchecked`:return`Not checked`}}function Cr(e){switch(e){case`eligible`:return`Indexable`;case`hidden`:return`Hidden or points elsewhere`;case`resource`:return`Not a page`;case`redirect`:return`Moved`;case`failed`:return`Broken`;case`unchecked`:return`Not checked`}}function wr(e){switch(e){case`eligible`:return`AI and search engines are allowed to index this page`;case`hidden`:return`This page tells them not to index it, or points them to another page`;case`resource`:return`A file rather than a page, such as a text file or a PDF. Answer engines can still read it`;case`redirect`:return`This address sends visitors to another page`;case`failed`:return`This page could not be loaded`;case`unchecked`:return`This page was found but not checked`}}function Tr(e){switch(e){case`eligible`:return`●`;case`hidden`:return`◆`;case`resource`:return`▪`;case`redirect`:return`↗`;case`failed`:return`×`;case`unchecked`:return`○`}}function Er(e,t){return!!t&&e.nodeKey===t}function Dr(e,t=!1,n=1){let r=ur(n),i=or+Math.sqrt(br(e))*(r-or);return t?Math.max(dr(n),i):i}function Or(e,t){switch(e){case`eligible`:return t.eligible;case`hidden`:return t.hidden;case`resource`:return t.resource;case`redirect`:return t.redirect;case`failed`:return t.failed;case`unchecked`:return t.unchecked}}function kr(e){return .35+Math.min(1.65,Math.log2(Math.max(1,e)+1)*.28)}function Ar(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function jr(e,t,n,r=null){let i=new tr({allowSelfLoops:!0}),a=new Map;for(let t of e)a.has(t.nodeKey)||a.set(t.nodeKey,t);for(let e of[...a.values()].sort((e,t)=>_e(e.nodeKey,t.nodeKey))){if(!Ar(e))continue;let t=xr(e),o=Or(t,n),s=Tr(t),c=Er(e,r);i.addNode(e.nodeKey,{x:e.x,y:e.y,size:Dr(e,c,a.size),color:o,baseColor:o,label:`${s} ${e.path||`/`}`,nodeKey:e.nodeKey,url:e.url,path:e.path,depth:e.depth,status:t,glyph:s,labelVisibility:c||e.depth===0||e.path.trim()===`/`?`visible`:`auto`,zIndex:c?2:+(e.depth===0),isRoot:c})}let o=new Set;for(let e of[...t].sort((e,t)=>_e(e.edgeKey,t.edgeKey)))!o.has(e.edgeKey)&&e.targetNodeKey&&i.hasNode(e.sourceNodeKey)&&i.hasNode(e.targetNodeKey)&&(o.add(e.edgeKey),i.addDirectedEdgeWithKey(e.edgeKey,e.sourceNodeKey,e.targetNodeKey,{size:kr(e.occurrences),color:n.edge,baseColor:n.edge,followable:e.followable,occurrences:e.occurrences,isTemplate:e.isTemplate===!0,type:`line`,zIndex:0}));return{graph:i,layoutAvailable:e.length===0||i.order>0,omittedNodes:Math.max(0,e.length-i.order),omittedEdges:Math.max(0,t.length-i.size)}}function Mr(e,t,n=gr){let r=t.trim().toLocaleLowerCase(),i=Math.max(0,Math.min(gr,Math.floor(n)));return[...e].sort((e,t)=>_e(e.path||e.url,t.path||t.url)||_e(e.nodeKey,t.nodeKey)).filter(e=>Ar(e)?!r||`${e.path}\n${e.url}\n${e.nodeKey}`.toLocaleLowerCase().includes(r):!1).slice(0,i)}function Nr(e,t,n,r,i=!0){let a=t&&e.hasNode(t)?t:null,o=typeof n==`function`?n:()=>n,s=e.nodes().sort((t,n)=>{let r=e.getNodeAttributes(t),i=e.getNodeAttributes(n);return Number(i.isRoot)-Number(r.isRoot)||i.size-r.size||(r.depth??2**53-1)-(i.depth??2**53-1)||_e(r.path,i.path)||_e(t,n)}),c=new Map(s.map((e,t)=>[e,t])),l=new Set(a?e.neighbors(a).filter(e=>e!==a).sort((e,t)=>(c.get(e)??0)-(c.get(t)??0)).slice(0,8):[]);return{nodeReducer:(t,n)=>{let i={x:n.x,y:n.y,size:n.size,color:n.color,label:n.label,labelVisibility:n.labelVisibility,zIndex:n.zIndex},s=o(),u=s>_r;if(n.isRoot)return t===a?{...i,size:n.size*1.35,labelVisibility:`visible`,zIndex:3}:{...i,labelVisibility:`visible`};if(a)return t===a?{...i,size:n.size*1.35,labelVisibility:`visible`,zIndex:3}:e.areNeighbors(t,a)?u?l.has(t)?{...i,labelVisibility:`auto`}:{...i,labelVisibility:`auto`,label:``}:i:{...i,color:r.dimmedNode,labelVisibility:`auto`,label:``,zIndex:0};let d=yr(s);return d===1/0?i:(c.get(t)??2**53-1)<d?{...i,labelVisibility:`visible`}:{...i,labelVisibility:`auto`,label:``}},edgeReducer:(t,n)=>{let s={size:n.size,color:n.color,zIndex:n.zIndex};if(n.isTemplate&&!i)return{...s,visibility:`hidden`};let c=o()>_r,[l,u]=e.extremities(t);return a&&(l===a||u===a)?{...s,color:r.edgeActive,size:Math.max(1.4,n.size),zIndex:2}:c?{...s,visibility:`hidden`}:a?{...s,color:r.edgeDimmed,size:Math.min(.45,n.size),zIndex:0}:s}}}var Q=S(),Pr={"layout-failed":{heading:`Map could not be built`,detail:`The map could not be created for this scan. Run a new scan to try again.`},"no-crawl":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"legacy-snapshot":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"details-unavailable":{heading:`No map yet`,detail:`This scan has no map yet. Run a new scan to create one.`},"empty-crawl":{heading:`No pages to map`,detail:`This scan found no pages to put on a map. Run a new scan to try again.`}};function Fr(e){return(e&&Pr[e])??Pr[`no-crawl`]}var Ir=class extends H.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[SiteGraphSigma] the map failed to render`,e,t.componentStack),M({kind:`render`,error:e,component:`site-graph`})}componentDidUpdate(e){this.state.failed&&e.resetToken!==this.props.resetToken&&this.setState({failed:!1})}render(){return this.state.failed?this.props.fallback:this.props.children}},Lr=220;function Rr(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:Lr}function zr(e,t,n=`${t}s`){return`${e.toLocaleString()} ${e===1?t:n}`}function Br(e,t,n){let r=window.getComputedStyle(e).getPropertyValue(t).trim();if(r&&!r.includes(`var(`)&&hr(r))return r;let i=document.createElement(`span`);i.style.position=`absolute`,i.style.visibility=`hidden`,i.style.color=`var(${t})`,e.appendChild(i);let a=window.getComputedStyle(i).color.trim();return i.remove(),a&&!a.includes(`var(`)&&hr(a)?a:n}function Vr(e){let t=t=>{let n=fr[t];return Br(e,n.property,n.fallback)};return{eligible:t(`eligible`),hidden:t(`hidden`),resource:t(`resource`),redirect:t(`redirect`),failed:t(`failed`),unchecked:t(`unchecked`),dimmedNode:t(`dimmedNode`),edge:t(`edge`),edgeDimmed:t(`edgeDimmed`),edgeActive:t(`edgeActive`),label:t(`label`),background:t(`background`)}}function Hr(){if(typeof document>`u`)return!1;try{return!!document.createElement(`canvas`).getContext(`webgl2`)}catch{return!1}}function Ur({onOpenInventory:e}){return(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`Interactive map unavailable`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`This browser could not start WebGL. The page inventory remains available for the complete crawl.`}),e&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:e,children:`Open page inventory`})]})})}function Wr({onRetry:e}){return(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,role:`alert`,children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:`The map could not be drawn`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Something went wrong while drawing this map. The page inventory below is unaffected.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:e,children:`Try again`})]})})}function Gr({setReducers:e,reactSigma:t,graph:n,theme:r,selectedNodeKey:i,showTemplateLinks:a,onSelectNodeKey:o,onHoverNode:s,onCameraReady:c}){let{useSigma:l,useRegisterEvents:u,useCamera:d}=t,f=l(),p=u(),{zoomIn:m,zoomOut:h,reset:g,gotoNode:_}=d(),[v,y]=(0,H.useState)(null),b=v??i,x=(0,H.useRef)(null),S=(0,H.useRef)({overview:!0,budget:NaN});return(0,H.useEffect)(()=>()=>{x.current!==null&&cancelAnimationFrame(x.current)},[]),(0,H.useEffect)(()=>{let e=Rr();return c({zoomIn:()=>m({duration:e}),zoomOut:()=>h({duration:e}),reset:()=>g({duration:e}),gotoNode:t=>_(t,{duration:e})}),()=>c(null)},[_,c,g,m,h]),(0,H.useEffect)(()=>{p({enterNode:({node:e,event:t})=>{y(e),s({nodeKey:e,left:Number.isFinite(t.x)?t.x+14:20,top:Number.isFinite(t.y)?t.y+14:20})},leaveNode:()=>{y(null),s(null)},clickNode:({node:e})=>o(e),clickStage:()=>s(null),updated:()=>{x.current===null&&(x.current=requestAnimationFrame(()=>{x.current=null;let e=f.getCamera().getState().ratio>_r,t=yr(f.getCamera().getState().ratio);(e!==S.current.overview||t!==S.current.budget)&&(S.current={overview:e,budget:t},f.refresh())}))}})},[s,o,p,f]),(0,H.useEffect)(()=>{if(f.getGraph()!==n)return;e(Nr(n,b,()=>f.getCamera().getState().ratio,r,a));let t=f.getCamera().getState().ratio;S.current={overview:t>_r,budget:yr(t)},f.refresh()},[b,n,a,f,r,e]),null}function Kr({nodes:e,edges:t,layoutState:n=`ready`,layoutUnavailableReason:a,rootNodeKey:o=null,showTemplateLinks:c=!0,selectedNodeKey:l,onSelectNode:u,onOpenInventory:d,ariaLabel:f,className:p}){let m=(0,H.useRef)(null),g=(0,H.useRef)(null),_=(0,H.useRef)(null),v=(0,H.useId)(),y=(0,H.useId)(),b=(0,H.useId)(),[x,S]=(0,H.useState)(null),[C,ee]=(0,H.useState)(null),[te,ne]=(0,H.useState)(`checking`),[re,ie]=(0,H.useState)(!1),[ae,oe]=(0,H.useState)(null),[se,ce]=(0,H.useState)(null),[le,w]=(0,H.useState)(``),[T,ue]=(0,H.useState)(!1),[E,fe]=(0,H.useState)(0),[pe,me]=(0,H.useState)(``),[he,ge]=(0,H.useState)(0),O=(0,H.useRef)(null),_e=(0,H.useDeferredValue)(le),A=l===void 0?ae:l,j=(0,H.useMemo)(()=>new Map(e.map(e=>[e.nodeKey,e])),[e]),ve=(0,H.useMemo)(()=>ft(o?j.get(o)?.url:null),[j,o]),M=(0,H.useCallback)(e=>ht(e,ve),[ve]),ye=A?j.get(A)??null:null,N=se?j.get(se.nodeKey)??null:null,P=(0,H.useMemo)(()=>Mr(e,_e),[_e,e]),be=e.some(e=>Number.isFinite(e.x)&&Number.isFinite(e.y)),xe=(0,H.useMemo)(()=>x?jr(e,t,x,o):null,[t,e,o,x]),Se=(0,H.useMemo)(()=>{if(!x||!xe)return null;let e=Nr(xe.graph,null,1,x,!1);return{options:{nodeReducer:(t,n,r)=>e.nodeReducer(t,r),edgeReducer:(t,n,r)=>e.edgeReducer(t,r),settings:{allowInvalidContainer:!0,enableCameraPanning:!0,enableCameraZooming:!0,enableCameraRotation:!1,enableEdgeEvents:!1,hideEdgesOnMove:!0,hideLabelsOnMove:!0,itemSizesReference:`screen`,labelDensity:.07,labelGridCellSize:140,labelRenderedSizeThreshold:8,maxCameraRatio:12,minCameraRatio:.04,minEdgeThickness:.35,renderEdgeLabels:!1,renderLabels:!0,stagePadding:42},styles:{nodes:{x:{attribute:`x`},y:{attribute:`y`},size:{attribute:`size`},label:{attribute:`label`},depth:{whenState:`isHovered`,then:`topNodes`,else:`nodes`},visibility:`visible`,backdropVisibility:{whenState:`isHovered`,then:`visible`,else:`hidden`},color:{attribute:`color`,defaultValue:x.unchecked},labelColor:x.label,labelFont:`600 Geist Variable, Geist, sans-serif`,labelSize:13,labelPosition:`right`,backdropColor:x.background,backdropBorderColor:x.edgeActive,backdropBorderWidth:1.5,backdropPadding:3,backdropCornerRadius:5,backdropLabelPadding:8},edges:{size:{attribute:`size`},depth:`edges`,visibility:`visible`,color:{attribute:`color`,defaultValue:x.edge},path:`straight`}}},setReducers:t=>{e=t}}},[xe,x]);(0,H.useEffect)(()=>{let e=m.current;if(!e)return;let t=()=>S(Vr(e));if(t(),typeof MutationObserver>`u`)return;let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-theme`,`style`]}),()=>n.disconnect()},[]),(0,H.useEffect)(()=>{e.length===0||n===`unavailable`||!be?ne(`checking`):ne(Hr()?`ready`:`unavailable`)},[be,n,e.length]),(0,H.useEffect)(()=>{if(te!==`ready`){ee(null);return}let e=!0;return V(()=>import(`./react-sigma_core.esm.min-BoCIEnkF.js`).then(t=>{e&&ee(t)}),__vite__mapDeps([0,1,2]),import.meta.url).catch(()=>{e&&ne(`unavailable`)}),()=>{e=!1}},[te]),(0,H.useEffect)(()=>{fe(0)},[_e]);let Ce=(0,H.useCallback)(e=>{_.current=e,ie(!!e)},[]),we=(0,H.useCallback)(e=>{ce(e)},[]),Te=(0,H.useCallback)((e,t)=>{let n=j.get(e);n&&(l===void 0&&oe(e),u?.(n),t&&_.current?.gotoNode(e),me(`Focused ${M(n)}`))},[j,u,M,l]),Ee=(0,H.useCallback)(e=>{Te(e,!1)},[Te]);(0,H.useEffect)(()=>{!re||!l||!j.has(l)?l||(O.current=null):O.current!==l&&(_.current?.gotoNode(l),O.current=l)},[re,j,l]);let De=e=>{Te(e.nodeKey,!0),w(M(e)),ue(!1)},Oe=()=>{window.setTimeout(()=>{document.activeElement!==g.current&&ue(!1)},0)},F=`Interactive site map showing ${zr(e.length,`page`)} and ${zr(t.length,`internal link`)}`,ke=e=>`${y}-${e.replaceAll(/[^\w-]/g,`-`)}`,I=Fr(a);if(n===`unavailable`)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:I.heading}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:I.detail}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});if(e.length===0)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`No page graph is available for this scan.`}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});if(!be)return(0,Q.jsx)(`section`,{ref:m,role:`group`,"aria-label":f??F,className:D(`flex min-h-80 items-center justify-center material-base px-6 text-center`,p),children:(0,Q.jsxs)(`div`,{className:`max-w-md`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:I.heading}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:I.detail}),d&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-4`,onClick:d,children:`Open page inventory`})]})});let Ae=P.at(E),je=(0,Q.jsx)(Wr,{onRetry:()=>ge(e=>e+1)}),Me=C?.SigmaContainer;return(0,Q.jsxs)(`section`,{ref:m,role:`group`,"aria-label":f??F,"aria-describedby":b,className:D(`flex h-[clamp(460px,62vh,680px)] min-h-[460px] flex-col overflow-hidden material-base`,p),children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-subtle bg-bg-elevated/70 px-3 py-2`,children:[(0,Q.jsx)(`label`,{htmlFor:v,className:`sr-only`,children:`Focus a page in the site map`}),(0,Q.jsxs)(`div`,{className:`relative min-w-56 max-w-lg flex-1`,children:[(0,Q.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`input`,{id:v,ref:g,role:`combobox`,type:`search`,autoComplete:`off`,"aria-label":`Focus a page in the site map`,"aria-autocomplete":`list`,"aria-controls":y,"aria-expanded":T,"aria-activedescendant":T&&Ae?ke(Ae.nodeKey):void 0,value:le,placeholder:ye?`Focused: ${M(ye)}`:`Find a page`,className:`h-10 w-full rounded-md border border-base bg-bg py-2 pl-9 pr-3 text-label-14 text-primary placeholder-mono-400 outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,onFocus:()=>ue(!0),onBlur:Oe,onChange:e=>{w(e.target.value),ue(!0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),ue(!0),fe(e=>Math.max(0,Math.min(P.length-1,e+1)))):e.key===`ArrowUp`?(e.preventDefault(),fe(e=>Math.max(0,e-1))):e.key===`Enter`&&T&&Ae?(e.preventDefault(),De(Ae)):e.key===`Escape`&&ue(!1)}}),T&&(0,Q.jsxs)(`div`,{className:`absolute left-0 right-0 top-[calc(100%+0.25rem)] z-30 overflow-hidden material-menu`,children:[(0,Q.jsx)(`div`,{id:y,role:`listbox`,"aria-label":`Matching pages`,className:`max-h-72 overflow-auto py-1`,children:P.length>0?P.map((e,t)=>{let n=xr(e);return(0,Q.jsxs)(`button`,{id:ke(e.nodeKey),type:`button`,role:`option`,"aria-selected":t===E,tabIndex:-1,className:D(`flex min-h-11 w-full items-center justify-between gap-3 px-3 py-2 text-left text-button-14 outline-none`,t===E?`bg-surface-active text-primary`:`text-secondary hover:bg-surface-hover hover:text-primary`),onPointerDown:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>fe(t),onClick:()=>De(e),children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-mono`,children:M(e)}),(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-label-13 text-muted`,children:[(0,Q.jsx)(`span`,{className:`text-label-13-mono-strong`,style:{color:`var(${ir[n].property})`},"aria-hidden":`true`,children:Tr(n)}),(0,Q.jsx)(`span`,{title:wr(n),children:Sr(n)})]})]},e.nodeKey)}):(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-secondary`,children:`No rendered pages match.`})}),P.length===50&&(0,Q.jsx)(`p`,{className:`border-t border-subtle px-3 py-2 text-copy-13 text-muted`,children:`First 50 matches. Refine the search or use the full page inventory.`})]})]}),(0,Q.jsxs)(`span`,{className:`text-label-13 tabular-nums text-muted`,children:[zr(e.length,`page`),` · `,zr(t.length,`link`)]})]}),(0,Q.jsx)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:te===`unavailable`?(0,Q.jsx)(Ur,{onOpenInventory:d}):te===`checking`||!x||!xe||!Se||!C||!Me?(0,Q.jsx)(`div`,{className:`flex h-full min-h-80 items-center justify-center px-6 text-center`,role:`status`,children:(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Preparing the interactive site map...`})}):(0,Q.jsxs)(Ir,{fallback:je,resetToken:he,children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-0`,children:(0,Q.jsx)(Me,{graph:xe.graph,className:`relative size-full bg-bg [&_.sigma-container]:size-full`,style:{width:`100%`,height:`100%`,background:x.background},options:Se.options,children:(0,Q.jsx)(Gr,{setReducers:Se.setReducers,reactSigma:C,graph:xe.graph,theme:x,selectedNodeKey:A,showTemplateLinks:c,onSelectNodeKey:Ee,onHoverNode:we,onCameraReady:Ce})})}),(0,Q.jsxs)(`div`,{className:`absolute right-3 top-3 z-20 flex flex-col overflow-hidden material-menu`,children:[(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none border-b border-subtle`,"aria-label":`Zoom in`,disabled:!re,onClick:()=>_.current?.zoomIn(),children:(0,Q.jsx)(i,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none border-b border-subtle`,"aria-label":`Zoom out`,disabled:!re,onClick:()=>_.current?.zoomOut(),children:(0,Q.jsx)(r,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`rounded-none`,"aria-label":`Fit site map`,disabled:!re,onClick:()=>_.current?.reset(),children:(0,Q.jsx)(s,{className:`size-4`,"aria-hidden":`true`})})]}),N&&se&&(0,Q.jsxs)(`div`,{role:`tooltip`,className:`pointer-events-none absolute z-20 max-w-64 material-tooltip px-3 py-2`,style:{left:se.left,top:se.top},children:[(0,Q.jsx)(`p`,{className:`truncate text-copy-13-mono-strong text-heading`,children:M(N)}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13-strong text-heading`,children:Sr(xr(N))}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-copy-13 text-secondary`,children:wr(xr(N))}),N.depth!=null&&(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-13 text-secondary`,children:[zr(N.depth,`click`),` from home`]}),N.auditScore!=null&&(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-13 tabular-nums text-heading`,children:[`Score `,Math.round(N.auditScore),`/100`]})]})]})}),(0,Q.jsxs)(`div`,{"aria-label":`Site map legend`,className:`flex flex-wrap items-center gap-x-4 gap-y-2 border-t border-subtle bg-bg-elevated/50 px-3 py-2 text-label-13 text-secondary`,children:[de.map(e=>(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,title:wr(e),children:[(0,Q.jsx)(`span`,{className:`w-3 text-center font-mono text-label-16-strong`,style:{color:`var(${ir[e].property})`},"aria-hidden":`true`,children:Tr(e)}),Cr(e)]},e)),(0,Q.jsx)(`span`,{className:`ml-auto`,children:`Bigger = more linked`}),xe&&(xe.omittedNodes>0||xe.omittedEdges>0)&&(0,Q.jsx)(`span`,{className:`text-caution`,children:`Some records lacked valid layout data.`})]}),(0,Q.jsx)(`p`,{id:b,className:`sr-only`,children:`The WebGL map supports pointer, wheel, and touch navigation. Use the page search to focus a rendered page. Use the full page inventory for an accessible list of every crawled page and its links.`}),(0,Q.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:pe})]})}var qr={"geographic-signals":`Checks whether pages say where your business operates: your address, service areas, map coordinates, and location details that search engines can read. Useful for businesses serving specific places. Off by default; enabling it adds this check to the health score.`,"agent-skill-exposure":`Checks whether AI agents can understand your forms, discover actions such as site search, and find links to tools or APIs. Reads page information only; it does not submit forms or run actions. Included in the health score by default.`};function Jr(e,t){return`Worth ${fe(e,w.percent)} of the ${t} score`}function Yr(e){return e>=70?`positive`:e>=40?`caution`:`negative`}function Xr(e){return e>=70?`pass`:e>=40?`partial`:`fail`}function Zr(e){return e===`pass`?`positive`:e===`partial`?`caution`:`negative`}function Qr(e){return e===`pass`?`Pass`:e===`partial`?`Partial`:`Fail`}function $r({audit:e,isLoading:t,error:n,onRetry:r}){return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`site-health-page-audit-heading`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`h3`,{id:`site-health-page-audit-heading`,className:`text-heading-16 text-heading`,children:`Findings and fixes for this page`})}),t?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,role:`status`,children:`Loading findings...`}):n?(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3 border-y border-negative bg-negative-soft px-4 py-3`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-negative`,children:`Findings could not be loaded.`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:r,children:`Try again`})]}):e?e.state===`no-crawl`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`No Site Health scan is available.`}):e.state===`details-unavailable`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`This scan saved its summary, but not the findings for each page.`}):e.state===`not-found`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`This page is not present in the selected scan.`}):e.state===`not-audited`?(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:e.auditState===`url-version`?`This address is a URL version of another page, so it was not scored.`:`This page was found, but it was not scored.`}):(0,Q.jsx)(ei,{audit:e}):(0,Q.jsx)(`p`,{className:`mt-4 text-copy-14 text-secondary`,children:`No findings are available for this page.`})]})}function ei({audit:e}){let t=e.factors.filter(e=>e.applicable!==!1&&(e.status!==`pass`||e.findings.some(e=>e.type===`missing`||e.type===`timeout`||e.type===`unreachable`)));return(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsxs)(`span`,{"aria-label":`Score ${Math.round(e.auditScore)} out of 100`,className:`text-heading-24 tabular-nums text-heading`,children:[Math.round(e.auditScore),(0,Q.jsx)(`span`,{className:`text-label-14 text-muted`,children:`/100`})]}),(0,Q.jsx)(A,{tone:Yr(e.auditScore),children:Qr(Xr(e.auditScore))})]}),e.evidenceState===`scores-only`&&(0,Q.jsx)(`p`,{className:`mt-3 border border-caution bg-caution-soft px-3 py-2 text-copy-14 text-caution`,children:`This older scan saved only the scores, not the findings or fixes.`}),e.criticalDefects.length>0&&(0,Q.jsxs)(`section`,{className:`mt-5`,"aria-labelledby":`site-health-critical-defects-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`h4`,{id:`site-health-critical-defects-heading`,className:`text-heading-14 text-heading`,children:`Problems outside the score`}),(0,Q.jsx)(A,{tone:e.criticalDefects.some(e=>e.severity===`critical`)?`negative`:`caution`,children:e.criticalDefects.length}),(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Not counted in the score`})]}),(0,Q.jsx)(`ul`,{className:`mt-2 divide-y divide-default border-y border-default`,children:e.criticalDefects.map(e=>(0,Q.jsxs)(`li`,{className:`py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-heading`,children:e.detail}),(0,Q.jsx)(A,{tone:e.severity===`critical`?`negative`:`caution`,children:e.severity===`critical`?`Critical`:`Warning`})]}),(0,Q.jsxs)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:[(0,Q.jsx)(`span`,{className:`text-copy-14-strong text-heading`,children:`Fix:`}),` `,e.recommendation]})]},e.id))})]}),t.length>0?(0,Q.jsx)(`div`,{className:`mt-5 divide-y divide-default border-y border-default`,children:t.map(t=>(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsxs)(`details`,{className:`group min-w-0 flex-1 py-1`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-12 cursor-pointer list-none items-center justify-between gap-3 rounded-sm px-1 py-2 outline-none marker:hidden focus-visible:ring-2 focus-visible:ring-mono-400 [&::-webkit-details-marker]:hidden`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-label-14-strong text-heading`,children:[(0,Q.jsx)(o,{className:`size-4 shrink-0 text-muted transition-transform group-open:rotate-90`,"aria-hidden":`true`}),t.name]}),(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[(0,Q.jsxs)(`span`,{className:`text-label-14 tabular-nums text-heading`,children:[Math.round(t.score),`/100`]}),(0,Q.jsx)(A,{tone:Zr(t.status),children:Qr(t.status)})]})]}),(0,Q.jsxs)(`div`,{className:`grid gap-4 px-1 pb-4 pt-1 md:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h5`,{className:`text-heading-14 normal-case text-muted`,children:`Evidence`}),t.findings.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-label-14 text-secondary`,children:t.findings.map((e,t)=>(0,Q.jsx)(`li`,{children:e.message},`${e.code}:${t}`))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:e.evidenceState===`scores-only`?`This scan did not save the findings here.`:`Nothing to report here.`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h5`,{className:`text-heading-14 normal-case text-muted`,children:`Recommended fix`}),t.recommendations.length>0?(0,Q.jsx)(`ol`,{className:`mt-2 list-decimal space-y-1.5 pl-5 text-label-14 text-secondary marker:text-muted`,children:t.recommendations.map(e=>(0,Q.jsx)(`li`,{children:e},e))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:e.evidenceState===`scores-only`?`This scan did not save a fix here.`:`No fix suggested here.`}),typeof t.sharePct==`number`?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:Jr(t.sharePct,`page`)}):null]})]})]}),qr[t.id]&&(0,Q.jsx)(`div`,{className:`flex min-h-14 items-center`,children:(0,Q.jsx)(B,{text:qr[t.id],placement:`bottom`})})]},t.id))}):e.criticalDefects.length===0&&e.evidenceState===`complete`?(0,Q.jsx)(`p`,{className:`mt-4 border-y border-positive bg-positive-soft px-4 py-3 text-copy-14 text-positive`,children:`Nothing needs attention on this page.`}):e.criticalDefects.length===0?(0,Q.jsx)(`p`,{className:`mt-4 border-y border-default px-4 py-3 text-copy-14 text-secondary`,children:`This scan saved only the score. Run a new scan to see findings.`}):null]})}function ti(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function ni(e){let t=e;try{t=decodeURIComponent(e.replace(/\+/g,` `))}catch{}let n=``,r=e.indexOf(`?`);return r>=0&&new URLSearchParams(e.slice(r+1)).forEach((e,t)=>{n+=` ${t} ${e}`}),`${e} ${t}${n}`}function ri(e,t=36,n=18){let r=[...e];return r.length<=t+n+1?e:`${r.slice(0,t).join(``)}…${r.slice(-n).join(``)}`}function ii({value:e,headLength:t,tailLength:n,className:r,title:i}){let a=ri(e,t,n);return(0,Q.jsx)(`span`,{className:r,title:i??e,children:a===e?e:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:e}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:a})]})})}function ai({rows:e,getSearchText:t,pageSize:n=25}){let[r,i]=(0,H.useState)(``),[a,o]=(0,H.useState)(1),s=(0,H.useMemo)(()=>ti(r),[r]),c=(0,H.useMemo)(()=>s.length===0||!t?e:e.filter(e=>{let n=t(e).toLocaleLowerCase();return s.every(e=>n.includes(e))}),[t,e,s]),l=Math.max(1,Math.ceil(c.length/n)),u=Math.min(Math.max(1,a),l),d=(u-1)*n,f=(0,H.useMemo)(()=>c.slice(d,d+n),[c,n,d]);return{query:r,setQuery:(0,H.useCallback)(e=>{i(e),o(1)},[]),page:u,setPage:(0,H.useCallback)(e=>{o(Math.max(1,e))},[]),rows:f,filteredRows:c,totalRows:c.length,totalPages:l,pageSize:n,rangeStart:c.length===0?0:d+1,rangeEnd:d+f.length,hasQuery:r.trim().length>0}}function oi({value:e,onChange:t,label:n,placeholder:r=`Filter rows`,className:i}){return(0,Q.jsxs)(`div`,{className:`relative ${i??``}`,children:[(0,Q.jsx)(h,{"aria-hidden":`true`,className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted`}),(0,Q.jsx)(`input`,{type:`search`,value:e,onChange:e=>{ce(e.target.value),t(e.target.value)},onKeyDown:e=>{e.key===`Enter`&&ce(e.currentTarget.value,!0)},"aria-label":n,placeholder:r,autoComplete:`off`,spellCheck:!1,className:`h-9 w-full rounded-md border border-default bg-surface/50 pl-9 pr-9 text-label-14 text-strong placeholder:text-muted outline-none transition focus:border-mono-500 focus:ring-1 focus:ring-mono-500 [&::-webkit-search-cancel-button]:appearance-none`}),e.trim().length>0?(0,Q.jsx)(`button`,{type:`button`,onClick:()=>t(``),"aria-label":`Clear ${n.toLocaleLowerCase()}`,className:`absolute right-2 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded text-muted transition-colors hover:bg-surface-hover hover:text-strong focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-mono-500`,children:(0,Q.jsx)(g,{"aria-hidden":`true`,className:`size-3.5`})}):null]})}function si({page:e,pageSize:t=25,visibleRows:n,totalRows:r,hasNextPage:i,onPageChange:a,itemLabel:s=`rows`,className:c,disabled:l=!1}){if(n===0)return null;let d=(e-1)*t+1,f=d+n-1,p=r===void 0?void 0:Math.max(1,Math.ceil(r/t)),m=i??(p!==void 0&&e<p),h=e>1||m;return(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2 text-label-12 text-secondary ${c??``}`,children:[(0,Q.jsxs)(`p`,{className:`tabular-nums`,children:[d.toLocaleString(`en-US`),` to `,f.toLocaleString(`en-US`),r===void 0?`${m?`+`:``} ${s}`:` of ${r.toLocaleString(`en-US`)} ${s}`]}),h?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(e-1),disabled:l||e<=1,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[(0,Q.jsx)(u,{"aria-hidden":`true`,className:`size-3.5`}),`Previous`]}),(0,Q.jsx)(`span`,{className:`tabular-nums`,children:p===void 0?`Page ${e}`:`Page ${e} of ${p}`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>a(e+1),disabled:l||!m,className:`inline-flex items-center gap-1 rounded-md border border-base bg-bg px-2.5 py-1.5 text-strong transition hover:border-strong hover:text-primary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:border-base disabled:hover:text-strong`,children:[`Next`,(0,Q.jsx)(o,{"aria-hidden":`true`,className:`size-3.5`})]})]}):null]})}var ci=[``,`sm:grid-cols-1`,`sm:grid-cols-2`,`sm:grid-cols-3`],li=[``,`lg:grid-cols-1`,`lg:grid-cols-2`,`lg:grid-cols-3`,`lg:grid-cols-4`,`lg:grid-cols-5`,`lg:grid-cols-6`],ui=14,di=Re[1],fi={current:`current`,previous:`previous`},pi=e=>e.series?.filter(e=>e.current!==null).length??0,mi=e=>e.interactive??pi(e)>=2,hi=e=>e!=null;function gi(e){return e.charAt(0).toLowerCase()+e.slice(1)}function _i(e){if(!e)return``;if(e.kind===`note`)return gi(e.text);if(e.direction===`flat`)return`no change ${e.basis}`;let t=e.tone===`better`?`, an improvement`:e.tone===`worse`?`, a decline`:``;return`${e.direction} ${e.amount} ${e.basis}${t}`}function vi({date:e,observedAt:t}){return t?Ge(R(t)):Ye(e)}function yi({date:e,observedAt:t}){return t?Be(R(t)):Number(e.slice(0,4))}function bi(e){return e.label??vi(e)}function xi(e,t){if(!e)return;let n=`since ${bi(e.basis)}`;if(e.difference===0)return{kind:`delta`,amount:t===`fraction`?`0 pts`:`0`,direction:`flat`,tone:`neutral`,basis:n};let r=Math.abs(e.difference);return{kind:`delta`,amount:t===`fraction`?`${me(r).magnitude} pts`:r.toLocaleString(),direction:e.difference>0?`up`:`down`,tone:e.tone,basis:n}}function Si(e){let t=new Set(e.map(e=>e.change?bi(e.change.basis):null)),[n]=[...t];return t.size===1&&n?`since ${n}`:void 0}function Ci(e){return e.series.map(e=>({date:e.observedAt??e.date,current:e.value,...e.label?{label:e.label}:{}}))}function wi(e,t){if(e.label&&t.label)return e.label===t.label?e.label:`${e.label} to ${t.label}`;let n=(e,t)=>t?`${vi(e)}, ${yi(e)}`:vi(e);return`${n(e,yi(e)!==yi(t))} to ${n(t,!0)}`}function Ti({change:e,hideBasis:t}){if(!e)return null;if(e.kind===`note`)return(0,Q.jsx)(`span`,{className:`block min-h-5 text-label-13 text-secondary`,children:e.text});if(e.direction===`flat`)return(0,Q.jsxs)(`span`,{className:`block min-h-5 text-label-13 text-secondary`,children:[`No change`,t?``:` ${e.basis}`]});let n=e.direction===`up`?v:b,r=e.tone===`better`?`text-positive`:e.tone===`worse`?`text-negative`:`text-secondary`;return(0,Q.jsxs)(`span`,{className:`flex min-h-5 flex-wrap items-center gap-x-1 text-label-13 tabular-nums`,children:[(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-label-13-strong ${r}`,children:[(0,Q.jsx)(n,{"aria-hidden":`true`,className:`size-3.5`,strokeWidth:2.5}),e.amount]}),!t&&(0,Q.jsx)(`span`,{className:`text-secondary`,children:e.basis})]})}function Ei({figure:e,active:t}){return e.stateValue?(0,Q.jsx)(`span`,{className:`flex min-h-10 items-center text-label-14 text-secondary`,children:e.value}):(0,Q.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-heading-32 tabular-nums transition-colors duration-150 ${t?`text-primary`:`text-strong`}`,title:e.exactValue,children:e.value}),e.detail&&(0,Q.jsx)(`span`,{className:`text-label-13 text-secondary`,children:e.detail})]})}function Di(e,t){return e.formatExact?.(t)??e.formatValue?.(t)??t.toLocaleString()}function Oi({active:e,payload:t,figure:n,previousLabel:r,rowLabel:i}){let a=t?.[0]?.payload;if(!e||!a)return null;let o=e=>hi(e)?Di(n,e):`—`;return(0,Q.jsxs)(`div`,{className:`material-tooltip min-w-48 px-3 py-2 text-label-13`,children:[(0,Q.jsx)(`p`,{className:`mb-1 text-copy-13-strong text-heading`,children:n.label}),(0,Q.jsxs)(`p`,{className:`flex items-center justify-between gap-6`,children:[(0,Q.jsx)(`span`,{className:`text-secondary`,children:i(a)}),(0,Q.jsx)(`span`,{className:`tabular-nums text-primary`,children:a.current===null?`Not recorded`:o(a.current)})]}),r&&a.previous!==void 0&&(0,Q.jsxs)(`p`,{className:`flex items-center justify-between gap-6`,children:[(0,Q.jsx)(`span`,{className:`text-secondary`,children:a.previousDate?He(a.previousDate):r}),(0,Q.jsx)(`span`,{className:`tabular-nums text-secondary`,children:o(a.previous)})]})]})}function ki({name:e,groups:t,mode:n=`single`,selected:r,onSelect:i,span:a,cadence:o=`day`,instants:s=!1,currentLabel:c,previous:u,chart:d,legendExtra:f,controls:p,notice:m,emptyChartMessage:h,refreshing:g=!1,chartHeight:_=240,frame:v=`card`}){let y=(0,H.useId)().replace(/:/g,``),b=e=>s?L(R(e)):He(e),x=e=>e.label??b(e.date),S=e=>Ue(R(new Date(e).toISOString())),[C,ee]=(0,H.useState)(new Set),ce=!$e(),le=t.flatMap(e=>e.figures),w=n===`single`?le.find(e=>e.key===r[0]&&mi(e)):void 0,T=w?.series??[],ue=s?T.map(e=>({...e,at:Date.parse(e.date)})):T,de=new Map(T.flatMap(e=>e.label?[[e.date,e.label]]:[])),E=!!u?.available&&T.some(e=>hi(e.previous)),fe=T.some(e=>e.current!==null||E&&hi(e.previous)),pe=!E||!C.has(fi.current),D=E&&!C.has(fi.previous),me=pi(w??{key:``,label:``,value:``})<ui?`linear`:`monotone`,he=o===`day`?`per day`:o===`scan`?`per scan`:`per release`,ge=w?`${w.label} ${he}, ${c?gi(c):a??``}${E?` and the previous period`:``}`:``,O=le.filter(mi).map(e=>e.key),_e=O.includes(r[0]??``)?r[0]:O[0],k=e=>{i(e),document.getElementById(`${y}-tab-${e}`)?.focus()},A=(e,t)=>{let n=O.indexOf(t),r=O.length-1,i=e.key===`ArrowRight`?n===r?0:n+1:e.key===`ArrowLeft`?n<=0?r:n-1:e.key===`Home`?0:e.key===`End`?r:null;i!==null&&(e.preventDefault(),k(O[i]))},j=e=>ee(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),ve=(e,t,a)=>{let o=mi(e),s=o&&r.includes(e.key),c=!!t.basis,u=[`${e.label} ${e.spokenValue??e.value}${e.detail?` ${e.detail}`:``}`,_i(e.change)].filter(Boolean).join(`, `),d=(0,Q.jsxs)(`div`,{className:`flex min-h-5 items-center gap-1.5`,children:[n===`compare`&&o&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block size-2.5 shrink-0 rounded-full`,style:{backgroundColor:s?e.color:`transparent`,border:`1.5px solid ${e.color}`}}),e.picker?(0,Q.jsxs)(`span`,{className:`relative inline-flex max-w-full items-center`,children:[(0,Q.jsx)(`select`,{"aria-label":e.picker.ariaLabel,value:e.picker.value,onChange:t=>e.picker.onChange(t.target.value),className:`max-w-full cursor-pointer appearance-none truncate rounded-sm bg-transparent py-0.5 pr-5 text-label-14-strong [field-sizing:content] transition-colors duration-150 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 ${s?`text-link`:`text-secondary`}`,children:e.picker.options.map(e=>(0,Q.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,Q.jsx)(l,{"aria-hidden":`true`,className:`pointer-events-none absolute right-0 size-3.5 ${s?`text-link`:`text-muted`}`})]}):(0,Q.jsx)(`span`,{className:`text-label-14-strong ${s?n===`single`?`text-link`:`text-heading`:`text-secondary`}`,children:e.label}),e.help&&(0,Q.jsx)(B,{text:e.help})]});return a?(0,Q.jsxs)(`div`,{className:`relative flex min-w-0 flex-col px-4 pb-4 pt-3 transition-colors duration-150 ${s?`bg-surface-active`:o?`hover:bg-surface-hover`:``}`,children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-0 h-[3px] transition-opacity duration-200 ${n===`single`?`bg-link`:``} ${s?`opacity-100`:`opacity-0`}`,style:n===`compare`?{backgroundColor:e.color}:void 0}),d,(0,Q.jsxs)(`button`,{type:`button`,id:`${y}-tab-${e.key}`,...n===`single`?{role:`tab`,"aria-selected":s,"aria-controls":`${y}-panel`,"aria-disabled":!o||void 0,tabIndex:o&&e.key===_e?0:-1,onKeyDown:t=>A(t,e.key)}:{"aria-pressed":s},"aria-label":u,disabled:n===`compare`&&(e.disabled||!o),onClick:o?()=>i(e.key):void 0,className:`mt-auto block w-full rounded-sm pt-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400 ${o?``:`cursor-default`} ${e.disabled?`disabled:cursor-not-allowed disabled:opacity-50`:``}`,children:[(0,Q.jsx)(Ei,{figure:e,active:s}),(0,Q.jsx)(Ti,{change:e.change,hideBasis:c})]})]},e.slot??e.key):(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col px-4 pb-4 pt-3`,children:[(0,Q.jsx)(`dt`,{children:d}),(0,Q.jsxs)(`dd`,{className:`mt-auto pt-1`,children:[(0,Q.jsx)(Ei,{figure:e,active:!1}),(0,Q.jsx)(Ti,{change:e.change,hideBasis:c}),e.change&&(0,Q.jsx)(`span`,{className:`sr-only`,children:_i(e.change)})]})]},e.slot??e.key)};return(0,Q.jsxs)(`div`,{className:`${v===`card`?`overflow-hidden material-base`:`-mx-4`} transition-opacity duration-200 ${g?`opacity-60`:``}`,children:[(0,Q.jsx)(`div`,{className:`flex flex-col lg:flex-row`,children:t.map((t,r)=>{let i=t.figures.some(mi),a=`${y}-group-${t.key}`,o=`grid grid-cols-2 ${ci[Math.min(t.figures.length,3)]} ${li[Math.min(t.figures.length,6)]}`;return(0,Q.jsxs)(`div`,{role:t.label?`group`:void 0,"aria-labelledby":t.label?a:void 0,className:`min-w-0 lg:basis-0 ${r>0?`border-t border-default lg:border-l lg:border-t-0`:``}`,style:{flexGrow:t.figures.length},children:[(t.label||t.basis)&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 px-4 pt-3`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{id:a,className:`text-label-13 text-secondary`,children:t.label}),t.help&&(0,Q.jsx)(B,{text:t.help})]}),t.basis&&(0,Q.jsx)(`span`,{className:`text-label-13 text-secondary`,children:t.basis})]}),i?(0,Q.jsx)(`div`,{role:n===`single`?`tablist`:void 0,"aria-label":n===`single`?e:void 0,className:o,children:t.figures.map(e=>ve(e,t,!0))}):(0,Q.jsx)(`dl`,{className:o,children:t.figures.map(e=>ve(e,t,!1))})]},t.key)})}),(0,Q.jsxs)(`div`,{id:`${y}-panel`,...n===`single`&&w?{role:`tabpanel`,"aria-labelledby":`${y}-tab-${w.key}`}:{role:`region`,"aria-label":`${e} chart`},className:`border-t border-default px-4 pb-3 pt-4`,children:[m&&(0,Q.jsx)(`div`,{className:`mb-3 text-copy-14 text-secondary`,children:m}),n===`compare`?d:!w||!fe?(0,Q.jsx)(`p`,{className:`flex h-32 items-center justify-center px-6 text-center text-copy-14 text-secondary`,children:h}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{role:`img`,"aria-label":ge,style:{height:_},children:(0,Q.jsx)(ie,{width:`100%`,height:`100%`,children:(0,Q.jsxs)(se,{data:[...ue],margin:{top:8,right:0,bottom:0,left:4},children:[(0,Q.jsx)(te,{stroke:Ke,vertical:!1}),s?(0,Q.jsx)(re,{dataKey:`at`,type:`number`,scale:`time`,domain:[`dataMin`,`dataMax`],tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:S,minTickGap:32,padding:{left:12,right:12}}):(0,Q.jsx)(re,{dataKey:`date`,tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:e=>de.get(e)??ze(e),minTickGap:32,padding:de.size>0?{left:40,right:40}:{left:12,right:12}}),(0,Q.jsx)(ae,{orientation:`right`,tick:We,tickLine:!1,axisLine:!1,width:52,allowDecimals:w.allowDecimals??!1,tickFormatter:e=>w.formatValue?.(e)??e.toLocaleString()}),(0,Q.jsx)(ne,{cursor:{stroke:Ve.textFaint,strokeWidth:1},wrapperStyle:{outline:`none`},content:(0,Q.jsx)(Oi,{figure:w,previousLabel:E?u?.label:void 0,rowLabel:x})}),D&&(0,Q.jsx)(oe,{type:me,dataKey:fi.previous,stroke:di,strokeOpacity:.65,strokeWidth:1.5,strokeDasharray:`4 4`,dot:!1,activeDot:{r:3,strokeWidth:0,fill:di},connectNulls:!1,isAnimationActive:ce,animationDuration:320,animationEasing:`ease-out`}),pe&&(0,Q.jsx)(oe,{type:me,dataKey:fi.current,stroke:di,strokeWidth:2.25,dot:me===`linear`&&{r:3,strokeWidth:0,fill:di},activeDot:{r:5,strokeWidth:2,stroke:di,fill:`var(--color-bg)`},connectNulls:!1,isAnimationActive:ce,animationDuration:320,animationEasing:`ease-out`})]})})}),(0,Q.jsx)(`div`,{className:`sr-only`,children:(0,Q.jsxs)(`table`,{children:[(0,Q.jsx)(`caption`,{children:ge}),(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:T.some(e=>e.label)?`Release`:`Date`}),(0,Q.jsx)(`th`,{scope:`col`,children:w.label}),E&&(0,Q.jsx)(`th`,{scope:`col`,children:u.label})]})}),(0,Q.jsx)(`tbody`,{children:T.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`row`,children:x(e)}),(0,Q.jsx)(`td`,{children:e.current===null?`Not recorded`:Di(w,e.current)}),E&&(0,Q.jsx)(`td`,{children:hi(e.previous)?Di(w,e.previous):`No data`})]},e.date))})]})})]}),n===`single`&&w&&fe&&c||f||a||p?(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center justify-between gap-x-6 gap-y-1`,children:[(0,Q.jsxs)(`fieldset`,{className:`flex flex-wrap gap-x-5 text-label-13 text-secondary`,children:[(0,Q.jsx)(`legend`,{className:`sr-only`,children:w?`${w.label} series`:`${e} options`}),n===`single`&&w&&fe&&c&&u&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ai,{label:c,checked:pe,disabled:!E||pe&&!D,onChange:()=>j(fi.current),dash:void 0}),(0,Q.jsx)(Ai,{label:E?u.label:`${u.label}: no earlier data`,checked:D,disabled:!E||D&&!pe,onChange:()=>j(fi.previous),dash:`4 3`})]}),f]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[a&&(0,Q.jsx)(`p`,{className:`text-copy-13 text-secondary`,children:a}),p]})]}):null]})]})}function Ai({label:e,checked:t,disabled:n,onChange:r,dash:i}){return(0,Q.jsxs)(`label`,{className:`flex min-h-9 items-center gap-2 pointer-coarse:min-h-11`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,className:`size-4 accent-mono-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,checked:t,disabled:n,onChange:r}),(0,Q.jsx)(`svg`,{"aria-hidden":`true`,width:`18`,height:`10`,viewBox:`0 0 18 10`,className:`shrink-0`,children:(0,Q.jsx)(`line`,{x1:`0`,y1:`5`,x2:`18`,y2:`5`,stroke:di,strokeWidth:i?1.5:2.5,strokeDasharray:i})}),e]})}var ji=`Not recorded by this scan`,Mi=100,Ni=12,Pi=[];function Fi(e){return ni(e.url)}function Ii(e){return e>=70?`positive`:e>=40?`caution`:`negative`}function Li(e){return e>=70?`text-positive-400`:e>=40?`text-caution-400`:`text-negative-400`}function Ri(e){return e===j.pass?`positive`:e===j.partial?`caution`:`negative`}var zi={[j.pass]:`Pass`,[j.partial]:`Partial`,[j.fail]:`Fail`},Bi=`Score is the average across audited pages. Status reflects the worst page: fail if any page scores below 40, partial if any page scores 40–69, otherwise pass. Share is how much of the site score the factor controls; the shares add up to 100%, and a dash means the scan did not record them.`;function Vi(e){return e>=70?`Pass`:e>=40?`Partial`:`Fail`}function Hi(e){return Ue(R(String(e)))}function Ui(e){return L(R(String(e)))}function Wi({projectName:e,projectId:t,runId:n,integrated:r=!1,compactCopy:i=!1,afterSummary:s,unavailableFooter:c}){let{isAdmin:u}=be(),d=T(le[`site-audit`])&&!u,[p,h]=(0,H.useState)(!1),[g,_]=(0,H.useState)(null),[v,b]=(0,H.useState)(null),S=n===void 0?v:n,[ee,ce]=(0,H.useState)(!1),ue=(0,H.useRef)(null),de=C(Ae({client:O,path:{name:e},...S?{query:{runId:S}}:{}})),E=C({...Fe({client:O,path:{name:e},query:{limit:30}}),enabled:!r}),pe=C({...Le({client:O,path:{name:e},query:{surface:`site-health`}}),enabled:r}),D=C(Oe({client:O,path:{name:e},query:{limit:Mi,sort:`score-asc`,...S?{runId:S}:{}}})),me=C({...we({client:O,path:{name:e},query:{kind:le[`site-audit`],limit:10}}),enabled:!r,refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.some(e=>e.status===`queued`||e.status===`running`)?3e3:1e4}),he=Qe(),ge=(0,H.useSyncExternalStore)(st,ct,ct),_e=Object.values(ge.runs).find(e=>e.kind===le[`site-audit`]&&e.projectId===t),j=me.data??[],ve=j.find(e=>e.status===`queued`||e.status===`running`),M=j.at(-1),N=he.isPending||!!_e||!!ve,P=he.isPending?`starting`:ve?.status??_e?.lastAnnouncedStatus,Se=(0,H.useCallback)(async()=>{r&&pe.refetch();let e=await Promise.all([de.refetch(),D.refetch(),...r?[]:[E.refetch()]]),t=e.find(e=>e.error);if(t?.error)throw t.error;return e[0]},[r,D.refetch,de.refetch,E.refetch,pe.refetch]);(0,H.useEffect)(()=>{r||S||!M||M.status!==`completed`&&M.status!==`partial`||de.data?.runId!==M.id&&ue.current!==M.id&&(ue.current=M.id,Se().catch(t=>{xe({title:`Technical AEO auto-refresh failed`,detail:t instanceof Error?t.message:`Could not load the completed audit.`,tone:`negative`,dedupeKey:`technical-aeo:auto-refresh:${e}`,dedupeMode:`replace`})}))},[S,r,M?.id,M?.status,e,Se,de.data?.runId]);let Ce=async()=>{ce(!0);try{let t=await Se();xe({title:`Technical AEO refreshed`,detail:N?`The audit is still running. This view will refresh again when it finishes.`:t.data?.hasData?`Latest score is ${t.data.aggregateScore}/100 from ${t.data.pagesAudited} audited page${t.data.pagesAudited===1?``:`s`}.`:`No audit data yet. Run an audit to crawl the sitemap.`,tone:t.data?.hasData?`positive`:`caution`,dedupeKey:`technical-aeo:refresh:${e}`,dedupeMode:`replace`})}catch(t){xe({title:`Technical AEO refresh failed`,detail:t instanceof Error?t.message:`Could not reload technical audit data.`,tone:`negative`,dedupeKey:`technical-aeo:refresh:${e}`,dedupeMode:`replace`})}finally{ce(!1)}},Ee=()=>{(!T(le[`site-audit`])||u)&&he.mutate({projectName:e,projectId:t})},De=P===`running`?`Audit running`:P===`queued`?`Audit queued`:`Starting audit`,F=de.data,ke=D.data?.pages??Pi,I=i?ke.find(e=>e.status===`success`&&e.overallScore<70)??ke.find(e=>e.status===`success`):void 0,je=!!(I&&I.overallScore<70),Me=C({...Te({client:O,path:{name:e},query:{...S?{runId:S}:{},url:I?.url??``}}),enabled:i&&!!I}),Ne=(F?.pagesErrored??0)>0,Pe=p&&Ne,Ie=ai({rows:(0,H.useMemo)(()=>Pe?ke.filter(e=>e.status===`error`):ke,[ke,Pe]),getSearchText:Fi}),Re=F?F.pagesAudited>ke.length:!1;if((0,H.useEffect)(()=>{h(!1),_(null)},[i,S,r]),de.isLoading)return(0,Q.jsxs)(`div`,{className:`flex min-h-40 items-center justify-center gap-2 text-label-14 text-secondary ${r?``:`mt-6`}`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page health...`]});if(de.error)return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-4 rounded-md border border-negative bg-negative-soft px-5 py-5 sm:flex-row sm:items-center sm:justify-between ${r?``:`mt-6`}`,role:`alert`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,Q.jsx)(y,{className:`mt-0.5 size-4 shrink-0 text-negative`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[r?(0,Q.jsx)(`h3`,{className:`text-heading-14 text-negative`,children:`Page health could not load`}):(0,Q.jsx)(`h2`,{className:`text-heading-14 text-negative`,children:`Page health could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`The saved audit could not be read. Try loading it again.`})]})]}),(0,Q.jsxs)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`shrink-0`,onClick:()=>void Ce(),disabled:ee,children:[(0,Q.jsx)(f,{className:`size-4 ${ee?`motion-safe:animate-spin`:``}`,"aria-hidden":`true`}),ee?`Trying again...`:`Try again`]})]}),c]});if(!F||!F.hasData)return r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`material-base px-5 py-7 text-center`,children:[(0,Q.jsx)(m,{className:`mx-auto size-7 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`h2`,{className:`mt-3 text-heading-16 text-heading`,children:`Page health unavailable`}),(0,Q.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-copy-14 text-secondary`,children:d?Ze:`Run a new Site Health scan to calculate page-level technical findings.`})]}),c]}):(0,Q.jsxs)(Xe,{className:`surface-card mt-6 p-8 text-center`,children:[(0,Q.jsx)(m,{className:`mx-auto mb-3 h-8 w-8 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:`No Technical AEO audit yet`}),(0,Q.jsx)(`p`,{className:`supporting-copy mx-auto mt-2 max-w-md`,children:`A technical AEO audit crawls your sitemap and scores every page for structured data, AI-readable content, crawler access, freshness, and more, then rolls it up into one site score.`}),!ye()&&!d&&(0,Q.jsx)(`div`,{className:`mt-5 flex items-center justify-center gap-3`,children:(0,Q.jsxs)(ut,{type:`button`,onClick:Ee,disabled:N,children:[N?(0,Q.jsx)(a,{className:`mr-1.5 h-4 w-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`mr-1.5 h-4 w-4`,"aria-hidden":`true`}),N?De:`Run first audit`]})}),N?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,role:`status`,"aria-live":`polite`,children:`The dashboard will refresh automatically when the audit finishes.`}):null]});let ze=F.deltaScore==null?null:`${F.deltaScore>=0?`+`:``}${F.deltaScore} vs previous`,L=F.trend===`up`?`positive`:F.trend===`down`?`negative`:`neutral`,Be=E.data?.points??[],R=Be.map(e=>({runId:e.runId,date:e.auditedAt,score:e.aggregateScore})),Ve=n===void 0&&v!==null,He=ke.filter(e=>e.status===`success`),Ue=F.factors.filter(e=>e.pagesPartial+e.pagesFailing>0).length,Ge=F.runStatus===`partial`,Ye=F.crossCuttingIssues.some(e=>e.topRecommendations.length>0);function $e(e){let t=[];for(let n of He){let r=n.factors.find(t=>t.id===e);r&&r.score<70&&t.push({url:n.url,score:r.score})}return t.sort((e,t)=>e.score-t.score)}return(0,Q.jsxs)(`div`,{className:r?``:`mt-6`,children:[r?(0,Q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-default pb-5 sm:flex-row sm:items-end sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-secondary`,children:Ge?`Score so far`:`Site score`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(`span`,{"aria-label":Ge?`Score so far ${F.aggregateScore} out of 100, from a scan that did not cover the whole site`:`Site score ${F.aggregateScore} out of 100`,className:`inline-flex items-baseline gap-1 font-mono tabular-nums ${Li(F.aggregateScore)}`,children:[(0,Q.jsx)(`span`,{className:`text-heading-32`,children:F.aggregateScore}),(0,Q.jsx)(`span`,{className:`text-label-14 text-muted`,children:`/100`})]}),(0,Q.jsx)(A,{tone:Ii(F.aggregateScore),children:Vi(F.aggregateScore)}),Ge?(0,Q.jsx)(A,{tone:`caution`,children:`Part of the site`}):null,ze?(0,Q.jsx)(A,{tone:L,children:ze}):null]})]}),(0,Q.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-copy-14 tabular-nums text-secondary`,children:[(0,Q.jsxs)(`span`,{children:[F.pagesAudited,` page`,F.pagesAudited===1?``:`s`,` checked`]}),(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-faint`,children:`·`}),(0,Q.jsxs)(`span`,{children:[Ue,` check`,Ue===1?``:`s`,` with pages below pass`]}),F.pagesErrored>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`text-faint`,children:`·`}),(0,Q.jsxs)(`span`,{className:`text-negative`,children:[F.pagesErrored,` crawl error`,F.pagesErrored===1?``:`s`]})]}):null]})]}):(0,Q.jsxs)(`section`,{className:`surface-card flex flex-wrap items-start justify-between gap-6 material-base p-6`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:Ve?`Technical AEO history`:`Technical AEO`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-baseline gap-3`,children:[(0,Q.jsx)(`span`,{className:`text-heading-40 tabular-nums ${Li(F.aggregateScore)}`,children:F.aggregateScore}),(0,Q.jsx)(`span`,{className:`text-label-18 text-muted`,children:`/ 100`}),(0,Q.jsx)(A,{tone:Ii(F.aggregateScore),children:Vi(F.aggregateScore)}),ze?(0,Q.jsx)(A,{tone:L,children:ze}):null,N?(0,Q.jsx)(A,{tone:`neutral`,children:De}):null]}),(0,Q.jsxs)(`p`,{className:`supporting-copy mt-2 tabular-nums`,children:[F.pagesDiscovered,` URL`,F.pagesDiscovered===1?``:`s`,` in sitemap · `,F.pagesAudited,` audited · `,F.pagesSkipped,` skipped · `,F.pagesErrored,` errored`]}),(0,Q.jsxs)(`p`,{className:`mt-1 flex flex-wrap items-center gap-x-1.5 text-copy-13 text-muted`,children:[(0,Q.jsx)(`span`,{className:`text-faint`,children:`Sitemap:`}),(0,Q.jsx)(`a`,{href:F.sitemapUrl??`#`,target:`_blank`,rel:`noreferrer`,className:`max-w-[22rem] truncate text-secondary underline decoration-mono-700 underline-offset-2 hover:text-strong`,children:F.sitemapUrl}),(0,Q.jsx)(B,{text:"Every audit re-reads this sitemap, so pages you add or remove are picked up on the next run. Discovered/audited counts and the score reflect the sitemap at the time of the latest run. Override it with `canonry technical-aeo run <project> --sitemap-url <url>`."})]}),F.auditedAt?(0,Q.jsxs)(`p`,{className:`mt-0.5 text-copy-13 text-faint`,children:[`Audited `,new Date(F.auditedAt).toLocaleString()]}):null,N?(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13 text-muted`,role:`status`,"aria-live":`polite`,children:`Results refresh automatically when this audit finishes.`}):null]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[n===void 0&&Be.length>1?(0,Q.jsxs)(`select`,{"aria-label":`View a Technical AEO audit`,value:v??``,onChange:e=>b(e.target.value||null),className:`min-h-11 rounded-md border border-base bg-bg px-3 text-label-14 text-strong focus:outline-none focus-visible:ring-1 focus-visible:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:`Latest Technical AEO audit`}),[...Be].reverse().slice(1).map(e=>(0,Q.jsxs)(`option`,{value:e.runId,children:[new Date(e.auditedAt).toLocaleDateString(),` · `,e.aggregateScore,`/100`]},e.runId))]}):null,(0,Q.jsxs)(k,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Ce(),disabled:ee,children:[(0,Q.jsx)(f,{className:`mr-1.5 h-4 w-4 ${ee?`motion-safe:animate-spin`:``}`,"aria-hidden":`true`}),ee?`Refreshing…`:`Refresh`]}),!ye()&&!d&&(0,Q.jsxs)(ut,{type:`button`,size:`sm`,onClick:Ee,disabled:N,children:[N?(0,Q.jsx)(a,{className:`mr-1.5 h-4 w-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`mr-1.5 h-4 w-4`,"aria-hidden":`true`}),N?De:`Re-run audit`]})]})]}),s,r?(0,Q.jsx)(Gi,{trend:pe.data}):null,!r&&R.length>=2?(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Trend`}),(0,Q.jsx)(`h2`,{children:`Site score over time`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 h-56`,children:[(0,Q.jsxs)(`p`,{className:`sr-only`,children:[`Technical AEO scores range from `,Math.min(...R.map(e=>e.score)),` to `,Math.max(...R.map(e=>e.score)),` across `,R.length,` audits. Use the audit selector to inspect a previous scorecard.`]}),(0,Q.jsx)(`div`,{className:`h-full`,"aria-hidden":`true`,children:(0,Q.jsx)(ie,{width:`100%`,height:`100%`,children:(0,Q.jsxs)(se,{data:R,margin:{top:8,right:8,bottom:0,left:0},children:[(0,Q.jsx)(te,{stroke:Ke,vertical:!1}),(0,Q.jsx)(re,{dataKey:`date`,tick:We,tickLine:!1,axisLine:{stroke:Je},tickFormatter:Hi,minTickGap:24}),(0,Q.jsx)(ae,{domain:[0,100],ticks:[0,25,50,75,100],tick:We,tickLine:!1,axisLine:!1,width:32}),(0,Q.jsx)(ne,{...qe,cursor:{stroke:Je,strokeWidth:1},labelFormatter:Ui,formatter:e=>[`${e}/100`,`Site score`]}),(0,Q.jsx)(oe,{type:`monotone`,dataKey:`score`,name:`score`,stroke:z.positive,strokeWidth:2.5,dot:{r:2.5,fill:z.positive,strokeWidth:0},isAnimationActive:!1})]})})})]})]}):null,(0,Q.jsxs)(`section`,{className:r?`pt-5`:`page-section-divider`,children:[r?(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`h3`,{className:`text-heading-16 text-heading`,children:i?`Checks`:`Technical findings`}),(0,Q.jsx)(B,{text:Bi})]}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-copy-14 text-secondary`,children:i?Ye?`Open a check to see affected pages and recommended fixes.`:I?je?`Open a check to see affected pages. Page-level evidence for the first page to fix appears below.`:`Open a check to see affected pages. Page-level evidence for one audited page appears below.`:`Open a check to see affected pages and score details.`:Ye?`Select a check to see affected pages and recommended fixes.`:`Select a check to see affected pages and score details.`})]}):(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Scorecard`}),(0,Q.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5`,children:[`Ranking factors`,(0,Q.jsx)(B,{text:Bi})]})]}),(0,Q.jsx)(`div`,{className:`evidence-table-wrap mt-3`,children:(0,Q.jsxs)(`table`,{className:`evidence-table ${r?`min-w-[42rem]`:``}`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{children:r?`Technical check`:`Factor`}),r?null:(0,Q.jsx)(`th`,{className:`text-right`,children:`Share`}),(0,Q.jsx)(`th`,{className:`text-right`,children:r?`Score`:`Avg`}),(0,Q.jsx)(`th`,{children:`Status`}),(0,Q.jsx)(`th`,{children:r?`Pages affected`:`Pass / Partial / Fail`})]})}),(0,Q.jsx)(`tbody`,{children:F.factors.map(e=>{let t=g===e.id,n=F.crossCuttingIssues.find(t=>t.factorId===e.id),i=t?$e(e.id):[],s=e.pagesPartial+e.pagesFailing,c=e.pagesPassing+s,u=!!n?.topRecommendations.length,d=u&&s>0;return(0,Q.jsxs)(H.Fragment,{children:[(0,Q.jsxs)(`tr`,{className:t?`bg-surface-subtle`:void 0,children:[(0,Q.jsx)(`td`,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 text-left text-button-14 text-strong outline-none hover:text-primary focus-visible:text-primary focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-mono-400`,"aria-expanded":t,onClick:()=>_(t?null:e.id),children:[t?(0,Q.jsx)(l,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}):(0,Q.jsx)(o,{className:`size-4 shrink-0 text-muted`,"aria-hidden":`true`}),e.name]}),qr[e.id]&&(0,Q.jsx)(B,{text:qr[e.id],placement:`bottom`})]})}),r?null:(0,Q.jsx)(`td`,{className:`text-right tabular-nums text-muted`,children:typeof e.sharePct==`number`?fe(e.sharePct,w.percent):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"aria-hidden":`true`,children:fe(null)}),(0,Q.jsx)(`span`,{className:`sr-only`,children:ji})]})}),(0,Q.jsxs)(`td`,{className:`text-right font-mono tabular-nums text-strong`,children:[e.avgScore,r?(0,Q.jsx)(`span`,{className:`text-muted`,children:`/100`}):null]}),(0,Q.jsx)(`td`,{children:(0,Q.jsx)(A,{tone:Ri(e.status),children:zi[e.status]})}),r?(0,Q.jsxs)(`td`,{className:`tabular-nums ${s>0?`text-strong`:`text-muted`}`,children:[s,` of `,c]}):(0,Q.jsxs)(`td`,{className:`tabular-nums text-secondary`,children:[(0,Q.jsx)(`span`,{className:`text-positive-400`,children:e.pagesPassing}),` / `,(0,Q.jsx)(`span`,{className:`text-caution-400`,children:e.pagesPartial}),` / `,(0,Q.jsx)(`span`,{className:`text-negative-400`,children:e.pagesFailing})]})]}),t?(0,Q.jsx)(`tr`,{className:`bg-surface-subtle`,children:(0,Q.jsx)(`td`,{colSpan:r?4:5,className:`px-4 pb-5 pt-0`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 border-t border-subtle pt-4 ${d?`lg:grid-cols-2`:``}`,children:[u&&n?(0,Q.jsxs)(`section`,{"aria-labelledby":`technical-finding-${e.id}-fixes`,children:[(0,Q.jsx)(`h4`,{id:`technical-finding-${e.id}-fixes`,className:`text-heading-14 text-heading`,children:`Recommended fixes`}),(0,Q.jsx)(`ol`,{className:`mt-2 list-decimal space-y-1.5 pl-5 marker:text-muted`,children:n.topRecommendations.map((e,t)=>(0,Q.jsx)(`li`,{className:`pl-1 text-label-14 text-secondary`,children:e},t))}),r&&typeof e.sharePct==`number`?(0,Q.jsx)(`p`,{className:`mt-3 text-copy-13 text-muted`,children:Jr(e.sharePct,`site`)}):null]}):s===0?(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:`Every audited page passes this check.`}):null,s>0?(0,Q.jsxs)(`section`,{"aria-labelledby":`technical-finding-${e.id}-pages`,children:[(0,Q.jsxs)(`h4`,{id:`technical-finding-${e.id}-pages`,className:`text-heading-14 text-heading`,children:[`Affected pages (`,s,`)`]}),r&&D.isLoading?(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading affected pages...`]}):r&&D.error?(0,Q.jsxs)(`div`,{className:`mt-3`,role:`alert`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-negative`,children:`Affected pages could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Try the page-level audit read again.`}),(0,Q.jsxs)(k,{type:`button`,variant:`secondary`,size:`sm`,className:`mt-3`,onClick:()=>void D.refetch(),disabled:D.isFetching,children:[D.isFetching?(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(f,{className:`size-4`,"aria-hidden":`true`}),D.isFetching?`Retrying affected pages...`:`Retry affected pages`]})]}):i.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:i.slice(0,Ni).map(e=>(0,Q.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2 text-label-14`,children:[(0,Q.jsx)(`span`,{className:`w-8 shrink-0 text-right font-mono tabular-nums ${Li(e.score)}`,children:e.score}),(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`min-w-0 truncate text-link outline-none hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,title:e.url,children:e.url})]},e.url))}):(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:`Page details are not available in the loaded audit sample.`}),i.length>Ni?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-muted`,children:[`+ `,i.length-Ni,` more below pass`]}):null,Re&&(!r||!D.isLoading&&!D.error)?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-muted`,children:[`Showing the worst `,ke.length,` audited pages.`]}):null]}):null]})})}):null]},e.id)})})]})})]}),i&&I?(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`onboarding-page-evidence-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-3 sm:flex-row sm:items-start`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`h3`,{id:`onboarding-page-evidence-heading`,className:`text-heading-16 text-heading`,children:je?`First page to fix`:`Example audited page`}),(0,Q.jsx)(`a`,{href:I.url,target:`_blank`,rel:`noreferrer`,className:`mt-1 block max-w-2xl truncate text-label-14-mono text-link outline-none hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,title:I.url,children:I.url})]}),(0,Q.jsxs)(A,{tone:Ii(I.overallScore),children:[Math.round(I.overallScore),`/100`]})]}),(0,Q.jsx)($r,{audit:Me.data,isLoading:Me.isLoading,error:Me.error,onRetry:()=>{Me.refetch()}})]}):null,!r&&F.crossCuttingIssues.length>0?(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head`,children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Opportunities`}),(0,Q.jsxs)(`h2`,{className:`inline-flex items-center gap-1.5`,children:[`Prioritized fixes`,(0,Q.jsx)(B,{text:`Factors scoring below pass across the most pages, ranked by site-wide impact. Fixing one of these typically lifts many pages at once.`})]})]}),(0,Q.jsx)(`div`,{className:`mt-3 divide-y divide-mono-800/60 overflow-hidden material-base`,children:F.crossCuttingIssues.map(e=>(0,Q.jsxs)(`div`,{className:`p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:e.factorName}),(0,Q.jsx)(A,{tone:Ii(e.avgScore),children:Vi(e.avgScore)}),(0,Q.jsxs)(`span`,{className:`text-label-12 tabular-nums text-muted`,children:[`avg `,e.avgScore,` · affects `,e.affectedPages,` of `,e.totalPages,` pages (`,fe(e.affectedPct,w.percent),`)`]})]}),e.topRecommendations.length>0?(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1`,children:e.topRecommendations.map((e,t)=>(0,Q.jsxs)(`li`,{className:`flex gap-2 text-label-14 text-secondary`,children:[(0,Q.jsx)(`span`,{className:`select-none text-faint`,children:`→`}),(0,Q.jsx)(`span`,{children:e})]},t))}):null]},e.factorId))})]}):null,r?null:(0,Q.jsxs)(`section`,{className:`page-section-divider`,children:[(0,Q.jsxs)(`div`,{className:`section-head section-head-inline`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`eyebrow eyebrow-soft`,children:`Pages`}),(0,Q.jsx)(`h2`,{children:`Per-page breakdown`})]}),Ne?(0,Q.jsxs)(`div`,{className:`segmented`,role:`group`,"aria-label":`Filter pages`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{h(!1),Ie.setPage(1)},"aria-pressed":!Pe,className:`segmented-option min-h-11 tabular-nums ${Pe?``:`segmented-option-active`}`,children:[`All `,F.pagesAudited]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{h(!0),Ie.setPage(1)},"aria-pressed":Pe,className:`segmented-option min-h-11 tabular-nums ${Pe?`segmented-option-active text-negative`:``}`,children:[`Errors `,F.pagesErrored]})]}):null]}),ke.length>0?(0,Q.jsx)(oi,{value:Ie.query,onChange:Ie.setQuery,label:`Filter audited page URLs`,placeholder:`Filter page URL or query parameters`,className:`mt-3 max-w-md`}):null,Ie.totalRows===0?(0,Q.jsx)(`p`,{className:`supporting-copy mt-3`,children:Ie.hasQuery?`No pages match this filter.`:`No pages recorded.`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`evidence-table-wrap mt-3`,children:(0,Q.jsxs)(`table`,{className:`evidence-table`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{className:`text-right`,children:`Score`}),(0,Q.jsx)(`th`,{children:`Status`}),(0,Q.jsx)(`th`,{className:`w-full`,children:`URL`})]})}),(0,Q.jsx)(`tbody`,{children:Ie.rows.map(e=>(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`text-right tabular-nums`,children:e.status===`error`?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-negative-400`,children:[(0,Q.jsx)(y,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),`err`]}):(0,Q.jsx)(`span`,{className:Li(e.overallScore),children:e.overallScore})}),(0,Q.jsx)(`td`,{children:e.status===`error`?(0,Q.jsx)(A,{tone:`negative`,children:`Error`}):(0,Q.jsx)(A,{tone:Ii(e.overallScore),children:Vi(e.overallScore)})}),(0,Q.jsx)(`td`,{className:`w-full max-w-0`,children:(0,Q.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:`block truncate text-neutral hover:text-heading`,title:e.status===`error`?e.error??e.url:e.url,children:(0,Q.jsx)(ii,{value:e.url,headLength:54,tailLength:20,title:e.status===`error`?e.error??e.url:e.url})})})]},e.url))})]})}),(0,Q.jsx)(si,{page:Ie.page,pageSize:Ie.pageSize,visibleRows:Ie.rows.length,totalRows:Ie.totalRows,onPageChange:Ie.setPage,itemLabel:Ie.hasQuery?`matches`:`rows`}),Re?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-13 text-faint`,children:[`Showing the worst `,ke.length,` of `,F.pagesAudited,` audited pages.`]}):null]})]})]})}function Gi({trend:e}){let[t,n]=(0,H.useState)(`score`),r=e?.groups.find(e=>e.key===`site-health`);if(!r)return null;let i=r.figures.map(e=>({key:e.key,label:e.label,value:e.value===null?`—`:e.value.toLocaleString(),detail:e.unit===he.score&&e.value!==null?`/100`:void 0,change:xi(e.change,e.unit),series:Ci(e)})),a=r.figures.find(e=>e.key===`score`),o=a?.series[0],s=a?.series.at(-1);return!o||!s||!i.some(e=>e.key===`score`&&mi(e))?null:(0,Q.jsx)(`section`,{"aria-label":`Site Health over time`,className:`border-b border-default py-5`,children:(0,Q.jsx)(ki,{name:`Site Health figures`,groups:[{key:`site-health`,label:`Every scan`,basis:Si(r.figures),figures:i}],selected:[t],onSelect:n,cadence:`scan`,instants:!0,span:wi(o,s)})})}var Ki=e({LivePageHealthFindings:()=>xo,PAGE_INTERNAL_LINKS_HELP:()=>Ra,SiteHealthSection:()=>Co,emptyLinkCopy:()=>qa}),qi=[{id:`map`,label:`Map`},{id:`inventory`,label:`Pages`},{id:`technical`,label:`Page health`}],Ji={map:`Explore how pages, site sections, and internal links fit together.`,inventory:`Review discovered pages and the links that shape their visibility.`,technical:`Prioritize audit findings and inspect the pages that need work.`},Yi=[{id:`all`,label:`All`,healthState:void 0},{id:`hidden`,label:`Hidden pages`,healthState:E.hidden}];function Xi(e,t,n){let r=U(e,n)||t,i=r.indexOf(`?`);if(i<0)return{path:r,query:null};let a=r.slice(i),o=a;try{o=decodeURIComponent(a.replaceAll(`+`,` `))}catch{o=a}return{path:r.slice(0,i),query:o}}function Zi(e){return e?e.urlVersions+(e.urlVersionsNotFetched??0):null}function Qi(e){let t=`${$(e)} URL version${e===1?``:`s`} skipped`;return{label:t,text:`${t}. These addresses add parameters, such as a filter, to a page and name that page as canonical, so they are copies of it. The audit does not score them or list them here.`}}var $i={[P.metaRobotsNoindex]:`Hidden by meta robots tag`,[P.xRobotsNoindex]:`Hidden by X-Robots-Tag header`,[P.robotsDisallow]:`Blocked by robots.txt`,[P.redirectTerminal]:`Redirects to another page`,[P.canonicalToOther]:`Points to another page as canonical`,[P.notHtmlOrUnavailable]:`Not an HTML page, so it was not scored`},ea=new Map(Object.entries($i));function ta(e){return ea.get(e)??e}var na=20,ra=200,ia=100,aa=100,oa=50,sa=pe,ca=ge,la=2e4,ua=3,da=new Intl.NumberFormat,fa=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,year:`numeric`}),pa={eligible:`positive`,hidden:`caution`,resource:`neutral`,redirect:`neutral`,failed:`negative`,unchecked:`neutral`};function ma(e){if(!e)return`Date unavailable`;let t=new Date(e);return Number.isNaN(t.getTime())?`Date unavailable`:fa.format(t)}function ha(e){return e.replaceAll(`_`,` `).replaceAll(`-`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ga(e){let t=xr(e);return{label:Sr(t),tone:pa[t]}}function _a(e){return e==null?`Not scored`:fe(e,w.percent)}function va(e){return e.auditScore==null?`Not checked`:`${Math.round(e.auditScore)}/100`}function $(e){return e==null?`Not available`:da.format(e)}var ya={clicksFromHome:`How many clicks it takes to reach this page from the home page, following links.`,linksIn:`How many other pages link to this page.`,linksOut:`How many other pages this page links to.`,linkImportance:`How much link value flows to this page, based on how many pages link to it and how important those pages are. Shown relative to the highest page on this site, which is 100%.`,technicalScore:`How well this page is set up for AI and search engines to read, from 0 to 100. Open a page to see what it is marked down for.`,linkTimes:`How many times this link appears on the page it comes from.`,pagesFound:`How many pages this scan discovered, whether or not it could load them.`,pagesChecked:`How many of the pages it found this scan actually loaded.`,internalLinks:`How many links between pages on this site the scan recorded.`},ba=new Set([`clicksFromHome`,`linkImportance`,`internalLinks`,`pagesFound`,`pagesChecked`]);function xa(e,t){let n=ya[e];return ba.has(e)?`${n} This always counts every link, including menu and footer.`:e===`technicalScore`||e===`linkTimes`?n:t?`${n} Right now this counts only links written in your page text. Menu and footer links are hidden.`:`${n} This counts every link, including menu and footer.`}function Sa(e,t){return`${da.format(e)} ${t}${e===1?``:`s`}`}function Ca(e,t){if(!e||!t)return null;try{let n=new URL(e),r=new URL(t),i=e=>e.hostname.toLowerCase().replace(/\.$/,``).replace(/^www\./,``);return i(n)===i(r)?null:{requested:n.host,effective:r.host}}catch{return null}}function wa(e){return e===`completed`?`positive`:e===`partial`||e===`queued`||e===`running`?`caution`:e===`failed`||e===`cancelled`?`negative`:`neutral`}var Ta=`Latest scan`,Ea=`Shows the most complete scan from the latest day with results. Choose a dated entry to view another scan.`;function Da(e){let t=ma(e.finishedAt??e.startedAt??e.createdAt),n=e.hasCrawlData?``:` · Score only`;return`${t} · ${ha(e.status)}${n}`}var Oa=new Map(Object.entries({complete:`This scan finished on its own.`,unknown:`This scan stopped before it checked every page it found.`,"max-pages":`This scan stopped at the page limit, so some pages were not checked.`,"max-edges":`This scan stopped at the link limit, so some links are missing.`,"max-fetches":`This scan stopped after checking as many pages as it could.`,"max-duration":`This scan ran out of time, so some pages were not checked.`,"max-bytes":`This scan stopped at the data limit, so some pages were not checked.`,"max-page-bytes":`This scan skipped a page that was too large to read.`,"max-depth":`This scan stopped at the depth limit, so deeper pages were not checked.`,"max-links-per-page":`This scan stopped reading links on pages that had too many.`,"max-query-variants":`This scan stopped at the limit for pages that differ only by a query string.`,"max-sitemap-fanout":`This scan stopped at the sitemap limit, so some sitemaps were not read.`,"max-sitemap-urls":`This scan stopped at the sitemap page limit, so some pages were not found.`,"root-host-redirect":`The site moved to another address during this scan.`})),ka=nt,Aa=[{value:null,label:`Default (10 clicks)`},{value:1,label:`1 click from the home page`},{value:2,label:`2 clicks`},{value:3,label:`3 clicks`},{value:5,label:`5 clicks`},{value:20,label:`20 clicks`},{value:50,label:`50 clicks`},{value:100,label:`100 clicks (maximum)`}],ja={"max-pages":`Raise the page budget in Scan settings.`,"max-edges":`Raise the page budget in Scan settings.`,"max-fetches":`Raise the page budget in Scan settings.`,"max-duration":`Try a smaller scan in Scan settings.`,"max-depth":`Raise the crawl depth in Scan settings.`};function Ma(e,t=!1){if(!e)return null;let n=ja[e]??null;return n&&t?`${n.replace(/ in Scan settings\.$/,``)} in Site Health's Scan settings after setup.`:n}function Na(e){return e?Oa.get(e)??`This scan stopped early: ${e}.`:`This scan stopped before it checked every page it found.`}var Pa={applied:`This scan told menu and footer links apart by how often the same link repeats across pages. It cannot spot a link written into the page text when its wording matches the menu. Run a new scan to read the page layout instead.`,"applied-placement":`This scan read where each link sits in the page, so links in the page text are separated from the menu, header, and footer even when they use the same wording.`,"applied-placement-with-ubiquity":`This scan read where each link sits in the page. Some pages mark out no menu or main area, so those links fall back to how often the link repeats across pages, which can miss a link written into the page text.`,"applied-placement-partial":`This scan read where each link sits in the page. Some pages mark out no menu or main area, and this scan found fewer than 15 pages, so nothing could tell those links apart. They are counted as links in your page text, which is what a link no rule marked as menu, header, or footer means here.`,"unavailable-too-few-pages":`This scan found fewer than 15 pages and did not read where each link sits in the page. On a site that small every link is on most pages, so menu and footer links cannot be told apart from the rest.`,"unavailable-legacy-scan":`This scan ran before menu and footer links were separated. Run a new scan to split them out.`},Fa=new Map(Object.entries(Pa));function Ia(e){return e===null?``:Fa.get(e)??Pa[`unavailable-legacy-scan`]}var La=`Scroll to zoom. Click a page to inspect it.`,Ra=`Observed links to and from this page in the selected scan.`,za=`Page positions on this map were set before menu and footer links were separated. Run a new scan to update them.`;function Ba(e){if(e.filterUnavailable)return`All ${Sa(e.totalEdgeCount,`link`)} shown.`;let t=`${da.format(e.contentEdgeCount)} link${e.contentEdgeCount===1?``:`s`} in your page text`,n=da.format(e.templateEdgeCount);return e.showTemplateLinks?`${t}, ${n} menu and footer.`:`${t}. ${n} menu and footer link${e.templateEdgeCount===1?``:`s`} hidden.`}var Va=`Menu, header, and footer links repeat on every page, so they say nothing about which pages relate to each other. Links written in your page text do.`;function Ha(e,t){let n=[Va,Ia(e)];return t.staleLayout&&n.push(za),n.filter(Boolean).join(` `)}function Ua(e,t,n){if(e===`disabled`)return{label:`Broken links: not checked`,tone:`neutral`};let r=n??0,i=r>0?`, ${da.format(r)} unchecked`:``;return e===`complete`?t?{label:`Broken links: ${da.format(t)} found${i}`,tone:`negative`}:r>0?{label:`Broken links: none found, ${da.format(r)} unchecked`,tone:`caution`}:{label:`Broken links: none found`,tone:`positive`}:e===`partial`?{label:`Broken links: ${da.format(t??0)} found so far${i}`,tone:`caution`}:{label:`Broken links: not checked`,tone:`neutral`}}function Wa(e){return e.showTemplateLinks||!e.known?{value:$(e.total),hiddenNote:null,filtered:!1}:{filtered:!0,value:e.truncated?`${$(e.visible)}+`:$(e.visible),hiddenNote:e.hidden===0?null:e.truncated?`At least ${$(e.hidden)} menu and footer hidden`:`${$(e.hidden)} menu and footer hidden`}}function Ga({label:e,value:t,hiddenNote:n,help:r}){return(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[e,(0,Q.jsx)(B,{text:r})]}),(0,Q.jsx)(`dd`,{className:`mt-1 text-label-14-strong tabular-nums text-heading`,children:t}),n&&(0,Q.jsx)(`dd`,{className:`mt-0.5 text-label-12 text-muted`,children:n})]})}function Ka({page:e,inbound:t,outbound:n}){return(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsxs)(`dl`,{className:`grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsx)(Ga,{label:`Clicks from home`,value:String(e.depth??`Not reached`),help:xa(`clicksFromHome`,!1)}),(0,Q.jsx)(Ga,{label:`Links in`,value:t.value,hiddenNote:t.hiddenNote,help:xa(`linksIn`,t.filtered)}),(0,Q.jsx)(Ga,{label:`Links out`,value:n.value,hiddenNote:n.hiddenNote,help:xa(`linksOut`,n.filtered)}),(0,Q.jsx)(Ga,{label:`Link importance`,value:_a(e.linkScoreNormalized),help:xa(`linkImportance`,!1)})]})})}function qa(e,t,n){return t===0?e===`inbound`?`Nothing links to this page.`:`This page links to nothing.`:`${e===`inbound`?`No links in the page text point here.`:`No links in the page text lead away from here.`} ${n?`At least ${$(t)} menu and footer links hidden.`:`${Sa(t,`menu and footer link`)} hidden.`}`}function Ja({label:e,metric:t}){return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e,(0,Q.jsx)(B,{text:xa(t,!1)})]})}function Ya({direction:e,edges:t,truncated:n,rootHost:r,hiddenTemplateCount:i}){let a=e===`inbound`?`Links in`:`Links out`;return(0,Q.jsxs)(`section`,{className:`min-w-0`,"aria-labelledby":`site-health-${e}-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`h4`,{id:`site-health-${e}-heading`,className:`text-heading-14 text-heading`,children:[a,` (`,$(t.length),`)`]}),n&&(0,Q.jsxs)(`span`,{className:`text-label-12 text-muted`,children:[`First `,aa]})]}),t.length===0?(0,Q.jsx)(`p`,{className:`material-base px-3 py-4 text-copy-14 text-secondary`,children:qa(e,i,n)}):(0,Q.jsx)(`div`,{className:`evidence-table-wrap max-h-64 overflow-auto`,children:(0,Q.jsxs)(`table`,{className:`evidence-table site-health-table min-w-[420px]`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:`Page`}),(0,Q.jsx)(`th`,{scope:`col`,children:`Anchor text`}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Times`,metric:`linkTimes`})})]})}),(0,Q.jsx)(`tbody`,{children:t.map(t=>{let n=e===`inbound`?t.sourceUrl:t.targetUrl;return(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`td`,{className:`max-w-64 truncate font-mono`,title:n,children:U(n,r)}),(0,Q.jsx)(`td`,{className:`max-w-52 truncate`,title:t.anchors.join(`, `)||void 0,children:t.anchors.join(`, `)||`No anchor text`}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(t.occurrences)})]},t.edgeKey)})})]})})]})}function Xa(e){return e&&`indexabilityReasons`in e?e.indexabilityReasons:[]}function Za({page:e,isLoading:t,error:n,inbound:r,outbound:i,inboundTruncated:o,outboundTruncated:s,audit:l,auditLoading:u,auditError:d,onRetryAudit:f,rootHost:p,reasonSource:m,reasonsState:h,onRetryReasons:g,showTemplateLinks:_}){if(!e)return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-label":`Selected page details`,children:[(0,Q.jsx)(`h3`,{className:`text-heading-16 text-heading`,children:`Page links`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Select a page to inspect its internal links and crawl signals.`})]});let v=ga(e),y=Xa(m??e),b=m?.urlVersionOf??null,x=_?r:r.filter(e=>!e.isTemplate),S=_?i:i.filter(e=>!e.isTemplate),C=!t&&!n,ee=r.length-x.length,te=i.length-S.length,ne=Wa({total:e.inboundUniqueEdges,visible:x.length,hidden:ee,truncated:o,showTemplateLinks:_,known:C}),re=Wa({total:e.outboundUniqueEdges,visible:S.length,hidden:te,truncated:s,showTemplateLinks:_,known:C});return(0,Q.jsxs)(`section`,{className:`border-t border-default pt-5`,"aria-labelledby":`site-health-page-inspector-title`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col justify-between gap-3 sm:flex-row sm:items-start`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(`h3`,{id:`site-health-page-inspector-title`,className:`break-words font-mono text-heading-16 text-heading`,children:e.path}),(0,Q.jsx)(A,{tone:v.tone,children:v.label})]}),(0,Q.jsx)(`p`,{className:`mt-1 break-all text-copy-14 text-secondary`,children:e.url}),h===`loading`?(0,Q.jsx)(`p`,{className:`mt-2 text-copy-14 text-secondary`,role:`status`,children:`Loading page details...`}):h===`error`?(0,Q.jsxs)(`p`,{className:`mt-2 flex flex-wrap items-center gap-2 text-copy-14 text-negative`,role:`alert`,children:[`Page details could not be loaded, so any reason this page is hidden is unknown.`,(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:g,children:`Try again`})]}):y.length>0||b?(0,Q.jsxs)(`ul`,{className:`mt-2 flex flex-wrap gap-x-4 gap-y-1 text-label-14 text-secondary`,"aria-label":`Why this page is hidden`,children:[b&&(0,Q.jsx)(`li`,{children:`URL version of ${U(b,p)}, not scored`}),y.map(e=>(0,Q.jsx)(`li`,{children:ta(e)},e))]}):null]}),(0,Q.jsx)(k,{asChild:!0,variant:`secondary`,size:`sm`,children:(0,Q.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:[`Open page `,(0,Q.jsx)(c,{className:`size-3.5`,"aria-hidden":`true`})]})})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)($r,{audit:l,isLoading:u,error:d,onRetry:f})}),(0,Q.jsxs)(`section`,{className:`mt-5 border-t border-default pt-5`,"aria-labelledby":`site-health-page-links-heading`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`h3`,{id:`site-health-page-links-heading`,className:`text-heading-16 text-heading`,children:`Internal links`}),(0,Q.jsx)(B,{text:Ra})]}),(0,Q.jsx)(`div`,{className:`mt-4`,children:(0,Q.jsx)(Ka,{page:e,inbound:ne,outbound:re})}),(0,Q.jsx)(`div`,{className:`mt-5`,children:t?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 py-6 text-label-14 text-secondary`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page links...`]}):n?(0,Q.jsx)(`p`,{className:`rounded-md border border-negative bg-negative-soft px-4 py-3 text-copy-14 text-negative`,role:`alert`,children:`Page links could not be loaded.`}):(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(Ya,{direction:`inbound`,edges:x,truncated:o,rootHost:p,hiddenTemplateCount:ee}),(0,Q.jsx)(Ya,{direction:`outbound`,edges:S,truncated:s,rootHost:p,hiddenTemplateCount:te})]})})]})]})}function Qa({pages:e,total:t,skippedUrlVersions:n,rootHost:r,selectedNodeKey:i,onSelect:o,hasNextPage:s,isFetchingNextPage:c,onLoadMore:l,filter:u,onFilterChange:d,filterUnavailable:f}){let[p,m]=(0,H.useState)(``),g=p.trim().toLowerCase(),_=(0,H.useMemo)(()=>g?e.filter(e=>`${e.path} ${e.url}`.toLowerCase().includes(g)):e,[g,e]),v=g.length>0&&(s||e.length<t);return(0,Q.jsxs)(`section`,{"aria-labelledby":`site-health-inventory-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col justify-between gap-3 sm:flex-row sm:items-end`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{id:`site-health-inventory-heading`,className:`text-heading-16 text-heading`,children:`Pages`}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-copy-14 text-secondary`,children:u===`all`?`Showing ${$(e.length)} of ${$(t)} pages found.`:`Showing ${$(e.length)} of ${$(t)} hidden pages.`}),n!=null&&n>0&&(0,Q.jsx)(B,{...Qi(n)})]})]}),(0,Q.jsxs)(`label`,{className:`relative block w-full sm:w-72`,children:[(0,Q.jsx)(`span`,{className:`sr-only`,children:`Search loaded pages`}),(0,Q.jsx)(h,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`input`,{type:`search`,value:p,onChange:e=>m(e.target.value),placeholder:`Search loaded pages`,className:`h-9 w-full rounded-md border border-base bg-bg pl-9 pr-3 text-label-14 text-primary outline-none placeholder-mono-400 focus:border-strong focus:ring-2 focus:ring-mono-600`})]})]}),(0,Q.jsx)(`div`,{className:`mb-3 flex flex-wrap gap-2`,role:`group`,"aria-label":`Filter pages`,children:Yi.map(e=>(0,Q.jsx)(`button`,{type:`button`,"aria-pressed":u===e.id,onClick:()=>d(e.id),className:`filter-chip ${u===e.id?`filter-chip-active`:``}`,children:e.label},e.id))}),(0,Q.jsx)(`div`,{className:`evidence-table-wrap`,children:(0,Q.jsxs)(`table`,{className:`evidence-table site-health-table min-w-[800px]`,children:[(0,Q.jsx)(`thead`,{children:(0,Q.jsxs)(`tr`,{children:[(0,Q.jsx)(`th`,{scope:`col`,children:`Page`}),(0,Q.jsx)(`th`,{scope:`col`,title:wr(`eligible`),children:`Status`}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Clicks from home`,metric:`clicksFromHome`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Links in`,metric:`linksIn`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Links out`,metric:`linksOut`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Link importance`,metric:`linkImportance`})}),(0,Q.jsx)(`th`,{scope:`col`,children:(0,Q.jsx)(Ja,{label:`Score`,metric:`technicalScore`})})]})}),(0,Q.jsx)(`tbody`,{children:_.map(e=>{let t=ga(e),n=Xi(e.url,e.path,r);return(0,Q.jsxs)(`tr`,{className:i===e.nodeKey?`bg-surface-active`:void 0,children:[(0,Q.jsx)(`td`,{className:`max-w-80`,children:(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>o(e.nodeKey),className:`block max-w-full rounded-sm text-left outline-none focus-visible:ring-2 focus-visible:ring-mono-400`,title:e.url,children:[(0,Q.jsx)(`span`,{className:`block truncate font-mono text-button-14 text-link`,children:n.path}),n.query&&(0,Q.jsx)(`span`,{className:`line-clamp-2 [overflow-wrap:anywhere] text-label-12-mono text-secondary`,children:n.query})]})}),(0,Q.jsx)(`td`,{title:wr(xr(e)),children:(0,Q.jsx)(A,{tone:t.tone,children:t.label})}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:e.depth??`Not reached`}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(e.inboundUniqueEdges)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:$(e.outboundUniqueEdges)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:_a(e.linkScoreNormalized)}),(0,Q.jsx)(`td`,{className:`tabular-nums`,children:va(e)})]},e.nodeKey)})})]})}),_.length===0&&(0,Q.jsx)(`p`,{className:`border-x border-b border-default px-4 py-8 text-center text-copy-14 text-secondary`,children:g.length===0?f?`This scan cannot be filtered. Run a new scan to filter its pages.`:u===`hidden`?`No hidden pages were found in this scan.`:`No pages are available.`:v?`No matches in the ${$(e.length)} loaded pages. Load more pages to continue searching.`:`No pages match this search.`}),s&&(0,Q.jsx)(`div`,{className:`flex justify-center border-x border-b border-default px-4 py-3`,children:(0,Q.jsxs)(k,{variant:`secondary`,size:`sm`,disabled:c,onClick:l,children:[c&&(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),c?`Loading more pages`:`Load more pages`]})})]})}function $a({projectName:e,runId:t,section:n,onSelect:r}){let[i,a]=(0,H.useState)(!1),s=n.pageCount-+!!n.hasPage>0;return(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`div`,{className:`flex min-h-11 items-center gap-1 px-2 py-1`,children:[s?(0,Q.jsx)(`button`,{type:`button`,"aria-label":`${i?`Collapse`:`Expand`} ${n.path}`,"aria-expanded":i,onClick:()=>a(e=>!e),className:`flex size-8 shrink-0 items-center justify-center rounded-sm text-muted outline-none hover:bg-surface-hover hover:text-heading focus-visible:ring-2 focus-visible:ring-mono-400`,children:i?(0,Q.jsx)(l,{className:`size-3.5`,"aria-hidden":`true`}):(0,Q.jsx)(o,{className:`size-3.5`,"aria-hidden":`true`})}):(0,Q.jsx)(`span`,{className:`block size-8 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>r(n.path),className:`min-w-0 flex-1 break-all rounded-sm py-2 text-left font-mono text-button-14 text-heading outline-none hover:text-link focus-visible:ring-2 focus-visible:ring-mono-400`,children:n.path}),(0,Q.jsx)(`span`,{className:`shrink-0 px-2 text-label-12-mono text-muted`,children:$(n.pageCount)})]}),i&&(0,Q.jsx)(`div`,{className:`ml-6 border-l border-default pl-1`,children:(0,Q.jsx)(to,{projectName:e,runId:t,parentPath:n.path,onSelect:r})})]})}function eo({page:e,onSelect:t}){return(0,Q.jsx)(`li`,{className:`bg-surface-subtle`,children:(0,Q.jsxs)(`div`,{className:`flex min-h-11 items-center gap-1 px-2 py-1`,children:[(0,Q.jsx)(`span`,{className:`block size-8 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>t(e.nodeKey),className:`min-w-0 flex-1 break-all rounded-sm py-2 text-left font-mono text-button-14 text-heading outline-none hover:text-link focus-visible:ring-2 focus-visible:ring-mono-400`,children:e.path||`/`}),(0,Q.jsx)(`span`,{className:`shrink-0 px-2 text-label-12-mono text-muted`,children:$(1)})]})})}function to({projectName:e,runId:t,parentPath:n,onSelect:r,rootPage:i,onSelectRootPage:o}){let s={client:O,path:{name:e},query:{runId:t,parentPath:n,limit:ia}},c=ee({...Ne(s),initialPageParam:s,getNextPageParam:e=>e.nextCursor?{path:s.path,query:{...s.query,cursor:e.nextCursor}}:void 0}),l=c.data?.pages.flatMap(e=>e.children)??[];return c.isLoading?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),` Loading sections...`]}):c.error?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-negative`,role:`alert`,children:`Site sections could not be loaded.`}):l.length===0&&!i?(0,Q.jsx)(`p`,{className:`px-3 py-4 text-copy-14 text-secondary`,children:`No nested sections were found.`}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`ul`,{className:`divide-y divide-default`,children:[i&&o&&(0,Q.jsx)(eo,{page:i,onSelect:o}),l.map(n=>(0,Q.jsx)($a,{projectName:e,runId:t,section:n,onSelect:r},n.path))]}),c.hasNextPage&&(0,Q.jsx)(`div`,{className:`px-3 py-2`,children:(0,Q.jsx)(k,{variant:`ghost`,size:`sm`,disabled:c.isFetchingNextPage,onClick:()=>void c.fetchNextPage(),children:c.isFetchingNextPage?`Loading more sections`:`Load more sections`})})]})}function no(){return(0,Q.jsx)(`div`,{role:`status`,className:`flex min-h-[420px] items-center justify-center material-base px-6 text-center lg:min-h-[520px]`,children:(0,Q.jsxs)(`div`,{className:`max-w-sm`,children:[(0,Q.jsx)(a,{className:`mx-auto size-5 motion-safe:animate-spin text-muted`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{className:`mt-3 text-copy-14-strong text-heading`,children:`Preparing the interactive site map`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Page and link data is ready for the graph renderer.`})]})})}function ro(e){return e===`discovering`?`Discovering pages`:e===`checking`?`Checking pages`:e===`arranging-map`?`Arranging map`:e===`queued`?`Waiting to start`:`Preparing scan`}var io=3;function ao(e){return e===`checking`?1:e===`arranging-map`?2:0}function oo({phase:e,pagesChecked:t,pageLimit:n,finalStep:r}){let i=ao(e),a=i===1&&t!==null&&n?Math.min(1,t/n):null,o=[`Find pages`,i===1&&t!==null?`Check pages · ${$(t)}${n?` of up to ${$(n)}`:``}`:`Check pages`,r];return(0,Q.jsxs)(`div`,{className:`mt-4`,role:`progressbar`,"aria-label":`Scan progress`,"aria-valuemin":0,"aria-valuemax":io,"aria-valuenow":i+(a??0),"aria-valuetext":o[i],children:[(0,Q.jsx)(`div`,{className:`grid grid-cols-[1fr_2fr_1fr] gap-1.5`,"aria-hidden":`true`,children:o.map((e,t)=>(0,Q.jsx)(`div`,{className:`h-2 overflow-hidden rounded-full bg-surface-inset`,children:t<i?(0,Q.jsx)(`div`,{className:`h-full w-full rounded-full bg-positive-400`}):t===i&&a!==null?(0,Q.jsx)(`div`,{className:`h-full rounded-full bg-positive-400 transition-[width] duration-500`,style:{width:`${Math.max(4,a*100)}%`}}):t===i?(0,Q.jsx)(`div`,{className:`h-full w-full rounded-full bg-positive-400/40 motion-safe:animate-pulse`}):null},e))}),(0,Q.jsx)(`div`,{className:`mt-2 grid grid-cols-[1fr_2fr_1fr] gap-1.5 text-label-14`,"aria-hidden":`true`,children:o.map((e,t)=>(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 truncate ${t===i?`text-label-14-strong text-heading`:t<i?`text-secondary`:`text-muted`}`,children:[t<i?(0,Q.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`,"aria-hidden":`true`}):null,(0,Q.jsx)(`span`,{className:`truncate`,children:e})]},e))})]})}function so(e){return e!==`completed`&&e!==`partial`&&e!==`failed`&&e!==`cancelled`}function co(e){return e===`queued`||e===`discovering`||e===`checking`||e===`arranging-map`}function lo(e){return e===`completed`||e===`partial`||e===`failed`||e===`cancelled`}function uo(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.code==`string`)return t.code;if(t.error&&typeof t.error==`object`){let e=t.error;return typeof e.code==`string`?e.code:null}return null}function fo(e){if(!e)return null;let t=Date.parse(e);return!Number.isFinite(t)||t>Date.now()?null:t+la}function po({active:e,runId:t,createdAt:n}){let r=fo(n),[i,a]=(0,H.useState)(null);return(0,H.useEffect)(()=>{if(!e||!t||r==null){a(null);return}let n=r-Date.now();if(n<=0){a({runId:t,deadline:r});return}a(null);let i=window.setTimeout(()=>a({runId:t,deadline:r}),n);return()=>window.clearTimeout(i)},[e,r,t]),e&&t!=null&&r!=null&&(Date.now()>=r||i?.runId===t&&i.deadline===r)}function mo({onContinueOnboarding:e,onSkipOnboarding:t}){return(0,Q.jsxs)(`section`,{"aria-labelledby":`site-health-continuation-heading`,className:`mt-5 flex flex-col gap-3 border-t border-default pt-5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{id:`site-health-continuation-heading`,className:`text-heading-16 text-heading`,children:`Continue while Site Health finishes`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`Canonry will finish this scan locally. Saved results will appear in Site Health.`})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsx)(k,{type:`button`,onClick:e,children:`Set up AI Visibility`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,onClick:t,children:`Skip for now`})]})]})}function ho({view:e,tabbed:t=!0,children:n}){return(0,Q.jsx)(`div`,{id:t?`site-health-${e}-panel`:void 0,role:t?`tabpanel`:void 0,"aria-labelledby":t?`site-health-${e}-tab`:void 0,className:`min-w-0`,children:n})}function go({status:e,progress:t,progressError:n,onRetryProgress:r,pageHealthDestination:i=!1,firstLook:a=!1,boundedPageLimit:o,livePageHealthPreview:s,livePageHealthError:c=!1,livePageHealthRunId:l=null,continuation:u}){let d=t?.attempt??null,f=t?.phase??e,p=f===`arranging-map`;return(0,Q.jsxs)(`section`,{"aria-label":`Current scan progress`,className:`material-base px-5 py-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-6 items-center gap-2`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:p&&i?`Preparing page health`:p?`Preparing site map`:a?`Checking your site`:`Scanning site`}),a?(0,Q.jsx)(B,{text:o?`A quick scan to find your first fixes. Reads up to ${o} pages, or stops sooner at the time limit, so results come back fast. You can run a larger scan from Site Health later.`:`A quick scan to find your first fixes. Stops at its page budget or the time limit, so results come back fast. You can run a larger scan from Site Health later.`}):null]}),(0,Q.jsx)(`p`,{"aria-atomic":`true`,"aria-label":`Current scan progress`,"aria-live":`polite`,role:`status`,className:`sr-only`,children:i?p?`Finalizing page health. The scan is complete and its findings are being published.`:`${ro(f)}. Page health appears after the scan finishes.`:p?`Arranging map. The scan is complete and its map is being published.`:`${ro(f)}. The map appears after the scan finishes.`}),(0,Q.jsx)(oo,{phase:f,pagesChecked:d?.pagesFetched??null,pageLimit:o??null,finalStep:i?`Build report`:`Build map`}),(0,Q.jsxs)(`dl`,{"aria-label":`Live scan counters`,className:`mt-5 grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages found`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesDiscovered):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages checked`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesFetched):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Links found`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.edgesDiscovered):`—`})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`dt`,{className:`text-label-14 text-secondary`,children:`Pages failed`}),(0,Q.jsx)(`dd`,{className:`mt-1 font-mono text-label-18-strong tabular-nums text-heading`,children:d?$(d.pagesErrored):`—`})]})]}),n&&(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3 text-label-14 text-secondary`,children:[(0,Q.jsx)(`span`,{children:p?i?`Page health publishing status could not load.`:`Map publishing status could not load.`:`Live scan counts could not load. The scan is still running.`}),r&&(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:r,children:`Retry progress`})]}),i?(0,Q.jsx)(xo,{runId:l,preview:s,error:c}):null,u]})}function _o(){return Array.from({length:ua},()=>null)}function vo(e,t){return e===t||e!=null&&t!=null&&e.nodeKey===t.nodeKey&&e.url===t.url&&e.auditScore===t.auditScore&&e.checksNeedingAttention===t.checksNeedingAttention}function yo(e,t){return e.length===t.length&&e.every((e,n)=>vo(e,t[n]??null))}function bo(e,t){let n=[...e];for(let e of t){let t=n.findIndex(t=>t?.nodeKey===e.nodeKey);if(t>=0){n[t]=e;continue}let r=n.findIndex(e=>e==null);if(r<0)break;n[r]=e}return n}function xo({runId:e,preview:t,error:n=!1}){let[r,i]=(0,H.useState)(()=>({runId:e,slots:_o()})),a=t?.state===`terminal`,o=a||r.runId!==e?_o():r.slots;(0,H.useEffect)(()=>{i(n=>{let r=n.runId===e?n.slots:_o(),i=a?_o():bo(r,t?.examples??[]);return n.runId===e&&yo(n.slots,i)?n:{runId:e,slots:i}})},[t?.examples,e,a]);let s=t?.pagesAudited??0,c=o.some(e=>e!=null);return(0,Q.jsxs)(`section`,{"aria-labelledby":`live-page-health-findings-heading`,className:`mt-5 border-t border-default pt-5`,children:[(0,Q.jsx)(`h3`,{id:`live-page-health-findings-heading`,className:`text-heading-16 text-heading`,children:`Findings so far`}),(0,Q.jsxs)(`div`,{className:`relative mt-1 min-h-[5.25rem] text-label-14 text-secondary sm:min-h-[3.5rem]`,children:[(0,Q.jsxs)(`p`,{children:[`Based on `,da.format(s),` audited pages. Results may change until the scan finishes.`]}),(0,Q.jsx)(`p`,{className:D(`absolute bottom-0 text-caution`,n?`visible`:`invisible`),children:`Live findings paused. The scan is still running.`})]}),(0,Q.jsx)(`ul`,{"aria-label":`Live Page Health findings`,className:`mt-3 grid h-[10.5rem] grid-rows-3 divide-y divide-default overflow-hidden material-base`,children:o.map((e,t)=>{let n=e==null&&t===0&&!c;return(0,Q.jsx)(`li`,{"aria-hidden":e==null&&!n||void 0,"data-testid":`live-page-health-slot`,className:`grid h-14 min-h-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-4 sm:gap-4`,children:e?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`min-w-0 truncate text-label-14-strong text-strong`,title:e.url,children:e.url}),(0,Q.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap text-label-14 tabular-nums text-secondary`,children:[(0,Q.jsxs)(`span`,{"aria-hidden":`true`,className:`sm:hidden`,children:[da.format(e.checksNeedingAttention),` checks`]}),(0,Q.jsxs)(`span`,{className:`hidden sm:inline`,children:[da.format(e.checksNeedingAttention),` checks need attention`]}),(0,Q.jsxs)(`span`,{className:`sr-only sm:hidden`,children:[da.format(e.checksNeedingAttention),` checks need attention`]})]})]}):n?(0,Q.jsx)(`span`,{className:`text-label-14 text-secondary`,children:`Checks that need attention will appear here.`}):null},`live-page-health-slot-${t}`)})})]})}function So({phase:e,progress:t,onRunAgain:n,pageHealthDestination:r=!1}){let i=e===`cancelled`,a=t?.error??t?.attempt?.error;return(0,Q.jsxs)(`section`,{"aria-label":`Site scan recovery`,role:`alert`,className:`rounded-md border border-negative bg-negative-soft px-5 py-6`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-negative`,children:i?`Scan cancelled`:`Scan failed`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:r?i?`The scan was cancelled before Canonry could publish page health results.`:`The scan did not complete, so page health results are unavailable.`:i?`The scan was cancelled before Canonry could publish a site map.`:`The scan did not complete, so there is no site map for this run.`}),a&&(0,Q.jsx)(`p`,{className:`mt-3 text-copy-14 text-negative`,children:a}),n&&(0,Q.jsx)(k,{type:`button`,className:`mt-4`,onClick:n,children:`Run scan again`})]})}function Co({projectName:e,projectId:t,initialRunId:n,onReleaseInitialRun:r,showOnboardingActions:i=!1,onContinueOnboarding:o,onSkipOnboarding:s}){let c=(0,H.useId)(),[l,u]=(0,H.useState)(`map`),d=(0,H.useRef)([]),[f,p]=(0,H.useState)(()=>n??null),[m,h]=(0,H.useState)(null),g=(0,H.useRef)(n),[v,b]=(0,H.useState)(null),[S,te]=(0,H.useState)(!1),[ne,re]=(0,H.useState)(!1),[ie,ae]=(0,H.useState)(!0),[oe,se]=(0,H.useState)(null),[ce,w]=(0,H.useState)(null),[de,E]=(0,H.useState)(!1),[fe,pe]=(0,H.useState)(`all`),[me,he]=(0,H.useState)(!1),ge=ye(),{isAdmin:_e}=be(),j=ue(),M=(j||T(le[`site-audit`]))&&!_e,N=i&&!ge,P=Qe(),xe=!N&&!ge&&!M,we=C({...je({client:O,path:{name:e}}),enabled:xe,staleTime:Se});(0,H.useEffect)(()=>{let e=g.current;e!==n&&(g.current=n,p(t=>n??(t===e?null:t)),b(null))},[n]);let Oe=C({...Ie({client:O,path:{name:e},query:{limit:na}}),refetchOnWindowFocus:`always`,refetchInterval:e=>e.state.data?.scans.some(e=>e.status===`queued`||e.status===`running`)?3e3:15e3}),Ae=Oe.data?.scans??[],Ne=Ae.find(e=>e.status===`queued`||e.status===`running`),Fe=Ae.find(e=>e.status===`completed`||e.status===`partial`),Le=N?P.data?.runId??null:null,Re=N?null:P.data?.runId??null,ze=Re&&Re!==m&&Ae.some(e=>e.runId===Re&&(e.status===`completed`||e.status===`partial`))?Re:null,L=f??(N?Le??Ne?.runId??Fe?.runId:ze??Oe.data?.preferredRunId??Fe?.runId??Ne?.runId)??null,Be=Ne?.runId===L?Ne:null,R=L?Ae.find(e=>e.runId===L):void 0,Ve=!!(n&&L===n),He=!!(Le&&L===Le),Ue=He&&!R,We=Be?.runId??(Ve||Ue?L:null),z=C({...Me({client:O,path:{name:e,runId:We??``}}),enabled:!!We,refetchInterval:e=>so(e.state.data?.phase)?3e3:!1,refetchIntervalInBackground:!0});(0,H.useEffect)(()=>{Ve&&z.isError&&uo(z.error)===`NOT_FOUND`&&(p(null),b(null),r?.())},[z.error,z.isError,Ve,r]);let Ge=co(z.data?.phase),Ke=lo(z.data?.phase)?null:Be,qe=!!(We&&z.isPending),Je=!(!Ve&&!He||R||!z.isError),Ye=!!(N&&We&&(Ke?.runId===We||Ge)),Xe=C({...Ce({client:O,path:{name:e,runId:We??``}}),enabled:Ye,refetchInterval:e=>e.state.data?.state!==`terminal`&&3e3,refetchIntervalInBackground:!0}),$e=!!(Ke||Ge||qe||Je),nt=z.data?.phase===`failed`||z.data?.phase===`cancelled`?z.data.phase:(Ve||He)&&(R?.status===`failed`||R?.status===`cancelled`)?R.status:null,st=C({...F({client:O,path:{name:e},...L?{query:{runId:L}}:{}}),enabled:!$e}),V=st.data,ct=L??V?.runId??null,dt=!!(ct&&V?.hasCrawlData&&V.detailsAvailable),pt=dt&&!N,mt=ct?{runId:ct}:{},U=C({...I({client:O,path:{name:e},query:{...mt,maxNodes:sa,maxEdges:ca}}),enabled:pt&&!$e}),ht=Yi.find(e=>e.id===fe)?.healthState,gt={client:O,path:{name:e},query:{...mt,...ht?{healthState:ht}:{},urlVersions:`exclude`,limit:ra,sort:`path`}},_t=ee({...De(gt),enabled:pt,initialPageParam:gt,getNextPageParam:e=>e.nextCursor?{path:gt.path,query:{...gt.query,cursor:e.nextCursor}}:void 0}),vt=pt&&(V?.deadLinks.state===`complete`||V?.deadLinks.state===`partial`),W=C({...Ee({client:O,path:{name:e},query:{...mt,limit:oa}}),enabled:vt}),G=U.data?.nodes??[],K=U.data?.layout.state===`ready`?U.data.totalEdges:null,yt=U.data?.edges??[],bt=(0,H.useMemo)(()=>yt.filter(e=>e.isTemplate).length,[yt]),xt=yt.length-bt,St=U.data?.templateDetection??null,Ct=St===null||!ve(St),wt=(0,H.useMemo)(()=>me||Ct?yt:yt.filter(e=>!e.isTemplate),[yt,me,Ct]),Tt=U.data?.layout.state===`ready`&&!U.data.layout.templateLinksExcluded,Et=(0,H.useMemo)(()=>_t.data?.pages.flatMap(e=>e.pages)??[],[_t.data]),q=_t.data?.pages[0]?.total??Et.length,J=(0,H.useMemo)(()=>Et.find(e=>e.nodeKey===v)??null,[Et,v]),Y=!!(dt&&v&&!J),Dt=C({...Pe({client:O,path:{name:e},query:{...mt,...ht?{healthState:ht}:{},nodeKey:v??void 0,limit:1}}),enabled:Y}),Ot=J??Dt.data?.pages[0]??null,kt=!!(v&&ht&&Y&&Dt.isSuccess&&Dt.data.healthStateFilter===`applied`&&Dt.data.pages.length===0);(0,H.useEffect)(()=>{kt&&b(null)},[kt]);let At=(0,H.useMemo)(()=>kt?null:G.find(e=>e.nodeKey===v)??Ot,[G,Ot,v,kt]),jt=At?.nodeKey??null;at(e,{view:`site-health`,page:{...ct?{runId:ct}:{},...jt?{nodeKey:jt}:{}}});let Mt=At?Ot?`ready`:Dt.isError?`error`:Y&&Dt.isLoading?`loading`:`ready`:`idle`,Nt=C({...ke({client:O,path:{name:e},query:{...mt,nodeKey:jt??void 0,limit:aa}}),enabled:pt&&!!jt}),Pt=C({...Te({client:O,path:{name:e},query:{...mt,nodeKey:jt??void 0}}),enabled:pt&&!!jt}),Ft=(0,H.useMemo)(()=>{let e=Ae.filter(e=>e.status===`completed`||e.status===`partial`),t=f?Ae.find(e=>e.runId===f):void 0;return t&&!e.some(e=>e.runId===t.runId)?[t,...e]:e},[Ae,f]),It=Ae[0]?.status??null,Lt=ct?R:void 0,Rt=Ke?Ke.status:Ge?z.data?.status??null:nt??V?.runStatus??Lt?.status??null,zt=Rt===`running`?`Scan running`:Rt===`queued`?`Scan queued`:Rt===`partial`?`Partial scan`:Rt===`completed`?`Complete`:Rt===`failed`?`Scan failed`:Rt===`cancelled`?`Scan cancelled`:`No scan`,Bt=W.data,Vt=Bt&&`found`in Bt?Bt:V?.deadLinks&&`found`in V.deadLinks?V.deadLinks:void 0,Ht=Ua(Bt?.state??V?.deadLinks?.state??`unavailable`,Vt?.found,Vt?.unverified),Ut=Ca(V?.requestedRootUrl??null,V?.rootUrl??null),Wt=ft(V?.rootUrl??null),Gt=U.data?.rootNodeKey??null,Kt=C({...Pe({client:O,path:{name:e},query:{...mt,nodeKey:Gt??void 0,limit:1}}),enabled:!!(dt&&Gt)}),qt=(0,H.useMemo)(()=>G.find(e=>e.nodeKey===Gt)??Kt.data?.pages[0]??null,[G,Gt,Kt.data]),Jt=Ne&&Ne.runId!==L?Ne:null,Yt=P.isPending||!!Ke||!!Jt||Ge||qe,Xt=$e||N&&P.isPending,Zt=R?.status===`queued`||R?.status===`running`,Qt=po({active:N&&Xt&&!!(o&&s)&&!!(Zt||We===L&&Ge),runId:L,createdAt:R?.createdAt}),$t=N&&!L&&!Oe.isSuccess,en=N&&Oe.isSuccess&&Ae.length===0&&!L&&!P.isPending,tn=en&<(e),nn=$t?Oe.isError?`Scan history could not be loaded`:`Checking scan history…`:en?tn?`Site scan skipped`:`No site scan yet`:`Page health results unavailable`,rn=$t?`Scan status is not confirmed. Check scan history before starting a scan.`:en?`No scan has been started for this project. Run a first scan or continue without scanning.`:`This scan did not produce page health results. Run it again to continue setup.`,an=!(!V?.hasCrawlData||Xt||nt),X=N?an?`technical`:`map`:l,on=X===`technical`?`map`:X,sn=e=>{p(e||null),h(Re),b(null)},cn=()=>{(!j&&!T(le[`site-audit`])||_e)&&(p(null),b(null),n&&r?.(),N&&E(!0),P.mutate({projectName:e,projectId:t,body:{checkDeadLinks:N||S,...ne?{includeGeo:!0}:{},...ie?{}:{includeAgentSkills:!1},...N?{maxPages:100}:oe===null?{}:{maxPages:oe},...N||ce===null?{}:{maxDepth:ce}}}))},ln=e=>{let t=G.find(t=>t.path===e||t.path.startsWith(`${e}/`));t&&b(t.nodeKey)},un=e=>u(e),dn=(e,t)=>{let n=null;e.key===`ArrowRight`||e.key===`ArrowDown`?n=(t+1)%qi.length:e.key===`ArrowLeft`||e.key===`ArrowUp`?n=(t-1+qi.length)%qi.length:e.key===`Home`?n=0:e.key===`End`&&(n=qi.length-1),n!=null&&(e.preventDefault(),un(qi[n].id),d.current[n]?.focus())};return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[N?(0,Q.jsx)(rt,{current:an?`fixes`:`site`}):null,!N&&(0,Q.jsxs)(`header`,{className:`flex flex-col justify-between gap-4 lg:flex-row lg:items-start`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-20 text-heading`,children:`Site Health`}),(0,Q.jsx)(B,{text:Ji[X]}),(0,Q.jsx)(A,{tone:wa(Rt),children:zt}),Lt&&(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:ma(Lt.finishedAt??Lt.startedAt)})]})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,Q.jsxs)(`div`,{className:`grid gap-1 text-label-12 text-muted`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`label`,{htmlFor:c,children:`Scan history`}),(0,Q.jsx)(B,{text:Ea,placement:`bottom`})]}),(0,Q.jsxs)(`select`,{id:c,"aria-label":`View a Site Health scan`,value:f??ze??``,onChange:e=>sn(e.target.value),className:`h-9 min-w-48 rounded-md border border-base bg-bg px-3 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:Ta}),Ft.map(e=>(0,Q.jsx)(`option`,{value:e.runId,children:Da(e)},e.runId))]})]}),!ge&&!M&&(0,Q.jsxs)(`div`,{className:`flex items-end gap-2 pt-5`,children:[(0,Q.jsxs)(`details`,{className:`group relative`,children:[(0,Q.jsxs)(`summary`,{className:`flex h-9 cursor-pointer list-none items-center gap-2 rounded-md border border-base bg-bg px-3 text-label-14-strong text-heading outline-none hover:bg-bg-elevated focus-visible:ring-2 focus-visible:ring-mono-400`,children:[(0,Q.jsx)(_,{className:`size-4`,"aria-hidden":`true`}),`Scan settings`]}),(0,Q.jsxs)(`div`,{className:`absolute left-0 z-20 mt-2 w-72 material-menu p-4 sm:left-auto sm:right-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Check dead links`,(0,Q.jsx)(B,{text:`Adds dead-link analysis to this scan. Slower on a large site.`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Check dead links`,checked:S,disabled:Yt,onChange:e=>te(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Geographic signals`,(0,Q.jsx)(B,{text:qr[`geographic-signals`],placement:`bottom`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Geographic signals`,checked:ne,disabled:Yt,onChange:e=>re(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 text-label-14 text-heading`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong`,children:[`Agent integrations`,(0,Q.jsx)(B,{text:qr[`agent-skill-exposure`],placement:`bottom`})]}),(0,Q.jsx)(`input`,{type:`checkbox`,"aria-label":`Agent integrations`,checked:ie,disabled:Yt,onChange:e=>ae(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`})]}),(0,Q.jsxs)(`div`,{className:`mt-4`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong text-heading`,children:[`Page budget`,(0,Q.jsx)(B,{text:tt,placement:`bottom`})]}),(0,Q.jsxs)(`select`,{"aria-label":`Page budget`,value:oe===null?``:String(oe),disabled:Yt,onChange:e=>se(e.target.value===``?null:Number(e.target.value)),className:`mt-1 h-9 w-full rounded-md border border-base bg-bg px-2 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:[(0,Q.jsx)(`option`,{value:``,children:it(we.data)}),[...ot(we.data)?[ot(we.data)]:[],...ka].map(e=>(0,Q.jsx)(`option`,{value:String(e.value),children:e.label},e.value))]})]}),(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-label-14-strong text-heading`,children:[`Crawl depth`,(0,Q.jsx)(B,{text:`How far from the home page to follow links. A smaller scan is what fixes a scan that ran out of time.`})]}),(0,Q.jsx)(`select`,{"aria-label":`Crawl depth`,value:ce===null?``:String(ce),disabled:Yt,onChange:e=>w(e.target.value===``?null:Number(e.target.value)),className:`mt-1 h-9 w-full rounded-md border border-base bg-bg px-2 text-label-14 text-primary outline-none focus:border-strong focus:ring-2 focus:ring-mono-600`,children:Aa.map(e=>(0,Q.jsx)(`option`,{value:e.value===null?``:String(e.value),children:e.label},String(e.value)))})]})]})]}),(0,Q.jsxs)(ut,{onClick:cn,disabled:Yt,children:[Yt?(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}):(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),Ne?.status===`running`?`Scan running`:Ne?.status===`queued`?`Scan queued`:`Run scan`]})]})]})]}),M&&(0,Q.jsx)(et,{projectName:e,kind:le[`site-audit`],loadSchedule:!j}),V?.hasCrawlData&&X!==`technical`&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 divide-x divide-y divide-default material-base sm:grid-cols-4 sm:divide-y-0`,children:[(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Pages found`,(0,Q.jsx)(B,{text:xa(`pagesFound`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesDiscovered)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Pages checked`,(0,Q.jsx)(B,{text:xa(`pagesChecked`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesFetched)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsx)(`div`,{className:`text-label-12 text-muted`,title:wr(`eligible`),children:`Indexable`}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(V.counts.pagesEligible)})]}),(0,Q.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1 text-label-12 text-muted`,children:[`Internal links`,(0,Q.jsx)(B,{text:xa(`internalLinks`,!1)})]}),(0,Q.jsx)(`div`,{className:`mt-1 text-label-20-strong tabular-nums text-heading`,children:$(K)})]})]}),!N&&(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-b border-default`,children:[(0,Q.jsx)(`div`,{role:`tablist`,"aria-label":`Site Health views`,"aria-orientation":`horizontal`,className:`flex min-w-0 gap-5`,children:qi.map((e,t)=>(0,Q.jsx)(`button`,{type:`button`,role:`tab`,id:`site-health-${e.id}-tab`,"aria-selected":X===e.id,"aria-controls":`site-health-${e.id}-panel`,tabIndex:X===e.id?0:-1,ref:e=>{d.current[t]=e},onClick:()=>un(e.id),onKeyDown:e=>dn(e,t),className:`min-h-11 border-b-2 px-0.5 text-button-14 outline-none transition-colors focus-visible:ring-2 focus-visible:ring-mono-400 disabled:cursor-not-allowed disabled:opacity-50 ${X===e.id?`border-strong text-heading`:`border-transparent text-secondary hover:border-base hover:text-primary`}`,children:e.label},e.id))}),V?.hasCrawlData&&X!==`technical`&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 pb-2`,children:[(0,Q.jsx)(`span`,{className:`text-label-12 text-muted`,children:`Dead-link check`}),(0,Q.jsx)(A,{tone:Ht.tone,children:Ht.label})]})]}),!f&&Ne&&!Ke&&(0,Q.jsx)(`div`,{className:`rounded-md border border-caution bg-caution-soft px-4 py-3 text-label-14 text-caution`,role:`status`,children:`A newer scan is running. The latest published result remains available until it finishes.`}),Ut&&(0,Q.jsxs)(`div`,{className:`material-base px-4 py-3 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(`span`,{className:`text-label-14-strong text-heading`,children:`Site address changed during this scan.`}),` `,`The scan started at `,(0,Q.jsx)(`span`,{className:`font-mono text-primary`,children:Ut.requested}),` and continued at`,` `,(0,Q.jsx)(`span`,{className:`font-mono text-primary`,children:Ut.effective}),`.`,` `,N?`Page health uses the new address.`:`The map and inventory use the new address.`]}),V?.hasCrawlData&&!V.complete&&(0,Q.jsxs)(`div`,{className:`rounded-md border border-caution bg-caution-soft px-4 py-3 text-label-14 text-caution`,role:`status`,children:[Na(V.termination),` `,!ge&&!M?Ma(V.termination,N):null]}),!Ne&&It===`failed`&&!f&&(0,Q.jsxs)(`div`,{className:`flex gap-3 rounded-md border border-negative bg-negative-soft px-4 py-3 text-label-14 text-negative`,role:`alert`,children:[(0,Q.jsx)(y,{className:`mt-0.5 size-4 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{children:`The latest scan failed. The previous completed results remain available.`})]}),nt?(0,Q.jsx)(ho,{view:on,tabbed:!N,children:(0,Q.jsx)(So,{phase:nt,progress:z.data,onRunAgain:M?void 0:cn,pageHealthDestination:N})}):Xt?(0,Q.jsx)(ho,{view:on,tabbed:!N,children:(0,Q.jsx)(go,{status:z.data?.phase??(Ke?.status===`running`?`running`:`queued`),progress:z.data,progressError:z.isError,onRetryProgress:()=>{z.refetch()},pageHealthDestination:N,firstLook:N,boundedPageLimit:N&&de?100:void 0,livePageHealthPreview:Xe.data,livePageHealthError:Xe.isError,livePageHealthRunId:We,continuation:Qt?(0,Q.jsx)(mo,{onContinueOnboarding:o,onSkipOnboarding:s}):null})}):X===`technical`?(0,Q.jsxs)(`div`,{id:`site-health-technical-panel`,role:N?void 0:`tabpanel`,"aria-labelledby":N?void 0:`site-health-technical-tab`,className:`min-w-0 space-y-6`,children:[N?(0,Q.jsx)(`h2`,{className:`text-heading-20 text-heading`,children:`Page health`}):null,(0,Q.jsx)(Wi,{projectName:e,projectId:t,runId:ct,integrated:!0,compactCopy:N,afterSummary:N&&an?(0,Q.jsxs)(`section`,{"aria-labelledby":`ai-visibility-next-heading`,className:`flex flex-col gap-3 border-b border-default py-5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{id:`ai-visibility-next-heading`,className:`text-heading-16 text-heading`,children:`Next: Set up AI Visibility`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`See whether answer engines mention your brand and cite your pages.`})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-wrap gap-2`,children:[(0,Q.jsx)(k,{type:`button`,onClick:o,children:`Set up AI Visibility`}),(0,Q.jsx)(k,{type:`button`,variant:`secondary`,onClick:s,children:`Skip for now`})]})]}):void 0,unavailableFooter:N&&an&&!M?(0,Q.jsx)(`section`,{"aria-label":`Page health recovery`,className:`mt-4`,children:(0,Q.jsx)(k,{type:`button`,disabled:Yt,onClick:()=>{u(`map`),cn()},children:`Run site audit again`})}):void 0})]}):st.isLoading?(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`div`,{className:`flex min-h-72 items-center justify-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading site health...`]})}):st.error?(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`rounded-md border border-negative bg-negative-soft px-5 py-6`,role:`alert`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-14 text-negative`,children:`Site Health could not load`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-negative`,children:`Try loading the crawl again.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:()=>void st.refetch(),children:`Try again`})]})}):V?.hasCrawlData?V.detailsAvailable?X===`inventory`?(0,Q.jsxs)(`div`,{id:`site-health-inventory-panel`,role:`tabpanel`,"aria-labelledby":`site-health-inventory-tab`,className:`space-y-5`,children:[_t.isLoading?(0,Q.jsxs)(`div`,{className:`flex min-h-56 items-center justify-center gap-2 text-label-14 text-secondary`,role:`status`,children:[(0,Q.jsx)(a,{className:`size-4 motion-safe:animate-spin`,"aria-hidden":`true`}),`Loading page inventory...`]}):_t.error?(0,Q.jsx)(`p`,{className:`rounded-md border border-negative bg-negative-soft px-4 py-3 text-copy-14 text-negative`,role:`alert`,children:`The page inventory could not be loaded.`}):(0,Q.jsx)(Qa,{pages:Et,total:q,skippedUrlVersions:Zi(_t.data?.pages[0]?.inventorySummary),rootHost:Wt,filterUnavailable:_t.data?.pages[0]?.healthStateFilter===`unavailable-legacy-scan`,selectedNodeKey:jt,onSelect:b,hasNextPage:!!_t.hasNextPage,isFetchingNextPage:_t.isFetchingNextPage,onLoadMore:()=>void _t.fetchNextPage(),filter:fe,onFilterChange:pe}),(0,Q.jsx)(Za,{page:At,isLoading:Nt.isLoading&&!!At,error:Nt.error,inbound:Nt.data?.inbound??[],outbound:Nt.data?.outbound??[],inboundTruncated:Nt.data?.inboundTruncated??!1,outboundTruncated:Nt.data?.outboundTruncated??!1,audit:Pt.data,auditLoading:Pt.isLoading&&!!At,auditError:Pt.error,onRetryAudit:()=>{Pt.refetch()},rootHost:Wt,reasonSource:Ot,reasonsState:Mt,onRetryReasons:()=>{Dt.refetch()},showTemplateLinks:me||Ct})]}):(0,Q.jsxs)(`div`,{id:`site-health-map-panel`,role:`tabpanel`,"aria-labelledby":`site-health-map-tab`,className:`space-y-5`,children:[(0,Q.jsxs)(`section`,{"aria-labelledby":`site-map-heading`,children:[(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col justify-between gap-2 sm:flex-row sm:items-end`,children:[(0,Q.jsx)(`div`,{children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`h2`,{id:`site-map-heading`,className:`text-heading-16 text-heading`,children:`Site map`}),(0,Q.jsx)(B,{text:La})]})}),U.data?.sampled&&(0,Q.jsxs)(`span`,{className:`text-label-12 text-muted`,children:[`Showing `,$(U.data.nodes.length),` of `,$(U.data.totalNodes),` pages`,` · `,$(U.data.edges.length),` of `,$(U.data.totalEdges),` links`]})]}),U.data?.layout.state===`ready`&&yt.length>0&&(0,Q.jsxs)(`div`,{className:`mb-3 flex flex-col gap-1.5 material-base px-4 py-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`p`,{className:`flex items-center gap-1 text-copy-14 text-secondary`,"data-testid":`site-map-link-counts`,children:[Ba({filterUnavailable:Ct,showTemplateLinks:me,contentEdgeCount:xt,templateEdgeCount:bt,totalEdgeCount:yt.length}),(0,Q.jsx)(B,{text:Ha(St,{staleLayout:Tt&&!Ct})})]}),(0,Q.jsxs)(`label`,{className:D(`flex shrink-0 items-center gap-2 text-label-14`,Ct?`cursor-not-allowed text-muted`:`cursor-pointer text-heading`),title:Ct?Ia(St):`Menu and footer links are drawn on top. Pages do not move, because the map was laid out from the links in your page text.`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:me&&!Ct,disabled:Ct,onChange:e=>he(e.target.checked),className:`size-4 rounded border-base accent-mono-200 focus:ring-2 focus:ring-mono-400`}),`Show menu and footer links`]})]}),(0,Q.jsxs)(`div`,{id:`site-health-map-explorer`,className:`grid gap-4 lg:grid-cols-[minmax(14rem,18rem)_minmax(0,1fr)]`,children:[(0,Q.jsxs)(`aside`,{className:`material-base`,"aria-labelledby":`site-sections-heading`,children:[(0,Q.jsxs)(`div`,{className:`border-b border-default px-4 py-3`,children:[(0,Q.jsx)(`h3`,{id:`site-sections-heading`,className:`text-heading-14 text-heading`,children:`Site sections`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-13 text-muted`,children:`Folders in this scan`})]}),(0,Q.jsx)(`div`,{className:`max-h-[468px] overflow-auto`,children:ct&&(0,Q.jsx)(to,{projectName:e,runId:ct,parentPath:`/`,onSelect:ln,rootPage:qt,onSelectRootPage:b})})]}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:U.isLoading?(0,Q.jsx)(no,{}):U.error?(0,Q.jsx)(`div`,{className:`flex min-h-[420px] items-center justify-center rounded-md border border-negative bg-negative-soft px-6 text-center lg:min-h-[520px]`,role:`alert`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-copy-14-strong text-negative`,children:`The interactive map could not be loaded.`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-secondary`,children:`The page inventory and technical findings remain available.`}),(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,className:`mt-4`,onClick:()=>u(`inventory`),children:`Open page inventory`})]})}):(0,Q.jsx)(Kr,{nodes:U.data?.nodes??[],edges:yt,showTemplateLinks:me||Ct,layoutState:U.data?.layout.state??`unavailable`,layoutUnavailableReason:U.data?.layout.state===`unavailable`?U.data.layout.reason:null,rootNodeKey:U.data?.rootNodeKey??null,selectedNodeKey:jt,onSelectNode:e=>b(e.nodeKey),onOpenInventory:()=>u(`inventory`),ariaLabel:`Interactive site map showing ${$(U.data?.nodes.length??0)} pages and ${$(wt.length)} internal links`})})]})]}),(0,Q.jsx)(Za,{page:At,isLoading:Nt.isLoading&&!!At,error:Nt.error,inbound:Nt.data?.inbound??[],outbound:Nt.data?.outbound??[],inboundTruncated:Nt.data?.inboundTruncated??!1,outboundTruncated:Nt.data?.outboundTruncated??!1,audit:Pt.data,auditLoading:Pt.isLoading&&!!At,auditError:Pt.error,onRetryAudit:()=>{Pt.refetch()},rootHost:Wt,reasonSource:Ot,reasonsState:Mt,onRetryReasons:()=>{Dt.refetch()},showTemplateLinks:me||Ct})]}):(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`rounded-md border border-caution bg-caution-soft px-5 py-6`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-14 text-caution`,children:N?`Page health results unavailable`:`Page details unavailable`}),(0,Q.jsx)(`p`,{className:`mt-1 text-copy-14 text-caution`,children:M&&N?`This scan did not publish page-level results.`:N?`This scan did not publish page-level results. Run it again to continue setup.`:`Summary metrics are preserved for this scan, but its page graph cannot be opened.`}),N&&!M?(0,Q.jsx)(k,{type:`button`,size:`sm`,className:`mt-4`,onClick:cn,children:`Run scan again`}):null]})}):(0,Q.jsx)(ho,{view:X,tabbed:!N,children:(0,Q.jsxs)(`section`,{className:`material-base px-5 py-8 text-center`,children:[(0,Q.jsx)(`h2`,{className:`text-heading-16 text-heading`,children:N?nn:`Full-site map not available`}),(0,Q.jsx)(`p`,{className:`mx-auto mt-2 max-w-xl text-copy-14 text-secondary`,children:M?Ze:N?rn:V?.legacyAuditAvailable?`Existing page health results are preserved. Run a new scan to build the page and internal-link map.`:ge?`A full-site scan has not been run for this project.`:`Run a scan to discover pages, site sections, and internal links.`}),N&&!$t?(0,Q.jsxs)(`p`,{className:`mt-2 text-copy-14 text-secondary`,children:[`First scan: up to `,100,` pages.`]}):null,(V?.legacyAuditAvailable||N)&&(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap justify-center gap-2`,children:[V?.legacyAuditAvailable&&!N&&(0,Q.jsx)(k,{variant:`secondary`,size:`sm`,onClick:()=>u(`technical`),children:`View page health`}),$t&&Oe.isError?(0,Q.jsx)(k,{type:`button`,size:`sm`,onClick:()=>{Oe.refetch()},children:`Retry scan history`}):null,N&&!$t&&!M&&(0,Q.jsx)(k,{type:`button`,size:`sm`,disabled:Yt,onClick:cn,children:en?`Run first scan`:`Run scan again`}),N&&o?(0,Q.jsx)(k,{type:`button`,variant:`secondary`,size:`sm`,onClick:o,children:$t?`Continue setup`:`Continue without scanning`}):null,N&&s?(0,Q.jsx)(k,{type:`button`,variant:`ghost`,size:`sm`,onClick:s,children:`Skip for now`}):null]})]})})]})}export{xi as a,wi as c,ii as d,ni as f,gt as h,mi as i,si as l,Z as m,Ki as n,Si as o,ai as p,ki as r,Ci as s,Co as t,oi as u};
|