1import{g as Sa,r as F,a5 as ja,a1 as Ca,s as Ta,a2 as Aa,$ as Gt,k as Zt,e as La,U as Pa,c as $a,d as Yt,m as Pe,V as nt,j as e,R as Xt,D as Ea,G as Ra,O as ot,b as Rt,t as it,h as rt,ai as Da,Z as Ma,Y as Ua}from"./index-B_KAAQRW.js";import{r as Oa,w as Ha,a as Fa}from"./toolCache-BZgTg6NJ.js";import{E as za}from"./jspdf.es.min-d1JpP-8o.js";import{a as Dt}from"./jspdf.plugin.autotable-BTchFZcl.js";import{c as Ia}from"./professionalPdfReport-C1lXNWTd.js";import{S as Je}from"./shield-BPZ5WDw7.js";import{P as Mt}from"./panels-top-left-BZCpufAB.js";import{B as Wa}from"./building-D29an7DU.js";import{S as Ba}from"./share-2-DHeq4ji9.js";import{X as lt}from"./x-circle-B4Cgrcvg.js";import{C as Va}from"./clock-YVp-5kfK.js";import{C as qa}from"./chevron-up-DeNbxQc_.js";import{P as Ga}from"./play-BB1Omc8H.js";import{T as Za}from"./trending-up-DL7o_FOp.js";import{E as Ya}from"./external-link-CaCnbLs9.js";import{I as Xa}from"./image-Dj3BFuSq.js";/** 2 * @license lucide-react v0.344.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Xe=Sa("FileCheck",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]),Ut=10080*60*1e3,Ot=8,Qa=2048,Ka=new Set(["eeat_pages","footer_elements","social_presence","homepage_checks","onsite_checks"]);function Ja(s,i,o){const l=o&&typeof o=="object"?o:{passed:null,details:"This check did not return a result."};if(!Ka.has(s))return l;if(l.expandedData)return{...l,expandable:!0};const d=String(l.details||"").trim();return{...l,expandable:!0,expandedData:{type:"evidence",title:`${i||"Check"} evidence`,items:[d?`Result: ${d}`:"No matching evidence was found on the audited page."]}}}const es=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Qt=/(?:^|[^a-z0-9])(?:logo|brand|branding|site[-_\s]?identity)(?:[^a-z0-9]|$)/i,ts=/\blogo(?:type)?\b/i,as=/(?:^|[/_.-])(?:logo|logotype|brandmark)(?:[/_.-]|$)/i;function ss(s){const i=String(s||"").toLowerCase().replace(/\.$/,"").replace(/^\[|\]$/g,"");if(!i||i==="localhost"||i.endsWith(".localhost")||i.endsWith(".local")||/^(0|10|127|169\.254)\./.test(i)||/^192\.168\./.test(i))return!0;const o=i.match(/^172\.(\d{1,3})\./);return o&&Number(o[1])>=16&&Number(o[1])<=31?!0:i==="::1"||i.startsWith("fc")||i.startsWith("fd")||i.startsWith("fe80:")||i.startsWith("::ffff:")}function Qe(s){const i=String(s||"").trim();if(!i)throw new Error("Enter a website URL.");if(i.length>Qa)throw new Error("The URL is too long.");const o=/^[a-z][a-z\d+.-]*:/i.test(i)?i:`https://${i}`;let l;try{l=new URL(o)}catch{throw new Error("Enter a valid website URL.")}if(!["http:","https:"].includes(l.protocol)||l.username||l.password)throw new Error("Only public HTTP and HTTPS URLs are supported.");if(ss(l.hostname))throw new Error("Private and local website addresses cannot be audited.");return l.hash="",l.href}function fe(s){try{return new URL(Qe(s)).hostname.toLowerCase().replace(/^www\./,"")}catch{return""}}function Ht(s,i){var l;const o=fe(i);return!o||!Array.isArray(s)?null:((l=s.find(d=>fe(d==null?void 0:d.domain)===o))==null?void 0:l.id)||null}function Ft(s,i,o=0){const l=Object.values(s||{}).filter(Boolean),d=l.filter(N=>typeof N.passed=="boolean"),p=d.filter(N=>N.passed).length,n=d.length-p,x=l.length-d.length;return{total:l.length,checked:d.length,passed:p,failed:n,unknown:x,score:d.length>0?Math.round(p/d.length*100):0,manualTotal:Math.max(0,Number(o)||0),manualChecked:Object.values(i||{}).filter(Boolean).length}}function ns(s){const i={},o=/([^\s"'<>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g,l=String(s||"").replace(/^<\/?[^\s>]+/,"").replace(/\/?>\s*$/,"");let d;for(;d=o.exec(l);)i[d[1].toLowerCase()]=d[2]??d[3]??d[4]??"";return i}function os(s){return["class","id","aria-label","data-widget_type","data-widget-type","itemprop","role"].map(o=>s[o]||"").find(o=>Qt.test(o))||""}function is(s){const i=["class","id","data-widget_type","data-widget-type","itemprop","role"].map(d=>s[d]||"").find(d=>Qt.test(d))||"",o=["src","data-src","data-lazy-src"].map(d=>s[d]||"").find(d=>as.test(d))||"",l=["alt","title","aria-label"].map(d=>s[d]||"").find(d=>{const p=String(d).match(ts);return p&&Number(p.index)<=60})||"";return o&&l?{value:l,score:140}:o?{value:o,score:130}:i?{value:i,score:120}:l?{value:l,score:110}:null}
6function rs(s,i){if(String(s.rel||"").split(/\s+/).some(l=>l.toLowerCase()==="home"))return!0;const o=s.href;if(!o)return!1;try{const l=new URL(i),d=new URL(o,l);return d.origin===l.origin&&(d.pathname==="/"||d.pathname==="")}catch{return o==="/"}}function ls(s,i=""){const o=String(s||"").replace(/<!--[\s\S]*?-->/g,"").replace(/<(script|style|template)\b[^>]*>[\s\S]*?<\/\1>/gi,""),l=/<\/?([a-z][\w:-]*)\b[^>]*>/gi,d=[];let p=null,n;for(;n=l.exec(o);){const x=n[0],N=n[1].toLowerCase();if(x.startsWith("</")){const R=d.map(A=>A.tagName).lastIndexOf(N);R>=0&&(d.length=R);continue}const T=ns(x);if(N==="img"||N==="svg"){const R=is(T),A=[...d].reverse().slice(0,6).find($=>$.logoSignal&&$.tagName!=="body"&&$.tagName!=="html"),k=d.some($=>$.tagName==="header"||$.tagName==="nav"),P=[...d].reverse().find($=>$.tagName==="a"&&rs($.attributes,i)),D=R?`Element attribute identifies this ${N} as a logo: ${R.value}`:A?`Ancestor <${A.tagName}> identifies this ${N} as a logo: ${A.logoSignal}`:k&&P?`The ${N} is linked to the homepage from the header/navigation.`:"";if(D){const W={tag:x.slice(0,500),reason:D,score:R?R.score:A?90:70};(!p||W.score>p.score)&&(p=W)}}!es.has(N)&&!/\/>\s*$/.test(x)&&d.push({tagName:N,attributes:T,logoSignal:os(T)})}return p?[{tag:p.tag,reason:p.reason}]:[]}function Kt(s){return String(s||"").replace(/ | /gi," ").replace(/&/gi,"&").replace(/"/gi,'"').replace(/�*39;|'/gi,"'").replace(/</gi,"<").replace(/>/gi,">").replace(/&#(\d{1,7});/g,(i,o)=>{const l=Number(o);return Number.isInteger(l)&&l<=1114111?String.fromCodePoint(l):" "}).replace(/&#x([0-9a-f]{1,6});/gi,(i,o)=>{const l=Number.parseInt(o,16);return Number.isInteger(l)&&l<=1114111?String.fromCodePoint(l):" "})}function Ge(s){return Kt(String(s||"").replace(/<!--[\s\S]*?-->/g," ").replace(/<(script|style|svg|template)\b[^>]*>[\s\S]*?<\/\1>/gi," ").replace(/<br\b[^>]*>/gi,` 7`).replace(/<\/(?:address|div|footer|li|p|section)\s*>/gi,` 8`).replace(/<[^>]+>/g," ")).replace(/[^\S\r\n]+/g," ").replace(/\s*\n\s*/g,` 9`).trim()}function Jt(s){return String(s||"").trim().replace(/^https?:\/\/schema\.org\//i,"").replace(/^schema:/i,"").toLowerCase()}function pt(s,i){const o=Jt(s);return i.some(l=>o===l||o.endsWith(l))}function ht(s,i,o,l=new WeakSet){if(!s||typeof s!="object"||o.length>=200||l.has(s))return;if(l.add(s),Array.isArray(s)){for(const n of s)ht(n,i,o,l);return}const p=(Array.isArray(s["@type"])?s["@type"]:[s["@type"]]).find(n=>typeof n=="string"&&pt(n,i));p&&o.push({data:s,matchedType:String(p).replace(/^https?:\/\/schema\.org\//i,"")});for(const[n,x]of Object.entries(s))n==="@context"||n==="@type"||!x||typeof x!="object"||ht(x,i,o,l)}function ea(s,i){var T;const o=(Array.isArray(i)?i:[i]).map(Jt).filter(Boolean);if(o.length===0)return{found:!1};const l=String(s||""),d=l.match(/<script\b[^>]*type\s*=\s*["']application\/ld\+json["'][^>]*>[\s\S]*?<\/script>/gi)||[],p=[];let n="",x=null;for(const R of d){const A=R.replace(/^<script\b[^>]*>/i,"").replace(/<\/script>\s*$/i,"").trim();if(!A)continue;const k=Kt(A).replace(/\\\//g,"/");try{const P=JSON.parse(k);if(!n){const D=Array.isArray(P)?P.find($=>$&&typeof $=="object"&&$["@context"]):P;n=(D==null?void 0:D["@context"])||""}ht(P,o,p)}catch{const P=/["']@type["']\s*:\s*["']([^"']+)["']/gi;let D;for(;D=P.exec(k);)!x&&pt(D[1],o)&&(x={found:!0,format:"JSON-LD (unparsed)",matchedType:D[1],matchCount:1,raw:k.slice(0,5e4)})}}if(p.length>0)return{found:!0,format:"JSON-LD",matchedType:[...new Set(p.map(A=>A.matchedType))].join(", "),matchCount:p.length,data:p.length===1?p[0].data:{"@context":n||"https://schema.org","@graph":p.map(A=>A.data)}};if(x)return x;const N=l.match(/<[a-z][^>]*\bitemtype\s*=\s*["'][^"']+["'][^>]*>/gi)||[],w=[];for(const R of N){const A=((T=R.match(/\bitemtype\s*=\s*["']([^"']+)["']/i))==null?void 0:T[1])||"";pt(A,o)&&w.push({matchedType:A.split("/").filter(Boolean).pop()||A,raw:R.slice(0,2e3)})}return w.length>0?{found:!0,format:"Microdata",matchedType:[...new Set(w.map(R=>R.matchedType))].join(", "),matchCount:w.length,raw:w.map(R=>R.raw).join(` 10`)}:{found:!1}}function cs(s,i){const o=s.toLowerCase();for(const l of["address","li","p","div"]){const d=o.lastIndexOf(`<${l}`,i),p=o.indexOf(`</${l}>`,i);if(d>=0&&p>i&&i-d<=2e3&&p-i<=2e3)return s.slice(d,p+l.length+3)}return s.slice(Math.max(0,i-150),i+650)}function Ze(s,i=null){const o=String(s||"").replace(/\s+/g," ").trim();if(!o)return"";const l=i?o.search(i):0,d=l>=0?Math.max(0,l-50):0;return o.slice(d,d+300).trim()}function ds(s){const i=String(s||"").replace(/<!--[\s\S]*?-->/g," ").replace(/<(script|style|template)\b[^>]*>[\s\S]*?<\/\1>/gi," "),o=[],l=new Set,d=A=>{const k=String(A||"").replace(/\s+/g," ").trim();!k||l.has(k.toLowerCase())||o.length>=8||(l.add(k.toLowerCase()),o.push(k))},p=ea(i,"PostalAddress");p.found&&d(`PostalAddress structured data found (${p.format}).`);for(const A of i.matchAll(/<address\b[^>]*>([\s\S]*?)<\/address>/gi)){const k=Ge(A[1]);d(k?`<address> element: ${Ze(k)}`:"<address> element found.")}const n=i.match(/<footer\b[^>]*>[\s\S]*?<\/footer>/gi)||[],x=/\b(?:address|location|headquarters|physical address|business address|office address|visit us|find us)\b/i;for(const A of n){const P=Ge(A).replace(/\b(?:email|e-mail|web|website|internet|ip)\s+address(?:es)?\b/gi," ");x.test(P)&&d(`Footer address label: ${Ze(P,x)}`)}const N=/\b(?:map[-_\s/]?(?:pin|marker)|location[-_\s/]?(?:pin|marker)?|address[-_\s/]?(?:pin|marker|icon)|geo[-_\s]?alt)\b/gi;let w;for(;(w=N.exec(i))&&o.length<8;){const A=Ge(cs(i,w.index)),k=A.replace(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi," ").replace(/\+?\d[\d\s().-]{6,}\d/g," ").replace(/\s+/g," ").trim();/[a-z]{2,}/i.test(k)&&d(`Map-pin/address icon is paired with: ${Ze(A)}`)}const T=Ge(i),R=/\b\d{1,6}[a-z]?(?:[-/]\d+)?\s+(?:(?:[a-z0-9.'-]+)\s+){0,8}(?:street|st|avenue|ave|road|rd|boulevard|blvd|drive|dr|lane|ln|court|ct|highway|hwy)\b(?:[^,\n]{0,80})/gi;for(const A of T.matchAll(R))d(`Street-style address: ${Ze(A[0])}`);return{found:o.length>0,evidence:o}}function us(s,i){var d;const o=[],l=new Set;for(const p of String(s||"").split(/\r?\n/)){const n=(d=p.match(/^\s*Sitemap\s*:\s*(\S+)/i))==null?void 0:d[1];if(n){try{const x=new URL(n,i);if(!["http:","https:"].includes(x.protocol)||x.username||x.password)continue;x.hash="",l.has(x.href)||(l.add(x.href),o.push(x.href))}catch{}if(o.length>=50)break}}return o}function ps(s,i=new Date().getFullYear()){const o=Number(i);if(!Number.isInteger(o)||o<1900||o>9999)return!1;const d=String(s||"").replace(/<(script|style|svg|template)\b[^>]*>[\s\S]*?<\/\1>/gi," ").replace(/©|©|©/gi," © ").replace(/<br\b[^>]*>/gi,` 11`).replace(/<\/(?:p|div|li|footer|section|address|small|br)\s*>/gi,` 12`).replace(/<[^>]+>/g," ").replace(/[^\S\r\n]+/g," ").trim().split(/\r?\n+/).map(p=>p.replace(/\s+/g," ").trim()).filter(p=>/©|copyright|\(c\)|all rights reserved/i.test(p));for(const p of d){const n=p.search(/©|copyright|\(c\)|all rights reserved/i),N=[...p.slice(Math.max(0,n-40),n+160).matchAll(/\b(19|20)\d{2}\b/g)].map(w=>Number(w[0]));if(N.length>0&&Math.max(...N)===o)return!0}return!1}function mt(s,i=0,o=""){if(i>5||s===null||s===void 0)return null;if(typeof s=="boolean"||typeof s=="number")return s;if(typeof s=="string"){const l=s.slice(0,o==="content"?5e4:2e3);return/^(?:href|url|src|finalUrl)$/i.test(o)&&/^\s*(?:javascript|data):/i.test(l)?"":l}
12if(Array.isArray(s))return s.slice(0,100).map(l=>mt(l,i+1,o));if(typeof s=="object"){const l={};for(const[d,p]of Object.entries(s).slice(0,40))/^[a-zA-Z][a-zA-Z0-9_]*$/.test(d)&&(l[d]=mt(p,i+1,d));return l}return null}function hs(s,i){if(!s||typeof s!="object"||Array.isArray(s))return{};const o=new Set(i||[]),l={};for(const[d,p]of Object.entries(s)){if(!o.has(d)||!p||typeof p!="object")continue;const n=typeof p.passed=="boolean"?p.passed:null;l[d]={id:d,passed:n,name:String(p.name||"").slice(0,200),description:String(p.description||"").slice(0,600),details:String(p.details||"").slice(0,1e3),category:String(p.category||"").slice(0,100),automated:p.automated!==!1,expandable:p.expandable===!0,expandedData:mt(p.expandedData)}}return l}function ms(s){const i=Array.isArray(s)?s:[];if(i.length===0||i.some(x=>!Number(x==null?void 0:x.finalStatus)))return{passed:null,details:"Could not verify URL variants."};const o=i.filter(x=>x.finalStatus===200&&Number(x.redirectCount||0)===0),l=i.every(x=>x.finalStatus===200),p=new Set(i.map(x=>{try{const N=new URL(x.finalUrl||x.url);return N.hash="",N.href}catch{return String(x.finalUrl||x.url||"")}})).size===1,n=o.length===1&&l&&p;return{passed:n,details:n?`One preferred version loads directly: ${o[0].url}`:l?p?o.length===0?"No URL variant returned a direct 200 response.":`${o.length} URL variants return a direct 200 response. Redirect duplicates to one preferred version.`:"URL variants resolve to different destinations.":"One or more URL variants do not resolve successfully."}}function fs(s,i){const o=[s,i].filter(Boolean);if(o.length<2||o.some(w=>!Number(w.finalStatus)))return{applicable:!1,passed:null,details:"Could not verify trailing-slash behavior."};if(o.every(w=>w.finalStatus===404))return{applicable:!1,passed:null,details:"The test page was not found."};const l=(()=>{try{return new URL(s.url).pathname.replace(/\/+$/,"")||"/"}catch{return""}})();if(!o.every(w=>{try{return(new URL(w.finalUrl||w.url).pathname.replace(/\/+$/,"")||"/")===l}catch{return!1}}))return{applicable:!1,passed:null,details:"The test URL redirected to a different page."};const p=o.filter(w=>w.finalStatus===200&&Number(w.redirectCount||0)===0),n=o.filter(w=>w.finalStatus===200&&Number(w.redirectCount||0)>0),x=new Set(o.map(w=>{try{const T=new URL(w.finalUrl||w.url);return T.hash="",T.href}catch{return String(w.finalUrl||w.url||"")}})),N=p.length===1&&n.length===1&&x.size===1;
12return{applicable:!0,passed:N,details:N?"Slash and non-slash versions resolve consistently.":"Slash and non-slash versions do not resolve to one preferred format."}}function gs(s,i=Date.now()){const o=Number(s);if(!Number.isFinite(o)||o<=0)return"";const l=Math.max(0,Math.floor((i-o)/6e4));if(l<1)return"just now";if(l<60)return`${l}m ago`;const d=Math.floor(l/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function zt(s){const i=String(s||"");return i.length<200||!/<(?:html|body|main|article|head)\b/i.test(i)||i.includes("/@vite/client")||i.includes("/@react-refresh")?!1:!(i.includes("challenge-platform")||i.includes("cdn-cgi/challenge-platform")||i.includes("Just a moment...")||/captcha|challenge/i.test(i)&&i.length<5e3)}const xs=2e4;async function ta(s,i){const o=new AbortController,l=window.setTimeout(()=>o.abort(),xs);try{const d=await fetch(s,{...i,signal:o.signal}),n=(d.headers.get("content-type")||"").includes("application/json")?await d.json().catch(()=>null):null;if(!d.ok)throw new Error((n==null?void 0:n.message)||(n==null?void 0:n.error)||`Request failed (${d.status}).`);if(!n||typeof n!="object")throw new Error("The audit service returned an invalid response.");return n}catch(d){throw(d==null?void 0:d.name)==="AbortError"?new Error("The website took too long to respond."):d}finally{window.clearTimeout(l)}}async function ct(s){const i=await ta("/api/proxy",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({url:s,responseMode:"json"})});return{html:typeof i.content=="string"?i.content:"",statusCode:Number(i.statusCode)||0,finalUrl:typeof i.url=="string"?i.url:s,contentType:typeof i.contentType=="string"?i.contentType:"",redirectCount:Number(i.redirectCount)||0,redirectChain:Array.isArray(i.redirectChain)?i.redirectChain:[]}}async function bs(s){const i=await ta(`/api/check-redirects?url=${encodeURIComponent(s)}`,{headers:{Accept:"application/json"}});return{url:s,finalUrl:typeof i.finalUrl=="string"?i.finalUrl:s,redirects:Array.isArray(i.redirects)?i.redirects:[],finalStatus:Number(i.finalStatus)||0,redirectCount:Number(i.redirectCount)||0,contentType:typeof i.contentType=="string"?i.contentType:""}}async function ke(s){try{return await bs(s)}catch{return{url:s,finalUrl:s,redirects:[],finalStatus:0,redirectCount:0,contentType:"",error:!0}}}const ys=new Set(["about","about-us","who-we-are","our-story","company"]),ws=/(?:^|\.)(?:facebook|instagram|linkedin|twitter|x|youtube|tiktok|pinterest)\.com$/i,It=/\b(?:about us|who we are|our story|about the company|about\s+[\p{L}\p{N}][\p{L}\p{N}&'â.-]*)\b/iu;function vs(s){const i={amp:"&",apos:"'",copy:"©",gt:">",lt:"<",nbsp:" ",quot:'"'};return String(s||"").replace(/&(#x?[\da-f]+|[a-z]+);/gi,(o,l)=>{var d;if(l[0]==="#"){const p=((d=l[1])==null?void 0:d.toLowerCase())==="x"?Number.parseInt(l.slice(2),16):Number.parseInt(l.slice(1),10);return Number.isInteger(p)&&p>=0&&p<=1114111&&!(p>=55296&&p<=57343)?String.fromCodePoint(p):o}return i[l.toLowerCase()]??o})}function Ne(s){return vs(String(s||"").replace(/<!--[^]*?-->/g," ").replace(/<br\b[^>]*>/gi," ").replace(/<[^>]+>/g," ")).replace(/\s+/g," ").trim()}function aa(s){return String(s||"").replace(/<!--[^]*?-->/g," ").replace(/<(script|style|nav|header|footer|aside|noscript|svg|template|form)\b[^>]*>[^]*?<\/\1>/gi," ")}function we(s,i){var o,l;return((l=(o=String(s||"").match(new RegExp(`\\b${i}\\s*=\\s*["']([^"']*)["']`,"i")))==null?void 0:o[1])==null?void 0:l.trim())||""}function gt(s){var i;return((i=String(s||"").match(/[\p{L}\p{N}][\p{L}\p{N}'â-]*/gu))==null?void 0:i.length)||0}function ks(s){const i=[],o=/<h([1-4])\b[^>]*>([^]*?)<\/h\1>/gi;let l;for(;(l=o.exec(s))!==null;)i.push({heading:Ne(l[2]),level:Number(l[1]),start:l.index,contentStart:o.lastIndex});return i.map((d,p)=>{const n=i.slice(p+1).find(N=>N.level<=d.level),x=s.slice(d.contentStart,(n==null?void 0:n.start)??s.length);return{...d,raw:x,text:Ne(x)}})}function Ye(s,i,o=100){const l=String(s||"").match(i);if(!l||l.index===void 0)return"";const d=Math.max(0,l.index-30),p=Math.min(s.length,l.index+l[0].length+o);return s.slice(d,p).trim()}function ye(s,i,o,l=[]){return{passed:s,details:s?i:o,expandable:!0,expandedData:{type:"evidence",title:"About-page evidence",items:(l.length>0?l:[o]).slice(0,20)}}}function dt(s,i,o=15){return s.find(l=>i.test(l.heading)&>(l.text)>=o)}function Ns(s,i){const o=[];for(const l of s.raw.match(/<a\b[^>]*>/gi)||[]){const d=we(l,"href");if(d)try{const p=new URL(d,i),n=new URL(i).origin;if(!["http:","https:"].includes(p.protocol)||p.origin===n||ws.test(p.hostname))continue;o.push(p.href)}catch{}}return[...new Set(o)]}function xt(s){try{return(/^https?:/i.test(String(s||""))?new URL(s).pathname:String(s||"")).toLowerCase().split("/").filter(
12Boolean).some(o=>ys.has(o))}catch{return!1}}function _s(s,i){let o;try{o=new URL(i)}catch{return[]}const l=new Map;for(const p of String(s||"").match(/<a\b[^>]*>[^]*?<\/a>/gi)||[]){const n=we(p,"href");if(n)try{const x=new URL(n,o);if(x.origin!==o.origin||!xt(x.pathname))continue;x.hash="";const N=Ne(p).toLowerCase(),w=x.pathname.toLowerCase().replace(/\/+$/,"")||"/";let T=1;/^(?:about|about us)$/.test(N)?T+=10:/^(?:who we are|our story)$/.test(N)?T+=8:N==="company"&&(T+=4),/^\/(?:about|about-us)$/.test(w)?T+=8:/^\/(?:who-we-are|our-story)$/.test(w)?T+=6:w==="/company"&&(T+=3),x.search||(T+=1);const R=l.get(x.href);(!R||R.score<T)&&l.set(x.href,{url:x.href,score:T})}catch{}}const d=["/about/","/about-us/","/who-we-are/","/our-story/"];for(const p of d){const n=new URL(p,o.origin).href;l.has(n)||l.set(n,{url:n,score:0})}return[...l.values()].sort((p,n)=>n.score-p.score).slice(0,6).map(({url:p})=>p)}function Wt(s,i){var x;if(!xt(i))return!1;const o=aa(s),l=(o.match(/<h[1-3]\b[^>]*>[^]*?<\/h[1-3]>/gi)||[]).map(Ne),d=Ne(((x=String(s||"").match(/<title\b[^>]*>([^]*?)<\/title>/i))==null?void 0:x[1])||""),p=l.some(N=>It.test(N)),n=It.test(d);return(p||n)&>(Ne(o))>=20}function Ss(s,i){const o=aa(s),l=Ne(o),d=ks(o),p=String.raw`(?:our|its|their|the)?\s*(?:employees?|team|customers?|clients?|members?|founders?|investors?|shareholders?|management|community|people)\b`,n=String.raw`(?:group|holdings?|inc\.?|llc|l\.?l\.?c\.?|ltd\.?|limited|corp\.?|corporation|company|gmbh|plc|pvt\.?\s*ltd\.?)`,N=[new RegExp(String.raw`\b(?:parent company\s+(?:is|:)|subsidiary of|a (?:division|brand|product) of)\s+(?:the\s+)?(?!a\b|an\b|${p})[\p{L}\p{N}][^.;!?<>]{1,100}`,"iu"),new RegExp(String.raw`\b(?:wholly owned (?:subsidiary )?(?:by|of)|owned and operated by|owned by|operated by)\s+(?:the\s+)?(?!${p})[\p{L}\p{N}&'â. -]{2,80}\b${n}\b`,"iu"),new RegExp(String.raw`\b(?:registered as|registered entity\s*:|legal (?:name|entity)\s+(?:is|:)|incorporated as|trading as|doing business as|d\/?b\/?a)\s+(?:the\s+)?(?!a\b|an\b|independent\b|privately\b)[\p{L}\p{N}&'â. -]{2,80}\b${n}\b`,"iu"),new RegExp(String.raw`\bpart of (?:the )?(?!${p})[\p{L}\p{N}&'â. -]{2,60}\s+${n}\b`,"iu")].map(M=>Ye(l,M)).find(Boolean)||"",w=dt(d,/\b(?:our story|our history|our journey|our beginnings|our origins|how we (?:started|began)|company history|founding story)\b/i),T=dt(d,/\b(?:who we are|who are we)\b/i),R=dt(d,/\b(?:what we do|what we offer|how we help|our services|our solutions|our capabilities)\b/i),k=[/\b(?:trusted|chosen|used) by (?:more than |over )?\d[\d,]*\+? (?:clients|customers|businesses|organizations|people|users)\b/i,/\b\d+\+? years (?:of )?(?:experience|expertise)\b/i,/\b(?:licensed|certified|accredited|regulated) (?:by|under|through) [\p{L}\p{N}][\p{L}\p{N}&'â. -]{2,80}/iu,/\b(?:ISO\s?\d{4,5}
12(?::\d{4})?|BBB accredited)\b/i,/\b(?:award(?:ed)?|winner|recognized) (?:by|as|for|with) [\p{L}\p{N}][\p{L}\p{N}&'â. -]{2,80}/iu].map(M=>Ye(l,M)).find(Boolean)||"",P=d.filter(M=>/\b(?:our team|meet (?:the|our) team|leadership|our people|management team|our experts)\b/i.test(M.heading)),D=d.filter(M=>/\b(?:our office|our workspace|inside our office|where we work)\b/i.test(M.heading)),$=/\b(?:founder|co-founder|chief|CEO|CTO|CFO|COO|director|manager|president|partner|head of|lead)\b/i,W=[];for(const M of[...P,...D]){const ie=(M.raw.match(/<img\b[^>]*>/gi)||[]).filter(ne=>{const De=we(ne,"src");return De&&!/^data:/i.test(De)}),re=ie.filter(ne=>/\b(?:team|staff|member|founder|leadership|headshot|portrait|employee|office|workspace|studio|people)\b/i.test([we(ne,"alt"),we(ne,"class"),we(ne,"id"),we(ne,"src")].join(" "))),Se=$.test(M.text);(re.length>0||ie.length>=2&&Se)&&W.push(...(re.length>0?re:ie).map(ne=>we(ne,"alt")||we(ne,"src")))}const Q=(o.match(/<address\b[^>]*>[^]*?<\/address>/gi)||[]).map(Ne),X=d.filter(M=>/\b(?:address|office|headquarters|location|visit us|find us)\b/i.test(M.heading)).map(M=>M.text),ee=Ye(l,/\b(?:mailing address|office address|physical address|business address|headquarters|located at|visit us at|find us at)\b/i,180),te=[...Q,...X,ee].filter(Boolean).join(" "),ce=[/\b\d{1,6}\s+[\p{L}\p{N}.'â -]{2,60}\b(?:street|st|avenue|ave|road|rd|boulevard|blvd|drive|dr|lane|ln|court|ct|highway|hwy|parkway|pkwy)\b/iu,/\b(?:P\.?\s*O\.?\s*Box|Post Office Box)\s+\d+[\p{L}\p{N}-]*\b/iu,/\b(?:house|plot|office|suite|unit|building)\s*(?:no\.?\s*)?[\p{L}\p{N}-]+[^.]{0,80}\b(?:block|sector|phase|district|city|town|road|street)\b/iu].find(M=>M.test(te)),ve=ce?Ye(te,ce):"",de=d.filter(M=>/\b(?:testimonials?|client reviews?|customer reviews?|customer stories|what (?:our )?(?:clients|customers) say|awards?|recognition|accreditations?)\b/i.test(M.heading));let _e="";for(const M of de){const ie=/<(?:blockquote|q)\b|\b(?:class|id)=["'][^"']*(?:testimonial|review|rating|award)[^"']*["']/i.test(M.raw),re=/\b(?:\d(?:\.\d)?\s*(?:\/\s*5|stars?)|\d[\d,]*\+?\s+reviews?)\b/i.test(M.text),Se=/\b(?:award(?:ed)?|winner|recognized|accredited|honou?r)\b/i.test(M.text);if(ie||re||Se||gt(M.text)>=20){_e=`${M.heading}: ${M.text.slice(0,180)}`;break}}const et=d.filter(M=>/\b(?:featured in|featured on|as seen in|press mentions?|media coverage|in the news|our partners|technology partners|strategic partners)\b/i.test(M.heading)).flatMap(M=>Ns(M,i)),Te=[...new Set(et)];return{about_parent_company:ye(!!N,"Explicit parent-company or legal-entity relationship found","No explicit parent-company or legal-entity relationship found",N?[N]:[]),about_our_story:ye(!!w,"Substantive story/history section found","No substantive âOur Storyâ or history section found",w?[`${w.heading}: ${w.text.slice(0,180)}`]:[]),about_who_we_are:ye(!!T,"Substantive âWho We Areâ section found","No substantive âWho We Areâ section found",T?[`${T.heading}: ${T.text.slice(0,180)}`]:[]),about_what_we_do:ye(!!R,"Substantive âWhat We Doâ or services section found","No substantive âWhat We Doâ or services section found",R?[`${R.heading}: ${R.text.slice(0,180)}`]:[]),about_trusted_source:ye(!!k,"Concrete trust or credibility evidence found","No concrete accreditation, award, scale, or experience evidence found",k?[k]:[]),about_team_photos:ye(W.length>0,`${W.length} team or workspace photo signal${W.length===1?"":"s"} found`,"No clearly labelled team or workspace photos found in a dedicated section",W),about_mailing_address:ye(!!ve,"Structured physical mailing address found in the About-page content","No complete physical mailing address found in the About-page content",ve?[ve]:[]),about_social_proof:ye(!!_e,"Dedicated testimonial, review, or award evidence found","No dedicated testimonial, review, or award evidence found",_e?[_e]:[]),about_featured_websites:ye(Te.length>0,`${Te.length} external featured or partner link${Te.length===1?"":"s"} found`,"No external links found in a dedicated featured or partner section",Te)}}const Bt=Dt.default||Dt,_=Object.freeze({navy:[15,23,42],slate:[71,85,105],muted:[100,116,139],border:[226,232,240],panel:[248,250,252],blue:[37,99,235],cyan:[8,145,178],green:[5,150,105],greenSoft:[236,253,245],red:[220,38,38],redSoft:[254,242,242],amber:[217,119,6],amberSoft:[255,251,235],violet:[124,58,237],white:[255,255,255]}),js=Object.freeze({authority_technical:_.blue,schema_markup:_.violet,eeat_pages:_.green,footer_elements:_.amber,author_elements:[79,70,229],article_elements:[225,29,72],social_presence:_.cyan,affiliate_seo:[234,88,12],ux_elements:[13,148,136],homepage_checks:[109,40,217],onsite_checks:[219,39,119]}),ft=Object.freeze({pass:{label:"PASS",color:_.green,fill:_.greenSoft},fail:{label:"ACTION",color:_.red,fill:_.redSoft}
12,unknown:{label:"VERIFY",color:_.amber,fill:_.amberSoft}}),ge=s=>String(s??"").replace(/<[^>]*>/g," ").replace(/&/gi,"&").replace(/"/gi,'"').replace(/'|'/gi,"'").replace(/</gi,"<").replace(/>/gi,">").replace(/[\u2190-\u21ff]/g,"-").replace(/[\u2600-\u27bf]/g,"").replace(/[\u200b-\u200d\ufeff]/g,"").replace(/[\u2010-\u2015]/g,"-").replace(/[\u2018\u2019]/g,"'").replace(/[\u201c\u201d]/g,'"').replace(/[^\x20-\x7e\u00c0-\u00ff]/g,"").replace(/\s+/g," ").trim(),Cs=s=>(s==null?void 0:s.passed)===!0?"pass":(s==null?void 0:s.passed)===!1?"fail":"unknown",Ts=s=>{const i=ge(s);try{return new URL(i).toString()}catch{return i||"Website not specified"}},As=s=>Object.fromEntries(Object.entries(s||{}).flatMap(([i,o])=>(o.checks||[]).map(l=>[l.id,{...l,categoryId:i,categoryName:o.name}]))),Ls=({url:s,checkResults:i,checkDefinitions:o,generatedAt:l=new Date})=>{const d=As(o),p=Object.entries(i||{}).map(([P,D])=>{var Q;const $=d[P]||{},W=(D==null?void 0:D.category)||$.categoryId||"other";return{id:P,categoryId:W,categoryName:((Q=o==null?void 0:o[W])==null?void 0:Q.name)||$.categoryName||"Other Checks",name:ge((D==null?void 0:D.name)||$.name||P),description:ge($.description||""),details:ge((D==null?void 0:D.details)||"No evidence was returned."),status:Cs(D)}}),n=p.filter(P=>P.status!=="unknown"),x=n.filter(P=>P.status==="pass").length,N=n.length-x,w=p.length-n.length,T=n.length?Math.round(x/n.length*100):0,A=Object.keys(o||{}).map(P=>{var Q;const D=p.filter(X=>X.categoryId===P),$=D.filter(X=>X.status!=="unknown"),W=$.filter(X=>X.status==="pass").length;return{id:P,name:ge(((Q=o[P])==null?void 0:Q.name)||P),rows:D,passed:W,checked:$.length,score:$.length?Math.round(W/$.length*100):0}}).filter(P=>P.rows.length>0),k=p.filter(P=>P.status==="fail").map(P=>({...P,action:P.description||`Review the ${P.name} implementation and verify it on the live website.`}));return{url:Ts(s),generatedAt:l instanceof Date?l:new Date(l),automatedRows:p,categories:A,priorityActions:k,stats:{total:p.length,checked:n.length,passed:x,failed:N,unknown:w,score:T}}},Ps=s=>s>=80?{label:"Strong foundation",color:_.green}:s>=60?{label:"Needs focused improvement",color:_.amber}:{label:"High-priority improvements",color:_.red},$s=(s,i)=>{let o="website";try{o=new URL(s).hostname.replace(/^www\./,"")}catch{o=ge(s)||o}return`eeat-audit-${o.toLowerCase().replace(/[^a-z0-9.-]+/g,"-").replace(/^-+|-+$/g,"")||"website"}-${i.toISOString().slice(0,10)}.pdf`},Es=(s,i)=>{const o=ft[i]||ft.unknown;s.styles.textColor=o.color,s.styles.fillColor=o.fill,s.styles.fontStyle="bold",s.styles.halign="center"},Rs=({url:s,checkResults:i,checkDefinitions:o,branding:l={},generatedAt:d=new Date})=>{const p=Ls({url:s,checkResults:i,checkDefinitions:o,generatedAt:d}),n=new za({orientation:"portrait",unit:"mm",format:"a4",compress:!0}),x=n.internal.pageSize.getWidth(),N=n.internal.pageSize.getHeight(),w=14,T=x-w*2,R=ge(l.name)||"SemanticsX",A=Ps(p.stats.score);let k=0;const P=()=>{n.internal.getCurrentPageInfo().pageNumber<=1||(n.setFillColor(..._.navy),n.rect(0,0,x,15,"F"),n.setTextColor(..._.white),n.setFont("helvetica","bold"),n.setFontSize(8),n.text(`${R} | E-E-A-T Audit`,w,9.5),n.setFont("helvetica","normal"),n.setTextColor(203,213,225),n.text(ge(p.url).slice(0,85),x-w,9.5,{align:"right"}))},D=U=>{n.internal.getCurrentPageInfo().pageNumber>1&&k<23&&(k=23),k+U>N-20&&(n.addPage(),k=23,P())},$=(U,G="")=>{D(G?18:12),n.setTextColor(..._.navy),n.setFont("helvetica","bold"),n.setFontSize(14),n.text(ge(U),w,k),n.setDrawColor(..._.blue),n.setLineWidth(.8),n.line(w,k+3,w+18,k+3),G?(n.setFont("helvetica","normal"),n.setFontSize(8.5),n.setTextColor(..._.muted),n.text(n.splitTextToSize(ge(G),T),w,k+8),k+=16):k+=9};n.setFillColor(..._.navy),n.rect(0,0,x,49,"F"),n.setFillColor(..._.blue),n.rect(0,46,x,3,"F");let W=w;if(l.logo)try{const U=n.getImageProperties(l.logo),G=Ia(U.width,U.height,28,18),V=13+(18-G.height)/2;n.addImage(l.logo,"AUTO",w,V,G.width,G.height),W+=G.width+6}catch{W=w}n.setTextColor(..._.white),n.setFont("helvetica","bold"),n.setFontSize(9),n.text(R.toUpperCase(),W,13),n.setFontSize(22),n.text("E-E-A-T Audit Report",W,23),n.setFont("helvetica","normal"),n.setFontSize(8.5),n.setTextColor(203,213,225),n.text(n.splitTextToSize(p.url,120),W,30),n.text(`Generated ${p.generatedAt.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}
12`,W,41),n.setFillColor(..._.white),n.roundedRect(x-51,8,37,33,4,4,"F"),n.setTextColor(...A.color),n.setFont("helvetica","bold"),n.setFontSize(24),n.text(`${p.stats.score}%`,x-32.5,24,{align:"center"}),n.setFontSize(7.5),n.text("AUDIT SCORE",x-32.5,31,{align:"center"}),n.setFont("helvetica","normal"),n.setFontSize(6.8),n.setTextColor(..._.slate),n.text(A.label,x-32.5,36.5,{align:"center",maxWidth:31}),k=59,$("Executive summary","A decision-ready view of the automated audit findings.");const Q=[["Passed",p.stats.passed,_.green,_.greenSoft],["Needs action",p.stats.failed,_.red,_.redSoft],["Unverified",p.stats.unknown,_.amber,_.amberSoft]],X=3,ee=(T-X*(Q.length-1))/Q.length;Q.forEach(([U,G,V,ce],ve)=>{const de=w+ve*(ee+X);n.setFillColor(...ce),n.setDrawColor(..._.border),n.roundedRect(de,k,ee,22,2.5,2.5,"FD"),n.setTextColor(...V),n.setFont("helvetica","bold"),n.setFontSize(15),n.text(String(G),de+4,k+9),n.setTextColor(..._.slate),n.setFont("helvetica","normal"),n.setFontSize(7.5),n.text(U,de+4,k+16)}),k+=29,n.setFillColor(..._.panel),n.setDrawColor(..._.border),n.roundedRect(w,k,T,17,2.5,2.5,"FD"),n.setTextColor(..._.navy),n.setFont("helvetica","bold"),n.setFontSize(9),n.text(A.label,w+5,k+6),n.setFont("helvetica","normal"),n.setTextColor(..._.muted),n.setFontSize(8),n.text(`${p.stats.checked} automated checks produced verified outcomes. ${p.stats.failed} require action and ${p.stats.unknown} should be reviewed or rescanned.`,w+5,k+12,{maxWidth:T-10}),k+=25,$("Priority action plan","Failed automated checks are listed first so the highest-value remediation work is easy to assign."),p.priorityActions.length?(Bt(n,{startY:k,head:[["Priority","Issue","Recommended action and evidence"]],body:p.priorityActions.map((U,G)=>[String(G+1).padStart(2,"0"),`${U.name} 13${U.categoryName}`,`${U.action} 14Evidence: ${U.details}`]),theme:"grid",margin:{left:w,right:w,top:23,bottom:18},styles:{font:"helvetica",fontSize:7.4,cellPadding:2.3,lineColor:_.border,lineWidth:.2,textColor:_.slate,valign:"top"},headStyles:{fillColor:_.navy,textColor:_.white,fontStyle:"bold",fontSize:7.8},alternateRowStyles:{fillColor:_.panel},columnStyles:{0:{cellWidth:16,halign:"center",fontStyle:"bold",textColor:_.red},1:{cellWidth:54,fontStyle:"bold",textColor:_.navy},2:{cellWidth:T-70}},willDrawPage:P,rowPageBreak:"avoid"}),k=n.lastAutoTable.finalY+10):(n.setFillColor(..._.greenSoft),n.setDrawColor(..._.green),n.roundedRect(w,k,T,16,2.5,2.5,"FD"),n.setTextColor(..._.green),n.setFont("helvetica","bold"),n.setFontSize(9),n.text("No failed automated checks were recorded.",w+5,k+7),n.setFont("helvetica","normal"),n.setFontSize(7.5),n.text("Schedule periodic rescans to keep the audit evidence current.",w+5,k+12),k+=24),$("Automated audit details","Complete evidence by category. PASS means verified, ACTION means failed, and VERIFY means no reliable outcome was available.");for(const U of p.categories){D(24);const G=js[U.id]||_.slate;n.setFillColor(...G),n.roundedRect(w,k,T,9,2,2,"F"),n.setTextColor(..._.white),n.setFont("helvetica","bold"),n.setFontSize(8.5),n.text(U.name,w+4,k+6),n.text(`${U.passed}/${U.checked} passed (${U.score}%)`,x-w-4,k+6,{align:"right"}),k+=11,Bt(n,{startY:k,head:[["Status","Check","Evidence"]],body:U.rows.map(V=>[ft[V.status].label,V.name,V.details]),theme:"grid",margin:{left:w,right:w,top:23,bottom:18},styles:{font:"helvetica",fontSize:7.4,cellPadding:2.1,lineColor:_.border,lineWidth:.2,textColor:_.slate,valign:"top",overflow:"linebreak"},headStyles:{fillColor:[241,245,249],textColor:_.navy,fontStyle:"bold",fontSize:7.6},alternateRowStyles:{fillColor:[252,252,253]},columnStyles:{0:{cellWidth:20},1:{cellWidth:57,fontStyle:"bold",textColor:_.navy},2:{cellWidth:T-77}},didParseCell(V){var ce;V.section==="body"&&V.column.index===0&&Es(V.cell,(ce=U.rows[V.row.index])==null?void 0:ce.status)},willDrawPage:P,rowPageBreak:"avoid"}),k=n.lastAutoTable.finalY+8}const te=n.internal.getNumberOfPages();for(let U=1;U<=te;U+=1)n.setPage(U),P(),n.setDrawColor(..._.border),n.setLineWidth(.25),n.line(w,N-13,x-w,N-13),n.setTextColor(..._.muted),n.setFont("helvetica","normal"),n.setFontSize(7),n.text(`${R} | Confidential audit report`,w,N-7),n.text(`Page ${U} of ${te}`,x-w,N-7,{align:"right"});return{doc:n,model:p,filename:$s(p.url,p.generatedAt)}},Ds=s=>{const i=Rs(s);return i.doc.save(i.filename),i},me={authority_technical:{name:"Authority & Technical",icon:Je,color:"blue",checks:[{id:"ssl_enabled",name:"SSL Certificate (HTTPS)",description:"Website uses secure HTTPS connection",automated:!0,tutorial:"https://www.youtube.com/watch?v=hBr-C9OXgjg"},{id:"has_favicon",name:"Has Favicon",description:"Website has a favicon defined",automated:!0,tutorial:"https://youtu.be/kJeSNHUJBhs"}
14,{id:"has_logo",name:"Has Logo Image",description:"Logo detected in header/navigation",automated:!0,tutorial:"https://youtu.be/kJeSNHUJBhs"},{id:"has_sitemap_link",name:"Sitemap Link Present",description:"XML sitemap linked or discoverable",automated:!0,tutorial:"https://www.youtube.com/watch?v=_A9AK-zpVo8"},{id:"has_semantic_html",name:"Semantic HTML Tags",description:"Uses semantic elements (header, nav, main, article, section, footer)",automated:!0,tutorial:null},{id:"robots_has_sitemap",name:"Robots.txt Has Sitemap",description:"Robots.txt contains Sitemap directive",automated:!0,tutorial:"https://youtu.be/4OXhWWHwZSU"},{id:"has_open_graph",name:"Open Graph Tags",description:"OG meta tags for social sharing",automated:!0,tutorial:"https://youtu.be/YcDBP9mThwg"},{id:"preferred_version",name:"Preferred Version Check",description:"Only one URL variant loads directly; the others redirect to it",automated:!0,expandable:!0,tutorial:"https://youtu.be/Uyagz3dbn74"},{id:"trailing_slash_check",name:"Trailing Slash Check",description:"Pages redirect consistently with/without trailing slash",automated:!0,expandable:!0,tutorial:"https://www.youtube.com/watch?v=TBl8PB8-dtY"},{id:"has_canonical",name:"Canonical Tag Set",description:"Canonical URL defined for page",automated:!0,tutorial:"https://youtu.be/HU5gxX55ebA"}]},schema_markup:{name:"Schema Markup",icon:Yt,color:"purple",checks:[{id:"schema_organization",name:"Organization Schema",description:"Business/company structured data",automated:!0,tutorial:"https://youtu.be/xuXEHngLbZk"},{id:"schema_website",name:"WebSite Schema",description:"Site-level schema with potential search action",automated:!0,tutorial:"https://youtu.be/OUOH7XVMkyA"},{id:"schema_webpage",name:"WebPage Schema",description:"Page-level structured data",automated:!0},{id:"schema_article",name:"Article Schema",description:"Article/BlogPosting markup",automated:!0},{id:"schema_person",name:"Person Schema",description:"Author/person structured data",automated:!0},{id:"schema_faq",name:"FAQ Schema",description:"FAQPage markup for rich snippets",automated:!0,tutorial:"https://www.youtube.com/watch?v=RgXFOshcTCg"},{id:"schema_breadcrumb",name:"BreadcrumbList Schema",description:"Navigation breadcrumb markup",automated:!0,tutorial:"https://www.youtube.com/watch?v=lyzqOVOgxmI"},{id:"schema_sitenavigation",name:"SiteNavigation Schema",description:"Navigation element markup",automated:!0,tutorial:"https://youtu.be/h2_UXDg0UAU"},{id:"schema_newsarticle",name:"NewsArticle Schema",description:"News-specific article markup",automated:!0,tutorial:"https://www.youtube.com/watch?v=a6a4EYZT6vc"},{id:"schema_localbusiness",name:"LocalBusiness Schema",description:"Local business information",automated:!0,tutorial:"https://youtu.be/S4pGo2bVFJ0"}]},eeat_pages:{name:"EEAT Pages",icon:$a,color:"emerald",checks:[{id:"has_privacy_policy",name:"Privacy Policy Page",description:"Link to privacy policy found",automated:!0,tutorial:"https://www.youtube.com/watch?v=2eJZElqfn0k"},{id:"has_terms",name:"Terms of Service Page",description:"Link to terms of service found",automated:!0,tutorial:"https://www.youtube.com/watch?v=Je7FE83dczA"},{id:"has_about",name:"About Us Page",description:"Link to about page found",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"has_contact",name:"Contact Us Page",description:"Link to contact page found",automated:!0,tutorial:"https://www.youtube.com/watch?v=AR-cgCAhBXA"},{id:"has_authors_page",name:"Authors/Team Page",description:"Link to authors or team page found",automated:!0,tutorial:"https://youtu.be/yFAn4yTi0aY"},{id:"has_editorial",name:"Editorial Guidelines",description:"Link to editorial guidelines found",automated:!0,tutorial:"https://youtu.be/IZwoXq3MKyc"},{id:"has_html_sitemap",name:"HTML Sitemap",description:"Link to HTML sitemap found",automated:!0,tutorial:"https://youtu.be/Rx3l4h6T0Es"}]},footer_elements:{name:"Footer EEAT",icon:Mt,color:"amber",checks:[{id:"has_copyright",name:"Copyright Notice",description:"Copyright text found in footer",automated:!0,tutorial:"https://www.youtube.com/watch?v=R1BL4dz8kqE"},{id:"copyright_current_year",name:"Copyright Current Year",description:"Copyright notice shows the current year",automated:!0,tutorial:"https://youtu.be/YV3y3Le3mfM"},{id:"has_address",name:"Physical Address",description:"Address in the footer or beside an address/map-pin icon",automated:!0,tutorial:"https://youtu.be/ilCA2XoVQxw"},{id:"has_email",name:"Contact Email",description:"Email address visible",automated:!0,tutorial:"https://youtu.be/ilCA2XoVQxw"},{id:"has_phone",name:"Phone Number",description:"Phone number visible",automated:!0,tutorial:"https://youtu.be/ilCA2XoVQxw"},{id:"footer_social_links",name:"Social Links in Footer",description:"Social media links present",automated:!0,tutorial:"https://youtu.be/6rKWbiKIj0s"},{id:"has_dmca",name:"DMCA Badge",description:"DMCA protection badge/link",automated:!0,tutorial:"https://www.youtube.com/watch?v=mZmUSh5-dOg"},{id:"footer_has_menu",name:"Footer Menu Links",description:"Footer has links to About, Contact, Terms, etc",automated:!0,tutorial:"https://youtu.be/4ViFSeSuLrw"},{id:"footer_website_description",name:"Short Website Description",description:"Footer contains a brief site description",automated:!0,tutorial:"https://youtu.be/w-LF42WwUAc"},{id:"footer_parent_company",name:"Parent Company Listed",description:"Parent company or business entity mentioned",automated:!0,tutorial:"https://youtu.be/woxGyvD9DlU"}]},author_elements:{name:"Author EEAT",icon:Pa,color:"indigo",checks:[{id:"has_author_box",name:"Author Box Present",description:"Author bio box on article",automated:!0,tutorial:"https://youtu.be/9udCPiqmdT0"},{id:"author_has_image",name:"Author Has Image",description:"Author photo displayed",automated:!0,tutorial:"https://youtu.be/UBdUluQQ5fA"},{id:"author_has_bio",name:"Author Has Bio",description:"Author biography/description present",automated:!0,tutorial:"https://youtu.be/hlut6aYcjZA"},{id:"author_has_social",name:"Author Social Links",description:"Author social profiles linked",automated:!0,tutorial:"https://youtu.be/jZmIgqVb8vo"}
14,{id:"multiple_authors",name:"Multiple Authors/Reviewed By",description:"Shows reviewer or secondary author",automated:!0,tutorial:"https://youtu.be/ur3Sbq-bevQ"},{id:"no_admin_author",name:'No "admin" Author',description:'Author name is not generic "admin"',automated:!0,tutorial:"https://youtu.be/yK-np5LAR9w"}]},article_elements:{name:"Article EEAT",icon:La,color:"rose",checks:[{id:"has_publish_date",name:"Publication Date Visible",description:"Article shows publish date",automated:!0,tutorial:"https://youtu.be/KkZgRI5ujDA"},{id:"has_modified_date",name:"Last Modified Date",description:"Shows last updated date",automated:!0,tutorial:"https://youtu.be/054jET8PY-M"},{id:"url_no_date",name:"URL Without Dates",description:"Permalink does not contain date",automated:!0,tutorial:"https://youtu.be/enzf0n18iRI"},{id:"has_breadcrumbs",name:"Breadcrumb Navigation",description:"Breadcrumb trail present",automated:!0,tutorial:"https://www.youtube.com/watch?v=lyzqOVOgxmI"},{id:"has_toc",name:"Table of Contents",description:"TOC for article navigation",automated:!0,tutorial:"https://www.youtube.com/watch?v=pqJi7XULQlM"},{id:"has_sources",name:"Sources/Citations",description:"References or sources cited",automated:!0,tutorial:"https://youtu.be/Y7sesKUkN_8"},{id:"has_social_share",name:"Social Share Buttons",description:"Sharing buttons for social media",automated:!0,tutorial:"https://www.youtube.com/watch?v=wEJ-GrIm0Xc"},{id:"good_heading_structure",name:"Proper Heading Hierarchy",description:"H1-H6 used correctly",automated:!0,tutorial:"https://youtu.be/yk43tysrIgA"},{id:"no_empty_links",name:"No Empty # Links",description:'No placeholder href="#" links',automated:!0,tutorial:"https://youtu.be/UFzAJhGngMg"}]},social_presence:{name:"Social Presence",icon:Ba,color:"cyan",checks:[{id:"link_twitter",name:"Twitter/X Link",description:"Twitter profile linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"link_facebook",name:"Facebook Link",description:"Facebook page linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"link_linkedin",name:"LinkedIn Link",description:"LinkedIn profile linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"link_youtube",name:"YouTube Link",description:"YouTube channel linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"link_instagram",name:"Instagram Link",description:"Instagram profile linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"link_pinterest",name:"Pinterest Link",description:"Pinterest profile linked",automated:!0,tutorial:"https://youtu.be/zBVlXRHVkvc"},{id:"link_tiktok",name:"TikTok Link",description:"TikTok profile linked",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"},{id:"has_rss",name:"RSS Feed",description:"RSS feed available",automated:!0,tutorial:"https://youtu.be/sy0DWD8Czz0"}]},affiliate_seo:{name:"Affiliate SEO",icon:Zt,color:"orange",checks:[{id:"affiliate_nofollow",name:"Affiliate Links Nofollowed",description:'External affiliate links have rel="nofollow"',automated:!0,tutorial:"https://youtu.be/OVAyTYsLNXk"},{id:"has_sponsored_tag",name:"Sponsored Tag Present",description:'rel="sponsored" on affiliate links',automated:!0,tutorial:"https://youtu.be/qxgepaLCzaw"},{id:"has_disclosure",name:"Affiliate Disclosure",description:"Affiliate/sponsorship disclosure present",automated:!0,tutorial:"https://youtu.be/PKsZKHm4AZg"}]},ux_elements:{name:"UX Elements",icon:Gt,color:"teal",checks:[{id:"has_search",name:"Search Functionality",description:"Search bar/form present",automated:!0,tutorial:"https://youtu.be/FjK9aeQkG9s"},{id:"has_back_to_top",name:"Back to Top Button",description:"Scroll to top button",automated:!0,tutorial:"https://youtu.be/GB0JCrbweNc"},{id:"external_links_new_tab",name:"External Links New Tab",description:"External links open in new tab",automated:!0,tutorial:"https://youtu.be/nZA7W6latJA"},{id:"images_have_alt",name:"Images Have Alt Text",description:"All images have alt attributes",automated:!0,tutorial:"https://youtu.be/2PLVWkGid6A"},{id:"no_broken_images",name:"No Missing Images",description:"No broken image references detected",automated:!0,tutorial:"https://youtu.be/FOC3fTDrbKI"}]},about_page_checks:{name:"About Us Page",icon:Wa,color:"lime",checks:[{id:"about_parent_company",name:"Parent Company Described",description:"Parent company or business entity is described",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_our_story",name:"Our Story Section",description:'Contains an "Our Story" or history section',automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_who_we_are",name:"Who We Are Section",description:'Contains a "Who We Are" section',automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_what_we_do",name:"What We Do Section",description:'Contains a "What We Do" section',automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_trusted_source",name:"Trusted Source Statement",description:"Contains trust or credibility statement",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_team_photos",name:"Team Photos in Workspace",description:"Team or office photos present on page",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_mailing_address",name:"Mailing Address Listed",description:"Physical mailing address on about page",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_social_proof",name:"Social Proof Displayed",description:"Testimonials, reviews, or awards displayed",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"},{id:"about_featured_websites",name:"Featured Websites Linked",description:"Links to featured or partner websites",automated:!0,tutorial:"https://youtu.be/GCVKjUwMOZc"}]},homepage_checks:{name:"Homepage Checks",icon:Mt,color:"violet",homepageOnly:!0,checks:[{id:"index_php_redirect",name:"index.php Redirects to Home",description:"index.php properly redirects to homepage",automated:!0,tutorial:"https://youtu.be/mS073hgfvTk"},{id:"homepage_not_noindex",name:"Homepage Not Noindexed",description:"Homepage is indexable by search engines",automated:!0,tutorial:"https://youtu.be/TByjQWfAXpY"},{id:"homepage_title_not_home",name:'Homepage Title Not "Home"',description:'Title tag is descriptive, not just "Home"',automated:!0,tutorial:"https://youtu.be/d1VnNWjTK6k"},{id:"homepage_content_visible",name:"Homepage Content Visible",description:"Homepage has substantial visible content",automated:!0,tutorial:"https://youtu.be/1W_oNRLzAnk"},{id:"homepage_no_redirect_chains",name:"No Homepage Redirect Chains",description:"Homepage loads without multiple redirects",automated:!0,tutorial:"https://youtu.be/ZqlT5orHhbE"}]},onsite_checks:{name:"EEAT On Site Check",icon:Je,color:"pink",checks:[{id:"no_hello_world",name:"Remove Default Content",description:"Default WordPress /hello-world/ post and /sample-page/ are removed",automated:!0,tutorial:null},{id:"no_uncategorized",name:"Configure Uncategorized Category",description:"Default /uncategorized/ or /category/uncategorized/ is removed or renamed",automated:!0,tutorial:null},{id:"no_read_more_buttons",name:"No Read More Buttons",description:'Use title links instead of "Read More" buttons',automated:!0,tutorial:null},{id:"no_headings_before_h1",name:"No Headings Before H1",description:"H2-H6 should not appear before the first H1 tag",automated:!0,tutorial:null},{id:"no_empty_hash_links",name:"No Empty # Links",description:'No placeholder href="#" links on the page',automated:!0,tutorial:null},{id:"links_look_like_links",name:"Links Look Like Links",description:"Links should have underline or distinct color styling",automated:!0,tutorial:null},{id:"no_background_images_content",name:"No Content as Backgroun
14d Images",description:"Important images should use img tags, not CSS backgrounds",automated:!0,tutorial:null},{id:"no_sentence_headings",name:"No Sentence Headings",description:"Headings should be concise, not entire paragraphs",automated:!0,tutorial:null},{id:"no_duplicate_plugins",name:"No Duplicate Functionality Plugins",description:"No multiple cache or SEO plugins detected",automated:!0,tutorial:null},{id:"gtm_not_in_body",name:"GTM Not in Body",description:"Google Tag Manager code should be in <head>, not <body>",automated:!0,tutorial:null},{id:"external_links_not_all_nofollow",name:"External Links Not All Nofollow",description:"Some external links should be followed for link juice",automated:!0,tutorial:null},{id:"no_staging_menu_links",name:"No Staging URLs in Menu",description:"Menu links should not point to staging/dev URLs",automated:!0,tutorial:null},{id:"menu_footer_not_nofollow",name:"Menu/Footer Links Not Nofollow",description:"Navigation links should not have nofollow attribute",automated:!0,tutorial:null},{id:"robots_sitemap_not_broken",name:"Robots Sitemap Not Broken",description:"XML sitemap URL in robots.txt is accessible",automated:!0,tutorial:null}]}},Ke={new_website:{name:"New Website Setup",icon:Ma,color:"slate",items:[{text:"Select PMD Domain (if Starting New)",tutorial:"https://youtu.be/pfaXgQJDKQM"},{text:"Select Good Domain Registrar",tutorial:"https://youtu.be/zBZVeokeFc8"},{text:"Select Fastest Hosting",tutorial:"https://youtu.be/Zy7LmxLSczk"},{text:"Select Expired Domain to Avoid Sandbox Issues",tutorial:"https://youtu.be/BcPXsB8IRNE"},{text:"Terms & Privacy Policy has Unique Content",tutorial:"https://youtu.be/P2YidkIUnwE"},{text:"Website Passes Web Core Vitals",tutorial:"https://youtu.be/8YQOYkQtnn4"},{text:"Blog Section on Website",tutorial:"https://youtu.be/PTQlxIDrves"},{text:"Categories have atleast 100 Words",tutorial:"https://youtu.be/TWA4IYie_RQ"},{text:"Menu/Homepage Optimized for Crawl Depth 1",tutorial:"https://youtu.be/5HwIZVZVvd8"},{text:"Website has a News Section",tutorial:"https://youtu.be/IY7MmNpHR8I"}]},onsite_seo:{name:"On-Site SEO Configuration",icon:Xt,color:"slate",items:[{text:"Rank Math Configured Correctly",tutorial:"https://www.youtube.com/watch?v=AxASIqOH3hI"},{text:"Yoast SEO Configured Correctly",tutorial:"https://www.youtube.com/watch?v=O9idSAH-pes"},{text:"Static Homepage Set",tutorial:"https://youtu.be/I1_KSThpY6g"},{text:"Pingers Configured",tutorial:"https://youtu.be/UfiReqXZzIM"},{text:"WordPress Configured Correctly",tutorial:"https://youtu.be/zQBRf5HOJVM"},{text:"Topic Authority using Topics",tutorial:"https://youtu.be/LlvnWBINfyE"},{text:"Guidelines for Tag Topics",tutorial:"https://youtu.be/UP3xvi3wDtk"}]},author_manual:{name:"Author Quality (Manual)",icon:Da,color:"slate",items:[{text:"No Duplicate Authors on Website",tutorial:"https://youtu.be/AQsa9O1Ipfw"},{text:"No AI-generated Author Photos",tutorial:"https://youtu.be/VGEjF1FH_DI"},{text:"No Fake Famous Personality Authors",tutorial:"https://youtu.be/-QMS22PY5Q8"},{text:"Authors have Degree Badges",tutorial:"https://youtu.be/tmi4o5yI-9o"},{text:"Authors Shown on Homepage",tutorial:"https://youtu.be/nixWlK5gEf0"},{text:"Author Summary, Education & Experience",tutorial:"https://youtu.be/dUGMPGvqIf4"},{text:"Author Schema with EEAT Data",tutorial:"https://youtu.be/5J4nbpSC6gc"},{text:"Professional Headshot Photos",tutorial:"https://youtu.be/UBdUluQQ5fA"},{text:"Featured Sources where Author Written",tutorial:"https://youtu.be/NtweaKvLeaQ"},{text:"At least 3 Authors on Website",tutorial:"https://youtu.be/E3qBtKazxJ8"}]},article_manual:{name:"Article Quality (Manual)",icon:Xe,color:"slate",items:[{text:"Summarized Points at Article Start",tutorial:"https://youtu.be/xIrRSjb5_AE"},{text:"Last Updated Not Always Today",tutorial:"https://youtu.be/054jET8PY-M"},{text:"No Grammar/Spelling Mistakes",tutorial:"https://youtu.be/mhXBYk8yiFc"},{text:"No Suspicious External Links",tutorial:"https://youtu.be/v8ZRUBiV6Lg"},{text:"No Multiple Categories per Post",tutorial:"https://youtu.be/qvN9rNyUlTA"},{text:"Articles Updated Recently",tutorial:"https://youtu.be/aID5rzdHSME"},{text:"Avoid Uncertainty Words",tutorial:"https://youtu.be/ql_tuuOiwAk"},{text:"Personal Experience Proof",tutorial:"https://youtu.be/FqWxgT-QXAU"},{text:"Authors Linked in Articles",tutorial:"https://youtu.be/Yo9wBa6eDVc"},{text:"Product Testing Images/Videos",tutorial:"https://youtu.be/7Fy7-T-kOUs"},{text:"Strong Authority Sources",tutorial:"https://youtu.be/n85HHdZZt4U"},{text:"Featured Brands on Homepage",tutorial:"https://youtu.be/8U-wBfaWV4E"},{text:"Factors to Consider Section",tutorial:"https://youtu.be/HwsXHG3gTYk"},{text:"Testing Process Described",tutorial:"https://youtu.be/TyhKjhN3ZlE"}]},search_console:{name:"Search Console Setup",icon:Za,color:"slate",items:[{text:"Verified on Google Search Console",tutorial:"https://www.youtube.com/watch?v=bzq2yi69OgU"},{text:"Verified on Google Analytics",tutorial:"https://www.youtube.com/watch?v=bzq2yi69OgU"},{text:"Verified on Bing Webmasters",tutorial:"https://www.youtube.com/watch?v=bzq2yi69OgU"},{text:"Verified on Yandex Webmasters",tutorial:"https://www.youtube.com/watch?v=bzq2yi69OgU"},{text:"Sitemap Submitted to GSC",tutorial:"https://youtu.be/3ZUX7sr4C1M"},{text:"Sitemap Submitted to Bing",tutorial:"https://youtu.be/CNE3ZDqsJ1Q"}]}},sa=Object.freeze(Object.fromEntries(Object.entries(me).flatMap(([s,i])=>i.checks.map(o=>[o.id,{...o,category:s}])))),Vt=Object.freeze(Object.keys(sa)),na=Object.freeze(Object.entries(Ke).flatMap(([s,i])=>i.items.map((o,l)=>`${s}_${l}`))),Ms=new Set(na),ut=na.length,qt=new Set(["ssl_enabled","has_canonical","has_privacy_policy","has_contact","schema_organization"]),le=(s,i)=>{var o,l;return((l=(o=String(s||"").match(new RegExp(`\\b${i}\\s*=\\s*["']([^"']*)["']`,"i")))==null?void 0:o[1])==null?void 0:l.trim())||""},C=(s,i)=>
14({type:"evidence",title:s,items:i.filter(Boolean).slice(0,50).map(String)}),Y=(s,i=800)=>{const o=String(s||"").replace(/\s+/g," ").trim();return o.length>i?`${o.slice(0,i)}â¦`:o},$e=(s,i,o=140)=>{const l=String(s||"").replace(/<(script|style|svg|template)\b[^>]*>[\s\S]*?<\/\1>/gi," ").replace(/©|©|©/gi,"©").replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();i.lastIndex=0;const d=i.exec(l);if(!d)return"";const p=Math.max(0,d.index-o),n=Math.min(l.length,d.index+d[0].length+o);return Y(l.slice(p,n),o*2+60)},Ee=(s,i,o=25)=>{const l=String(s||"").match(/<a\b[^>]*href\s*=\s*["'][^"']+["'][^>]*>[\s\S]*?<\/a>/gi)||[],d=[],p=new Set;for(const n of l){const x=le(n,"href");if(i.lastIndex=0,!i.test(x))continue;const N=Y(n);if(p.has(N)||(p.add(N),d.push(N)),d.length>=o)break}return d},J=({html:s,hrefPattern:i,foundDetails:o,missingDetails:l="Not found",evidenceTitle:d,additionalEvidence:p=[],matchAnywhere:n=!1})=>{var R;const x=Ee(s,i);i.lastIndex=0;const N=n?(R=i.exec(String(s||"")))==null?void 0:R[0]:"",w=[...x,x.length===0&&N?`Matched URL: ${N}`:"",...p].filter(Boolean),T=w.length>0;return{passed:T,details:T?o:l,expandable:!0,expandedData:C(d,T?w:[`No matching ${d.toLowerCase()} was found in the page HTML.`])}},he=(s,i,o)=>{const l=ea(s,i);let d="";return l.data?d=JSON.stringify(l.data,null,2):l.raw&&(d=l.raw),{passed:l.found,details:l.found?l.matchCount>1?`${l.matchCount} ${l.matchedType||o} schema nodes found`:`${l.matchedType||o} schema found`:`${o} schema not found`,expandable:!0,expandedData:{type:"schema",title:l.found?l.matchCount>1?`Extracted ${l.matchCount} ${l.matchedType||o} schema nodes`:`Extracted ${l.matchedType||o} schema`:`${o} schema`,format:l.format||"",content:d.slice(0,5e4),emptyMessage:`No ${o} JSON-LD or microdata markup was extracted from this page.`}}},Us=({value:s,color:i,empty:o=!1,size:l=32,stroke:d=4})=>{const p=(l-d)/2,n=2*Math.PI*p;return e.jsxs("svg",{width:l,height:l,className:"-rotate-90 flex-shrink-0","aria-hidden":"true",children:[e.jsx("circle",{cx:l/2,cy:l/2,r:p,fill:"none",stroke:"var(--sx-track)",strokeWidth:d}),!o&&e.jsx("circle",{cx:l/2,cy:l/2,r:p,fill:"none",stroke:i,strokeWidth:d,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:n-Math.min(s,100)/100*n,className:"transition-all duration-700"})]})},en=()=>{const[s,i]=F.useState(""),[o,l]=F.useState({}),[d,p]=F.useState({}),[n,x]=F.useState(null),[N,w]=F.useState(null),[T,R]=F.useState(!1),[A,k]=F.useState(!1),[P,D]=F.useState(""),[$,W]=F.useState(!1),[Q,X]=F.useState({}),[ee,te]=F.useState("automated"),[U,G]=F.useState(!1),[V,ce]=F.useState(!1),[ve,de]=F.useState(null),[_e,Re]=F.useState(null),[et,Te]=F.useState({}),[M,ie]=F.useState("all"),[re,Se]=F.useState(null),[ne,De]=F.useState(!1),[oa]=F.useState(()=>Date.now()),{addNotification:ia}=ja(),{getToolResults:bt,saveToolResults:yt}=Ca(),{user:B,selectedProject:H}=Ta(),[je,wt]=Aa(),vt=F.useRef(!1),tt="eeat_audit",Me=je.get("website")||je.get("url"),Ue=(H==null?void 0:H.id)||(B==null?void 0:B.id)||"guest",ra=F.useCallback(r=>{const a=fe(r||"");if(!a)return;const u=new URLSearchParams(je);u.set("website",a),u.delete("url"),wt(u,{replace:!0})},[je,wt]),kt=F.useCallback(r=>{if(!r||typeof r!="object")return!1;const a=hs(r.checkResults,Vt);if(Object.keys(a).length===0)return!1;for(const[y,b]of Object.entries(a))a[y]={...b,...sa[y],passed:b.passed,details:b.details};const u={};for(const[y,b]of Object.entries(r.manualChecks||{}))Ms.has(y)&&b===!0&&(u[y]=!0);return l(a),p(u),W(!0),G(!!r.isHomepage),ce(!!r.isAffiliateMode),de(Array.isArray(r.preferredVersionResults)?r.preferredVersionResults:null),Re(r.trailingSlashResults&&typeof r.trailingSlashResults=="object"?r.trailingSlashResults:null),Se(Number(r.timestamp)||null),D(""),!0},[]),Oe=F.useCallback(r=>{var u;const a=fe(r);if(!a)return!1;De(!0);try{const y=Oa(tt,Ue,Ut),b=H!=null&&H.id?(u=bt(H.id,"eeatAudit"))==null?void 0:u.results:null,z=[y,b].filter(E=>E&&E.cacheVersion===Ot&&fe(E.url)===a&&Date.now()-Number(E.timestamp||0)<Ut).sort((E,I)=>Number(I.timestamp||0)-Number(E.timestamp||0));return z.length>0?kt(z[0]):!1}finally{De(!1)}},[kt,Ue,bt,H==null?void 0:H.id]),He=F.useCallback(({preserveManual:r=!0}={})=>
14{l({}),r||p({}),W(!1),Se(null),D(""),de(null),Re(null)},[]);F.useEffect(()=>{if(!Me&&H!=null&&H.domain){let r="";try{r=Qe(H.domain)}catch{return}fe(r)!==fe(s)&&queueMicrotask(()=>{Oe(r)||He({preserveManual:!1}),i(r)})}},[He,Oe,Me,H,s]),F.useEffect(()=>{if(!Me||$)return;let r="";try{r=Qe(Me)}catch{return}fe(r)!==fe(s)&&queueMicrotask(()=>{i(r),Oe(r)})},[$,Oe,Me,s]),F.useEffect(()=>{if(!$||!s||Object.keys(o).length===0)return;const r=setTimeout(()=>{try{const a=Number(re)||Date.now(),u=Ft(o,d,ut),y={cacheVersion:Ot,url:s,checkResults:o,manualChecks:d,analysisComplete:!0,isHomepage:U,isAffiliateMode:V,preferredVersionResults:ve,trailingSlashResults:_e,score:u.score,timestamp:a};Ha(tt,Ue,y),re||Se(a);const b=(H==null?void 0:H.id)||Ht(B==null?void 0:B.projects,s);b&&yt(b,"eeatAudit",y)}catch(a){console.error("Error saving EEAT cache:",a)}},300);return()=>clearTimeout(r)},[s,o,d,$,U,V,ve,_e,B==null?void 0:B.projects,yt,H==null?void 0:H.id,Ue,re]);const la=(r,a,u,y={})=>{var z,E,I,se,q,K,xe,qe;const b=new URL(u);switch(r){case"ssl_enabled":{const t=b.protocol==="https:";return{passed:t,details:t?"HTTPS enabled":"Not using HTTPS",expandable:!0,expandedData:C("HTTPS connection evidence",[`Final page URL: ${b.href}`,`Detected protocol: ${b.protocol.replace(":","").toUpperCase()}`,t?"The fetched page resolved over an encrypted HTTPS URL.":"The fetched page resolved over HTTP and should redirect to HTTPS."])}}case"has_favicon":{const t=(a.match(/<link\b[^>]*>/gi)||[]).filter(f=>/\b(?:icon|shortcut icon|apple-touch-icon|mask-icon)\b/i.test(le(f,"rel"))),c=t.length>0,h=t.map(f=>{const m=le(f,"href");return`${le(f,"rel")||"icon"}: ${m||f}`});return{passed:c,details:c?"Favicon found":"No favicon detected",expandable:!0,expandedData:C("Favicon evidence",c?h:['No <link rel="icon">, shortcut icon, Apple touch icon, or mask icon was found.'])}}case"has_logo":{const t=ls(a,u),c=t.length>0;return{passed:c,details:c?"Logo detected":"No logo found in header",expandable:!0,expandedData:C("Logo evidence",c?t.flatMap(h=>[h.reason,h.tag]):["No logo-labelled image, SVG, logo widget, or homepage-linked header image was found."])}}case"has_sitemap_link":{const t=y.sitemapCheckResult;if(t)return{passed:t.found,details:t.details,expandable:!0,expandedData:C("Sitemap discovery evidence",[t.url?`Sitemap URL: ${t.url}`:"",t.source?`Discovered via: ${t.source}`:"",t.details])};const c=/sitemap\.xml/i.test(a)||/href=["'][^"']*\/sitemap[/"']/i.test(a)||/>\s*sitemap\s*</i.test(a)||/sitemap<\/a>/i.test(a);return{passed:c,details:c?"Sitemap reference found in HTML":"No sitemap link detected",expandable:!0,expandedData:C("Sitemap discovery evidence",[c?"A sitemap reference was found in the page HTML.":"No sitemap reference was found in robots.txt, common sitemap locations, or the page HTML."])}}case"has_semantic_html":{const c=Object.fromEntries(["header","nav","main","article","section","aside","footer"].map(v
14=>[v,0]));for(const v of a.matchAll(/<(header|nav|main|article|section|aside|footer)\b/gi))c[v[1].toLowerCase()]+=1;const h=Object.entries(c).filter(([,v])=>v>0).map(([v])=>v),f=h.length,m=f>=3,g=m?`${f} semantic tags found: ${h.join(", ")}`:f>0?`Only ${f} semantic tag(s): ${h.join(", ")}. Add more (header, nav, main, article, section, footer)`:"No semantic HTML tags found. Use <header>, <nav>, <main>, <article>, <section>, <footer>";return{passed:m,details:g,expandable:!0,expandedData:C("Semantic HTML evidence",[...Object.entries(c).filter(([,v])=>v>0).map(([v,j])=>`<${v}>: ${j} found`),f===0?"No supported semantic HTML elements were detected.":""])}}case"robots_has_sitemap":{const t=y.robotsContent;if(t==null)return{passed:null,details:"Robots.txt could not be verified",expandable:!0,expandedData:C("Robots.txt sitemap evidence",["The robots.txt response could not be retrieved securely."])};if(t==="")return{passed:!1,details:"Robots.txt not found",expandable:!0,expandedData:C("Robots.txt sitemap evidence",[`No readable robots.txt file was found at ${b.origin}/robots.txt.`])};const c=t.split(/\r?\n/).map(f=>f.trim()).filter(f=>/^Sitemap:/i.test(f)),h=c.length>0;return{passed:h,details:h?"Sitemap directive found in robots.txt":"No Sitemap in robots.txt",expandable:!0,expandedData:C("Robots.txt sitemap evidence",h?c:["robots.txt was retrieved, but it contains no Sitemap directive."])}}case"has_open_graph":{const t=(a.match(/<meta\b[^>]*>/gi)||[]).filter(h=>/^og:/i.test(le(h,"property")||le(h,"name"))),c=t.length>0;return{passed:c,details:c?`${t.length} Open Graph tags found`:"No OG tags detected",expandable:!0,expandedData:C("Open Graph evidence",c?t.map(h=>{const f=le(h,"property")||le(h,"name"),m=le(h,"content");return`${f}: ${m||"(empty content)"}`}):['No <meta property="og:..."> tags were detected.'])}}case"preferred_version":{const t=y.preferredVersionResults;return{...ms(t),expandable:Array.isArray(t)&&t.length>0,expandedData:t||[]}}case"trailing_slash_check":{const t=y.trailingSlashResults;return t&&t.results?{passed:t.passed,details:t.details||(t.passed?"Trailing slash handled correctly":"Inconsistent trailing slash"),expandable:!0,expandedData:t}:{passed:null,details:"Trailing-slash behavior could not be verified",expandable:!1}}case"has_canonical":{const t=(a.match(/<link\b[^>]*>/gi)||[]).filter(f=>le(f,"rel").split(/\s+/).some(m=>m.toLowerCase()==="canonical")),c=t.map(f=>le(f,"href")).filter(Boolean),h=t.length>0&&c.length>0;return{passed:h,details:h?"Canonical URL set":"No canonical tag",expandable:!0,expandedData:C("Canonical URL evidence",h?c.map(f=>`Canonical URL: ${f}`):['No valid <link rel="canonical" href="..."> element was found.'])}}case"schema_organization":return he(a,"Organization","Organization");case"schema_website":return he(a,"WebSite","WebSite");case"schema_webpage":return he(a,"WebPage","WebPage");case"schema_article":return he(a,["Article","BlogPosting"],"Article/BlogPosting");case"schema_person":return he(a,"Person","Person");case"schema_faq":return he(a,"FAQPage","FAQPage");case"schema_breadcrumb":return he(a,"BreadcrumbList","BreadcrumbList");case"schema_sitenavigation":return he(a,"SiteNavigationElement","SiteNavigationElement");case"schema_newsarticle":return he(a,"NewsArticle","NewsArticle");case"schema_localbusiness":return he(a,"LocalBusiness","LocalBusiness");case"has_privacy_policy":return J({html:a,hrefPattern:/(privacy|datenschutz)/i,foundDetails:"Privacy Policy link found",evidenceTitle:"Privacy Policy link evidence"});case"has_terms":return J({html:a,hrefPattern:/(terms|tos|conditions)/i,foundDetails:"Terms of Service link found",evidenceTitle:"Terms of Service link evidence"});case"has_about":return J({html:a,hrefPattern:/(about|uber-uns|about-us)/i,foundDetails:"About Us link found",evidenceTitle:"About Us link evidence"});case"has_contact":return J({html:a,hrefPattern:/(contact|kontakt)/i,foundDetails:"Contact link found",evidenceTitle:"Contact link evidence"});case"has_authors_page":return J({html:a,hrefPattern:/(author|team|writer|contributor)/i,foundDetails:"Authors/Team page link found",evidenceTitle:"Authors/Team link evidence"});case"has_editorial":return J({html:a,hrefPattern:/(editorial|guidelines|policy)/i,foundDetails:"Editorial Guidelines link found",evidenceTitle:"Editorial Guidelines link evidence"});case"has_html_sitemap":{const t=/>\s*html\s*sitemap\s*</i.test(a)?["Visible link text: HTML Sitemap"]:[];return J({html:a,hrefPattern:/sitemap(?!\.xml)/i,foundDetails:"HTML Sitemap link found",evidenceTitle:"HTML Sitemap link evidence",additionalEvidence:t})}case"has_copyright":{const c=[/©/,/©/i,/copyright/i,/\(c\)/i,/all\s*rights\s*reserved/i,/\d{4}\s*[-ââ]?\s*\d{0,4}
14\s*(?:all|rights|reserved)/i].some(f=>f.test(a)),h=$e((a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi)||[]).join("")||a,/©|é|copyright|\(c\)|all rights reserved/i);return{passed:c,details:c?"Copyright notice found":"No copyright text",expandable:!0,expandedData:C("Copyright notice evidence",[h||"No copyright marker or notice was found in the page HTML."])}}case"copyright_current_year":{const t=new Date().getFullYear(),c=ps(a,t),h=$e((a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi)||[]).join("")||a,new RegExp(`(?:©|é|copyright|\\(c\\)|all rights reserved)[^\\n]{0,160}\\b${t}\\b|\\b${t}\\b[^\\n]{0,160}(?:©|é|copyright|all rights reserved)`,"i"));return{passed:c,details:c?`Copyright notice includes ${t}`:`Copyright notice does not include ${t}`,expandable:!0,expandedData:C("Current-year copyright evidence",[h||`No copyright statement containing ${t} was found.`])}}case"has_address":{const t=ds(a);return{passed:t.found,details:t.found?"Physical address evidence detected":"No address found",expandable:!0,expandedData:C("Physical address evidence",t.found?t.evidence:["No PostalAddress schema, <address> element, footer address label, street-style address, or map-pin/address-icon text was found."])}}case"has_email":{const t=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,c=/mailto:/gi,h=a.match(t)||[],f=(a.match(c)||[]).length,m=h.length>0||f>0,g=Math.max(h.length,f),v=Ee(a,/^mailto:/i),j=[...new Set(h.map(L=>L.toLowerCase()))];return{passed:m,details:m?`${g} email(s) found`:"No email detected",expandable:!0,expandedData:C("Contact email evidence",m?[...j.map(L=>`Email: ${L}`),...v]:["No email address or mailto: link was found in the page HTML."])}}case"has_phone":{const c=[/tel:[^"'\s]+/i,/\+\d{1,4}[\s.-]*\d{1,4}[\s.-]*\d{1,4}[\s.-]*\d{1,9}/,/\+\d{10,15}/,/\(\d{3}\)[\s.-]*\d{3}[\s.-]*\d{4}/,/\d{3}[\s.-]\d{3}[\s.-]\d{4}/,/>\s*\+?\d[\d\s.-]{8,}/].some(v=>v.test(a)),h=Ee(a,/^tel:/i),f=a.match(/\+\d{1,4}(?:[\s().-]*\d){7,14}|\(\d{3}\)[\s.-]*\d{3}[\s.-]*\d{4}|\b\d{3}[\s.-]\d{3}[\s.-]\d{4}\b/g)||[],m=[...new Set(f.map(v=>`Phone: ${v.trim()}`)),...h],g=$e(a,/\+?\d(?:[\d\s().-]*\d){7,14}/);return{passed:c,details:c?"Phone number found":"No phone detected",expandable:!0,expandedData:C("Phone number evidence",c?m.length>0?m:[g||"A phone-like number was detected in visible element content."]:["No phone number or tel: link was found in the page HTML."])}}case"footer_social_links":{const c=[{name:"facebook",pattern:/facebook\.com\/[^"'\s<>]+/i},{name:"twitter",pattern:/(?:twitter|x)\.com\/[^"'\s<>]+/i},{name:"linkedin",pattern:/linkedin\.com\/(?:company|in)\/[^"'\s<>]+/i},{name:"instagram",pattern:/instagram\.com\/[^"'\s<>]+/i},{name:"youtube",pattern:/youtube\.com\/(?:channel|user|c|@)[^"'\s<>]*/i},{name:"pinterest",pattern:/pinterest\.com\/[^"'\s<>]+/i},{name:"tiktok",pattern:/tiktok\.com\/@?[^"'\s<>]+/i}].filter(f=>f.pattern.test(a)),h=c.flatMap(f=>{var g;const m=Ee(a,f.pattern,5);return m.length>0?m.map(v=>`${f.name}: ${v}`):[`${f.name}: ${((g=a.match(f.pattern))==null?void 0:g[0])||"URL detected"}`]});return{passed:c.length>=2,details:`${c.length} social platforms linked`,expandable:!0,expandedData:C("Footer social-link evidence",h.length>0?h:["No supported social-platform URL was found in the page HTML."])}}case"has_dmca":{const t=/dmca/i.test(a),c=[...Ee(a,/dmca/i),$e(a,/\bdmca\b/i)];return{passed:t,details:t?"DMCA reference found":"No DMCA badge",expandable:!0,expandedData:C("DMCA evidence",t?c:["No DMCA text, badge link, or DMCA URL was found."])}}case"footer_has_menu":{const c=(a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi)||[]).join("").match(/<a[^>]*href=["'][^"']+["'][^>]*>[\s\S]*?<\/a>/gi)||[],h=["about","contact","privacy","terms","disclaimer","faq","help","support","sitemap","careers","blog","press","media","legal","cookie","accessibility","refund","return","shipping","advertise","partner","affiliate","investor"],f=h.filter(v=>c.some(j=>new RegExp(v,"i").test(j))),m=f.length>=3,g=c.filter(v=>h.some(j=>new RegExp(j,"i").test(v))).map(v=>Y(v));return{passed:m,details:m?`Footer has ${f.length} essential links (${f.slice(0,6).join(", ")}${f.length>6?"...":""})`:`Only ${f.length}/3 essential links in footer`,expandable:!0,expandedData:C("Footer menu evidence",g.length>
140?g:["No About, Contact, Privacy, Terms, or other essential menu links were found inside a <footer> element."])}}case"footer_website_description":{const t=(a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi)||[]).join(""),c=/<[^>]*(widget.?text|site.?description|footer.?desc|footer.?about|footer.?info|tagline|footer.?text|footer.?content|about.?widget|company.?info|brand.?desc)[^>]*>/i.test(t),h=t.match(/<p[^>]*>[\s\S]*?<\/p>/gi)||[],f=h.some(L=>L.replace(/<[^>]*>/g,"").trim().split(/\s+/).length>10),m=/we are a|we're a|is a leading|is a premier|is your|dedicated to|specializing in|committed to|providing|offering|delivering|since \d{4}|established|serving|passionate about|is an? |welcome to/i.test(t),g=c||f||m,v=h.filter(L=>L.replace(/<[^>]*>/g,"").trim().split(/\s+/).length>10).map(L=>Y(L)),j=$e(t,/we are a|we're a|is a leading|is a premier|is your|dedicated to|specializing in|committed to|providing|offering|delivering|since \d{4}|established|serving|passionate about|welcome to/i);return{passed:g,details:g?"Website description found in footer":"No short description in footer",expandable:!0,expandedData:C("Footer website-description evidence",g?[...v,j,c?"A footer element uses a description/about/info CSS class or ID.":""]:["No substantial footer paragraph, description-style element, or descriptive phrase was found."])}}case"footer_parent_company":{const t=(a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi)||[]).join(""),c=/parent company|subsidiary|a division of|part of|owned by|operated by|a .{1,30} company|powered by|brand of|portfolio|umbrella|group of|holdings?|inc\.|incorporated|llc|l\.l\.c|ltd\.?|limited|corp\.?|corporation|gmbh|pvt\.?|private|pty\.?|co\.|s\.?a\.?|b\.?v\.?|s\.?r\.?l|s\.?p\.?a|plc|l\.?p\.?|registered|\u00a9\s*\d{4}\s+[A-Z]/i,h=c.test(t),f=$e(t,c);return{passed:h,details:h?"Parent company/entity mentioned in footer":"No parent company mentioned",expandable:!0,expandedData:C("Parent company/entity evidence",[f||"No parent-company phrase or recognizable legal business entity was found in the footer."])}}case"has_author_box":{const t=/<[^>]*(author-box|author-bio|byline|post-author|entry-author)[^>]*>/i.test(a);return{passed:t,details:t?"Author box detected":"No author box found"}}case"author_has_image":{const t=/<[^>]*(author|avatar)[^>]*>[\s\S]*?<img/i.test(a)||/<img[^>]*(author|avatar)[^>]*>/i.test(a);return{passed:t,details:t?"Author image found":"No author image"}}case"author_has_bio":{const t=/<[^>]*(author-bio|author-description|author-info)[^>]*>/i.test(a);return{passed:t,details:t?"Author bio section found":"No bio detected"}}case"author_has_social":{const t=a.match(/<[^>]*(author)[^>]*>[\s\S]*?<\/[^>]+>/i),c=t?t[0]:"",h=/twitter|facebook|linkedin|instagram/i.test(c);return{passed:h,details:h?"Author social links found":"No author socials"}}case"multiple_authors":{const t=/reviewed by|edited by|fact.?check|medical review|expert review/i.test(a);return{passed:t,details:t?"Multiple author attribution found":"Single author only"}}case"no_admin_author":{const t=/by\s+admin|author.*admin|admin.*author/i.test(a);return{passed:!t,details:t?'â ï¸ "admin" author detected':"No generic admin author"}}case"has_publish_date":{const t=/<time/i.test(a)||/published|posted|date/i.test(a);return{passed:t,details:t?"Publication date detected":"No date found"}}case"has_modified_date":{const t=/modified|updated|last.?edit/i.test(a);return{passed:t,details:t?"Modified date detected":"No update date"}}case"url_no_date":{const t=/\/\d{4}\/\d{2}\/|\/\d{4}-\d{2}-\d{2}\//.test(u);return{passed:!t,details:t?"URL contains date":"URL is dateless â"}}case"has_breadcrumbs":{const t=/<[^>]*(breadcrumb|crumb)[^>]*>/i.test(a)||/aria-label=["']breadcrumb/i.test(a);return{passed:t,details:t?"Breadcrumbs found":"No breadcrumbs"}}case"has_toc":{const t=/<[^>]*(toc|table-of-content|tableofcontent)[^>]*>/i.test(a)||(a.match(/<a[^>]*href=["']#[^"']+["']/gi)||[]).length>3;return{passed:t,details:t?"TOC detected":"No table of contents"}}case"has_sources":{const t=/source|reference|citation|bibliography|works cited|\[1\]|\[2\]/i.test(a);
14return{passed:t,details:t?"Sources/citations found":"No sources detected"}}case"has_social_share":{const t=/<[^>]*(share|social-share|sharing)[^>]*>/i.test(a)||/share.?on|share.?this/i.test(a);return{passed:t,details:t?"Social sharing buttons found":"No share buttons"}}case"good_heading_structure":{const t=(a.match(/<h1/gi)||[]).length,h=(a.match(/<h([1-6])/gi)||[]).map(m=>{var g;return parseInt(((g=m.match(/<h([1-6])/i))==null?void 0:g[1])||0)});let f=!0;for(let m=1;m<h.length;m++)h[m]>h[m-1]+1&&(f=!1);return{passed:t===1&&f,details:`${t} H1(s), hierarchy ${f?"OK":"has gaps"}`}}case"no_empty_links":{const t=a.match(/<a[^>]*href=["']#["'][^>]*>([\s\S]*?)<\/a>/gi)||[],c=t.length;return{passed:c===0,details:c?`${c} empty # links found`:"No empty links â",expandable:c>0,expandedData:c>0?{type:"tags",items:t.slice(0,50)}:null}}case"link_twitter":return J({html:a,hrefPattern:/(?:twitter\.com|x\.com)\/[a-zA-Z0-9_]+/i,foundDetails:"Twitter/X link found",evidenceTitle:"Twitter/X link evidence",matchAnywhere:!0});case"link_facebook":return J({html:a,hrefPattern:/facebook\.com\/[a-zA-Z0-9_.]+/i,foundDetails:"Facebook link found",evidenceTitle:"Facebook link evidence",matchAnywhere:!0});case"link_linkedin":return J({html:a,hrefPattern:/linkedin\.com\/(?:company|in)\/[a-zA-Z0-9_-]+/i,foundDetails:"LinkedIn link found",evidenceTitle:"LinkedIn link evidence",matchAnywhere:!0});case"link_youtube":return J({html:a,hrefPattern:/(?:youtube\.com|youtu\.be)\/[a-zA-Z0-9_@/-]+/i,foundDetails:"YouTube link found",evidenceTitle:"YouTube link evidence",matchAnywhere:!0});case"link_instagram":return J({html:a,hrefPattern:/instagram\.com\/[a-zA-Z0-9_.]+/i,foundDetails:"Instagram link found",evidenceTitle:"Instagram link evidence",matchAnywhere:!0});case"link_pinterest":return J({html:a,hrefPattern:/pinterest\.com\/[a-zA-Z0-9_]+/i,foundDetails:"Pinterest link found",evidenceTitle:"Pinterest link evidence",matchAnywhere:!0});case"link_tiktok":return J({html:a,hrefPattern:/tiktok\.com\/@?[a-zA-Z0-9_.]+/i,foundDetails:"TikTok link found",evidenceTitle:"TikTok link evidence",matchAnywhere:!0});case"has_rss":{const t=a.match(/<link[^>]*type=["']application\/(rss|atom)\+xml["'][^>]*>/gi)||[],c=Ee(a,/\/feed\/?(?:$|[?#])/i),h=t.length>0||c.length>0;return{passed:h,details:h?"RSS feed found":"No RSS feed detected",expandable:!0,expandedData:C("RSS feed evidence",h?[...t.map(f=>Y(f)),...c]:["No RSS/Atom <link> tag or /feed/ link was found in the page HTML."])}}case"affiliate_nofollow":{const t=a.match(/<a[^>]*(amazon|affiliate|partner|aff=|ref=)[^>]*>/gi)||[],c=t.filter(f=>/rel=["'][^"']*nofollow/i.test(f)).length,h=t.length;return{passed:h===0||c===h,details:h?`${c}/${h} nofollowed`:"No affiliate links found"}}case"has_sponsored_tag":{const t=/rel=["'][^"']*sponsored/i.test(a);return{passed:t,details:t?"Sponsored rel tag found":"No sponsored tags"}}case"has_disclosure":{const t=/disclosure|affiliate|sponsored|compensation|commission/i.test(a);return{passed:t,details:t?"Disclosure content found":"No disclosure detected"}}case"has_search":{const t=/<input[^>]*type=["']search["']/i.test(a)||/<form[^>]*(search|s=|q=)[^>]*>/i.test(a)||/<[^>]*(search-form|searchform)[^>]*>/i.test(a);return{passed:t,details:t?"Search functionality found":"No search detected"}}case"has_back_to_top":{const t=/(back.?to.?top|scroll.?top|go.?top|return.?top)/i.test(a);return{passed:t,details:t?"Back to top button found":"No scroll-to-top"}}case"external_links_new_tab":{const t=b.hostname,c=(a.match(/<a[^>]*href=["']https?:\/\/[^"']+["'][^>]*>/gi)||[]).filter(m=>!m.includes(t)),h=c.filter(m=>/target=["']_blank["']/i.test(m)).length,f=c.map(m=>{const g=m.match(/href=["'](https?:\/\/[^"']+)["']/i),v=/target=["']_blank["']/i.test(m);return{href:g?g[1]:"unknown",hasNewTab:v,tag:m}});return{passed:c.length===0||h>=c.length*.7,details:`${h}/${c.length} open in new tab`,expandable:c.length>0,expandedData:c.length>0?{type:"external_links",items:f}:null}}case"images_have_alt":{const c=(a.match(/<img[^>]*>/gi)||[]).filter(g=>!/src=["']data:/i.test(g)),h=c.filter(g=>/alt=["'][^"']+["']/i.test(g)).length,f=c.filter(g=>!/alt=["'][^"']+["']/i.test(g)),m=f.map(g=>{const v=g.match(/src=["']([^"']+)["']/i);return{src:v?v[1]:"unknown",tag:g}});return{passed:c.length===0||h>=c.length*.8,details:`${h}/${c.length} have alt text`,expandable:f.length>
140,expandedData:f.length>0?{type:"missing_alt",items:m}:null}}case"no_broken_images":{const t=y.brokenImageCheckResult;return t||{passed:null,details:"Image availability could not be verified"}}case"index_php_redirect":{const t=y.indexPhpRedirectResult;return t?{passed:t.passed,details:t.details,expandable:!0,expandedData:t.redirectData||C("index.php redirect evidence",[t.details||"The index.php request could not be verified."])}:{passed:null,details:"index.php behavior could not be verified",expandable:!0,expandedData:C("index.php redirect evidence",["No index.php redirect response was available."])}}case"homepage_not_noindex":{const t=(a.match(/<meta\b[^>]*>/gi)||[]).filter(h=>/\bname=["']robots["']/i.test(h)&&/\bcontent=["'][^"']*noindex/i.test(h)),c=t.length>0;return{expandable:!0,expandedData:C("Homepage indexability evidence",c?t.map(h=>Y(h)):['No <meta name="robots"> tag containing noindex was found.']),passed:!c,details:c?"â ï¸ Homepage has noindex tag!":"Homepage is indexable"}}case"homepage_title_not_home":{const t=a.match(/<title[^>]*>([^<]*)<\/title>/i),c=t?t[1].trim().toLowerCase():"",h=c==="home"||c==="homepage"||c==="home page"||c==="welcome"||c==="index"||c==="";return{expandable:!0,expandedData:C("Homepage title evidence",[t?Y(t[0]):"No <title> element was found."]),passed:!h,details:h?`â ï¸ Title is generic: "${(t==null?void 0:t[1])||"empty"}"`:`Title is descriptive: "${((z=t==null?void 0:t[1])==null?void 0:z.substring(0,40))||"N/A"}..."`}}case"homepage_content_visible":{const t=a.match(/<body[^>]*>([\s\S]*)<\/body>/i),h=(t?t[1]:"").replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim(),f=h.split(" ").filter(g=>g.length>2).length,m=/<body[^>]*style=["'][^"']*display:\s*none/i.test(a);return{expandable:!0,expandedData:C("Homepage content evidence",[`Visible word count: ${f}`,m?"The <body> element contains inline display:none styling.":"The <body> element is not hidden with inline display:none.",h?`Visible-text sample: ${Y(h,500)}`:"No visible body text was extracted."]),passed:f>50&&!m,details:m?"â ï¸ Body has display:none!":`${f} words visible on page`}}case"homepage_no_redirect_chains":{const t=y.preferredVersionResults;if(t&&t.length>0){const c=t.find(h=>h.finalStatus===200);if(c){const h=c.redirectCount||((E=c.redirects)==null?void 0:E.length)||0;return{expandable:!0,expandedData:{type:"redirect_chain",items:t},passed:h<=1,details:h>1?`â ï¸ ${h} redirects to reach homepage`:"Homepage loads directly"}}}return{passed:null,details:"Unable to verify the redirect chain",expandable:!0,expandedData:t!=null&&t.length?{type:"redirect_chain",items:t}:C("Homepage redirect-chain evidence",["No verified homepage URL-variant responses were available."])}}case"no_hello_world":{const t=y.defaultContentCheckResult;return t?{passed:t.passed,details:t.details,expandable:!0,expandedData:t.expandedData||C("Default WordPress content evidence",[t.details])}:{passed:null,details:"Default WordPress content could not be verified"}}case"no_uncategorized":{const t=y.uncategorizedCheckResult;return t?{passed:t.passed,details:t.details,expandable:!0,expandedData:t.expandedData||C("Uncategorized category evidence",[t.details])}:{passed:null,details:"Uncategorized category could not be verified"}}case"no_read_more_buttons":{const t=[],c=new Set,h=/<(a|button)\b[^>]*>[\s\S]*?<\/\1>/gi,f=/\b(read\s*more|continue\s*reading|learn\s*more|see\s*more)\b/i,m=/class\s*=\s*["'][^"']*read[\s_-]?more[^"']*["']/i,g=/href\s*=\s*["']([^"']+)["']/i;let v;for(;(v=h.exec(a))!==null;){const L=v[0],S=L.replace(/<[^>]+>/g," ").replace(/ /g," ").replace(/\s+/g," ").trim();if(f.test(S)||m.test(L)){const Z=L.length>400?L.slice(0,400)+"â¦":L,oe=Z+"|"+S;if(!c.has(oe)){c.add(oe);const pe=L.match(g);t.push({tag:Z,text:S||"(empty)",href:pe?pe[1]:null})}}if(t.length>=200)break}const j=t.length;return{passed:j===0,details:j===0?'No "Read More" buttons found â':`â ï¸ Found ${j} "Read More" style link${j===1?"":"s"}`,expandable:!0,expandedData:j>0?{type:"read_more",items:t}:C("Read More button evidence",["No anchors or buttons labelled Read More, Continue Reading, Learn More, or See More were found."])}}case"no_headings_before_h1":{const t=a.search(/<h1[\s>]/i),c=/<h[2-6][\s>]/gi;let h=!1,f="",m;for(;(m=c.exec(a))!==null;)if(t===-1||m.index<t){h=!0,f=m[0];break}return{expandable:!0,expandedData:C("Heading order evidence",h?[`First offending heading: ${Y(f)}`,t===-1?"No H1 element was found on the page.":`First H1 starts at HTML character ${t}.`]:[t===-1?"No H1 or earlier H2-H6 heading was found.":`The first H1 starts at HTML character ${t}; no H2-H6 starts before it.`]),passed:!h,details:h?"â ï¸ H2-H6 foun
14d before H1":"H1 appears first â"}}case"no_empty_hash_links":{const t=a.match(/<a[^>]*href=["']#["'][^>]*>[\s\S]*?<\/a>/gi)||[],c=a.match(/<a[^>]*href=["']javascript:\s*void\s*\(0\)["'][^>]*>[\s\S]*?<\/a>/gi)||[],h=[...t,...c],f=h.length;return{passed:f===0,details:f===0?"No empty # links â":`â ï¸ ${f} empty/placeholder links found`,expandable:!0,expandedData:f>0?{type:"tags",items:h.slice(0,50)}:C("Placeholder-link evidence",['No href="#" or javascript:void(0) placeholder links were found.'])}}case"links_look_like_links":{const t=a.match(/<a[^>]*style="[^"]*text-decoration:\s*none[^"]*"/gi)||[],c=t.length,h=(a.match(/<a[^>]*href/gi)||[]).length,f=h>0?(h-c)/h:1;return{expandable:!0,expandedData:C("Link styling evidence",[`Links checked: ${h}`,`Inline text-decoration:none links: ${c}`,...t.map(m=>Y(m))]),passed:f>=.5,details:f>=.5?"Links appear properly styled â":"â ï¸ Many links have text-decoration:none"}}case"no_background_images_content":{const t=a.match(/style="[^"]*background-image:\s*url\([^)]+\)[^"]*"/gi)||[],c=t.filter(f=>!f.includes("header")&&!f.includes("hero")&&!f.includes("banner")),h=c.length;
14return{expandable:!0,expandedData:C("Background-image evidence",[`Inline background-image declarations checked: ${t.length}`,`Possible content background images: ${h}`,...c.map(f=>Y(f))]),passed:h<5,details:h<5?"Content images use img tags â":`â ï¸ ${h} content areas use background images`}}case"no_sentence_headings":{const t=a.match(/<h[1-6][^>]*>([^<]+)<\/h[1-6]>/gi)||[],c=t.filter(h=>{const f=h.replace(/<[^>]+>/g,"").trim();return f.length>100||f.split(" ").length>15});return{expandable:!0,expandedData:C("Heading-length evidence",[`Headings checked: ${t.length}`,`Headings over the threshold: ${c.length}`,...c.map(h=>Y(h))]),passed:c.length===0,details:c.length===0?"Headings are concise â":`â ï¸ ${c.length} headings are too long`}}case"no_duplicate_plugins":{const t=["wp-super-cache","w3-total-cache","wp-rocket","litespeed","wp-fastest-cache","autoptimize","breeze","hummingbird"],c=["yoast","rank-math","all-in-one-seo","seopress","squirrly"],h=a.toLowerCase(),f=t.filter(j=>h.includes(j)),m=c.filter(j=>h.includes(j)),g=f.length>1,v=m.length>1;return{expandable:!0,expandedData:C("Plugin-signature evidence",[`Cache plugin signatures: ${f.length?f.join(", "):"none"}`,`SEO plugin signatures: ${m.length?m.join(", "):"none"}`]),passed:!g&&!v,details:g||v?`â ï¸ Multiple plugins: ${[...f,...m].join(", ")}`:"No duplicate functionality plugins â"}}case"gtm_not_in_body":{const t=a.match(/<body[^>]*>([\s\S]*)<\/body>/i),c=t?t[1]:"",h=/googletagmanager\.com\/gtm\.js/i.test(c),f=c.search(/googletagmanager\.com\/gtm\.js/i),m=f>=0?Y(c.slice(Math.max(0,f-220),f+320)):"";return{expandable:!0,expandedData:C("Google Tag Manager placement evidence",[h?m||"googletagmanager.com/gtm.js was found inside the <body> element.":"No googletagmanager.com/gtm.js script was found inside the <body> element."]),passed:!h,details:h?"â ï¸ GTM JavaScript is in <body> instead of <head>":"GTM placement is correct â"}}case"external_links_not_all_nofollow":{const t=b.hostname,c=(a.match(/<a[^>]*href=["']https?:\/\/[^"']+["'][^>]*>/gi)||[]).filter(m=>!m.includes(t)),h=c.filter(m=>/rel=["'][^"']*nofollow/i.test(m));if(c.length===0)return{passed:!0,details:"No external links found",expandable:!0,expandedData:C("External-link evidence",[`No absolute external HTTP(S) links outside ${t} were found.`])};const f=h.length===c.length;return{expandable:!0,expandedData:C("External-link rel evidence",[`External links checked: ${c.length}`,`External links with nofollow: ${h.length}`,...c.map(m=>Y(m))]),passed:!f,details:f?`â ï¸ All ${c.length} external links are nofollow`:`${c.length-h.length}/${c.length} external links are followed â`}}case"no_staging_menu_links":{const t=((I=a.match(/<nav[^>]*>[\s\S]*?<\/nav>/gi))==null?void 0:I.join(""))||"",c=((se=a.match(/<header[^>]*>[\s\S]*?<\/header>/gi))==null?void 0:se.join(""))||"",h=t+c,f=[/href=["'][^"']*staging\./i,/href=["'][^"']*\.staging/i,/href=["'][^"']*dev\./i,/href=["'][^"']*\.dev/i,/href=["'][^"']*test\./i,/href=["'][^"']*localhost/i,/href=["'][^"']*:3000/i,/href=["'][^"']*:8080/i],g=(h.match(/<a\b[^>]*href=["'][^"']+["'][^>]*>/gi)||[]).filter(j=>f.some(L=>(L.lastIndex=0,L.test(j)))),v=g.length>0;return{expandable:!0,expandedData:C("Staging/dev menu-link evidence",v?g.map(j=>Y(j)):["No staging, development, localhost, or common development-port URL was found in header/navigation links."]),passed:!v,details:v?"â ï¸ Staging/dev URLs found in menu":"No staging URLs in menu â"}}case"menu_footer_not_nofollow":{const t=((q=a.match(/<nav[^>]*>[\s\S]*?<\/nav>/gi))==null?void 0:q.join(""))||"",c=((K=a.match(/<footer[^>]*>[\s\S]*?<\/footer>/gi))==null?void 0:K.join(""))||"",f=((t+c).match(/<a[^>]*>/gi)||[]).filter(g=>!g.includes("http")||g.includes(b.hostname)),m=f.filter(g=>/rel=["'][^"']*nofollow/i.test(g));return{expandable:!0,expandedData:C("Menu/footer nofollow evidence",[`Internal menu/footer links checked: ${f.length}`,`Internal menu/footer links with nofollow: ${m.length}`,...m.map(g=>Y(g))]),passed:m.length===0,details:m.length===0?"Menu/footer internal links are followed â":`â ï¸ ${m.length} menu/footer links have nofollow`}}case"robots_sitemap_not_broken":{const t=y.sitemapCheckResult;return t?{expandable:!0,expandedData:C("Robots/sitemap accessibility evidence",[t.url?`Sitemap URL: ${t.url}
14`:"",t.source?`Discovery source: ${t.source}`:"",t.details||""]),passed:t.found,details:t.found===null?t.details:t.found?`Sitemap accessible: ${t.source} â`:"â ï¸ No accessible sitemap found"}:{passed:null,details:"Sitemap accessibility could not be verified",expandable:!0,expandedData:C("Robots/sitemap accessibility evidence",["No sitemap discovery result was available."])}}case"about_parent_company":case"about_our_story":case"about_who_we_are":case"about_what_we_do":case"about_trusted_source":{const t=(xe=y.aboutPageAnalysis)==null?void 0:xe[r];if(t)return t;const c=y.aboutPageStatus==="unavailable";return{passed:c?null:!1,details:c?"The dedicated About page could not be verified":"No valid dedicated About page was found",expandable:!0,expandedData:C("About-page evidence",[c?"The About-page request failed or returned an unusable response.":"No same-site About page with substantive content was found."])}}case"about_team_photos":case"about_mailing_address":case"about_social_proof":case"about_featured_websites":{const t=(qe=y.aboutPageAnalysis)==null?void 0:qe[r];if(t)return t;const c=y.aboutPageStatus==="unavailable";return{passed:c?null:!1,details:c?"The dedicated About page could not be verified":"No valid dedicated About page was found",expandable:!0,expandedData:C("About-page evidence",[c?"The About-page request failed or returned an unusable response.":"No same-site About page with substantive content was found."])}}default:return{passed:!1,details:"Check not implemented"}}};async function ca(r,a){var h,f;R(!0),l({});const u=new URL(a),y=u.pathname==="/"||u.pathname===""||u.pathname==="/index.html"||u.pathname==="/index.php";G(y);const b={robotsContent:null,sitemapCheckResult:null,preferredVersionResults:[],trailingSlashResults:null,aboutPageHtml:null,aboutPageUrl:null,aboutPageStatus:"not_found",aboutPageAnalysis:null,indexPhpRedirectResult:null,defaultContentCheckResult:null,uncategorizedCheckResult:null,brokenImageCheckResult:null},z=`${u.origin}/robots.txt`;try{const m=await ct(z),g=/<(?:html|body|head)\b/i.test(m.html);b.robotsContent=m.statusCode===200&&!g?m.html:""}catch{b.robotsContent=null}try{const m=b.robotsContent,g=us(m,u.origin),v=[...g.map(O=>({url:O,source:"robots.txt"})),"/sitemap.xml","/sitemap_index.xml","/sitemap-index.xml","/wp-sitemap.xml","/sitemap/sitemap.xml","/index_sitemap.xml"].map(O=>typeof O=="string"?{url:`${u.origin}${O}`,source:`URL: ${O}`}:O),j=[...new Map(v.map(O=>[O.url,O])).values()],L=await Promise.all(j.map(async O=>({...O,result:await ke(O.url)}))),S=L.find(({result:O})=>{const be=O.contentType.toLowerCase();return O.finalStatus===200&&(be.includes("xml")||/sitemap|\.xml(?:$|\?)/i.test(O.finalUrl))}),Z=L.some(({result:O})=>O.error||O.finalStatus===0),oe=g[0]||null,pe=S||oe?!0:Z?null:!1;
14b.sitemapCheckResult={found:pe,url:(S==null?void 0:S.result.finalUrl)||oe,source:(S==null?void 0:S.source)||(oe?"robots.txt":""),details:S?`Sitemap found via ${S.source}`:oe?"Sitemap declared in robots.txt; accessibility could not be verified":Z?"Sitemap discovery could not be fully verified":"No sitemap found (checked robots.txt and common URLs)"}}catch{b.sitemapCheckResult={found:null,details:"Sitemap accessibility could not be verified"}}try{const m=u.hostname.replace(/^www\./,""),g=[`https://www.${m}/`,`https://${m}/`,`http://${m}/`,`http://www.${m}/`],v=await Promise.all(g.map(ke));b.preferredVersionResults=v,de(v)}catch{b.preferredVersionResults=[],de([])}try{const m=["about-us","about","contact","contact-us"];let g=null;for(const j of m){const L=`${u.origin}/${j}/`,S=`${u.origin}/${j}`;try{const[Z,oe]=await Promise.all([ke(L),ke(S)]),pe=fs(Z,oe);if(g={...pe,pageUrl:`${u.origin}/${j}`,results:[oe,Z]},pe.applicable)break}catch{continue}}const v=g||{passed:null,applicable:!1,details:"No suitable test page was available.",results:[]};b.trailingSlashResults=v,Re(v)}catch{b.trailingSlashResults={passed:null,details:"Trailing-slash behavior could not be verified.",results:[]},Re(b.trailingSlashResults)}try{if(xt(a)&&Wt(r,a))b.aboutPageHtml=r,b.aboutPageUrl=a,b.aboutPageStatus="found";else{const m=_s(r,a);let g=0;for(const v of m)try{const j=await ct(v),L=j.finalUrl||v,S=new URL(L);if(!(j.statusCode===200&&S.origin===u.origin&&zt(j.html)&&Wt(j.html,L)))continue;b.aboutPageHtml=j.html,b.aboutPageUrl=L,b.aboutPageStatus="found";break}catch{g+=1}b.aboutPageStatus!=="found"&&m.length>0&&g===m.length&&(b.aboutPageStatus="unavailable")}b.aboutPageStatus==="found"&&(b.aboutPageAnalysis=Ss(b.aboutPageHtml,b.aboutPageUrl))}catch{b.aboutPageHtml=null,b.aboutPageUrl=null,b.aboutPageStatus="unavailable",b.aboutPageAnalysis=null}if(y)try{const m=`${u.origin}/index.php`,g=await ke(m),v=(()=>{try{return new URL(g.finalUrl).pathname.replace(/\/+$/,"")||"/"}catch{return""}})(),j=g.redirectCount>0&&g.finalStatus===200&&v==="/",L=g.finalStatus===404,S=g.finalStatus===0?null:j||L;b.indexPhpRedirectResult={passed:S,details:S===null?"index.php behavior could not be verified":j?"index.php redirects to the homepage correctly":L?"index.php returns 404 (acceptable)":`index.php returns ${g.finalStatus} without a homepage redirect`,redirectData:{type:"redirect_chain",items:[g]}}}catch{b.indexPhpRedirectResult={passed:null,details:"index.php behavior could not be verified"}}try{const m=r.match(/<img\b[^>]*>/gi)||[],g=new Map;for(const O of m){const be=(f=(h=O.match(/\bsrc\s*=\s*["']([^"']+)["']/i))==null?void 0:h[1])==null?void 0:f.trim();if(!(!be||/^(?:data|blob|javascript):/i.test(be)))try{const Le=new URL(be,a);if(!["http:","https:"].includes(Le.protocol))continue;g.has(Le.href)||g.set(Le.href,{src:Le.href,tag:O})}catch{g.set(`invalid:${be}`,{src:be,tag:O,malformed:!0})}}const v=[...g.values()],j=v.slice(0,20),L=await Promise.all(j.map(async O=>({...O,result:O.malformed?{finalStatus:400}:await ke(O.src)}))),S=L.filter(({result:O})=>O.finalStatus>=400),Z=L.filter(({result:O})=>O.finalStatus===0),oe=v.length>j.length,pe=S.length>0?!1:Z.length>0||oe?null:!0;b.brokenImageCheckResult={passed:pe,details:S.length>0?`${S.length} broken image${S.length===1?"":"s"} found`:pe===null?`Checked ${j.length} of ${v.length} images; some could not be verified`:`${j.length} image${j.length===1?"":"s"} loaded successfully`,expandable:S.length>0,expandedData:S.length>0?{type:"broken_images",items:S.map(({src:O,tag:be,result:Le})=>({src:O,tag:be,status:Le.finalStatus}))}:null}}catch{b.brokenImageCheckResult={passed:null,details:"Image availability could not be verified"}}try{const m=[{path:"/hello-world/",name:"Hello World post"},{path:"/sample-page/",name:"Sample Page"}],g=await Promise.all(m.map(async S=>({...S,result:await ke(`${u.origin}${S.path}`)}))),v=g.filter(({path:S,result:Z})=>{try{return Z.finalStatus===200&&new URL(Z.finalUrl).pathname.replace(/\/+$/,"")===S.replace(/\/+$/,"")}catch{return!1}}),j=g.some(({result:S})=>S.finalStatus===0),L=v.length>0?!1:j?null:!0;b.defaultContentCheckResult={passed:L,details:L===null?"Default WordPress content could not be fully verified":L?"Default WordPress content is not publicly accessible":`Found: ${v.map(S=>S.name).join(", ")}`,expandedData:{type:"redirect_chain",items:g.map(({result:S})=>S)}}}catch{b.defaultContentCheckResult={passed:null,details:"Default WordPress content could not be verified"}}try{const m=["/uncategorized/","/category/uncategorized/"],g=await Promise.all(m.map(async S=>({path:S,result:await ke(`${u.origin}${S}`)}))),v=g.filter(({path:S,result:Z})=>{try{return Z.finalStatus===200&&new URL(Z.finalUrl).pathname.replace(/\/+$/,"")===S.replace(/\/+$/,"")}catch{return!1}}),j=g.some(({result:S})=>S.finalStatus===0),L=v.length>0?!1:j?null:!0;b.uncategorizedCheckResult={passed:L,details:L===null?"The Uncategorized category could not be fully verified":L?"The default Uncategorized category is not publicly accessible":`Found: ${v.map(({path:S})=>S).join(", ")}`,expandedData:{type:"redirect_chain",items:g.map(({result:S})=>S)}}}catch{b.uncategorizedCheckResult={passed:null,details:"The Uncategorized category could not be verified"}}const E=["article_elements","author_elements"],I=y||!V,se=Object.keys(me),q={};for(const m of se){if(y&&E.includes(m)||m==="affiliate_seo"&&I)continue;const g=me[m];
14if(!(g.homepageOnly&&!y)){w(g.name);for(const v of g.checks){if(!v.automated||y&&["schema_person","schema_article","schema_webpage","schema_breadcrumb","schema_newsarticle","schema_localbusiness"].includes(v.id))continue;x(v.name);const L=Ja(m,v.name,la(v.id,r,a,b));q[v.id]={...v,...L,category:m}}l({...q}),await new Promise(v=>requestAnimationFrame(v))}}l(q),x(null),w(null),R(!1),W(!0);const K={};Object.keys(me).forEach(m=>{y&&E.includes(m)?K[m]=!1:K[m]=!0}),Object.keys(Ke).forEach(m=>{me[m]||(K[m]=!1)}),X(K);const xe=new URL(a).hostname,qe=(H==null?void 0:H.id)||Ht(B==null?void 0:B.projects,a),t=Object.values(q).filter(m=>m.passed===!1),c=t.filter(m=>qt.has(m.id));c.length>0&&ia({type:"error",title:`EEAT Audit: ${c.length} critical issue${c.length>1?"s":""} found`,message:c.map(m=>m.name).join(", "),source:"EEAT Audit",projectId:qe,projectDomain:xe,data:{totalChecks:Object.keys(q).length,passed:Object.values(q).filter(m=>m.passed===!0).length,failed:t.length,unknown:Object.values(q).filter(m=>m.passed===null).length,criticalIssues:c.map(m=>m.name)}})}const Fe=async({forceFresh:r=!1}={})=>{if(!B){D("Sign in to run a secure E-E-A-T website audit.");return}let a="";try{a=Qe(s)}catch(u){D(u.message);return}if(ra(a),i(a),!(!r&&Oe(a))){k(!0),D(""),l({}),W(!1);try{const u=await ct(a);if(u.statusCode<200||u.statusCode>=400)throw new Error(`The website returned HTTP ${u.statusCode||"error"}.`);if(!zt(u.html))throw new Error("The website returned a blocked, empty, or non-HTML page.");i(u.finalUrl||a),k(!1),await ca(u.html,u.finalUrl||a)}catch(u){D(u.message||"The website could not be fetched securely."),R(!1),x(null),w(null)}finally{k(!1)}}},da=()=>{Fa(tt,Ue),He({preserveManual:!0}),Fe({forceFresh:!0})};F.useEffect(()=>{const r=!!je.get("url")&&!je.get("website"),a=$||Object.keys(o).length>0;!r||vt.current||a||!s||A||T||ne||(vt.current=!0,queueMicrotask(()=>Fe()))},[$,o,T,A,ne,je,s]);const ae=F.useMemo(()=>Ft(o,d,ut),[o,d]),ua=()=>{Ds({url:s,checkResults:o,checkDefinitions:me,branding:{name:B!=null&&B.agencyEnabled&&(B!=null&&B.agencyName)?B.agencyName:"SemanticsX",logo:B!=null&&B.agencyEnabled?B==null?void 0:B.agencyLogo:null}})},Nt=(r,a)=>{X(u=>({...u,[r]:!a}))},pa=r=>{p(a=>({...a,[r]:!a[r]}))},ze=Object.entries(me).filter(([r])=>!(U&&(r==="article_elements"||r==="author_elements")||r==="affiliate_seo"&&!V)),_t=r=>{const a=r.checks.map(b=>o[b.id]).filter(Boolean),u=a.filter(b=>b.passed===!0).length,y=a.filter(b=>typeof b.passed=="boolean").length;return{passed:u,checked:y,failed:y-u,unknown:a.length-y,score:y>0?Math.round(u/y*100):0}},Ie=r=>typeof(r==null?void 0:r.passed)!="boolean"?"unknown":r.passed?"passed":"failed",ue=ze.reduce((r,[,a])=>(a.checks.forEach(u=>{const y=o[u.id];y&&(r.all+=1,r[Ie(y)]+=1)}),r),{all:0,passed:0,failed:0,unknown:0}),ha=r=>M==="all"||Ie(r)===M,ma=r=>r>=80?{label:"Excellent",note:"sx-status-good"}:r>=60?{label:"Good",note:"sx-status-fair"}:{label:"Needs work",note:"sx-status-poor"},We=r=>r>=80?"#10b981":r>=60?"#f59e0b":"#f43f5e",at=r=>r==="purple"?"violet":r||"slate",St=["indigo","blue","emerald","amber","violet","cyan"],jt=r=>{te("automated"),ie("all"),X(a=>({...a,[r]:!0})),window.requestAnimationFrame(()=>{var a;(a=document.getElementById(`eeat-cat-${r}`))==null||a.scrollIntoView({behavior:"smooth",block:"start"})})},Ct=r=>{const a=ee==="automated"?ze.map(([u])=>u):Object.keys(Ke);X(u=>({...u,...Object.fromEntries(a.map(y=>[y,r]))}))},Be=Object.keys(me),Ce=Be.findIndex(r=>me[r].name===N),fa=A||Ce<0?4:Math.round((Ce+.5)/Be.length*100),Ae=A||T,Tt=ma(ae.score),ga={passed:"sx-note-good",failed:"sx-note-poor",unknown:"sx-note-fair"},xa=(r,a)=>{jt(r),window.setTimeout(()=>{var u;(u=document.getElementById(`eeat-check-${a}`))==null||u.scrollIntoView({behavior:"smooth",block:"center"})},60)},At=(r,a=84)=>{const u=(135+270*r/100)*Math.PI/180;return[104+a*Math.cos(u),104+a*Math.sin(u)]},[ba,ya]=At(0),[wa,va]=At(100),Ve=`M ${ba} ${ya} A 84 84 0 1 1 ${wa} ${va}`,Lt=[{key:"passed",label:"Passed",value:ue.passed,color:"#10b981",icon:Pe},{key:"failed",label:"Failed",value:ue.failed,color:"#f43f5e",icon:lt},{key:"unknown",label:"Unverified",value:ue.unknown,color:"#f59e0b",icon:nt}],Pt=ze.map(([r,a])=>({catKey:r,category:a,catStats:_t(a)})).sort((r,a)=>!r.catStats.checked!=!a.catStats.checked?r.catStats.checked?-1:1:r.catStats.score-a.catStats.score),st=(()=>{const r=Pt.map(({catKey:b,category:z})=>z.checks.filter(E=>{var I;return((I=o[E.id])==null?void 0:I.passed)===!1}).map(E=>({catKey:b,category:z,check:E,isCritical:qt.has(E.id)}))),a=r.flat().filter(b=>b.isCritical),u=r.map(b=>b.filter(z=>!z.isCritical)),y=[];for(let b=0;u.some(z=>z.length>b);b+=1)u.forEach(z=>{z[b]&&y.push(z[b])});return[...a,...y].slice(0,6)})(),ka=r=>{let a=r;try{!/^(https?:|mailto:|tel:)/i.test(r)&&!r.startsWith("#")&&!r.startsWith("javascript:")&&(a=new URL(r,s).href)}catch{}return/^https?:/i.test(a)?e.jsxs("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"sx-code
14-link text-[12px] inline-flex items-center gap-1",onClick:u=>u.stopPropagation(),children:[e.jsx(Ya,{className:"w-3 h-3 flex-shrink-0"})," ",r]}):e.jsx("span",{className:"text-[12px] sx-muted break-all",children:r})},Na=r=>e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[r.redirects&&r.redirects.length>0&&r.redirects.map((a,u)=>e.jsx("span",{className:"sx-tone sx-tone-blue px-2 py-0.5 rounded-md text-[11px] font-semibold",children:a.status||301},u)),e.jsx("span",{className:`sx-tone ${r.finalStatus===200||r.status===200?"sx-tone-emerald":"sx-tone-rose"} px-2 py-0.5 rounded-md text-[11px] font-semibold`,children:r.finalStatus||r.status||"Error"})]}),$t=r=>e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"sx-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Request URL"}),e.jsx("th",{children:"Status codes"}),e.jsx("th",{children:"Redirects"})]})}),e.jsx("tbody",{children:r.map((a,u)=>{var y;return e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"sx-code-link",children:a.url})}),e.jsx("td",{children:Na(a)}),e.jsx("td",{className:"tabular-nums",children:a.redirectCount!==void 0?a.redirectCount:((y=a.redirects)==null?void 0:y.length)||0})]},u)})})]})}),Et=(r,a,u)=>e.jsxs("div",{children:[e.jsxs("div",{className:"sx-evidence-head",children:[r," ",e.jsx("span",{className:"sx-count",children:a.length})]}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:a.map((y,b)=>e.jsxs("div",{className:"sx-evidence-row px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx(Xa,{className:`w-4 h-4 flex-shrink-0 ${u}`}),e.jsx("span",{className:"text-[12px] sx-text-2 break-all",children:y.src})]}),e.jsx("code",{className:"sx-code",children:y.tag})]},b))})]}),_a=(r,a)=>{const u=a.expandedData;return u.type==="evidence"?e.jsxs("div",{children:[e.jsx("div",{className:"sx-evidence-head",children:u.title||`${r.name} details`}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:(u.items||[]).map((y,b)=>e.jsxs("div",{className:"sx-evidence-row px-4 py-2.5 flex items-start gap-2.5",children:[e.jsx(it,{className:"w-3.5 h-3.5 mt-0.5 sx-accent flex-shrink-0"}),e.jsx("span",{className:"text-[12.5px] sx-text-2 break-all whitespace-pre-wrap",children:y})]},`${r.id}-evidence-${b}`))})]}):u.type==="schema"?e.jsxs("div",{children:[e.jsxs("div",{className:"sx-evidence-head",children:[e.jsx("span",{children:u.title||`${r.name} details`}),u.format?e.jsx("span",{className:"sx-count",children:u.format}):null]}),u.content?e.jsx("pre",{className:"max-h-96 overflow-auto bg-slate-950 p-4 text-xs leading-5 text-slate-100 whitespace-pre-wrap break-words",children:e.jsx("code",{children:u.content})}):e.jsx("div",{className:"px-4 py-4 text-[13px] sx-text-2",children:u.emptyMessage||"No schema markup was extracted."})]}):u.type==="tags"?e.jsx("div",{className:"max-h-64 overflow-y-auto",children:u.items.map((y,b)=>e.jsx("div",{className:"sx-evidence-row px-4 py-2.5",children:e.jsx("code",{className:"sx-code",children:y})},b))}):u.type==="read_more"?e.jsxs("div",{children:[e.jsxs("div",{className:"sx-evidence-head",children:['"Read More" / "Continue Reading" style links ',e.jsx("span",{className:"sx-count",children:u.items.length})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto",children:u.items.map((y,b)=>e.jsxs("div",{className:"sx-evidence-row px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[e.jsx("span",{className:"text-[12px] font-semibold sx-text",children:y.text}),y.href&&ka(y.href)]}),e.jsx("code",{className:"sx-code",children:y.tag})]},b))})]}):u.type==="external_links"?e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"sx-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"External URL"}),e.jsx("th",{children:"Opens in new tab"})]})}),e.jsx("tbody",{children:u.items.map((y,b)=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("a",{href:y.href,target:"_blank",rel:"noopener noreferrer",className:"sx-code
14-link",children:y.href})}),e.jsx("td",{children:e.jsx("span",{className:`sx-status ${y.hasNewTab?"sx-status-good":"sx-status-poor"}`,children:y.hasNewTab?"Yes":"No"})})]},b))})]})}):u.type==="missing_alt"?Et("Images missing alt text",u.items,"text-amber-500"):u.type==="broken_images"?Et("Potentially broken images",u.items,"text-rose-500"):u.type==="redirect_chain"?$t(u.items):u.type?null:$t(r.id==="preferred_version"?u:u.results||[])};return e.jsx("div",{className:"sx-dash min-h-screen overflow-y-auto p-4 sm:p-6 lg:p-8 pb-24",children:e.jsxs("div",{className:"max-w-[1440px] mx-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4 mb-6",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0",children:[e.jsx("span",{className:"sx-tone sx-tone-blue w-12 h-12 rounded-xl",children:e.jsx(Je,{className:"w-6 h-6"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[12.5px] font-medium sx-muted",children:"Technical SEO"}),e.jsx("h1",{className:"text-[24px] md:text-[28px] leading-tight font-semibold tracking-tight sx-text",children:"E-E-A-T Audit"}),e.jsx("p",{className:"text-[13.5px] sx-text-2 mt-0.5",children:"Check a page for Experience, Expertise, Authoritativeness and Trust signals."})]})]}),$&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 flex-shrink-0",children:[re&&e.jsxs("span",{className:"sx-chip mr-1",children:[e.jsx(Va,{className:"w-3.5 h-3.5"}),"Cached ",gs(re,oa)]}),e.jsxs("button",{type:"button",onClick:da,disabled:Ae,className:"sx-btn sx-btn-secondary",title:"Clear cache and run a fresh analysis",children:[e.jsx(Xt,{className:"w-4 h-4"}),"Re-analyze"]}),e.jsxs("button",{type:"button",onClick:()=>ua(),className:"sx-btn sx-btn-primary",children:[e.jsx(Ea,{className:"w-4 h-4"}),"Download Report"]})]})]}),e.jsxs("div",{className:"sx-card p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(Ra,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 w-[18px] h-[18px] sx-muted pointer-events-none"}),e.jsx("input",{type:"text",value:s,onChange:r=>{H||($&&He({preserveManual:!1}),D(""),i(r.target.value))},placeholder:H?`Locked to ${H.websiteName||H.domain}`:"Enter a website URL, e.g. example.com",readOnly:!!H,"aria-label":"Website URL",className:"sx-input pl-11 pr-4",onKeyDown:r=>r.key==="Enter"&&!Ae&&Fe()})]}),e.jsx("button",{type:"button",onClick:()=>Fe(),disabled:Ae||!s.trim(),className:"sx-btn sx-btn-primary sx-btn-lg w-full md:w-auto",children:Ae?e.jsxs(e.Fragment,{children:[e.jsx(ot,{className:"w-4 h-4 animate-spin"}),A?"Fetchingâ¦":"Analyzingâ¦"]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4"}),"Analyze Website"]})})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 mt-3.5",children:[$?e.jsxs(e.Fragment,{children:[V&&e.jsxs("span",{className:"sx-chip",children:[e.jsx(Zt,{className:"w-3.5 h-3.5"})," Affiliate mode"]}),U&&e.jsx("span",{className:"text-[12px] sx-muted",children:"Homepage scan: article and author checks are skipped."})]}):e.jsxs("label",{className:"inline-flex items-center gap-2.5 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:V,onChange:r=>ce(r.target.checked),className:"sr-only peer"}),e.jsx("span",{className:"sx-switch","aria-hidden":"true"}),e.jsx("span",{className:"text-[13px] font-medium sx-text",children:"Affiliate site mode"}),e.jsx("span",{className:"text-[12px] sx-muted hidden sm:inline",children:"Adds affiliate disclosure and review checks"})]}),H&&e.jsx("span",{className:"text-[12px] sx-muted",children:"URL is locked to the selected project."})]}),Ae&&e.jsxs("div",{className:"mt-5 pt-5 border-t sx-divider",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ot,{className:"w-4 h-4 animate-spin sx-accent flex-shrink-0"}),e.jsx("span",{className:"text-[13.5px] font-semibold sx-text truncate",children:A?"Fetching website securely":N||"Scanning for E-E-A-T signals"})]}),!A&&Ce>=0&&e.jsxs("span",{className:"text-[12px] sx-muted tabular-nums flex-shrink-0",children:["Step ",Ce+1," of ",Be.length]})]}),e.jsx("div",{className:"h-1.5 rounded-full sx-track overflow-hidden",children:A?e.jsx("div",{className:"sx-indeterminate h-full rounded-full bg-gradient-to-r from-indigo-500 to-violet-500"}):e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-indigo-500 to-violet-500 transition-all duration-500",style:{width:`${fa}%`}})}),n&&e.jsxs("p",{className:"text-[12.5px] sx-muted mt-2 truncate",children:["Checking: ",n]}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-1.5",children:Be.map((r,a)=>{const u=a===Ce,y=Ce>-1&&a<Ce;return e.jsxs("span",{className:`sx-step ${u?"is-active":y?"is-done":""}`,children:[y&&e.jsx(Pe,{className:"w-3 h-3"}),u&&e.jsx(ot,{className:"w-3 h-3 animate-spin"}),me[r].name]},r)})})]}),P&&e.jsxs("div",{className:"mt-4 p-3.5 rounded-xl sx-note-poor flex items-start gap-2.5",role:"alert",children:[e.jsx(nt,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("span",{className:"text-[13px] font-medium",children:P})]})]}),$&&e.jsxs("div",{className:"eeat-results-container",children:[e.jsxs("div",{className:"mt-6 grid gap-6 lg:grid-cols-2 xl:grid-cols-12",children:[e.jsxs("div",{className:"sx-card sx-hero-card relative overflow-hidden p-6 xl:col-span-4 flex flex-col",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"sx-card-title",children:"E-E-A-T score"}),e.jsx("p",{className:"sx-card-subtitle truncate max-w-[240px]",title:s,children:fe(s)||s})]}),e.jsx("span",{className:`sx-status ${Tt.note}`,children:Tt.label})]}),e.jsxs("div",{className:"relative mx-auto mt-4 w-[208px] h-[190px]",children:[e.jsxs("svg",{viewBox:"0 0 208 208",width:"208",height:"208",className:"absolute top-0 left-0","aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"eeat-gauge-gradient",x1:"0",y1:"1",x2:"1",y2:"0",children:[e.jsx("stop",{offset:"0%",stopColor:We(
14ae.score),stopOpacity:"0.7"}),e.jsx("stop",{offset:"100%",stopColor:We(ae.score)})]})}),e.jsx("path",{d:Ve,fill:"none",stroke:"var(--sx-track)",strokeWidth:"14",strokeLinecap:"round"}),e.jsx("path",{d:Ve,fill:"none",stroke:"url(#eeat-gauge-gradient)",strokeWidth:"14",strokeLinecap:"round",pathLength:"100",strokeDasharray:`${Math.max(ae.score,.001)} 100`,className:"transition-all duration-1000"})]}),e.jsxs("div",{className:"absolute inset-x-0 top-[62px] flex flex-col items-center",children:[e.jsx("span",{className:"text-[44px] leading-none font-semibold tracking-tight sx-text tabular-nums",children:ae.score}),e.jsx("span",{className:"text-[12px] font-medium sx-muted mt-1.5",children:"out of 100"})]}),e.jsx("span",{className:"absolute left-[40px] bottom-0 text-[11px] sx-muted tabular-nums",children:"0"}),e.jsx("span",{className:"absolute right-[32px] bottom-0 text-[11px] sx-muted tabular-nums",children:"100"})]}),e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{className:"flex items-center justify-between text-[12px] mb-2",children:[e.jsx("span",{className:"font-semibold sx-text-2",children:"Results"}),e.jsxs("span",{className:"sx-muted tabular-nums",children:[ue.all," checks"]})]}),e.jsx("div",{className:"flex h-2.5 gap-[2px] rounded-full overflow-visible",children:Lt.filter(r=>r.value>0).map(r=>e.jsx("button",{type:"button",onClick:()=>{te("automated"),ie(r.key)},className:"sx-tip-host relative h-full first:rounded-l-full last:rounded-r-full",style:{width:`${r.value/Math.max(ue.all,1)*100}%`,background:r.color},"aria-label":`${r.value} ${r.label.toLowerCase()} checks`,children:e.jsxs("span",{className:"sx-tip",children:[r.value," ",r.label.toLowerCase()," · ",Math.round(r.value/Math.max(ue.all,1)*100),"%"]})},r.key))}),e.jsx("div",{className:"mt-3 grid grid-cols-3 gap-2",children:Lt.map(r=>e.jsxs("button",{type:"button",onClick:()=>{te("automated"),ie(r.key)},className:`rounded-lg px-2.5 py-2 text-left sx-hover-row border ${M===r.key&&ee==="automated"?"border-[var(--sx-accent)]":"sx-divider"}`,children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11.5px] font-medium sx-text-2",children:[e.jsx(r.icon,{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:r.color}}),r.label]}),e.jsx("span",{className:"block text-[18px] font-semibold sx-text tabular-nums mt-0.5",children:r.value})]},r.key))})]}),e.jsxs("button",{type:"button",onClick:()=>te("manual"),className:"mt-4 pt-4 border-t sx-divider text-left group",children:[e.jsxs("span",{className:"flex items-center justify-between text-[12px] mb-1.5",children:[e.jsxs("span",{className:"flex items-center gap-1.5 font-semibold sx-text-2 group-hover:text-indigo-600",children:[e.jsx(Xe,{className:"w-3.5 h-3.5"})," Manual checklist"]}),e.jsxs("span",{className:"sx-muted tabular-nums",children:[ae.manualChecked,"/",ae.manualTotal]})]}),e.jsx("span",{className:"block h-1.5 rounded-full sx-track overflow-hidden",children:e.jsx("span",{className:"block h-full rounded-full bg-gradient-to-r from-indigo-500 to-violet-500 transition-all duration-500",style:{width:`${ae.manualTotal?ae.manualChecked/ae.manualTotal*100:0}%`}})})]})]}),e.jsxs("div",{className:"sx-card min-w-0 xl:col-span-5 flex flex-col",children:[e.jsxs("div",{className:"sx-card-header",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"sx-card-title",children:"Category scores"}),e.jsx("p",{className:"sx-card-subtitle",children:"Weakest first · share of verified checks passed"})]}),e.jsx("div",{className:"hidden sm:flex items-center gap-3 text-[11px] sx-muted",children:[["#f43f5e","< 60"],["#f59e0b","60â79"],["#10b981","80+"]].map(([r,a])=>e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:r}}),a]},a))})]}),e.jsx("div",{className:"px-5 py-3 flex-1",children:Pt.map(({catKey:r,category:a,catStats:u})=>e.jsxs("button",{type:"button",onClick:()=>jt(r),className:"sx-tip-host group relative w-full grid grid-cols-[minmax(0,9.5rem)_minmax(0,1fr)_2.75rem] items-center gap-3 py-[7px] text-left",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:`sx-tone sx-tone-${at(a.color)} w-6 h-6 rounded-md`,children:e.jsx(a.icon,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"text-[12.5px] font-medium sx-text-2 group-hover:text-indigo-600 truncate",children:a.name})]}),e.jsx("span",{className:"relative h-2 rounded-full sx-track",children:e.jsx("span",{className:"absolute inset-y-0 left-0 rounded-full transition-all duration-700",style:{width:`${Math.max(u.score,u.checked?2:0)}%`,background:We(u.score)}})}),e.jsx("span",{className:"text-right text-[12.5px] font-semibold sx-text tabular-nums",children:u.checked>
140?`${u.score}%`:"â"}),e.jsxs("span",{className:"sx-tip",children:[u.passed," passed · ",u.failed," failed",u.unknown?` · ${u.unknown} unverified`:""]})]},r))})]}),e.jsxs("div",{className:"sx-card min-w-0 lg:col-span-2 xl:col-span-3 flex flex-col",children:[e.jsxs("div",{className:"sx-card-header",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"sx-card-title",children:"Priority fixes"}),e.jsx("p",{className:"sx-card-subtitle",children:"Critical first, then weakest categories"})]}),e.jsx("span",{className:"sx-count",children:ue.failed})]}),st.length===0?e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center p-6",children:[e.jsx("span",{className:"sx-tone sx-tone-emerald w-10 h-10 mb-3",children:e.jsx(Pe,{className:"w-5 h-5"})}),e.jsx("p",{className:"text-[13px] font-semibold sx-text",children:"Nothing failed"}),e.jsx("p",{className:"text-[12px] sx-muted",children:"Every verified check passed."})]}):e.jsx("div",{className:"flex-1 py-1.5",children:st.map(({catKey:r,category:a,check:u,isCritical:y})=>e.jsxs("button",{type:"button",onClick:()=>xa(r,u.id),className:"w-full flex items-start gap-3 px-5 py-2.5 sx-hover-row text-left",children:[e.jsx("span",{className:`sx-tone sx-tone-${at(a.color)} w-7 h-7 rounded-lg mt-0.5`,children:e.jsx(a.icon,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"text-[13px] font-semibold sx-text truncate",children:u.name}),y&&e.jsx("span",{className:"sx-status sx-status-poor flex-shrink-0",children:"Critical"})]}),e.jsx("span",{className:"block text-[11.5px] sx-muted truncate",children:a.name})]}),e.jsx(it,{className:"w-4 h-4 sx-muted mt-1.5 flex-shrink-0"})]},u.id))}),ue.failed>st.length&&e.jsxs("button",{type:"button",onClick:()=>{var r;te("automated"),ie("failed"),(r=document.getElementById("eeat-results-list"))==null||r.scrollIntoView({behavior:"smooth",block:"start"})},className:"sx-link px-5 py-3 border-t sx-divider text-left flex items-center gap-1",children:["View all ",ue.failed," failed checks ",e.jsx(it,{className:"w-3.5 h-3.5"})]})]})]}),e.jsxs("div",{className:"mt-8 flex flex-col md:flex-row md:items-end md:justify-between gap-3 border-b sx-divider",children:[e.jsxs("div",{className:"sx-tabs border-b-0 -mb-px overflow-x-auto",role:"tablist",children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":ee==="automated",onClick:()=>te("automated"),className:`sx-tab ${ee==="automated"?"is-active":""}`,children:[e.jsx(Rt,{className:"w-4 h-4"}),"Automated checks",e.jsx("span",{className:"sx-count",children:ae.total})]}),e.jsxs("button",{type:"button",role:"tab","aria-selected":ee==="manual",onClick:()=>te("manual"),className:`sx-tab ${ee==="manual"?"is-active":""}`,children:[e.jsx(Xe,{className:"w-4 h-4"}),"Manual checklists",e.jsxs("span",{className:"sx-count",children:[ae.manualChecked,"/",ae.manualTotal]})]})]}),e.jsxs("div",{className:"flex items-center gap-1 pb-2",children:[e.jsxs("button",{type:"button",onClick:()=>Ct(!0),className:"sx-btn sx-btn-ghost",children:[e.jsx(rt,{className:"w-3.5 h-3.5"})," Expand all"]}),e.jsxs("button",{type:"button",onClick:()=>Ct(!1),className:"sx-btn sx-btn-ghost",children:[e.jsx(qa,{className:"w-3.5 h-3.5"})," Collapse all"]})]})]}),ee==="automated"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[{key:"all",label:"All"},{key:"failed",label:"Failed"},{key:"passed",label:"Passed"},{key:"unknown",label:"Unverified"}].map(r=>e.jsxs("button",{type:"button",onClick:()=>ie(r.key),className:`sx-filter ${M===r.key?"is-active":""}`,"aria-pressed":M===r.key,children:[r.label,e.jsx("span",{className:"sx-filter-count",children:ue[r.key]})]},r.key))}),e.jsx("div",{id:"eeat-results-list",className:"mt-4 space-y-3 scroll-mt-6",children:ze.map(([r,a])=>{const u=_t(a),y=a.checks.filter(E=>o[E.id]&&ha(o[E.id]));if(M!=="all"&&y.length===0)return null;const b=a.icon,z=Q[r]??M!=="all";return e.jsxs("div",{id:`eeat-cat-${r}`,className:"sx-card overflow-hidden scroll-mt-6",children:[e.jsxs("button",{type:"button",onClick:()=>Nt(r,z),"aria-expanded":!!z,className:"w-full px-5 py-4 flex items-center gap-4 sx-hover-row text-left",children:[e.jsx("span",{className:`sx-tone sx-tone-${at(a.color)} w-10 h-10`,children:e.jsx(b,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[14.5px] font-semibold sx-text truncate",children:a.name}),e.jsxs("div",{className:"text-[12.5px] sx-muted",children:[u.passed," of ",u.checked," verified checks passed",u.failed>0?` · ${u.failed} failed`:"",u.unknown>0?` · ${u.unknown} unverified`:""]})]}),e.jsx("div",{className:"hidden md:flex items-center gap-1 flex-shrink-0","aria-hidden":"true",children:a.checks.map(E=>{const I=o[E.id]?Ie(o[E.id]):null;return I?e.jsx("span",{className:`sx-pip sx-pip-${I}`,title:`${E.name}: ${I==="unknown"?"unverified":I}`},E.id):null})}),e.jsxs("div",{className:"flex items-center gap-2.5 flex-shrink-0",children:[e.jsx(Us,{value:u.score,color:We(u.score),empty:u.checked===0}),e.jsx("span",{className:"w-10 text-right text-[14px] font-semibold sx-text tabular-nums",children:u.checked>
140?`${u.score}%`:"â"})]}),e.jsx(rt,{className:`w-4 h-4 sx-muted flex-shrink-0 transition-transform duration-200 ${z?"rotate-180":""}`})]}),z&&e.jsx("div",{className:"border-t sx-divider",children:y.map(E=>{const I=o[E.id],se=Ie(I),q=!!et[E.id];return e.jsxs("div",{id:`eeat-check-${E.id}`,className:"border-b sx-divider last:border-b-0 scroll-mt-24",children:[e.jsxs("div",{className:"px-5 py-3.5 flex flex-col sm:flex-row sm:items-center gap-3",children:[e.jsxs("div",{className:"flex items-start gap-3 min-w-0 flex-1",children:[e.jsx("span",{className:"mt-0.5 flex-shrink-0",children:se==="unknown"?e.jsx(nt,{className:"w-[18px] h-[18px] text-amber-500"}):se==="passed"?e.jsx(Pe,{className:"w-[18px] h-[18px] text-emerald-500"}):e.jsx(lt,{className:"w-[18px] h-[18px] text-rose-500"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[13.5px] font-semibold sx-text",children:E.name}),e.jsx("div",{className:"text-[12.5px] sx-muted",children:E.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-[30px] sm:pl-0 sm:max-w-[45%] sm:justify-end",children:[e.jsx("span",{className:`sx-note ${ga[se]}`,children:I.details}),I.expandable&&e.jsx("button",{type:"button",onClick:K=>{K.stopPropagation(),Te(xe=>({...xe,[E.id]:!xe[E.id]}))},className:`sx-icon-btn ${q?"is-active":""}`,"aria-expanded":q,"aria-label":`${q?"Collapse":"Expand"} details for ${E.name}`,title:`${q?"Hide":"Show"} details`,children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),E.tutorial&&e.jsx("a",{href:E.tutorial,target:"_blank",rel:"noopener noreferrer",onClick:K=>K.stopPropagation(),className:"sx-icon-btn hover:!text-rose-500",title:"Watch tutorial","aria-label":`Watch tutorial for ${E.name}`,children:e.jsx(Ga,{className:"w-3.5 h-3.5"})})]})]}),I.expandable&&q&&I.expandedData&&e.jsx("div",{className:"px-5 pb-4 sm:pl-[50px]",children:e.jsx("div",{className:"sx-evidence",children:_a(E,I)})})]},E.id)})})]},r)})})]}),ee==="manual"&&e.jsx("div",{className:"mt-4 space-y-3",children:Object.entries(Ke).map(([r,a],u)=>{const y=a.items.filter((I,se)=>d[`${r}_${se}`]).length,b=a.icon,z=Q[r]!==!1,E=y===a.items.length;return e.jsxs("div",{className:"sx-card overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>Nt(r,z),"aria-expanded":z,className:"w-full px-5 py-4 flex items-center gap-4 sx-hover-row text-left",children:[e.jsx("span",{className:`sx-tone sx-tone-${St[u%St.length]} w-10 h-10`,children:e.jsx(b,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[14.5px] font-semibold sx-text truncate",children:a.name}),e.jsxs("div",{className:"text-[12.5px] sx-muted",children:[y," of ",a.items.length," completed"]})]}),e.jsxs("div",{className:"hidden sm:flex items-center gap-3 flex-shrink-0",children:[e.jsx("div",{className:"w-28 lg:w-36 h-1.5 rounded-full sx-track overflow-hidden",children:e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${E?"bg-emerald-500":"bg-gradient-to-r from-indigo-500 to-violet-500"}`,style:{width:`${y/a.items.length*100}%`}})}),E&&e.jsx("span",{className:"sx-status sx-status-good",children:"Done"})]}),e.jsx(rt,{className:`w-4 h-4 sx-muted flex-shrink-0 transition-transform duration-200 ${z?"rotate-180":""}`})]}),z&&e.jsx("div",{className:"border-t sx-divider",children:a.items.map((I,se)=>{const q=`${r}_${se}`,K=!!d[q];return e.jsxs("label",{className:"px-5 py-3 flex items-center gap-3 sx-hover-row cursor-pointer border-b sx-divider last:border-b-0",children:[e.jsx("input",{type:"checkbox",checked:K,onChange:()=>pa(q),className:"w-4 h-4 rounded flex-shrink-0 accent-indigo-600 cursor-pointer"}),e.jsx("span",{className:`flex-1 text-[13.5px] ${K?"sx-muted line-through":"sx-text"}`,children:I.text}),I.tutorial&&e.jsx("a",{href:I.tutorial,target:"_blank",rel:"noopener noreferrer",onClick:xe=>xe.stopPropagation(),className:"sx-icon-btn hover:!text-rose-500",title:"Watch tutorial","aria-label":`Watch tutorial: ${I.text}`,children:e.jsx(Ua,{className:"w-3.5 h-3.5"})})]},se)})})]},r)})})]}),!$&&!Ae&&e.jsx("div",{className:"mt-6 sx-card overflow-hidden",children:e.jsxs("div",{className:"grid lg:grid-cols-[minmax(0,1fr)_minmax(0,1.05fr)]",children:[e.jsxs("div",{className:"p-6 sm:p-10 flex flex-col justify-center",children:[e.jsxs("span",{className:"sx-chip self-start mb-4",children:[e.jsx(Je,{className:"w-3.5 h-3.5 sx-accent"})," Experience · Expertise · Authority · Trust"]}),e.jsx("h2",{className:"text-[22px] leading-tight font-semibold tracking-tight sx-text mb-2",children:"See how trustworthy your page looks to Google"}),e.jsx("p",{className:"text-[13.5px] sx-text-2 leading-relaxed max-w-md",children:"Enter a URL above. We scan it for E-E-A-T signals and turn the results into a score, a category breakdown and a prioritised list of fixes."}),e.jsx("ol",{className:"mt-6 space-y-3",children:[{icon:Pe,tone:"emerald",title:`${Vt.length} automated checks`,text:"Pages, footer, authors, articles and technical signals."}
14,{icon:Yt,tone:"blue",title:"Schema analysis",text:"Organization, Article, Person, FAQ and more, with extracted markup."},{icon:Xe,tone:"violet",title:`${ut} manual checklist items`,text:"Guided tasks with tutorials for what a crawler cannot judge."}].map(r=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`sx-tone sx-tone-${r.tone} w-8 h-8 rounded-lg`,children:e.jsx(r.icon,{className:"w-4 h-4"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-[13px] font-semibold sx-text",children:r.title}),e.jsx("span",{className:"block text-[12px] sx-muted leading-relaxed",children:r.text})]})]},r.title))})]}),e.jsx("div",{className:"hidden sm:block p-6 sm:p-8 lg:border-l sx-divider","aria-hidden":"true",children:e.jsxs("div",{className:"sx-preview p-5 h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-400/70"}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-400/70"}),e.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-400/70"}),e.jsx("span",{className:"ml-2 h-5 flex-1 max-w-[220px] sx-preview-block"})]}),e.jsxs("div",{className:"grid grid-cols-[150px_minmax(0,1fr)] gap-4",children:[e.jsxs("div",{className:"sx-preview-block p-4 flex flex-col items-center",children:[e.jsxs("svg",{viewBox:"0 0 208 176",className:"w-full h-auto",children:[e.jsx("path",{d:Ve,fill:"none",stroke:"var(--sx-track)",strokeWidth:"16",strokeLinecap:"round"}),e.jsx("path",{d:Ve,fill:"none",stroke:"#10b981",strokeWidth:"16",strokeLinecap:"round",pathLength:"100",strokeDasharray:"82 100"}),e.jsx("text",{x:"104",y:"120",textAnchor:"middle",fontSize:"46",fontWeight:"600",fill:"var(--sx-text)",children:"82"})]}),e.jsx("span",{className:"mt-1 sx-status sx-status-good",children:"Excellent"})]}),e.jsx("div",{className:"sx-preview-block p-4 space-y-3",children:[["Authority & Technical",92,"#10b981"],["Schema Markup",70,"#f59e0b"],["EEAT Pages",86,"#10b981"],["Author EEAT",45,"#f43f5e"],["Footer EEAT",64,"#f59e0b"]].map(([r,a,u])=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-[11px] mb-1",children:[e.jsx("span",{className:"sx-text-2 font-medium truncate",children:r}),e.jsxs("span",{className:"sx-text font-semibold tabular-nums",children:[a,"%"]})]}),e.jsx("div",{className:"h-1.5 rounded-full sx-track",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${a}%`,background:u}})})]},r))})]}),e.jsx("div",{className:"mt-4 sx-preview-block divide-y divide-[var(--sx-border)]",children:[["SSL Certificate (HTTPS)","passed"],["Organization Schema","failed"],["Author Box Present","passed"]].map(([r,a])=>e.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-2.5",children:[a==="passed"?e.jsx(Pe,{className:"w-4 h-4 text-emerald-500"}):e.jsx(lt,{className:"w-4 h-4 text-rose-500"}),e.jsx("span",{className:"text-[12px] font-medium sx-text flex-1 truncate",children:r}),e.jsx("span",{className:`sx-note ${a==="passed"?"sx-note-good":"sx-note-poor"} py-0.5 text-[11px]`,children:a==="passed"?"Passed":"Not found"})]},r))})]})})]})})]})})};export{en as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.