lintpage 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -6
- package/dist/cli.cjs +10 -10
- package/dist/cli.mjs +3 -3
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -94,7 +94,7 @@ Content-Type: ${s.type||`application/octet-stream`}\r\n\r\n`);a.push(e,s,o),type
|
|
|
94
94
|
`)}close(){this.#n.close()}get(e){r(e);let t=this.#f(e);return t?{body:t.body?Buffer.from(t.body.buffer,t.body.byteOffset,t.body.byteLength):void 0,statusCode:t.statusCode,statusMessage:t.statusMessage,headers:t.headers?JSON.parse(t.headers):void 0,etag:t.etag?t.etag:void 0,vary:t.vary?JSON.parse(t.vary):void 0,cacheControlDirectives:t.cacheControlDirectives?JSON.parse(t.cacheControlDirectives):void 0,cachedAt:t.cachedAt,staleAt:t.staleAt,deleteAt:t.deleteAt}:void 0}set(e,t){r(e);let n=this.#d(e),i=Array.isArray(t.body)?Buffer.concat(t.body):t.body,a=i?.byteLength;if(a&&a>this.#e)return;let o=this.#f(e,!0);o?this.#i.run(i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt,o.id):(this.#a.run(n,e.method,i,t.deleteAt,t.statusCode,t.statusMessage,t.headers?JSON.stringify(t.headers):null,t.etag?t.etag:null,t.cacheControlDirectives?JSON.stringify(t.cacheControlDirectives):null,t.vary?JSON.stringify(t.vary):null,t.cachedAt,t.staleAt),this.#u())}createWriteStream(e,t){r(e),i(t);let a=0,o=[],s=this;return new n({decodeStrings:!0,write(e,t,n){a+=e.byteLength,a<=s.#e?o.push(e):this.destroy(),n()},final(n){s.set(e,{...t,body:o}),n()}})}delete(e){if(typeof e!=`object`)throw TypeError(`expected key to be object, got ${typeof e}`);this.#s.run(this.#d(e))}#u(){if(Number.isFinite(this.#t)&&this.size<=this.#t)return 0;{let e=this.#o.run(Date.now()).changes;if(e)return e}{let e=this.#l?.run(Math.max(Math.floor(this.#t*.1),1)).changes;if(e)return e}return 0}get size(){let{total:e}=this.#c.get();return e}#d(e){return`${e.origin}/${e.path}`}#f(e,t=!1){let n=this.#d(e),{headers:r,method:i}=e,a=this.#r.all(n,i);if(a.length===0)return;let o=Date.now();for(let e of a){if(o>=e.deleteAt&&!t)continue;let n=!0;if(e.vary){let t=JSON.parse(e.vary);for(let e in t)if(!s(r[e],t[e])){n=!1;break}}if(n)return e}}};function s(e,t){if(e==null&&t==null)return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}})),Je=_(((e,t)=>{let{kConstruct:n}=y(),{kEnumerableProperty:r}=w(),{iteratorMixin:i,isValidHeaderName:a,isValidHeaderValue:o}=V(),{webidl:s}=B(),c=v(`node:assert`),l=v(`node:util`);function u(e){return e===10||e===13||e===9||e===32}function d(e){let t=0,n=e.length;for(;n>t&&u(e.charCodeAt(n-1));)--n;for(;n>t&&u(e.charCodeAt(t));)++t;return t===0&&n===e.length?e:e.substring(t,n)}function f(e,t){if(Array.isArray(t))for(let n=0;n<t.length;++n){let r=t[n];if(r.length!==2)throw s.errors.exception({header:`Headers constructor`,message:`expected name/value pair to be length 2, found ${r.length}.`});p(e,r[0],r[1])}else if(typeof t==`object`&&t){let n=Object.keys(t);for(let r=0;r<n.length;++r)p(e,n[r],t[n[r]])}else throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence<sequence<ByteString>>`,`record<ByteString, ByteString>`]})}function p(e,t,n){if(n=d(n),!a(t))throw s.errors.invalidArgument({prefix:`Headers.append`,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:`Headers.append`,value:n,type:`header value`});if(b(e)===`immutable`)throw TypeError(`immutable`);return S(e).append(t,n,!1)}function m(e){let t=S(e);if(!t)return[];if(t.sortedMap)return t.sortedMap;let n=[],r=t.toSortedArray(),i=t.cookies;if(i===null||i.length===1)return t.sortedMap=r;for(let e=0;e<r.length;++e){let{0:t,1:a}=r[e];if(t===`set-cookie`)for(let e=0;e<i.length;++e)n.push([t,i[e]]);else n.push([t,a])}return t.sortedMap=n}function h(e,t){return e[0]<t[0]?-1:1}var g=class e{cookies=null;sortedMap;headersMap;constructor(t){t instanceof e?(this.headersMap=new Map(t.headersMap),this.sortedMap=t.sortedMap,this.cookies=t.cookies===null?null:[...t.cookies]):(this.headersMap=new Map(t),this.sortedMap=null)}contains(e,t){return this.headersMap.has(t?e:e.toLowerCase())}clear(){this.headersMap.clear(),this.sortedMap=null,this.cookies=null}append(e,t,n){this.sortedMap=null;let r=n?e:e.toLowerCase(),i=this.headersMap.get(r);if(i){let e=r===`cookie`?`; `:`, `;this.headersMap.set(r,{name:i.name,value:`${i.value}${e}${t}`})}else this.headersMap.set(r,{name:e,value:t});r===`set-cookie`&&(this.cookies??=[]).push(t)}set(e,t,n){this.sortedMap=null;let r=n?e:e.toLowerCase();r===`set-cookie`&&(this.cookies=[t]),this.headersMap.set(r,{name:e,value:t})}delete(e,t){this.sortedMap=null,t||(e=e.toLowerCase()),e===`set-cookie`&&(this.cookies=null),this.headersMap.delete(e)}get(e,t){return this.headersMap.get(t?e:e.toLowerCase())?.value??null}*[Symbol.iterator](){for(let{0:e,1:{value:t}}of this.headersMap)yield[e,t]}get entries(){let e={};if(this.headersMap.size!==0)for(let{name:t,value:n}of this.headersMap.values())e[t]=n;return e}rawValues(){return this.headersMap.values()}get entriesList(){let e=[];if(this.headersMap.size!==0)for(let{0:t,1:{name:n,value:r}}of this.headersMap)if(t===`set-cookie`)for(let t of this.cookies)e.push([n,t]);else e.push([n,r]);return e}toSortedArray(){let e=this.headersMap.size,t=Array(e);if(e<=32){if(e===0)return t;let n=this.headersMap[Symbol.iterator](),r=n.next().value;t[0]=[r[0],r[1].value],c(r[1].value!==null);for(let r=1,i=0,a=0,o=0,s=0,l,u;r<e;++r){for(u=n.next().value,l=t[r]=[u[0],u[1].value],c(l[1]!==null),o=0,a=r;o<a;)s=o+(a-o>>1),t[s][0]<=l[0]?o=s+1:a=s;if(r!==s){for(i=r;i>o;)t[i]=t[--i];t[o]=l}}if(!n.next().done)throw TypeError(`Unreachable`);return t}else{let e=0;for(let{0:n,1:{value:r}}of this.headersMap)t[e++]=[n,r],c(r!==null);return t.sort(h)}}},_=class e{#e;#t;constructor(e=void 0){s.util.markAsUncloneable(this),e!==n&&(this.#t=new g,this.#e=`none`,e!==void 0&&(e=s.converters.HeadersInit(e,`Headers constructor`,`init`),f(this,e)))}append(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.append`);let r=`Headers.append`;return t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),p(this,t,n)}delete(t){if(s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.delete`),t=s.converters.ByteString(t,`Headers.delete`,`name`),!a(t))throw s.errors.invalidArgument({prefix:`Headers.delete`,value:t,type:`header name`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.contains(t,!1)&&this.#t.delete(t,!1)}get(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.get`);let n=`Headers.get`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.get(t,!1)}has(t){s.brandCheck(this,e),s.argumentLengthCheck(arguments,1,`Headers.has`);let n=`Headers.has`;if(t=s.converters.ByteString(t,n,`name`),!a(t))throw s.errors.invalidArgument({prefix:n,value:t,type:`header name`});return this.#t.contains(t,!1)}set(t,n){s.brandCheck(this,e),s.argumentLengthCheck(arguments,2,`Headers.set`);let r=`Headers.set`;if(t=s.converters.ByteString(t,r,`name`),n=s.converters.ByteString(n,r,`value`),n=d(n),!a(t))throw s.errors.invalidArgument({prefix:r,value:t,type:`header name`});if(!o(n))throw s.errors.invalidArgument({prefix:r,value:n,type:`header value`});if(this.#e===`immutable`)throw TypeError(`immutable`);this.#t.set(t,n,!1)}getSetCookie(){s.brandCheck(this,e);let t=this.#t.cookies;return t?[...t]:[]}[l.inspect.custom](e,t){return t.depth??=e,`Headers ${l.formatWithOptions(t,this.#t.entries)}`}static getHeadersGuard(e){return e.#e}static setHeadersGuard(e,t){e.#e=t}static getHeadersList(e){return e.#t}static setHeadersList(e,t){e.#t=t}};let{getHeadersGuard:b,setHeadersGuard:x,getHeadersList:S,setHeadersList:C}=_;Reflect.deleteProperty(_,`getHeadersGuard`),Reflect.deleteProperty(_,`setHeadersGuard`),Reflect.deleteProperty(_,`getHeadersList`),Reflect.deleteProperty(_,`setHeadersList`),i(`Headers`,_,m,0,1),Object.defineProperties(_.prototype,{append:r,delete:r,get:r,has:r,set:r,getSetCookie:r,[Symbol.toStringTag]:{value:`Headers`,configurable:!0},[l.inspect.custom]:{enumerable:!1}}),s.converters.HeadersInit=function(e,t,n){if(s.util.Type(e)===s.util.Types.OBJECT){let r=Reflect.get(e,Symbol.iterator);if(!l.types.isProxy(e)&&r===_.prototype.entries)try{return S(e).entriesList}catch{}return typeof r==`function`?s.converters[`sequence<sequence<ByteString>>`](e,t,n,r.bind(e)):s.converters[`record<ByteString, ByteString>`](e,t,n)}throw s.errors.conversionFailed({prefix:`Headers constructor`,argument:`Argument 1`,types:[`sequence<sequence<ByteString>>`,`record<ByteString, ByteString>`]})},t.exports={fill:f,compareHeaderName:h,Headers:_,HeadersList:g,getHeadersGuard:b,setHeadersGuard:x,setHeadersList:C,getHeadersList:S}})),Ye=_(((e,t)=>{let{Headers:n,HeadersList:r,fill:i,getHeadersGuard:a,setHeadersGuard:o,setHeadersList:s}=Je(),{extractBody:c,cloneBody:l,mixinBody:u,streamRegistry:d,bodyUnusable:f}=ee(),p=w(),m=v(`node:util`),{kEnumerableProperty:h}=p,{isValidReasonPhrase:g,isCancelled:_,isAborted:b,isErrorLike:x,environmentSettingsObject:S}=V(),{redirectStatusSet:C,nullBodyStatus:T}=F(),{webidl:E}=B(),{URLSerializer:D}=z(),{kConstruct:O}=y(),k=v(`node:assert`),{isomorphicEncode:A,serializeJavascriptValueToJSONString:j}=R(),M=new TextEncoder(`utf-8`);var N=class e{#e;#t;static error(){return J(te(),`immutable`)}static json(e,t=void 0){E.argumentLengthCheck(arguments,1,`Response.json`),t=E.converters.ResponseInit(t);let n=c(M.encode(j(e))),r=J(W({}),`response`);return q(r,t,{body:n[0],type:`application/json`}),r}static redirect(e,t=302){E.argumentLengthCheck(arguments,1,`Response.redirect`),e=E.converters.USVString(e),t=E.converters[`unsigned short`](t);let n;try{n=new URL(e,S.settingsObject.baseUrl)}catch(t){throw TypeError(`Failed to parse URL from ${e}`,{cause:t})}if(!C.has(t))throw RangeError(`Invalid status code ${t}`);let r=J(W({}),`immutable`);r.#t.status=t;let i=A(D(n));return r.#t.headersList.append(`location`,i,!0),r}constructor(e=null,t=void 0){if(E.util.markAsUncloneable(this),e===O)return;e!==null&&(e=E.converters.BodyInit(e,`Response`,`body`)),t=E.converters.ResponseInit(t),this.#t=W({}),this.#e=new n(O),o(this.#e,`response`),s(this.#e,this.#t.headersList);let r=null;if(e!=null){let[t,n]=c(e);r={body:t,type:n}}q(this,t,r)}get type(){return E.brandCheck(this,e),this.#t.type}get url(){E.brandCheck(this,e);let t=this.#t.urlList,n=t[t.length-1]??null;return n===null?``:D(n,!0)}get redirected(){return E.brandCheck(this,e),this.#t.urlList.length>1}get status(){return E.brandCheck(this,e),this.#t.status}get ok(){return E.brandCheck(this,e),this.#t.status>=200&&this.#t.status<=299}get statusText(){return E.brandCheck(this,e),this.#t.statusText}get headers(){return E.brandCheck(this,e),this.#e}get body(){return E.brandCheck(this,e),this.#t.body?this.#t.body.stream:null}get bodyUsed(){return E.brandCheck(this,e),!!this.#t.body&&p.isDisturbed(this.#t.body.stream)}clone(){if(E.brandCheck(this,e),f(this.#t))throw E.errors.exception({header:`Response.clone`,message:`Body has already been consumed.`});let t=U(this.#t);return this.#t.urlList.length!==0&&this.#t.body?.stream&&d.register(this,new WeakRef(this.#t.body.stream)),J(t,a(this.#e))}[m.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={status:this.status,statusText:this.statusText,headers:this.headers,body:this.body,bodyUsed:this.bodyUsed,ok:this.ok,redirected:this.redirected,type:this.type,url:this.url};return`Response ${m.formatWithOptions(t,n)}`}static getResponseHeaders(e){return e.#e}static setResponseHeaders(e,t){e.#e=t}static getResponseState(e){return e.#t}static setResponseState(e,t){e.#t=t}};let{getResponseHeaders:P,setResponseHeaders:I,getResponseState:L,setResponseState:H}=N;Reflect.deleteProperty(N,`getResponseHeaders`),Reflect.deleteProperty(N,`setResponseHeaders`),Reflect.deleteProperty(N,`getResponseState`),Reflect.deleteProperty(N,`setResponseState`),u(N,L),Object.defineProperties(N.prototype,{type:h,url:h,status:h,ok:h,redirected:h,statusText:h,headers:h,clone:h,body:h,bodyUsed:h,[Symbol.toStringTag]:{value:`Response`,configurable:!0}}),Object.defineProperties(N,{json:h,redirect:h,error:h});function U(e){if(e.internalResponse)return re(U(e.internalResponse),e.type);let t=W({...e,body:null});return e.body!=null&&(t.body=l(e.body)),t}function W(e){return{aborted:!1,rangeRequested:!1,timingAllowPassed:!1,requestIncludesCredentials:!1,type:`default`,status:200,timingInfo:null,cacheState:``,statusText:``,...e,headersList:e?.headersList?new r(e?.headersList):new r,urlList:e?.urlList?[...e.urlList]:[]}}function te(e){return W({type:`error`,status:0,error:x(e)?e:Error(e&&String(e)),aborted:e&&e.name===`AbortError`})}function ne(e){return e.type===`error`&&e.status===0}function G(e,t){return t={internalResponse:e,...t},new Proxy(e,{get(e,n){return n in t?t[n]:e[n]},set(e,n,r){return k(!(n in t)),e[n]=r,!0}})}function re(e,t){if(t===`basic`)return G(e,{type:`basic`,headersList:e.headersList});if(t===`cors`)return G(e,{type:`cors`,headersList:e.headersList});if(t===`opaque`)return G(e,{type:`opaque`,urlList:[],status:0,statusText:``,body:null});if(t===`opaqueredirect`)return G(e,{type:`opaqueredirect`,status:0,statusText:``,headersList:[],body:null});k(!1)}function K(e,t=null){return k(_(e)),b(e)?te(Object.assign(new DOMException(`The operation was aborted.`,`AbortError`),{cause:t})):te(Object.assign(new DOMException(`Request was cancelled.`),{cause:t}))}function q(e,t,n){if(t.status!==null&&(t.status<200||t.status>599))throw RangeError(`init["status"] must be in the range of 200 to 599, inclusive.`);if(`statusText`in t&&t.statusText!=null&&!g(String(t.statusText)))throw TypeError(`Invalid statusText`);if(`status`in t&&t.status!=null&&(L(e).status=t.status),`statusText`in t&&t.statusText!=null&&(L(e).statusText=t.statusText),`headers`in t&&t.headers!=null&&i(P(e),t.headers),n){if(T.includes(e.status))throw E.errors.exception({header:`Response constructor`,message:`Invalid response status code ${e.status}`});L(e).body=n.body,n.type!=null&&!L(e).headersList.contains(`content-type`,!0)&&L(e).headersList.append(`content-type`,n.type,!0)}}function J(e,t){let r=new N(O);H(r,e);let i=new n(O);return I(r,i),s(i,e.headersList),o(i,t),e.urlList.length!==0&&e.body?.stream&&d.register(r,new WeakRef(e.body.stream)),r}E.converters.XMLHttpRequestBodyInit=function(e,t,n){return typeof e==`string`?E.converters.USVString(e,t,n):E.is.Blob(e)||E.is.BufferSource(e)||E.is.FormData(e)||E.is.URLSearchParams(e)?e:E.converters.DOMString(e,t,n)},E.converters.BodyInit=function(e,t,n){return E.is.ReadableStream(e)||e?.[Symbol.asyncIterator]?e:E.converters.XMLHttpRequestBodyInit(e,t,n)},E.converters.ResponseInit=E.dictionaryConverter([{key:`status`,converter:E.converters[`unsigned short`],defaultValue:()=>200},{key:`statusText`,converter:E.converters.ByteString,defaultValue:()=>``},{key:`headers`,converter:E.converters.HeadersInit}]),E.is.Response=E.util.MakeTypeAssertion(N),t.exports={isNetworkError:ne,makeNetworkError:te,makeResponse:W,makeAppropriateNetworkError:K,filterResponse:re,Response:N,cloneResponse:U,fromInnerResponse:J,getResponseState:L}})),Xe=_(((e,t)=>{let{extractBody:n,mixinBody:r,cloneBody:i,bodyUnusable:a}=ee(),{Headers:o,fill:s,HeadersList:c,setHeadersGuard:l,getHeadersGuard:u,setHeadersList:d,getHeadersList:f}=Je(),p=w(),m=v(`node:util`),{isValidHTTPToken:h,sameOrigin:g,environmentSettingsObject:_}=V(),{forbiddenMethodsSet:b,corsSafeListedMethodsSet:x,referrerPolicy:S,requestRedirect:C,requestMode:T,requestCredentials:E,requestCache:D,requestDuplex:O}=F(),{kEnumerableProperty:k,normalizedMethodRecordsBase:A,normalizedMethodRecords:j}=p,{webidl:M}=B(),{URLSerializer:N}=z(),{kConstruct:P}=y(),I=v(`node:assert`),{getMaxListeners:L,setMaxListeners:R,defaultMaxListeners:H}=v(`node:events`),U=Symbol(`abortController`),W=new FinalizationRegistry(({signal:e,abort:t})=>{e.removeEventListener(`abort`,t)}),te=new WeakMap,ne;try{ne=L(new AbortController().signal)>0}catch{ne=!1}function G(e){return t;function t(){let n=e.deref();if(n!==void 0){W.unregister(t),this.removeEventListener(`abort`,t),n.abort(this.reason);let e=te.get(n.signal);if(e!==void 0){if(e.size!==0){for(let t of e){let e=t.deref();e!==void 0&&e.abort(this.reason)}e.clear()}te.delete(n.signal)}}}}let re=!1;var K=class e{#e;#t;#n;#r;#i=null;constructor(e,t=void 0){if(M.util.markAsUncloneable(this),e===P)return;M.argumentLengthCheck(arguments,1,`Request constructor`),e=M.converters.RequestInfo(e),t=M.converters.RequestInit(t);let r=null,i=null,u=_.settingsObject.baseUrl,m=null;if(typeof e==`string`){this.#t=t.dispatcher;let n;try{n=new URL(e,u)}catch(t){throw TypeError(`Failed to parse URL from `+e,{cause:t})}if(n.username||n.password)throw TypeError(`Request cannot be constructed from a URL that includes credentials: `+e);r=se({urlList:[n]}),i=`cors`}else I(M.is.Request(e)),r=e.#r,m=e.#e,this.#t=t.dispatcher||e.#t;let v=_.settingsObject.origin,y=`client`;if(r.window?.constructor?.name===`EnvironmentSettingsObject`&&g(r.window,v)&&(y=r.window),t.window!=null)throw TypeError(`'window' option '${y}' must be null`);`window`in t&&(y=`no-window`),r=se({method:r.method,headersList:r.headersList,unsafeRequest:r.unsafeRequest,client:_.settingsObject,window:y,priority:r.priority,origin:r.origin,referrer:r.referrer,referrerPolicy:r.referrerPolicy,mode:r.mode,credentials:r.credentials,cache:r.cache,redirect:r.redirect,integrity:r.integrity,keepalive:r.keepalive,reloadNavigation:r.reloadNavigation,historyNavigation:r.historyNavigation,urlList:[...r.urlList]});let S=Object.keys(t).length!==0;if(S&&(r.mode===`navigate`&&(r.mode=`same-origin`),r.reloadNavigation=!1,r.historyNavigation=!1,r.origin=`client`,r.referrer=`client`,r.referrerPolicy=``,r.url=r.urlList[r.urlList.length-1],r.urlList=[r.url]),t.referrer!==void 0){let e=t.referrer;if(e===``)r.referrer=`no-referrer`;else{let t;try{t=new URL(e,u)}catch(t){throw TypeError(`Referrer "${e}" is not a valid URL.`,{cause:t})}t.protocol===`about:`&&t.hostname===`client`||v&&!g(t,_.settingsObject.baseUrl)?r.referrer=`client`:r.referrer=t}}t.referrerPolicy!==void 0&&(r.referrerPolicy=t.referrerPolicy);let C;if(C=t.mode===void 0?i:t.mode,C===`navigate`)throw M.errors.exception({header:`Request constructor`,message:`invalid request mode navigate.`});if(C!=null&&(r.mode=C),t.credentials!==void 0&&(r.credentials=t.credentials),t.cache!==void 0&&(r.cache=t.cache),r.cache===`only-if-cached`&&r.mode!==`same-origin`)throw TypeError(`'only-if-cached' can be set only with 'same-origin' mode`);if(t.redirect!==void 0&&(r.redirect=t.redirect),t.integrity!=null&&(r.integrity=String(t.integrity)),t.keepalive!==void 0&&(r.keepalive=!!t.keepalive),t.method!==void 0){let e=t.method,n=j[e];if(n!==void 0)r.method=n;else{if(!h(e))throw TypeError(`'${e}' is not a valid HTTP method.`);let t=e.toUpperCase();if(b.has(t))throw TypeError(`'${e}' HTTP method is unsupported.`);e=A[t]??e,r.method=e}!re&&r.method===`patch`&&(process.emitWarning("Using `patch` is highly likely to result in a `405 Method Not Allowed`. `PATCH` is much more likely to succeed.",{code:`UNDICI-FETCH-patch`}),re=!0)}t.signal!==void 0&&(m=t.signal),this.#r=r;let w=new AbortController;if(this.#e=w.signal,m!=null)if(m.aborted)w.abort(m.reason);else{this[U]=w;let e=G(new WeakRef(w));ne&&L(m)===H&&R(1500,m);let t=p.addAbortListener(m,e);W.register(w,{signal:m,abort:e},e),this.#i=()=>{W.unregister(e),t(),this.#i=null}}if(this.#n=new o(P),d(this.#n,r.headersList),l(this.#n,`request`),C===`no-cors`){if(!x.has(r.method))throw TypeError(`'${r.method} is unsupported in no-cors mode.`);l(this.#n,`request-no-cors`)}if(S){let e=f(this.#n),n=t.headers===void 0?new c(e):t.headers;if(e.clear(),n instanceof c){for(let{name:t,value:r}of n.rawValues())e.append(t,r,!1);e.cookies=n.cookies}else s(this.#n,n)}let T=M.is.Request(e)?e.#r.body:null;if((t.body!=null||T!=null)&&(r.method===`GET`||r.method===`HEAD`))throw TypeError(`Request with GET/HEAD method cannot have body.`);let E=null;if(t.body!=null){let[e,i]=n(t.body,r.keepalive);E=e,i&&!f(this.#n).contains(`content-type`,!0)&&this.#n.append(`content-type`,i,!0)}let D=E??T;if(D!=null&&D.source==null){if(E!=null&&t.duplex==null)throw TypeError(`RequestInit: duplex option is required when sending a body.`);if(r.mode!==`same-origin`&&r.mode!==`cors`)throw TypeError(`If request is made from ReadableStream, mode should be "same-origin" or "cors"`);r.useCORSPreflightFlag=!0}let O=D;if(E==null&&T!=null){if(a(e.#r))throw TypeError(`Cannot construct a Request with a Request object that has already been used.`);let t=new TransformStream;T.stream.pipeThrough(t),O={source:T.source,length:T.length,stream:t.readable}}this.#r.body=O}get method(){return M.brandCheck(this,e),this.#r.method}get url(){return M.brandCheck(this,e),N(this.#r.url)}get headers(){return M.brandCheck(this,e),this.#n}get destination(){return M.brandCheck(this,e),this.#r.destination}get referrer(){return M.brandCheck(this,e),this.#r.referrer===`no-referrer`?``:this.#r.referrer===`client`?`about:client`:this.#r.referrer.toString()}get referrerPolicy(){return M.brandCheck(this,e),this.#r.referrerPolicy}get mode(){return M.brandCheck(this,e),this.#r.mode}get credentials(){return M.brandCheck(this,e),this.#r.credentials}get cache(){return M.brandCheck(this,e),this.#r.cache}get redirect(){return M.brandCheck(this,e),this.#r.redirect}get integrity(){return M.brandCheck(this,e),this.#r.integrity}get keepalive(){return M.brandCheck(this,e),this.#r.keepalive}get isReloadNavigation(){return M.brandCheck(this,e),this.#r.reloadNavigation}get isHistoryNavigation(){return M.brandCheck(this,e),this.#r.historyNavigation}get signal(){return M.brandCheck(this,e),this.#e}get body(){return M.brandCheck(this,e),this.#r.body?this.#r.body.stream:null}get bodyUsed(){return M.brandCheck(this,e),!!this.#r.body&&p.isDisturbed(this.#r.body.stream)}get duplex(){return M.brandCheck(this,e),`half`}clone(){if(M.brandCheck(this,e),a(this.#r))throw TypeError(`unusable`);let t=ce(this.#r),n=new AbortController;if(this.signal.aborted)n.abort(this.signal.reason);else{let e=te.get(this.signal);e===void 0&&(e=new Set,te.set(this.signal,e));let t=new WeakRef(n);e.add(t),p.addAbortListener(n.signal,G(t))}return Z(t,this.#t,n.signal,u(this.#n))}[m.inspect.custom](e,t){t.depth===null&&(t.depth=2),t.colors??=!0;let n={method:this.method,url:this.url,headers:this.headers,destination:this.destination,referrer:this.referrer,referrerPolicy:this.referrerPolicy,mode:this.mode,credentials:this.credentials,cache:this.cache,redirect:this.redirect,integrity:this.integrity,keepalive:this.keepalive,isReloadNavigation:this.isReloadNavigation,isHistoryNavigation:this.isHistoryNavigation,signal:this.signal};return`Request ${m.formatWithOptions(t,n)}`}static setRequestSignal(e,t){return e.#e=t,e}static getRequestDispatcher(e){return e.#t}static setRequestDispatcher(e,t){e.#t=t}static setRequestHeaders(e,t){e.#n=t}static getRequestState(e){return e.#r}static setRequestState(e,t){e.#r=t}static removeRequestAbortListener(e){e.#i?.()}};let{setRequestSignal:q,getRequestDispatcher:J,setRequestDispatcher:ie,setRequestHeaders:Y,getRequestState:ae,setRequestState:X,removeRequestAbortListener:oe}=K;Reflect.deleteProperty(K,`setRequestSignal`),Reflect.deleteProperty(K,`getRequestDispatcher`),Reflect.deleteProperty(K,`setRequestDispatcher`),Reflect.deleteProperty(K,`setRequestHeaders`),Reflect.deleteProperty(K,`getRequestState`),Reflect.deleteProperty(K,`setRequestState`),Reflect.deleteProperty(K,`removeRequestAbortListener`),r(K,ae);function se(e){return{method:e.method??`GET`,localURLsOnly:e.localURLsOnly??!1,unsafeRequest:e.unsafeRequest??!1,body:e.body??null,client:e.client??null,reservedClient:e.reservedClient??null,replacesClientId:e.replacesClientId??``,window:e.window??`client`,keepalive:e.keepalive??!1,serviceWorkers:e.serviceWorkers??`all`,initiator:e.initiator??``,destination:e.destination??``,priority:e.priority??`auto`,origin:e.origin??`client`,policyContainer:e.policyContainer??`client`,referrer:e.referrer??`client`,referrerPolicy:e.referrerPolicy??``,mode:e.mode??`no-cors`,useCORSPreflightFlag:e.useCORSPreflightFlag??!1,credentials:e.credentials??`same-origin`,useCredentials:e.useCredentials??!1,cache:e.cache??`default`,redirect:e.redirect??`follow`,integrity:e.integrity??``,cryptoGraphicsNonceMetadata:e.cryptoGraphicsNonceMetadata??``,parserMetadata:e.parserMetadata??``,reloadNavigation:e.reloadNavigation??!1,historyNavigation:e.historyNavigation??!1,userActivation:e.userActivation??!1,taintedOrigin:e.taintedOrigin??!1,redirectCount:e.redirectCount??0,responseTainting:e.responseTainting??`basic`,preventNoCacheCacheControlHeaderModification:e.preventNoCacheCacheControlHeaderModification??!1,done:e.done??!1,timingAllowFailed:e.timingAllowFailed??!1,useURLCredentials:e.useURLCredentials??void 0,traversableForUserPrompts:e.traversableForUserPrompts??`client`,urlList:e.urlList,url:e.urlList[0],headersList:e.headersList?new c(e.headersList):new c}}function ce(e){let t=se({...e,body:null});return e.body!=null&&(t.body=i(e.body)),t}function Z(e,t,n,r){let i=new K(P);X(i,e),ie(i,t),q(i,n);let a=new o(P);return Y(i,a),d(a,e.headersList),l(a,r),i}Object.defineProperties(K.prototype,{method:k,url:k,headers:k,redirect:k,clone:k,signal:k,duplex:k,destination:k,body:k,bodyUsed:k,isHistoryNavigation:k,isReloadNavigation:k,keepalive:k,integrity:k,cache:k,credentials:k,attribute:k,referrerPolicy:k,referrer:k,mode:k,[Symbol.toStringTag]:{value:`Request`,configurable:!0}}),M.is.Request=M.util.MakeTypeAssertion(K),M.converters.RequestInfo=function(e){return typeof e==`string`?M.converters.USVString(e):M.is.Request(e)?e:M.converters.USVString(e)},M.converters.RequestInit=M.dictionaryConverter([{key:`method`,converter:M.converters.ByteString},{key:`headers`,converter:M.converters.HeadersInit},{key:`body`,converter:M.nullableConverter(M.converters.BodyInit)},{key:`referrer`,converter:M.converters.USVString},{key:`referrerPolicy`,converter:M.converters.DOMString,allowedValues:S},{key:`mode`,converter:M.converters.DOMString,allowedValues:T},{key:`credentials`,converter:M.converters.DOMString,allowedValues:E},{key:`cache`,converter:M.converters.DOMString,allowedValues:D},{key:`redirect`,converter:M.converters.DOMString,allowedValues:C},{key:`integrity`,converter:M.converters.DOMString},{key:`keepalive`,converter:M.converters.boolean},{key:`signal`,converter:M.nullableConverter(e=>M.converters.AbortSignal(e,`RequestInit`,`signal`))},{key:`window`,converter:M.converters.any},{key:`duplex`,converter:M.converters.DOMString,allowedValues:O},{key:`dispatcher`,converter:M.converters.any},{key:`priority`,converter:M.converters.DOMString,allowedValues:[`high`,`low`,`auto`]}]),t.exports={Request:K,makeRequest:se,fromInnerRequest:Z,cloneRequest:ce,getRequestDispatcher:J,getRequestState:ae,removeRequestAbortListener:oe}})),Ze=_(((e,t)=>{let n=v(`node:assert`),{runtimeFeatures:r}=H(),i=new Map([[`sha256`,0],[`sha384`,1],[`sha512`,2]]),a;if(r.has(`crypto`)){a=v(`node:crypto`);let e=a.getHashes();e.length===0&&i.clear();for(let t of i.keys())e.includes(t)===!1&&i.delete(t)}else i.clear();let o=Map.prototype.get.bind(i),s=Map.prototype.has.bind(i),c=r.has(`crypto`)===!1||i.size===0?()=>!0:(e,t)=>{let n=u(t);if(n.length===0)return!0;let r=l(n);for(let t of r){let n=t.alg,r=t.val;if(f(d(n,e),r))return!0}return!1};function l(e){let t=[],r=null;for(let i of e){if(n(s(i.alg),`Invalid SRI hash algorithm token`),t.length===0){t.push(i),r=i;continue}let e=r.alg,a=o(e),c=i.alg,l=o(c);l<a||(l>a?(r=i,t[0]=i,t.length=1):t.push(i))}return t}function u(e){let t=[];for(let n of e.split(` `)){let e=n.split(`?`,1)[0],r=``,i=[e.slice(0,6),e.slice(7)],a=i[0];if(!s(a))continue;i[1]&&(r=i[1]);let o={alg:a,val:r};t.push(o)}return t}let d=(e,t)=>a.hash(e,t,`base64`);function f(e,t){let n=e.length;n!==0&&e[n-1]===`=`&&--n,n!==0&&e[n-1]===`=`&&--n;let r=t.length;if(r!==0&&t[r-1]===`=`&&--r,r!==0&&t[r-1]===`=`&&--r,n!==r)return!1;for(let r=0;r<n;++r)if(!(e[r]===t[r]||e[r]===`+`&&t[r]===`-`||e[r]===`/`&&t[r]===`_`))return!1;return!0}t.exports={applyAlgorithmToBytes:d,bytesMatch:c,caseSensitiveMatch:f,isValidSRIHashAlgorithm:s,getStrongestMetadata:l,parseMetadata:u}})),Qe=_(((e,t)=>{let{makeNetworkError:n,makeAppropriateNetworkError:r,filterResponse:i,makeResponse:a,fromInnerResponse:o,getResponseState:s}=Ye(),{HeadersList:c}=Je(),{Request:l,cloneRequest:u,getRequestDispatcher:d,getRequestState:f,removeRequestAbortListener:p}=Xe(),m=v(`node:zlib`),{makePolicyContainer:h,clonePolicyContainer:g,requestBadPort:_,TAOCheck:y,appendRequestOriginHeader:b,responseLocationURL:S,requestCurrentURL:C,setRequestReferrerPolicyOnRedirect:T,tryUpgradeRequestToAPotentiallyTrustworthyURL:E,createOpaqueTimingInfo:D,appendFetchMetadata:O,corsCheck:k,crossOriginResourcePolicyCheck:A,determineRequestsReferrer:j,coarsenedSharedCurrentTime:M,sameOrigin:N,isCancelled:P,isAborted:I,isErrorLike:L,fullyReadBody:H,readableStreamClose:U,urlIsLocal:W,urlIsHttpHttpsScheme:te,urlHasHttpsScheme:ne,clampAndCoarsenConnectionTimingInfo:G,simpleRangeHeaderValue:re,buildContentRange:K,createInflate:q,extractMimeType:J,hasAuthenticationEntry:ie,includesCredentials:Y,isTraversableNavigable:ae}=V(),X=v(`node:assert`),{safelyExtractBody:oe,extractBody:se}=ee(),{redirectStatusSet:ce,nullBodyStatus:Z,safeMethodsSet:le,requestBodyHeader:ue,subresourceSet:de}=F(),fe=v(`node:events`),{Readable:pe,pipeline:me,finished:he,isErrored:ge,isReadable:_e}=v(`node:stream`),{addAbortListener:Q,bufferToLowerCasedHeaderName:ve}=w(),{SocketError:ye}=x(),{dataURLProcessor:$,serializeAMimeType:be,minimizeSupportedMimeType:xe}=z(),{getGlobalDispatcher:Se}=Ae(),{webidl:Ce}=B(),{STATUS_CODES:we}=v(`node:http`),{bytesMatch:Te}=Ze(),{isomorphicEncode:Ee}=R(),De=[`GET`,`HEAD`],Oe=typeof __UNDICI_IS_NODE__<`u`||typeof esbuildDetection<`u`?`node`:`undici`,ke;function je(e,t,n){if(Array.isArray(n)){for(let t=0;t<n.length;t+=2){let r=ve(n[t]),i=n[t+1];if(Array.isArray(i)&&!Buffer.isBuffer(i))for(let t of i)e.append(r,t.toString(`latin1`),!0);else e.append(r,i.toString(`latin1`),!0)}return}for(let[n,r]of Object.entries(t??{}))if(Array.isArray(r))for(let t of r)e.append(n,`${t}`,!0);else e.append(n,`${r}`,!0)}var Me=class extends fe{constructor(e){super(),this.dispatcher=e,this.connection=null,this.dump=!1,this.state=`ongoing`}terminate(e){this.state===`ongoing`&&(this.state=`terminated`,this.connection?.destroy(e),this.emit(`terminated`,e))}abort(e){this.state===`ongoing`&&(this.state=`aborted`,e||=new DOMException(`The operation was aborted.`,`AbortError`),this.serializedAbortReason=e,this.connection?.destroy(e),this.emit(`terminated`,e))}};function Ne(e){Fe(e,`fetch`)}function Pe(e,t=void 0){Ce.argumentLengthCheck(arguments,1,`globalThis.fetch`);let n=Promise.withResolvers(),r;try{r=new l(e,t)}catch(e){return n.reject(e),n.promise}let i=f(r);if(r.signal.aborted)return Le(n,i,null,r.signal.reason,null),n.promise;i.client.globalObject?.constructor?.name===`ServiceWorkerGlobalScope`&&(i.serviceWorkers=`none`);let a=null,s=!1,c=null,u=Q(r.signal,()=>{s=!0,X(c!=null),c.abort(r.signal.reason);let e=a?.deref();Le(n,i,e,r.signal.reason,c.controller)}),m=()=>{u(),p(r)};return c=Re({request:i,processResponseEndOfBody:e=>{Ne(e),m()},processResponse:e=>{if(!s){if(e.aborted){Le(n,i,a,c.serializedAbortReason,c.controller),m();return}if(e.type===`error`){n.reject(TypeError(`fetch failed`,{cause:e.error})),m();return}a=new WeakRef(o(e,`immutable`)),n.resolve(a.deref()),n=null}},dispatcher:d(r),requestObject:r}),n.promise}function Fe(e,t=`other`){if(e.type===`error`&&e.aborted||!e.urlList?.length)return;let n=e.urlList[0],r=e.timingInfo,i=e.cacheState;te(n)&&r!==null&&(e.timingAllowPassed||(r=D({startTime:r.startTime}),i=``),r.endTime=M(),e.timingInfo=r,Ie(r,n.href,t,globalThis,i,``,e.status))}let Ie=performance.markResourceTiming;function Le(e,t,n,r,i){if(e&&e.reject(r),t.body?.stream!=null&&_e(t.body.stream)&&t.body.stream.cancel(r).catch(e=>{if(e.code!==`ERR_INVALID_STATE`)throw e}),n==null)return;let a=s(n);a.body?.stream!=null&&_e(a.body.stream)&&i.error(r)}function Re({request:e,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseEndOfBody:i,processResponseConsumeBody:a,useParallelQueue:o=!1,dispatcher:s=Se(),requestObject:c=null}){X(s);let l=null,u=!1;e.client!=null&&(l=e.client.globalObject,u=e.client.crossOriginIsolatedCapability);let d=D({startTime:M(u)}),f={controller:new Me(s),request:e,timingInfo:d,processRequestBodyChunkLength:t,processRequestEndOfBody:n,processResponse:r,processResponseConsumeBody:a,processResponseEndOfBody:i,taskDestination:l,crossOriginIsolatedCapability:u,requestObject:c};return X(!e.body||e.body.stream),e.window===`client`&&(e.window=e.client?.globalObject?.constructor?.name===`Window`?e.client:`no-window`),e.origin===`client`&&(e.origin=e.client.origin),e.policyContainer===`client`&&(e.client==null?e.policyContainer=h():e.policyContainer=g(e.client.policyContainer)),e.headersList.contains(`accept`,!0)||e.headersList.append(`accept`,`*/*`,!0),e.headersList.contains(`accept-language`,!0)||e.headersList.append(`accept-language`,`*`,!0),e.priority,de.has(e.destination),ze(f,!1),f.controller}async function ze(e,t){try{let r=e.request,a=null;if(r.localURLsOnly&&!W(C(r))&&(a=n(`local URLs only`)),E(r),_(r)===`blocked`&&(a=n(`bad port`)),r.referrerPolicy===``&&(r.referrerPolicy=r.policyContainer.referrerPolicy),r.referrer!==`no-referrer`&&(r.referrer=j(r)),a===null){let t=C(r);N(t,r.url)&&r.responseTainting===`basic`||t.protocol===`data:`||r.mode===`navigate`||r.mode===`websocket`?(r.responseTainting=`basic`,a=await Be(e)):r.mode===`same-origin`?a=n(`request mode cannot be "same-origin"`):r.mode===`no-cors`?r.redirect===`follow`?(r.responseTainting=`opaque`,a=await Be(e)):a=n(`redirect mode cannot be "follow" for "no-cors" request`):te(C(r))?(r.responseTainting=`cors`,a=await Ue(e)):a=n(`URL scheme must be a HTTP(S) scheme`)}if(t)return a;a.status!==0&&!a.internalResponse&&(r.responseTainting,r.responseTainting===`basic`?a=i(a,`basic`):r.responseTainting===`cors`?a=i(a,`cors`):r.responseTainting===`opaque`?a=i(a,`opaque`):X(!1));let o=a.status===0?a:a.internalResponse;if(o.urlList.length===0&&o.urlList.push(...r.urlList),r.timingAllowFailed||(a.timingAllowPassed=!0),a.type===`opaque`&&o.status===206&&o.rangeRequested&&!r.headers.contains(`range`,!0)&&(a=o=n()),a.status!==0&&(r.method===`HEAD`||r.method===`CONNECT`||Z.includes(o.status))&&(o.body=null,e.controller.dump=!0),r.integrity){let t=t=>He(e,n(t));if(r.responseTainting===`opaque`||a.body==null){t(a.error);return}H(a.body,n=>{if(!Te(n,r.integrity)){t(`integrity mismatch`);return}a.body=oe(n)[0],He(e,a)},t)}else He(e,a)}catch(t){e.controller.terminate(t)}}function Be(e){if(P(e)&&e.request.redirectCount===0)return Promise.resolve(r(e));let{request:t}=e,{protocol:i}=C(t);switch(i){case`about:`:return Promise.resolve(n(`about scheme is not supported`));case`blob:`:{ke||=v(`node:buffer`).resolveObjectURL;let e=C(t);if(e.search.length!==0)return Promise.resolve(n(`NetworkError when attempting to fetch resource.`));let r=ke(e.toString());if(t.method!==`GET`||!Ce.is.Blob(r))return Promise.resolve(n(`invalid method`));let i=a(),o=r.size,s=Ee(`${o}`),c=r.type;if(t.headersList.contains(`range`,!0)){i.rangeRequested=!0;let e=re(t.headersList.get(`range`,!0),!0);if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let{rangeStartValue:a,rangeEndValue:s}=e;if(a===null)a=o-s,s=a+s-1;else{if(a>=o)return Promise.resolve(n(`Range start is greater than the blob's size.`));(s===null||s>=o)&&(s=o-1)}let l=r.slice(a,s+1,c);i.body=se(l)[0];let u=Ee(`${l.size}`),d=K(a,s,o);i.status=206,i.statusText=`Partial Content`,i.headersList.set(`content-length`,u,!0),i.headersList.set(`content-type`,c,!0),i.headersList.set(`content-range`,d,!0)}else{let e=se(r);i.statusText=`OK`,i.body=e[0],i.headersList.set(`content-length`,s,!0),i.headersList.set(`content-type`,c,!0)}return Promise.resolve(i)}case`data:`:{let e=$(C(t));if(e===`failure`)return Promise.resolve(n(`failed to fetch the data URL`));let r=be(e.mimeType);return Promise.resolve(a({statusText:`OK`,headersList:[[`content-type`,{name:`Content-Type`,value:r}]],body:oe(e.body)[0]}))}case`file:`:return Promise.resolve(n(`not implemented... yet...`));case`http:`:case`https:`:return Ue(e).catch(e=>n(e));default:return Promise.resolve(n(`unknown scheme`))}}function Ve(e,t){e.request.done=!0,e.processResponseDone!=null&&queueMicrotask(()=>e.processResponseDone(t))}function He(e,t){let n=e.timingInfo,r=()=>{let r=Date.now();e.request.destination===`document`&&(e.controller.fullTimingInfo=n),e.controller.reportTimingSteps=()=>{if(!te(e.request.url))return;n.endTime=r;let i=t.cacheState,a=t.bodyInfo;t.timingAllowPassed||(n=D(n),i=``);let o=0;if(e.request.mode!==`navigate`||!t.hasCrossOriginRedirects){o=t.status;let e=J(t.headersList);e!==`failure`&&(a.contentType=xe(e))}e.request.initiatorType!=null&&Ie(n,e.request.url.href,e.request.initiatorType,globalThis,i,a,o)};let i=()=>{e.request.done=!0,e.processResponseEndOfBody!=null&&queueMicrotask(()=>e.processResponseEndOfBody(t)),e.request.initiatorType!=null&&e.controller.reportTimingSteps()};queueMicrotask(()=>i())};e.processResponse!=null&&queueMicrotask(()=>{e.processResponse(t),e.processResponse=null});let i=t.type===`error`?t:t.internalResponse??t;i.body==null?r():he(i.body.stream,()=>{r()})}async function Ue(e){let t=e.request,r=null,i=null,a=e.timingInfo;if(t.serviceWorkers,r===null){if(t.redirect===`follow`&&(t.serviceWorkers=`none`),i=r=await Ge(e),t.responseTainting===`cors`&&k(t,r)===`failure`)return n(`cors failure`);y(t,r)===`failure`&&(t.timingAllowFailed=!0)}return(t.responseTainting===`opaque`||r.type===`opaque`)&&A(t.origin,t.client,t.destination,i)===`blocked`?n(`blocked`):(ce.has(i.status)&&(t.redirect!==`manual`&&e.controller.connection.destroy(void 0,!1),t.redirect===`error`?r=n(`unexpected redirect`):t.redirect===`manual`?r=i:t.redirect===`follow`?r=await We(e,r):X(!1)),r.timingInfo=a,r)}function We(e,t){let r=e.request,i=t.internalResponse?t.internalResponse:t,a;try{if(a=S(i,C(r).hash),a==null)return t}catch(e){return Promise.resolve(n(e))}if(!te(a))return Promise.resolve(n(`URL scheme must be a HTTP(S) scheme`));if(r.redirectCount===20)return Promise.resolve(n(`redirect count exceeded`));if(r.redirectCount+=1,r.mode===`cors`&&(a.username||a.password)&&!N(r,a))return Promise.resolve(n(`cross origin not allowed for request mode "cors"`));if(r.responseTainting===`cors`&&(a.username||a.password))return Promise.resolve(n(`URL cannot contain credentials for request mode "cors"`));if(i.status!==303&&r.body!=null&&r.body.source==null)return Promise.resolve(n());if([301,302].includes(i.status)&&r.method===`POST`||i.status===303&&!De.includes(r.method)){r.method=`GET`,r.body=null;for(let e of ue)r.headersList.delete(e)}N(C(r),a)||(r.headersList.delete(`authorization`,!0),r.headersList.delete(`proxy-authorization`,!0),r.headersList.delete(`cookie`,!0),r.headersList.delete(`host`,!0)),r.body!=null&&(X(r.body.source!=null),r.body=oe(r.body.source)[0]);let o=e.timingInfo;return o.redirectEndTime=o.postRedirectStartTime=M(e.crossOriginIsolatedCapability),o.redirectStartTime===0&&(o.redirectStartTime=o.startTime),r.urlList.push(a),T(r,i),ze(e,!0)}async function Ge(e,t=!1,i=!1){let a=e.request,o=null,s=null,c=null;a.window===`no-window`&&a.redirect===`error`?(o=e,s=a):(a.body?.source==null?(s=u({...a,body:null}),s.body=a.body):s=u(a),o={...e},o.request=s);let l=a.credentials===`include`||a.credentials===`same-origin`&&a.responseTainting===`basic`,d=s.body?s.body.length:null,f=null;if(s.body==null&&[`POST`,`PUT`].includes(s.method)&&(f=`0`),d!=null&&(f=Ee(`${d}`)),f!=null&&!s.headersList.contains(`content-length`,!0)&&s.headersList.append(`content-length`,f,!0),d!=null&&s.keepalive,Ce.is.URL(s.referrer)&&s.headersList.append(`referer`,Ee(s.referrer.href),!0),b(s),O(s),s.headersList.contains(`user-agent`,!0)||s.headersList.append(`user-agent`,Oe,!0),s.cache===`default`&&(s.headersList.contains(`if-modified-since`,!0)||s.headersList.contains(`if-none-match`,!0)||s.headersList.contains(`if-unmodified-since`,!0)||s.headersList.contains(`if-match`,!0)||s.headersList.contains(`if-range`,!0))&&(s.cache=`no-store`),s.cache===`no-cache`&&!s.preventNoCacheCacheControlHeaderModification&&!s.headersList.contains(`cache-control`,!0)&&s.headersList.append(`cache-control`,`max-age=0`,!0),(s.cache===`no-store`||s.cache===`reload`)&&(s.headersList.contains(`pragma`,!0)||s.headersList.append(`pragma`,`no-cache`,!0),s.headersList.contains(`cache-control`,!0)||s.headersList.append(`cache-control`,`no-cache`,!0)),s.headersList.contains(`range`,!0)&&s.headersList.append(`accept-encoding`,`identity`,!0),s.headersList.contains(`accept-encoding`,!0)||(ne(C(s))?s.headersList.append(`accept-encoding`,`br, gzip, deflate, zstd`,!0):s.headersList.append(`accept-encoding`,`gzip, deflate`,!0)),s.headersList.delete(`host`,!0),l&&!s.headersList.contains(`authorization`,!0)){let e=null;if(!(ie(s)&&(s.useURLCredentials===void 0||!Y(C(s))))&&Y(C(s))&&t){let{username:t,password:n}=C(s);e=`Basic ${Buffer.from(`${t}:${n}`).toString(`base64`)}`}e!==null&&s.headersList.append(`Authorization`,e,!1)}if(s.cache=`no-store`,s.cache!==`no-store`&&s.cache,c==null){if(s.cache===`only-if-cached`)return n(`only if cached`);let e=await Ke(o,l,i);!le.has(s.method)&&e.status>=200&&e.status,c??=e}if(c.urlList=[...s.urlList],s.headersList.contains(`range`,!0)&&(c.rangeRequested=!0),c.requestIncludesCredentials=l,c.status===401&&s.responseTainting!==`cors`&&l&&(a.useURLCredentials!==void 0||ae(a.traversableForUserPrompts))){if(a.body!=null){if(a.body.source==null)return c;a.body=oe(a.body.source)[0]}if(a.useURLCredentials===void 0||t)return P(e)?r(e):c;e.controller.connection.destroy(),c=await Ge(e,!0)}if(c.status===407)return a.window===`no-window`?n():P(e)?r(e):n(`proxy authentication required`);if(c.status===421&&!i&&(a.body==null||a.body.source!=null)){if(P(e))return r(e);e.controller.connection.destroy(),c=await Ge(e,t,!0)}return c}async function Ke(e,t=!1,i=!1){X(!e.controller.connection||e.controller.connection.destroyed),e.controller.connection={abort:null,destroyed:!1,destroy(e,t=!0){this.destroyed||(this.destroyed=!0,t&&this.abort?.(e??new DOMException(`The operation was aborted.`,`AbortError`)))}};let o=e.request,s=null,l=e.timingInfo;o.cache=`no-store`,o.mode;let u=null;if(o.body==null&&e.processRequestEndOfBody)queueMicrotask(()=>e.processRequestEndOfBody());else if(o.body!=null){let t=async function*(t){P(e)||(yield t,e.processRequestBodyChunkLength?.(t.byteLength))},n=()=>{P(e)||e.processRequestEndOfBody&&e.processRequestEndOfBody()},r=t=>{P(e)||(t.name===`AbortError`?e.controller.abort():e.controller.terminate(t))};u=(async function*(){try{for await(let e of o.body.stream)yield*t(e);n()}catch(e){r(e)}})()}try{let{body:t,status:n,statusText:r,headersList:i,socket:o}=await p({body:u});if(o)s=a({status:n,statusText:r,headersList:i,socket:o});else{let o=t[Symbol.asyncIterator]();e.controller.next=()=>o.next(),s=a({status:n,statusText:r,headersList:i})}}catch(t){return t.name===`AbortError`?(e.controller.connection.destroy(),r(e,t)):n(t)}let d=new ReadableStream({start(t){e.controller.controller=t},pull:()=>e.controller.resume(),cancel:t=>{P(e)||e.controller.abort(t)},type:`bytes`});s.body={stream:d,source:null,length:null},e.controller.resume||e.controller.on(`terminated`,f),e.controller.resume=async()=>{for(;;){let t,n;try{let{done:n,value:r}=await e.controller.next();if(I(e))break;t=n?void 0:r}catch(r){e.controller.ended&&!l.encodedBodySize?t=void 0:(t=r,n=!0)}if(t===void 0){U(e.controller.controller),Ve(e,s);return}if(l.decodedBodySize+=t?.byteLength??0,n){e.controller.terminate(t);return}let r=new Uint8Array(t);if(r.byteLength&&e.controller.controller.enqueue(r),ge(d)){e.controller.terminate();return}if(e.controller.controller.desiredSize<=0)return}};function f(t){I(e)?(s.aborted=!0,_e(d)&&e.controller.controller.error(e.controller.serializedAbortReason)):_e(d)&&e.controller.controller.error(TypeError(`terminated`,{cause:L(t)?t:void 0})),e.controller.connection.destroy()}return s;function p({body:t}){let n=C(o),r=e.controller.dispatcher,i=n.pathname+n.search,a=n.search.length===0&&n.href[n.href.length-n.hash.length-1]===`?`;return s(t);function s(t,u){return new Promise((d,f)=>r.dispatch({path:a?`${i}?`:i,origin:n.origin,method:o.method,body:r.isMockActive?o.body&&(o.body.source||o.body.stream):t,__mockAgentBodyForDispatch:t,headers:o.headersList.entries,maxRedirections:0,upgrade:o.mode===`websocket`?`websocket`:void 0,...u===!1?{allowH2:u}:null},{body:null,abort:null,onRequestStart(t){let{connection:n}=e.controller;l.finalConnectionTimingInfo=G(void 0,l.postRedirectStartTime,e.crossOriginIsolatedCapability);let r=e=>t.abort(e);n.destroyed?r(new DOMException(`The operation was aborted.`,`AbortError`)):(e.controller.on(`terminated`,r),this.abort=n.abort=r),l.finalNetworkRequestStartTime=M(e.crossOriginIsolatedCapability)},onResponseStarted(){l.finalNetworkResponseStartTime=M(e.crossOriginIsolatedCapability)},onResponseStart(e,t,n,r){if(t<200)return;let i=e?.rawHeaders??[],a=new c;je(a,n,i);let s=a.get(`location`,!0);this.body=new pe({read:()=>e.resume()});let l=s&&o.redirect===`follow`&&ce.has(t),u=[];if(o.method!==`HEAD`&&o.method!==`CONNECT`&&!Z.includes(t)&&!l){let e=a.get(`content-encoding`,!0),t=e?e.toLowerCase().split(`,`):[];if(t.length>5){f(Error(`too many content-encodings in response: ${t.length}, maximum allowed is 5`));return}for(let e=t.length-1;e>=0;--e){let n=t[e].trim();if(n===`x-gzip`||n===`gzip`)u.push(m.createGunzip({flush:m.constants.Z_SYNC_FLUSH,finishFlush:m.constants.Z_SYNC_FLUSH}));else if(n===`deflate`)u.push(q({flush:m.constants.Z_SYNC_FLUSH,finishFlush:m.constants.Z_SYNC_FLUSH}));else if(n===`br`)u.push(m.createBrotliDecompress({flush:m.constants.BROTLI_OPERATION_FLUSH,finishFlush:m.constants.BROTLI_OPERATION_FLUSH}));else if(n===`zstd`)u.push(m.createZstdDecompress({flush:m.constants.ZSTD_e_continue,finishFlush:m.constants.ZSTD_e_end}));else{u.length=0;break}}}let p=t=>this.onResponseError(e,t);d({status:t,statusText:r,headersList:a,body:u.length?me(this.body,...u,t=>{t&&this.onResponseError(e,t)}).on(`error`,p):this.body.on(`error`,p)})},onResponseData(t,n){if(e.controller.dump)return;let r=n;l.encodedBodySize+=r.byteLength,this.body.push(r)===!1&&t.pause()},onResponseEnd(){this.abort&&e.controller.off(`terminated`,this.abort),e.controller.ended=!0,this.body?.push(null)},onResponseError(n,r){if(this.abort&&e.controller.off(`terminated`,this.abort),o.mode===`websocket`&&u!==!1&&r?.code===`UND_ERR_INFO`&&r?.message===`HTTP/2: Extended CONNECT protocol not supported by server`){d(s(t,!1));return}this.body?.destroy(r),e.controller.terminate(r),f(r)},onRequestUpgrade(e,t,n,r){if(r.session!=null&&t!==200||r.session==null&&t!==101)return r.session!=null&&e.abort(new ye(`bad upgrade`,null)),!1;let i=e?.rawHeaders??[],a=new c;return je(a,n,i),d({status:t,statusText:we[t],headersList:a,socket:r}),!0}}))}}}t.exports={fetch:Pe,Fetch:Me,fetching:Re,finalizeAndReportTiming:Fe}})),$e=_(((e,t)=>{let n=v(`node:assert`),{URLSerializer:r}=z(),{isValidHeaderName:i}=V();function a(e,t,n=!1){return r(e,n)===r(t,n)}function o(e){n(e!==null);let t=[];for(let n of e.split(`,`))n=n.trim(),i(n)&&t.push(n);return t}t.exports={urlEquals:a,getFieldValues:o}})),et=_(((e,t)=>{let n=v(`node:assert`),{kConstruct:r}=y(),{urlEquals:i,getFieldValues:a}=$e(),{kEnumerableProperty:o,isDisturbed:s}=w(),{webidl:c}=B(),{cloneResponse:l,fromInnerResponse:u,getResponseState:d}=Ye(),{Request:f,fromInnerRequest:p,getRequestState:m}=Xe(),{fetching:h}=Qe(),{urlIsHttpHttpsScheme:g,readAllBytes:_}=V();var b=class e{#e;constructor(){arguments[0]!==r&&c.illegalConstructor(),c.util.markAsUncloneable(this),this.#e=arguments[1]}async match(t,n={}){c.brandCheck(this,e);let r=`Cache.match`;c.argumentLengthCheck(arguments,1,r),t=c.converters.RequestInfo(t),n=c.converters.CacheQueryOptions(n,r,`options`);let i=this.#i(t,n,1);if(i.length!==0)return i[0]}async matchAll(t=void 0,n={}){return c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n,`Cache.matchAll`,`options`),this.#i(t,n)}async add(t){c.brandCheck(this,e),c.argumentLengthCheck(arguments,1,`Cache.add`),t=c.converters.RequestInfo(t);let n=[t];return await this.addAll(n)}async addAll(t){c.brandCheck(this,e);let n=`Cache.addAll`;c.argumentLengthCheck(arguments,1,n);let r=[],i=[];for(let e of t){if(e===void 0)throw c.errors.conversionFailed({prefix:n,argument:`Argument 1`,types:[`undefined is not allowed`]});if(e=c.converters.RequestInfo(e),typeof e==`string`)continue;let t=m(e);if(!g(t.url)||t.method!==`GET`)throw c.errors.exception({header:n,message:`Expected http/s scheme when method is not GET.`})}let o=[];for(let e of t){let t=m(new f(e));if(!g(t.url))throw c.errors.exception({header:n,message:`Expected http/s scheme.`});t.initiator=`fetch`,t.destination=`subresource`,i.push(t);let s=Promise.withResolvers();o.push(h({request:t,processResponse(e){if(e.type===`error`||e.status===206||e.status<200||e.status>299)s.reject(c.errors.exception({header:`Cache.addAll`,message:`Received an invalid status code or the request failed.`}));else if(e.headersList.contains(`vary`)){let t=a(e.headersList.get(`vary`));for(let e of t)if(e===`*`){s.reject(c.errors.exception({header:`Cache.addAll`,message:`invalid vary field value`}));for(let e of o)e.abort();return}}},processResponseEndOfBody(e){if(e.aborted){s.reject(new DOMException(`aborted`,`AbortError`));return}s.resolve(e)}})),r.push(s.promise)}let s=await Promise.all(r),l=[],u=0;for(let e of s){let t={type:`put`,request:i[u],response:e};l.push(t),u++}let d=Promise.withResolvers(),p=null;try{this.#t(l)}catch(e){p=e}return queueMicrotask(()=>{p===null?d.resolve(void 0):d.reject(p)}),d.promise}async put(t,n){c.brandCheck(this,e);let r=`Cache.put`;c.argumentLengthCheck(arguments,2,r),t=c.converters.RequestInfo(t),n=c.converters.Response(n,r,`response`);let i=null;if(i=c.is.Request(t)?m(t):m(new f(t)),!g(i.url)||i.method!==`GET`)throw c.errors.exception({header:r,message:`Expected an http/s scheme when method is not GET`});let o=d(n);if(o.status===206)throw c.errors.exception({header:r,message:`Got 206 status`});if(o.headersList.contains(`vary`)){let e=a(o.headersList.get(`vary`));for(let t of e)if(t===`*`)throw c.errors.exception({header:r,message:`Got * vary field value`})}if(o.body&&(s(o.body.stream)||o.body.stream.locked))throw c.errors.exception({header:r,message:`Response body is locked or disturbed`});let u=l(o),p=Promise.withResolvers();o.body==null?p.resolve(void 0):_(o.body.stream.getReader(),p.resolve,p.reject);let h=[],v={type:`put`,request:i,response:u};h.push(v);let y=await p.promise;u.body!=null&&(u.body.source=y);let b=Promise.withResolvers(),x=null;try{this.#t(h)}catch(e){x=e}return queueMicrotask(()=>{x===null?b.resolve():b.reject(x)}),b.promise}async delete(t,r={}){c.brandCheck(this,e);let i=`Cache.delete`;c.argumentLengthCheck(arguments,1,i),t=c.converters.RequestInfo(t),r=c.converters.CacheQueryOptions(r,i,`options`);let a=null;if(c.is.Request(t)){if(a=m(t),a.method!==`GET`&&!r.ignoreMethod)return!1}else n(typeof t==`string`),a=m(new f(t));let o=[],s={type:`delete`,request:a,options:r};o.push(s);let l=Promise.withResolvers(),u=null,d;try{d=this.#t(o)}catch(e){u=e}return queueMicrotask(()=>{u===null?l.resolve(!!d?.length):l.reject(u)}),l.promise}async keys(t=void 0,n={}){c.brandCheck(this,e),t!==void 0&&(t=c.converters.RequestInfo(t)),n=c.converters.CacheQueryOptions(n,`Cache.keys`,`options`);let r=null;if(t!==void 0)if(c.is.Request(t)){if(r=m(t),r.method!==`GET`&&!n.ignoreMethod)return[]}else typeof t==`string`&&(r=m(new f(t)));let i=Promise.withResolvers(),a=[];if(t===void 0)for(let e of this.#e)a.push(e[0]);else{let e=this.#n(r,n);for(let t of e)a.push(t[0])}return queueMicrotask(()=>{let e=[];for(let t of a){let n=p(t,void 0,new AbortController().signal,`immutable`);e.push(n)}i.resolve(Object.freeze(e))}),i.promise}#t(e){let t=this.#e,r=[...t],i=[],a=[];try{for(let r of e){if(r.type!==`delete`&&r.type!==`put`)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`operation type does not match "delete" or "put"`});if(r.type===`delete`&&r.response!=null)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`delete operation should not have an associated response`});if(this.#n(r.request,r.options,i).length)throw new DOMException(`???`,`InvalidStateError`);let e;if(r.type===`delete`){if(e=this.#n(r.request,r.options),e.length===0)return[];for(let r of e){let e=t.indexOf(r);n(e!==-1),t.splice(e,1)}}else if(r.type===`put`){if(r.response==null)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`put operation should have an associated response`});let a=r.request;if(!g(a.url))throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`expected http or https scheme`});if(a.method!==`GET`)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`not get method`});if(r.options!=null)throw c.errors.exception({header:`Cache.#batchCacheOperations`,message:`options must not be defined`});e=this.#n(r.request);for(let r of e){let e=t.indexOf(r);n(e!==-1),t.splice(e,1)}t.push([r.request,r.response]),i.push([r.request,r.response])}a.push([r.request,r.response])}return a}catch(e){throw this.#e.length=0,this.#e=r,e}}#n(e,t,n){let r=[],i=n??this.#e;for(let n of i){let[i,a]=n;this.#r(e,i,a,t)&&r.push(n)}return r}#r(e,t,n=null,r){let o=new URL(e.url),s=new URL(t.url);if(r?.ignoreSearch&&(s.search=``,o.search=``),!i(o,s,!0))return!1;if(n==null||r?.ignoreVary||!n.headersList.contains(`vary`))return!0;let c=a(n.headersList.get(`vary`));for(let n of c)if(n===`*`||t.headersList.get(n)!==e.headersList.get(n))return!1;return!0}#i(e,t,n=1/0){let r=null;if(e!==void 0)if(c.is.Request(e)){if(r=m(e),r.method!==`GET`&&!t.ignoreMethod)return[]}else typeof e==`string`&&(r=m(new f(e)));let i=[];if(e===void 0)for(let e of this.#e)i.push(e[1]);else{let e=this.#n(r,t);for(let t of e)i.push(t[1])}let a=[];for(let e of i){let t=u(l(e),`immutable`);if(a.push(t),a.length>=n)break}return Object.freeze(a)}};Object.defineProperties(b.prototype,{[Symbol.toStringTag]:{value:`Cache`,configurable:!0},match:o,matchAll:o,add:o,addAll:o,put:o,delete:o,keys:o});let x=[{key:`ignoreSearch`,converter:c.converters.boolean,defaultValue:()=>!1},{key:`ignoreMethod`,converter:c.converters.boolean,defaultValue:()=>!1},{key:`ignoreVary`,converter:c.converters.boolean,defaultValue:()=>!1}];c.converters.CacheQueryOptions=c.dictionaryConverter(x),c.converters.MultiCacheQueryOptions=c.dictionaryConverter([...x,{key:`cacheName`,converter:c.converters.DOMString}]),c.converters.Response=c.interfaceConverter(c.is.Response,`Response`),c.converters[`sequence<RequestInfo>`]=c.sequenceConverter(c.converters.RequestInfo),t.exports={Cache:b}})),tt=_(((e,t)=>{let{Cache:n}=et(),{webidl:r}=B(),{kEnumerableProperty:i}=w(),{kConstruct:a}=y();var o=class e{#e=new Map;constructor(){arguments[0]!==a&&r.illegalConstructor(),r.util.markAsUncloneable(this)}async match(t,i={}){if(r.brandCheck(this,e),r.argumentLengthCheck(arguments,1,`CacheStorage.match`),t=r.converters.RequestInfo(t),i=r.converters.MultiCacheQueryOptions(i),i.cacheName!=null){if(this.#e.has(i.cacheName))return await new n(a,this.#e.get(i.cacheName)).match(t,i)}else for(let e of this.#e.values()){let r=await new n(a,e).match(t,i);if(r!==void 0)return r}}async has(t){r.brandCheck(this,e);let n=`CacheStorage.has`;return r.argumentLengthCheck(arguments,1,n),t=r.converters.DOMString(t,n,`cacheName`),this.#e.has(t)}async open(t){r.brandCheck(this,e);let i=`CacheStorage.open`;if(r.argumentLengthCheck(arguments,1,i),t=r.converters.DOMString(t,i,`cacheName`),this.#e.has(t))return new n(a,this.#e.get(t));let o=[];return this.#e.set(t,o),new n(a,o)}async delete(t){r.brandCheck(this,e);let n=`CacheStorage.delete`;return r.argumentLengthCheck(arguments,1,n),t=r.converters.DOMString(t,n,`cacheName`),this.#e.delete(t)}async keys(){return r.brandCheck(this,e),[...this.#e.keys()]}};Object.defineProperties(o.prototype,{[Symbol.toStringTag]:{value:`CacheStorage`,configurable:!0},match:i,has:i,open:i,delete:i,keys:i}),t.exports={CacheStorage:o}})),nt=_(((e,t)=>{t.exports={maxAttributeValueSize:1024,maxNameValuePairSize:4096}})),rt=_(((e,t)=>{function n(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n>=0&&n<=8||n>=10&&n<=31||n===127)return!0}return!1}function r(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===60||n===62||n===64||n===44||n===59||n===58||n===92||n===47||n===91||n===93||n===63||n===61||n===123||n===125)throw Error(`Invalid cookie name`)}}function i(e){let t=e.length,n=0;if(e[0]===`"`){if(t===1||e[t-1]!==`"`)throw Error(`Invalid cookie value`);--t,++n}for(;n<t;){let t=e.charCodeAt(n++);if(t<33||t>126||t===34||t===44||t===59||t===92)throw Error(`Invalid cookie value`)}}function a(e){for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<32||n>126||n===59)throw Error(`Invalid cookie path`)}}function o(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function s(e){if(e===` `)return;if(e.length>255)throw Error(`Invalid cookie domain`);let t=0;for(let n=0;n<e.length;++n){let r=e.charCodeAt(n);if(r===46){if(t===0||e.charCodeAt(n-1)===45)throw Error(`Invalid cookie domain`);t=0;continue}if(t===0&&!o(r)||!o(r)&&r!==45||++t>63)throw Error(`Invalid cookie domain`)}if(t===0||e.charCodeAt(e.length-1)===45)throw Error(`Invalid cookie domain`)}let c=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],l=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],u=Array(61).fill(0).map((e,t)=>t.toString().padStart(2,`0`));function d(e){return typeof e==`number`&&(e=new Date(e)),`${c[e.getUTCDay()]}, ${u[e.getUTCDate()]} ${l[e.getUTCMonth()]} ${e.getUTCFullYear()} ${u[e.getUTCHours()]}:${u[e.getUTCMinutes()]}:${u[e.getUTCSeconds()]} GMT`}function f(e){if(e<0)throw Error(`Invalid cookie max-age`)}function p(e){if(e.name.length===0)return null;r(e.name),i(e.value);let t=[`${e.name}=${e.value}`];e.name.startsWith(`__Secure-`)&&(e.secure=!0),e.name.startsWith(`__Host-`)&&(e.secure=!0,e.domain=null,e.path=`/`),e.secure&&t.push(`Secure`),e.httpOnly&&t.push(`HttpOnly`),typeof e.maxAge==`number`&&(f(e.maxAge),t.push(`Max-Age=${e.maxAge}`)),e.domain&&(s(e.domain),t.push(`Domain=${e.domain}`)),e.path&&(a(e.path),t.push(`Path=${e.path}`)),e.expires&&e.expires.toString()!==`Invalid Date`&&t.push(`Expires=${d(e.expires)}`),e.sameSite&&t.push(`SameSite=${e.sameSite}`);for(let n of e.unparsed){if(!n.includes(`=`))throw Error(`Invalid unparsed`);let[e,...a]=n.split(`=`),o=e.trim(),s=a.join(`=`);r(o),i(s),t.push(`${o}=${s}`)}return t.join(`; `)}t.exports={isCTLExcludingHtab:n,validateCookieName:r,validateCookiePath:a,validateCookieValue:i,toIMFDate:d,stringify:p}})),it=_(((e,t)=>{let{collectASequenceOfCodePointsFast:n}=R(),{maxNameValuePairSize:r,maxAttributeValueSize:i}=nt(),{isCTLExcludingHtab:a}=rt(),o=v(`node:assert`);function s(e){if(a(e))return null;let t=``,i=``,o=``,s=``;if(e.includes(`;`)){let r={position:0};t=n(`;`,e,r),i=e.slice(r.position)}else t=e;if(!t.includes(`=`))s=t;else{let e={position:0};o=n(`=`,t,e),s=t.slice(e.position+1)}return o=o.trim(),s=s.trim(),o.length+s.length>r?null:{name:o,value:s,...c(i)}}function c(e,t={}){for(;;){if(e.length===0)return t;o(e[0]===`;`),e=e.slice(1);let r=``;e.includes(`;`)?(r=n(`;`,e,{position:0}),e=e.slice(r.length)):(r=e,e=``);let a=``,s=``;if(r.includes(`=`)){let e={position:0};a=n(`=`,r,e),s=r.slice(e.position+1)}else a=r;if(a=a.trim(),s=s.trim(),s.length>i)continue;let c=a.toLowerCase();if(c===`expires`){let e=new Date(s);Number.isNaN(e.getTime())||(t.expires=e)}else if(c===`max-age`){let e=s.charCodeAt(0),n=e>=48&&e<=57,r=s[0]===`-`&&s.length>1;if(!n&&!r||/[^\d]/.test(s.slice(1)))continue;t.maxAge=Number(s)}else if(c===`domain`){let e=s;e[0]===`.`&&(e=e.slice(1)),e=e.toLowerCase(),t.domain=e}else if(c===`path`){let e=``;e=s.length===0||s[0]!==`/`?`/`:s,t.path=e}else if(c===`secure`)t.secure=!0;else if(c===`httponly`)t.httpOnly=!0;else if(c===`samesite`){let e=s.toLowerCase();e===`none`?t.sameSite=`None`:e===`strict`?t.sameSite=`Strict`:e===`lax`&&(t.sameSite=`Lax`)}else t.unparsed??=[],t.unparsed.push(`${a}=${s}`)}}t.exports={parseSetCookie:s,parseUnparsedAttributes:c}})),at=_(((e,t)=>{let{parseSetCookie:n}=it(),{stringify:r}=rt(),{webidl:i}=B(),{Headers:a}=Je(),o=i.brandCheckMultiple([a,globalThis.Headers].filter(Boolean));function s(e){i.argumentLengthCheck(arguments,1,`getCookies`),o(e);let t=e.get(`cookie`),n={};if(!t)return n;for(let e of t.split(`;`)){let[t,...r]=e.split(`=`);n[t.trim()]=r.join(`=`)}return n}function c(e,t,n){o(e);let r=`deleteCookie`;i.argumentLengthCheck(arguments,2,r),t=i.converters.DOMString(t,r,`name`),n=i.converters.DeleteCookieAttributes(n),d(e,{name:t,value:``,expires:new Date(0),...n})}function l(e){i.argumentLengthCheck(arguments,1,`getSetCookies`),o(e);let t=e.getSetCookie();return t?t.map(e=>n(e)):[]}function u(e){return e=i.converters.DOMString(e),n(e)}function d(e,t){i.argumentLengthCheck(arguments,2,`setCookie`),o(e),t=i.converters.Cookie(t);let n=r(t);n&&e.append(`set-cookie`,n,!0)}i.converters.DeleteCookieAttributes=i.dictionaryConverter([{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null}]),i.converters.Cookie=i.dictionaryConverter([{converter:i.converters.DOMString,key:`name`},{converter:i.converters.DOMString,key:`value`},{converter:i.nullableConverter(e=>typeof e==`number`?i.converters[`unsigned long long`](e):new Date(e)),key:`expires`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters[`long long`]),key:`maxAge`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`domain`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.DOMString),key:`path`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`secure`,defaultValue:()=>null},{converter:i.nullableConverter(i.converters.boolean),key:`httpOnly`,defaultValue:()=>null},{converter:i.converters.USVString,key:`sameSite`,allowedValues:[`Strict`,`Lax`,`None`]},{converter:i.sequenceConverter(i.converters.DOMString),key:`unparsed`,defaultValue:()=>[]}]),t.exports={getCookies:s,deleteCookie:c,getSetCookies:l,setCookie:d,parseCookie:u}})),ot=_(((e,t)=>{let{webidl:n}=B(),{kEnumerableProperty:r}=w(),{kConstruct:i}=y();var a=class e extends Event{#e;constructor(e,t={}){if(e===i){super(arguments[1],arguments[2]),n.util.markAsUncloneable(this);return}let r=`MessageEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.MessageEventInit(t,r,`eventInitDict`),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get data(){return n.brandCheck(this,e),this.#e.data}get origin(){return n.brandCheck(this,e),this.#e.origin}get lastEventId(){return n.brandCheck(this,e),this.#e.lastEventId}get source(){return n.brandCheck(this,e),this.#e.source}get ports(){return n.brandCheck(this,e),Object.isFrozen(this.#e.ports)||Object.freeze(this.#e.ports),this.#e.ports}initMessageEvent(t,r=!1,i=!1,a=null,o=``,s=``,c=null,l=[]){return n.brandCheck(this,e),n.argumentLengthCheck(arguments,1,`MessageEvent.initMessageEvent`),new e(t,{bubbles:r,cancelable:i,data:a,origin:o,lastEventId:s,source:c,ports:l})}static createFastMessageEvent(t,n){let r=new e(i,t,n);return r.#e=n,r.#e.data??=null,r.#e.origin??=``,r.#e.lastEventId??=``,r.#e.source??=null,r.#e.ports??=[],r}};let{createFastMessageEvent:o}=a;delete a.createFastMessageEvent;var s=class e extends Event{#e;constructor(e,t={}){let r=`CloseEvent constructor`;n.argumentLengthCheck(arguments,1,r),e=n.converters.DOMString(e,r,`type`),t=n.converters.CloseEventInit(t),super(e,t),this.#e=t,n.util.markAsUncloneable(this)}get wasClean(){return n.brandCheck(this,e),this.#e.wasClean}get code(){return n.brandCheck(this,e),this.#e.code}get reason(){return n.brandCheck(this,e),this.#e.reason}},c=class e extends Event{#e;constructor(e,t){let r=`ErrorEvent constructor`;n.argumentLengthCheck(arguments,1,r),super(e,t),n.util.markAsUncloneable(this),e=n.converters.DOMString(e,r,`type`),t=n.converters.ErrorEventInit(t??{}),this.#e=t}get message(){return n.brandCheck(this,e),this.#e.message}get filename(){return n.brandCheck(this,e),this.#e.filename}get lineno(){return n.brandCheck(this,e),this.#e.lineno}get colno(){return n.brandCheck(this,e),this.#e.colno}get error(){return n.brandCheck(this,e),this.#e.error}};Object.defineProperties(a.prototype,{[Symbol.toStringTag]:{value:`MessageEvent`,configurable:!0},data:r,origin:r,lastEventId:r,source:r,ports:r,initMessageEvent:r}),Object.defineProperties(s.prototype,{[Symbol.toStringTag]:{value:`CloseEvent`,configurable:!0},reason:r,code:r,wasClean:r}),Object.defineProperties(c.prototype,{[Symbol.toStringTag]:{value:`ErrorEvent`,configurable:!0},message:r,filename:r,lineno:r,colno:r,error:r}),n.converters.MessagePort=n.interfaceConverter(n.is.MessagePort,`MessagePort`),n.converters[`sequence<MessagePort>`]=n.sequenceConverter(n.converters.MessagePort);let l=[{key:`bubbles`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`cancelable`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`composed`,converter:n.converters.boolean,defaultValue:()=>!1}];n.converters.MessageEventInit=n.dictionaryConverter([...l,{key:`data`,converter:n.converters.any,defaultValue:()=>null},{key:`origin`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lastEventId`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`source`,converter:n.nullableConverter(n.converters.MessagePort),defaultValue:()=>null},{key:`ports`,converter:n.converters[`sequence<MessagePort>`],defaultValue:()=>[]}]),n.converters.CloseEventInit=n.dictionaryConverter([...l,{key:`wasClean`,converter:n.converters.boolean,defaultValue:()=>!1},{key:`code`,converter:n.converters[`unsigned short`],defaultValue:()=>0},{key:`reason`,converter:n.converters.USVString,defaultValue:()=>``}]),n.converters.ErrorEventInit=n.dictionaryConverter([...l,{key:`message`,converter:n.converters.DOMString,defaultValue:()=>``},{key:`filename`,converter:n.converters.USVString,defaultValue:()=>``},{key:`lineno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`colno`,converter:n.converters[`unsigned long`],defaultValue:()=>0},{key:`error`,converter:n.converters.any}]),t.exports={MessageEvent:a,CloseEvent:s,ErrorEvent:c,createFastMessageEvent:o}})),st=_(((e,t)=>{t.exports={uid:`258EAFA5-E914-47DA-95CA-C5AB0DC85B11`,sentCloseFrameState:{SENT:1,RECEIVED:2},staticPropertyDescriptors:{enumerable:!0,writable:!1,configurable:!1},states:{CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3},opcodes:{CONTINUATION:0,TEXT:1,BINARY:2,CLOSE:8,PING:9,PONG:10},maxUnsigned16Bit:65535,parserStates:{INFO:0,PAYLOADLENGTH_16:2,PAYLOADLENGTH_64:3,READ_DATA:4},emptyBuffer:Buffer.allocUnsafe(0),sendHints:{text:1,typedArray:2,arrayBuffer:3,blob:4}}})),ct=_(((e,t)=>{let{states:n,opcodes:r}=st(),{isUtf8:i}=v(`node:buffer`),{removeHTTPWhitespace:a}=z(),{collectASequenceOfCodePointsFast:o}=R();function s(e){return e===n.CONNECTING}function c(e){return e===n.OPEN}function l(e){return e===n.CLOSING}function u(e){return e===n.CLOSED}function d(e,t,n=(e,t)=>new Event(e,t),r={}){let i=n(e,r);t.dispatchEvent(i)}function f(e,t,n){e.onMessage(t,n)}function p(e){return e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function m(e){if(e.length===0)return!1;for(let t=0;t<e.length;++t){let n=e.charCodeAt(t);if(n<33||n>126||n===34||n===40||n===41||n===44||n===47||n===58||n===59||n===60||n===61||n===62||n===63||n===64||n===91||n===92||n===93||n===123||n===125)return!1}return!0}function h(e){return e>=1e3&&e<1015?e!==1004&&e!==1005&&e!==1006:e>=3e3&&e<=4999}function g(e){return e===r.CLOSE||e===r.PING||e===r.PONG}function _(e){return e===r.CONTINUATION}function y(e){return e===r.TEXT||e===r.BINARY}function b(e){return y(e)||_(e)||g(e)}function x(e){let t={position:0},n=new Map;for(;t.position<e.length;){let[r,i=``]=o(`;`,e,t).split(`=`,2);n.set(a(r,!0,!1),a(i,!1,!0)),t.position++}return n}function S(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}let t=Number.parseInt(e,10);return t>=8&&t<=15}function C(e,t){let n;try{n=new URL(e,t)}catch(e){throw new DOMException(e,`SyntaxError`)}if(n.protocol===`http:`?n.protocol=`ws:`:n.protocol===`https:`&&(n.protocol=`wss:`),n.protocol!==`ws:`&&n.protocol!==`wss:`)throw new DOMException(`expected a ws: or wss: url`,`SyntaxError`);if(n.hash.length||n.href.endsWith(`#`))throw new DOMException(`hash`,`SyntaxError`);return n}function w(e,t){if(e!==null&&e!==1e3&&(e<3e3||e>4999))throw new DOMException(`invalid code`,`InvalidAccessError`);if(t!==null){let e=Buffer.byteLength(t);if(e>123)throw new DOMException(`Reason must be less than 123 bytes; received ${e}`,`SyntaxError`)}}t.exports={isConnecting:s,isEstablished:c,isClosing:l,isClosed:u,fireEvent:d,isValidSubprotocol:m,isValidStatusCode:h,websocketMessageReceived:f,utf8Decode:(()=>{if(typeof process.versions.icu==`string`){let e=new TextDecoder(`utf-8`,{fatal:!0});return e.decode.bind(e)}return function(e){if(i(e))return e.toString(`utf-8`);throw TypeError(`Invalid utf-8 received.`)}})(),isControlFrame:g,isContinuationFrame:_,isTextBinaryFrame:y,isValidOpcode:b,parseExtensions:x,isValidClientWindowBits:S,toArrayBuffer:p,getURLRecord:C,validateCloseCodeAndReason:w}})),lt=_(((e,t)=>{let{runtimeFeatures:n}=H(),{maxUnsigned16Bit:r,opcodes:i}=st(),a=8*1024,o=null,s=a,c=n.has(`crypto`)?v(`node:crypto`).randomFillSync:null;function l(){return s===a&&(s=0,c(o??=Buffer.allocUnsafeSlow(a),0,a)),[o[s++],o[s++],o[s++],o[s++]]}t.exports={WebsocketFrameSend:class{constructor(e){this.frameData=e}createFrame(e){let t=this.frameData,n=l(),i=t?.byteLength??0,a=i,o=6;i>r?(o+=8,a=127):i>125&&(o+=2,a=126);let s=Buffer.allocUnsafe(i+o);s[0]=s[1]=0,s[0]|=128,s[0]=(s[0]&240)+e,s[o-4]=n[0],s[o-3]=n[1],s[o-2]=n[2],s[o-1]=n[3],s[1]=a,a===126?s.writeUInt16BE(i,2):a===127&&(s[2]=s[3]=0,s.writeUIntBE(i,4,6)),s[1]|=128;for(let e=0;e<i;++e)s[o+e]=t[e]^n[e&3];return s}static createFastTextFrame(e){let t=l(),n=e.length;for(let r=0;r<n;++r)e[r]^=t[r&3];let a=n,o=6;n>r?(o+=8,a=127):n>125&&(o+=2,a=126);let s=Buffer.allocUnsafeSlow(o);return s[0]=128|i.TEXT,s[1]=a|128,s[o-4]=t[0],s[o-3]=t[1],s[o-2]=t[2],s[o-1]=t[3],a===126?s.writeUInt16BE(n,2):a===127&&(s[2]=s[3]=0,s.writeUIntBE(n,4,6)),[s,e]}},generateMask:l}})),ut=_(((e,t)=>{let{uid:n,states:r,sentCloseFrameState:i,emptyBuffer:a,opcodes:o}=st(),{parseExtensions:s,isClosed:c,isClosing:l,isEstablished:u,isConnecting:d,validateCloseCodeAndReason:f}=ct(),{makeRequest:p}=Xe(),{fetching:m}=Qe(),{Headers:h,getHeadersList:g}=Je(),{getDecodeSplit:_}=V(),{WebsocketFrameSend:y}=lt(),b=v(`node:assert`),{runtimeFeatures:x}=H(),S=x.has(`crypto`)?v(`node:crypto`):null,C=!1;function w(e,t,r,i,a){let o=e;o.protocol=e.protocol===`ws:`?`http:`:`https:`;let c=p({urlList:[o],client:r,serviceWorkers:`none`,referrer:`no-referrer`,mode:`websocket`,credentials:`include`,cache:`no-store`,redirect:`error`,useURLCredentials:!0});a.headers&&(c.headersList=g(new h(a.headers)));let l=S.randomBytes(16).toString(`base64`);c.headersList.append(`sec-websocket-key`,l,!0),c.headersList.append(`sec-websocket-version`,`13`,!0);for(let e of t)c.headersList.append(`sec-websocket-protocol`,e,!0);return c.headersList.append(`sec-websocket-extensions`,`permessage-deflate; client_max_window_bits`,!0),m({request:c,useParallelQueue:!0,dispatcher:a.dispatcher,processResponse(e){if(e.type===`error`||e.status!==101){if(e.socket?.session==null){E(i,1002,`Received network error or non-101 status code.`,e.error);return}if(e.status!==200){E(i,1002,`Received network error or non-200 status code.`,e.error);return}}if(C===!1&&e.socket?.session!=null&&(process.emitWarning(`WebSocket over HTTP2 is experimental, and subject to change.`,`ExperimentalWarning`),C=!0),t.length!==0&&!e.headersList.get(`Sec-WebSocket-Protocol`)){E(i,1002,`Server did not respond with sent protocols.`);return}if(e.socket.session==null&&e.headersList.get(`Upgrade`)?.toLowerCase()!==`websocket`){E(i,1002,`Server did not set Upgrade header to "websocket".`);return}if(e.socket.session==null&&e.headersList.get(`Connection`)?.toLowerCase()!==`upgrade`){E(i,1002,`Server did not set Connection header to "upgrade".`);return}if(e.headersList.get(`Sec-WebSocket-Accept`)!==S.hash(`sha1`,l+n,`base64`)){E(i,1002,`Incorrect hash received in Sec-WebSocket-Accept header.`);return}let r=e.headersList.get(`Sec-WebSocket-Extensions`),a;if(r!==null&&(a=s(r),!a.has(`permessage-deflate`))){E(i,1002,`Sec-WebSocket-Extensions header does not match.`);return}let o=e.headersList.get(`Sec-WebSocket-Protocol`);if(o!==null){let e=_(`sec-websocket-protocol`,c.headersList);if(e===null||!e.includes(o)){E(i,1002,`Protocol was not set in the opening handshake.`);return}}e.socket.on(`data`,i.onSocketData),e.socket.on(`close`,i.onSocketClose),e.socket.on(`error`,i.onSocketError),i.wasEverConnected=!0,i.onConnectionEstablished(e,a)}})}function T(e,t,n,s=!1){if(t??=null,n??=``,s&&f(t,n),!(c(e.readyState)||l(e.readyState)))if(!u(e.readyState))E(e),e.readyState=r.CLOSING;else if(!e.closeState.has(i.SENT)&&!e.closeState.has(i.RECEIVED)){let s=new y;n.length!==0&&t===null&&(t=1e3),b(t===null||Number.isInteger(t)),t===null&&n.length===0?s.frameData=a:t!==null&&n===null?(s.frameData=Buffer.allocUnsafe(2),s.frameData.writeUInt16BE(t,0)):t!==null&&n!==null?(s.frameData=Buffer.allocUnsafe(2+Buffer.byteLength(n)),s.frameData.writeUInt16BE(t,0),s.frameData.write(n,2,`utf-8`)):s.frameData=a,e.socket.write(s.createFrame(o.CLOSE)),e.closeState.add(i.SENT),e.readyState=r.CLOSING}else e.readyState=r.CLOSING}function E(e,t,n,r){u(e.readyState)&&T(e,t,n,!1),e.controller.abort(),d(e.readyState)?e.onSocketClose():e.socket?.destroyed===!1&&e.socket.destroy()}t.exports={establishWebSocketConnection:w,failWebsocketConnection:E,closeWebSocketConnection:T}})),dt=_(((e,t)=>{let{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:r}=v(`node:zlib`),{isValidClientWindowBits:i}=ct(),{MessageSizeExceededError:a}=x(),o=Buffer.from([0,0,255,255]),s=Symbol(`kBuffer`),c=Symbol(`kLength`);t.exports={PerMessageDeflate:class{#e;#t={};#n=0;constructor(e,t){this.#t.serverNoContextTakeover=e.has(`server_no_context_takeover`),this.#t.serverMaxWindowBits=e.get(`server_max_window_bits`),this.#n=t.maxPayloadSize}decompress(e,t,l){if(!this.#e){let e=r;if(this.#t.serverMaxWindowBits){if(!i(this.#t.serverMaxWindowBits)){l(Error(`Invalid server_max_window_bits`));return}e=Number.parseInt(this.#t.serverMaxWindowBits)}try{this.#e=n({windowBits:e})}catch(e){l(e);return}this.#e[s]=[],this.#e[c]=0,this.#e.on(`data`,e=>{if(this.#e[c]+=e.length,this.#n>0&&this.#e[c]>this.#n){l(new a),this.#e.removeAllListeners(),this.#e.destroy(),this.#e=null;return}this.#e[s].push(e)}),this.#e.on(`error`,e=>{this.#e=null,l(e)})}this.#e.write(e),t&&this.#e.write(o),this.#e.flush(()=>{if(!this.#e)return;let e=Buffer.concat(this.#e[s],this.#e[c]);this.#e[s].length=0,this.#e[c]=0,l(null,e)})}}}})),ft=_(((e,t)=>{let{Writable:n}=v(`node:stream`),r=v(`node:assert`),{parserStates:i,opcodes:a,states:o,emptyBuffer:s,sentCloseFrameState:c}=st(),{isValidStatusCode:l,isValidOpcode:u,websocketMessageReceived:d,utf8Decode:f,isControlFrame:p,isTextBinaryFrame:m,isContinuationFrame:h}=ct(),{failWebsocketConnection:g}=ut(),{WebsocketFrameSend:_}=lt(),{PerMessageDeflate:y}=dt(),{MessageSizeExceededError:b}=x();t.exports={ByteParser:class extends n{#e=[];#t=0;#n=0;#r=!1;#i=i.INFO;#a={};#o=[];#s;#c;#l;#u;constructor(e,t,n={}){super(),this.#c=e,this.#s=t??new Map,this.#l=n.maxFragments??0,this.#u=n.maxPayloadSize??0,this.#s.has(`permessage-deflate`)&&this.#s.set(`permessage-deflate`,new y(t,n))}_write(e,t,n){this.#e.push(e),this.#n+=e.length,this.#r=!0,this.run(n)}#d(){return this.#u>0&&!p(this.#a.opcode)&&this.#a.payloadLength+this.#t>this.#u?(g(this.#c,1009,`Payload size exceeds maximum allowed size`),!1):!0}run(e){for(;this.#r;)if(this.#i===i.INFO){if(this.#n<2)return e();let t=this.consume(2),n=(t[0]&128)!=0,r=t[0]&15,o=(t[1]&128)==128,s=!n&&r!==a.CONTINUATION,c=t[1]&127,l=t[0]&64,d=t[0]&32,f=t[0]&16;if(!u(r))return g(this.#c,1002,`Invalid opcode received`),e();if(o)return g(this.#c,1002,`Frame cannot be masked`),e();if(l!==0&&!this.#s.has(`permessage-deflate`)){g(this.#c,1002,`Expected RSV1 to be clear.`);return}if(d!==0||f!==0){g(this.#c,1002,`RSV1, RSV2, RSV3 must be clear`);return}if(s&&!m(r)){g(this.#c,1002,`Invalid frame type was fragmented.`);return}if(m(r)&&this.#o.length>0){g(this.#c,1002,`Expected continuation frame`);return}if(this.#a.fragmented&&s){g(this.#c,1002,`Fragmented frame exceeded 125 bytes.`);return}if((c>125||s)&&p(r)){g(this.#c,1002,`Control frame either too large or fragmented`);return}if(h(r)&&this.#o.length===0&&!this.#a.compressed){g(this.#c,1002,`Unexpected continuation frame`);return}if(c<=125){if(this.#a.payloadLength=c,this.#i=i.READ_DATA,!this.#d())return}else c===126?this.#i=i.PAYLOADLENGTH_16:c===127&&(this.#i=i.PAYLOADLENGTH_64);m(r)&&(this.#a.binaryType=r,this.#a.compressed=l!==0),this.#a.opcode=r,this.#a.masked=o,this.#a.fin=n,this.#a.fragmented=s}else if(this.#i===i.PAYLOADLENGTH_16){if(this.#n<2)return e();let t=this.consume(2);if(this.#a.payloadLength=t.readUInt16BE(0),this.#i=i.READ_DATA,!this.#d())return}else if(this.#i===i.PAYLOADLENGTH_64){if(this.#n<8)return e();let t=this.consume(8),n=t.readUInt32BE(0),r=t.readUInt32BE(4);if(n!==0||r>2**31-1){g(this.#c,1009,`Received payload length > 2^31 bytes.`);return}if(this.#a.payloadLength=r,this.#i=i.READ_DATA,!this.#d())return}else if(this.#i===i.READ_DATA){if(this.#n<this.#a.payloadLength)return e();let t=this.consume(this.#a.payloadLength);if(p(this.#a.opcode))this.#r=this.parseControlFrame(t),this.#i=i.INFO;else if(this.#a.compressed){this.#s.get(`permessage-deflate`).decompress(t,this.#a.fin,(t,n)=>{if(t){let e=t instanceof b?1009:1007;g(this.#c,e,t.message);return}if(this.writeFragments(n)){if(this.#u>0&&this.#t>this.#u){g(this.#c,1009,new b().message);return}if(!this.#a.fin){this.#i=i.INFO,this.#r=!0,this.run(e);return}d(this.#c,this.#a.binaryType,this.consumeFragments()),this.#r=!0,this.#i=i.INFO,this.run(e)}},this.#t),this.#r=!1;break}else{if(!this.writeFragments(t))return;!this.#a.fragmented&&this.#a.fin&&d(this.#c,this.#a.binaryType,this.consumeFragments()),this.#i=i.INFO}}}consume(e){if(e>this.#n)throw Error(`Called consume() before buffers satiated.`);if(e===0)return s;this.#n-=e;let t=this.#e[0];if(t.length>e)return this.#e[0]=t.subarray(e,t.length),t.subarray(0,e);if(t.length===e)return this.#e.shift();{let t=0,n=Buffer.allocUnsafeSlow(e);for(;t!==e;){let r=this.#e[0],i=r.length;if(i+t===e){n.set(this.#e.shift(),t);break}else if(i+t>e){n.set(r.subarray(0,e-t),t),this.#e[0]=r.subarray(e-t);break}else n.set(this.#e.shift(),t),t+=i}return n}}writeFragments(e){return this.#l>0&&this.#o.length===this.#l?(g(this.#c,1008,`Too many message fragments`),!1):(this.#t+=e.length,this.#o.push(e),!0)}consumeFragments(){let e=this.#o;if(e.length===1)return this.#t=0,e.shift();let t=0,n=Buffer.allocUnsafeSlow(this.#t);for(let r=0;r<e.length;++r){let i=e[r];n.set(i,t),t+=i.length}return this.#o=[],this.#t=0,n}parseCloseBody(e){r(e.length!==1);let t;if(e.length>=2&&(t=e.readUInt16BE(0)),t!==void 0&&!l(t))return{code:1002,reason:`Invalid status code`,error:!0};let n=e.subarray(2);n[0]===239&&n[1]===187&&n[2]===191&&(n=n.subarray(3));try{n=f(n)}catch{return{code:1007,reason:`Invalid UTF-8`,error:!0}}return{code:t,reason:n,error:!1}}parseControlFrame(e){let{opcode:t,payloadLength:n}=this.#a;if(t===a.CLOSE){if(n===1)return g(this.#c,1002,`Received close frame with a 1-byte body.`),!1;if(this.#a.closeInfo=this.parseCloseBody(e),this.#a.closeInfo.error){let{code:e,reason:t}=this.#a.closeInfo;return g(this.#c,e,t),!1}if(!this.#c.closeState.has(c.SENT)&&!this.#c.closeState.has(c.RECEIVED)){let e=s;this.#a.closeInfo.code&&(e=Buffer.allocUnsafe(2),e.writeUInt16BE(this.#a.closeInfo.code,0));let t=new _(e);this.#c.socket.write(t.createFrame(a.CLOSE)),this.#c.closeState.add(c.SENT)}return this.#c.readyState=o.CLOSING,this.#c.closeState.add(c.RECEIVED),!1}else if(t===a.PING){if(!this.#c.closeState.has(c.RECEIVED)){let t=new _(e);this.#c.socket.write(t.createFrame(a.PONG)),this.#c.onPing(e)}}else t===a.PONG&&this.#c.onPong(e);return!0}get closingInfo(){return this.#a.closeInfo}}}})),pt=_(((e,t)=>{let{WebsocketFrameSend:n}=lt(),{opcodes:r,sendHints:i}=st(),a=re();var o=class{#e=new a;#t=!1;#n;constructor(e){this.#n=e}add(e,t,r){if(r!==i.blob){if(this.#t){let n={promise:null,callback:t,frame:s(e,r)};this.#e.push(n)}else if(r===i.text){let{0:r,1:i}=n.createFastTextFrame(e);this.#n.cork(),this.#n.write(r),this.#n.write(i,t),this.#n.uncork()}else this.#n.write(s(e,r),t);return}let a={promise:e.arrayBuffer().then(e=>{a.promise=null,a.frame=s(e,r)}),callback:t,frame:null};this.#e.push(a),this.#t||this.#r()}async#r(){this.#t=!0;let e=this.#e;for(;!e.isEmpty();){let t=e.shift();t.promise!==null&&await t.promise,this.#n.write(t.frame,t.callback),t.callback=t.frame=null}this.#t=!1}};function s(e,t){return new n(c(e,t)).createFrame(t===i.text?r.TEXT:r.BINARY)}function c(e,t){switch(t){case i.text:case i.typedArray:return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);case i.arrayBuffer:case i.blob:return new Uint8Array(e)}}t.exports={SendQueue:o}})),mt=_(((e,t)=>{let{isArrayBuffer:n}=v(`node:util/types`),{webidl:r}=B(),{URLSerializer:i}=z(),{environmentSettingsObject:a}=V(),{staticPropertyDescriptors:o,states:s,sentCloseFrameState:c,sendHints:l,opcodes:u}=st(),{isConnecting:d,isEstablished:f,isClosing:p,isClosed:m,isValidSubprotocol:h,fireEvent:g,utf8Decode:_,toArrayBuffer:y,getURLRecord:b}=ct(),{establishWebSocketConnection:x,closeWebSocketConnection:S,failWebsocketConnection:C}=ut(),{ByteParser:T}=ft(),{kEnumerableProperty:D}=w(),{getGlobalDispatcher:O}=Ae(),{ErrorEvent:k,CloseEvent:A,createFastMessageEvent:j}=ot(),{SendQueue:M}=pt(),{WebsocketFrameSend:N}=lt(),{channels:P}=E(),F=Symbol.for(`nodejs.ref`),I=Symbol.for(`nodejs.unref`);function L(e){return typeof e?.address==`function`?e.address():typeof e?.session?.socket?.address==`function`?e.session.socket.address():null}var R=class e extends EventTarget{#e={open:null,error:null,close:null,message:null};#t=0;#n=``;#r=``;#i=!0;#a;#o={onConnectionEstablished:(e,t)=>this.#u(e,t),onMessage:(e,t)=>this.#d(e,t),onParserError:e=>C(this.#o,null,e.message),onParserDrain:()=>this.#f(),onSocketData:e=>{this.#l.write(e)||this.#o.socket.pause()},onSocketError:e=>{this.#o.readyState=s.CLOSING,P.socketError.hasSubscribers&&P.socketError.publish(e),this.#o.socket.destroy()},onSocketClose:()=>this.#p(),onPing:e=>{P.ping.hasSubscribers&&P.ping.publish({payload:e,websocket:this})},onPong:e=>{P.pong.hasSubscribers&&P.pong.publish({payload:e,websocket:this})},readyState:s.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#s;#c;#l;constructor(t,n=[]){super(),r.util.markAsUncloneable(this);let i=`WebSocket constructor`;r.argumentLengthCheck(arguments,1,i);let o=r.converters[`DOMString or sequence<DOMString> or WebSocketInit`](n,i,`options`);t=r.converters.USVString(t),n=o.protocols;let s=a.settingsObject.baseUrl,c=b(t,s);if(typeof n==`string`&&(n=[n]),n.length!==new Set(n.map(e=>e.toLowerCase())).size||n.length>0&&!n.every(e=>h(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);this.#s=new URL(c.href);let l=a.settingsObject;this.#o.controller=x(c,n,l,this.#o,o),this.#o.readyState=e.CONNECTING,this.#c=`blob`}[F](){r.brandCheck(this,e),this.#i=!0,this.#o.socket?.ref?.()}[I](){r.brandCheck(this,e),this.#i=!1,this.#o.socket?.unref?.()}close(t=void 0,n=void 0){r.brandCheck(this,e),t!==void 0&&(t=r.converters[`unsigned short`](t,`WebSocket.close`,`code`,r.attributes.Clamp)),n!==void 0&&(n=r.converters.USVString(n)),t??=null,n??=``,S(this.#o,t,n,!0)}send(t){r.brandCheck(this,e);let i=`WebSocket.send`;if(r.argumentLengthCheck(arguments,1,i),t=r.converters.WebSocketSendData(t,i,`data`),d(this.#o.readyState))throw new DOMException(`Sent before connected.`,`InvalidStateError`);if(!(!f(this.#o.readyState)||p(this.#o.readyState)))if(typeof t==`string`){let e=Buffer.from(t);this.#t+=e.byteLength,this.#a.add(e,()=>{this.#t-=e.byteLength},l.text)}else n(t)?(this.#t+=t.byteLength,this.#a.add(t,()=>{this.#t-=t.byteLength},l.arrayBuffer)):ArrayBuffer.isView(t)?(this.#t+=t.byteLength,this.#a.add(t,()=>{this.#t-=t.byteLength},l.typedArray)):r.is.Blob(t)&&(this.#t+=t.size,this.#a.add(t,()=>{this.#t-=t.size},l.blob))}get readyState(){return r.brandCheck(this,e),this.#o.readyState}get bufferedAmount(){return r.brandCheck(this,e),this.#t}get url(){return r.brandCheck(this,e),i(this.#s)}get extensions(){return r.brandCheck(this,e),this.#r}get protocol(){return r.brandCheck(this,e),this.#n}get onopen(){return r.brandCheck(this,e),this.#e.open}set onopen(t){r.brandCheck(this,e),this.#e.open&&this.removeEventListener(`open`,this.#e.open);let n=r.converters.EventHandlerNonNull(t);n===null?this.#e.open=null:(this.addEventListener(`open`,n),this.#e.open=t)}get onerror(){return r.brandCheck(this,e),this.#e.error}set onerror(t){r.brandCheck(this,e),this.#e.error&&this.removeEventListener(`error`,this.#e.error);let n=r.converters.EventHandlerNonNull(t);n===null?this.#e.error=null:(this.addEventListener(`error`,n),this.#e.error=t)}get onclose(){return r.brandCheck(this,e),this.#e.close}set onclose(t){r.brandCheck(this,e),this.#e.close&&this.removeEventListener(`close`,this.#e.close);let n=r.converters.EventHandlerNonNull(t);n===null?this.#e.close=null:(this.addEventListener(`close`,n),this.#e.close=t)}get onmessage(){return r.brandCheck(this,e),this.#e.message}set onmessage(t){r.brandCheck(this,e),this.#e.message&&this.removeEventListener(`message`,this.#e.message);let n=r.converters.EventHandlerNonNull(t);n===null?this.#e.message=null:(this.addEventListener(`message`,n),this.#e.message=t)}get binaryType(){return r.brandCheck(this,e),this.#c}set binaryType(t){r.brandCheck(this,e),t!==`blob`&&t!==`arraybuffer`?this.#c=`blob`:this.#c=t}#u(e,t){this.#o.socket=e.socket,this.#i||this.#o.socket.unref?.();let n=this.#o.controller.dispatcher?.webSocketOptions?.maxFragments,r=this.#o.controller.dispatcher?.webSocketOptions?.maxPayloadSize,i=new T(this.#o,t,{maxFragments:n,maxPayloadSize:r});i.on(`drain`,()=>this.#o.onParserDrain()),i.on(`error`,e=>this.#o.onParserError(e)),this.#l=i,this.#a=new M(e.socket),this.#o.readyState=s.OPEN;let a=e.headersList.get(`sec-websocket-extensions`);a!==null&&(this.#r=a);let o=e.headersList.get(`sec-websocket-protocol`);if(o!==null&&(this.#n=o),g(`open`,this),P.open.hasSubscribers){let t=e.headersList.entries;P.open.publish({address:L(e.socket),protocol:this.#n,extensions:this.#r,websocket:this,handshakeResponse:{status:e.status,statusText:e.statusText,headers:t}})}}#d(e,t){if(this.#o.readyState!==s.OPEN)return;let n;if(e===u.TEXT)try{n=_(t)}catch{C(this.#o,1007,`Received invalid UTF-8 in text frame.`);return}else e===u.BINARY&&(n=this.#c===`blob`?new Blob([t]):y(t));g(`message`,this,j,{origin:this.#s.origin,data:n})}#f(){this.#o.socket.resume()}#p(){let e=this.#o.closeState.has(c.SENT)&&this.#o.closeState.has(c.RECEIVED),t=1005,n=``,r=this.#l?.closingInfo;r&&!r.error&&(t=r.code??1005,n=r.reason),this.#o.readyState=s.CLOSED,this.#o.closeState.has(c.RECEIVED)||(t=1006,g(`error`,this,(e,t)=>new k(e,t),{error:TypeError(n)})),g(`close`,this,(e,t)=>new A(e,t),{wasClean:e,code:t,reason:n}),P.close.hasSubscribers&&P.close.publish({websocket:this,code:t,reason:n})}static ping(e,t){if(Buffer.isBuffer(t)){if(t.length>125)throw TypeError(`A PING frame cannot have a body larger than 125 bytes.`)}else if(t!==void 0)throw TypeError(`Expected buffer payload`);let n=e.#o.readyState;if(f(n)&&!p(n)&&!m(n)){let n=new N(t);e.#o.socket.write(n.createFrame(u.PING))}}};let{ping:H}=R;Reflect.deleteProperty(R,`ping`),R.CONNECTING=R.prototype.CONNECTING=s.CONNECTING,R.OPEN=R.prototype.OPEN=s.OPEN,R.CLOSING=R.prototype.CLOSING=s.CLOSING,R.CLOSED=R.prototype.CLOSED=s.CLOSED,Object.defineProperties(R.prototype,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o,url:D,readyState:D,bufferedAmount:D,onopen:D,onerror:D,onclose:D,close:D,onmessage:D,binaryType:D,send:D,extensions:D,protocol:D,[Symbol.toStringTag]:{value:`WebSocket`,writable:!1,enumerable:!1,configurable:!0}}),Object.defineProperties(R,{CONNECTING:o,OPEN:o,CLOSING:o,CLOSED:o}),r.converters[`sequence<DOMString>`]=r.sequenceConverter(r.converters.DOMString),r.converters[`DOMString or sequence<DOMString>`]=function(e,t,n){return r.util.Type(e)===r.util.Types.OBJECT&&Symbol.iterator in e?r.converters[`sequence<DOMString>`](e):r.converters.DOMString(e,t,n)},r.converters.WebSocketInit=r.dictionaryConverter([{key:`protocols`,converter:r.converters[`DOMString or sequence<DOMString>`],defaultValue:()=>[]},{key:`dispatcher`,converter:r.converters.any,defaultValue:()=>O()},{key:`headers`,converter:r.nullableConverter(r.converters.HeadersInit)}]),r.converters[`DOMString or sequence<DOMString> or WebSocketInit`]=function(e){return r.util.Type(e)===r.util.Types.OBJECT&&!(Symbol.iterator in e)?r.converters.WebSocketInit(e):{protocols:r.converters[`DOMString or sequence<DOMString>`](e)}},r.converters.WebSocketSendData=function(e){return r.util.Type(e)===r.util.Types.OBJECT&&(r.is.Blob(e)||r.is.BufferSource(e))?e:r.converters.USVString(e)},t.exports={WebSocket:R,ping:H}})),ht=_(((e,t)=>{let{webidl:n}=B(),{validateCloseCodeAndReason:r}=ct(),{kConstruct:i}=y(),{kEnumerableProperty:a}=w();function o(){class e extends DOMException{get reason(){return``}}return new e().reason===void 0?new Proxy(DOMException,{construct(e,t,n){let r=Reflect.construct(e,t,e);return Object.setPrototypeOf(r,n.prototype),r}}):DOMException}var s=class e extends o(){#e;#t;constructor(e=``,t=void 0){if(e=n.converters.DOMString(e,`WebSocketError`,`message`),super(e,`WebSocketError`),t===i)return;t!==null&&(t=n.converters.WebSocketCloseInfo(t));let a=t.closeCode??null,o=t.reason??``;r(a,o),o.length!==0&&a===null&&(a=1e3),this.#e=a,this.#t=o}get closeCode(){return this.#e}get reason(){return this.#t}static createUnvalidatedWebSocketError(t,n,r){let a=new e(t,i);return a.#e=n,a.#t=r,a}};let{createUnvalidatedWebSocketError:c}=s;delete s.createUnvalidatedWebSocketError,Object.defineProperties(s.prototype,{closeCode:a,reason:a,[Symbol.toStringTag]:{value:`WebSocketError`,writable:!1,enumerable:!1,configurable:!0}}),n.is.WebSocketError=n.util.MakeTypeAssertion(s),t.exports={WebSocketError:s,createUnvalidatedWebSocketError:c}})),gt=_(((e,t)=>{let{addAbortListener:n}=v(`node:events`),{environmentSettingsObject:r,readableStreamClose:i}=V(),{states:a,opcodes:o,sentCloseFrameState:s}=st(),{webidl:c}=B(),{getURLRecord:l,isValidSubprotocol:u,isEstablished:d,utf8Decode:f}=ct(),{establishWebSocketConnection:p,failWebsocketConnection:m,closeWebSocketConnection:h}=ut(),{channels:g}=E(),{WebsocketFrameSend:_}=lt(),{ByteParser:y}=ft(),{WebSocketError:b,createUnvalidatedWebSocketError:x}=ht(),{kEnumerableProperty:S}=w(),{utf8DecodeBytes:C}=L(),T=!1;var D=class{#e;#t;#n;#r;#i;#a;#o=!1;#s={onConnectionEstablished:(e,t)=>this.#u(e,t),onMessage:(e,t)=>this.#d(e,t),onParserError:e=>m(this.#s,null,e.message),onParserDrain:()=>this.#s.socket.resume(),onSocketData:e=>{this.#c.write(e)||this.#s.socket.pause()},onSocketError:e=>{this.#s.readyState=a.CLOSING,g.socketError.hasSubscribers&&g.socketError.publish(e),this.#s.socket.destroy()},onSocketClose:()=>this.#f(),onPing:()=>{},onPong:()=>{},readyState:a.CONNECTING,socket:null,closeState:new Set,controller:null,wasEverConnected:!1};#c;constructor(e,t=void 0){T||=(process.emitWarning(`WebSocketStream is experimental! Expect it to change at any time.`,{code:`UNDICI-WSS`}),!0),c.argumentLengthCheck(arguments,1,`WebSocket`),e=c.converters.USVString(e),t!==null&&(t=c.converters.WebSocketStreamOptions(t));let i=r.settingsObject.baseUrl,o=l(e,i),s=t.protocols;if(s.length!==new Set(s.map(e=>e.toLowerCase())).size||s.length>0&&!s.every(e=>u(e)))throw new DOMException(`Invalid Sec-WebSocket-Protocol value`,`SyntaxError`);if(this.#e=o.toString(),this.#t=Promise.withResolvers(),this.#n=Promise.withResolvers(),t.signal!=null){let e=t.signal;if(e.aborted){this.#t.reject(e.reason),this.#n.reject(e.reason);return}n(e,()=>{d(this.#s.readyState)||(m(this.#s),this.#s.readyState=a.CLOSING,this.#t.reject(e.reason),this.#n.reject(e.reason),this.#o=!0)})}let f=r.settingsObject;this.#s.controller=p(o,s,f,this.#s,t)}get url(){return this.#e.toString()}get opened(){return this.#t.promise}get closed(){return this.#n.promise}close(e=void 0){e!==null&&(e=c.converters.WebSocketCloseInfo(e));let t=e.closeCode??null,n=e.reason;h(this.#s,t,n,!0)}#l(e){e=c.converters.WebSocketStreamWrite(e);let t=Promise.withResolvers(),n=null,r=null;if(c.is.BufferSource(e))n=new Uint8Array(ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e.slice()),r=o.BINARY;else{let i;try{i=c.converters.DOMString(e)}catch(e){return t.reject(e),t.promise}n=new TextEncoder().encode(i),r=o.TEXT}if(!this.#s.closeState.has(s.SENT)&&!this.#s.closeState.has(s.RECEIVED)){let e=new _(n);this.#s.socket.write(e.createFrame(r),()=>{t.resolve(void 0)})}return t.promise}#u(e,t){this.#s.socket=e.socket;let n=this.#s.controller.dispatcher?.webSocketOptions?.maxFragments,r=this.#s.controller.dispatcher?.webSocketOptions?.maxPayloadSize,i=new y(this.#s,t,{maxFragments:n,maxPayloadSize:r});i.on(`drain`,()=>this.#s.onParserDrain()),i.on(`error`,e=>this.#s.onParserError(e)),this.#c=i,this.#s.readyState=a.OPEN;let o=t??``,s=e.headersList.get(`sec-websocket-protocol`)??``,c=new ReadableStream({start:e=>{this.#i=e},cancel:e=>this.#m(e)}),l=new WritableStream({start:e=>{this.#a=e},write:e=>this.#l(e),close:()=>h(this.#s,null,null),abort:e=>this.#p(e)});this.#r=c,this.#t.resolve({extensions:o,protocol:s,readable:c,writable:l})}#d(e,t){if(this.#s.readyState!==a.OPEN)return;let n;if(e===o.TEXT)try{n=f(t)}catch{m(this.#s,1007,`Received invalid UTF-8 in text frame.`);return}else e===o.BINARY&&(n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength));this.#i.enqueue(n)}#f(){let e=this.#s.closeState.has(s.SENT)&&this.#s.closeState.has(s.RECEIVED);if(this.#s.readyState=a.CLOSED,this.#o)return;this.#s.wasEverConnected||this.#t.reject(new b(`Socket never opened`));let t=this.#c?.closingInfo,n=t?.code??1005;!this.#s.closeState.has(s.SENT)&&!this.#s.closeState.has(s.RECEIVED)&&(n=1006);let r=t?.reason==null?``:C(Buffer.from(t.reason));if(e)i(this.#i),this.#a.error(new DOMException(`A closed WebSocketStream cannot be written to`,`InvalidStateError`)),this.#n.resolve({closeCode:n,reason:r});else{let e=x(`unclean close`,n,r);this.#i?.error(e),this.#a?.error(e),this.#n.reject(e)}}#p(e){let t=null,n=``;c.is.WebSocketError(e)&&(t=e.closeCode,n=e.reason),h(this.#s,t,n)}#m(e){this.#p(e)}};Object.defineProperties(D.prototype,{url:S,opened:S,closed:S,close:S,[Symbol.toStringTag]:{value:`WebSocketStream`,writable:!1,enumerable:!1,configurable:!0}}),c.converters.WebSocketStreamOptions=c.dictionaryConverter([{key:`protocols`,converter:c.sequenceConverter(c.converters.USVString),defaultValue:()=>[]},{key:`signal`,converter:c.nullableConverter(c.converters.AbortSignal),defaultValue:()=>null}]),c.converters.WebSocketCloseInfo=c.dictionaryConverter([{key:`closeCode`,converter:e=>c.converters[`unsigned short`](e,c.attributes.EnforceRange)},{key:`reason`,converter:c.converters.USVString,defaultValue:()=>``}]),c.converters.WebSocketStreamWrite=function(e){return typeof e==`string`?c.converters.USVString(e):c.converters.BufferSource(e)},t.exports={WebSocketStream:D}})),_t=_(((e,t)=>{let{makeRequest:n}=Xe();function r(e){return e.indexOf(`\0`)===-1}function i(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)<48||e.charCodeAt(t)>57)return!1;return!0}function a(e,t,r,i){let a=r===`no cors`?`no-cors`:`cors`;i&&a===`no-cors`&&(a=`same-origin`);let o=`include`;return r===`anonymous`&&(o=`same-origin`),n({urlList:[e],destination:t,mode:a,credentials:o,useURLCredentials:!0})}t.exports={isValidLastEventId:r,isASCIINumber:i,createPotentialCORSRequest:a}})),vt=_(((e,t)=>{let n=v(`node:buffer`),{Transform:r}=v(`node:stream`),{isASCIINumber:i,isValidLastEventId:a}=_t(),o=[239,187,191],s=n.kStringMaxLength,c=Buffer.from(`data`),l=Buffer.from(`event`),u=Buffer.from(`id`),d=Buffer.from(`retry`);function f(e,t){if(t>=e.length)return!1;for(let n=t;n<e.length;n++)if(e[n]<48||e[n]>57)return!1;return!0}function p(e,t){for(let n=t;n<e.length;n++)if(e[n]===0)return!1;return!0}function m(e,t,n){if(t!==n.length)return!1;for(let r=0;r<t;r++)if(e[r]!==n[r])return!1;return!0}function h(){let e=Error(`EventSource message size exceeded`);return e.aborted=!1,e}t.exports={EventSourceStream:class extends r{state;checkBOM=!0;crlfCheck=!1;eventEndCheck=!1;chunks=[];chunkIndex=0;pos=0;lineChunkIndex=0;linePos=0;eventDataSize=0;maxEventSize;event={data:void 0,event:void 0,id:void 0,retry:void 0};constructor(e={}){e.readableObjectMode=!0,super(e),this.state=e.eventSourceSettings||{},this.maxEventSize=e.maxEventSize??s,e.push&&(this.push=e.push)}_transform(e,t,n){if(e.length===0){n();return}if(this.chunks.push(e),this.checkBOM&&this.handleBOM()){n();return}for(;this.hasCurrentByte();){let e=this.currentByte();if(this.eventEndCheck){if(this.crlfCheck){if(e===10){this.crlfCheck=!1,this.consumeCurrentByte();continue}this.crlfCheck=!1}if(e===10||e===13){e===13&&(this.crlfCheck=!0),this.consumeCurrentByte(),this.hasPendingEvent()&&this.processEvent(this.event),this.clearEvent();continue}this.eventEndCheck=!1;continue}if(e===10||e===13){e===13&&(this.crlfCheck=!0);try{this.parseLine(this.readLine(),this.event)}catch(e){n(e);return}this.consumeCurrentByte(),this.eventEndCheck=!0;continue}this.advanceCursor()}n()}parseLine(e,t){if(e.length===0)return;let n=e.indexOf(58);if(n===0)return;let r=e.length,i=e.length;if(n!==-1&&(r=n,i=n+1,e[i]===32&&++i),m(e,r,c)){let n=e.length-i,r=this.eventDataSize+(t.data===void 0?0:1)+n;if(this.maxEventSize>0&&r>this.maxEventSize)throw h();let a=e.toString(`utf8`,i);t.data===void 0?t.data=a:t.data+=`\n${a}`,this.eventDataSize=r;return}if(m(e,r,d)){f(e,i)&&(t.retry=e.toString(`utf8`,i));return}if(m(e,r,u)){p(e,i)&&(t.id=e.toString(`utf8`,i));return}if(m(e,r,l)){let n=e.toString(`utf8`,i);n.length>0&&(t.event=n)}}processEvent(e){e.retry&&i(e.retry)&&(this.state.reconnectionTime=parseInt(e.retry,10)),e.id!==void 0&&a(e.id)&&(this.state.lastEventId=e.id),e.data!==void 0&&this.push({type:e.event||`message`,options:{data:e.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event.data=void 0,this.event.event=void 0,this.event.id=void 0,this.event.retry=void 0,this.eventDataSize=0}hasPendingEvent(){return this.event.data!==void 0||this.event.event!==void 0||this.event.id!==void 0||this.event.retry!==void 0}hasCurrentByte(){return this.chunkIndex<this.chunks.length&&this.pos<this.chunks[this.chunkIndex].length}currentByte(){return this.chunks[this.chunkIndex][this.pos]}consumeCurrentByte(){this.advanceCursor(),this.syncLineStartToCursor()}advanceCursor(){for(this.pos++;this.chunkIndex<this.chunks.length&&this.pos>=this.chunks[this.chunkIndex].length;)this.chunkIndex++,this.pos=0}syncLineStartToCursor(){this.lineChunkIndex=this.chunkIndex,this.linePos=this.pos,this.dropConsumedChunks()}dropConsumedChunks(){for(;this.lineChunkIndex>0;)this.chunks.shift(),this.lineChunkIndex--,this.chunkIndex--;this.chunkIndex===this.chunks.length&&(this.chunks.length=0,this.chunkIndex=0,this.pos=0,this.lineChunkIndex=0,this.linePos=0)}readLine(){if(this.lineChunkIndex===this.chunkIndex)return this.chunks[this.chunkIndex].subarray(this.linePos,this.pos);let e=[],t=0;for(let n=this.lineChunkIndex;n<=this.chunkIndex;n++){let r=this.chunks[n],i=n===this.lineChunkIndex?this.linePos:0,a=n===this.chunkIndex?this.pos:r.length,o=r.subarray(i,a);t+=o.length,e.push(o)}return Buffer.concat(e,t)}peekBufferedByte(e){let t=this.lineChunkIndex,n=this.linePos;for(;t<this.chunks.length;){let r=this.chunks[t],i=r.length-n;if(e<i)return r[n+e];e-=i,t++,n=0}}discardLeadingBytes(e){for(;e>0&&this.lineChunkIndex<this.chunks.length;){let t=this.chunks[this.lineChunkIndex].length-this.linePos;e<t?(this.linePos+=e,e=0):(e-=t,this.lineChunkIndex++,this.linePos=0)}this.chunkIndex=this.lineChunkIndex,this.pos=this.linePos,this.dropConsumedChunks()}handleBOM(){let e=this.peekBufferedByte(0),t=this.peekBufferedByte(1),n=this.peekBufferedByte(2);return t===void 0?(e===o[0]||(this.checkBOM=!1),!0):n===void 0?e===o[0]&&t===o[1]?!0:(this.checkBOM=!1,!1):(e===o[0]&&t===o[1]&&n===o[2]&&this.discardLeadingBytes(3),this.checkBOM=!1,!this.hasCurrentByte())}}}})),yt=_(((e,t)=>{let{pipeline:n}=v(`node:stream`),{fetching:r}=Qe(),{webidl:i}=B(),{EventSourceStream:a}=vt(),{parseMIMEType:o}=z(),{createFastMessageEvent:s}=ot(),{isNetworkError:c}=Ye(),{isValidHeaderValue:l,kEnumerableProperty:u}=w(),{environmentSettingsObject:d}=V(),{createPotentialCORSRequest:f}=_t(),{getGlobalDispatcher:p}=Ae(),{isomorphicDecode:m}=R(),h=new TextEncoder,g=!1,_=3e3;var y=class e extends EventTarget{#e={open:null,error:null,message:null};#t;#n=!1;#r=0;#i=null;#a=null;#o;#s;constructor(e,t={}){super(),i.util.markAsUncloneable(this);let n=`EventSource constructor`;i.argumentLengthCheck(arguments,1,n),g||(g=!0,process.emitWarning(`EventSource is experimental, expect them to change at any time.`,{code:`UNDICI-ES`})),e=i.converters.USVString(e),t=i.converters.EventSourceInitDict(t,n,`eventSourceInitDict`),this.#o=t.node.dispatcher||t.dispatcher,this.#s={lastEventId:``,reconnectionTime:t.node.reconnectionTime};let r=d,a;try{a=new URL(e,r.settingsObject.baseUrl),this.#s.origin=a.origin}catch(e){throw new DOMException(e,`SyntaxError`)}this.#t=a.href;let o=`anonymous`;t.withCredentials===!0&&(o=`use-credentials`,this.#n=!0);let s=f(a,``,o);s.client=d.settingsObject,s.headersList.set(`Accept`,`text/event-stream`),s.cache=`no-store`,s.initiator=`other`,this.#i=s,this.#c()}get readyState(){return this.#r}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#r===2)return;this.#r=0;let e={request:this.#i,dispatcher:this.#o};e.processResponseEndOfBody=e=>{if(!c(e))return this.#l()},e.processResponse=e=>{if(c(e))if(e.aborted){this.close(),this.dispatchEvent(new Event(`error`));return}else{this.#l();return}let t=e.headersList.get(`content-type`,!0),r=t===null?`failure`:o(t),i=r!==`failure`&&r.essence===`text/event-stream`;if(e.status!==200||i===!1){this.close(),this.dispatchEvent(new Event(`error`));return}this.#r=1,this.dispatchEvent(new Event(`open`)),this.#s.origin=e.urlList[e.urlList.length-1].origin;let l=new a({eventSourceSettings:this.#s,maxEventSize:this.#o.eventSourceOptions?.maxEventSize,push:e=>{this.dispatchEvent(s(e.type,e.options))}});n(e.body.stream,l,e=>{e?.aborted===!1&&(this.close(),this.dispatchEvent(new Event(`error`)))})},this.#a=r(e)}#l(){this.#r!==2&&(this.#r=0,this.dispatchEvent(new Event(`error`)),setTimeout(()=>{if(this.#r===0){if(this.#i.headersList.delete(`last-event-id`,!0),this.#s.lastEventId.length){let e=m(h.encode(this.#s.lastEventId));l(e)&&this.#i.headersList.set(`last-event-id`,e,!0)}this.#c()}},this.#s.reconnectionTime)?.unref())}close(){i.brandCheck(this,e),this.#r!==2&&(this.#r=2,this.#a.abort(),this.#i=null)}get onopen(){return this.#e.open}set onopen(e){this.#e.open&&this.removeEventListener(`open`,this.#e.open);let t=i.converters.EventHandlerNonNull(e);t===null?this.#e.open=null:(this.addEventListener(`open`,t),this.#e.open=e)}get onmessage(){return this.#e.message}set onmessage(e){this.#e.message&&this.removeEventListener(`message`,this.#e.message);let t=i.converters.EventHandlerNonNull(e);t===null?this.#e.message=null:(this.addEventListener(`message`,t),this.#e.message=e)}get onerror(){return this.#e.error}set onerror(e){this.#e.error&&this.removeEventListener(`error`,this.#e.error);let t=i.converters.EventHandlerNonNull(e);t===null?this.#e.error=null:(this.addEventListener(`error`,t),this.#e.error=e)}};let b={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:0,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:1,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:2,writable:!1}};Object.defineProperties(y,b),Object.defineProperties(y.prototype,b),Object.defineProperties(y.prototype,{close:u,onerror:u,onmessage:u,onopen:u,readyState:u,url:u,withCredentials:u}),i.converters.EventSourceInitDict=i.dictionaryConverter([{key:`withCredentials`,converter:i.converters.boolean,defaultValue:()=>!1},{key:`dispatcher`,converter:i.converters.any,defaultValue:()=>p()},{key:`node`,converter:i.dictionaryConverter([{key:`reconnectionTime`,converter:i.converters[`unsigned long`],defaultValue:()=>_},{key:`dispatcher`,converter:i.converters.any}]),defaultValue:()=>({})}]),t.exports={EventSource:y,defaultReconnectionTime:_}})),bt=_(((e,t)=>{let n=G(),r=O(),i=q(),a=J(),o=ie(),s=Y(),c=ae(),l=ce(),u=se(),d=Z(),f=ue(),p=de(),m=x(),h=w(),{InvalidArgumentError:g}=m,_=ve(),v=A(),b=Se(),{MockCallHistory:S,MockCallHistoryLog:C}=Ce(),T=Ee(),E=we(),D=ke(),k=ye(),j=le(),{getGlobalDispatcher:M,setGlobalDispatcher:N}=Ae(),P=je(),F=Me();Object.assign(r.prototype,_),t.exports.Dispatcher=r,t.exports.Client=n,t.exports.Pool=i,t.exports.BalancedPool=a,t.exports.RoundRobinPool=o,t.exports.Agent=s,t.exports.Dispatcher1Wrapper=c,t.exports.ProxyAgent=l,t.exports.Socks5ProxyAgent=u,t.exports.EnvHttpProxyAgent=d,t.exports.RetryAgent=f,t.exports.H2CClient=p,t.exports.RetryHandler=j,t.exports.DecoratorHandler=P,t.exports.RedirectHandler=F,t.exports.interceptors={redirect:Ne(),responseError:Pe(),retry:Fe(),dump:Ie(),dns:Le(),cache:Ue(),decompress:We(),deduplicate:Ke()},t.exports.cacheStores={MemoryCacheStore:Ve()};let L=qe();t.exports.cacheStores.SqliteCacheStore=L,t.exports.buildConnector=v,t.exports.errors=m,t.exports.util={parseHeaders:h.parseHeaders,headerNameToString:h.headerNameToString};function R(e){return(t,n,r)=>{if(typeof n==`function`&&(r=n,n=null),!t||typeof t!=`string`&&typeof t!=`object`&&!(t instanceof URL))throw new g(`invalid url`);if(n!=null&&typeof n!=`object`)throw new g(`invalid opts`);if(n&&n.path!=null){if(typeof n.path!=`string`)throw new g(`invalid opts.path`);let e=n.path;n.path.startsWith(`/`)||(e=`/${e}`),t=new URL(h.parseOrigin(t).origin+e)}else n||=typeof t==`object`?t:{},t=h.parseURL(t);let{agent:i,dispatcher:a=M(),...o}=n;if(i)throw new g(`unsupported opts.agent. Did you mean opts.client?`);return e.call(a,{...o,origin:t.origin,path:t.search?`${t.pathname}${t.search}`:t.pathname,method:n.method||(n.body?`PUT`:`GET`)},r)}}t.exports.setGlobalDispatcher=N,t.exports.getGlobalDispatcher=M;let B=Qe().fetch,V=typeof __filename<`u`?__filename:void 0;function H(e,t){if(!e||typeof e!=`object`)return;let n=typeof e.stack==`string`?e.stack:``,r=t.replace(/\\/g,`/`);if(n&&(n.includes(t)||n.includes(r)))return;let i={};if(Error.captureStackTrace(i,H),!i.stack)return;let a=i.stack.split(`
|
|
95
95
|
`).slice(1).join(`
|
|
96
96
|
`);e.stack=n?`${n}\n${a}`:i.stack}t.exports.fetch=function(e,n=void 0){return B(e,n).catch(e=>{throw V?H(e,V):e&&typeof e==`object`&&Error.captureStackTrace(e,t.exports.fetch),e})},t.exports.Headers=Je().Headers,t.exports.Response=Ye().Response,t.exports.Request=Xe().Request,t.exports.FormData=U().FormData;let{setGlobalOrigin:W,getGlobalOrigin:ee}=I();t.exports.setGlobalOrigin=W,t.exports.getGlobalOrigin=ee;let{CacheStorage:te}=tt(),{kConstruct:ne}=y();t.exports.caches=new te(ne);let{deleteCookie:re,getCookies:K,getSetCookies:X,setCookie:oe,parseCookie:fe}=at();t.exports.deleteCookie=re,t.exports.getCookies=K,t.exports.getSetCookies=X,t.exports.setCookie=oe,t.exports.parseCookie=fe;let{parseMIMEType:pe,serializeAMimeType:me}=z();t.exports.parseMIMEType=pe,t.exports.serializeAMimeType=me;let{CloseEvent:he,ErrorEvent:ge,MessageEvent:_e}=ot(),{WebSocket:Q,ping:$}=mt();t.exports.WebSocket=Q,t.exports.CloseEvent=he,t.exports.ErrorEvent=ge,t.exports.MessageEvent=_e,t.exports.ping=$,t.exports.WebSocketStream=gt().WebSocketStream,t.exports.WebSocketError=ht().WebSocketError,t.exports.request=R(_.request),t.exports.stream=R(_.stream),t.exports.pipeline=R(_.pipeline),t.exports.connect=R(_.connect),t.exports.upgrade=R(_.upgrade),t.exports.MockClient=b,t.exports.MockCallHistory=S,t.exports.MockCallHistoryLog=C,t.exports.MockPool=E,t.exports.MockAgent=T,t.exports.SnapshotAgent=D,t.exports.mockErrors=k;let{EventSource:be}=yt();t.exports.EventSource=be;function xe(){globalThis.fetch=t.exports.fetch,globalThis.Headers=t.exports.Headers,globalThis.Response=t.exports.Response,globalThis.Request=t.exports.Request,globalThis.FormData=t.exports.FormData,globalThis.WebSocket=t.exports.WebSocket,globalThis.CloseEvent=t.exports.CloseEvent,globalThis.ErrorEvent=t.exports.ErrorEvent,globalThis.MessageEvent=t.exports.MessageEvent,globalThis.EventSource=t.exports.EventSource}t.exports.install=xe}))(),xt=[{meta:{id:`title`,name:`Page Title`,category:`SEO`,tier:`free`,description:`Checks for the presence and length of the <title> tag`},run(e){let{document:t}=e,n=[],r=t.querySelector(`title`)?.textContent?.trim()||``,i=r.length;return r?i<30?n.push({ruleId:`title`,ruleName:`Page Title`,message:`Title may be too short - under 30 characters may not be descriptive enough`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Expand your title to 50-60 characters to avoid truncation. Google does not enforce a character limit but truncates based on pixel width (~600px on desktop).`,data:{value:r,length:i}}):i>60&&n.push({ruleId:`title`,ruleName:`Page Title`,message:`Title is over 60 characters - likely to be truncated in search results`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Shorten your title to under 60 characters to avoid truncation. Google truncates based on pixel width (~600px on desktop), which is roughly 60 characters.`,data:{value:r,length:i}}):n.push({ruleId:`title`,ruleName:`Page Title`,message:`Missing title tag`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add a <title>Your Page Title</title> tag inside your <head> element. Aim for 50-60 characters to avoid truncation in search results.`,data:{value:r,length:i}}),n}},{meta:{id:`meta-description`,name:`Meta Description`,category:`SEO`,tier:`free`,description:`Checks for the presence and length of the meta description tag`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[name="description"]`)?.getAttribute(`content`)?.trim()||``,i=r.length;return r?i<120?n.push({ruleId:`meta-description`,ruleName:`Meta Description`,message:`Meta description may be too short - under 120 characters may not fully utilize the available snippet space`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Expand your meta description to 150-160 characters. Google does not enforce a character limit but typically truncates around 160 characters on desktop (~120 on mobile).`,data:{value:r,length:i}}):i>160&&n.push({ruleId:`meta-description`,ruleName:`Meta Description`,message:`Meta description is over 160 characters - likely to be truncated in search results`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Shorten your meta description to under 160 characters. Google truncates snippets based on device width, typically around 160 characters on desktop.`,data:{value:r,length:i}}):n.push({ruleId:`meta-description`,ruleName:`Meta Description`,message:`Missing meta description`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta name="description" content="Your description here" /> to your <head> tag. Aim for 150-160 characters to avoid truncation.`,data:{value:r,length:i}}),n}},{meta:{id:`og-title`,name:`Open Graph Title`,category:`SEO`,tier:`free`,description:`Checks for the og:title meta tag`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:title"]`)?.getAttribute(`content`)?.trim()||``;return r?r.length>60?n.push({ruleId:`og-title`,ruleName:`Open Graph Title`,message:`og:title is long (${r.length} characters). Optimal: 50-60 characters`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Shorten your og:title to under 60 characters. Longer titles get truncated on most social platforms.`,data:{value:r,length:r.length}}):r.length<30&&n.push({ruleId:`og-title`,ruleName:`Open Graph Title`,message:`og:title is short (${r.length} characters). Optimal: 50-60 characters`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`Consider expanding your og:title to 50-60 characters to make social shares more compelling.`,data:{value:r,length:r.length}}):n.push({ruleId:`og-title`,ruleName:`Open Graph Title`,message:`Missing og:title tag - social media shares will have no title preview`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta property="og:title" content="Your Page Title" /> to your <head> tag.`}),n}},{meta:{id:`og-description`,name:`Open Graph Description`,category:`SEO`,tier:`free`,description:`Checks for the og:description meta tag`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:description"]`)?.getAttribute(`content`)?.trim()||``;return r?r.length>200?n.push({ruleId:`og-description`,ruleName:`Open Graph Description`,message:`og:description is long (${r.length} characters). Optimal: 110-160 characters`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Shorten your og:description to under 200 characters. Most platforms truncate longer descriptions.`,data:{value:r,length:r.length}}):r.length<70&&n.push({ruleId:`og-description`,ruleName:`Open Graph Description`,message:`og:description is short (${r.length} characters). Optimal: 110-160 characters`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`Consider expanding your og:description to 110-160 characters to make social shares more engaging.`,data:{value:r,length:r.length}}):n.push({ruleId:`og-description`,ruleName:`Open Graph Description`,message:`Missing og:description tag - social media shares will have no description preview`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta property="og:description" content="Your description" /> to your <head> tag.`}),n}},{meta:{id:`og-image`,name:`Open Graph Image`,category:`SEO`,tier:`free`,description:`Checks for the og:image meta tag`},run(e){let{document:t}=e,n=[];return t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`)||n.push({ruleId:`og-image`,ruleName:`Open Graph Image`,message:`Missing og:image tag - social media shares will have no image preview`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta property="og:image" content="https://yoursite.com/image.jpg" /> to your <head> tag.`}),n}},{meta:{id:`og-url`,name:`Open Graph URL`,category:`SEO`,tier:`free`,description:`Checks for the og:url meta tag`},run(e){let{document:t}=e,n=[];return t.querySelector(`meta[property="og:url"]`)?.getAttribute(`content`)||n.push({ruleId:`og-url`,ruleName:`Open Graph URL`,message:`Missing og:url tag - social media may not show the correct URL`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta property="og:url" content="https://yoursite.com/page" /> to your <head> tag.`}),n}},{meta:{id:`twitter-card`,name:`Twitter Card`,category:`SEO`,tier:`free`,description:`Checks for Twitter Card meta tags`},run(e){let{document:t}=e,n=[];return t.querySelector(`meta[name="twitter:card"]`)?.getAttribute(`content`)||n.push({ruleId:`twitter-card`,ruleName:`Twitter Card`,message:`Missing Twitter Card tags - tweets with your URL will have no preview card`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta name="twitter:card" content="summary_large_image" />, <meta name="twitter:title" content="..." />, and <meta name="twitter:image" content="..." /> to your <head>.`}),n}},{meta:{id:`canonical-url`,name:`Canonical URL`,category:`SEO`,tier:`free`,description:`Checks for a canonical link tag and validates the URL`},run(e){let{document:t}=e,n=[],r=t.querySelector(`link[rel="canonical"]`),i=r?.getAttribute(`href`)||void 0;return r?i&&!i.startsWith(`http`)&&n.push({ruleId:`canonical-url`,ruleName:`Canonical URL`,message:`Canonical URL should be absolute (include protocol and domain)`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Change your canonical href to an absolute URL starting with https:// (e.g., href="https://yoursite.com/page").`,data:{present:!0,value:i}}):n.push({ruleId:`canonical-url`,ruleName:`Canonical URL`,message:`No canonical link found (recommended for SEO)`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`Add <link rel="canonical" href="https://yoursite.com/this-page" /> to your <head> tag to prevent duplicate content issues.`,data:{present:!1}}),n}},{meta:{id:`robots-noindex`,name:`Robots Noindex`,category:`Pre-Launch`,tier:`free`,description:`Checks for noindex/nofollow in the robots meta tag`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[name="robots"]`)?.getAttribute(`content`)||``;return r.includes(`noindex`)&&n.push({ruleId:`robots-noindex`,ruleName:`Robots Noindex`,message:`Page has noindex meta tag - WILL NOT BE INDEXED by search engines! Remove this before launch or you'll get ZERO organic traffic.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`free`,fix:`Remove the <meta name="robots" content="noindex" /> tag from your <head>, or change it to content="index, follow".`,data:{metaRobots:r}}),r.includes(`nofollow`)&&n.push({ruleId:`robots-noindex`,ruleName:`Robots Noindex`,message:`Page has nofollow meta tag - links will not be followed`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Remove "nofollow" from your <meta name="robots"> content if you want search engines to follow your links.`,data:{metaRobots:r}}),n}},{meta:{id:`heading-structure`,name:`Heading Structure`,category:`SEO`,tier:`free`,description:`Validates H1 tag presence, count, and heading hierarchy`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`h1`),i=r.length,a=Array.from(r).map(e=>e.textContent?.trim()||``);i===0?n.push({ruleId:`heading-structure`,ruleName:`Heading Structure`,message:`No H1 tag found`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add a single <h1> tag to your page with a clear, descriptive heading that includes your primary keyword.`,data:{h1Count:i}}):i>1&&n.push({ruleId:`heading-structure`,ruleName:`Heading Structure`,message:`Multiple H1 tags found (${i}). Best practice is 1 per page`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`While Google does not penalize multiple H1 tags, using a single H1 per page is a widely recommended best practice for clarity and accessibility.`,data:{h1Count:i,h1Values:a}}),a.forEach((e,t)=>{e?e.length>70&&n.push({ruleId:`heading-structure`,ruleName:`Heading Structure`,message:`H1 #${t+1} is too long (${e.length} characters)`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`Shorten your H1 to under 70 characters for better readability and SEO.`}):n.push({ruleId:`heading-structure`,ruleName:`Heading Structure`,message:`H1 #${t+1} is empty`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add descriptive text content to your <h1> tag.`})});let o=t.querySelectorAll(`h1, h2, h3, h4, h5, h6`),s=0;return Array.from(o).forEach(e=>{let t=Number.parseInt(e.tagName[1]??`1`,10);if(t-s>1){let t=e.textContent?.trim().substring(0,40)||`...`;n.push({ruleId:`heading-structure`,ruleName:`Heading Structure`,message:`${e.tagName} skips heading level from h${s} (content: "${t}")`,severity:`INFO`,category:`SEO`,tier:`free`,fix:`Don't skip heading levels. Use h${s+1} instead of ${e.tagName} to maintain proper hierarchy.`})}s=t}),n}},{meta:{id:`html-lang`,name:`HTML Lang Attribute`,category:`Accessibility`,tier:`free`,description:`Checks for the lang attribute on the <html> tag`},run(e){let{document:t}=e,n=[];return t.documentElement.getAttribute(`lang`)||n.push({ruleId:`html-lang`,ruleName:`HTML Lang Attribute`,message:`Missing lang attribute on <html> tag`,severity:`WARNING`,category:`Accessibility`,tier:`free`,fix:`Add lang="en" (or your language code) to your <html> tag: <html lang="en">.`,data:{present:!1}}),n}},{meta:{id:`viewport`,name:`Viewport Meta Tag`,category:`SEO`,tier:`free`,description:`Checks for the viewport meta tag for mobile responsiveness`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[name="viewport"]`);if(!r)n.push({ruleId:`viewport`,ruleName:`Viewport Meta Tag`,message:`Missing viewport meta tag - page will not render properly on mobile devices`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <meta name="viewport" content="width=device-width, initial-scale=1" /> to your <head> tag.`,data:{present:!1}});else{let e=r.getAttribute(`content`)||``,t=/user-scalable\s*=\s*no/i.test(e),i=e.match(/maximum-scale\s*=\s*([\d.]+)/i),a=i&&parseFloat(i[1])<2;(t||a)&&n.push({ruleId:`viewport`,ruleName:`Viewport Meta Tag`,message:`Viewport disables or restricts user zoom - this fails WCAG 1.4.4 (Resize text) which requires at least 200% zoom`,severity:`WARNING`,category:`Accessibility`,tier:`free`,fix:`Remove user-scalable=no and ensure maximum-scale is at least 2.0 (or remove it entirely) to allow users to zoom.`})}return n}},{meta:{id:`favicon`,name:`Favicon`,category:`SEO`,tier:`free`,description:`Checks for the presence of a favicon link tag`},run(e){let{document:t}=e,n=[];return t.querySelector(`link[rel*="icon"]`)||n.push({ruleId:`favicon`,ruleName:`Favicon`,message:`No favicon found - browsers will show a default icon in tabs and bookmarks`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add <link rel="icon" href="/favicon.ico" /> to your <head> tag. Include multiple sizes for best results.`,data:{present:!1}}),n}},{meta:{id:`anchor-missing-href`,name:`Anchor Missing Href`,category:`SEO`,tier:`free`,description:`Checks that all <a> elements have a valid href attribute`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`a`),i=[];for(let e of r){let t=e.getAttribute(`href`);if(!t||t.trim()===``){let t=e.textContent?.trim()||``,n=t.length>50?t.slice(0,50)+`…`:t;i.push(n||`<empty>`)}}return i.length>0&&n.push({ruleId:`anchor-missing-href`,ruleName:`Anchor Missing Href`,message:`${i.length} <a> element(s) missing a valid href attribute: ${i.join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`free`,fix:`Add a valid href attribute to all <a> elements. Links without href are not crawlable by search engines and inaccessible to keyboard/screen reader users. If the element is not a link, use a <button> or <span> instead.`,data:{count:i.length,anchors:i}}),n}}];new Map(xt.map(e=>[e.meta.id,e]));function St(e){let t=e.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);if(!t)return!1;let[,n,r]=t.map(Number);return n===10||n===172&&r>=16&&r<=31||n===192&&r===168||n===127||n===169&&r===254||n===0||n===100&&r>=64&&r<=127||n===198&&(r===18||r===19)||n>=224}function Ct(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase();if(St(t))return!0;if(!t.includes(`:`))return!1;let n=t.match(/^::(?:ffff:)?(\d{1,3}(?:\.\d{1,3}){3})$/);if(n)return St(n[1]);let r=t.match(/^::(?:ffff:)?([0-9a-f]{1,4}):([0-9a-f]{1,4})$/);if(r){let e=parseInt(r[1],16),t=parseInt(r[2],16);if(St([e>>8,e&255,t>>8,t&255].join(`.`)))return!0}return!!(t===`::`||t===`::1`||/^f[cd][0-9a-f]{0,2}:/.test(t)||/^fe[89ab][0-9a-f]?:/.test(t)||t.startsWith(`::ffff:`))}function wt(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase(),n=t.match(/^(\d{1,3})\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);if(n)return Number(n[1])===127;if(t===`::1`)return!0;let r=t.match(/^::ffff:(\d{1,3})\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);if(r)return Number(r[1])===127;let i=t.match(/^::ffff:([0-9a-f]{1,4}):[0-9a-f]{1,4}$/);return i?parseInt(i[1],16)>>8==127:!1}function Tt(e){return e.port?e.port:e.protocol===`https:`?`443`:`80`}function Et(e,t){if(!t)return!1;let n=e=>e.replace(/^\[|\]$/g,``).toLowerCase();return n(e)===n(t.loopbackHost)}function Dt(e,t,n){return n?Et(e,n)&&t===n.port:!1}function Ot(e){return!!(e===`localhost`||e===`127.0.0.1`||e===`[::1]`||e===`0.0.0.0`||e.endsWith(`.internal`)||e.endsWith(`.local`)||e.endsWith(`.localhost`)||Ct(e))}async function kt(e,t,n,r){let i=e.replace(/^\[|\]$/g,``),a=Date.now();n?.({step:`dns`,status:`start`,host:i});try{let{address:e}=await s.lookup(i);if(!(!Ct(e)||Dt(i,t,r)&&wt(e))){let e=`URLs pointing to private or internal addresses are not allowed`;throw n?.({step:`dns`,status:`fail`,host:i,error:e}),Error(e)}let o=Date.now()-a;return n?.({step:`dns`,status:`ok`,host:i,address:e,ms:o}),{address:e,ms:o}}catch(e){if(e instanceof Error&&e.message.includes(`private or internal`))throw e;let t=`Could not resolve hostname`;throw n?.({step:`dns`,status:`fail`,host:i,error:t}),Error(t)}}function At(e=c,t){return function(n,r,i){let a=r??{};e(n,{...a,all:!0},(e,r)=>{if(e){i(e,``,void 0);return}let o=Et(n,t),s=r.filter(e=>!Ct(e.address)||o&&wt(e.address));if(s.length===0){i(Error(`URLs pointing to private or internal addresses are not allowed`),``,void 0);return}if(a.all){i(null,s);return}i(null,s[0].address,s[0].family)})}}var jt,Mt=8,Nt=new Map;function Pt(e){let t=(0,bt.buildConnector)({lookup:At(void 0,e)}),n=(0,bt.buildConnector)({lookup:At(void 0,void 0)});return function(r,i){let a=String(r.hostname??``).replace(/^\[|\]$/g,``),o=Dt(a,String(r.port??``)||(String(r.protocol??``)===`https:`?`443`:`80`),e);if(l(a)&&Ct(a)&&!(o&&wt(a))){i(Error(`URLs pointing to private or internal addresses are not allowed`),null);return}(o?t:n)(r,i)}}function Ft(e){if(!e)return jt??=new bt.Agent({connect:Pt()}),jt;let t=`${e.loopbackHost.toLowerCase()}:${e.port}`,n=Nt.get(t);if(!n&&(n=new bt.Agent({connect:Pt(e)}),Nt.set(t,n),Nt.size>Mt)){let e=Nt.keys().next().value;if(e!==void 0&&e!==t){let t=Nt.get(e);Nt.delete(e),t?.close()}}return n}function It(e,t,n){let r=Ft(n),i=Lt.getStore();return(0,bt.fetch)(e,{...t,dispatcher:i?zt(r,i):r})}var Lt=new u;function Rt(e,t){return e?Lt.run(e,t):t()}function zt(e,t){return e.compose(e=>(n,r)=>{let i;try{i=new URL(String(n.origin)).origin}catch{i=void 0}return i===t.origin?e({...n,headers:Bt(n.headers,t.headers)},r):e(n,r)})}function Bt(e,t){let n=Object.entries(t).flat();if(e==null)return{...t};if(Array.isArray(e))return[...e,...n];if(typeof e[Symbol.iterator]==`function`){let t=[];for(let[n,r]of e)if(r!==void 0)for(let e of Array.isArray(r)?r:[r])t.push(n,e);return[...t,...n]}return{...e,...t}}function Vt(e,t){let n;try{n=new URL(e)}catch{throw Error(`Invalid URL`)}if(n.protocol!==`http:`&&n.protocol!==`https:`)throw Error(`Only HTTP and HTTPS URLs are allowed`);if(n.hostname===`0.0.0.0`||n.hostname===`[::]`)throw Error(`URLs pointing to private or internal addresses are not allowed. 0.0.0.0 is a bind address rather than a destination: use http://127.0.0.1 with the same port.`);let r=Dt(n.hostname,Tt(n),t)&&(!Ct(n.hostname)||wt(n.hostname));if(Ot(n.hostname)&&!r)throw Error(`URLs pointing to private or internal addresses are not allowed`)}async function Ht(e,t,n){try{Vt(e,n),t?.({step:`validate`,status:`ok`})}catch(e){let n=e instanceof Error?e.message:`Invalid URL`;throw t?.({step:`validate`,status:`fail`,error:n}),e}let r=new URL(e);return kt(r.hostname,Tt(r),t,n)}var Ut=`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 LintPage/1.0 (+https://lintpage.com)`;async function Wt(e,t){let{onStep:n,grant:r}=t??{};await Ht(e,n,r);let i=Date.now();n?.({step:`fetch`,status:`start`,url:e});let a;try{a=await It(e,{headers:{"User-Agent":Ut,Accept:`text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8`,"Accept-Language":`en-US,en;q=0.9`,"Accept-Encoding":`gzip, deflate, br`},signal:AbortSignal.timeout(3e4)},r)}catch(e){let t=e instanceof Error?e.message:`fetch failed`;throw n?.({step:`fetch`,status:`fail`,error:t}),e}let o=Date.now()-i;if(!a.ok){let e=`Failed to fetch URL: ${a.status} ${a.statusText}`;throw n?.({step:`fetch`,status:`fail`,error:e,statusCode:a.status}),Object.assign(Error(e),{finalUrl:a.url})}n?.({step:`fetch`,status:`ok`,statusCode:a.status,contentType:a.headers.get(`content-type`),ttfbMs:o}),n?.({step:`parse`,status:`start`});let s;try{s=await a.text()}catch(e){let t=e instanceof Error?e.message:`failed to read body`;throw n?.({step:`parse`,status:`fail`,error:t}),e}let c;try{let{JSDOM:e}=await import(`jsdom`);c=new e(s).window.document,n?.({step:`parse`,status:`ok`,sizeBytes:Buffer.byteLength(s,`utf8`)})}catch(e){let t=e instanceof Error?e.message:`failed to parse HTML`;throw n?.({step:`parse`,status:`fail`,error:t}),e}return{document:c,response:a,html:s,ttfbMs:o}}var Gt={"Pre-Launch":25,SEO:30,"AI Visibility":10,Accessibility:20,Performance:15};function Kt(e){let t={};for(let e of Object.keys(Gt))t[e]={critical:0,warning:0,info:0};for(let n of e){let e=n.category;t[e]||(t[e]={critical:0,warning:0,info:0}),n.severity===`CRITICAL`?t[e].critical++:n.severity===`WARNING`?t[e].warning++:t[e].info++}let n={};for(let[e,r]of Object.entries(Gt)){let i=t[e]||{critical:0,warning:0,info:0},a=Math.min(100,i.critical*30+i.warning*5+i.info*1);n[e]={score:Math.round(r*(1-a/100)*10)/10,max:r,deductionPercent:a}}return n}function qt(e){let t=Kt(e),n=Object.values(t).reduce((e,t)=>e+t.score,0);return Math.round(n)}var Jt=new Set([`CRITICAL`,`WARNING`,`INFO`]),Yt=`ttfb`,Xt=`redirected-off-site`;function Zt(e){try{let t=new URL(e);return t.hash=``,t.href}catch{return e}}function Qt(e,t){if(!(typeof t!=`string`||!t)&&!(t===e||t===Zt(e)))return t}function $t(e,t){let n=en(e),r=en(t);return n&&r&&n!==r?r:null}function en(e){try{return new URL(e).hostname.toLowerCase().replace(/\.$/,``).replace(/^www\./,``)}catch{return null}}function tn(e,t){let n=$t(e,t);if(!n)return null;let r=``;try{r=new URL(t).pathname}catch{}let i=n===`vercel.com`&&(r.startsWith(`/sso-api`)||r.startsWith(`/login`));return{ruleId:Xt,ruleName:`Redirected to another site`,message:i?`This deployment is behind Vercel Deployment Protection: it redirected to the Vercel login page, so the audit checked that page instead of your site.`:`This URL redirected to ${n}, so the audit checked that site instead of this one.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`free`,fix:i?`Set VERCEL_AUTOMATION_BYPASS_SECRET to the project's Protection Bypass for Automation secret (Vercel: Settings, Deployment Protection), or turn off protection for this deployment.`:`Audit ${t} directly. If this redirect is intended, set the severity of \`${Xt}\` lower in your config.`,data:{from:e,to:t}}}function nn(e,t,n){let r=t?.rules;return r?e.map(e=>{if(!n.has(e.ruleId))return e;let t=r[e.ruleId];if(typeof t!=`object`||!t)return e;let i=t.severity;return!i||!Jt.has(i)||i===e.severity?e:{...e,severity:i}}):e}function rn(e,t,n){let r=[];for(let i of e){if(n?.rules){let e=n.rules[i.meta.id];if(e===!1||typeof e==`object`&&e.enabled===!1)continue}try{let e=i.run(t);r.push(...e)}catch(e){console.warn(`[lintpage] Rule "${i.meta.id}" threw an error: ${e instanceof Error?e.message:String(e)}`)}}return r}function an(e,t){if(!t?.rules)return!0;let n=t.rules[e];return!(n===!1||typeof n==`object`&&n.enabled===!1)}async function on(e,t,n){let r=e.filter(e=>an(e.meta.id,n)),i=await Promise.allSettled(r.map(e=>e.run(t))),a=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.status===`fulfilled`)a.push(...t.value);else{let n=t.reason;console.warn(`[lintpage] Async rule "${r[e].meta.id}" threw an error: ${n instanceof Error?n.message:String(n)}`)}}return a}async function sn(e,t,n){let r=e.filter(e=>an(e.meta.id,n)),i=await Promise.allSettled(r.map(e=>e.run(t))),a=[];for(let e=0;e<i.length;e++){let t=i[e];if(t.status===`fulfilled`)a.push(...t.value);else{let n=t.reason;console.warn(`[lintpage] Standalone rule "${r[e].meta.id}" threw an error: ${n instanceof Error?n.message:String(n)}`)}}return a}async function cn(e,t){let n=t?.onStep,r=[...xt],i=[],a=[];if(t?.plugins)for(let e of t.plugins)r.push(...e.rules),e.asyncRules&&i.push(...e.asyncRules),e.standaloneRules&&a.push(...e.standaloneRules);let o=null,s=0,c=null,l;try{let r=await Wt(e,{onStep:n,grant:t?.grant});l=Qt(e,r.response.url),o={document:r.document,url:e,response:r.response,isHttps:e.startsWith(`https://`)},s=r.ttfbMs}catch(t){let n=t instanceof Error?t.message:String(t),r=/Failed to fetch URL: (\d{3})/.exec(n);c={message:n,statusCode:r?Number(r[1]):void 0},l=Qt(e,t?.finalUrl)}let u=r.length+i.length+a.length;n?.({step:`rules`,status:`start`,count:u});let d=o?rn(r,o,t?.config):[],f=[];if(o&&i.length>0&&f.push(on(i,o,t?.config)),a.length>0&&f.push(sn(a,e,t?.config)),f.length>0){let e=await Promise.all(f);for(let t of e)d.push(...t)}if(c){let t=c.statusCode,n=l?$t(e,l):null,r=!n&&(t===403||t===429||t===503);d.push({ruleId:`target-unreachable`,ruleName:`Target unreachable to LintPage`,message:n?`The page redirected to ${n}, which ${t?`answered HTTP ${t}`:`could not be fetched`}. DOM-dependent checks were skipped; standalone checks still ran.`:r?`Your WAF or CDN blocked our outer probe (HTTP ${t}). DOM-dependent checks were skipped; AI visibility and other standalone checks still ran.`:`LintPage could not fetch the page (${c.message}). DOM-dependent checks were skipped; standalone checks (AI visibility, robots.txt, sitemap) still ran.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`free`,fix:n?`Check where ${e} redirects: the failing response came from ${n}, not from this site.`:r?'If you control this site: allow the `LintPage/1.0` token in your WAF or CDN rules. Our probe sends a Chrome-prefixed User-Agent containing "LintPage/1.0", so match on that token rather than on the whole string. If you don\'t control the site, the partial report below still shows what AI crawlers see.':`Verify the URL is reachable from the public internet and returns 2xx for a Chrome-like User-Agent within 30s.`,data:{statusCode:t,raw:c.message}})}if(t?.reportOffSiteRedirect&&l&&an(`redirected-off-site`,t?.config)){let t=tn(e,l);t&&d.push(t)}s>1800?d.push({ruleId:Yt,ruleName:`Time to First Byte`,message:`Slow server response time (TTFB: ${s}ms) - aim for under 800ms`,severity:`WARNING`,category:`Performance`,tier:`free`,fix:`Optimize server response time: enable caching, use a CDN, optimize database queries, or upgrade hosting.`,data:{ms:s}}):s>800&&d.push({ruleId:Yt,ruleName:`Time to First Byte`,message:`Server response time could be improved (TTFB: ${s}ms) - aim for under 800ms`,severity:`INFO`,category:`Performance`,tier:`free`,fix:`Consider enabling server-side caching or using a CDN to reduce response time.`,data:{ms:s}}),n?.({step:`rules`,status:`done`,found:d.length});let p=new Set([...r.map(e=>e.meta.id),...i.map(e=>e.meta.id),...a.map(e=>e.meta.id),Yt,Xt]),m=nn(t?.adjustResults?t.adjustResults(d):d,t?.config,p),h=Kt(m),g=Object.values(h).reduce((e,t)=>e+t.score,0),_=m.some(e=>e.severity===`CRITICAL`&&e.category!==`AI Visibility`),v=m.some(e=>e.severity===`CRITICAL`&&e.category===`AI Visibility`),y=_?`FAIL`:v?`AI-FAIL`:`PASS`;return{url:e,timestamp:new Date().toISOString(),results:m,score:Math.round(g),overallStatus:y,categoryScores:h,...l?{finalUrl:l}:{}}}var ln=[`.lintpagerc.json`,`.lintpagerc`,`lintpage.config.json`];function un(e){let t=e||process.cwd();if(e&&f(e)&&m(e).isFile())try{let t=p(e,`utf-8`);return JSON.parse(t)}catch{return null}let n=t;for(let e of ln){let t=g(n,e);if(f(t))try{let e=p(t,`utf-8`);return JSON.parse(e)}catch{return null}}return null}function dn(){return{rules:{}}}var fn={meta:{id:`ssl`,name:`SSL / HTTPS`,category:`Pre-Launch`,tier:`pro`,description:`Checks that the site is served over HTTPS`},run(e){let t=[];return e.isHttps||t.push({ruleId:`ssl`,ruleName:`SSL / HTTPS`,message:`Site is not using HTTPS - required for SEO and user trust. Search engines penalize HTTP sites.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Install an SSL certificate and redirect all HTTP traffic to HTTPS. Most hosting providers offer free SSL via Let's Encrypt.`}),t}},pn={meta:{id:`robots-txt-check`,name:`robots.txt Check`,category:`Pre-Launch`,tier:`pro`,description:`Fetches and validates robots.txt for proper directives`},async run(e){let t=[];try{let n=new URL(`/robots.txt`,e).href,r=await It(n,{headers:{"User-Agent":`LintPage-Bot/1.0`}});if(!r.ok)return t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`No robots.txt file found - recommended to have one`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Create a robots.txt file at your site root with at least "User-Agent: *" and "Allow: /" directives.`}),t;let i=await r.text(),a=i.split(`
|
|
97
|
-
`).map(e=>e.trim()),o=new Map,s=`*`;for(let e of a){if(!e||e.startsWith(`#`))continue;let[t,...n]=e.split(`:`).map(e=>e.trim()),r=n.join(`:`).trim();if(!t||!r)continue;let i=t.toUpperCase();if(i===`USER-AGENT`)s=r,o.has(s)||o.set(s,{disallow:[],allow:[]});else if(i===`DISALLOW`){let e=o.get(s)||{disallow:[],allow:[]};e.disallow.push(r),o.set(s,e)}else if(i===`ALLOW`){let e=o.get(s)||{disallow:[],allow:[]};e.allow.push(r),o.set(s,e)}}let c=o.get(`*`);c&&c.disallow.includes(`/`)&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt contains "Disallow: /" for User-Agent: * - this blocks ALL search engines from crawling your entire site!`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Change "Disallow: /" to "Allow: /" in your robots.txt, or remove the Disallow directive entirely.`}),i.toLowerCase().includes(`sitemap`)||t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt does not reference sitemap.xml - consider adding a Sitemap directive`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Add "Sitemap: https://yoursite.com/sitemap.xml" to the end of your robots.txt file.`}),a.some(e=>!e||e.startsWith(`#`)?!1:!e.includes(`:`)&&e.length>0)&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt may have syntax errors - ensure each directive follows "Directive: value" format`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Review each line in robots.txt. Every directive must follow the "Directive: value" format (e.g., "User-Agent: *").`}),(o.size===0||o.size===1&&!o.has(`*`))&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt exists but has no rules defined - add User-Agent and Disallow/Allow directives`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Add at minimum "User-Agent: *" followed by "Allow: /" to your robots.txt.`})}catch{t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`Could not fetch robots.txt - ensure it exists at root domain`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Create a robots.txt file at your domain root (e.g., https://yoursite.com/robots.txt).`})}return t}},mn={meta:{id:`sitemap-presence`,name:`Sitemap Presence`,category:`Pre-Launch`,tier:`pro`,description:`Checks for the existence and validity of sitemap.xml`},async run(e){let t=[];try{let n=new URL(`/sitemap.xml`,e).href,r=await It(n,{headers:{"User-Agent":`LintPage-Bot/1.0`}});if(!r.ok)return t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`No sitemap.xml found - recommended for search engines to discover your pages`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Generate a sitemap.xml and place it at your domain root. Most frameworks (Next.js, WordPress) have built-in sitemap generation.`}),t;let i=await r.text(),a=i.includes(`<urlset`),o=i.includes(`<sitemapindex`);if((!i.includes(`<?xml`)||!a&&!o)&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`sitemap.xml exists but may not be valid XML format`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Ensure your sitemap.xml starts with <?xml version="1.0"?> and uses the <urlset> or <sitemapindex> element with proper namespace.`}),o){let e=i.match(/<sitemap>/g);return(!e||e.length===0)&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`Sitemap index file is empty - add child sitemap references`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Add <sitemap><loc>https://yoursite.com/sitemap-pages.xml</loc></sitemap> entries to your sitemap index.`}),t}let s=i.match(/<loc>/g);(s?s.length:0)===0&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`sitemap.xml is empty - add URLs to help search engines discover content`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Add <url><loc>https://yoursite.com/page</loc></url> entries to your sitemap for each page you want indexed.`})}catch{t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`Could not fetch sitemap.xml - create one at /sitemap.xml`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Create a sitemap.xml at your domain root. Use a sitemap generator or your framework's built-in sitemap feature.`})}return t}},hn=[`googletagmanager.com`,`google-analytics.com`,`plausible.io`,`usefathom.com`,`posthog.com`,`mixpanel.com`,`mxpnl.com`,`va.vercel-scripts.com`,`vitals.vercel-insights.com`,`cloudflareinsights.com`,`umami.is`,`clarity.ms`];function gn(e){let t=e.toLowerCase().replace(/\.$/,``);return hn.some(e=>t===e||t.endsWith(`.${e}`))}function _n(e,t){let n=new Set([`preconnect`,`dns-prefetch`,`preload`,`modulepreload`]);for(let r of Array.from(e.querySelectorAll(`link[rel][href]`)))if((r.getAttribute(`rel`)||``).toLowerCase().split(/\s+/).some(e=>n.has(e)))try{let{hostname:e}=new URL(r.getAttribute(`href`)||``,t);if(gn(e))return!0}catch{}return!1}function vn(e){if(e.startsWith(`'`))return null;let t=e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``);return t===e&&t.endsWith(`:`)?null:(t=t.split(`/`)[0].replace(/:[0-9*]+$/,``).replace(/^\*\./,``),t.includes(`.`)?t:null)}function yn(e){let t=[];for(let n of[`content-security-policy`,`content-security-policy-report-only`]){let r=e.response?.headers?.get(n);r&&t.push(r)}for(let n of Array.from(e.document.querySelectorAll(`meta[http-equiv]`)))(n.getAttribute(`http-equiv`)||``).toLowerCase()===`content-security-policy`&&t.push(n.getAttribute(`content`)||``);return t.some(e=>e.split(/[;,]/).flatMap(e=>e.trim().split(/\s+/).slice(1)).some(e=>{let t=vn(e);return t!==null&&gn(t)}))}var bn={meta:{id:`tracking`,name:`Analytics Tracking`,category:`Pre-Launch`,tier:`pro`,description:`Checks for an analytics service (Google Analytics, Tag Manager, Plausible, PostHog and others) in the page scripts, resource hints and Content-Security-Policy`},run(e){let{document:t}=e,n=[],r=!1,i=t.querySelectorAll(`script`),a=t.documentElement?.outerHTML||``;return i.forEach(e=>{let t=e.getAttribute(`src`)||``,n=e.textContent||``;(t.includes(`googletagmanager.com/gtag/js`)||n.includes(`gtag(`))&&(r=!0),(t.includes(`googletagmanager.com/gtm.js`)||n.includes(`GTM-`))&&(r=!0),t.includes(`plausible.io/js/`)&&(r=!0),(t.includes(`usefathom.com/script.js`)||t.includes(`cdn.usefathom.com`))&&(r=!0),(t.includes(`matomo.js`)||t.includes(`matomo.php`)||t.includes(`piwik.js`))&&(r=!0),(t.includes(`posthog-js`)||t.includes(`i.posthog.com`))&&(r=!0),(t.includes(`cdn.mxpnl.com`)||t.includes(`mixpanel.com`))&&(r=!0),(t.includes(`va.vercel-scripts.com`)||t.includes(`vitals.vercel-insights.com`))&&(r=!0),t.includes(`static.cloudflareinsights.com`)&&(r=!0),(t.includes(`umami.js`)||t.includes(`umami.is/script.js`))&&(r=!0),t.includes(`clarity.ms/tag`)&&(r=!0)}),!r&&(a.includes(`@vercel/analytics`)||a.includes(`vercel-analytics`))&&(r=!0),!r&&_n(t,e.url)&&(r=!0),!r&&yn(e)&&(r=!0),r||n.push({ruleId:`tracking`,ruleName:`Analytics Tracking`,message:`No analytics script found in the page HTML or headers. Analytics loaded from a JavaScript bundle cannot be detected, so check this yourself`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`If the site has no analytics, add one to measure traffic after launch. Options include Google Analytics, Plausible, Fathom, Matomo, PostHog, Vercel Analytics, Umami, or Cloudflare Web Analytics. If it loads analytics from its own JavaScript, nothing needs to change.`,data:{foundAnalytics:r}}),n}},xn={meta:{id:`x-robots-tag`,name:`X-Robots-Tag Header`,category:`Pre-Launch`,tier:`pro`,description:`Checks the X-Robots-Tag HTTP header for noindex/nofollow`},run(e){let{response:t}=e,n=[],r=t.headers.get(`x-robots-tag`);if(!r)return n;let i=r.toLowerCase();return i.includes(`noindex`)&&n.push({ruleId:`x-robots-tag`,ruleName:`X-Robots-Tag Header`,message:`X-Robots-Tag HTTP header contains "noindex" - page will NOT be indexed by search engines!`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Remove the X-Robots-Tag header from your server configuration, or change its value to "index, follow".`,data:{value:r}}),i.includes(`nofollow`)&&n.push({ruleId:`x-robots-tag`,ruleName:`X-Robots-Tag Header`,message:`X-Robots-Tag HTTP header contains "nofollow" - links will not be followed by search engines`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove "nofollow" from the X-Robots-Tag header if you want search engines to follow your links.`,data:{value:r}}),n}},Sn={meta:{id:`thin-content`,name:`Thin Content`,category:`SEO`,tier:`pro`,description:`Checks that the page has sufficient text content for search engines`},run(e){let{document:t}=e,n=[],r=(t.body?.textContent||``).trim().split(/\s+/).filter(Boolean).length;return r<300&&n.push({ruleId:`thin-content`,ruleName:`Thin Content`,message:`Page has thin content (${r} words) - search engines prefer pages with substantial content (300+ words)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add more meaningful text content to the page. Search engines rank pages with substantial, relevant content higher.`,data:{wordCount:r}}),n}},Cn={meta:{id:`duplicate-meta`,name:`Duplicate Meta Tags`,category:`SEO`,tier:`pro`,description:`Checks for duplicate title, meta description, and canonical tags`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`title`);r.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${r.length} <title> tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <title> tags. Keep only one in your <head> element.`,data:{count:r.length,tag:`title`}});let i=t.querySelectorAll(`meta[name="description"]`);i.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${i.length} meta description tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <meta name="description"> tags. Keep only one in your <head> element.`,data:{count:i.length,tag:`meta-description`}});let a=t.querySelectorAll(`link[rel="canonical"]`);return a.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${a.length} canonical link tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <link rel="canonical"> tags. Keep only one in your <head> element.`,data:{count:a.length,tag:`canonical`}}),n}},wn={meta:{id:`structured-data`,name:`Structured Data`,category:`SEO`,tier:`pro`,description:`Checks for the presence and validity of JSON-LD structured data`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`script[type="application/ld+json"]`),i=[];return r.forEach(e=>{try{let t=JSON.parse(e.textContent||``);if(Array.isArray(t[`@graph`]))for(let e of t[`@graph`])e[`@type`]&&i.push(e[`@type`]);else t[`@type`]&&i.push(t[`@type`])}catch{n.push({ruleId:`structured-data`,ruleName:`Structured Data`,message:`Invalid JSON-LD structured data found`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Validate your JSON-LD using Google's Rich Results Test tool and fix any JSON syntax errors.`})}}),i.length===0&&n.push({ruleId:`structured-data`,ruleName:`Structured Data`,message:`No structured data (JSON-LD) found`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add a <script type="application/ld+json"> block with Organization, WebPage, or other relevant schema.org types.`,data:{types:i}}),n}},Tn={meta:{id:`charset`,name:`Character Encoding`,category:`SEO`,tier:`pro`,description:`Checks for a proper charset/encoding declaration`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[charset]`),i=t.querySelector(`meta[http-equiv="Content-Type"]`);return!r&&!i&&n.push({ruleId:`charset`,ruleName:`Character Encoding`,message:`Missing character encoding declaration - may cause rendering issues with special characters`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta charset="utf-8" /> as the first element in your <head> tag.`}),n}},En={meta:{id:`image-alt-text`,name:`Image Alt Text`,category:`Accessibility`,tier:`pro`,description:`Checks that all images have alt attributes`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=0;return r.forEach(e=>{e.getAttribute(`alt`)??i++}),i>0&&n.push({ruleId:`image-alt-text`,ruleName:`Image Alt Text`,message:`${i} of ${r.length} images missing alt attributes`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add descriptive alt attributes to all images. Screen readers use alt text to describe images to visually impaired users. Use alt="" for decorative images.`,data:{total:r.length,missingAlt:i}}),n}},Dn={meta:{id:`accessibility`,name:`Accessibility & ARIA`,category:`Accessibility`,tier:`pro`,description:`Checks buttons, links, inputs, and ARIA attributes for accessibility`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`button`),i=0;r.forEach(e=>{let t=e.textContent?.trim(),n=e.getAttribute(`aria-label`),r=e.getAttribute(`aria-labelledby`);!t&&!n&&!r&&i++}),i>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${i} button(s) missing accessible name (no text, aria-label, or aria-labelledby)`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add visible text content, an aria-label, or aria-labelledby attribute to each button.`,data:{inaccessibleButtons:i}});let a=t.querySelectorAll(`a`),o=0;a.forEach(e=>{let t=e.textContent?.trim(),n=e.getAttribute(`aria-label`),r=e.getAttribute(`aria-labelledby`);!t&&!n&&!r&&o++}),o>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${o} link(s) missing accessible name (no text, aria-label, or aria-labelledby)`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add descriptive text content, an aria-label, or aria-labelledby attribute to each link so screen readers can identify it.`,data:{inaccessibleLinks:o}});let s=t.querySelectorAll(`input:not([type='hidden'])`),c=0;s.forEach(e=>{let n=e.getAttribute(`id`),r=e.getAttribute(`aria-label`),i=e.getAttribute(`aria-labelledby`),a=e.getAttribute(`title`),o=n&&t.querySelector(`label[for="${n}"]`),s=e.closest(`label`)!==null;!o&&!s&&!r&&!i&&!a&&c++}),c>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${c} input(s) missing associated label`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add a <label for="inputId"> element, or add an aria-label attribute to each input.`,data:{unlabeledInputs:c}});let l=t.querySelectorAll(`div[onclick], span[onclick]`),u=0;l.forEach(e=>{e.getAttribute(`role`)||u++}),u>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${u} interactive div/span element(s) missing role attribute`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Use a <button> element instead, or add role="button" and an aria-label to interactive elements.`,data:{missingRoles:u}});let d=t.querySelectorAll(`nav, [role="navigation"]`),f=0;return d.forEach(e=>{let t=e.getAttribute(`aria-label`),n=e.getAttribute(`aria-labelledby`);!t&&!n&&f++}),f>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${f} navigation element(s) missing aria-label or aria-labelledby`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add aria-label="Main navigation" (or similar descriptive label) to your <nav> elements.`,data:{unlabeledNav:f}}),n}},On={meta:{id:`semantic-structure`,name:`Semantic Structure`,category:`Accessibility`,tier:`pro`,description:`Checks for proper semantic HTML: landmarks, lists, tables, articles`},run(e){let{document:t}=e,n=[];t.querySelector(`main`)||n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`Missing <main> element - should wrap primary page content for better structure`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Wrap your primary page content in a <main> element. There should be exactly one per page.`}),t.querySelectorAll(`main, section, article, aside, nav`).length===0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`Missing semantic page regions - use <main>, <section>, <article>, <nav>, <aside> instead of generic divs`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Replace generic <div> containers with semantic elements: <main>, <nav>, <section>, <article>, <aside>.`});let r=t.querySelectorAll(`li`),i=0;r.forEach(e=>{let t=e.parentElement;t?.tagName!==`UL`&&t?.tagName!==`OL`&&i++}),i>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${i} <li> element(s) found outside of <ul> or <ol> - breaks semantic structure`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Wrap <li> elements inside a <ul> (unordered) or <ol> (ordered) list element.`,data:{orphanedLi:i}});let a=t.querySelectorAll(`table`),o=0;a.forEach(e=>{e.querySelector(`th`)||o++}),o>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${o} table(s) missing <th> header cells`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add <th> cells to define table column or row headers. Optionally wrap them in a <thead> element for additional structure.`,data:{tablesWithoutHeaders:o}});let s=t.querySelectorAll(`article`),c=0;return s.forEach(e=>{e.querySelector(`h1, h2, h3, h4, h5, h6`)||c++}),c>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${c} <article> element(s) without a heading`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add a heading (h2-h6) inside each <article> element to provide context.`,data:{articlesWithoutHeading:c}}),n}},kn={meta:{id:`performance`,name:`Performance Hints`,category:`Performance`,tier:`pro`,description:`Checks for inline styles, lazy loading, and script count`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=Array.from(r).slice(3),a=0;i.forEach(e=>{e.getAttribute(`loading`)||a++}),a>0&&n.push({ruleId:`performance`,ruleName:`Performance Hints`,message:`${a} below-the-fold image(s) without loading="lazy" - add lazy loading to defer offscreen images`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add loading="lazy" to images below the fold. Do NOT add loading="lazy" to above-the-fold or LCP images - this hurts performance (per web.dev).`,data:{noLazyLoad:a,totalImages:r.length}});let o=t.querySelectorAll(`script[src]`);return o.length>10&&n.push({ruleId:`performance`,ruleName:`Performance Hints`,message:`Consider reducing external scripts (${o.length} found) for better performance`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Audit your scripts and remove unused ones. Consider bundling or deferring non-critical scripts.`,data:{scriptCount:o.length}}),n}},An={meta:{id:`image-dimensions`,name:`Image Dimensions`,category:`Performance`,tier:`pro`,description:`Checks that images have explicit width and height to prevent layout shift (CLS)`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=0;return r.forEach(e=>{let t=e.getAttribute(`width`),n=e.getAttribute(`height`);(!t||!n)&&i++}),i>0&&n.push({ruleId:`image-dimensions`,ruleName:`Image Dimensions`,message:`${i} image${i===1?``:`s`} missing explicit width/height attributes - causes layout shift (CLS)`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add width and height attributes to <img> tags to reserve space and prevent layout shift.`,data:{missingCount:i,totalImages:r.length}}),n}},jn={meta:{id:`ttfb-pro`,name:`Time to First Byte (Pro)`,category:`Performance`,tier:`pro`,description:`Measures server response time (TTFB) with detailed thresholds`},async run(e){let t=[];try{let n=Date.now();await It(e,{headers:{"User-Agent":`LintPage-Bot/1.0`}});let r=Date.now()-n;r>1800?t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Slow server response time (TTFB: ${r}ms) - aim for under 800ms`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Optimize server response time: enable caching, use a CDN, optimize database queries, or upgrade hosting.`,data:{ms:r}}):r>800&&t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Server response time could be improved (TTFB: ${r}ms) - aim for under 800ms`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Consider enabling server-side caching or using a CDN to reduce response time.`,data:{ms:r}})}catch{t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Could not measure TTFB - server may be unreachable`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Ensure your server is accessible and responding to requests.`})}return t}},Mn={meta:{id:`mixed-content`,name:`Mixed Content`,category:`Pre-Launch`,tier:`pro`,description:`Checks for HTTP resources loaded on an HTTPS page (mixed content)`},run(e){let{document:t,isHttps:n}=e,r=[];if(!n)return r;let i=[`img[src^="http:"]`,`script[src^="http:"]`,`link[href^="http:"]`,`iframe[src^="http:"]`,`video[src^="http:"]`,`audio[src^="http:"]`,`object[data^="http:"]`,`source[src^="http:"]`],a=0;return i.forEach(e=>{a+=t.querySelectorAll(e).length}),a>0&&r.push({ruleId:`mixed-content`,ruleName:`Mixed Content`,message:`Found ${a} mixed content resource${a===1?``:`s`} (HTTP on HTTPS page) - browsers may block these`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Change all resource URLs from http:// to https:// or use protocol-relative URLs (//).`,data:{count:a}}),r}},Nn={meta:{id:`security-headers`,name:`Security Headers`,category:`Pre-Launch`,tier:`pro`,description:`Checks for important security headers (CSP, HSTS, X-Content-Type-Options, Permissions-Policy)`},run(e){let{response:t}=e,n=[],r=[{name:`content-security-policy`,label:`Content-Security-Policy`},{name:`strict-transport-security`,label:`Strict-Transport-Security (HSTS)`},{name:`x-content-type-options`,label:`X-Content-Type-Options`},{name:`permissions-policy`,label:`Permissions-Policy`}],i=[];return r.forEach(({name:e,label:n})=>{t.headers.get(e)||i.push(n)}),i.length>0&&n.push({ruleId:`security-headers`,ruleName:`Security Headers`,message:`Missing security headers: ${i.join(`, `)}`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Configure your server or hosting provider to send these security headers. Most can be set in next.config.js headers() or your CDN settings.`,data:{missing:i}}),n}},Pn={meta:{id:`og-image-size`,name:`OG Image Size`,category:`SEO`,tier:`pro`,description:`Checks that the og:image URL exists and advises on recommended dimensions (1200x630)`},run(e){let{document:t}=e,n=[];if(!t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`)?.trim())return n;let r=t.querySelector(`meta[property="og:image:width"]`),i=t.querySelector(`meta[property="og:image:height"]`),a=Number.parseInt(r?.getAttribute(`content`)||``,10),o=Number.parseInt(i?.getAttribute(`content`)||``,10);return!r||!i||Number.isNaN(a)||Number.isNaN(o)?(n.push({ruleId:`og-image-size`,ruleName:`OG Image Size`,message:`Missing og:image:width and og:image:height meta tags - social platforms may crop your image incorrectly`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:image:width" content="1200" /> and <meta property="og:image:height" content="630" /> to your <head>.`}),n):((a<1200||o<630)&&n.push({ruleId:`og-image-size`,ruleName:`OG Image Size`,message:`OG image dimensions (${a}x${o}) are below recommended 1200x630 - may appear blurry on social platforms`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use an image at least 1200x630 pixels for best display on Facebook, LinkedIn, and other social platforms.`,data:{width:a,height:o}}),n)}},Fn=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]),In=new Set([`.jpg`,`.jpeg`,`.png`,`.gif`,`.webp`]),Ln={meta:{id:`og-image-type`,name:`OG Image Type`,category:`SEO`,tier:`pro`,description:`Checks that the og:image type is a widely-supported format (JPEG, PNG, GIF, WebP)`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`)?.trim();if(!r)return n;let i=t.querySelector(`meta[property="og:image:type"]`)?.getAttribute(`content`)?.trim();if(i&&!Fn.has(i.toLowerCase()))return n.push({ruleId:`og-image-type`,ruleName:`OG Image Type`,message:`OG image type "${i}" may not be supported by all social platforms`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use JPEG or PNG for og:image. These formats are supported by all social platforms.`,data:{type:i}}),n;if(!i)try{let e=new URL(r,`https://example.com`),t=e.pathname.substring(e.pathname.lastIndexOf(`.`)).toLowerCase();t&&!In.has(t)&&n.push({ruleId:`og-image-type`,ruleName:`OG Image Type`,message:`OG image URL has extension "${t}" which may not be supported by all social platforms`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Use JPEG or PNG for og:image, and add <meta property="og:image:type" content="image/jpeg" /> to your <head>.`,data:{extension:t}})}catch{}return n}},Rn={meta:{id:`twitter-image`,name:`Twitter/X Image`,category:`SEO`,tier:`pro`,description:`Checks for twitter:image meta tag for rich card previews on X/Twitter`},run(e){let{document:t}=e,n=[];if(!t.querySelector(`meta[name="twitter:card"]`))return n;let r=t.querySelector(`meta[name="twitter:image"]`),i=t.querySelector(`meta[property="og:image"]`);return!r&&!i?n.push({ruleId:`twitter-image`,ruleName:`Twitter/X Image`,message:`Twitter card present but no twitter:image or og:image found - tweets will have no image preview`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta name="twitter:image" content="https://yoursite.com/image.png" /> to your <head>.`}):!r&&i&&n.push({ruleId:`twitter-image`,ruleName:`Twitter/X Image`,message:`No explicit twitter:image - falling back to og:image. Consider adding twitter:image for optimal display.`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add <meta name="twitter:image" content="..." /> for more control over how your image appears on X/Twitter.`}),n}},zn={meta:{id:`social-preview-render`,name:`Social Preview Completeness`,category:`SEO`,tier:`pro`,description:`Checks that all essential meta tags for social sharing previews are present and consistent`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:title"]`)?.getAttribute(`content`),i=t.querySelector(`meta[property="og:description"]`)?.getAttribute(`content`),a=t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`),o=t.querySelector(`meta[property="og:url"]`)?.getAttribute(`content`),s=t.querySelector(`meta[property="og:type"]`)?.getAttribute(`content`),c=t.querySelector(`title`)?.textContent?.trim();return t.querySelector(`meta[name="description"]`)?.getAttribute(`content`),s||n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`Missing og:type meta tag - required by the Open Graph protocol and needed for correct social preview rendering`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:type" content="website" /> (or "article" for blog posts) to your <head>. This is a required property per the Open Graph protocol.`}),a&&a.trim()&&(t.querySelector(`meta[property="og:image:alt"]`)?.getAttribute(`content`)||n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`Missing og:image:alt - the Open Graph protocol recommends providing alt text when og:image is set`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:image:alt" content="Description of the image" /> to your <head> for accessibility.`})),r&&c&&r.length>0&&c.length>0&&r.length>60&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:title is ${r.length} characters - may be truncated on social platforms (recommended: 50-60)`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Keep og:title under 60 characters for best display on social platforms.`,data:{ogTitleLength:r.length}}),i&&i.length>200&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:description is ${i.length} characters - may be truncated on social platforms (recommended: under 200)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Keep og:description under 200 characters for best display on social platforms.`,data:{ogDescLength:i.length}}),o&&!o.startsWith(`http`)&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:url should be an absolute URL starting with https://`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change og:url to an absolute URL (e.g., https://yoursite.com/page).`}),a&&!a.startsWith(`http`)&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:image should be an absolute URL starting with https://`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change og:image to an absolute URL (e.g., https://yoursite.com/image.png).`}),n}},Bn={meta:{id:`title-keyword-stuffing`,name:`Title Keyword Stuffing`,category:`SEO`,tier:`pro`,description:`Detects potential keyword stuffing in the page title`},run(e){let{document:t}=e,n=[],r=t.querySelector(`title`)?.textContent?.trim();if(!r)return n;let i=r.toLowerCase().split(/[\s\-|:,]+/).filter(e=>e.length>3),a=new Map;for(let e of i)a.set(e,(a.get(e)||0)+1);let o=[];for(let[e,t]of a)t>=3&&o.push(`"${e}" (${t}x)`);o.length>0&&n.push({ruleId:`title-keyword-stuffing`,ruleName:`Title Keyword Stuffing`,message:`Potential keyword stuffing in title: ${o.join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a natural, readable title. Avoid repeating the same keyword more than twice. Search engines may penalize keyword stuffing.`,data:{title:r,stuffedWords:o}});let s=(r.match(/[|–—]/g)||[]).length;return s>=3&&n.push({ruleId:`title-keyword-stuffing`,ruleName:`Title Keyword Stuffing`,message:`Title has ${s} separators - may appear spammy to search engines`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Simplify your title. Use at most one separator (|, – or —) to separate the page name from your brand.`,data:{separatorCount:s}}),n}},Vn={meta:{id:`content-to-html-ratio`,name:`Content-to-HTML Ratio`,category:`SEO`,tier:`pro`,description:`Checks the ratio of visible text to total HTML markup`},run(e){let{document:t}=e,n=[],r=t.documentElement?.outerHTML?.length||0;if(r===0)return n;let i=(t.body?.textContent||``).replace(/\s+/g,` `).trim().length,a=Math.round(i/r*100);return a<10?n.push({ruleId:`content-to-html-ratio`,ruleName:`Content-to-HTML Ratio`,message:`Low content-to-HTML ratio (${a}%) - may indicate excessive markup or thin content`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Increase meaningful text content or reduce unnecessary HTML markup. Note: content-to-HTML ratio is not a direct ranking factor per Google, but correlates with page speed and code quality.`,data:{ratio:a,textLength:i,htmlLength:r}}):a<20&&n.push({ruleId:`content-to-html-ratio`,ruleName:`Content-to-HTML Ratio`,message:`Content-to-HTML ratio is ${a}% - could be improved (aim for 25%+)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Consider adding more text content or reducing unnecessary HTML markup to improve the ratio.`,data:{ratio:a,textLength:i,htmlLength:r}}),n}},Hn={meta:{id:`title-uniqueness`,name:`Title Uniqueness`,category:`SEO`,tier:`pro`,description:`Flags titles that appear generic or auto-generated (single-page heuristic)`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelector(`title`)?.textContent?.trim();if(!i)return r;for(let e of[/^home$/i,/^untitled/i,/^page \d+$/i,/^welcome$/i,/^index$/i,/^document$/i,/^my site$/i,/^my website$/i,/^website$/i,/^new page$/i])if(e.test(i)){r.push({ruleId:`title-uniqueness`,ruleName:`Title Uniqueness`,message:`Title "${i}" appears to be a generic/default title - use a unique, descriptive title`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a unique, descriptive title for each page that includes your target keyword.`,data:{title:i}});break}try{let e=new URL(n).hostname.replace(`www.`,``),t=e.split(`.`)[0];t&&i.toLowerCase()===t.toLowerCase()&&r.push({ruleId:`title-uniqueness`,ruleName:`Title Uniqueness`,message:`Title is just the domain name - add a descriptive page-specific title`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Include a page-specific description in your title, e.g., "Product Name — Your Brand".`,data:{title:i,hostname:e}})}catch{}return r}},Un={meta:{id:`description-uniqueness`,name:`Description Uniqueness`,category:`SEO`,tier:`pro`,description:`Flags meta descriptions that appear generic or auto-generated (single-page heuristic)`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[name="description"]`)?.getAttribute(`content`)?.trim();if(!r)return n;for(let e of[/^welcome to/i,/^this is a website/i,/^a website about/i,/^home page/i,/^we are a company/i,/^default description/i])if(e.test(r)){n.push({ruleId:`description-uniqueness`,ruleName:`Description Uniqueness`,message:`Meta description appears generic - write a unique, compelling description for this page`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a unique meta description for each page that summarizes the specific content and includes a call to action.`,data:{description:r}});break}let i=t.querySelector(`title`)?.textContent?.trim();return i&&r.toLowerCase()===i.toLowerCase()&&n.push({ruleId:`description-uniqueness`,ruleName:`Description Uniqueness`,message:`Meta description is identical to the title - they should be different and complementary`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a meta description that expands on your title with more detail, a value proposition, or a call to action.`,data:{description:r,title:i}}),n}},Wn={Organization:[`name`,`url`],WebSite:[`name`,`url`],WebPage:[`name`],BreadcrumbList:[`itemListElement`],LocalBusiness:[`name`,`address`]},Gn={Article:[`headline`,`author`,`datePublished`],Product:[`name`,`image`,`offers`]};function Kn(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function qn(e,t,n){let r=Kn(e[`@type`]);if(r.length===0){n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD block missing @type property`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add an @type property (e.g., "Organization", "WebPage", "Article") to your JSON-LD.`});return}let i=r.join(`, `);e[`@context`]||t||n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${i}" missing @context - should be "https://schema.org"`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add "@context": "https://schema.org" to your JSON-LD block.`,data:{type:i}});for(let t of r){let r=Wn[t];if(r){let i=r.filter(t=>!e[t]);i.length>0&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${t}" missing required fields: ${i.join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add the missing fields to your ${t} schema: ${i.join(`, `)}.`,data:{type:t,missing:i}})}let i=Gn[t];if(i){let r=i.filter(t=>!e[t]);r.length>0&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${t}" missing recommended fields: ${r.join(`, `)}`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add the recommended fields to your ${t} schema for richer search results: ${r.join(`, `)}.`,data:{type:t,missing:r}})}}r.includes(`FAQPage`)&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`FAQPage rich results are only shown for well-known, authoritative government and health websites. For all other sites, this rich result will no longer be shown regularly`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`You can keep or remove this markup. Unused structured data does not cause problems for Search, but it also has no visible effects in Google Search. Consider using other structured data types that still produce rich results for your site type.`,data:{type:`FAQPage`}})}var Jn={meta:{id:`structured-data-validate`,name:`Structured Data Validation`,category:`SEO`,tier:`pro`,description:`Validates JSON-LD structured data for required fields based on schema type`},run(e){let{document:t}=e,n=[];return t.querySelectorAll(`script[type="application/ld+json"]`).forEach(e=>{let t;try{t=JSON.parse(e.textContent||``)}catch{return}if(Array.isArray(t[`@graph`])){let e=t[`@context`];for(let r of t[`@graph`])qn(r,e,n);return}qn(t,void 0,n)}),n}},Yn={meta:{id:`hreflang`,name:`Hreflang Tags`,category:`SEO`,tier:`pro`,description:`Validates hreflang tags for multi-language pages`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelectorAll(`link[rel="alternate"][hreflang]`);if(i.length===0)return r;Array.from(i).some(e=>e.getAttribute(`hreflang`)===`x-default`)||r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang tags found but missing x-default - add a fallback for unmatched languages`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <link rel="alternate" hreflang="x-default" href="..." /> to specify the default/fallback page.`}),Array.from(i).some(e=>{let t=e.getAttribute(`href`);return t===n||t===n.replace(/\/$/,``)})||r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang tags do not include a self-referencing tag for the current page`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add a hreflang tag that points to the current page URL with the appropriate language code.`});let a=/^[a-z]{2}(-[A-Z]{2})?$/;return i.forEach(e=>{let t=e.getAttribute(`hreflang`);t&&t!==`x-default`&&!a.test(t)&&r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Invalid hreflang language code "${t}" - use ISO 639-1 format (e.g., "en", "en-US")`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change "${t}" to a valid ISO 639-1 language code (e.g., "en", "fr", "de-AT").`,data:{invalidLang:t}});let n=e.getAttribute(`href`);n&&!n.startsWith(`http`)&&r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang href should be an absolute URL (found: "${n}")`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use absolute URLs (starting with https://) for all hreflang href attributes.`})}),r}},Xn={meta:{id:`canonical-self-referencing`,name:`Canonical Self-Referencing`,category:`SEO`,tier:`pro`,description:`Checks that the canonical URL points to the current page (self-referencing canonical)`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelector(`link[rel="canonical"]`);if(!i)return r;let a=i.getAttribute(`href`)?.trim();if(!a)return r;let o=e=>{try{return new URL(e).href.replace(/\/$/,``)}catch{return e.replace(/\/$/,``)}};try{let e=new URL(a,n).href;o(e)!==o(n)&&(new URL(e).hostname===new URL(n).hostname?r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Canonical URL points to a different page on the same site - this tells search engines to index "${e}" instead of this page`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`If this page should be indexed, change the canonical to point to itself. If this is intentional (e.g., pagination), you can ignore this.`,data:{canonical:e,pageUrl:n}}):r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Canonical URL points to a different domain ("${new URL(e).hostname}") - this is unusual and may be a misconfiguration`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Cross-domain canonical tags are rarely correct. Verify this is intentional, otherwise change the canonical to point to this page.`,data:{canonical:e,pageUrl:n}}))}catch{r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Cannot parse canonical URL "${a}" - ensure it's a valid absolute URL`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use a valid absolute URL for your canonical tag (e.g., https://yoursite.com/page).`})}return r}},Zn={meta:{id:`meta-render-blocking`,name:`Render-Blocking Resources`,category:`Performance`,tier:`pro`,description:`Checks for render-blocking stylesheets and synchronous scripts in the <head>`},run(e){let{document:t}=e,n=[],r=t.querySelector(`head`);if(!r)return n;let i=r.querySelectorAll(`script[src]`),a=0;i.forEach(e=>{let t=e.hasAttribute(`async`),n=e.hasAttribute(`defer`),r=e.getAttribute(`type`)?.trim().toLowerCase(),i=e.hasAttribute(`nomodule`);!t&&!n&&!i&&r!==`module`&&a++}),a>0&&n.push({ruleId:`meta-render-blocking`,ruleName:`Render-Blocking Resources`,message:`${a} synchronous script(s) in <head> may block page rendering`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Add async or defer attributes to non-critical scripts in the <head>, or move them to the end of <body>.`,data:{blockingScripts:a}});let o=r.querySelectorAll(`link[rel="stylesheet"]`),s=0;return o.forEach(e=>{let t=e.getAttribute(`media`);(!t||t===`all`)&&s++}),s>3&&n.push({ruleId:`meta-render-blocking`,ruleName:`Render-Blocking Resources`,message:`${s} render-blocking stylesheets in <head> - consider inlining critical CSS`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Inline critical CSS and load non-critical stylesheets asynchronously using media="print" with an onload handler.`,data:{blockingStylesheets:s}}),n}},Qn={meta:{id:`lazy-load-lcp`,name:`Lazy Load LCP`,category:`Performance`,tier:`pro`,description:`Checks that above-the-fold images (likely LCP candidates) are not lazy-loaded`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=Array.from(r).slice(0,3);for(let e of i){let t=e.getAttribute(`loading`),r=e.getAttribute(`fetchpriority`);if(t===`lazy`){let t=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``,i=r?`"${r.substring(0,40)}"`:t?`src="${t.substring(0,50)}"`:`first image`;n.push({ruleId:`lazy-load-lcp`,ruleName:`Lazy Load LCP`,message:`Above-the-fold image (${i}) has loading="lazy" - this delays the Largest Contentful Paint`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Remove loading="lazy" from above-the-fold images. Add fetchpriority="high" to the LCP image instead.`});break}if(!r&&!t){n.push({ruleId:`lazy-load-lcp`,ruleName:`Lazy Load LCP`,message:`Consider adding fetchpriority="high" to your hero/banner image to improve Largest Contentful Paint`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add fetchpriority="high" to the most important above-the-fold image to prioritize its loading.`});break}}return n}},$n={meta:{id:`https-links`,name:`HTTPS Links`,category:`Pre-Launch`,tier:`pro`,description:`Checks that internal links use HTTPS instead of HTTP`},run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n).hostname}catch{return r}let a=t.querySelectorAll(`a[href^="http:"]`),o=0,s=0;return a.forEach(e=>{let t=e.getAttribute(`href`);if(t)try{new URL(t).hostname===i?o++:s++}catch{}}),o>0&&r.push({ruleId:`https-links`,ruleName:`HTTPS Links`,message:`${o} internal link(s) use HTTP instead of HTTPS`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Change all internal links from http:// to https:// to avoid redirect chains and mixed content warnings.`,data:{internalHttpLinks:o}}),s>0&&r.push({ruleId:`https-links`,ruleName:`HTTPS Links`,message:`${s} external link(s) use HTTP - consider updating to HTTPS where available`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Update external links to use https:// where the destination supports it.`,data:{externalHttpLinks:s}}),r}},er={meta:{id:`meta-refresh-redirect`,name:`Meta Refresh Redirect`,category:`SEO`,tier:`pro`,description:`Checks for <meta http-equiv="refresh"> redirects which are bad for SEO`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[http-equiv="refresh"]`);if(!r)return n;let i=r.getAttribute(`content`)||``,a=i.toLowerCase().includes(`url=`),o=Number.parseInt(i.split(`;`)[0]||``,10);return a?n.push({ruleId:`meta-refresh-redirect`,ruleName:`Meta Refresh Redirect`,message:`Page uses a meta refresh redirect${Number.isNaN(o)?``:` (${o}s delay)`} - use server-side 301 redirects instead`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Replace <meta http-equiv="refresh"> with a server-side 301 redirect. Meta refreshes are bad for SEO and user experience.`,data:{content:i,delay:Number.isNaN(o)?void 0:o}}):!Number.isNaN(o)&&o>0&&n.push({ruleId:`meta-refresh-redirect`,ruleName:`Meta Refresh Redirect`,message:`Page auto-refreshes every ${o} seconds - this may cause usability issues`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Consider removing the auto-refresh meta tag unless it serves a clear user need.`,data:{content:i,delay:o}}),n}},tr={meta:{id:`nofollow-audit`,name:`Nofollow Audit`,category:`SEO`,tier:`pro`,description:`Audits the use of rel="nofollow" on internal vs. external links`},run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n).hostname}catch{return r}let a=t.querySelectorAll(`a[rel~="nofollow"]`),o=0;return a.forEach(e=>{let t=e.getAttribute(`href`);if(t)try{new URL(t,n).hostname===i&&o++}catch{(t.startsWith(`/`)||t.startsWith(`.`))&&o++}}),o>0&&r.push({ruleId:`nofollow-audit`,ruleName:`Nofollow Audit`,message:`${o} internal link(s) have rel="nofollow" - this wastes PageRank and hurts internal linking`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove rel="nofollow" from internal links. Nofollow should only be used for external links you do not want to endorse (e.g., user-generated content, sponsored links).`,data:{internalNofollow:o,totalNofollow:a.length}}),r}},nr={meta:{id:`cors-policy`,name:`CORS Policy`,category:`Pre-Launch`,tier:`pro`,description:`Checks for overly permissive CORS configuration that could allow unauthorized cross-origin access`},async run(e){let t=[],n=`https://evil.example.com`;try{let r=await It(e,{method:`GET`,headers:{"User-Agent":`LintPage-Bot/1.0`,Origin:n},redirect:`follow`}),i=r.headers.get(`access-control-allow-origin`),a=r.headers.get(`access-control-allow-credentials`);if(!i)return t;i===`*`?a?.toLowerCase()===`true`?t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS allows all origins with credentials enabled - this is a security vulnerability`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Set Access-Control-Allow-Origin to your specific trusted domains instead of "*". Wildcard with credentials is blocked by browsers but indicates a dangerous misconfiguration.`}):t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS allows all origins (Access-Control-Allow-Origin: *) - restrict to trusted domains in production. Note: some hosting platforms (e.g. Vercel, Netlify, Cloudflare Pages) add this header by default, even if you haven't configured it.`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`If you set this header yourself, configure Access-Control-Allow-Origin to only allow requests from your trusted domains (e.g., "https://myapp.com") instead of using the wildcard "*". If your hosting platform adds it automatically, check their documentation for how to override or restrict CORS headers.`}):i.toLowerCase()===n&&(a?.toLowerCase()===`true`?t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS reflects any origin with credentials enabled - any website can make authenticated cross-origin requests and read responses. This is the most exploitable CORS misconfiguration.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Configure your server to validate the Origin header against a strict allowlist of trusted domains. Never reflect arbitrary origins when credentials are enabled.`}):t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS reflects any origin back in Access-Control-Allow-Origin - this is equivalent to a wildcard and allows any site to make cross-origin requests. Note: this may be caused by your hosting platform or a reverse proxy, not your own configuration.`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`If you set this header yourself, configure your server to validate the Origin header against an allowlist of trusted domains instead of reflecting it back. If your hosting platform adds it automatically, check their documentation for how to override or restrict CORS headers.`}))}catch{}return t}},rr=1e4,ir={meta:{id:`broken-internal-links`,name:`Broken Internal Links`,category:`SEO`,tier:`pro`,description:`Checks that internal links on the page resolve successfully (no 404s or server errors)`},async run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n)}catch{return r}let a=new Set,o=[],s=t.querySelectorAll(`a[href]`);for(let e of s){let t=e.getAttribute(`href`);if(!t||t.startsWith(`#`)||t.startsWith(`mailto:`)||t.startsWith(`tel:`)||t.startsWith(`javascript:`)||t.startsWith(`data:`))continue;let r;try{r=new URL(t,n)}catch{continue}if(r.hostname!==i.hostname)continue;r.hash=``;let s=r.toString();if(a.has(s))continue;a.add(s);let c=new URL(n);c.hash=``,s!==c.toString()&&o.push(s)}if(o.length===0)return r;let c=o.slice(0,50),l=[],u=[],d=async e=>{try{let t=await It(e,{method:`HEAD`,headers:{"User-Agent":`LintPage-Bot/1.0`},redirect:`follow`,signal:AbortSignal.timeout(rr)});if(t.status===405){let t=await It(e,{method:`GET`,headers:{"User-Agent":`LintPage-Bot/1.0`},redirect:`follow`,signal:AbortSignal.timeout(rr)});t.status>=400&&l.push({url:e,status:t.status});return}t.status>=400&&l.push({url:e,status:t.status})}catch{u.push(e)}};for(let e=0;e<c.length;e+=10){let t=c.slice(e,e+10);await Promise.all(t.map(d))}if(l.length>0){let e=l.filter(e=>e.status===404),t=l.filter(e=>e.status>=500),n=l.filter(e=>e.status!==404&&e.status<500);e.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${e.length} internal link(s) return 404 Not Found: ${e.map(e=>e.url).join(`, `)}`,severity:`CRITICAL`,category:`SEO`,tier:`pro`,fix:`Remove or update the broken links to point to valid pages. Broken internal links hurt SEO and user experience.`,data:{notFoundLinks:e}}),t.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${t.length} internal link(s) return server errors: ${t.map(e=>`${e.url} (${e.status})`).join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Investigate server errors on the linked pages. These may indicate temporary issues or misconfigured routes.`,data:{serverErrorLinks:t}}),n.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${n.length} internal link(s) return client errors: ${n.map(e=>`${e.url} (${e.status})`).join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Check the linked pages for access issues (e.g., 401/403 may indicate authentication or permission problems).`,data:{clientErrorLinks:n}})}return u.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${u.length} internal link(s) could not be reached: ${u.join(`, `)}`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`These links timed out or had network errors during the check. Verify they are accessible.`,data:{unreachableLinks:u}}),o.length>50&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`Only checked 50 of ${o.length} internal links. Consider reducing the number of links on this page.`,severity:`INFO`,category:`SEO`,tier:`pro`,data:{totalLinks:o.length,checkedLinks:50}}),r}},ar=`https://developers.openai.com/api/docs/bots`,or=`https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler`,sr=`https://docs.perplexity.ai/docs/resources/perplexity-crawlers`,cr=`https://developers.facebook.com/docs/sharing/webmasters/web-crawlers/`,lr=`https://developer.amazon.com/amazonbot`,ur=`https://docs.mistral.ai/robots`,dr=[{token:`GPTBot`,operator:`OpenAI`,kind:`training`,purpose:`Crawls content for training generative AI foundation models.`,blockingCost:`Your content is excluded from future model training. Live ChatGPT answers are unaffected.`,robots:`documented`,robotsNote:`Disallowing GPTBot "indicates a site's content should not be used in training".`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.4; +https://openai.com/gptbot`,userAgentSource:`example`,docsUrl:ar,ipRangesUrl:`https://openai.com/gptbot.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`OAI-SearchBot`,operator:`OpenAI`,kind:`search`,purpose:`Builds the search index behind ChatGPT search.`,blockingCost:`You "will not be shown in ChatGPT search answers, though can still appear as navigational links".`,robots:`documented`,userAgent:`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36; compatible; OAI-SearchBot/1.4; +https://openai.com/searchbot`,userAgentSource:`example`,docsUrl:ar,ipRangesUrl:`https://openai.com/searchbot.json`,verifiedOn:`2026-09-16`,inChecker:!0,notes:`When fetching robots.txt itself OpenAI inserts a "robots.txt;" marker into the string.`},{token:`ChatGPT-User`,operator:`OpenAI`,kind:`retrieval`,purpose:`Fetches a page on demand when a ChatGPT user, Custom GPT or GPT Action asks for it.`,blockingCost:`ChatGPT cannot retrieve your page to answer a question about it. This is the expensive one.`,robots:`bypasses`,robotsNote:`"Because these actions are initiated by a user, robots.txt rules may not apply."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot`,userAgentSource:`documented`,docsUrl:ar,ipRangesUrl:`https://openai.com/chatgpt-user.json`,verifiedOn:`2026-09-16`,inChecker:!0,notes:`The self-link in the string is +https://openai.com/bot, not /chatgpt-user.`},{token:`OAI-AdsBot`,operator:`OpenAI`,kind:`ads`,purpose:`Validates advertising landing pages. "Only visits pages submitted as ads"; the data is not used for training.`,blockingCost:`Ad landing pages you submit cannot be validated. No effect on organic AI visibility.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-AdsBot/1.0; +https://openai.com/adsbot`,userAgentSource:`documented`,docsUrl:ar,ipRangesUrl:`https://openai.com/adsbot.json`,verifiedOn:`2026-09-16`},{token:`ClaudeBot`,operator:`Anthropic`,kind:`training`,purpose:`Collects web content that "could potentially contribute to their training".`,blockingCost:`Your content is excluded from Claude training data. Live Claude answers are unaffected.`,robots:`documented`,robotsNote:`Honours robots.txt and the non-standard Crawl-delay directive.`,userAgent:null,userAgentSource:`none`,docsUrl:or,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ClaudeBot/1.0; +claudebot@anthropic.com`,notes:`Anthropic publishes no User-Agent header string for any of its bots. Match the token.`},{token:`Claude-User`,operator:`Anthropic`,kind:`retrieval`,purpose:`Fetches a page when someone asks Claude a question that needs it.`,blockingCost:`Claude cannot retrieve your content in response to a user query.`,robots:`documented`,robotsNote:`No user-initiated exception is documented, unlike ChatGPT-User and Perplexity-User.`,userAgent:null,userAgentSource:`none`,docsUrl:or,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Mozilla/5.0 (compatible; Claude-User/1.0; +Claude-User@anthropic.com)`},{token:`Claude-SearchBot`,operator:`Anthropic`,kind:`search`,purpose:`Indexes content to improve Claude search result quality.`,blockingCost:`You are excluded from the index Claude search draws on.`,robots:`documented`,userAgent:null,userAgentSource:`none`,docsUrl:or,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`},{token:`anthropic-ai`,operator:`Anthropic`,kind:`training`,purpose:`Legacy token in wide circulation. Anthropic does not document it.`,blockingCost:`Unknown. Anthropic lists only ClaudeBot, Claude-User and Claude-SearchBot, so this token may control nothing.`,robots:`undocumented`,userAgent:null,userAgentSource:`none`,docsUrl:null,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`anthropic-ai`,notes:`Appears in countless robots.txt files and blocklists. Absent from Anthropic's documentation, with no retirement notice.`},{token:`PerplexityBot`,operator:`Perplexity`,kind:`search`,purpose:`Indexes pages for Perplexity search. "Not used to crawl content for AI foundation models."`,blockingCost:`You are excluded from Perplexity search results and citations.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)`,userAgentSource:`documented`,docsUrl:sr,ipRangesUrl:`https://www.perplexity.ai/perplexitybot.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`Perplexity-User`,operator:`Perplexity`,kind:`retrieval`,purpose:`Fetches a page because a Perplexity user asked something about it.`,blockingCost:`Perplexity cannot pull up your page to answer a live question.`,robots:`bypasses`,robotsNote:`"Since a user requested the fetch, this fetcher generally ignores robots.txt rules."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Perplexity-User/1.0; +https://perplexity.ai/perplexity-user)`,userAgentSource:`documented`,docsUrl:sr,ipRangesUrl:`https://www.perplexity.ai/perplexity-user.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`Google-Extended`,operator:`Google`,kind:`training`,purpose:`Controls training of future Gemini models and grounding in Gemini Apps and Vertex AI.`,blockingCost:`Excluded from Gemini training and grounding. It does NOT remove you from AI Overviews, and it is not a Search ranking signal.`,robots:`documented`,robotsNote:`"Google-Extended does not impact a site's inclusion in Google Search nor is it used as a ranking signal in Google Search."`,userAgent:null,userAgentSource:`robots-token-only`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Google-Extended`,notes:`A control token, not a fetcher. Nothing ever arrives with this User-Agent, so the checker reads your robots.txt for it and sends no request: there is no live result to report.`},{token:`Googlebot`,operator:`Google`,kind:`search`,purpose:`The Search crawler. AI Overviews and AI Mode are built on Search, so this is what feeds them.`,blockingCost:`You leave Google Search entirely. This is the only documented way out of AI Overviews, which is why it is almost never the right move.`,robots:`documented`,robotsNote:`Common crawlers "always respect robots.txt rules for automatic crawls".`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,notes:`Listed as the contrast case: the AI control people reach for is Google-Extended, but the AI surface they mean is governed here.`},{token:`Google-CloudVertexBot`,operator:`Google`,kind:`training`,purpose:`Crawls sites on their owner's request to build Vertex AI Agents.`,blockingCost:`Vertex AI Agents cannot ingest your site. "It has no effect on Google Search or other products."`,robots:`documented`,userAgent:null,userAgentSource:`none`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,notes:`Google documents the substring only, not a full header string.`},{token:`GoogleOther`,operator:`Google`,kind:`training`,purpose:`Generic crawler used for one-off internal research and development.`,blockingCost:`Preferences for GoogleOther "don't affect any specific product", so blocking it changes little you can observe.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GoogleOther) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`},{token:`Google-GeminiNotebook`,operator:`Google`,kind:`retrieval`,purpose:`Fetches URLs a Gemini Notebook user supplies as a source.`,blockingCost:`Nothing you can control by robots.txt: as a user-triggered fetcher it is documented to ignore it.`,robots:`bypasses`,robotsNote:`User-triggered fetchers "generally ignore robots.txt rules".`,userAgent:`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 (compatible; Google-GeminiNotebook; +https://developers.google.com/crawling/docs/crawlers-fetchers/google-gemininotebook)`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-user-triggered-fetchers`,verifiedOn:`2026-09-16`,notes:`Replaced Google-NotebookLM, which Google supported until August 2026.`},{token:`Google-Agent`,operator:`Google`,kind:`retrieval`,purpose:`Agents on Google infrastructure navigating the web and acting on a user's request.`,blockingCost:`Again not robots-controllable. Google pairs it with a Web Bot Auth experiment under the identity https://agent.bot.goog.`,robots:`bypasses`,robotsNote:`User-triggered fetchers "generally ignore robots.txt rules".`,userAgent:`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; compatible; Google-Agent; +https://developers.google.com/crawling/docs/crawlers-fetchers/google-agent) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-user-triggered-fetchers`,verifiedOn:`2026-09-16`},{token:`Applebot-Extended`,operator:`Apple`,kind:`training`,purpose:`Opts your content out of training Apple's general-purpose foundation models.`,blockingCost:`Excluded from Apple Intelligence training only. "Webpages that disallow Applebot-Extended can still be included in search results", and it is not considered in Search ranking.`,robots:`documented`,userAgent:null,userAgentSource:`robots-token-only`,docsUrl:`https://support.apple.com/en-us/119829`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Applebot-Extended`,notes:`Training only. Grounding is a separate control: nosnippet stops Apple using the page as AI context.`},{token:`Applebot`,operator:`Apple`,kind:`search`,purpose:`Powers Spotlight, Siri and Safari search. The crawled data also feeds foundation-model training and AI grounding.`,blockingCost:`Removes you from Apple search surfaces.`,robots:`documented`,robotsNote:`Respects robots.txt, falls back to Googlebot rules when Applebot is not named, and does not follow crawl-delay.`,userAgent:`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15 (Applebot/0.1; +http://www.apple.com/go/applebot)`,userAgentSource:`example`,docsUrl:`https://support.apple.com/en-us/119829`,verifiedOn:`2026-09-16`},{token:`bingbot`,operator:`Microsoft`,kind:`search`,purpose:`Builds the Bing index. Copilot grounds on indexed content, so this is the Copilot crawler in practice.`,blockingCost:`You leave the Bing index, and with it Copilot citation: Bing's AI Performance report "reflects only content that is eligible for indexing".`,robots:`documented`,robotsNote:`Honours one group in priority order: bingbot, then msnbot, then the wildcard.`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0`,verifiedOn:`2026-09-16`,notes:`Microsoft controls AI use by meta tag rather than by token: noindex bars training, noarchive bars Chat and Copilot, nocache limits them to URL, title and snippet.`},{token:`DuckAssistBot`,operator:`DuckDuckGo`,kind:`retrieval`,purpose:`Crawls in real time for AI-assisted answers. "This data is not used in any way to train AI models."`,blockingCost:`No AI-assisted answers from your content. "Opting out of DuckAssistBot does not impact organic search rankings." Takes effect after 72 hours.`,robots:`documented`,userAgent:`DuckAssistBot/1.2; (+http://duckduckgo.com/duckassistbot.html)`,userAgentSource:`documented`,docsUrl:`https://duckduckgo.com/duckduckgo-help-pages/results/duckassistbot`,verifiedOn:`2026-09-16`},{token:`meta-externalagent`,operator:`Meta`,kind:`training`,purpose:`Trains foundation AI models, and indexes content directly to improve products.`,blockingCost:`Your content is excluded from Meta AI training and indexing.`,robots:`documented`,userAgent:`meta-externalagent/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:cr,verifiedOn:`2026-09-16`,notes:`The parenthetical is relativized on Meta's own page; match the "meta-externalagent/1.1" prefix rather than the whole string.`},{token:`meta-externalfetcher`,operator:`Meta`,kind:`retrieval`,purpose:`Fetches links a user asked about, including for agentic AI.`,blockingCost:`Meta AI cannot follow a link to your page on a user's behalf.`,robots:`bypasses`,robotsNote:`"May bypass robots.txt because it performs fetches that were requested by the user."`,userAgent:`meta-externalfetcher/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:cr,verifiedOn:`2026-09-16`},{token:`meta-webindexer`,operator:`Meta`,kind:`search`,purpose:`Builds the index Meta AI search cites from.`,blockingCost:`You are excluded from Meta AI search citations.`,robots:`documented`,userAgent:`meta-webindexer/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:cr,verifiedOn:`2026-09-16`},{token:`facebookexternalhit`,operator:`Meta`,kind:`retrieval`,purpose:`Scrapes a page to build the share preview when someone posts your link.`,blockingCost:`Links to your site post without a title, description or image. Nothing to do with AI.`,robots:`bypasses`,robotsNote:`"Might bypass robots.txt when performing security or integrity checks."`,userAgent:`facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)`,userAgentSource:`documented`,docsUrl:cr,verifiedOn:`2026-09-16`,notes:`Listed because it is routinely swept up in AI blocklists, which silently breaks link previews.`},{token:`Amazonbot`,operator:`Amazon`,kind:`training`,purpose:`Crawls to "improve our products and services", which may include training Amazon AI.`,blockingCost:`Excluded from Amazon AI training and product data.`,robots:`documented`,robotsNote:`"Respects the Robots Exclusion Protocol."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amazonbot/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:lr,ipRangesUrl:`https://developer.amazon.com/amazonbot/ip-addresses/`,verifiedOn:`2026-09-16`},{token:`Amzn-SearchBot`,operator:`Amazon`,kind:`search`,purpose:`Builds Amazon's search index.`,blockingCost:`Excluded from Amazon search results.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amzn-SearchBot/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:lr,ipRangesUrl:`https://developer.amazon.com/amazonbot/searchbot-ip-addresses/`,verifiedOn:`2026-09-16`},{token:`Amzn-User`,operator:`Amazon`,kind:`retrieval`,purpose:`Live retrieval on a user's behalf, including for Alexa.`,blockingCost:`Alexa cannot read your page out in answer to a question.`,robots:`partial`,robotsNote:`"May not follow all robots.txt directives."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amzn-User/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:lr,ipRangesUrl:`https://developer.amazon.com/amazonbot/live-ip-addresses/`,verifiedOn:`2026-09-16`},{token:`MistralAI-User`,operator:`Mistral`,kind:`retrieval`,purpose:`Fetches pages to answer a user's question in Le Chat.`,blockingCost:`Mistral cannot retrieve your page for a live answer.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-User/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:ur,ipRangesUrl:`https://mistral.ai/mistralai-user-ips.json`,verifiedOn:`2026-09-16`},{token:`MistralAI-Index`,operator:`Mistral`,kind:`search`,purpose:`Builds a search index. Explicitly not training.`,blockingCost:`Excluded from Mistral's search index.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-Index/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:ur,ipRangesUrl:`https://mistral.ai/mistralai-index-ips.json`,verifiedOn:`2026-09-16`},{token:`MistralAI-Training`,operator:`Mistral`,kind:`training`,purpose:`Collects training data for Mistral models.`,blockingCost:`Excluded from Mistral training data.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-Training/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:ur,verifiedOn:`2026-09-16`,notes:`The only Mistral agent with no published IP list, so it is the one you cannot verify.`},{token:`CCBot`,operator:`Common Crawl`,kind:`dataset`,purpose:`Builds the Common Crawl public archive. A nonprofit corpus, not an AI product.`,blockingCost:`You leave the corpus that many third-party models train on, which blocks them indirectly. Archives already published stay published.`,robots:`documented`,userAgent:`CCBot/2.0 (https://commoncrawl.org/faq/)`,userAgentSource:`documented`,docsUrl:`https://commoncrawl.org/ccbot`,ipRangesUrl:`https://index.commoncrawl.org/ccbot.json`,verifiedOn:`2026-09-16`,notes:`Predates the LLM era. Verifiable by reverse DNS under *.crawl.commoncrawl.org.`},{token:`YouBot`,operator:`You.com`,kind:`search`,purpose:`Indexes pages for You.com search.`,blockingCost:`Excluded from You.com results.`,robots:`documented`,robotsNote:`"Fully respects robots.txt directives, including user-agent specific rules and crawl-delay."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; YouBot/1.0; +https://docs.you.com/youbot; env:prod) Chrome/X.X.X.X Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://you.com/docs/youbot`,verifiedOn:`2026-09-16`,notes:`Verifiable three ways: IP range, reverse DNS, and Cloudflare Web Bot Auth.`},{token:`Diffbot`,operator:`Diffbot`,kind:`search`,purpose:`Crawls for Diffbot's Knowledge Graph. "It is not used for AI training."`,blockingCost:`Excluded from the Knowledge Graph and products built on it.`,robots:`partial`,robotsNote:`Obeys robots.txt by default, but the default is overridable under a partnership agreement.`,userAgent:null,userAgentSource:`none`,docsUrl:`https://www.diffbot.com/docs/crawl/faq/robots-txt`,verifiedOn:`2026-09-16`,notes:`Diffbot documents the token and a Diffbot-User variant, but no header string.`},{token:`Webzio-extended`,operator:`Webz.io`,kind:`dataset`,purpose:`Collects content resold as datasets. The "-extended" token covers AI and ML use.`,blockingCost:`Your content is kept out of datasets sold on for AI training.`,robots:`documented`,robotsNote:`"Meticulously adheres to robots.txt exclusions."`,userAgent:null,userAgentSource:`none`,docsUrl:`https://webz.io/bot.html`,verifiedOn:`2026-09-16`,notes:`Webz.io also operates the Webzio and Omgilibot tokens. No header string is published for any of them.`}],fr=`AI Visibility`,pr=`pro`,mr=`/blog/ai-crawler-accessibility-guide`,hr=`LintPage/1.0 (+https://lintpage.com)`,gr=5e3,_r=3600*1e3,vr=200,yr=dr.filter(e=>e.inChecker).map(e=>({name:e.token,userAgent:e.probeUserAgent??e.userAgent??e.token,purpose:e.purpose,controlOnly:e.userAgentSource===`robots-token-only`})),br=new Map;async function xr(e,t,n=gr){let r=new AbortController,i=setTimeout(()=>r.abort(),n);try{return await It(e,{...t,signal:r.signal})}finally{clearTimeout(i)}}async function Sr(e){try{let t=new URL(`/robots.txt`,e).href,n=await xr(t,{headers:{"User-Agent":hr}});return n.ok?{fetched:!0,raw:await n.text()}:{fetched:!1,raw:null}}catch{return{fetched:!1,raw:null}}}async function Cr(e){try{let t=new URL(`/llms.txt`,e).href;return{exists:(await xr(t,{headers:{"User-Agent":hr}})).ok}}catch{return{exists:!1}}}function wr(e){let t=new Map,n=[],r=!1;for(let i of e.split(`
|
|
98
|
-
`)){let e=i.replace(/#.*$/,``).trim();if(!e)continue;let a=e.indexOf(`:`);if(a===-1)continue;let o=e.slice(0,a).trim().toLowerCase(),s=e.slice(a+1).trim();if(o===`user-agent`){r&&=(n=[],!1);let e=s.toLowerCase();n.push(e),t.has(e)||t.set(e,{allow:[],disallow:[]})}else if(o===`disallow`||o===`allow`){r=!0;for(let e of n){let n=t.get(e);n&&(o===`disallow`?n.disallow.push(s):n.allow.push(s))}}}return t}function Tr(e,t){if(e===``)return!1;if(e===`/`)return!0;let n=`^`;for(let t of e)t===`*`?n+=`.*`:t===`$`?n+=`$`:n+=t.replace(/[.+?^${}()|[\]\\]/g,`\\$&`);try{return new RegExp(n).test(t)}catch{return!1}}function Er(e,t,n){if(e===null)return`NO_ROBOTS_TXT`;let r=wr(e),i=r.get(t.toLowerCase()),a=r.get(`*`),o=i??a;if(!o)return`ALLOWED`;let s=[...o.disallow.map(e=>({pattern:e,allow:!1})),...o.allow.map(e=>({pattern:e,allow:!0}))].filter(e=>e.pattern&&Tr(e.pattern,n));return s.length===0?`ALLOWED`:(s.sort((e,t)=>t.pattern.length-e.pattern.length||(e.allow?-1:t.allow?1:0)),s[0].allow?`ALLOWED`:`DISALLOWED`)}function Dr(e,t){return e===200?`SUCCESS_200`:e===403?`BLOCKED_403`:e===429?`BLOCKED_429`:e>=500?`SERVER_ERROR_5XX`:t||e>=300&&e<400?`REDIRECTED`:`ERROR`}function Or(e){return e.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,``).replace(/<style[^>]*>[\s\S]*?<\/style>/gi,``).replace(/<noscript[^>]*>[\s\S]*?<\/noscript>/gi,``).replace(/<[^>]+>/g,` `).replace(/ /g,` `).replace(/\s+/g,` `).trim().length}async function kr(e,t,n){let r=(()=>{try{return new URL(e).pathname||`/`}catch{return`/`}})(),i=Er(n,t.name,r);if(t.controlOnly)return{bot:t.name,userAgent:t.userAgent,robotsStatus:i,fetchStatus:`NOT_FETCHED`,silentBlock:!1,likelyJsRendered:!1,controlOnly:!0};let a=`ERROR`,o,s,c,l,u,d=!1;try{let n=Date.now(),r=await xr(e,{headers:{"User-Agent":t.userAgent},redirect:`follow`});if(s=Date.now()-n,o=r.status,l=r.url,a=Dr(r.status,r.redirected),r.status===200){let e=await r.text();c=e.length,u=Or(e),!t.controlOnly&&u<vr&&(d=!0)}}catch(e){a=e instanceof Error&&e.name===`AbortError`?`TIMEOUT`:`ERROR`}let f=i===`ALLOWED`||i===`NO_ROBOTS_TXT`,p=a===`BLOCKED_403`||a===`BLOCKED_429`||a===`SERVER_ERROR_5XX`,m=!t.controlOnly&&f&&p;return{bot:t.name,userAgent:t.userAgent,robotsStatus:i,fetchStatus:a,httpStatus:o,responseTimeMs:s,contentLength:c,finalUrl:l,bodyTextLength:u,silentBlock:m,likelyJsRendered:d,controlOnly:t.controlOnly}}async function Ar(e){let[t,n]=await Promise.all([Sr(e),Cr(e)]),r=await Promise.all(yr.map(n=>kr(e,n,t.raw))),i={};for(let e of r)i[e.bot]=e;return{scannedAt:Date.now(),url:e,robotsTxt:t,llmsTxt:n,bots:i}}async function jr(e){let t;try{t=new URL(e).hostname}catch{return Ar(e)}let n=br.get(t);if(n&&Date.now()-n.cachedAt<_r)return n.promise;let r=Ar(e);return br.set(t,{promise:r,cachedAt:Date.now()}),r.catch(()=>{br.get(t)?.promise===r&&br.delete(t)}),r}function Mr(e,t,n,r,i,a){return{ruleId:e,ruleName:t,message:n,severity:r,category:fr,tier:pr,fix:i,learnMoreUrl:mr,data:a}}var Nr={meta:{id:`ai/all-crawlers-blocked`,name:`AI: site-wide AI access blocked`,category:fr,tier:pr,description:`Every tested AI bot is blocked (robots.txt or live block) — page is invisible to AI assistants`},async run(e){let t=await jr(e),n=Object.values(t.bots).filter(e=>!e.controlOnly),r=n.length,i=n.filter(e=>e.robotsStatus===`DISALLOWED`||e.fetchStatus===`BLOCKED_403`||e.fetchStatus===`BLOCKED_429`||e.fetchStatus===`SERVER_ERROR_5XX`);return i.length<r?[]:[Mr(`ai/all-crawlers-blocked`,`AI: site-wide AI access blocked`,`All ${r} AI bots tested are blocked \u2014 by robots.txt or live block. ChatGPT, Claude, Perplexity, and Gemini cannot read or cite this page.`,`CRITICAL`,`Review robots.txt for blanket AI bot Disallow rules. If using Cloudflare, check Security Settings → Configure AI bot policies and allow the categories you want to stay visible to (Search, Agent, Training are set separately).`,{blocked:i.length,total:r})]}};function Pr(e){return{meta:{id:e.id,name:e.name,category:fr,tier:pr,description:e.description},async run(t){let n=(await jr(t)).bots[e.bot];return n.silentBlock?[Mr(e.id,e.name,`robots.txt allows ${e.bot} but the live fetch returned HTTP ${n.httpStatus}. This is the Cloudflare-default block: AI bots get a 403 at the edge regardless of what your robots.txt says.`,`CRITICAL`,`Cloudflare \u2192 Security Settings \u2192 Configure AI bot policies, and allow the category "${e.bot}" falls under (Search, Agent or Training). The older "Block AI bots" toggle was deprecated on 2026-09-15, when Cloudflare also applied new defaults to free-plan zones that had never changed the setting. Or, if you intend to opt out, add "User-agent: ${e.bot}\\nDisallow: /" to robots.txt so the signal is intentional.`,{bot:e.bot,httpStatus:n.httpStatus,userAgent:n.userAgent,robotsStatus:n.robotsStatus,fetchStatus:n.fetchStatus})]:[]}}}var Fr=Pr({id:`ai/gptbot-silent-block`,name:`AI: GPTBot silent block`,bot:`GPTBot`,description:`robots.txt allows GPTBot but live fetch returns 403/429 (likely Cloudflare or WAF block)`}),Ir=Pr({id:`ai/claudebot-silent-block`,name:`AI: ClaudeBot silent block`,bot:`ClaudeBot`,description:`robots.txt allows ClaudeBot but live fetch returns 403/429`}),Lr=Pr({id:`ai/perplexitybot-silent-block`,name:`AI: PerplexityBot silent block`,bot:`PerplexityBot`,description:`robots.txt allows PerplexityBot but live fetch returns 403/429`});function Rr(e){return{meta:{id:e.id,name:e.name,category:fr,tier:pr,description:e.description},async run(t){let n=(await jr(t)).bots[e.bot],r=n.robotsStatus===`DISALLOWED`,i=n.fetchStatus===`BLOCKED_403`||n.fetchStatus===`BLOCKED_429`||n.fetchStatus===`SERVER_ERROR_5XX`;if(!r&&!i)return[];let a=r?`robots.txt disallows it`:`the live fetch returned HTTP ${n.httpStatus}`;return[Mr(e.id,e.name,`${e.bot} cannot reach this page \u2014 ${a}. When a user asks ${e.serviceLabel} a question that should cite this page, the assistant cannot retrieve the content.`,`CRITICAL`,r?`Remove the User-agent: ${e.bot} Disallow rule from robots.txt. "-User" variants represent live retrieval at user request, not training \u2014 opting out of these typically isn't intentional.`:`Cloudflare or your WAF is blocking ${e.bot}. Allow this bot at the edge \u2014 it represents live AI assistant browsing, not training. Blocking it removes you from ${e.serviceLabel}'s answers.`,{bot:e.bot,userAgent:n.userAgent,httpStatus:n.httpStatus,robotsStatus:n.robotsStatus,fetchStatus:n.fetchStatus})]}}}var zr=[Nr,Fr,Ir,Lr,Rr({id:`ai/chatgpt-user-blocked`,name:`AI: ChatGPT-User cannot reach page`,bot:`ChatGPT-User`,serviceLabel:`ChatGPT`,description:`ChatGPT-User cannot reach the page — blocks live ChatGPT browsing when users ask questions`}),Rr({id:`ai/claude-user-blocked`,name:`AI: Claude-User cannot reach page`,bot:`Claude-User`,serviceLabel:`Claude`,description:`Claude-User cannot reach the page — blocks live Claude browsing`}),Rr({id:`ai/perplexity-user-blocked`,name:`AI: Perplexity-User cannot reach page`,bot:`Perplexity-User`,serviceLabel:`Perplexity`,description:`Perplexity-User cannot reach the page — blocks live Perplexity browsing`}),{meta:{id:`ai/google-extended-disallowed`,name:`AI: Google-Extended disallowed`,category:fr,tier:pr,description:`Google-Extended disallowed — opt-out from Gemini training and grounding; confirm this is intentional`},async run(e){let t=await jr(e);return t.bots[`Google-Extended`].robotsStatus===`DISALLOWED`?[Mr(`ai/google-extended-disallowed`,`AI: Google-Extended disallowed`,`robots.txt disallows Google-Extended — your content is opted out of training future Gemini models and of grounding in Gemini Apps and Vertex AI. Confirm this is intentional.`,`WARNING`,`If you want to appear in Gemini responses, remove the User-agent: Google-Extended Disallow rule from robots.txt. This is separate from regular Googlebot: disallowing Google-Extended does not affect search rankings, and it does not remove you from AI Overviews either — those follow Googlebot.`,{robotsStatus:t.bots[`Google-Extended`].robotsStatus})]:[]}},{meta:{id:`ai/applebot-extended-disallowed`,name:`AI: Applebot-Extended disallowed`,category:fr,tier:pr,description:`Applebot-Extended disallowed — opt-out from Apple Intelligence; confirm this is intentional`},async run(e){let t=await jr(e);return t.bots[`Applebot-Extended`].robotsStatus===`DISALLOWED`?[Mr(`ai/applebot-extended-disallowed`,`AI: Applebot-Extended disallowed`,`robots.txt disallows Applebot-Extended — your content is opted out of Apple Intelligence training. Confirm this is intentional.`,`INFO`,`If you want Apple Intelligence to learn from this page, remove the User-agent: Applebot-Extended Disallow from robots.txt. Regular Applebot (search) is unaffected.`,{robotsStatus:t.bots[`Applebot-Extended`].robotsStatus})]:[]}},{meta:{id:`ai/empty-content-to-bot`,name:`AI: bot receives near-empty content`,category:fr,tier:pr,description:`AI bot receives near-empty content (likely client-side rendering blocks the bot from seeing the page)`},async run(e){let t=await jr(e),n=Object.values(t.bots).filter(e=>e.likelyJsRendered&&e.fetchStatus===`SUCCESS_200`);if(n.length===0)return[];let r=n.map(e=>e.bot).join(`, `),i=Math.min(...n.map(e=>e.bodyTextLength??0));return[Mr(`ai/empty-content-to-bot`,`AI: bot receives near-empty content`,`${n.length} bot${n.length===1?``:`s`} (${r}) received a 200 OK but the HTML body contained only ${i} characters of readable text. Your content is likely hydrated client-side and invisible to non-rendering crawlers.`,`WARNING`,`Server-render the primary content of this page. Googlebot, bingbot and Applebot document that they render JavaScript; OpenAI, Anthropic, Perplexity and Meta document nothing either way, so content assembled in the browser reaches them only if an undocumented behaviour happens to go your way.`,{bots:n.map(e=>e.bot),minBodyTextLength:i,threshold:vr})]}},{meta:{id:`ai/llms-txt-missing`,name:`AI: llms.txt not found`,category:fr,tier:pr,description:`llms.txt file not found — experimental, low confirmed impact; included for completeness`},async run(e){return(await jr(e)).llmsTxt.exists?[]:[Mr(`ai/llms-txt-missing`,`AI: llms.txt not found`,`No /llms.txt file at the site root. This is an experimental proposed standard for giving AI assistants a curated index — low confirmed impact today, but trivial to add.`,`INFO`,`If you want to provide an LLM-friendly site index, add /llms.txt at the root listing your most important pages. Spec at https://llmstxt.org. Skip this if you do not want to participate in the experiment.`,{exists:!1})]}}],Br=[fn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,Mn,Nn,Pn,Ln,Rn,zn,Bn,Vn,Hn,Un,Jn,Yn,Xn,Zn,Qn,$n,er,tr],Vr=[ir],Hr=[pn,mn,jn,nr,...zr],Ur={[fn.meta.id]:`INFO`,[$n.meta.id]:`INFO`,[Xn.meta.id]:`INFO`,[Yt]:`INFO`},Wr={name:`@lintpage/pro`,rules:Br,asyncRules:Vr,standaloneRules:Hr};function Gr(){return Wr}async function Kr(e){let t;try{let n=await jr(e);t=Object.values(n.bots).map(e=>e.finalUrl).filter(e=>typeof e==`string`&&e.length>0)}catch{return null}for(let n of t){let t=tn(e,n);if(t)return{finding:t,finalUrl:n}}return null}async function qr(e){let t=await sn(zr,e),n=await Kr(e);n&&t.push(n.finding);let r=qt(t),i=Kt(t),a=t.some(e=>e.severity===`CRITICAL`&&e.category!==`AI Visibility`),o=t.some(e=>e.severity===`CRITICAL`&&e.category===`AI Visibility`),s=a?`FAIL`:o?`AI-FAIL`:`PASS`;return{url:e,timestamp:new Date().toISOString(),results:t,score:r,overallStatus:s,categoryScores:i,...n?{finalUrl:n.finalUrl}:{}}}function Jr(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase().replace(/\.$/,``);return t===`localhost`||t.endsWith(`.localhost`)?!0:wt(t)}const Yr=/^https?:\/\//i;function Xr(e){let t=Yr.test(e),n=new URL(t?e:`http://${e}`),r=Jr(n.hostname),i=t?e:`${r?`http`:`https`}://${e}`;return r?{url:i,grant:{loopbackHost:n.hostname,port:Tt(n)}}:{url:i}}function Zr(e){let t=new Map;for(let n of e){if(!n.isBoolean)continue;let e=n.names[0];if(e)for(let r of n.rawName.split(`,`)){let n=r.trim().replace(/^-{1,2}/,``);n.includes(`-`)&&t.set(n,e)}}return t}function Qr(e,t){let n=Zr(t);if(n.size===0)return e;let r=!1;return e.map(e=>{if(r)return e;if(e===`--`)return r=!0,e;if(!e.startsWith(`--`))return e;let[t,...i]=e.slice(2).split(`=`),a=n.get(t);return a?i.length>0?`--${a}=${i.join(`=`)}`:`--${a}`:e})}const $r=`VERCEL_AUTOMATION_BYPASS_SECRET`,ei=`LINTPAGE_BYPASS_ORIGINS`;function ti(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`?t.hostname.toLowerCase().replace(/\.$/,``).endsWith(`.vercel.app`):!1}function ni(e){let t=new Set;for(let n of(e??``).split(/[\s,]+/))if(n)try{t.add(new URL(n).origin)}catch{}return t}function ri(e,t,n){let r=t?.trim();if(!r)return{};if(!ti(e))return{note:`${$r} is set but not sent: it only goes to https *.vercel.app URLs.`};let i=new URL(e).origin;return ni(n).has(i)?{scope:{origin:i,headers:{"x-vercel-protection-bypass":r}},note:`Sending the Vercel protection bypass secret to ${i} only.`}:{note:`${$r} is set but not sent: ${i} is not listed in ${ei}.`}}function ii(e){return e.ruleId===`x-robots-tag`&&e.severity===`CRITICAL`&&/noindex/i.test(String(e.data?.value??``))}function ai(e){return e.map(e=>ii(e)?{...e,severity:`INFO`,data:{...e.data,vercelDowngraded:!0}}:e)}function oi(e){return e.results.some(e=>e.ruleId===`x-robots-tag`&&e.severity===`INFO`&&e.data?.vercelDowngraded===!0)?[`x-robots-tag`]:[]}function si(e,t){let n=[...xt,...Br,...Vr,...Hr],r={};for(let t of n){let n=t.meta.category===`AI Visibility`;e===`only`?r[t.meta.id]=n:n&&(r[t.meta.id]=!1)}return{...t??{},rules:{...t?.rules??{},...r}}}function ci(){return[...Hr,...Vr].map(e=>e.meta.id).sort()}function li(e){return e===!1?!0:typeof e==`object`&&!!e&&e.enabled===!1}function ui(e){let t=di(e).rules??{};return Object.keys(Ur).filter(e=>{let n=t[e];return typeof n==`object`&&!!n&&n.enabled===!0}).sort()}function di(e){let t={...e?.rules??{}};for(let e of ci())t[e]=!1;for(let[e,n]of Object.entries(Ur))li(t[e])||(t[e]={enabled:!0,severity:n});return{...e??{},rules:t}}function fi(e,t){let n=e;return t.grant&&(n=di(n)),t.skipAi&&(n=si(`skip`,n)),n}function pi(e,t){return!e||!t?null:`Error: --ai-only cannot run against localhost. Those rules probe your site as external crawlers, which cannot reach a loopback address.`}const mi=o(`lintpage`);function hi(e){let t=process.env.GITHUB_STEP_SUMMARY;if(t)try{d(t,`${e}\n`)}catch(e){console.error(`Could not write the job summary: ${e instanceof Error?e.message:String(e)}`)}}mi.command(`<url>`,`Run an audit on a URL`).option(`--format <format>`,`Output format: text, json, github`,{default:`text`}).option(`--config <path>`,`Path to config file`).option(`--fail-on-warning`,`Exit 1 on warnings (not just criticals)`).option(`--ai-only`,`Run only the AI Visibility module (LP-050…LP-060)`).option(`--skip-ai`,`Skip the AI Visibility module`).option(`--quiet`,`Minimal output (counts only)`).action(async(i,o)=>{let s=o.format||`text`,c=o.config,l=!!o.failOnWarning,u=!!o.aiOnly,d=!!o.skipAi,f=!!o.quiet;u&&d&&(console.error(a.red(`Error: --ai-only and --skip-ai are mutually exclusive.`)),process.exit(2));try{let{url:t,grant:n}=Xr(i),o=pi(u,n);o&&(console.error(a.red(o)),process.exit(2));let p=un(c)??void 0,m=ti(t),h=fi(p,{grant:n,skipAi:d});!f&&s===`text`&&console.log(a.dim(`Auditing ${t}...`));let g=ri(t,process.env[$r],process.env[ei]);g.note&&console.error(g.note);let _=await Rt(g.scope,()=>u?qr(t):cn(t,{plugins:[Gr()],config:h,grant:n,reportOffSiteRedirect:!0,adjustResults:m?ai:void 0}));if(n&&(_.localhost={host:n.loopbackHost,notRun:ci(),downgraded:ui(p)}),m){let e=oi(_);e.length>0&&(_.vercelDeployment={downgraded:e})}console.log(r(_,s,f,l)),s===`github`&&hi(e(_));let v=_.results.some(e=>e.severity===`CRITICAL`),y=_.results.some(e=>e.severity===`WARNING`);v&&process.exit(1),l&&y&&process.exit(1),process.exit(0)}catch(e){if(s===`json`)console.error(JSON.stringify({error:e instanceof Error?e.message:String(e)}));else if(s===`github`){let r=e instanceof Error?e.message:String(e);console.log(n(i,r)),hi(t(i,r))}else console.error(a.red(`Error: ${e instanceof Error?e.message:String(e)}`));process.exit(2)}}),mi.command(`init`,`Generate a .lintpagerc.json config file`).action(()=>{let e=g(process.cwd(),`.lintpagerc.json`);f(e)&&(console.log(a.yellow(`.lintpagerc.json already exists`)),process.exit(0));let t=dn();h(e,JSON.stringify(t,null,2)+`
|
|
99
|
-
`),console.log(a.green(`Created .lintpagerc.json`)),process.exit(0)}),
|
|
97
|
+
`).map(e=>e.trim()),o=new Map,s=`*`;for(let e of a){if(!e||e.startsWith(`#`))continue;let[t,...n]=e.split(`:`).map(e=>e.trim()),r=n.join(`:`).trim();if(!t||!r)continue;let i=t.toUpperCase();if(i===`USER-AGENT`)s=r,o.has(s)||o.set(s,{disallow:[],allow:[]});else if(i===`DISALLOW`){let e=o.get(s)||{disallow:[],allow:[]};e.disallow.push(r),o.set(s,e)}else if(i===`ALLOW`){let e=o.get(s)||{disallow:[],allow:[]};e.allow.push(r),o.set(s,e)}}let c=o.get(`*`);c&&c.disallow.includes(`/`)&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt contains "Disallow: /" for User-Agent: * - this blocks ALL search engines from crawling your entire site!`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Change "Disallow: /" to "Allow: /" in your robots.txt, or remove the Disallow directive entirely.`}),i.toLowerCase().includes(`sitemap`)||t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt does not reference sitemap.xml - consider adding a Sitemap directive`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Add "Sitemap: https://yoursite.com/sitemap.xml" to the end of your robots.txt file.`}),a.some(e=>!e||e.startsWith(`#`)?!1:!e.includes(`:`)&&e.length>0)&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt may have syntax errors - ensure each directive follows "Directive: value" format`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Review each line in robots.txt. Every directive must follow the "Directive: value" format (e.g., "User-Agent: *").`}),(o.size===0||o.size===1&&!o.has(`*`))&&t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`robots.txt exists but has no rules defined - add User-Agent and Disallow/Allow directives`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Add at minimum "User-Agent: *" followed by "Allow: /" to your robots.txt.`})}catch{t.push({ruleId:`robots-txt-check`,ruleName:`robots.txt Check`,message:`Could not fetch robots.txt - ensure it exists at root domain`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Create a robots.txt file at your domain root (e.g., https://yoursite.com/robots.txt).`})}return t}},mn={meta:{id:`sitemap-presence`,name:`Sitemap Presence`,category:`Pre-Launch`,tier:`pro`,description:`Checks for the existence and validity of sitemap.xml`},async run(e){let t=[];try{let n=new URL(`/sitemap.xml`,e).href,r=await It(n,{headers:{"User-Agent":`LintPage-Bot/1.0`}});if(!r.ok)return t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`No sitemap.xml found - recommended for search engines to discover your pages`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Generate a sitemap.xml and place it at your domain root. Most frameworks (Next.js, WordPress) have built-in sitemap generation.`}),t;let i=await r.text(),a=i.includes(`<urlset`),o=i.includes(`<sitemapindex`);if((!i.includes(`<?xml`)||!a&&!o)&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`sitemap.xml exists but may not be valid XML format`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Ensure your sitemap.xml starts with <?xml version="1.0"?> and uses the <urlset> or <sitemapindex> element with proper namespace.`}),o){let e=i.match(/<sitemap>/g);return(!e||e.length===0)&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`Sitemap index file is empty - add child sitemap references`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Add <sitemap><loc>https://yoursite.com/sitemap-pages.xml</loc></sitemap> entries to your sitemap index.`}),t}let s=i.match(/<loc>/g);(s?s.length:0)===0&&t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`sitemap.xml is empty - add URLs to help search engines discover content`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Add <url><loc>https://yoursite.com/page</loc></url> entries to your sitemap for each page you want indexed.`})}catch{t.push({ruleId:`sitemap-presence`,ruleName:`Sitemap Presence`,message:`Could not fetch sitemap.xml - create one at /sitemap.xml`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Create a sitemap.xml at your domain root. Use a sitemap generator or your framework's built-in sitemap feature.`})}return t}},hn=[`googletagmanager.com`,`google-analytics.com`,`plausible.io`,`usefathom.com`,`posthog.com`,`mixpanel.com`,`mxpnl.com`,`va.vercel-scripts.com`,`vitals.vercel-insights.com`,`cloudflareinsights.com`,`umami.is`,`clarity.ms`];function gn(e){let t=e.toLowerCase().replace(/\.$/,``);return hn.some(e=>t===e||t.endsWith(`.${e}`))}function _n(e,t){let n=new Set([`preconnect`,`dns-prefetch`,`preload`,`modulepreload`]);for(let r of Array.from(e.querySelectorAll(`link[rel][href]`)))if((r.getAttribute(`rel`)||``).toLowerCase().split(/\s+/).some(e=>n.has(e)))try{let{hostname:e}=new URL(r.getAttribute(`href`)||``,t);if(gn(e))return!0}catch{}return!1}function vn(e){if(e.startsWith(`'`))return null;let t=e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``);return t===e&&t.endsWith(`:`)?null:(t=t.split(`/`)[0].replace(/:[0-9*]+$/,``).replace(/^\*\./,``),t.includes(`.`)?t:null)}var yn=new Set([`default-src`,`script-src`,`script-src-elem`,`script-src-attr`,`connect-src`,`img-src`,`frame-src`,`child-src`,`worker-src`,`style-src`,`style-src-elem`,`style-src-attr`,`font-src`,`media-src`,`manifest-src`,`object-src`,`fenced-frame-src`,`prefetch-src`]);function bn(e){let t=[];for(let n of[`content-security-policy`,`content-security-policy-report-only`]){let r=e.response?.headers?.get(n);r&&t.push(r)}for(let n of Array.from(e.document.querySelectorAll(`meta[http-equiv]`)))(n.getAttribute(`http-equiv`)||``).toLowerCase()===`content-security-policy`&&t.push(n.getAttribute(`content`)||``);return t.some(e=>e.split(/[;,]/).flatMap(e=>{let[t,...n]=e.trim().split(/\s+/);return yn.has(t.toLowerCase())?n:[]}).some(e=>{let t=vn(e);return t!==null&&gn(t)}))}var xn={meta:{id:`tracking`,name:`Analytics Tracking`,category:`Pre-Launch`,tier:`pro`,description:`Checks for an analytics service (Google Analytics, Tag Manager, Plausible, PostHog and others) in the page scripts, resource hints and Content-Security-Policy`},run(e){let{document:t}=e,n=[],r=!1,i=t.querySelectorAll(`script`),a=t.documentElement?.outerHTML||``;return i.forEach(e=>{let t=e.getAttribute(`src`)||``,n=e.textContent||``;(t.includes(`googletagmanager.com/gtag/js`)||n.includes(`gtag(`))&&(r=!0),(t.includes(`googletagmanager.com/gtm.js`)||n.includes(`GTM-`))&&(r=!0),t.includes(`plausible.io/js/`)&&(r=!0),(t.includes(`usefathom.com/script.js`)||t.includes(`cdn.usefathom.com`))&&(r=!0),(t.includes(`matomo.js`)||t.includes(`matomo.php`)||t.includes(`piwik.js`))&&(r=!0),(t.includes(`posthog-js`)||t.includes(`i.posthog.com`))&&(r=!0),(t.includes(`cdn.mxpnl.com`)||t.includes(`mixpanel.com`))&&(r=!0),(t.includes(`va.vercel-scripts.com`)||t.includes(`vitals.vercel-insights.com`))&&(r=!0),t.includes(`static.cloudflareinsights.com`)&&(r=!0),(t.includes(`umami.js`)||t.includes(`umami.is/script.js`))&&(r=!0),t.includes(`clarity.ms/tag`)&&(r=!0)}),!r&&(a.includes(`@vercel/analytics`)||a.includes(`vercel-analytics`))&&(r=!0),!r&&_n(t,e.url)&&(r=!0),!r&&bn(e)&&(r=!0),r||n.push({ruleId:`tracking`,ruleName:`Analytics Tracking`,message:`No analytics script found in the page HTML or headers. Analytics loaded from a JavaScript bundle cannot be detected, so check this yourself`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`If the site has no analytics, add one to measure traffic after launch. Options include Google Analytics, Plausible, Fathom, Matomo, PostHog, Vercel Analytics, Umami, or Cloudflare Web Analytics. If it loads analytics from its own JavaScript, nothing needs to change.`,data:{foundAnalytics:r}}),n}},Sn={meta:{id:`x-robots-tag`,name:`X-Robots-Tag Header`,category:`Pre-Launch`,tier:`pro`,description:`Checks the X-Robots-Tag HTTP header for noindex/nofollow`},run(e){let{response:t}=e,n=[],r=t.headers.get(`x-robots-tag`);if(!r)return n;let i=r.toLowerCase();return i.includes(`noindex`)&&n.push({ruleId:`x-robots-tag`,ruleName:`X-Robots-Tag Header`,message:`X-Robots-Tag HTTP header contains "noindex" - page will NOT be indexed by search engines!`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Remove the X-Robots-Tag header from your server configuration, or change its value to "index, follow".`,data:{value:r}}),i.includes(`nofollow`)&&n.push({ruleId:`x-robots-tag`,ruleName:`X-Robots-Tag Header`,message:`X-Robots-Tag HTTP header contains "nofollow" - links will not be followed by search engines`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove "nofollow" from the X-Robots-Tag header if you want search engines to follow your links.`,data:{value:r}}),n}},Cn={meta:{id:`thin-content`,name:`Thin Content`,category:`SEO`,tier:`pro`,description:`Checks that the page has sufficient text content for search engines`},run(e){let{document:t}=e,n=[],r=(t.body?.textContent||``).trim().split(/\s+/).filter(Boolean).length;return r<300&&n.push({ruleId:`thin-content`,ruleName:`Thin Content`,message:`Page has thin content (${r} words) - search engines prefer pages with substantial content (300+ words)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add more meaningful text content to the page. Search engines rank pages with substantial, relevant content higher.`,data:{wordCount:r}}),n}},wn={meta:{id:`duplicate-meta`,name:`Duplicate Meta Tags`,category:`SEO`,tier:`pro`,description:`Checks for duplicate title, meta description, and canonical tags`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`title`);r.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${r.length} <title> tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <title> tags. Keep only one in your <head> element.`,data:{count:r.length,tag:`title`}});let i=t.querySelectorAll(`meta[name="description"]`);i.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${i.length} meta description tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <meta name="description"> tags. Keep only one in your <head> element.`,data:{count:i.length,tag:`meta-description`}});let a=t.querySelectorAll(`link[rel="canonical"]`);return a.length>1&&n.push({ruleId:`duplicate-meta`,ruleName:`Duplicate Meta Tags`,message:`Found ${a.length} canonical link tags - should have exactly one`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove duplicate <link rel="canonical"> tags. Keep only one in your <head> element.`,data:{count:a.length,tag:`canonical`}}),n}},Tn={meta:{id:`structured-data`,name:`Structured Data`,category:`SEO`,tier:`pro`,description:`Checks for the presence and validity of JSON-LD structured data`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`script[type="application/ld+json"]`),i=[];return r.forEach(e=>{try{let t=JSON.parse(e.textContent||``);if(Array.isArray(t[`@graph`]))for(let e of t[`@graph`])e[`@type`]&&i.push(e[`@type`]);else t[`@type`]&&i.push(t[`@type`])}catch{n.push({ruleId:`structured-data`,ruleName:`Structured Data`,message:`Invalid JSON-LD structured data found`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Validate your JSON-LD using Google's Rich Results Test tool and fix any JSON syntax errors.`})}}),i.length===0&&n.push({ruleId:`structured-data`,ruleName:`Structured Data`,message:`No structured data (JSON-LD) found`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add a <script type="application/ld+json"> block with Organization, WebPage, or other relevant schema.org types.`,data:{types:i}}),n}},En={meta:{id:`charset`,name:`Character Encoding`,category:`SEO`,tier:`pro`,description:`Checks for a proper charset/encoding declaration`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[charset]`),i=t.querySelector(`meta[http-equiv="Content-Type"]`);return!r&&!i&&n.push({ruleId:`charset`,ruleName:`Character Encoding`,message:`Missing character encoding declaration - may cause rendering issues with special characters`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta charset="utf-8" /> as the first element in your <head> tag.`}),n}},Dn={meta:{id:`image-alt-text`,name:`Image Alt Text`,category:`Accessibility`,tier:`pro`,description:`Checks that all images have alt attributes`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=0;return r.forEach(e=>{e.getAttribute(`alt`)??i++}),i>0&&n.push({ruleId:`image-alt-text`,ruleName:`Image Alt Text`,message:`${i} of ${r.length} images missing alt attributes`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add descriptive alt attributes to all images. Screen readers use alt text to describe images to visually impaired users. Use alt="" for decorative images.`,data:{total:r.length,missingAlt:i}}),n}},On={meta:{id:`accessibility`,name:`Accessibility & ARIA`,category:`Accessibility`,tier:`pro`,description:`Checks buttons, links, inputs, and ARIA attributes for accessibility`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`button`),i=0;r.forEach(e=>{let t=e.textContent?.trim(),n=e.getAttribute(`aria-label`),r=e.getAttribute(`aria-labelledby`);!t&&!n&&!r&&i++}),i>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${i} button(s) missing accessible name (no text, aria-label, or aria-labelledby)`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add visible text content, an aria-label, or aria-labelledby attribute to each button.`,data:{inaccessibleButtons:i}});let a=t.querySelectorAll(`a`),o=0;a.forEach(e=>{let t=e.textContent?.trim(),n=e.getAttribute(`aria-label`),r=e.getAttribute(`aria-labelledby`);!t&&!n&&!r&&o++}),o>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${o} link(s) missing accessible name (no text, aria-label, or aria-labelledby)`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add descriptive text content, an aria-label, or aria-labelledby attribute to each link so screen readers can identify it.`,data:{inaccessibleLinks:o}});let s=t.querySelectorAll(`input:not([type='hidden'])`),c=0;s.forEach(e=>{let n=e.getAttribute(`id`),r=e.getAttribute(`aria-label`),i=e.getAttribute(`aria-labelledby`),a=e.getAttribute(`title`),o=n&&t.querySelector(`label[for="${n}"]`),s=e.closest(`label`)!==null;!o&&!s&&!r&&!i&&!a&&c++}),c>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${c} input(s) missing associated label`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Add a <label for="inputId"> element, or add an aria-label attribute to each input.`,data:{unlabeledInputs:c}});let l=t.querySelectorAll(`div[onclick], span[onclick]`),u=0;l.forEach(e=>{e.getAttribute(`role`)||u++}),u>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${u} interactive div/span element(s) missing role attribute`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Use a <button> element instead, or add role="button" and an aria-label to interactive elements.`,data:{missingRoles:u}});let d=t.querySelectorAll(`nav, [role="navigation"]`),f=0;return d.forEach(e=>{let t=e.getAttribute(`aria-label`),n=e.getAttribute(`aria-labelledby`);!t&&!n&&f++}),f>0&&n.push({ruleId:`accessibility`,ruleName:`Accessibility & ARIA`,message:`${f} navigation element(s) missing aria-label or aria-labelledby`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add aria-label="Main navigation" (or similar descriptive label) to your <nav> elements.`,data:{unlabeledNav:f}}),n}},kn={meta:{id:`semantic-structure`,name:`Semantic Structure`,category:`Accessibility`,tier:`pro`,description:`Checks for proper semantic HTML: landmarks, lists, tables, articles`},run(e){let{document:t}=e,n=[];t.querySelector(`main`)||n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`Missing <main> element - should wrap primary page content for better structure`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Wrap your primary page content in a <main> element. There should be exactly one per page.`}),t.querySelectorAll(`main, section, article, aside, nav`).length===0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`Missing semantic page regions - use <main>, <section>, <article>, <nav>, <aside> instead of generic divs`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Replace generic <div> containers with semantic elements: <main>, <nav>, <section>, <article>, <aside>.`});let r=t.querySelectorAll(`li`),i=0;r.forEach(e=>{let t=e.parentElement;t?.tagName!==`UL`&&t?.tagName!==`OL`&&i++}),i>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${i} <li> element(s) found outside of <ul> or <ol> - breaks semantic structure`,severity:`WARNING`,category:`Accessibility`,tier:`pro`,fix:`Wrap <li> elements inside a <ul> (unordered) or <ol> (ordered) list element.`,data:{orphanedLi:i}});let a=t.querySelectorAll(`table`),o=0;a.forEach(e=>{e.querySelector(`th`)||o++}),o>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${o} table(s) missing <th> header cells`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add <th> cells to define table column or row headers. Optionally wrap them in a <thead> element for additional structure.`,data:{tablesWithoutHeaders:o}});let s=t.querySelectorAll(`article`),c=0;return s.forEach(e=>{e.querySelector(`h1, h2, h3, h4, h5, h6`)||c++}),c>0&&n.push({ruleId:`semantic-structure`,ruleName:`Semantic Structure`,message:`${c} <article> element(s) without a heading`,severity:`INFO`,category:`Accessibility`,tier:`pro`,fix:`Add a heading (h2-h6) inside each <article> element to provide context.`,data:{articlesWithoutHeading:c}}),n}},An={meta:{id:`performance`,name:`Performance Hints`,category:`Performance`,tier:`pro`,description:`Checks for inline styles, lazy loading, and script count`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=Array.from(r).slice(3),a=0;i.forEach(e=>{e.getAttribute(`loading`)||a++}),a>0&&n.push({ruleId:`performance`,ruleName:`Performance Hints`,message:`${a} below-the-fold image(s) without loading="lazy" - add lazy loading to defer offscreen images`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add loading="lazy" to images below the fold. Do NOT add loading="lazy" to above-the-fold or LCP images - this hurts performance (per web.dev).`,data:{noLazyLoad:a,totalImages:r.length}});let o=t.querySelectorAll(`script[src]`);return o.length>10&&n.push({ruleId:`performance`,ruleName:`Performance Hints`,message:`Consider reducing external scripts (${o.length} found) for better performance`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Audit your scripts and remove unused ones. Consider bundling or deferring non-critical scripts.`,data:{scriptCount:o.length}}),n}},jn={meta:{id:`image-dimensions`,name:`Image Dimensions`,category:`Performance`,tier:`pro`,description:`Checks that images have explicit width and height to prevent layout shift (CLS)`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=0;return r.forEach(e=>{let t=e.getAttribute(`width`),n=e.getAttribute(`height`);(!t||!n)&&i++}),i>0&&n.push({ruleId:`image-dimensions`,ruleName:`Image Dimensions`,message:`${i} image${i===1?``:`s`} missing explicit width/height attributes - causes layout shift (CLS)`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add width and height attributes to <img> tags to reserve space and prevent layout shift.`,data:{missingCount:i,totalImages:r.length}}),n}},Mn={meta:{id:`ttfb-pro`,name:`Time to First Byte (Pro)`,category:`Performance`,tier:`pro`,description:`Measures server response time (TTFB) with detailed thresholds`},async run(e){let t=[];try{let n=Date.now();await It(e,{headers:{"User-Agent":`LintPage-Bot/1.0`}});let r=Date.now()-n;r>1800?t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Slow server response time (TTFB: ${r}ms) - aim for under 800ms`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Optimize server response time: enable caching, use a CDN, optimize database queries, or upgrade hosting.`,data:{ms:r}}):r>800&&t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Server response time could be improved (TTFB: ${r}ms) - aim for under 800ms`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Consider enabling server-side caching or using a CDN to reduce response time.`,data:{ms:r}})}catch{t.push({ruleId:`ttfb-pro`,ruleName:`Time to First Byte (Pro)`,message:`Could not measure TTFB - server may be unreachable`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Ensure your server is accessible and responding to requests.`})}return t}},Nn={meta:{id:`mixed-content`,name:`Mixed Content`,category:`Pre-Launch`,tier:`pro`,description:`Checks for HTTP resources loaded on an HTTPS page (mixed content)`},run(e){let{document:t,isHttps:n}=e,r=[];if(!n)return r;let i=[`img[src^="http:"]`,`script[src^="http:"]`,`link[href^="http:"]`,`iframe[src^="http:"]`,`video[src^="http:"]`,`audio[src^="http:"]`,`object[data^="http:"]`,`source[src^="http:"]`],a=0;return i.forEach(e=>{a+=t.querySelectorAll(e).length}),a>0&&r.push({ruleId:`mixed-content`,ruleName:`Mixed Content`,message:`Found ${a} mixed content resource${a===1?``:`s`} (HTTP on HTTPS page) - browsers may block these`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Change all resource URLs from http:// to https:// or use protocol-relative URLs (//).`,data:{count:a}}),r}},Pn={meta:{id:`security-headers`,name:`Security Headers`,category:`Pre-Launch`,tier:`pro`,description:`Checks for important security headers (CSP, HSTS, X-Content-Type-Options, Permissions-Policy)`},run(e){let{response:t}=e,n=[],r=[{name:`content-security-policy`,label:`Content-Security-Policy`},{name:`strict-transport-security`,label:`Strict-Transport-Security (HSTS)`},{name:`x-content-type-options`,label:`X-Content-Type-Options`},{name:`permissions-policy`,label:`Permissions-Policy`}],i=[];return r.forEach(({name:e,label:n})=>{t.headers.get(e)||i.push(n)}),i.length>0&&n.push({ruleId:`security-headers`,ruleName:`Security Headers`,message:`Missing security headers: ${i.join(`, `)}`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Configure your server or hosting provider to send these security headers. Most can be set in next.config.js headers() or your CDN settings.`,data:{missing:i}}),n}},Fn={meta:{id:`og-image-size`,name:`OG Image Size`,category:`SEO`,tier:`pro`,description:`Checks that the og:image URL exists and advises on recommended dimensions (1200x630)`},run(e){let{document:t}=e,n=[];if(!t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`)?.trim())return n;let r=t.querySelector(`meta[property="og:image:width"]`),i=t.querySelector(`meta[property="og:image:height"]`),a=Number.parseInt(r?.getAttribute(`content`)||``,10),o=Number.parseInt(i?.getAttribute(`content`)||``,10);return!r||!i||Number.isNaN(a)||Number.isNaN(o)?(n.push({ruleId:`og-image-size`,ruleName:`OG Image Size`,message:`Missing og:image:width and og:image:height meta tags - social platforms may crop your image incorrectly`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:image:width" content="1200" /> and <meta property="og:image:height" content="630" /> to your <head>.`}),n):((a<1200||o<630)&&n.push({ruleId:`og-image-size`,ruleName:`OG Image Size`,message:`OG image dimensions (${a}x${o}) are below recommended 1200x630 - may appear blurry on social platforms`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use an image at least 1200x630 pixels for best display on Facebook, LinkedIn, and other social platforms.`,data:{width:a,height:o}}),n)}},In=new Set([`image/jpeg`,`image/png`,`image/gif`,`image/webp`]),Ln=new Set([`.jpg`,`.jpeg`,`.png`,`.gif`,`.webp`]),Rn={meta:{id:`og-image-type`,name:`OG Image Type`,category:`SEO`,tier:`pro`,description:`Checks that the og:image type is a widely-supported format (JPEG, PNG, GIF, WebP)`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`)?.trim();if(!r)return n;let i=t.querySelector(`meta[property="og:image:type"]`)?.getAttribute(`content`)?.trim();if(i&&!In.has(i.toLowerCase()))return n.push({ruleId:`og-image-type`,ruleName:`OG Image Type`,message:`OG image type "${i}" may not be supported by all social platforms`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use JPEG or PNG for og:image. These formats are supported by all social platforms.`,data:{type:i}}),n;if(!i)try{let e=new URL(r,`https://example.com`),t=e.pathname.substring(e.pathname.lastIndexOf(`.`)).toLowerCase();t&&!Ln.has(t)&&n.push({ruleId:`og-image-type`,ruleName:`OG Image Type`,message:`OG image URL has extension "${t}" which may not be supported by all social platforms`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Use JPEG or PNG for og:image, and add <meta property="og:image:type" content="image/jpeg" /> to your <head>.`,data:{extension:t}})}catch{}return n}},zn={meta:{id:`twitter-image`,name:`Twitter/X Image`,category:`SEO`,tier:`pro`,description:`Checks for twitter:image meta tag for rich card previews on X/Twitter`},run(e){let{document:t}=e,n=[];if(!t.querySelector(`meta[name="twitter:card"]`))return n;let r=t.querySelector(`meta[name="twitter:image"]`),i=t.querySelector(`meta[property="og:image"]`);return!r&&!i?n.push({ruleId:`twitter-image`,ruleName:`Twitter/X Image`,message:`Twitter card present but no twitter:image or og:image found - tweets will have no image preview`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta name="twitter:image" content="https://yoursite.com/image.png" /> to your <head>.`}):!r&&i&&n.push({ruleId:`twitter-image`,ruleName:`Twitter/X Image`,message:`No explicit twitter:image - falling back to og:image. Consider adding twitter:image for optimal display.`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add <meta name="twitter:image" content="..." /> for more control over how your image appears on X/Twitter.`}),n}},Bn={meta:{id:`social-preview-render`,name:`Social Preview Completeness`,category:`SEO`,tier:`pro`,description:`Checks that all essential meta tags for social sharing previews are present and consistent`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[property="og:title"]`)?.getAttribute(`content`),i=t.querySelector(`meta[property="og:description"]`)?.getAttribute(`content`),a=t.querySelector(`meta[property="og:image"]`)?.getAttribute(`content`),o=t.querySelector(`meta[property="og:url"]`)?.getAttribute(`content`),s=t.querySelector(`meta[property="og:type"]`)?.getAttribute(`content`),c=t.querySelector(`title`)?.textContent?.trim();return t.querySelector(`meta[name="description"]`)?.getAttribute(`content`),s||n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`Missing og:type meta tag - required by the Open Graph protocol and needed for correct social preview rendering`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:type" content="website" /> (or "article" for blog posts) to your <head>. This is a required property per the Open Graph protocol.`}),a&&a.trim()&&(t.querySelector(`meta[property="og:image:alt"]`)?.getAttribute(`content`)||n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`Missing og:image:alt - the Open Graph protocol recommends providing alt text when og:image is set`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add <meta property="og:image:alt" content="Description of the image" /> to your <head> for accessibility.`})),r&&c&&r.length>0&&c.length>0&&r.length>60&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:title is ${r.length} characters - may be truncated on social platforms (recommended: 50-60)`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Keep og:title under 60 characters for best display on social platforms.`,data:{ogTitleLength:r.length}}),i&&i.length>200&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:description is ${i.length} characters - may be truncated on social platforms (recommended: under 200)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Keep og:description under 200 characters for best display on social platforms.`,data:{ogDescLength:i.length}}),o&&!o.startsWith(`http`)&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:url should be an absolute URL starting with https://`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change og:url to an absolute URL (e.g., https://yoursite.com/page).`}),a&&!a.startsWith(`http`)&&n.push({ruleId:`social-preview-render`,ruleName:`Social Preview Completeness`,message:`og:image should be an absolute URL starting with https://`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change og:image to an absolute URL (e.g., https://yoursite.com/image.png).`}),n}},Vn={meta:{id:`title-keyword-stuffing`,name:`Title Keyword Stuffing`,category:`SEO`,tier:`pro`,description:`Detects potential keyword stuffing in the page title`},run(e){let{document:t}=e,n=[],r=t.querySelector(`title`)?.textContent?.trim();if(!r)return n;let i=r.toLowerCase().split(/[\s\-|:,]+/).filter(e=>e.length>3),a=new Map;for(let e of i)a.set(e,(a.get(e)||0)+1);let o=[];for(let[e,t]of a)t>=3&&o.push(`"${e}" (${t}x)`);o.length>0&&n.push({ruleId:`title-keyword-stuffing`,ruleName:`Title Keyword Stuffing`,message:`Potential keyword stuffing in title: ${o.join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a natural, readable title. Avoid repeating the same keyword more than twice. Search engines may penalize keyword stuffing.`,data:{title:r,stuffedWords:o}});let s=(r.match(/[|–—]/g)||[]).length;return s>=3&&n.push({ruleId:`title-keyword-stuffing`,ruleName:`Title Keyword Stuffing`,message:`Title has ${s} separators - may appear spammy to search engines`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Simplify your title. Use at most one separator (|, – or —) to separate the page name from your brand.`,data:{separatorCount:s}}),n}},Hn={meta:{id:`content-to-html-ratio`,name:`Content-to-HTML Ratio`,category:`SEO`,tier:`pro`,description:`Checks the ratio of visible text to total HTML markup`},run(e){let{document:t}=e,n=[],r=t.documentElement?.outerHTML?.length||0;if(r===0)return n;let i=(t.body?.textContent||``).replace(/\s+/g,` `).trim().length,a=Math.round(i/r*100);return a<10?n.push({ruleId:`content-to-html-ratio`,ruleName:`Content-to-HTML Ratio`,message:`Low content-to-HTML ratio (${a}%) - may indicate excessive markup or thin content`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Increase meaningful text content or reduce unnecessary HTML markup. Note: content-to-HTML ratio is not a direct ranking factor per Google, but correlates with page speed and code quality.`,data:{ratio:a,textLength:i,htmlLength:r}}):a<20&&n.push({ruleId:`content-to-html-ratio`,ruleName:`Content-to-HTML Ratio`,message:`Content-to-HTML ratio is ${a}% - could be improved (aim for 25%+)`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Consider adding more text content or reducing unnecessary HTML markup to improve the ratio.`,data:{ratio:a,textLength:i,htmlLength:r}}),n}},Un={meta:{id:`title-uniqueness`,name:`Title Uniqueness`,category:`SEO`,tier:`pro`,description:`Flags titles that appear generic or auto-generated (single-page heuristic)`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelector(`title`)?.textContent?.trim();if(!i)return r;for(let e of[/^home$/i,/^untitled/i,/^page \d+$/i,/^welcome$/i,/^index$/i,/^document$/i,/^my site$/i,/^my website$/i,/^website$/i,/^new page$/i])if(e.test(i)){r.push({ruleId:`title-uniqueness`,ruleName:`Title Uniqueness`,message:`Title "${i}" appears to be a generic/default title - use a unique, descriptive title`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a unique, descriptive title for each page that includes your target keyword.`,data:{title:i}});break}try{let e=new URL(n).hostname.replace(`www.`,``),t=e.split(`.`)[0];t&&i.toLowerCase()===t.toLowerCase()&&r.push({ruleId:`title-uniqueness`,ruleName:`Title Uniqueness`,message:`Title is just the domain name - add a descriptive page-specific title`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Include a page-specific description in your title, e.g., "Product Name — Your Brand".`,data:{title:i,hostname:e}})}catch{}return r}},Wn={meta:{id:`description-uniqueness`,name:`Description Uniqueness`,category:`SEO`,tier:`pro`,description:`Flags meta descriptions that appear generic or auto-generated (single-page heuristic)`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[name="description"]`)?.getAttribute(`content`)?.trim();if(!r)return n;for(let e of[/^welcome to/i,/^this is a website/i,/^a website about/i,/^home page/i,/^we are a company/i,/^default description/i])if(e.test(r)){n.push({ruleId:`description-uniqueness`,ruleName:`Description Uniqueness`,message:`Meta description appears generic - write a unique, compelling description for this page`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a unique meta description for each page that summarizes the specific content and includes a call to action.`,data:{description:r}});break}let i=t.querySelector(`title`)?.textContent?.trim();return i&&r.toLowerCase()===i.toLowerCase()&&n.push({ruleId:`description-uniqueness`,ruleName:`Description Uniqueness`,message:`Meta description is identical to the title - they should be different and complementary`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Write a meta description that expands on your title with more detail, a value proposition, or a call to action.`,data:{description:r,title:i}}),n}},Gn={Organization:[`name`,`url`],WebSite:[`name`,`url`],WebPage:[`name`],BreadcrumbList:[`itemListElement`],LocalBusiness:[`name`,`address`]},Kn={Article:[`headline`,`author`,`datePublished`],Product:[`name`,`image`,`offers`]};function qn(e){return typeof e==`string`?[e]:Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Jn(e,t,n){let r=qn(e[`@type`]);if(r.length===0){n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD block missing @type property`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add an @type property (e.g., "Organization", "WebPage", "Article") to your JSON-LD.`});return}let i=r.join(`, `);e[`@context`]||t||n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${i}" missing @context - should be "https://schema.org"`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add "@context": "https://schema.org" to your JSON-LD block.`,data:{type:i}});for(let t of r){let r=Gn[t];if(r){let i=r.filter(t=>!e[t]);i.length>0&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${t}" missing required fields: ${i.join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add the missing fields to your ${t} schema: ${i.join(`, `)}.`,data:{type:t,missing:i}})}let i=Kn[t];if(i){let r=i.filter(t=>!e[t]);r.length>0&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`JSON-LD "${t}" missing recommended fields: ${r.join(`, `)}`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Add the recommended fields to your ${t} schema for richer search results: ${r.join(`, `)}.`,data:{type:t,missing:r}})}}r.includes(`FAQPage`)&&n.push({ruleId:`structured-data-validate`,ruleName:`Structured Data Validation`,message:`FAQPage rich results are only shown for well-known, authoritative government and health websites. For all other sites, this rich result will no longer be shown regularly`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`You can keep or remove this markup. Unused structured data does not cause problems for Search, but it also has no visible effects in Google Search. Consider using other structured data types that still produce rich results for your site type.`,data:{type:`FAQPage`}})}var Yn={meta:{id:`structured-data-validate`,name:`Structured Data Validation`,category:`SEO`,tier:`pro`,description:`Validates JSON-LD structured data for required fields based on schema type`},run(e){let{document:t}=e,n=[];return t.querySelectorAll(`script[type="application/ld+json"]`).forEach(e=>{let t;try{t=JSON.parse(e.textContent||``)}catch{return}if(Array.isArray(t[`@graph`])){let e=t[`@context`];for(let r of t[`@graph`])Jn(r,e,n);return}Jn(t,void 0,n)}),n}},Xn={meta:{id:`hreflang`,name:`Hreflang Tags`,category:`SEO`,tier:`pro`,description:`Validates hreflang tags for multi-language pages`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelectorAll(`link[rel="alternate"][hreflang]`);if(i.length===0)return r;Array.from(i).some(e=>e.getAttribute(`hreflang`)===`x-default`)||r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang tags found but missing x-default - add a fallback for unmatched languages`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add <link rel="alternate" hreflang="x-default" href="..." /> to specify the default/fallback page.`}),Array.from(i).some(e=>{let t=e.getAttribute(`href`);return t===n||t===n.replace(/\/$/,``)})||r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang tags do not include a self-referencing tag for the current page`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Add a hreflang tag that points to the current page URL with the appropriate language code.`});let a=/^[a-z]{2}(-[A-Z]{2})?$/;return i.forEach(e=>{let t=e.getAttribute(`hreflang`);t&&t!==`x-default`&&!a.test(t)&&r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Invalid hreflang language code "${t}" - use ISO 639-1 format (e.g., "en", "en-US")`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Change "${t}" to a valid ISO 639-1 language code (e.g., "en", "fr", "de-AT").`,data:{invalidLang:t}});let n=e.getAttribute(`href`);n&&!n.startsWith(`http`)&&r.push({ruleId:`hreflang`,ruleName:`Hreflang Tags`,message:`Hreflang href should be an absolute URL (found: "${n}")`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use absolute URLs (starting with https://) for all hreflang href attributes.`})}),r}},Zn={meta:{id:`canonical-self-referencing`,name:`Canonical Self-Referencing`,category:`SEO`,tier:`pro`,description:`Checks that the canonical URL points to the current page (self-referencing canonical)`},run(e){let{document:t,url:n}=e,r=[],i=t.querySelector(`link[rel="canonical"]`);if(!i)return r;let a=i.getAttribute(`href`)?.trim();if(!a)return r;let o=e=>{try{return new URL(e).href.replace(/\/$/,``)}catch{return e.replace(/\/$/,``)}};try{let e=new URL(a,n).href;o(e)!==o(n)&&(new URL(e).hostname===new URL(n).hostname?r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Canonical URL points to a different page on the same site - this tells search engines to index "${e}" instead of this page`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`If this page should be indexed, change the canonical to point to itself. If this is intentional (e.g., pagination), you can ignore this.`,data:{canonical:e,pageUrl:n}}):r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Canonical URL points to a different domain ("${new URL(e).hostname}") - this is unusual and may be a misconfiguration`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Cross-domain canonical tags are rarely correct. Verify this is intentional, otherwise change the canonical to point to this page.`,data:{canonical:e,pageUrl:n}}))}catch{r.push({ruleId:`canonical-self-referencing`,ruleName:`Canonical Self-Referencing`,message:`Cannot parse canonical URL "${a}" - ensure it's a valid absolute URL`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Use a valid absolute URL for your canonical tag (e.g., https://yoursite.com/page).`})}return r}},Qn=new Set([`application/ecmascript`,`application/javascript`,`application/x-ecmascript`,`application/x-javascript`,`text/ecmascript`,`text/javascript`,`text/javascript1.0`,`text/javascript1.1`,`text/javascript1.2`,`text/javascript1.3`,`text/javascript1.4`,`text/javascript1.5`,`text/jscript`,`text/livescript`,`text/x-ecmascript`,`text/x-javascript`]);function $n(e){let t=e.getAttribute(`type`);if(t===null||t===``){let n=e.getAttribute(`language`);return t===null&&n?Qn.has(`text/${n.toLowerCase()}`):!0}return Qn.has(t.replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g,``).toLowerCase())}var er={meta:{id:`meta-render-blocking`,name:`Render-Blocking Resources`,category:`Performance`,tier:`pro`,description:`Checks for render-blocking stylesheets and synchronous scripts in the <head>`},run(e){let{document:t}=e,n=[],r=t.querySelector(`head`);if(!r)return n;let i=r.querySelectorAll(`script[src]`),a=0;i.forEach(e=>{let t=e.hasAttribute(`async`),n=e.hasAttribute(`defer`),r=e.hasAttribute(`nomodule`);e.getAttribute(`src`)!==``&&!t&&!n&&!r&&$n(e)&&a++}),a>0&&n.push({ruleId:`meta-render-blocking`,ruleName:`Render-Blocking Resources`,message:`${a} synchronous script(s) in <head> may block page rendering`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Add async or defer attributes to non-critical scripts in the <head>, or move them to the end of <body>.`,data:{blockingScripts:a}});let o=r.querySelectorAll(`link[rel="stylesheet"]`),s=0;return o.forEach(e=>{let t=e.getAttribute(`media`);(!t||t===`all`)&&s++}),s>3&&n.push({ruleId:`meta-render-blocking`,ruleName:`Render-Blocking Resources`,message:`${s} render-blocking stylesheets in <head> - consider inlining critical CSS`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Inline critical CSS and load non-critical stylesheets asynchronously using media="print" with an onload handler.`,data:{blockingStylesheets:s}}),n}},tr={meta:{id:`lazy-load-lcp`,name:`Lazy Load LCP`,category:`Performance`,tier:`pro`,description:`Checks that above-the-fold images (likely LCP candidates) are not lazy-loaded`},run(e){let{document:t}=e,n=[],r=t.querySelectorAll(`img`),i=Array.from(r).slice(0,3);for(let e of i){let t=e.getAttribute(`loading`),r=e.getAttribute(`fetchpriority`);if(t===`lazy`){let t=e.getAttribute(`src`)||``,r=e.getAttribute(`alt`)||``,i=r?`"${r.substring(0,40)}"`:t?`src="${t.substring(0,50)}"`:`first image`;n.push({ruleId:`lazy-load-lcp`,ruleName:`Lazy Load LCP`,message:`Above-the-fold image (${i}) has loading="lazy" - this delays the Largest Contentful Paint`,severity:`WARNING`,category:`Performance`,tier:`pro`,fix:`Remove loading="lazy" from above-the-fold images. Add fetchpriority="high" to the LCP image instead.`});break}if(!r&&!t){n.push({ruleId:`lazy-load-lcp`,ruleName:`Lazy Load LCP`,message:`Consider adding fetchpriority="high" to your hero/banner image to improve Largest Contentful Paint`,severity:`INFO`,category:`Performance`,tier:`pro`,fix:`Add fetchpriority="high" to the most important above-the-fold image to prioritize its loading.`});break}}return n}},nr={meta:{id:`https-links`,name:`HTTPS Links`,category:`Pre-Launch`,tier:`pro`,description:`Checks that internal links use HTTPS instead of HTTP`},run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n).hostname}catch{return r}let a=t.querySelectorAll(`a[href^="http:"]`),o=0,s=0;return a.forEach(e=>{let t=e.getAttribute(`href`);if(t)try{new URL(t).hostname===i?o++:s++}catch{}}),o>0&&r.push({ruleId:`https-links`,ruleName:`HTTPS Links`,message:`${o} internal link(s) use HTTP instead of HTTPS`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`Change all internal links from http:// to https:// to avoid redirect chains and mixed content warnings.`,data:{internalHttpLinks:o}}),s>0&&r.push({ruleId:`https-links`,ruleName:`HTTPS Links`,message:`${s} external link(s) use HTTP - consider updating to HTTPS where available`,severity:`INFO`,category:`Pre-Launch`,tier:`pro`,fix:`Update external links to use https:// where the destination supports it.`,data:{externalHttpLinks:s}}),r}},rr={meta:{id:`meta-refresh-redirect`,name:`Meta Refresh Redirect`,category:`SEO`,tier:`pro`,description:`Checks for <meta http-equiv="refresh"> redirects which are bad for SEO`},run(e){let{document:t}=e,n=[],r=t.querySelector(`meta[http-equiv="refresh"]`);if(!r)return n;let i=r.getAttribute(`content`)||``,a=i.toLowerCase().includes(`url=`),o=Number.parseInt(i.split(`;`)[0]||``,10);return a?n.push({ruleId:`meta-refresh-redirect`,ruleName:`Meta Refresh Redirect`,message:`Page uses a meta refresh redirect${Number.isNaN(o)?``:` (${o}s delay)`} - use server-side 301 redirects instead`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Replace <meta http-equiv="refresh"> with a server-side 301 redirect. Meta refreshes are bad for SEO and user experience.`,data:{content:i,delay:Number.isNaN(o)?void 0:o}}):!Number.isNaN(o)&&o>0&&n.push({ruleId:`meta-refresh-redirect`,ruleName:`Meta Refresh Redirect`,message:`Page auto-refreshes every ${o} seconds - this may cause usability issues`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`Consider removing the auto-refresh meta tag unless it serves a clear user need.`,data:{content:i,delay:o}}),n}},ir={meta:{id:`nofollow-audit`,name:`Nofollow Audit`,category:`SEO`,tier:`pro`,description:`Audits the use of rel="nofollow" on internal vs. external links`},run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n).hostname}catch{return r}let a=t.querySelectorAll(`a[rel~="nofollow"]`),o=0;return a.forEach(e=>{let t=e.getAttribute(`href`);if(t)try{new URL(t,n).hostname===i&&o++}catch{(t.startsWith(`/`)||t.startsWith(`.`))&&o++}}),o>0&&r.push({ruleId:`nofollow-audit`,ruleName:`Nofollow Audit`,message:`${o} internal link(s) have rel="nofollow" - this wastes PageRank and hurts internal linking`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Remove rel="nofollow" from internal links. Nofollow should only be used for external links you do not want to endorse (e.g., user-generated content, sponsored links).`,data:{internalNofollow:o,totalNofollow:a.length}}),r}},ar={meta:{id:`cors-policy`,name:`CORS Policy`,category:`Pre-Launch`,tier:`pro`,description:`Checks for overly permissive CORS configuration that could allow unauthorized cross-origin access`},async run(e){let t=[],n=`https://evil.example.com`;try{let r=await It(e,{method:`GET`,headers:{"User-Agent":`LintPage-Bot/1.0`,Origin:n},redirect:`follow`}),i=r.headers.get(`access-control-allow-origin`),a=r.headers.get(`access-control-allow-credentials`);if(!i)return t;i===`*`?a?.toLowerCase()===`true`?t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS allows all origins with credentials enabled - this is a security vulnerability`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Set Access-Control-Allow-Origin to your specific trusted domains instead of "*". Wildcard with credentials is blocked by browsers but indicates a dangerous misconfiguration.`}):t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS allows all origins (Access-Control-Allow-Origin: *) - restrict to trusted domains in production. Note: some hosting platforms (e.g. Vercel, Netlify, Cloudflare Pages) add this header by default, even if you haven't configured it.`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`If you set this header yourself, configure Access-Control-Allow-Origin to only allow requests from your trusted domains (e.g., "https://myapp.com") instead of using the wildcard "*". If your hosting platform adds it automatically, check their documentation for how to override or restrict CORS headers.`}):i.toLowerCase()===n&&(a?.toLowerCase()===`true`?t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS reflects any origin with credentials enabled - any website can make authenticated cross-origin requests and read responses. This is the most exploitable CORS misconfiguration.`,severity:`CRITICAL`,category:`Pre-Launch`,tier:`pro`,fix:`Configure your server to validate the Origin header against a strict allowlist of trusted domains. Never reflect arbitrary origins when credentials are enabled.`}):t.push({ruleId:`cors-policy`,ruleName:`CORS Policy`,message:`CORS reflects any origin back in Access-Control-Allow-Origin - this is equivalent to a wildcard and allows any site to make cross-origin requests. Note: this may be caused by your hosting platform or a reverse proxy, not your own configuration.`,severity:`WARNING`,category:`Pre-Launch`,tier:`pro`,fix:`If you set this header yourself, configure your server to validate the Origin header against an allowlist of trusted domains instead of reflecting it back. If your hosting platform adds it automatically, check their documentation for how to override or restrict CORS headers.`}))}catch{}return t}},or=1e4,sr={meta:{id:`broken-internal-links`,name:`Broken Internal Links`,category:`SEO`,tier:`pro`,description:`Checks that internal links on the page resolve successfully (no 404s or server errors)`},async run(e){let{document:t,url:n}=e,r=[],i;try{i=new URL(n)}catch{return r}let a=new Set,o=[],s=t.querySelectorAll(`a[href]`);for(let e of s){let t=e.getAttribute(`href`);if(!t||t.startsWith(`#`)||t.startsWith(`mailto:`)||t.startsWith(`tel:`)||t.startsWith(`javascript:`)||t.startsWith(`data:`))continue;let r;try{r=new URL(t,n)}catch{continue}if(r.hostname!==i.hostname)continue;r.hash=``;let s=r.toString();if(a.has(s))continue;a.add(s);let c=new URL(n);c.hash=``,s!==c.toString()&&o.push(s)}if(o.length===0)return r;let c=o.slice(0,50),l=[],u=[],d=async e=>{try{let t=await It(e,{method:`HEAD`,headers:{"User-Agent":`LintPage-Bot/1.0`},redirect:`follow`,signal:AbortSignal.timeout(or)});if(t.status===405){let t=await It(e,{method:`GET`,headers:{"User-Agent":`LintPage-Bot/1.0`},redirect:`follow`,signal:AbortSignal.timeout(or)});t.status>=400&&l.push({url:e,status:t.status});return}t.status>=400&&l.push({url:e,status:t.status})}catch{u.push(e)}};for(let e=0;e<c.length;e+=10){let t=c.slice(e,e+10);await Promise.all(t.map(d))}if(l.length>0){let e=l.filter(e=>e.status===404),t=l.filter(e=>e.status>=500),n=l.filter(e=>e.status!==404&&e.status<500);e.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${e.length} internal link(s) return 404 Not Found: ${e.map(e=>e.url).join(`, `)}`,severity:`CRITICAL`,category:`SEO`,tier:`pro`,fix:`Remove or update the broken links to point to valid pages. Broken internal links hurt SEO and user experience.`,data:{notFoundLinks:e}}),t.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${t.length} internal link(s) return server errors: ${t.map(e=>`${e.url} (${e.status})`).join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Investigate server errors on the linked pages. These may indicate temporary issues or misconfigured routes.`,data:{serverErrorLinks:t}}),n.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${n.length} internal link(s) return client errors: ${n.map(e=>`${e.url} (${e.status})`).join(`, `)}`,severity:`WARNING`,category:`SEO`,tier:`pro`,fix:`Check the linked pages for access issues (e.g., 401/403 may indicate authentication or permission problems).`,data:{clientErrorLinks:n}})}return u.length>0&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`${u.length} internal link(s) could not be reached: ${u.join(`, `)}`,severity:`INFO`,category:`SEO`,tier:`pro`,fix:`These links timed out or had network errors during the check. Verify they are accessible.`,data:{unreachableLinks:u}}),o.length>50&&r.push({ruleId:`broken-internal-links`,ruleName:`Broken Internal Links`,message:`Only checked 50 of ${o.length} internal links. Consider reducing the number of links on this page.`,severity:`INFO`,category:`SEO`,tier:`pro`,data:{totalLinks:o.length,checkedLinks:50}}),r}},cr=`https://developers.openai.com/api/docs/bots`,lr=`https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler`,ur=`https://docs.perplexity.ai/docs/resources/perplexity-crawlers`,dr=`https://developers.facebook.com/docs/sharing/webmasters/web-crawlers/`,fr=`https://developer.amazon.com/amazonbot`,pr=`https://docs.mistral.ai/robots`,mr=[{token:`GPTBot`,operator:`OpenAI`,kind:`training`,purpose:`Crawls content for training generative AI foundation models.`,blockingCost:`Your content is excluded from future model training. Live ChatGPT answers are unaffected.`,robots:`documented`,robotsNote:`Disallowing GPTBot "indicates a site's content should not be used in training".`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.4; +https://openai.com/gptbot`,userAgentSource:`example`,docsUrl:cr,ipRangesUrl:`https://openai.com/gptbot.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`OAI-SearchBot`,operator:`OpenAI`,kind:`search`,purpose:`Builds the search index behind ChatGPT search.`,blockingCost:`You "will not be shown in ChatGPT search answers, though can still appear as navigational links".`,robots:`documented`,userAgent:`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36; compatible; OAI-SearchBot/1.4; +https://openai.com/searchbot`,userAgentSource:`example`,docsUrl:cr,ipRangesUrl:`https://openai.com/searchbot.json`,verifiedOn:`2026-09-16`,inChecker:!0,notes:`When fetching robots.txt itself OpenAI inserts a "robots.txt;" marker into the string.`},{token:`ChatGPT-User`,operator:`OpenAI`,kind:`retrieval`,purpose:`Fetches a page on demand when a ChatGPT user, Custom GPT or GPT Action asks for it.`,blockingCost:`ChatGPT cannot retrieve your page to answer a question about it. This is the expensive one.`,robots:`bypasses`,robotsNote:`"Because these actions are initiated by a user, robots.txt rules may not apply."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot`,userAgentSource:`documented`,docsUrl:cr,ipRangesUrl:`https://openai.com/chatgpt-user.json`,verifiedOn:`2026-09-16`,inChecker:!0,notes:`The self-link in the string is +https://openai.com/bot, not /chatgpt-user.`},{token:`OAI-AdsBot`,operator:`OpenAI`,kind:`ads`,purpose:`Validates advertising landing pages. "Only visits pages submitted as ads"; the data is not used for training.`,blockingCost:`Ad landing pages you submit cannot be validated. No effect on organic AI visibility.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-AdsBot/1.0; +https://openai.com/adsbot`,userAgentSource:`documented`,docsUrl:cr,ipRangesUrl:`https://openai.com/adsbot.json`,verifiedOn:`2026-09-16`},{token:`ClaudeBot`,operator:`Anthropic`,kind:`training`,purpose:`Collects web content that "could potentially contribute to their training".`,blockingCost:`Your content is excluded from Claude training data. Live Claude answers are unaffected.`,robots:`documented`,robotsNote:`Honours robots.txt and the non-standard Crawl-delay directive.`,userAgent:null,userAgentSource:`none`,docsUrl:lr,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ClaudeBot/1.0; +claudebot@anthropic.com`,notes:`Anthropic publishes no User-Agent header string for any of its bots. Match the token.`},{token:`Claude-User`,operator:`Anthropic`,kind:`retrieval`,purpose:`Fetches a page when someone asks Claude a question that needs it.`,blockingCost:`Claude cannot retrieve your content in response to a user query.`,robots:`documented`,robotsNote:`No user-initiated exception is documented, unlike ChatGPT-User and Perplexity-User.`,userAgent:null,userAgentSource:`none`,docsUrl:lr,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Mozilla/5.0 (compatible; Claude-User/1.0; +Claude-User@anthropic.com)`},{token:`Claude-SearchBot`,operator:`Anthropic`,kind:`search`,purpose:`Indexes content to improve Claude search result quality.`,blockingCost:`You are excluded from the index Claude search draws on.`,robots:`documented`,userAgent:null,userAgentSource:`none`,docsUrl:lr,ipRangesUrl:`https://claude.com/crawling/bots.json`,verifiedOn:`2026-09-16`},{token:`anthropic-ai`,operator:`Anthropic`,kind:`training`,purpose:`Legacy token in wide circulation. Anthropic does not document it.`,blockingCost:`Unknown. Anthropic lists only ClaudeBot, Claude-User and Claude-SearchBot, so this token may control nothing.`,robots:`undocumented`,userAgent:null,userAgentSource:`none`,docsUrl:null,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`anthropic-ai`,notes:`Appears in countless robots.txt files and blocklists. Absent from Anthropic's documentation, with no retirement notice.`},{token:`PerplexityBot`,operator:`Perplexity`,kind:`search`,purpose:`Indexes pages for Perplexity search. "Not used to crawl content for AI foundation models."`,blockingCost:`You are excluded from Perplexity search results and citations.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)`,userAgentSource:`documented`,docsUrl:ur,ipRangesUrl:`https://www.perplexity.ai/perplexitybot.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`Perplexity-User`,operator:`Perplexity`,kind:`retrieval`,purpose:`Fetches a page because a Perplexity user asked something about it.`,blockingCost:`Perplexity cannot pull up your page to answer a live question.`,robots:`bypasses`,robotsNote:`"Since a user requested the fetch, this fetcher generally ignores robots.txt rules."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Perplexity-User/1.0; +https://perplexity.ai/perplexity-user)`,userAgentSource:`documented`,docsUrl:ur,ipRangesUrl:`https://www.perplexity.ai/perplexity-user.json`,verifiedOn:`2026-09-16`,inChecker:!0},{token:`Google-Extended`,operator:`Google`,kind:`training`,purpose:`Controls training of future Gemini models and grounding in Gemini Apps and Vertex AI.`,blockingCost:`Excluded from Gemini training and grounding. It does NOT remove you from AI Overviews, and it is not a Search ranking signal.`,robots:`documented`,robotsNote:`"Google-Extended does not impact a site's inclusion in Google Search nor is it used as a ranking signal in Google Search."`,userAgent:null,userAgentSource:`robots-token-only`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Google-Extended`,notes:`A control token, not a fetcher. Nothing ever arrives with this User-Agent, so the checker reads your robots.txt for it and sends no request: there is no live result to report.`},{token:`Googlebot`,operator:`Google`,kind:`search`,purpose:`The Search crawler. AI Overviews and AI Mode are built on Search, so this is what feeds them.`,blockingCost:`You leave Google Search entirely. This is the only documented way out of AI Overviews, which is why it is almost never the right move.`,robots:`documented`,robotsNote:`Common crawlers "always respect robots.txt rules for automatic crawls".`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,notes:`Listed as the contrast case: the AI control people reach for is Google-Extended, but the AI surface they mean is governed here.`},{token:`Google-CloudVertexBot`,operator:`Google`,kind:`training`,purpose:`Crawls sites on their owner's request to build Vertex AI Agents.`,blockingCost:`Vertex AI Agents cannot ingest your site. "It has no effect on Google Search or other products."`,robots:`documented`,userAgent:null,userAgentSource:`none`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`,notes:`Google documents the substring only, not a full header string.`},{token:`GoogleOther`,operator:`Google`,kind:`training`,purpose:`Generic crawler used for one-off internal research and development.`,blockingCost:`Preferences for GoogleOther "don't affect any specific product", so blocking it changes little you can observe.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GoogleOther) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers`,verifiedOn:`2026-09-16`},{token:`Google-GeminiNotebook`,operator:`Google`,kind:`retrieval`,purpose:`Fetches URLs a Gemini Notebook user supplies as a source.`,blockingCost:`Nothing you can control by robots.txt: as a user-triggered fetcher it is documented to ignore it.`,robots:`bypasses`,robotsNote:`User-triggered fetchers "generally ignore robots.txt rules".`,userAgent:`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 (compatible; Google-GeminiNotebook; +https://developers.google.com/crawling/docs/crawlers-fetchers/google-gemininotebook)`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-user-triggered-fetchers`,verifiedOn:`2026-09-16`,notes:`Replaced Google-NotebookLM, which Google supported until August 2026.`},{token:`Google-Agent`,operator:`Google`,kind:`retrieval`,purpose:`Agents on Google infrastructure navigating the web and acting on a user's request.`,blockingCost:`Again not robots-controllable. Google pairs it with a Web Bot Auth experiment under the identity https://agent.bot.goog.`,robots:`bypasses`,robotsNote:`User-triggered fetchers "generally ignore robots.txt rules".`,userAgent:`Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko; compatible; Google-Agent; +https://developers.google.com/crawling/docs/crawlers-fetchers/google-agent) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://developers.google.com/crawling/docs/crawlers-fetchers/google-user-triggered-fetchers`,verifiedOn:`2026-09-16`},{token:`Applebot-Extended`,operator:`Apple`,kind:`training`,purpose:`Opts your content out of training Apple's general-purpose foundation models.`,blockingCost:`Excluded from Apple Intelligence training only. "Webpages that disallow Applebot-Extended can still be included in search results", and it is not considered in Search ranking.`,robots:`documented`,userAgent:null,userAgentSource:`robots-token-only`,docsUrl:`https://support.apple.com/en-us/119829`,verifiedOn:`2026-09-16`,inChecker:!0,probeUserAgent:`Applebot-Extended`,notes:`Training only. Grounding is a separate control: nosnippet stops Apple using the page as AI context.`},{token:`Applebot`,operator:`Apple`,kind:`search`,purpose:`Powers Spotlight, Siri and Safari search. The crawled data also feeds foundation-model training and AI grounding.`,blockingCost:`Removes you from Apple search surfaces.`,robots:`documented`,robotsNote:`Respects robots.txt, falls back to Googlebot rules when Applebot is not named, and does not follow crawl-delay.`,userAgent:`Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15 (Applebot/0.1; +http://www.apple.com/go/applebot)`,userAgentSource:`example`,docsUrl:`https://support.apple.com/en-us/119829`,verifiedOn:`2026-09-16`},{token:`bingbot`,operator:`Microsoft`,kind:`search`,purpose:`Builds the Bing index. Copilot grounds on indexed content, so this is the Copilot crawler in practice.`,blockingCost:`You leave the Bing index, and with it Copilot citation: Bing's AI Performance report "reflects only content that is eligible for indexing".`,robots:`documented`,robotsNote:`Honours one group in priority order: bingbot, then msnbot, then the wildcard.`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0`,verifiedOn:`2026-09-16`,notes:`Microsoft controls AI use by meta tag rather than by token: noindex bars training, noarchive bars Chat and Copilot, nocache limits them to URL, title and snippet.`},{token:`DuckAssistBot`,operator:`DuckDuckGo`,kind:`retrieval`,purpose:`Crawls in real time for AI-assisted answers. "This data is not used in any way to train AI models."`,blockingCost:`No AI-assisted answers from your content. "Opting out of DuckAssistBot does not impact organic search rankings." Takes effect after 72 hours.`,robots:`documented`,userAgent:`DuckAssistBot/1.2; (+http://duckduckgo.com/duckassistbot.html)`,userAgentSource:`documented`,docsUrl:`https://duckduckgo.com/duckduckgo-help-pages/results/duckassistbot`,verifiedOn:`2026-09-16`},{token:`meta-externalagent`,operator:`Meta`,kind:`training`,purpose:`Trains foundation AI models, and indexes content directly to improve products.`,blockingCost:`Your content is excluded from Meta AI training and indexing.`,robots:`documented`,userAgent:`meta-externalagent/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:dr,verifiedOn:`2026-09-16`,notes:`The parenthetical is relativized on Meta's own page; match the "meta-externalagent/1.1" prefix rather than the whole string.`},{token:`meta-externalfetcher`,operator:`Meta`,kind:`retrieval`,purpose:`Fetches links a user asked about, including for agentic AI.`,blockingCost:`Meta AI cannot follow a link to your page on a user's behalf.`,robots:`bypasses`,robotsNote:`"May bypass robots.txt because it performs fetches that were requested by the user."`,userAgent:`meta-externalfetcher/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:dr,verifiedOn:`2026-09-16`},{token:`meta-webindexer`,operator:`Meta`,kind:`search`,purpose:`Builds the index Meta AI search cites from.`,blockingCost:`You are excluded from Meta AI search citations.`,robots:`documented`,userAgent:`meta-webindexer/1.1 (+/documentation/sharing/webmasters/web-crawlers)`,userAgentSource:`documented`,docsUrl:dr,verifiedOn:`2026-09-16`},{token:`facebookexternalhit`,operator:`Meta`,kind:`retrieval`,purpose:`Scrapes a page to build the share preview when someone posts your link.`,blockingCost:`Links to your site post without a title, description or image. Nothing to do with AI.`,robots:`bypasses`,robotsNote:`"Might bypass robots.txt when performing security or integrity checks."`,userAgent:`facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)`,userAgentSource:`documented`,docsUrl:dr,verifiedOn:`2026-09-16`,notes:`Listed because it is routinely swept up in AI blocklists, which silently breaks link previews.`},{token:`Amazonbot`,operator:`Amazon`,kind:`training`,purpose:`Crawls to "improve our products and services", which may include training Amazon AI.`,blockingCost:`Excluded from Amazon AI training and product data.`,robots:`documented`,robotsNote:`"Respects the Robots Exclusion Protocol."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amazonbot/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:fr,ipRangesUrl:`https://developer.amazon.com/amazonbot/ip-addresses/`,verifiedOn:`2026-09-16`},{token:`Amzn-SearchBot`,operator:`Amazon`,kind:`search`,purpose:`Builds Amazon's search index.`,blockingCost:`Excluded from Amazon search results.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amzn-SearchBot/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:fr,ipRangesUrl:`https://developer.amazon.com/amazonbot/searchbot-ip-addresses/`,verifiedOn:`2026-09-16`},{token:`Amzn-User`,operator:`Amazon`,kind:`retrieval`,purpose:`Live retrieval on a user's behalf, including for Alexa.`,blockingCost:`Alexa cannot read your page out in answer to a question.`,robots:`partial`,robotsNote:`"May not follow all robots.txt directives."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Amzn-User/0.1) Chrome/W.X.Y.Z Safari/537.36`,userAgentSource:`documented`,docsUrl:fr,ipRangesUrl:`https://developer.amazon.com/amazonbot/live-ip-addresses/`,verifiedOn:`2026-09-16`},{token:`MistralAI-User`,operator:`Mistral`,kind:`retrieval`,purpose:`Fetches pages to answer a user's question in Le Chat.`,blockingCost:`Mistral cannot retrieve your page for a live answer.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-User/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:pr,ipRangesUrl:`https://mistral.ai/mistralai-user-ips.json`,verifiedOn:`2026-09-16`},{token:`MistralAI-Index`,operator:`Mistral`,kind:`search`,purpose:`Builds a search index. Explicitly not training.`,blockingCost:`Excluded from Mistral's search index.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-Index/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:pr,ipRangesUrl:`https://mistral.ai/mistralai-index-ips.json`,verifiedOn:`2026-09-16`},{token:`MistralAI-Training`,operator:`Mistral`,kind:`training`,purpose:`Collects training data for Mistral models.`,blockingCost:`Excluded from Mistral training data.`,robots:`documented`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; MistralAI-Training/1.0; +https://docs.mistral.ai/robots)`,userAgentSource:`documented`,docsUrl:pr,verifiedOn:`2026-09-16`,notes:`The only Mistral agent with no published IP list, so it is the one you cannot verify.`},{token:`CCBot`,operator:`Common Crawl`,kind:`dataset`,purpose:`Builds the Common Crawl public archive. A nonprofit corpus, not an AI product.`,blockingCost:`You leave the corpus that many third-party models train on, which blocks them indirectly. Archives already published stay published.`,robots:`documented`,userAgent:`CCBot/2.0 (https://commoncrawl.org/faq/)`,userAgentSource:`documented`,docsUrl:`https://commoncrawl.org/ccbot`,ipRangesUrl:`https://index.commoncrawl.org/ccbot.json`,verifiedOn:`2026-09-16`,notes:`Predates the LLM era. Verifiable by reverse DNS under *.crawl.commoncrawl.org.`},{token:`YouBot`,operator:`You.com`,kind:`search`,purpose:`Indexes pages for You.com search.`,blockingCost:`Excluded from You.com results.`,robots:`documented`,robotsNote:`"Fully respects robots.txt directives, including user-agent specific rules and crawl-delay."`,userAgent:`Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; YouBot/1.0; +https://docs.you.com/youbot; env:prod) Chrome/X.X.X.X Safari/537.36`,userAgentSource:`documented`,docsUrl:`https://you.com/docs/youbot`,verifiedOn:`2026-09-16`,notes:`Verifiable three ways: IP range, reverse DNS, and Cloudflare Web Bot Auth.`},{token:`Diffbot`,operator:`Diffbot`,kind:`search`,purpose:`Crawls for Diffbot's Knowledge Graph. "It is not used for AI training."`,blockingCost:`Excluded from the Knowledge Graph and products built on it.`,robots:`partial`,robotsNote:`Obeys robots.txt by default, but the default is overridable under a partnership agreement.`,userAgent:null,userAgentSource:`none`,docsUrl:`https://www.diffbot.com/docs/crawl/faq/robots-txt`,verifiedOn:`2026-09-16`,notes:`Diffbot documents the token and a Diffbot-User variant, but no header string.`},{token:`Webzio-extended`,operator:`Webz.io`,kind:`dataset`,purpose:`Collects content resold as datasets. The "-extended" token covers AI and ML use.`,blockingCost:`Your content is kept out of datasets sold on for AI training.`,robots:`documented`,robotsNote:`"Meticulously adheres to robots.txt exclusions."`,userAgent:null,userAgentSource:`none`,docsUrl:`https://webz.io/bot.html`,verifiedOn:`2026-09-16`,notes:`Webz.io also operates the Webzio and Omgilibot tokens. No header string is published for any of them.`}],hr=`AI Visibility`,gr=`pro`,_r=`/blog/ai-crawler-accessibility-guide`,vr=`LintPage/1.0 (+https://lintpage.com)`,yr=5e3,br=3600*1e3,xr=200,Sr=mr.filter(e=>e.inChecker).map(e=>({name:e.token,userAgent:e.probeUserAgent??e.userAgent??e.token,purpose:e.purpose,controlOnly:e.userAgentSource===`robots-token-only`})),Cr=new Map;async function wr(e,t,n=yr){let r=new AbortController,i=setTimeout(()=>r.abort(),n);try{return await It(e,{...t,signal:r.signal})}finally{clearTimeout(i)}}async function Tr(e){try{let t=new URL(`/robots.txt`,e).href,n=await wr(t,{headers:{"User-Agent":vr}});return n.ok?{fetched:!0,raw:await n.text()}:{fetched:!1,raw:null}}catch{return{fetched:!1,raw:null}}}async function Er(e){try{let t=new URL(`/llms.txt`,e).href;return{exists:(await wr(t,{headers:{"User-Agent":vr}})).ok}}catch{return{exists:!1}}}function Dr(e){let t=new Map,n=[],r=!1;for(let i of e.split(`
|
|
98
|
+
`)){let e=i.replace(/#.*$/,``).trim();if(!e)continue;let a=e.indexOf(`:`);if(a===-1)continue;let o=e.slice(0,a).trim().toLowerCase(),s=e.slice(a+1).trim();if(o===`user-agent`){r&&=(n=[],!1);let e=s.toLowerCase();n.push(e),t.has(e)||t.set(e,{allow:[],disallow:[]})}else if(o===`disallow`||o===`allow`){r=!0;for(let e of n){let n=t.get(e);n&&(o===`disallow`?n.disallow.push(s):n.allow.push(s))}}}return t}function Or(e,t){if(e===``)return!1;if(e===`/`)return!0;let n=`^`;for(let t of e)t===`*`?n+=`.*`:t===`$`?n+=`$`:n+=t.replace(/[.+?^${}()|[\]\\]/g,`\\$&`);try{return new RegExp(n).test(t)}catch{return!1}}function kr(e,t,n){if(e===null)return`NO_ROBOTS_TXT`;let r=Dr(e),i=r.get(t.toLowerCase()),a=r.get(`*`),o=i??a;if(!o)return`ALLOWED`;let s=[...o.disallow.map(e=>({pattern:e,allow:!1})),...o.allow.map(e=>({pattern:e,allow:!0}))].filter(e=>e.pattern&&Or(e.pattern,n));return s.length===0?`ALLOWED`:(s.sort((e,t)=>t.pattern.length-e.pattern.length||(e.allow?-1:t.allow?1:0)),s[0].allow?`ALLOWED`:`DISALLOWED`)}function Ar(e,t){return e===200?`SUCCESS_200`:e===403?`BLOCKED_403`:e===429?`BLOCKED_429`:e>=500?`SERVER_ERROR_5XX`:t||e>=300&&e<400?`REDIRECTED`:`ERROR`}function jr(e){return e.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,``).replace(/<style[^>]*>[\s\S]*?<\/style>/gi,``).replace(/<noscript[^>]*>[\s\S]*?<\/noscript>/gi,``).replace(/<[^>]+>/g,` `).replace(/ /g,` `).replace(/\s+/g,` `).trim().length}async function Mr(e,t,n){let r=(()=>{try{return new URL(e).pathname||`/`}catch{return`/`}})(),i=kr(n,t.name,r);if(t.controlOnly)return{bot:t.name,userAgent:t.userAgent,robotsStatus:i,fetchStatus:`NOT_FETCHED`,silentBlock:!1,likelyJsRendered:!1,controlOnly:!0};let a=`ERROR`,o,s,c,l,u,d=!1;try{let n=Date.now(),r=await wr(e,{headers:{"User-Agent":t.userAgent},redirect:`follow`});if(s=Date.now()-n,o=r.status,l=r.url,a=Ar(r.status,r.redirected),r.status===200){let e=await r.text();c=e.length,u=jr(e),!t.controlOnly&&u<xr&&(d=!0)}}catch(e){a=e instanceof Error&&e.name===`AbortError`?`TIMEOUT`:`ERROR`}let f=i===`ALLOWED`||i===`NO_ROBOTS_TXT`,p=a===`BLOCKED_403`||a===`BLOCKED_429`||a===`SERVER_ERROR_5XX`,m=!t.controlOnly&&f&&p;return{bot:t.name,userAgent:t.userAgent,robotsStatus:i,fetchStatus:a,httpStatus:o,responseTimeMs:s,contentLength:c,finalUrl:l,bodyTextLength:u,silentBlock:m,likelyJsRendered:d,controlOnly:t.controlOnly}}async function Nr(e){let[t,n]=await Promise.all([Tr(e),Er(e)]),r=await Promise.all(Sr.map(n=>Mr(e,n,t.raw))),i={};for(let e of r)i[e.bot]=e;return{scannedAt:Date.now(),url:e,robotsTxt:t,llmsTxt:n,bots:i}}async function Pr(e){let t;try{t=new URL(e).hostname}catch{return Nr(e)}let n=Cr.get(t);if(n&&Date.now()-n.cachedAt<br)return n.promise;let r=Nr(e);return Cr.set(t,{promise:r,cachedAt:Date.now()}),r.catch(()=>{Cr.get(t)?.promise===r&&Cr.delete(t)}),r}function Fr(e,t,n,r,i,a){return{ruleId:e,ruleName:t,message:n,severity:r,category:hr,tier:gr,fix:i,learnMoreUrl:_r,data:a}}var Ir={meta:{id:`ai/all-crawlers-blocked`,name:`AI: site-wide AI access blocked`,category:hr,tier:gr,description:`Every tested AI bot is blocked (robots.txt or live block) — page is invisible to AI assistants`},async run(e){let t=await Pr(e),n=Object.values(t.bots).filter(e=>!e.controlOnly),r=n.length,i=n.filter(e=>e.robotsStatus===`DISALLOWED`||e.fetchStatus===`BLOCKED_403`||e.fetchStatus===`BLOCKED_429`||e.fetchStatus===`SERVER_ERROR_5XX`);return i.length<r?[]:[Fr(`ai/all-crawlers-blocked`,`AI: site-wide AI access blocked`,`All ${r} AI bots tested are blocked \u2014 by robots.txt or live block. ChatGPT, Claude, Perplexity, and Gemini cannot read or cite this page.`,`CRITICAL`,`Review robots.txt for blanket AI bot Disallow rules. If using Cloudflare, check Security Settings → Configure AI bot policies and allow the categories you want to stay visible to (Search, Agent, Training are set separately).`,{blocked:i.length,total:r})]}};function Lr(e){return{meta:{id:e.id,name:e.name,category:hr,tier:gr,description:e.description},async run(t){let n=(await Pr(t)).bots[e.bot];return n.silentBlock?[Fr(e.id,e.name,`robots.txt allows ${e.bot} but the live fetch returned HTTP ${n.httpStatus}. This is the Cloudflare-default block: AI bots get a 403 at the edge regardless of what your robots.txt says.`,`CRITICAL`,`Cloudflare \u2192 Security Settings \u2192 Configure AI bot policies, and allow the category "${e.bot}" falls under (Search, Agent or Training). The older "Block AI bots" toggle was deprecated on 2026-09-15, when Cloudflare also applied new defaults to free-plan zones that had never changed the setting. Or, if you intend to opt out, add "User-agent: ${e.bot}\\nDisallow: /" to robots.txt so the signal is intentional.`,{bot:e.bot,httpStatus:n.httpStatus,userAgent:n.userAgent,robotsStatus:n.robotsStatus,fetchStatus:n.fetchStatus})]:[]}}}var Rr=Lr({id:`ai/gptbot-silent-block`,name:`AI: GPTBot silent block`,bot:`GPTBot`,description:`robots.txt allows GPTBot but live fetch returns 403/429 (likely Cloudflare or WAF block)`}),zr=Lr({id:`ai/claudebot-silent-block`,name:`AI: ClaudeBot silent block`,bot:`ClaudeBot`,description:`robots.txt allows ClaudeBot but live fetch returns 403/429`}),Br=Lr({id:`ai/perplexitybot-silent-block`,name:`AI: PerplexityBot silent block`,bot:`PerplexityBot`,description:`robots.txt allows PerplexityBot but live fetch returns 403/429`});function Vr(e){return{meta:{id:e.id,name:e.name,category:hr,tier:gr,description:e.description},async run(t){let n=(await Pr(t)).bots[e.bot],r=n.robotsStatus===`DISALLOWED`,i=n.fetchStatus===`BLOCKED_403`||n.fetchStatus===`BLOCKED_429`||n.fetchStatus===`SERVER_ERROR_5XX`;if(!r&&!i)return[];let a=r?`robots.txt disallows it`:`the live fetch returned HTTP ${n.httpStatus}`;return[Fr(e.id,e.name,`${e.bot} cannot reach this page \u2014 ${a}. When a user asks ${e.serviceLabel} a question that should cite this page, the assistant cannot retrieve the content.`,`CRITICAL`,r?`Remove the User-agent: ${e.bot} Disallow rule from robots.txt. "-User" variants represent live retrieval at user request, not training \u2014 opting out of these typically isn't intentional.`:`Cloudflare or your WAF is blocking ${e.bot}. Allow this bot at the edge \u2014 it represents live AI assistant browsing, not training. Blocking it removes you from ${e.serviceLabel}'s answers.`,{bot:e.bot,userAgent:n.userAgent,httpStatus:n.httpStatus,robotsStatus:n.robotsStatus,fetchStatus:n.fetchStatus})]}}}var Hr=[Ir,Rr,zr,Br,Vr({id:`ai/chatgpt-user-blocked`,name:`AI: ChatGPT-User cannot reach page`,bot:`ChatGPT-User`,serviceLabel:`ChatGPT`,description:`ChatGPT-User cannot reach the page — blocks live ChatGPT browsing when users ask questions`}),Vr({id:`ai/claude-user-blocked`,name:`AI: Claude-User cannot reach page`,bot:`Claude-User`,serviceLabel:`Claude`,description:`Claude-User cannot reach the page — blocks live Claude browsing`}),Vr({id:`ai/perplexity-user-blocked`,name:`AI: Perplexity-User cannot reach page`,bot:`Perplexity-User`,serviceLabel:`Perplexity`,description:`Perplexity-User cannot reach the page — blocks live Perplexity browsing`}),{meta:{id:`ai/google-extended-disallowed`,name:`AI: Google-Extended disallowed`,category:hr,tier:gr,description:`Google-Extended disallowed — opt-out from Gemini training and grounding; confirm this is intentional`},async run(e){let t=await Pr(e);return t.bots[`Google-Extended`].robotsStatus===`DISALLOWED`?[Fr(`ai/google-extended-disallowed`,`AI: Google-Extended disallowed`,`robots.txt disallows Google-Extended — your content is opted out of training future Gemini models and of grounding in Gemini Apps and Vertex AI. Confirm this is intentional.`,`WARNING`,`If you want to appear in Gemini responses, remove the User-agent: Google-Extended Disallow rule from robots.txt. This is separate from regular Googlebot: disallowing Google-Extended does not affect search rankings, and it does not remove you from AI Overviews either — those follow Googlebot.`,{robotsStatus:t.bots[`Google-Extended`].robotsStatus})]:[]}},{meta:{id:`ai/applebot-extended-disallowed`,name:`AI: Applebot-Extended disallowed`,category:hr,tier:gr,description:`Applebot-Extended disallowed — opt-out from Apple Intelligence; confirm this is intentional`},async run(e){let t=await Pr(e);return t.bots[`Applebot-Extended`].robotsStatus===`DISALLOWED`?[Fr(`ai/applebot-extended-disallowed`,`AI: Applebot-Extended disallowed`,`robots.txt disallows Applebot-Extended — your content is opted out of Apple Intelligence training. Confirm this is intentional.`,`INFO`,`If you want Apple Intelligence to learn from this page, remove the User-agent: Applebot-Extended Disallow from robots.txt. Regular Applebot (search) is unaffected.`,{robotsStatus:t.bots[`Applebot-Extended`].robotsStatus})]:[]}},{meta:{id:`ai/empty-content-to-bot`,name:`AI: bot receives near-empty content`,category:hr,tier:gr,description:`AI bot receives near-empty content (likely client-side rendering blocks the bot from seeing the page)`},async run(e){let t=await Pr(e),n=Object.values(t.bots).filter(e=>e.likelyJsRendered&&e.fetchStatus===`SUCCESS_200`);if(n.length===0)return[];let r=n.map(e=>e.bot).join(`, `),i=Math.min(...n.map(e=>e.bodyTextLength??0));return[Fr(`ai/empty-content-to-bot`,`AI: bot receives near-empty content`,`${n.length} bot${n.length===1?``:`s`} (${r}) received a 200 OK but the HTML body contained only ${i} characters of readable text. Your content is likely hydrated client-side and invisible to non-rendering crawlers.`,`WARNING`,`Server-render the primary content of this page. Googlebot, bingbot and Applebot document that they render JavaScript; OpenAI, Anthropic, Perplexity and Meta document nothing either way, so content assembled in the browser reaches them only if an undocumented behaviour happens to go your way.`,{bots:n.map(e=>e.bot),minBodyTextLength:i,threshold:xr})]}},{meta:{id:`ai/llms-txt-missing`,name:`AI: llms.txt not found`,category:hr,tier:gr,description:`llms.txt file not found — experimental, low confirmed impact; included for completeness`},async run(e){return(await Pr(e)).llmsTxt.exists?[]:[Fr(`ai/llms-txt-missing`,`AI: llms.txt not found`,`No /llms.txt file at the site root. This is an experimental proposed standard for giving AI assistants a curated index — low confirmed impact today, but trivial to add.`,`INFO`,`If you want to provide an LLM-friendly site index, add /llms.txt at the root listing your most important pages. Spec at https://llmstxt.org. Skip this if you do not want to participate in the experiment.`,{exists:!1})]}}],Ur=[fn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Nn,Pn,Fn,Rn,zn,Bn,Vn,Hn,Un,Wn,Yn,Xn,Zn,er,tr,nr,rr,ir],Wr=[sr],Gr=[pn,mn,Mn,ar,...Hr],Kr={[fn.meta.id]:`INFO`,[nr.meta.id]:`INFO`,[Zn.meta.id]:`INFO`,[Yt]:`INFO`},qr={name:`@lintpage/pro`,rules:Ur,asyncRules:Wr,standaloneRules:Gr};function Jr(){return qr}async function Yr(e){let t;try{let n=await Pr(e);t=Object.values(n.bots).map(e=>e.finalUrl).filter(e=>typeof e==`string`&&e.length>0)}catch{return null}for(let n of t){let t=tn(e,n);if(t)return{finding:t,finalUrl:n}}return null}async function Xr(e){let t=await sn(Hr,e),n=await Yr(e);n&&t.push(n.finding);let r=qt(t),i=Kt(t),a=t.some(e=>e.severity===`CRITICAL`&&e.category!==`AI Visibility`),o=t.some(e=>e.severity===`CRITICAL`&&e.category===`AI Visibility`),s=a?`FAIL`:o?`AI-FAIL`:`PASS`;return{url:e,timestamp:new Date().toISOString(),results:t,score:r,overallStatus:s,categoryScores:i,...n?{finalUrl:n.finalUrl}:{}}}function Zr(e){let t=e.replace(/^\[|\]$/g,``).toLowerCase().replace(/\.$/,``);return t===`localhost`||t.endsWith(`.localhost`)?!0:wt(t)}const Qr=/^https?:\/\//i;function $r(e){let t=Qr.test(e),n=new URL(t?e:`http://${e}`),r=Zr(n.hostname),i=t?e:`${r?`http`:`https`}://${e}`;return r?{url:i,grant:{loopbackHost:n.hostname,port:Tt(n)}}:{url:i}}function ei(e){let t=new Map;for(let n of e){if(!n.isBoolean)continue;let e=n.names[0];if(e)for(let r of n.rawName.split(`,`)){let n=r.trim().replace(/^-{1,2}/,``);n.includes(`-`)&&t.set(n,e)}}return t}function ti(e,t){let n=ei(t);if(n.size===0)return e;let r=!1;return e.map(e=>{if(r)return e;if(e===`--`)return r=!0,e;if(!e.startsWith(`--`))return e;let[t,...i]=e.slice(2).split(`=`),a=n.get(t);return a?i.length>0?`--${a}=${i.join(`=`)}`:`--${a}`:e})}const ni=`VERCEL_AUTOMATION_BYPASS_SECRET`,ri=`LINTPAGE_BYPASS_ORIGINS`;function ii(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol===`https:`?t.hostname.toLowerCase().replace(/\.$/,``).endsWith(`.vercel.app`):!1}function ai(e){let t=new Set;for(let n of(e??``).split(/[\s,]+/))if(n)try{t.add(new URL(n).origin)}catch{}return t}function oi(e,t,n){let r=t?.trim();if(!r)return{};if(!ii(e))return{note:`${ni} is set but not sent: it only goes to https *.vercel.app URLs.`};let i=new URL(e).origin;return ai(n).has(i)?{scope:{origin:i,headers:{"x-vercel-protection-bypass":r}},note:`Sending the Vercel protection bypass secret to ${i} only.`}:{note:`${ni} is set but not sent: ${i} is not listed in ${ri}.`}}function si(e){return e.ruleId===`x-robots-tag`&&e.severity===`CRITICAL`&&/noindex/i.test(String(e.data?.value??``))}function ci(e){return e.map(e=>si(e)?{...e,severity:`INFO`,data:{...e.data,vercelDowngraded:!0}}:e)}function li(e){return e.results.some(e=>e.ruleId===`x-robots-tag`&&e.severity===`INFO`&&e.data?.vercelDowngraded===!0)?[`x-robots-tag`]:[]}function ui(e,t){let n=[...xt,...Ur,...Wr,...Gr],r={};for(let t of n){let n=t.meta.category===`AI Visibility`;e===`only`?r[t.meta.id]=n:n&&(r[t.meta.id]=!1)}return{...t??{},rules:{...t?.rules??{},...r}}}function di(){return[...Gr,...Wr].map(e=>e.meta.id).sort()}function fi(e){return e===!1?!0:typeof e==`object`&&!!e&&e.enabled===!1}function pi(e){let t=mi(e).rules??{};return Object.keys(Kr).filter(e=>{let n=t[e];return typeof n==`object`&&!!n&&n.enabled===!0}).sort()}function mi(e){let t={...e?.rules??{}};for(let e of di())t[e]=!1;for(let[e,n]of Object.entries(Kr))fi(t[e])||(t[e]={enabled:!0,severity:n});return{...e??{},rules:t}}function hi(e,t){let n=e;return t.grant&&(n=mi(n)),t.skipAi&&(n=ui(`skip`,n)),n}function gi(e,t){return!e||!t?null:`Error: --ai-only cannot run against localhost. Those rules probe your site as external crawlers, which cannot reach a loopback address.`}const _i=o(`lintpage`);function vi(e){let t=process.env.GITHUB_STEP_SUMMARY;if(t)try{d(t,`${e}\n`)}catch(e){console.error(`Could not write the job summary: ${e instanceof Error?e.message:String(e)}`)}}_i.command(`<url>`,`Run an audit on a URL`).option(`--format <format>`,`Output format: text, json, github`,{default:`text`}).option(`--config <path>`,`Path to config file`).option(`--fail-on-warning`,`Exit 1 on warnings (not just criticals)`).option(`--ai-only`,`Run only the AI Visibility module (LP-050…LP-060)`).option(`--skip-ai`,`Skip the AI Visibility module`).option(`--quiet`,`Minimal output (counts only)`).action(async(i,o)=>{let s=o.format||`text`,c=o.config,l=!!o.failOnWarning,u=!!o.aiOnly,d=!!o.skipAi,f=!!o.quiet;u&&d&&(console.error(a.red(`Error: --ai-only and --skip-ai are mutually exclusive.`)),process.exit(2));try{let{url:t,grant:n}=$r(i),o=gi(u,n);o&&(console.error(a.red(o)),process.exit(2));let p=un(c)??void 0,m=ii(t),h=hi(p,{grant:n,skipAi:d});!f&&s===`text`&&console.log(a.dim(`Auditing ${t}...`));let g=oi(t,process.env[ni],process.env[ri]);g.note&&console.error(g.note);let _=await Rt(g.scope,()=>u?Xr(t):cn(t,{plugins:[Jr()],config:h,grant:n,reportOffSiteRedirect:!0,adjustResults:m?ci:void 0}));if(n&&(_.localhost={host:n.loopbackHost,notRun:di(),downgraded:pi(p)}),m){let e=li(_);e.length>0&&(_.vercelDeployment={downgraded:e})}console.log(r(_,s,f,l)),s===`github`&&vi(e(_));let v=_.results.some(e=>e.severity===`CRITICAL`),y=_.results.some(e=>e.severity===`WARNING`);v&&process.exit(1),l&&y&&process.exit(1),process.exit(0)}catch(e){if(s===`json`)console.error(JSON.stringify({error:e instanceof Error?e.message:String(e)}));else if(s===`github`){let r=e instanceof Error?e.message:String(e);console.log(n(i,r)),vi(t(i,r))}else console.error(a.red(`Error: ${e instanceof Error?e.message:String(e)}`));process.exit(2)}}),_i.command(`init`,`Generate a .lintpagerc.json config file`).action(()=>{let e=g(process.cwd(),`.lintpagerc.json`);f(e)&&(console.log(a.yellow(`.lintpagerc.json already exists`)),process.exit(0));let t=dn();h(e,JSON.stringify(t,null,2)+`
|
|
99
|
+
`),console.log(a.green(`Created .lintpagerc.json`)),process.exit(0)}),_i.help();const yi=g(__dirname,`..`,`package.json`),bi=f(yi)?JSON.parse(p(yi,`utf-8`)):{version:`0.0.0`};_i.version(bi.version);try{_i.parse([...process.argv.slice(0,2),...ti(process.argv.slice(2),[_i.globalCommand,..._i.commands].flatMap(e=>e.options))])}catch(e){e instanceof Error&&e.message?(console.error(a.red(`Error: ${e.message}`)),console.error(a.dim(`Run "lintpage --help" for usage information.`))):console.error(a.red(`Error: ${String(e)}`)),process.exit(2)}export{};
|
|
100
100
|
//# sourceMappingURL=cli.mjs.map
|