@wcag-checkr/ci 1.0.23 → 1.0.25
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/dist/assets/{ErrorBoundary-CAo1EDqF.js → ErrorBoundary-Dz8MotbH.js} +42 -42
- package/dist/assets/{copy-ai-fixer-prompt-CoTMEYa8.js → copy-ai-fixer-prompt-zCj1CiZK.js} +2 -2
- package/dist/assets/{devtools-panel-BZ5-1wG6.js → devtools-panel-DZkip4u6.js} +1 -1
- package/dist/assets/{options-C7TJwA_a.js → options-DjXDOL93.js} +1 -1
- package/dist/assets/{parallel-tab-flow-B8XxnbrB.js → parallel-tab-flow-ichC6qRG.js} +1 -1
- package/dist/assets/{rubric-config-client-DhPZ3tGE.js → rubric-config-client-VuUmF7Y1.js} +1 -1
- package/dist/assets/{scheduled-audit-runner-Dek_J9pU.js → scheduled-audit-runner-BJXKsQZK.js} +124 -124
- package/dist/assets/service-worker.ts-GP6asxWi.js +2 -0
- package/dist/assets/side-panel-BcBA4SnN.js +4 -0
- package/dist/assets/{site-report-renderer-Bw9jYmSg.js → site-report-renderer-DelUUXsi.js} +1 -1
- package/dist/assets/{styles-Dg6rHpW6.js → styles-BsDacBC8.js} +1 -1
- package/dist/devtools/panel.html +4 -4
- package/dist/manifest.json +1 -1
- package/dist/options/options.html +2 -2
- package/dist/service-worker-loader.js +1 -1
- package/dist/side-panel/side-panel.html +6 -6
- package/package.json +1 -1
- package/dist/assets/service-worker.ts-BGN4N7Yn.js +0 -2
- package/dist/assets/side-panel-DvxfwgMS.js +0 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ai-usage-log-DVzy9AU1.js","assets/crash-reporter-DAZnNefT.js","assets/scheduled-audit-runner-BJXKsQZK.js","assets/preload-helper-D7HrI6pR.js","assets/diff-CECbooHD.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as $}from"./preload-helper-D7HrI6pR.js";import{at as U,au as v,b as J,y as Z,av as ee,aw as te,ax as re,ay as ae,az as ne,aA as oe,aB as se,aC as ie,aD as ce,aE as le,aF as de,aG as ue,aH as fe,aI as ge,an as pe,aJ as he,aK as Ee,aL as Se,aM as me,aN as Te,aO as ye,p as C,aP as k,aQ as Re,aR as Ie,aS as Q,aT as we,aU as Ae,aV as Ce,aW as _e,aX as be}from"./scheduled-audit-runner-BJXKsQZK.js";import{m as M,b as S,r as Pe}from"./diff-CECbooHD.js";import{w as ke,r as Oe,a as Ue}from"./tier-config-client-CimEdyEg.js";import{w as ve,r as Ne,a as xe}from"./rubric-config-client-VuUmF7Y1.js";import{o as g,m as Le,n as De,c as h,e as _,i as Fe,p as $e,f as B,k as Me}from"./crash-reporter-DAZnNefT.js";import{o as A,p as Ge}from"./ai-usage-log-DVzy9AU1.js";const Ve=h("support-messenger"),He="https://api.wcagcheckr.com/v1/products/wcagcheckr/support",O="support:rate-window",We=5,Ke=10*60*1e3,Qe=2,Be="wcagcheckr",G="storybook:lastDetected";async function je(e){if(!e)return;const t=await chrome.runtime.getPlatformInfo(),a=(await chrome.storage.local.get(G))[G];return{extensionVersion:chrome.runtime.getManifest().version,platform:t,storybookDetected:a!=null&&a.detected?a.version??"detected":"none",licenseTier:await S(),logTail:Le(De())}}async function qe(e=Date.now()){const r=((await chrome.storage.local.get(O))[O]??[]).filter(a=>e-a<Ke);return r.length>=We?!1:(r.push(e),await chrome.storage.local.set({[O]:r}),!0)}async function j(e,t=0){try{const r=await fetch(He,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`http ${r.status}`);const a=await r.json();if(!a.success)throw new Error(a.error??"server returned success=false");return{ticketRef:a.ticketRef??""}}catch(r){if(t<Qe){const a=(t+1)*1e3;return await new Promise(n=>setTimeout(n,a)),j(e,t+1)}throw r}}function Xe(){return g("SUPPORT_MESSAGE_REQUEST",async e=>{if(!await qe())return{type:"SUPPORT_MESSAGE_RESPONSE",success:!1,error:M("NETWORK","Rate limit reached. Try again in 10 minutes.",!0)};try{const t=await je(e.includeContext);return{type:"SUPPORT_MESSAGE_RESPONSE",success:!0,ticketRef:(await j({productSlug:Be,subject:e.subject,body:e.body,replyEmail:e.replyEmail,context:t,extensionVersion:chrome.runtime.getManifest().version,timestamp:new Date().toISOString()})).ticketRef}}catch(t){Ve.error("send failed",t);const r=t instanceof Error?t.message:String(t);return{type:"SUPPORT_MESSAGE_RESPONSE",success:!1,error:M("NETWORK",r,!0)}}})}const q=h("ai-color-suggester");async function Ye(e,t,r=[]){if(!t.enabled||e.length===0)return{results:[],totalCostUsd:0,capExceeded:!1};const a=U(t);if(!a.ok)return{results:[],totalCostUsd:0,capExceeded:!1};const n=a.client,o=v(t.costCapUsd),i=[];for(const c of e){if(!o.canCharge())break;try{const d=await n.suggestColorFix({foreground:c.foreground,background:c.background,fontSize:c.fontSize,fontWeight:c.fontWeight,targetLevel:c.targetLevel,paletteHints:r});o.recordCharge(d.costUsd),d.verdict==="suggested"&&d.candidates.length>0&&i.push({matchKey:c.matchKey,suggestions:d.candidates,reasoning:d.reasoning,costUsd:d.costUsd})}catch(d){q.warn(`color-fix suggestion failed for ${c.matchKey}`,d)}}return{results:i,totalCostUsd:o.state.spentUsd,capExceeded:o.state.exceeded}}async function ze(){const e=await chrome.storage.local.get("aiConfig");return A(e.aiConfig)}function Je(){return g("AI_COLOR_SUGGEST_REQUEST",async e=>{const t=await S();if(!_(t,"aiColorFix"))return{type:"AI_COLOR_SUGGEST_RESPONSE",results:[],totalCostUsd:0,capExceeded:!1,unavailableReason:"AI color-fix suggester is not available on your current plan."};const r=await ze();if(!r.enabled)return{type:"AI_COLOR_SUGGEST_RESPONSE",results:[],totalCostUsd:0,capExceeded:!1,unavailableReason:"AI augmentation is disabled in Settings → AI augmentation."};if(!r.apiKey)return{type:"AI_COLOR_SUGGEST_RESPONSE",results:[],totalCostUsd:0,capExceeded:!1,unavailableReason:"No AI API key configured. Add one in Settings → AI augmentation."};try{const{results:a,totalCostUsd:n,capExceeded:o}=await Ye(e.inputs,r,e.paletteHints);return{type:"AI_COLOR_SUGGEST_RESPONSE",results:a,totalCostUsd:n,capExceeded:o}}catch(a){return q.warn("color-suggest handler failed",a),{type:"AI_COLOR_SUGGEST_RESPONSE",results:[],totalCostUsd:0,capExceeded:!1,unavailableReason:a instanceof Error?a.message:String(a)}}})}function V(e){if(!e)return null;const t=e.match(/rgba?\(\s*([0-9.]+)\s*,?\s*([0-9.]+)\s*,?\s*([0-9.]+)(?:\s*[,/]\s*([0-9.]+))?\s*\)/i);return t?{r:Math.round(parseFloat(t[1])),g:Math.round(parseFloat(t[2])),b:Math.round(parseFloat(t[3])),a:t[4]!==void 0?parseFloat(t[4]):1}:null}function H(e){const t=r=>{const a=r/255;return a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function Ze(e,t){const r=H(e),a=H(t),n=Math.max(r,a),o=Math.min(r,a);return(n+.05)/(o+.05)}function et(e,t){const r=Math.max(0,Math.min(1,e.a));return{r:Math.round(e.r*r+t.r*(1-r)),g:Math.round(e.g*r+t.g*(1-r)),b:Math.round(e.b*r+t.b*(1-r))}}function tt(e,t){var F;if(e!=="color-contrast"&&e!=="color-contrast-enhanced")return null;const r=t.styles;if(!r)return null;const a=((F=r.effectiveBackground)==null?void 0:F.color)??r.background,n=r.foreground;if(!n||!a)return null;const o=V(n),i=V(a);if(!o||!i||i.a<.999)return null;const c=o.a<.999?et(o,i):{r:o.r,g:o.g,b:o.b},d=Ze(c,i),l=r.fontSize??16,s=r.fontWeight??400,u=l>=24||l>=18.5&&s>=700,y=e==="color-contrast-enhanced"?u?4.5:7:u?3:4.5,L=d>=y?"pass":"fail",D=P=>`rgb(${P.r}, ${P.g}, ${P.b})`,z=`Deterministic WCAG contrast measurement (no AI guessing, no pixel sampling). Foreground ${D(c)}${o.a<.999?` (originally rgba with alpha=${o.a}, composited over background)`:""} against background ${D(i)} yields contrast ratio ${d.toFixed(2)}:1. Text is ${l}px at font-weight ${s}; ${u?"qualifies as large text (threshold 3:1 for AA)":"normal text (threshold 4.5:1 for AA)"}. ${L==="pass"?`Passes AA at ${y}:1.`:`Falls below the ${y}:1 threshold.`}`;return{verdict:L,ratio:d,threshold:y,reasoning:z}}async function rt(e,t,r){var c,d,l,s,u;const a=JSON.stringify({ruleId:e,selector:t,styles:{fg:((c=r.styles)==null?void 0:c.foreground)??null,bg:((d=r.styles)==null?void 0:d.background)??null,fs:((l=r.styles)==null?void 0:l.fontSize)??null,fw:((s=r.styles)==null?void 0:s.fontWeight)??null,ts:((u=r.styles)==null?void 0:u.textSample)??null},failureSummary:r.failureSummary??null}),n=new TextEncoder().encode(a),o=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(o)).map(T=>T.toString(16).padStart(2,"0")).join("")}const w=h("ai-incomplete-resolver");function W(e,t){if(!e)return t;const r=e.toLowerCase(),a=/verdict\s+corrected\s+to\s+pass|verdict:\s*pass\s+\(corrected\)/i,n=/verdict\s+corrected\s+to\s+fail|verdict:\s*fail\s+\(corrected\)/i,o=R(r,a),i=R(r,n);if(o>i&&o>=0)return"pass";if(i>o&&i>=0)return"fail";const c=/actually\s+passes|in\s+fact\s+passes|passes\s+AA/gi,d=/actually\s+fails|in\s+fact\s+fails|fails\s+AA/gi,l=R(r,c),s=R(r,d);return l<0&&s<0?t:l>s&&l/r.length>=.5?"pass":s>l&&s/r.length>=.5?"fail":t}function R(e,t){let r=-1;const a=t.flags.includes("g")?t.flags:t.flags+"g",n=new RegExp(t.source,a);let o;for(;(o=n.exec(e))!==null;)r=o.index,o.index===n.lastIndex&&n.lastIndex++;return r}async function at(){const e=await chrome.storage.local.get("aiConfig");return A(e.aiConfig)}async function nt(e){if(!e.aiConfig.enabled||e.elements.length===0)return{resolutions:[],totalCostUsd:0};const t=U(e.aiConfig);if(!t.ok)return{resolutions:[],totalCostUsd:0};const r=t.client,a=v(e.aiConfig.costCapUsd),n=[],o=await J(e.pageUrl),i=new Map;for(const c of o)i.set(`${c.ruleId}::${c.selector}`,c);for(const c of e.elements){if(!a.canCharge())break;const d=await rt(e.ruleId,c.selector,c),l=i.get(`${e.ruleId}::${c.selector}`),s=tt(e.ruleId,c);if(s){w.info(`Deterministic verdict for ${e.ruleId} on ${c.selector}: ${s.verdict} (${s.ratio.toFixed(2)}:1 vs ${s.threshold}:1) — math overrides cache + AI`),n.push({pageUrl:e.pageUrl,ruleId:e.ruleId,selector:c.selector,verdict:s.verdict,reasoning:s.reasoning,resolvedAt:new Date().toISOString(),costUsd:0,wcagCriterion:e.wcagCriterion,inputHash:d});continue}if(l&&l.inputHash===d&&l.verdict!=="uncertain"){w.info(`Reusing cached resolution for ${e.ruleId} on ${c.selector} (hash match, verdict=${l.verdict})`);const u=W(l.reasoning,l.verdict);n.push({...l,verdict:u,resolvedAt:new Date().toISOString(),costUsd:0,inputHash:d});continue}try{const u=await r.resolveAxeIncomplete({ruleId:e.ruleId,element:c,pageUrl:e.pageUrl,targetLevel:e.targetLevel});a.recordCharge(u.costUsd);const T=W(u.reasoning,u.verdict);n.push({pageUrl:e.pageUrl,ruleId:e.ruleId,selector:c.selector,verdict:T,reasoning:u.reasoning,resolvedAt:new Date().toISOString(),costUsd:u.costUsd,wcagCriterion:e.wcagCriterion,inputHash:d})}catch(u){w.warn(`resolveAxeIncomplete failed for ${c.selector}`,u)}}return n.length>0&&await Z(n),{resolutions:n,totalCostUsd:a.state.spentUsd}}function ot(){return g("AI_RESOLVE_INCOMPLETE_REQUEST",async e=>{const t=await S();if(!_(t,"aiIncompleteResolver"))return{type:"AI_RESOLVE_INCOMPLETE_RESPONSE",resolutions:[],totalCostUsd:0,unavailableReason:"AI resolver for axe-incomplete elements is not available on your current plan."};const r=await at();if(!r.enabled)return{type:"AI_RESOLVE_INCOMPLETE_RESPONSE",resolutions:[],totalCostUsd:0,unavailableReason:"AI augmentation is disabled in Settings → AI augmentation."};if(!r.apiKey)return{type:"AI_RESOLVE_INCOMPLETE_RESPONSE",resolutions:[],totalCostUsd:0,unavailableReason:"No AI API key configured. Add one in Settings → AI augmentation."};try{const{resolutions:a,totalCostUsd:n}=await nt({ruleId:e.ruleId,pageUrl:e.pageUrl,wcagCriterion:e.wcagCriterion,elements:e.elements,targetLevel:e.targetLevel,aiConfig:r});return{type:"AI_RESOLVE_INCOMPLETE_RESPONSE",resolutions:a,totalCostUsd:n}}catch(a){return w.warn("ai-incomplete-resolver failed",a),{type:"AI_RESOLVE_INCOMPLETE_RESPONSE",resolutions:[],totalCostUsd:0,unavailableReason:a instanceof Error?a.message:"Unknown error during AI resolution."}}})}function st(){return g("INTERACTIVE_AUDIT_REQUEST",async e=>{try{switch(e.criterionId){case"2.4.3":{const t=await oe({tabId:e.tabId,componentId:e.componentId,pageUrl:e.pageUrl});return t.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:t.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:t.error}}case"2.1.2":{const t=await ne({tabId:e.tabId,componentId:e.componentId,pageUrl:e.pageUrl});return t.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:t.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:t.error}}case"2.4.7":{const t=await ae({tabId:e.tabId,componentId:e.componentId,pageUrl:e.pageUrl});return t.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:t.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:t.error}}case"1.4.11":{const t=await chrome.storage.local.get("sidePanel:lastAudit"),r=t==null?void 0:t["sidePanel:lastAudit"],a=(r==null?void 0:r.results)??[];if(a.length===0)return{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:"No audit results available. Run an audit first; 1.4.11 needs the page screenshot."};const n=await re({componentId:e.componentId,pageUrl:e.pageUrl,results:a});return n.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:n.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:n.error}}case"1.3.2":{const t=await chrome.storage.local.get("sidePanel:lastAudit"),r=t==null?void 0:t["sidePanel:lastAudit"],a=(r==null?void 0:r.results)??[];if(a.length===0)return{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:"No audit results available. Run an audit first, then the 1.3.2 walkthrough can judge its reading-order findings."};const n=await te({componentId:e.componentId,pageUrl:e.pageUrl,results:a});return n.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:n.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:n.error}}case"2.5.3":{const t=await chrome.storage.local.get("sidePanel:lastAudit"),r=t==null?void 0:t["sidePanel:lastAudit"],a=await ee({tabId:e.tabId,componentId:e.componentId,pageUrl:e.pageUrl,results:r==null?void 0:r.results});return a.ok?{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!0,result:a.result}:{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:a.error}}default:return{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:`Interactive audit for criterion ${e.criterionId} not yet implemented.`}}}catch(t){return{type:"INTERACTIVE_AUDIT_RESPONSE",ok:!1,error:t instanceof Error?t.message:String(t)}}})}async function it(){var t;if(typeof chrome>"u"||!((t=chrome.storage)!=null&&t.local))return A(void 0);const e=await chrome.storage.local.get("aiConfig");return A(e.aiConfig)}async function ct(e){const t=await it();if(!t.enabled)return{findings:[],totalCostUsd:0,capExceeded:!1,errors:[],skipReason:"disabled"};if(!t.apiKey)return{findings:[],totalCostUsd:0,capExceeded:!1,errors:[],skipReason:"no-key"};const r=U(t);if(!r.ok)return{findings:[],totalCostUsd:0,capExceeded:!1,errors:[`AI client unavailable: ${r.reason}`],skipReason:"client-error"};const a=r.client,n=v(t.costCapUsd),o=[],i=[],c=Math.max(1,t.maxCandidatesPerCheck??10);if(t.enabledChecks.altText){const d=e.figureAltTexts.slice(0,c);for(const l of d){if(!n.canCharge())break;try{const s=await a.judgeGenericLinkText({linkText:l.alt,surroundingText:`(This is an alt text on a PDF Figure tag, page ${l.pageNum}.)`});n.recordCharge(s.costUsd),s.verdict==="fail"&&s.confidence>=.6&&o.push({ruleId:"pdf-alt-text-not-descriptive",impact:"moderate",wcagCriterion:"1.1.1",description:`Figure on page ${l.pageNum} has alt text "${l.alt}" that doesn't describe the figure's content. ${s.reasoning} A screen-reader user hears the literal alt and gets no useful information about what the figure shows.`,failureSummary:'Replace generic alt text with a description of what the figure actually shows. For data charts: include the key data point. For decorative images: use alt="" so the screen reader skips them. PDF/UA-1 §7.4 / WCAG 1.1.1.'})}catch(s){i.push(`alt-text page ${l.pageNum}: ${s instanceof Error?s.message:String(s)}`)}}}else i.push("altText AI check disabled in user settings");if(t.enabledChecks.altText&&e.formLabels&&e.formLabels.length>0){const d=s=>{switch(s){case"Tx":return"text input";case"Btn":return"button / checkbox / radio";case"Ch":return"choice / dropdown";case"Sig":return"signature field";default:return s||"unknown"}},l=e.formLabels.slice(0,c);for(const s of l){if(!n.canCharge())break;try{const u=await a.judgeGenericLinkText({linkText:s.tooltip,surroundingText:`(This is the screen-reader tooltip for a PDF form field on page ${s.pageNum}. Field type: ${d(s.fieldType)}. Internal field name: "${s.fieldName||"(none)"}".)`});n.recordCharge(u.costUsd),u.verdict==="fail"&&u.confidence>=.6&&o.push({ruleId:"pdf-form-label-not-descriptive",impact:"serious",wcagCriterion:"3.3.2",description:`Form field on page ${s.pageNum} (${d(s.fieldType)}) has tooltip "${s.tooltip}" that doesn't convey what the user should enter. ${u.reasoning} Screen-reader users hear the tooltip as the field's accessible name; generic tooltips fail to identify the field's purpose.`,failureSummary:'Replace the generic tooltip with one that names what the field is for. "Field 1" → "Mailing address." "Text input" → "Email address." In Acrobat: Tools → Prepare Form → right-click field → Properties → General → Tooltip. WCAG 3.3.2 (Labels or Instructions) requires labels that describe purpose, not just type.'})}catch(u){i.push(`form-label page ${s.pageNum}: ${u instanceof Error?u.message:String(u)}`)}}}if(t.enabledChecks.headings&&e.headings&&e.headings.length>0){const d=e.headings.slice(0,c);for(const l of d){if(!n.canCharge())break;try{const s=await a.judgeHeading({headingText:l.headingText,sectionContent:l.sectionContent});n.recordCharge(s.costUsd),s.verdict==="fail"&&s.confidence>=.6&&o.push({ruleId:"pdf-heading-not-descriptive",impact:"moderate",wcagCriterion:"2.4.6",description:`Heading on page ${l.pageNum} "${l.headingText}" doesn't describe the content of its section. ${s.reasoning} Screen-reader users navigating by heading hear titles that don't help them locate the section they want.`,failureSummary:`Rewrite the heading to describe what the section is about. "Section 1" → "Q3 financial summary." "More info" → "How to apply for benefits." Generic, recycled, or placeholder heading text wastes the SR user's heading-navigation feature.`})}catch(s){i.push(`heading page ${l.pageNum}: ${s instanceof Error?s.message:String(s)}`)}}}return{findings:o,totalCostUsd:n.state.spentUsd,capExceeded:n.state.exceeded,errors:i}}function lt(e){return g("PDF_AUDIT_REQUEST",async t=>{const r=await e();if(!_(r,"pdfAudit"))return{type:"PDF_AUDIT_RESPONSE",ok:!1,source:t.url,findings:[],pageCount:null,fatalError:`PDF accessibility audit is not enabled on the ${r} tier. Upgrade or contact your admin to enable the pdfAudit feature.`};try{const a=await se(t.url,{maxBytes:t.maxBytes});let n=[];if(a.aiCandidates)try{const o=await ct(a.aiCandidates);if(n=o.findings,o.skipReason&&(a.aiCandidates.figureAltTexts.length>0||a.aiCandidates.headings.length>0||a.aiCandidates.formLabels.length>0)){const i=o.skipReason==="no-key"?"No Anthropic API key configured. AI quality checks (alt-text descriptiveness, heading clarity, form-label match) did NOT run on this PDF.":o.skipReason==="disabled"?"AI augmentation is disabled in Settings → AI. AI quality checks did NOT run on this PDF.":"AI client could not be constructed. AI quality checks did NOT run on this PDF.";n=[...n,{ruleId:"pdf-ai-quality-skipped",impact:"minor",wcagCriterion:"1.1.1",description:i+` (${a.aiCandidates.figureAltTexts.length} figure alts, ${a.aiCandidates.headings.length} headings, ${a.aiCandidates.formLabels.length} form labels would have been judged.)`,failureSummary:"Configure an Anthropic API key in Settings → AI augmentation to enable PDF semantic-quality checks. The structural audit ran normally; this informational finding is dismissible."}]}}catch{}return{type:"PDF_AUDIT_RESPONSE",ok:a.ok,source:a.source,findings:[...a.findings,...n],pageCount:a.pageCount,...a.fatalError?{fatalError:a.fatalError}:{},...a._perPageContrast?{_perPageContrast:a._perPageContrast}:{},...a.aiCandidates?{aiCandidates:a.aiCandidates}:{}}}catch(a){return{type:"PDF_AUDIT_RESPONSE",ok:!1,source:t.url,findings:[],pageCount:null,fatalError:`PDF audit handler threw: ${a instanceof Error?a.message:String(a)}`}}})}const dt=h("ax-tree-snapshot"),ut="1.3";function ft(e){var r,a,n;const t=[];for(const o of e.properties??[]){const i=(r=o.value)==null?void 0:r.value;i!==void 0&&(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i===null)&&t.push({name:o.name,value:i})}return{nodeId:e.nodeId,parentId:e.parentId,childIds:e.childIds??[],role:typeof((a=e.role)==null?void 0:a.value)=="string"?e.role.value:"unknown",name:typeof((n=e.name)==null?void 0:n.value)=="string"?e.name.value:"",ignored:!!e.ignored,properties:t,backendDomNodeId:e.backendDOMNodeId}}async function gt(e){let t=!1;try{try{await chrome.debugger.attach({tabId:e},ut),t=!0}catch(n){if(!(n instanceof Error?n.message:String(n)).includes("Another debugger"))throw dt.warn("chrome.debugger.attach failed",n),n}await chrome.debugger.sendCommand({tabId:e},"Accessibility.enable");const r=await chrome.debugger.sendCommand({tabId:e},"Accessibility.getFullAXTree");return((r==null?void 0:r.nodes)??[]).map(ft)}finally{if(t)try{await chrome.debugger.detach({tabId:e})}catch{}}}const X=h("perf-throttle"),pt="1.3",ht={none:{label:"No throttling",network:null,cpuRate:1},"3g-slow":{label:"Slow 3G",network:{offline:!1,latency:400,downloadThroughput:500*1024/8,uploadThroughput:500*1024/8},cpuRate:6},"3g-fast":{label:"Fast 3G",network:{offline:!1,latency:150,downloadThroughput:1.5*1024*1024/8,uploadThroughput:750*1024/8},cpuRate:4},"4g":{label:"4G LTE",network:{offline:!1,latency:20,downloadThroughput:4*1024*1024/8,uploadThroughput:3*1024*1024/8},cpuRate:2},"cpu-2x":{label:"CPU 2× slowdown (no network throttle)",network:null,cpuRate:2},"cpu-4x":{label:"CPU 4× slowdown (no network throttle)",network:null,cpuRate:4}};async function Et(e){try{return await chrome.debugger.attach({tabId:e},pt),!0}catch(t){if((t instanceof Error?t.message:String(t)).includes("Another debugger"))return!1;throw t}}async function St(e,t){const r=ht[t];await Et(e),await chrome.debugger.sendCommand({tabId:e},"Network.enable"),r.network?await chrome.debugger.sendCommand({tabId:e},"Network.emulateNetworkConditions",r.network):await chrome.debugger.sendCommand({tabId:e},"Network.emulateNetworkConditions",{offline:!1,latency:0,downloadThroughput:-1,uploadThroughput:-1}),await chrome.debugger.sendCommand({tabId:e},"Emulation.setCPUThrottlingRate",{rate:r.cpuRate}),X.info(`applied ${t} (label="${r.label}", cpu×${r.cpuRate})`)}async function mt(e){try{await chrome.debugger.sendCommand({tabId:e},"Network.emulateNetworkConditions",{offline:!1,latency:0,downloadThroughput:-1,uploadThroughput:-1}),await chrome.debugger.sendCommand({tabId:e},"Emulation.setCPUThrottlingRate",{rate:1})}catch(t){X.debug("throttle reset commands failed (debugger may not be attached)",t)}}const f=h("service-worker");Fe("service-worker");ie();var I,K;(K=(I=chrome.sidePanel)==null?void 0:I.setPanelBehavior)==null||K.call(I,{openPanelOnActionClick:!0}).catch(e=>f.warn("setPanelBehavior failed",e));ce();le();Pe();de().catch(e=>f.warn("initial cloud pull failed",e));(async()=>(await Ge(),await ke(),Oe(),await ve(),Ne(),ue(),fe(),ge(),pe()))();chrome.alarms.onAlarm.addListener(e=>{const t=he(e.name);t!==null&&Ee(t).catch(r=>f.warn(`scheduled audit ${t} threw at top level`,r))});Ue();xe();Se();me();Xe();Je();Te();ot();st();lt(S);self.addEventListener("unhandledrejection",e=>{const t=e.reason;$e(t instanceof Error?t:new Error(String(t)))});let E=!1;chrome.runtime.onConnect.addListener(e=>{if(e.name==="audit-keepalive"){f.debug("keepalive connected"),e.onDisconnect.addListener(async()=>{f.debug("keepalive disconnected"),await ye()});return}if(e.name==="sidepanel-tracker"){E=!0,f.debug("chrome.sidePanel opened"),e.onDisconnect.addListener(async()=>{E=!1,f.debug("chrome.sidePanel closed — restoring in-page overlay"),await b()});return}});let N=!1;const p={isCanceled:()=>N};async function x(){const e=await C();if(e)try{await B(e,{type:"SIDEBAR_HIDE_REQUEST"})}catch(t){f.warn("sidebar hide failed",t)}}async function b(){const e=await C();if(e)try{await B(e,{type:"SIDEBAR_SHOW_REQUEST"})}catch(t){f.warn("sidebar show failed",t)}}g("START_AUDIT",async e=>{N=!1,await x();const t=await C();let r;const a={verifyFixesOnly:e.verifyFixesOnly,recordForensic:e.recordForensic};if(e.mode==="single-element"){if(!e.scope)throw new Error("START_AUDIT single-element requires scope");r=k(e.scope,p,e.frameId,e.matrixOverride,a)}else if(e.mode==="full-page")r=k("html",p,0,e.matrixOverride,a);else if(e.mode==="quick-scan"){const{QUICK_SCAN_MATRIX_SETTINGS:n}=await $(async()=>{const{QUICK_SCAN_MATRIX_SETTINGS:o}=await import("./ai-usage-log-DVzy9AU1.js").then(i=>i.H);return{QUICK_SCAN_MATRIX_SETTINGS:o}},__vite__mapDeps([0,1]));r=k(e.scope??"html",p,e.frameId??0,n,a)}else if(e.mode==="all-frames")r=Re(p);else if(e.mode==="parallel-scan"){const{runParallelScan:n}=await $(async()=>{const{runParallelScan:o}=await import("./scheduled-audit-runner-BJXKsQZK.js").then(i=>i.bb);return{runParallelScan:o}},__vite__mapDeps([2,3,1,4,0]));r=n(p)}else r=Ie(p);r.catch(n=>{f.error("audit failed",n);const o=n instanceof Error?n.message:String(n),i=/no audit target tab/i.test(o);Me({type:"AUDIT_FAILED_EVENT",error:{code:i?"RESTRICTED_URL":"UNKNOWN",message:i?"No audit target tab found. Open a regular http(s) page (not chrome:// or about:blank) and try again.":`Audit failed: ${o}`,recoverable:!0}})}).finally(()=>{t!=null&&Q(t).catch(n=>f.debug("post-audit debugger release failed (best-effort)",n)),E||b()})});g("CANCEL_AUDIT",async()=>{N=!0,f.info("cancel requested")});let m=!1;const Y={isCanceled:()=>m};g("START_SITE_CRAWL",async e=>{m=!1,await x();const t=await C();we(e.startUrl,{maxPages:e.maxPages,includeRegex:e.includeRegex,excludeRegex:e.excludeRegex,verifyFixesOnly:e.verifyFixesOnly,urls:e.urls,recordForensic:e.recordForensic},Y).catch(r=>f.error("site crawl failed",r)).finally(()=>{t!=null&&Q(t).catch(r=>f.debug("post-crawl debugger release failed (best-effort)",r)),E||b()})});g("CANCEL_SITE_CRAWL",async()=>{m=!0,f.info("site crawl cancel requested")});g("START_CRAWL_DISCOVERY",async e=>{m=!1,await x(),Ae(e.startUrl,{maxPages:e.maxPages,includeRegex:e.includeRegex,excludeRegex:e.excludeRegex},Y).catch(t=>f.error("crawl discovery failed",t)).finally(()=>{E||b()})});g("CANCEL_CRAWL_DISCOVERY",async()=>{m=!0,f.info("crawl discovery cancel requested")});g("REGRADE_SITE_CRAWL",async()=>{try{const e=await Ce();return{type:"REGRADE_SITE_CRAWL_RESPONSE",ok:e.ok,...e.reason?{reason:e.reason}:{}}}catch(e){return{type:"REGRADE_SITE_CRAWL_RESPONSE",ok:!1,reason:e instanceof Error?e.message:String(e)}}});g("OPEN_SETTINGS",()=>{chrome.runtime.openOptionsPage()});g("PERF_THROTTLE_APPLY_REQUEST",async e=>{try{return await St(e.tabId,e.profile),{type:"PERF_THROTTLE_APPLY_RESPONSE",ok:!0}}catch(t){return{type:"PERF_THROTTLE_APPLY_RESPONSE",ok:!1,error:t instanceof Error?t.message:String(t)}}});g("PERF_THROTTLE_CLEAR_REQUEST",async e=>{try{return await mt(e.tabId),{type:"PERF_THROTTLE_CLEAR_RESPONSE",ok:!0}}catch(t){return{type:"PERF_THROTTLE_CLEAR_RESPONSE",ok:!1,error:t instanceof Error?t.message:String(t)}}});g("SITE_CLAIM_GET_REQUEST",async e=>({type:"SITE_CLAIM_GET_RESPONSE",claim:await _e(e.domain)}));g("SITE_CLAIM_LIST_REQUEST",async()=>({type:"SITE_CLAIM_LIST_RESPONSE",claims:await be()}));g("AX_TREE_SNAPSHOT_REQUEST",async e=>{const t=await S();if(!_(t,"axTreeViewer"))return{type:"AX_TREE_SNAPSHOT_RESPONSE",ok:!1,error:"AX-tree viewer is not available on your current plan."};try{return{type:"AX_TREE_SNAPSHOT_RESPONSE",ok:!0,nodes:await gt(e.tabId)}}catch(r){return f.warn("ax-tree snapshot failed",r),{type:"AX_TREE_SNAPSHOT_RESPONSE",ok:!1,error:r instanceof Error?r.message:String(r)}}});f.info("service worker ready");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/site-report-renderer-DelUUXsi.js","assets/scheduled-audit-runner-BJXKsQZK.js","assets/preload-helper-D7HrI6pR.js","assets/crash-reporter-DAZnNefT.js","assets/diff-CECbooHD.js","assets/ai-usage-log-DVzy9AU1.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"./modulepreload-polyfill-B5Qt9EMX.js";import{r as c,j as e,C as Se,t as Ne,u as Ie,o as Ue,c as ze,R as Pe}from"./styles-BsDacBC8.js";import{u as f,a as oe,R as ue,c as De,C as Le,M as _e,l as ne,b as We,d as Ge,e as Fe,i as Me,P as Oe,f as $e,s as He,w as Be,r as Ve,g as qe,h as Ke,j as Ye,p as Qe,k as Ze,A as Xe,m as Je,E as et,n as tt}from"./ErrorBoundary-Dz8MotbH.js";import{s as S,r as rt,i as at}from"./crash-reporter-DAZnNefT.js";import{B as ie}from"./ai-usage-log-DVzy9AU1.js";import{c as nt,C as it,a as st,d as ot,l as Ce,g as Re,s as lt,b as ct,e as dt,f as ut,h as pe,i as pt,j as vt}from"./scheduled-audit-runner-BJXKsQZK.js";import{_ as re}from"./preload-helper-D7HrI6pR.js";import{copyAiFixerPrompt as gt}from"./copy-ai-fixer-prompt-zCj1CiZK.js";import{w as ve,h as ge,r as he}from"./tier-config-client-CimEdyEg.js";import{w as me,r as fe}from"./rubric-config-client-VuUmF7Y1.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./diff-CECbooHD.js";import"./design-system-audit-DpxJrxnb.js";function xe({initialUrl:t,isRunning:a,onCrawl:r,onVerifyFixes:o,onAuditThisPage:s,reviewEnabled:l,onToggleReview:i}){const[n,g]=c.useState(t),[y,h]=c.useState(25),[p,b]=c.useState(""),[k,j]=c.useState(""),[w,m]=c.useState(!1),[E,P]=c.useState(ie),[x,F]=c.useState(ie[0].id),[$,U]=c.useState(null),[W,R]=c.useState(!0);c.useEffect(()=>{t&&!n&&g(t)},[t]),c.useEffect(()=>{let u=!1;return Promise.all([S({type:"SETTINGS_GET",key:"matrixPresets"}),S({type:"SETTINGS_GET",key:"activePresetId"})]).then(([T,L])=>{if(u)return;const d=Array.isArray(T.data)?T.data:null;P(d&&d.length>0?d:ie),typeof L.data=="string"&&F(L.data)}),()=>{u=!0}},[]),c.useEffect(()=>{let u=!1;return S({type:"SETTINGS_GET",key:"crawlRememberSettings"}).then(async T=>{if(u)return;const d=T.data!==!1;if(R(d),!d)return;const[C,B,M]=await Promise.all([S({type:"SETTINGS_GET",key:"crawlMaxPages"}),S({type:"SETTINGS_GET",key:"crawlIncludeRegex"}),S({type:"SETTINGS_GET",key:"crawlExcludeRegex"})]);if(u)return;const O=C.data;typeof O=="number"&&O>=1&&h(Math.min(200,O));const Z=B.data,X=M.data;typeof Z=="string"&&Z&&b(Z),typeof X=="string"&&X&&j(X),(typeof Z=="string"&&Z||typeof X=="string"&&X)&&m(!0)}),()=>{u=!0}},[]);function Q(u){h(u),W&&S({type:"SETTINGS_SET",key:"crawlMaxPages",value:u})}function v(u){b(u),W&&S({type:"SETTINGS_SET",key:"crawlIncludeRegex",value:u})}function z(u){j(u),W&&S({type:"SETTINGS_SET",key:"crawlExcludeRegex",value:u})}function A(u){R(u),S({type:"SETTINGS_SET",key:"crawlRememberSettings",value:u}),u&&(S({type:"SETTINGS_SET",key:"crawlMaxPages",value:y}),S({type:"SETTINGS_SET",key:"crawlIncludeRegex",value:p.trim()}),S({type:"SETTINGS_SET",key:"crawlExcludeRegex",value:k.trim()}))}function N(u){const T=E.find(L=>L.id===u);T&&(F(u),S({type:"SETTINGS_SET",key:"activePresetId",value:u}),S({type:"SETTINGS_SET",key:"stateMatrix",value:T.matrix}))}function H(){U(null);for(const[u,T]of[["Include",p.trim()],["Exclude",k.trim()]])if(T)try{new RegExp(T)}catch(L){return U(`${u} regex invalid: ${L instanceof Error?L.message:String(L)}`),!1}return!0}function D(){const u=n.trim();if(!u)return null;let T;try{T=new URL(u)}catch{return"Start URL must be a full URL starting with http:// or https://."}return T.protocol!=="http:"&&T.protocol!=="https:"?`Start URL must use http:// or https:// — ${T.protocol} can't be crawled.`:null}const I=D(),q=!!n.trim()&&!I;function V(u){if(!H()||!q)return;const T={startUrl:n.trim(),maxPages:y,includeRegex:p.trim(),excludeRegex:k.trim()};u&&o?o(T):r(T)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",textAlign:"left"},children:[e.jsxs(J,{label:"Start URL",children:[e.jsx("input",{type:"url",value:n,onChange:u=>g(u.target.value),placeholder:"https://yoursite.com",disabled:a,"aria-invalid":!!I,className:"v2-mono",style:ee}),I&&e.jsx("p",{role:"alert",style:{margin:"4px 0 0",fontSize:11,color:"var(--v2-critical)",lineHeight:1.4},children:I})]}),e.jsx(J,{label:"Max pages",hint:"1–200. Each page runs the full pipeline you configured.",children:e.jsx("input",{type:"number",min:1,max:200,value:y,onChange:u=>Q(Math.min(200,Math.max(1,parseInt(u.target.value,10)||25))),disabled:a,className:"v2-mono",style:{...ee,maxWidth:100}})}),e.jsx(J,{label:"Audit depth",hint:"State matrix preset applied to every crawled page.",children:e.jsx("select",{value:x,onChange:u=>N(u.target.value),disabled:a,style:ee,children:E.map(u=>e.jsx("option",{value:u.id,children:u.name},u.id))})}),e.jsx("button",{type:"button",onClick:()=>m(u=>!u),className:"v2-eyebrow",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-ink-secondary)",textAlign:"left",alignSelf:"flex-start"},children:w?"− hide advanced filters":"+ show URL filters (include / exclude)"}),w&&e.jsxs(e.Fragment,{children:[e.jsx(J,{label:"Include only URLs matching",hint:"Optional regex. Empty = no filter.",children:e.jsx("input",{type:"text",value:p,onChange:u=>v(u.target.value),placeholder:"^https://example\\.com/products/",disabled:a,className:"v2-mono",style:ee})}),e.jsx(J,{label:"Exclude URLs matching",hint:"Optional regex. Useful for /admin or /login while logged in.",children:e.jsx("input",{type:"text",value:k,onChange:u=>z(u.target.value),placeholder:"/admin|/dashboard|/login",disabled:a,className:"v2-mono",style:ee})})]}),$&&e.jsx("p",{role:"alert",style:{color:"var(--v2-critical)",fontSize:12,margin:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)"},children:$}),e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-2)",fontSize:12,lineHeight:1.4,color:"var(--v2-ink-secondary)",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:W,disabled:a,onChange:u=>A(u.target.checked),style:{marginTop:2}}),e.jsxs("span",{children:[e.jsx("strong",{style:{color:"var(--v2-ink-primary)"},children:"Remember these settings."})," ","Keep max pages + the include/exclude filters for next time (the audit-depth preset is always remembered)."]})]}),e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-2)",fontSize:12,lineHeight:1.4,color:"var(--v2-ink-secondary)",cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:l,disabled:a,onChange:u=>i(u.target.checked),style:{marginTop:2}}),e.jsxs("span",{children:[e.jsx("strong",{style:{color:"var(--v2-ink-primary)"},children:"Review pages before auditing."})," ","List every page that would be crawled, then remove any you don't want before the audit runs."]})]}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:a||!q,onClick:()=>V(!1),children:a?"Crawling…":l?"Find pages to audit":"Crawl whole site"}),o&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:a||!q,onClick:()=>V(!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),s&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:a,onClick:s,title:"Single-page audit on the active tab (no crawl)",children:"Just this page"})]})]})}function ht(){var h;const t=f(p=>p.siteCrawlProgress),a=f(p=>p.siteCrawlStatus),r=f(p=>p.progress),o=f(p=>p.aiProgress),[s,l]=c.useState(!1);function i(){l(!0),S({type:"CANCEL_SITE_CRAWL"})}if(a!=="running")return null;const n=t?Math.min(100,Math.max(0,t.current/Math.max(1,t.total)*100)):0,g=r?Math.min(100,Math.max(0,r.current/Math.max(1,r.total)*100)):0,y=r!=null&&r.currentState?[r.currentState.pseudoState,r.currentState.theme&&r.currentState.theme!=="light"?r.currentState.theme:null,r.currentState.direction&&r.currentState.direction!=="ltr"?r.currentState.direction:null,(h=r.currentState.breakpoint)!=null&&h.id&&r.currentState.breakpoint.id!=="desktop"?r.currentState.breakpoint.id:null].filter(Boolean).join(" · "):"";return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"crawling…"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:12,fontWeight:600,color:"var(--v2-ink-primary)",fontVariantNumeric:"tabular-nums"},children:t?`${t.current} / ${t.total}`:"…"})]}),e.jsx("div",{role:"progressbar","aria-valuenow":(t==null?void 0:t.current)??0,"aria-valuemin":0,"aria-valuemax":(t==null?void 0:t.total)??1,"aria-label":"Crawl progress",style:{height:8,background:"var(--v2-bg-elev-2)",borderRadius:4,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${n}%`,background:"var(--v2-action)",transition:"width 240ms ease"}})}),(t==null?void 0:t.url)&&e.jsxs("div",{children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:4},children:"current page"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:t.url})]}),(t==null?void 0:t.lastViolations)!==void 0&&t.lastViolations>0&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:["last page: ",t.lastViolations," axe violation",t.lastViolations===1?"":"s"]}),r&&e.jsxs("div",{style:{marginTop:"var(--v2-pad-2)",paddingTop:"var(--v2-pad-3)",borderTop:"1px solid var(--v2-border)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("span",{className:"v2-eyebrow",style:{color:"var(--v2-ink-tertiary)"},children:"this page · auditing"}),e.jsxs("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",fontVariantNumeric:"tabular-nums"},children:[r.current," / ",r.total]})]}),e.jsx("div",{role:"progressbar","aria-valuenow":r.current,"aria-valuemin":0,"aria-valuemax":r.total,"aria-label":"Current page audit progress",style:{height:4,background:"var(--v2-bg-elev-2)",borderRadius:2,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${g}%`,background:"var(--v2-ink-tertiary)",transition:"width 240ms ease"}})}),y&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)"},children:["state: ",y]}),o&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-needs-review)",fontVariantNumeric:"tabular-nums"},children:["AI: ",o.current," / ",o.total," · ",o.currentCheckLabel,o.candidatesTotal&&o.candidatesTotal>0?` (${o.candidatesDone??0}/${o.candidatesTotal})`:""]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-3)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:i,disabled:s,children:s?"Cancelling…":"Cancel crawl"}),s&&e.jsx("span",{"aria-live":"polite",style:{fontSize:11,color:"var(--v2-ink-tertiary)"},children:"Wrapping up current page audit — final cancel can take up to a few seconds."})]})]})}function mt(){const t=f(s=>s.crawlDiscoveryStatus),a=f(s=>s.crawlDiscoveryFound),r=f(s=>s.crawlDiscoveryLastUrl);function o(){S({type:"CANCEL_CRAWL_DISCOVERY"}),f.getState().resetCrawlDiscovery()}return t!=="discovering"?null:e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"finding pages…"}),e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:12,fontWeight:600,color:"var(--v2-ink-primary)",fontVariantNumeric:"tabular-nums"},children:[a," page",a===1?"":"s"," found"]}),r&&e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:r}),e.jsx("p",{style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.4},children:"Loading each page to read its links — no audit yet. You'll prune the list before anything is audited."}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:o,children:"Cancel"})})]})}function ft({onAudit:t}){const a=f(i=>i.crawlDiscoveryStatus),r=f(i=>i.crawlDiscoveryUrls),[o,s]=c.useState(new Set);c.useEffect(()=>{a==="reviewing"&&s(new Set(r))},[a,r]);function l(){S({type:"CANCEL_CRAWL_DISCOVERY"}),f.getState().resetCrawlDiscovery()}return a!=="reviewing"?null:e.jsxs("div",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",textAlign:"left"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"review pages to audit"}),e.jsxs("p",{style:{margin:0,fontSize:12,color:"var(--v2-ink-secondary)",lineHeight:1.4},children:["Found ",e.jsx("strong",{style:{color:"var(--v2-ink-primary)"},children:r.length})," page",r.length===1?"":"s",". Uncheck any you don't want, then audit the rest. ",e.jsx("strong",{style:{color:"var(--v2-ink-primary)"},children:o.size})," selected."]}),r.length===0?e.jsx("p",{style:{margin:0,fontSize:12,color:"var(--v2-ink-tertiary)"},children:"No pages discovered from this URL. Check the start URL + filters and try again."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-3)"},children:[e.jsx("button",{type:"button",onClick:()=>s(new Set(r)),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-action)",fontSize:11},children:"select all"}),e.jsx("button",{type:"button",onClick:()=>s(new Set),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-action)",fontSize:11},children:"select none"})]}),e.jsx("ul",{style:{listStyle:"none",margin:0,padding:0,maxHeight:300,overflowY:"auto",border:"1px solid var(--v2-border)",borderRadius:4},children:r.map(i=>e.jsx("li",{style:{borderBottom:"1px solid var(--v2-border)"},children:e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-2)",padding:"6px 10px",fontSize:11,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:o.has(i),onChange:n=>s(g=>{const y=new Set(g);return n.target.checked?y.add(i):y.delete(i),y}),style:{marginTop:2}}),e.jsx("span",{className:"v2-mono",style:{wordBreak:"break-all",color:"var(--v2-ink-secondary)"},children:i})]})},i))})]}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[e.jsxs("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:o.size===0,onClick:()=>t(r.filter(i=>o.has(i))),children:["Audit ",o.size," page",o.size===1?"":"s"]}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:l,children:"Cancel"})]})]})}function xt(){const t=f(h=>h.status),a=f(h=>h.progress),r=f(h=>h.aiProgress),[o,s]=c.useState(!1);if(t!=="running")return null;const l=a?a.current>=a.total:!1,i=a?l?"Running deep analyzers…":`Auditing… ${a.current} / ${a.total}`:"Starting audit…",n=a?l?"reading order · tab order · typography · CSS vars · AI candidates":yt(a.currentState):"Loading axe + DOM analyzers",g=a?l?100:a.current/Math.max(1,a.total)*100:0;function y(){s(!0),S({type:"CANCEL_AUDIT"})}return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-4)"},children:[e.jsx(ye,{label:i,detail:n,pct:g,valuenow:a?Math.min(a.current,a.total):0,valuemax:a?a.total:1,ariaLabel:a?l?"Running deep analyzers: reading order, tab order, typography, custom properties, AI candidates.":`Audit progress: ${a.current} of ${a.total} states`:"Audit starting",fillColor:"var(--v2-action)"}),r&&e.jsx(ye,{label:`AI augmentation… ${r.current} / ${r.total}`,detail:r.candidatesTotal&&r.candidatesTotal>0?`${r.currentCheckLabel} (${r.candidatesDone??0}/${r.candidatesTotal})`:r.currentCheckLabel,pct:r.current/Math.max(1,r.total)*100,valuenow:r.current,valuemax:r.total,ariaLabel:`AI augmentation: ${r.current} of ${r.total} checks. ${r.currentCheckLabel}`,fillColor:"var(--v2-needs-review)"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-3)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:y,disabled:o,children:o?"Cancelling…":"Cancel audit"}),o&&e.jsx("span",{"aria-live":"polite",style:{fontSize:11,color:"var(--v2-ink-tertiary)"},children:"Wrapping up — final cancel can take up to a few seconds."})]})]})}function ye({label:t,detail:a,pct:r,valuenow:o,valuemax:s,ariaLabel:l,fillColor:i}){return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:[e.jsx("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:e.jsx("span",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:t})}),e.jsx("div",{role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":s,"aria-label":l,style:{height:6,background:"var(--v2-bg-elev-2)",borderRadius:3,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${r}%`,background:i,transition:"width 240ms ease"}})}),a&&e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:a})]})}function yt(t){if(!t)return"";const a=[t.pseudoState];return t.theme&&t.theme!=="light"&&a.push(t.theme),t.direction&&t.direction!=="ltr"&&a.push(t.direction),a.join(" · ")}function J({label:t,hint:a,children:r}){return e.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{className:"v2-eyebrow",style:{color:"var(--v2-ink-secondary)"},children:t}),r,a&&e.jsx("span",{style:{fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.4},children:a})]})}const ee={fontFamily:"var(--v2-body)",fontSize:12,padding:"8px 10px",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,outline:"none"};function bt({sealed:t}){const[a,r]=c.useState(!1),o=JSON.stringify({claim:t.claim,hash:t.hash,receipt:t.receipt},null,2),s=new Date(t.claim.auditedAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),l=()=>{navigator.clipboard.writeText(o).then(()=>{r(!0),setTimeout(()=>r(!1),2500)})};return e.jsxs("div",{role:"group","aria-label":"Wall of Fame badge",style:{marginTop:"var(--v2-pad-5)",padding:"var(--v2-pad-4)",border:"1px solid var(--v2-verified, #15803d)",borderRadius:6,background:"var(--v2-verified-bg, rgba(21,128,61,0.06))",maxWidth:640},children:[e.jsx("p",{style:{margin:0,fontWeight:600,fontSize:13,color:"var(--v2-ink-primary)"},children:"🏆 You earned a Wall of Fame badge"}),e.jsxs("p",{style:{margin:"var(--v2-pad-2) 0 0",fontSize:12,color:"var(--v2-ink-secondary)"},children:["WCAG ",t.claim.wcagLevel," · grade ",t.claim.grade," · ",t.claim.pageCount," page",t.claim.pageCount===1?"":"s"," · audited ",s]}),e.jsxs("p",{style:{margin:"var(--v2-pad-2) 0 0",fontSize:11,lineHeight:1.5,color:"var(--v2-ink-tertiary)"},children:["Submit this signed attestation at ",e.jsx("strong",{children:"accessibilitywatch.org"})," to claim a public, dated, verifiable badge for ",e.jsx("strong",{children:t.claim.domain}),". They verify the signature and confirm you control the domain before it goes live."]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-3)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:l,children:a?"Copied ✓":"Copy attestation"}),e.jsx("span",{role:"status","aria-live":"polite",style:{fontSize:11,color:"var(--v2-verified, #15803d)"},children:a?"Attestation copied to clipboard.":""})]})]})}function kt(t){const[a,r]=c.useState(null);return c.useEffect(()=>{if(!t){r(null);return}let o=!1;const s=()=>rt({type:"SITE_CLAIM_GET_REQUEST",domain:t}).then(i=>{o||r(i.claim)}).catch(()=>{o||r(null)});s();const l=i=>{typeof i=="object"&&i!==null&&i.type==="SITE_CLAIM_SEALED_EVENT"&&i.domain===t&&s()};return chrome.runtime.onMessage.addListener(l),()=>{o=!0,chrome.runtime.onMessage.removeListener(l)}},[t]),a}function be({open:t,gaps:a,onRunFull:r,onQuickCheck:o,onCancel:s}){return t?e.jsx("div",{role:"dialog","aria-modal":"true","aria-label":"Audit settings are below WCAG 2.1 AA conformance",style:{position:"fixed",inset:0,background:"rgba(2,6,23,0.7)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:16},onClick:s,children:e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{background:"#0f172a",border:"1px solid #334155",borderRadius:10,maxWidth:460,width:"100%",padding:20,color:"#e2e8f0"},children:[e.jsx("h2",{style:{margin:"0 0 8px",fontSize:16},children:"Your settings aren’t a Full 2.1 AA audit"}),e.jsxs("p",{style:{margin:"0 0 10px",fontSize:13,color:"#cbd5e1",lineHeight:1.5},children:["A grade only means WCAG 2.1 AA if the audit exercised the states and checks the AA criteria live in. With your current settings, this run is a ",e.jsx("strong",{children:"quick check"}),", not a conformance result."]}),e.jsx("ul",{style:{margin:"0 0 14px",paddingLeft:18,fontSize:12,color:"#fca5a5",lineHeight:1.6},children:a.map((l,i)=>e.jsx("li",{children:l},i))}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx("button",{onClick:r,style:{background:"#2563eb",color:"#fff",border:"none",borderRadius:6,padding:"10px 12px",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Run the Full 2.1 AA audit (applies the preset, then crawls)"}),e.jsx("button",{onClick:o,style:{background:"#1e293b",color:"#cbd5e1",border:"1px solid #334155",borderRadius:6,padding:"10px 12px",fontSize:13,cursor:"pointer"},children:"Quick check with current settings — not a conformance result"}),e.jsx("button",{onClick:s,style:{background:"none",color:"#64748b",border:"none",fontSize:12,padding:"4px",cursor:"pointer"},children:"Cancel"})]}),e.jsx("p",{style:{margin:"12px 0 0",fontSize:11,color:"#64748b",lineHeight:1.5},children:"Either way, the grade and every export are stamped with the exact settings used — a quick check can’t be mistaken for a conformance result. (Owner mode isn’t affected; it only flags demand-letter bait.)"})]})}):null}function wt(){const[t,a]=c.useState([]),[r,o]=c.useState(!1),s=c.useRef(null),l=c.useRef(!1),i=c.useCallback(async()=>{try{const p=await chrome.storage.local.get(["stateMatrix","runsPerState","aiConfig"]),b=p.aiConfig??{},k=nt({stateMatrix:p.stateMatrix,runsPerState:typeof p.runsPerState=="number"?p.runsPerState:1,aiEnabled:!!b.enabled&&!!b.apiKey});return a(k),k}catch{return a([]),[]}},[]);c.useEffect(()=>{i()},[i]);const n=c.useCallback(async p=>{if((await i()).length===0||l.current){p();return}s.current=p,o(!0)},[i]),g=c.useCallback(async()=>{try{const k=(await chrome.storage.local.get("aiConfig")).aiConfig??{};await chrome.storage.local.set({stateMatrix:st,runsPerState:it,aiConfig:{...k,enabled:!0}})}catch{}l.current=!0,o(!1);const p=s.current;s.current=null,p==null||p()},[]),y=c.useCallback(()=>{l.current=!0,o(!1);const p=s.current;s.current=null,p==null||p()},[]),h=c.useCallback(()=>{o(!1),s.current=null},[]);return{gaps:t,gateOpen:r,requestCrawl:n,runFull:g,quickCheck:y,cancel:h}}function jt(){const{report:t,resolvedFails:a}=oe(),r=f(d=>d.siteCrawlReport),o=f(d=>d.siteCrawlStatus),s=f(d=>d.siteCrawlError),l=f(d=>d.status),i=o==="running",g=i||l==="running"&&!i,y=!!t&&!r,h=!y&&(t==null?void 0:t.siteGrade)==="A"&&t.startUrl?ot(t.startUrl):null,p=kt(h),[b,k]=c.useState(null);c.useEffect(()=>{let d=!1;return chrome.tabs.query({active:!0,currentWindow:!0}).then(C=>{var M;if(d)return;const B=((M=C[0])==null?void 0:M.url)??null;k(B&&/^https?:\/\//i.test(B)?B:null)}),()=>{d=!0}},[]);const[j,w]=c.useState(!1),m=f(d=>d.crawlDiscoveryStatus),[E,P]=c.useState(!0),x=wt(),[F,$]=c.useState("");c.useEffect(()=>{S({type:"SETTINGS_GET",key:"crawlReviewEnabled"}).then(d=>{const C=d.data;typeof C=="boolean"&&P(C)})},[]);function U(d){P(d),S({type:"SETTINGS_SET",key:"crawlReviewEnabled",value:d})}function W(d,C=!1){if(d.startUrl){if(C){R(d,!0);return}x.requestCrawl(()=>R(d,!1))}}function R(d,C=!1){if(E&&!C){$(d.startUrl),f.getState().setSiteCrawlError(null),f.getState().setCrawlDiscoveryStatus("discovering"),We({type:"START_CRAWL_DISCOVERY",startUrl:d.startUrl,maxPages:d.maxPages,...d.includeRegex?{includeRegex:d.includeRegex}:{},...d.excludeRegex?{excludeRegex:d.excludeRegex}:{}});return}f.getState().setSiteCrawlStatus("running"),f.getState().setSiteCrawlReport(null),f.getState().setSiteCrawlError(null),ne({type:"START_SITE_CRAWL",startUrl:d.startUrl,maxPages:d.maxPages,...d.includeRegex?{includeRegex:d.includeRegex}:{},...d.excludeRegex?{excludeRegex:d.excludeRegex}:{},...C?{verifyFixesOnly:!0}:{}})}function Q(d){d.length!==0&&(f.getState().setSiteCrawlStatus("running"),f.getState().setSiteCrawlReport(null),f.getState().setSiteCrawlError(null),f.getState().resetCrawlDiscovery(),ne({type:"START_SITE_CRAWL",startUrl:F,urls:d}))}function v(){ne({type:"START_AUDIT",mode:"full-page"}),f.getState().startNewScan()}const[z,A]=c.useState(!1),[N,H]=c.useState(null),[D,I]=c.useState(null);async function q(){A(!0),H(null),I(null);const d=(t==null?void 0:t.siteGrade)??"A";try{const C=await S({type:"REGRADE_SITE_CRAWL"});if((C==null?void 0:C.ok)===!0)setTimeout(()=>{var O;const M=((O=f.getState().siteCrawlReport)==null?void 0:O.siteGrade)??d;I({prevGrade:d,nextGrade:M,at:Date.now()})},0);else{const M=(C==null?void 0:C.reason)??"Regrade failed.";H(M)}}catch(C){H(C instanceof Error?C.message:String(C))}finally{A(!1)}}if(c.useEffect(()=>{if(!D)return;const d=setTimeout(()=>I(null),6e3);return()=>clearTimeout(d)},[D]),g)return e.jsx("section",{"aria-label":"Audit in progress",style:{padding:"var(--v2-pad-5) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:i?e.jsx(ht,{}):e.jsx(xt,{})});if(m==="discovering"||m==="reviewing")return e.jsx("section",{"aria-label":"Choose pages to audit",style:{padding:"var(--v2-pad-5) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",maxWidth:640,margin:"0 auto"},children:m==="discovering"?e.jsx(mt,{}):e.jsx(ft,{onAudit:Q})});if(!t)return e.jsxs("section",{"aria-label":"No audit yet",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",maxWidth:640,margin:"0 auto"},children:[e.jsx("p",{className:"v2-eyebrow",style:{marginBottom:"var(--v2-pad-2)"},children:"new audit"}),e.jsx("h1",{className:"v2-display",style:{fontSize:28,fontWeight:500,letterSpacing:"-0.02em",color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:"Configure your crawl."}),s&&e.jsxs("div",{role:"alert",style:{marginBottom:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)",color:"var(--v2-critical)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600,marginRight:6},children:"Last crawl failed:"}),s]}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,marginBottom:"var(--v2-pad-5)",maxWidth:520},children:"The crawler follows internal links from the start URL, same-origin only. Each page runs your full audit pipeline (axe + DOM analyzers + AI walkthroughs). Findings appear below as a single unified list."}),e.jsx(xe,{initialUrl:b??"",isRunning:g,onCrawl:d=>W(d,!1),onAuditThisPage:v,reviewEnabled:E,onToggleReview:U}),e.jsx("div",{style:{marginTop:"var(--v2-pad-3)"},children:e.jsx(ue,{})}),e.jsx(be,{open:x.gateOpen,gaps:x.gaps,onRunFull:x.runFull,onQuickCheck:x.quickCheck,onCancel:x.cancel})]});const V=a.length,u=(t.totalWalkthroughFindings??0)+t.totalUniqueViolations+V,T=(t.walkthroughAcknowledgements??[]).length,L=t.totalNeedsReview;return e.jsxs("section",{"aria-label":"Audit summary",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"var(--v2-pad-6)"},children:[e.jsx(Ct,{grade:t.siteGrade}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0},children:y?"page grade · single-page audit":`site grade · ${t.pagesAudited} page${t.pagesAudited===1?"":"s"}`}),e.jsxs("p",{style:{margin:0,fontSize:11,lineHeight:1.4,color:"var(--v2-ink-tertiary)"},children:["Your ",e.jsx("strong",{children:"combined grade"})," — severity (your most serious finding) and breadth (how many of the 9 areas have issues) together, with a legal floor so a serious issue can't be averaged away. The Dev view shows the same letter."]})]})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",marginTop:"var(--v2-pad-5)"},children:[e.jsx("h1",{className:"v2-display",style:{fontSize:22,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0,lineHeight:1.25},children:(()=>{var B,M;if(((B=t.spotCheckGate)==null?void 0:B.status)==="pending"){const O=t.spotCheckGate;return`On track for A — answer ${O.unanswered.length} more content-meaning spot-check${O.unanswered.length===1?"":"s"} below to finalize your grade (${O.answered}/${O.total} done).`}const d=u+L,C=((M=t.blockingCriteria)==null?void 0:M.length)??0;return d===0&&C===0?"All clear — nothing open.":d===0&&C>0?`Visible findings clear — ${C} criteri${C===1?"on":"a"} still need${C===1?"s":""} your judgment.`:`${d} finding${d===1?"":"s"} to address.`})()}),e.jsx(Rt,{openCount:u,reviewCount:L,verifiedCount:T,axeCount:t.totalUniqueViolations,walkthroughCount:t.totalWalkthroughFindings??0,autoCount:V}),b&&!St(b,t.startUrl)&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:["Active tab: ",b]}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-2)",flexWrap:"wrap"},children:[y?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:v,title:"Re-audit the current page",children:"Re-audit this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>w(d=>!d),"aria-expanded":j,title:"Open crawl setup to audit the whole site instead",children:j?"Hide crawl options":"Crawl whole site"})]}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:q,disabled:z,title:"Re-aggregate this audit against your latest verdicts + acks. No re-crawl. Use this after marking criteria in the Coverage gaps panel.",children:z?"Regrading…":"Regrade"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>W({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!1),title:`Re-crawl ${t.startUrl} (same options) — full audit re-run, use when page code changed`,children:"Re-crawl"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:v,title:"Single-page audit of the active tab (no crawl)",children:"Just this page"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>W({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>w(d=>!d),"aria-expanded":j,children:j?"Hide options":"Adjust options"})]}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>void De(),title:"Wipe these results so you can start fresh",style:{marginLeft:"auto"},children:"Clear results"})]}),e.jsx("div",{style:{marginTop:"var(--v2-pad-2)"},children:e.jsx(ue,{})}),N&&e.jsx("p",{role:"alert",style:{margin:"var(--v2-pad-2) 0 0",fontSize:11,color:"var(--v2-critical)"},children:N}),D&&!N&&e.jsx("p",{role:"status",style:{margin:"var(--v2-pad-2) 0 0",fontSize:11,color:"var(--v2-verified)"},children:D.prevGrade===D.nextGrade?`Regraded — grade unchanged at ${D.nextGrade}. Any verdict changes you made were already in this report.`:`Regraded — grade ${D.prevGrade} → ${D.nextGrade}.`})]}),(p==null?void 0:p.receipt)&&e.jsx(bt,{sealed:p}),e.jsx(Le,{}),e.jsx(_e,{}),j&&e.jsxs("div",{style:{marginTop:"var(--v2-pad-5)",paddingTop:"var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)",maxWidth:640},children:[e.jsx(xe,{initialUrl:t.startUrl,isRunning:g,onCrawl:d=>W(d,!1),onVerifyFixes:d=>W(d,!0),onAuditThisPage:v,reviewEnabled:E,onToggleReview:U}),e.jsx(be,{open:x.gateOpen,gaps:x.gaps,onRunFull:x.runFull,onQuickCheck:x.quickCheck,onCancel:x.cancel})]})]})}function St(t,a){try{return new URL(t).origin===new URL(a).origin}catch{return!1}}function Ct({grade:t}){if(t==="pending")return e.jsx("div",{"aria-label":"Grade pending — spot-checks outstanding",role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:40,lineHeight:1.05,fontWeight:600,color:"var(--v2-ink-secondary, #94a3b8)",letterSpacing:"-0.02em",textAlign:"center"},children:"Pending"})});const a={A:"var(--v2-grade-a)",B:"var(--v2-grade-b)",C:"var(--v2-grade-c)",D:"var(--v2-grade-d)",F:"var(--v2-grade-f)"};return e.jsx("div",{"aria-label":`Grade ${t}`,role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:132,lineHeight:1,fontWeight:500,color:a[t],letterSpacing:"-0.04em",fontVariationSettings:'"opsz" 144'},children:t})})}function Rt({openCount:t,reviewCount:a,verifiedCount:r,axeCount:o,walkthroughCount:s,autoCount:l}){return e.jsxs("dl",{style:{display:"flex",gap:"var(--v2-pad-4)",flexWrap:"wrap",margin:0,color:"var(--v2-ink-secondary)",fontSize:12},children:[e.jsx(K,{term:"open",value:t,tone:t>0?"attention":"neutral"}),e.jsx(K,{term:"review",value:a,tone:a>0?"review":"neutral"}),e.jsx(K,{term:"verified",value:r,tone:r>0?"positive":"neutral"}),e.jsx("span",{style:{color:"var(--v2-ink-faint)"},children:"·"}),e.jsx(K,{term:"axe",value:o,tone:"neutral"}),e.jsx(K,{term:"walkthrough",value:s,tone:"neutral"}),l>0&&e.jsx(K,{term:"auto-contrast",value:l,tone:"neutral"})]})}function K({term:t,value:a,tone:r}){const o={attention:"var(--v2-critical)",review:"var(--v2-needs-review)",positive:"var(--v2-verified)",neutral:"var(--v2-ink-secondary)"};return e.jsxs("div",{style:{display:"inline-flex",alignItems:"baseline",gap:6},children:[e.jsx("dt",{className:"v2-eyebrow",style:{display:"inline",margin:0,color:"var(--v2-ink-tertiary)"},children:t}),e.jsx("dd",{className:"v2-mono",style:{margin:0,fontWeight:600,fontSize:13,color:o[r],fontVariantNumeric:"tabular-nums"},children:a})]})}const Tt=new Set(["2.4.3","2.1.2","2.4.7","1.3.2","1.4.11","2.5.3"]);function ke(t){return Tt.has(t)}async function we(t){var o,s;const a=f.getState();if(a.componentId&&((o=a.results[0])==null?void 0:o.pageUrl)===t)return a.componentId;const r=await Ce();return((s=r==null?void 0:r.find(l=>l.url===t))==null?void 0:s.componentId)??null}async function Et(t,a){var n;const r=f.getState(),o=[],s=new Set,l=(g,y)=>{const h=`${g}::${y}`;s.has(h)||(s.add(h),o.push({componentId:g,matchKey:y}))};if(r.componentId&&r.results.length>0){const g=(n=r.results[0])==null?void 0:n.pageUrl,y=a.find(h=>h.url===g);if(y)for(const h of r.results)for(const p of h.violations)p.ruleId===t&&p.target.selector===y.selector&&l(r.componentId,p.matchKey)}const i=await Ce()??[];for(const g of a){const y=i.find(h=>h.url===g.url);if(y)for(const h of y.results)for(const p of h.violations)p.ruleId===t&&p.target.selector===g.selector&&l(y.componentId,p.matchKey)}return o}function At({row:t}){return e.jsxs("details",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,overflow:"hidden"},children:[e.jsxs("summary",{style:{cursor:"pointer",padding:"var(--v2-pad-3) var(--v2-pad-4)",listStyle:"none",display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-3)"},children:[e.jsx(Nt,{row:t}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(It,{row:t}),e.jsx(Ut,{row:t})]}),e.jsx(zt,{})]}),e.jsx("div",{style:{padding:"0 var(--v2-pad-4) var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)"},children:e.jsx(Pt,{row:t})})]})}function Nt({row:t}){if(t.kind==="walkthrough-ack")return e.jsx("span",{className:"v2-chip v2-chip-verified","aria-label":"Status: human verified",children:"verified"});if(t.kind==="needs-review")return e.jsx("span",{className:"v2-chip v2-chip-review","aria-label":"Status: needs human review",children:"review"});if(t.kind==="auto-contrast")return e.jsx("span",{className:"v2-chip v2-chip-serious","aria-label":"Severity: serious, auto-resolved by pixel sampler",title:"Empirical pixel-contrast measurement, not an axe-confirmed violation. Human verification recommended.",children:"auto · serious"});if(t.kind==="walkthrough-fail")return e.jsx("span",{className:t.verdict==="fail"?"v2-chip v2-chip-serious":"v2-chip v2-chip-moderate","aria-label":`Severity: ${t.verdict}`,children:t.verdict});const a={critical:"v2-chip-critical",serious:"v2-chip-serious",moderate:"v2-chip-moderate",minor:"v2-chip-minor"};return e.jsx("span",{className:`v2-chip ${a[t.impact]}`,"aria-label":`Severity: ${t.impact}`,children:t.impact})}function It({row:t}){const a=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="needs-review"||t.kind==="axe"||t.kind==="auto-contrast"?t.criterion:null,r=t.kind==="walkthrough-fail"?t.verdict==="uncertain"?"AI could not decide this criterion — needs your manual verification.":"AI walkthrough fail on this criterion.":t.kind==="walkthrough-ack"?"Human-verified by an auditor.":t.kind==="needs-review"?t.description:t.kind==="auto-contrast"?"Empirical contrast measurement fell below threshold.":t.description;return e.jsxs("p",{style:{margin:0,marginBottom:4,color:"var(--v2-ink-primary)",fontSize:13,fontWeight:500,lineHeight:1.4},children:[a&&e.jsxs("span",{className:"v2-mono",style:{fontSize:11,fontWeight:600,color:"var(--v2-ink-tertiary)",marginRight:8},children:["WCAG ",a]}),r]})}function Ut({row:t}){const a=t.kind==="axe"||t.kind==="needs-review"?t.pages.length:1,r=t.kind==="axe"||t.kind==="needs-review"||t.kind==="auto-contrast"?t.selector:null,o=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="auto-contrast"?t.pageUrl:null;return e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[r&&e.jsx("code",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",background:"var(--v2-bg-elev-2)",padding:"2px 6px",borderRadius:2,wordBreak:"break-all"},children:r}),o&&e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:o}),a>1&&e.jsxs("span",{className:"v2-eyebrow",style:{marginLeft:"auto"},children:["on ",a," pages"]})]})}function zt(){return e.jsx("span",{"aria-hidden":"true",style:{color:"var(--v2-ink-tertiary)",fontFamily:"var(--v2-mono)",fontSize:12,marginLeft:8,marginTop:2},children:"⏵"})}function Pt({row:t}){return t.kind==="walkthrough-fail"?e.jsx(Lt,{row:t}):t.kind==="walkthrough-ack"?e.jsx(_t,{row:t}):t.kind==="needs-review"?e.jsx(Wt,{row:t}):t.kind==="auto-contrast"?e.jsx(Dt,{row:t}):e.jsx(Gt,{row:t})}function Dt({row:t}){const[a,r]=c.useState(!1),[o,s]=c.useState(!1),[l,i]=c.useState(""),[n,g]=c.useState(!1),[y,h]=c.useState(!1),[p,b]=c.useState(null),k=Re(t.ruleId);async function j(){if(g(!0),b(null),!l.trim()){b("Note is required — explain why the empirical contrast measurement is wrong, or why this element is acceptable in context."),g(!1);return}try{const m=(await ct(t.pageUrl)).find(P=>P.ruleId===t.ruleId&&P.selector===t.selector),E={pageUrl:t.pageUrl,ruleId:t.ruleId,selector:t.selector,verdict:"pass",reasoning:`Human override: ${l.trim()}
|
|
3
|
+
|
|
4
|
+
(Original empirical reasoning: ${t.reasoning})`,resolvedAt:new Date().toISOString(),costUsd:0,wcagCriterion:t.criterion,inputHash:m==null?void 0:m.inputHash};await dt(E),h(!0),r(!1)}catch(w){b(w instanceof Error?w.message:String(w))}finally{g(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(te,{label:"Empirical measurement",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.reasoning})}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-3)",fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5,fontStyle:"italic"},children:"This finding came from a pixel-level screenshot diff of text against the rendered background, not from axe-core. Treat as a strong hint for human review, not a confirmed violation — gradients, translucent overlays, and animated backdrops can fool the sampler."}),y?e.jsx(ce,{}):e.jsxs(e.Fragment,{children:[e.jsxs(de,{children:[k&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>s(w=>!w),"aria-expanded":o,children:o?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>r(w=>!w),"aria-expanded":a,children:a?"Cancel":"Mark verified manually"})]}),o&&k&&e.jsx(Ee,{summary:k.summary,snippet:k.snippet}),a&&e.jsx(le,{note:l,setNote:i,busy:n,err:p,onConfirm:j,hint:"Why the empirical measurement is wrong, or why this is acceptable. Overrides the resolution to pass.",placeholder:"e.g., Text sits over a video poster image; static screenshot misreads the rendered background. Production poster passes 7:1."}),p&&!a&&e.jsx(ae,{message:p})]})]})}function Lt({row:t}){const[a,r]=c.useState(!1),[o,s]=c.useState(""),[l,i]=c.useState(!1),[n,g]=c.useState(!1),[y,h]=c.useState(!1),[p,b]=c.useState(null),[k,j]=c.useState(null),w=ke(t.criterion),m=Ge();async function E(){if(i(!0),j(null),!o.trim()){j("Note is required — explain how you manually verified this."),i(!1);return}try{const x=await we(t.pageUrl);if(!x){j("Could not find this page in the audit data. Re-run the audit and try again.");return}await lt({componentId:x,criterionId:t.criterion,pageUrl:t.pageUrl,note:o.trim(),acknowledgedAt:new Date().toISOString(),verdictAtAck:t.verdict}),g(!0),r(!1)}catch(x){j(x instanceof Error?x.message:String(x))}finally{i(!1)}}async function P(){var x;h(!0),b(null),j(null);try{const $=(x=(await chrome.tabs.query({active:!0,currentWindow:!0}))[0])==null?void 0:x.id;if(!$){j("Open the audited page in your active tab to re-run.");return}const U=await we(t.pageUrl);if(!U){j("Could not find this page in the audit data.");return}if(!ke(t.criterion)){j(`Re-run is only available for interactive criteria. ${t.criterion} is not supported.`);return}const R=await S({type:"INTERACTIVE_AUDIT_REQUEST",criterionId:t.criterion,tabId:$,componentId:U,pageUrl:t.pageUrl});if(!R.ok){j(R.error??"Re-run failed.");return}b(`Re-run verdict: ${R.verdict??"unknown"}. Re-audit the page to refresh this list.`)}catch(F){j(F instanceof Error?F.message:String(F))}finally{h(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(te,{label:"AI reasoning",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),n?e.jsx(ce,{}):e.jsxs(e.Fragment,{children:[e.jsxs(de,{children:[w&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:P,disabled:y||!m,title:m?void 0:"AI walkthroughs need an Anthropic API key. Add one in Settings → AI.",children:y?"Re-running…":"Re-run walkthrough"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>r(x=>!x),"aria-expanded":a,children:a?"Cancel":"Mark verified manually"})]}),p&&e.jsx("p",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:11,lineHeight:1.5},children:p}),a&&e.jsx(le,{note:o,setNote:s,busy:l,err:k,onConfirm:E,hint:"Explain what you checked. This goes into the forensic record.",placeholder:"e.g., Verified — focus indicator visible on every interactive control under :focus-visible; tested with keyboard nav."}),k&&!a&&e.jsx(ae,{message:k})]})]})}function _t({row:t}){return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(te,{label:"What the human verified",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),e.jsxs("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)"},children:["Original AI verdict: ",e.jsx("strong",{children:t.verdict}),". Now treated as pass for conformance."]})]})}function Wt({row:t}){return e.jsx(Te,{row:t,kind:"needs-review"})}function Gt({row:t}){return e.jsx(Te,{row:t,kind:"axe"})}function Te({row:t,kind:a}){const[r,o]=c.useState(!1),[s,l]=c.useState(""),[i,n]=c.useState(!1),[g,y]=c.useState(!1),[h,p]=c.useState(!1),[b,k]=c.useState(null),j=Re(t.ruleId);async function w(){if(n(!0),k(null),!s.trim()){k(a==="needs-review"?"Note is required — explain your review judgment.":"Note is required — explain why this isn't actually an issue in your context."),n(!1);return}try{const m=await Et(t.ruleId,t.pages);if(m.length===0){k("Could not find this finding in the persisted audit data. Re-run the audit and try again.");return}for(const E of m)await ut({componentId:E.componentId,matchKey:E.matchKey,ruleId:t.ruleId,note:s.trim()});y(!0),o(!1)}catch(m){k(m instanceof Error?m.message:String(m))}finally{n(!1)}}return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[a==="needs-review"&&t.failureSummary&&e.jsx(te,{label:"AI assessment",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.failureSummary})}),e.jsx(te,{label:"Affected",children:e.jsxs("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:[t.pages.slice(0,8).map(m=>e.jsx("li",{children:e.jsx("a",{href:m.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:m.url})},m.url)),t.pages.length>8&&e.jsxs("li",{className:"v2-eyebrow",children:["+ ",t.pages.length-8," more"]})]})}),g?e.jsx(ce,{}):e.jsxs(e.Fragment,{children:[e.jsxs(de,{children:[a==="axe"&&j&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>p(m=>!m),"aria-expanded":h,children:h?"Hide fix recipe":"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>o(m=>!m),"aria-expanded":r,children:r?"Cancel":"Mark verified manually"})]}),h&&j&&e.jsx(Ee,{summary:j.summary,snippet:j.snippet}),r&&e.jsx(le,{note:s,setNote:l,busy:i,err:b,onConfirm:w,hint:a==="needs-review"?"Your review judgment. Goes into the forensic record.":"Why this isn't actually an issue in your context. Goes into the forensic record.",placeholder:a==="needs-review"?"e.g., Verified — image is a portrait of the named founder; alt text correctly identifies subject and role.":'e.g., This element is decorative; aria-hidden + role="presentation" applied via design system.',confirmLabel:`Confirm — acknowledge on ${t.pages.length} page${t.pages.length===1?"":"s"}`}),b&&!r&&e.jsx(ae,{message:b})]})]})}function le({note:t,setNote:a,busy:r,err:o,onConfirm:s,hint:l,placeholder:i,confirmLabel:n="Confirm acknowledgement"}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-border-strong)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:"verification note · required"}),e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-2)",fontSize:11,color:"var(--v2-ink-tertiary)"},children:l}),e.jsx("textarea",{value:t,onChange:g=>a(g.target.value),placeholder:i,rows:3,style:{width:"100%",fontFamily:"var(--v2-body)",fontSize:12,lineHeight:1.5,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,resize:"vertical",minHeight:70},autoFocus:!0}),o&&e.jsx(ae,{message:o}),e.jsx("div",{style:{marginTop:"var(--v2-pad-2)"},children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:s,disabled:r||!t.trim(),children:r?"Saving…":n})})]})}function Ee({summary:t,snippet:a}){return e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-verified)",borderRadius:4,background:"rgba(15, 143, 94, 0.06)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6,color:"var(--v2-verified)"},children:"how to fix"}),e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t}),a&&e.jsx("pre",{className:"v2-mono",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"var(--v2-bg)",border:"1px solid var(--v2-border)",borderRadius:3,fontSize:11,color:"var(--v2-ink-primary)",overflowX:"auto",whiteSpace:"pre"},children:e.jsx("code",{children:a})})]})}function ce(){return e.jsxs("div",{role:"status",style:{marginTop:"var(--v2-pad-2)",padding:"var(--v2-pad-2) var(--v2-pad-3)",background:"rgba(15, 143, 94, 0.08)",border:"1px solid var(--v2-verified)",borderRadius:4,color:"var(--v2-verified)",fontSize:12,lineHeight:1.5},children:[e.jsx("strong",{style:{fontWeight:600},children:"✓ Acknowledged."})," ","The ack is saved. Re-audit or re-crawl to see this finding drop out of the list."]})}function ae({message:t}){return e.jsx("p",{role:"alert",style:{marginTop:"var(--v2-pad-2)",marginBottom:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",background:"rgba(207, 44, 44, 0.06)",borderRadius:4,color:"var(--v2-critical)",fontSize:11,lineHeight:1.4},children:t})}function te({label:t,children:a}){return e.jsxs("div",{style:{marginBottom:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:t}),a]})}function de({children:t}){return e.jsx("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:t})}function Ft(){const{report:t,resolvedFails:a}=oe(),[r,o]=c.useState("open"),s=c.useMemo(()=>t?$t(t.pages,t.findingGroups??[],a):[],[t,a]),l=c.useMemo(()=>r==="all"?s:s.filter(n=>r==="verified"?n.kind==="walkthrough-ack":r==="review"?n.kind==="needs-review"||n.kind==="walkthrough-fail"&&n.verdict==="uncertain":r==="open"?n.kind==="axe"||n.kind==="walkthrough-fail"&&n.verdict==="fail"||n.kind==="auto-contrast":!0),[s,r]);if(!t)return null;const i={all:s.length,open:s.filter(n=>n.kind==="axe"||n.kind==="walkthrough-fail"&&n.verdict==="fail"||n.kind==="auto-contrast").length,review:s.filter(n=>n.kind==="needs-review"||n.kind==="walkthrough-fail"&&n.verdict==="uncertain").length,verified:s.filter(n=>n.kind==="walkthrough-ack").length};return e.jsxs("section",{"aria-labelledby":"findings-heading",style:{padding:"var(--v2-pad-5) var(--v2-pad-5) var(--v2-pad-7)"},children:[e.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)",marginBottom:"var(--v2-pad-4)",flexWrap:"wrap"},children:[e.jsx("h2",{id:"findings-heading",className:"v2-display",style:{fontSize:20,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0},children:"Findings"}),e.jsx(Mt,{filter:r,setFilter:o,counts:i})]}),l.length===0?e.jsx(Ot,{filter:r}):e.jsx("ul",{"aria-label":`${r} findings, ${l.length} items`,style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:l.map((n,g)=>e.jsx("li",{style:{animation:`v2-row-in 240ms ease ${Math.min(g,12)*30}ms both`},children:e.jsx(At,{row:n})},n.key))})]})}function Mt({filter:t,setFilter:a,counts:r}){const o=[{id:"open",label:"Open"},{id:"review",label:"Review"},{id:"verified",label:"Verified"},{id:"all",label:"All"}];return e.jsx("div",{role:"tablist","aria-label":"Filter findings",style:{display:"inline-flex",gap:4,background:"var(--v2-bg-elev)",padding:3,borderRadius:6,border:"1px solid var(--v2-border)"},children:o.map(s=>{const l=t===s.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":l,onClick:()=>a(s.id),style:{fontFamily:"var(--v2-body)",fontSize:11,padding:"5px 10px",borderRadius:4,border:"none",cursor:"pointer",background:l?"var(--v2-bg-elev-2)":"transparent",color:l?"var(--v2-ink-primary)":"var(--v2-ink-secondary)",fontWeight:l?600:500,transition:"background 120ms ease, color 120ms ease",display:"inline-flex",alignItems:"baseline",gap:5},children:[s.label,e.jsx("span",{className:"v2-mono",style:{fontSize:10,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:r[s.id]})]},s.id)})})}function Ot({filter:t}){const r={open:{headline:"Nothing open.",sub:"No axe violations or AI walkthrough failures across the audited pages. Switch to All to see everything, or to Verified for a record of acknowledged items."},review:{headline:"No items awaiting review.",sub:"AI walkthroughs returned definitive verdicts (or human verifications) for every criterion that needed judgment."},verified:{headline:"No human verifications recorded.",sub:"When you mark a walkthrough finding as manually verified, it appears here with your note + timestamp."},all:{headline:"Nothing to show.",sub:"No audit data yet — run a scan to begin."}}[t];return e.jsxs("div",{role:"status","aria-live":"polite",style:{padding:"var(--v2-pad-6) var(--v2-pad-4)",textAlign:"center",border:"1px dashed var(--v2-border)",borderRadius:6},children:[e.jsx("p",{className:"v2-display",style:{fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:r.headline}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,maxWidth:440,marginInline:"auto"},children:r.sub})]})}function $t(t,a,r=[]){const o=[];for(const i of a)i.needsReview?o.push({kind:"needs-review",key:`nr::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,description:i.axeDescription,selector:i.representativeSelector,failureSummary:i.failureSummary,pages:i.pages,group:i}):o.push({kind:"axe",key:`axe::${i.ruleId}::${i.representativeSelector}`,criterion:i.wcagCriterion,ruleId:i.ruleId,impact:i.impact,description:i.axeDescription,selector:i.representativeSelector,pages:i.pages,isShared:i.isShared});const s=new Set;for(const i of t){for(const n of i.walkthroughFindings??[]){const g=`wt-fail::${n.criterionId}::${n.pageUrl}`;s.has(g)||(s.add(g),o.push({kind:"walkthrough-fail",key:g,criterion:n.criterionId,verdict:n.verdict,impact:n.impact,reasoning:n.reasoning,pageUrl:n.pageUrl}))}for(const n of i.walkthroughAcknowledgements??[]){const g=`wt-ack::${n.criterionId}::${n.pageUrl}`;s.has(g)||(s.add(g),o.push({kind:"walkthrough-ack",key:g,criterion:n.criterionId,verdict:n.verdict,reasoning:n.reasoning,pageUrl:n.pageUrl}))}}for(const i of r)o.push({kind:"auto-contrast",key:`auto::${i.ruleId}::${i.selector}::${i.pageUrl}`,criterion:i.wcagCriterion??"1.4.3",ruleId:i.ruleId,impact:"serious",selector:i.selector,pageUrl:i.pageUrl,reasoning:i.reasoning});const l={critical:0,serious:1,moderate:2,minor:3,"needs-review":4,ack:5};return o.sort((i,n)=>{const g=i.kind==="walkthrough-ack"?l.ack:i.kind==="needs-review"?l["needs-review"]:l[i.impact],y=n.kind==="walkthrough-ack"?l.ack:n.kind==="needs-review"?l["needs-review"]:l[n.impact];return(g??99)-(y??99)}),o}function Ht({open:t,onClose:a}){const{report:r}=oe(),o=f(v=>v.siteCrawlReport),s=f(v=>v.results),l=f(v=>v.componentId),i=f(v=>v.delta),n=!!o,g=n||s.length>0,y=f(v=>v.tier),h=v=>!Me(y,v),[p,b]=c.useState(!1),k=()=>b(!0),j=n?"ai-prompt-site-crawl":"ai-prompt",w=Fe({storeComponentId:l,storeCrawlReport:o,pageUrls:(r==null?void 0:r.pages.map(v=>v.url))??[]}),[m,E]=c.useState({}),P=c.useRef(null);c.useEffect(()=>{var z;if(!t)return;const v=A=>{A.key==="Escape"&&a()};return document.addEventListener("keydown",v),(z=P.current)==null||z.focus(),()=>document.removeEventListener("keydown",v)},[t,a]);function x(v,z){E(A=>({...A,[v]:z}))}async function F(){x("ai-prompt",{state:"busy"});try{if(n){const v=await S({type:"EXPORT_REQUEST",format:"ai-prompt-site-crawl",results:[],...r?{siteCrawlReport:r}:{}});if(!(v!=null&&v.content))throw new Error("Empty response");await navigator.clipboard.writeText(v.content),Ne(v.content,"ai-fixer-prompt.md","text/markdown"),x("ai-prompt",{state:"done",message:"Copied to clipboard + saved ai-fixer-prompt.md to Downloads."})}else{if(!s.length)throw new Error("No audit results yet");await gt({results:s,componentId:l??null,delta:i}),x("ai-prompt",{state:"done",message:"Copied to clipboard + opened in a new tab."})}}catch(v){x("ai-prompt",{state:"error",message:v instanceof Error?v.message:String(v)})}}async function $(){x("html",{state:"busy"});try{if(n&&r){const{renderSiteReportHtml:v}=await re(async()=>{const{renderSiteReportHtml:N}=await import("./site-report-renderer-DelUUXsi.js");return{renderSiteReportHtml:N}},__vite__mapDeps([0,1,2,3,4,5])),z=await pe([r.startUrl]).catch(()=>[]),A=v(r,void 0,z);await se(A,"site-report.html","text/html"),x("html",{state:"done",message:"Opened in a new tab — Save as PDF or use Cmd/Ctrl+S."})}else{if(!s.length)throw new Error("No audit results yet");const{toHtmlPrint:v}=await re(async()=>{const{toHtmlPrint:A}=await import("./scheduled-audit-runner-BJXKsQZK.js").then(N=>N.ba);return{toHtmlPrint:A}},__vite__mapDeps([1,2,3,4,5])),z=v(s,i??void 0);await se(z,"page-report.html","text/html"),x("html",{state:"done",message:"Opened in a new tab — Save as PDF or use Cmd/Ctrl+S."})}}catch(v){x("html",{state:"error",message:v instanceof Error?v.message:String(v)})}}async function U(v,z,A){x(v,{state:"busy"});try{const N=await S({type:"EXPORT_REQUEST",format:v,results:n?[]:s,...i&&!n?{delta:i}:{},...n?{siteCrawlSource:!0}:{},...w?{auditTargetId:w}:{}});if(!(N!=null&&N.content))throw new Error("Empty response");await se(N.content,A,"text/html"),x(v,{state:"done",message:`${z} opened in a new tab.`})}catch(N){x(v,{state:"error",message:N instanceof Error?N.message:String(N)})}}async function W(){const{createZip:v}=await re(async()=>{const{createZip:I}=await import("./zip-encoder-CtULHXx_.js");return{createZip:I}},[]),{renderSiteReportHtml:z}=await re(async()=>{const{renderSiteReportHtml:I}=await import("./site-report-renderer-DelUUXsi.js");return{renderSiteReportHtml:I}},__vite__mapDeps([0,1,2,3,4,5])),A=[],N=n?[{format:"ai-prompt-site-crawl",filename:"ai-fixer-prompt.md"},{format:"defense-bundle",filename:"defense-bundle.html"},{format:"deposition-packet",filename:"deposition-packet.html"},{format:"evidence-bundle",filename:"evidence-bundle.html"},{format:"vpat",filename:"vpat.html"},{format:"conformance-crosswalk",filename:"conformance-crosswalk.html"},{format:"methodology-doc",filename:"methodology-doc.html"},{format:"executive-report",filename:"executive-report.html"}]:[{format:"ai-prompt",filename:"ai-fixer-prompt.md"},{format:"html-print",filename:"page-report.html"}],H=N.length+(n&&r?1:0);let D=0;x("zip",{state:"busy",progress:{current:0,total:H,label:"Starting…"}});try{if(n&&r){D++,x("zip",{state:"busy",progress:{current:D,total:H,label:"site-report.html (client-side)"}});try{const T=await pe([r.startUrl]).catch(()=>[]);A.push({name:"site-report.html",content:z(r,void 0,T)})}catch{}}for(const{format:T,filename:L}of N){D++,x("zip",{state:"busy",progress:{current:D,total:H,label:L}});try{const d=await S({type:"EXPORT_REQUEST",format:T,results:n?[]:s,...i&&!n?{delta:i}:{},...n?{siteCrawlSource:!0}:{},...w?{auditTargetId:w}:{}});d!=null&&d.content&&A.push({name:L,content:d.content})}catch{}}if(A.length===0)throw new Error("All exports failed");const I=v(A),q=new Blob([I],{type:"application/zip"}),V=URL.createObjectURL(q),u=document.createElement("a");u.href=V,u.download=n?"wcagcheckr-site-bundle.zip":"wcagcheckr-page-bundle.zip",u.click(),setTimeout(()=>URL.revokeObjectURL(V),6e4),x("zip",{state:"done",message:`Downloaded ${A.length} file${A.length===1?"":"s"}.`})}catch(I){x("zip",{state:"error",message:I instanceof Error?I.message:String(I)})}}function R(v){f.getState().setView(v),f.getState().setUserMode("dev"),S({type:"SETTINGS_SET",key:"userMode",value:"dev"}),a()}function Q(){S({type:"OPEN_SETTINGS"})}return t?e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Tools and exports",style:{position:"fixed",inset:0,zIndex:50,display:"flex"},children:[e.jsx("div",{onClick:a,style:{position:"absolute",inset:0,background:"rgba(26, 20, 16, 0.35)",backdropFilter:"blur(2px)"},"aria-hidden":"true"}),e.jsxs("div",{style:{position:"relative",marginLeft:"auto",width:"min(100%, 440px)",height:"100%",background:"var(--v2-bg)",borderLeft:"1px solid var(--v2-border-strong)",boxShadow:"-12px 0 28px rgba(26, 20, 16, 0.18)",overflowY:"auto",display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{position:"sticky",top:0,background:"var(--v2-bg)",borderBottom:"1px solid var(--v2-border)",padding:"var(--v2-pad-4) var(--v2-pad-5)",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:1},children:[e.jsx("h2",{className:"v2-display",style:{margin:0,fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)"},children:"Tools"}),e.jsx("button",{ref:P,type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:a,"aria-label":"Close tools drawer",children:"Close"})]}),e.jsxs("div",{style:{padding:"var(--v2-pad-5)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-5)"},children:[!g&&e.jsx("p",{style:{margin:0,padding:"var(--v2-pad-3) var(--v2-pad-4)",background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:4,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.5},children:"Most tools need an audit to act on. Run an audit first, then come back here."}),g&&e.jsxs(e.Fragment,{children:[e.jsx(Y,{title:"AI fixer",children:e.jsx(G,{status:m["ai-prompt"],label:n?"Copy site-wide AI fix prompt":"Copy AI fix prompt",description:n?"Multi-page markdown for ChatGPT/Claude/Copilot. Site-wide summary, consistency findings, per-page violations + fix recipes.":"Markdown for ChatGPT/Claude/Copilot. Every violation with fix recipes, AI-resolved fails, acknowledged context.",onClick:F,locked:h(j),onUpgrade:k})}),e.jsxs(Y,{title:"Reports",children:[e.jsx(G,{status:m.html,label:n?"Site report (HTML)":"Page report (HTML)",description:n?"Full crawl summary with per-page grades, top violations, consistency findings. Print-ready.":"Print-friendly single-page report.",onClick:$}),e.jsx(G,{status:m["executive-report"],label:"Executive report",description:"Hero grade + framing, top risks, next steps. For non-technical readers.",onClick:()=>U("executive-report","Executive report","executive-report.html"),locked:h("executive-report"),onUpgrade:k}),n&&e.jsx(G,{status:m["ticket-bundle"],label:"Ticket bundle",description:"Markdown formatted for paste into Linear / Jira / GitHub Issues — one ticket per finding, sorted by severity.",onClick:()=>U("ticket-bundle","Ticket bundle","ticket-bundle.md")})]}),e.jsxs(Y,{title:"Compliance & legal",children:[e.jsx(G,{status:m["defense-bundle"],label:"Defense bundle",description:"Anchored chain-of-custody evidence package. Use in pre-litigation.",onClick:()=>U("defense-bundle","Defense bundle","defense-bundle.html"),locked:h("defense-bundle"),onUpgrade:k}),e.jsx(G,{status:m["deposition-packet"],label:"Deposition packet",description:"Full evidence bundle — anchor, receipts, fingerprints, signing cert.",onClick:()=>U("deposition-packet","Deposition packet","deposition-packet.html"),locked:h("deposition-packet"),onUpgrade:k}),e.jsx(G,{status:m.vpat,label:"VPAT",description:"Voluntary Product Accessibility Template. Procurement-ready.",onClick:()=>U("vpat","VPAT","vpat.html"),locked:h("vpat"),onUpgrade:k}),e.jsx(G,{status:m["conformance-crosswalk"],label:"Conformance crosswalk",description:"WCAG ↔ Section 508 ↔ EN 301 549 mapping.",onClick:()=>U("conformance-crosswalk","Conformance crosswalk","conformance-crosswalk.html"),locked:h("conformance-crosswalk"),onUpgrade:k}),e.jsx(G,{status:m["methodology-doc"],label:"Methodology PDF",description:"Auditor-explainable methodology — what was tested, how, with what tools.",onClick:()=>U("methodology-doc","Methodology doc","methodology-doc.html"),locked:h("methodology-doc"),onUpgrade:k}),e.jsx(G,{status:m["evidence-bundle"],label:"Evidence bundle",description:"Lighter than defense bundle — audit records + summary.",onClick:()=>U("evidence-bundle","Evidence bundle","evidence-bundle.html"),locked:h("evidence-bundle"),onUpgrade:k})]}),e.jsx(Y,{title:"Bulk",children:e.jsx(G,{status:m.zip,label:n?"Download all as ZIP":"Download both as ZIP",description:n?"Every format above bundled in one ZIP. Runs each export in sequence.":"AI fix prompt + page report in one ZIP.",onClick:W,locked:h(n?"defense-bundle":"ai-prompt"),onUpgrade:k})})]}),e.jsxs(Y,{title:"Specialized views (classic UI)",children:[e.jsx("p",{style:{margin:0,marginBottom:"var(--v2-pad-2)",fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5},children:`These surfaces aren't ported to v2 yet — clicking opens them in the classic UI. Return to v2 anytime via the "Try v2 UI" button in the classic Header.`}),e.jsx(_,{label:"State matrix",description:"Per-state findings grid (hover · focus · dark · RTL · etc.)",onClick:()=>R("matrix")}),e.jsx(_,{label:"Per-area compliance",description:"9 sub-grade areas with drill-in: Color & contrast, Keyboard, etc.",onClick:()=>R("report")}),e.jsx(_,{label:"Baseline delta",description:"New vs. persistent vs. fixed vs. acknowledged since the last baseline.",onClick:()=>R("delta")}),e.jsx(_,{label:"Forensic log",description:"Anchored audit history with chain-of-custody.",onClick:()=>R("forensic")}),e.jsx(_,{label:"Risk dashboard",description:"Lawsuit / conformance risk tiers with prioritized actions.",onClick:()=>R("risk")}),e.jsx(_,{label:"WCAG 3 mapping",description:"Outcome-level grouping per WCAG 3 snapshot.",onClick:()=>R("wcag3")}),e.jsx(_,{label:"WCAG-EM verdicts",description:"Formal per-criterion verdict map.",onClick:()=>R("compliance")}),e.jsx(_,{label:"Schedules",description:"Recurring audit management with email alerts.",onClick:()=>R("schedules")}),e.jsx(_,{label:"Copilot chat",description:"Anthropic-powered Q&A over your audit context.",onClick:()=>R("copilot")}),e.jsx(_,{label:"Accessibility tree",description:"Inspect the live aria tree as assistive tech sees it.",onClick:()=>R("ax-tree")}),e.jsx(_,{label:"Design tokens",description:"CSS-token / design-system audit.",onClick:()=>R("tokens")}),e.jsx(_,{label:"Guided audit",description:"13 manual IGT workflows (keyboard, screen reader, etc.).",onClick:()=>R("guided")}),e.jsx(_,{label:"Per-component scorecard",description:"Custom rules, baselines, per-component drill-in.",onClick:()=>R("scorecard")}),e.jsx(_,{label:"User journey flows",description:"Multi-step audit recordings.",onClick:()=>R("flows")}),e.jsx(_,{label:"Activity / IGT runs",description:"Manual workflow run history.",onClick:()=>R("activity")})]}),e.jsx(Y,{title:"Settings",children:e.jsx(G,{status:void 0,label:"Open settings",description:"Matrix preset, AI config, axe rule overrides, breakpoints, auto-export.",onClick:Q})})]})]}),e.jsx(Se,{open:p,onClose:()=>b(!1)})]}):null}async function se(t,a,r){const{body:o,type:s}=Ie(t,r),l=new Blob([o],{type:s}),i=URL.createObjectURL(l);try{await chrome.tabs.create({url:i})}catch{const n=document.createElement("a");n.href=i,n.download=a,n.click()}setTimeout(()=>URL.revokeObjectURL(i),6e4)}function Y({title:t,children:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:"var(--v2-pad-2)",color:"var(--v2-ink-tertiary)"},children:t}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:a})]})}function G({label:t,description:a,status:r,onClick:o,locked:s=!1,onUpgrade:l}){const i=(r==null?void 0:r.state)==="busy",n=(r==null?void 0:r.state)==="done",g=(r==null?void 0:r.state)==="error";return s?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-warning, #f59e0b)",borderRadius:4,background:"var(--v2-warning-bg, rgba(245,158,11,0.08))"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:500,color:"var(--v2-ink-primary)"},children:["🔒 ",t]}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-sm",onClick:l,children:"Upgrade"})]}),e.jsxs("p",{style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5},children:[e.jsx("strong",{children:"Upgrade to unlock"}),a?` · ${a}`:""]})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-border)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("span",{style:{fontSize:13,fontWeight:500,color:"var(--v2-ink-primary)"},children:t}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:o,disabled:i,children:i?"Working…":n?"Run again":"Run"})]}),a&&e.jsx("p",{style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5},children:a}),i&&(r==null?void 0:r.progress)&&e.jsxs("p",{role:"status","aria-live":"polite",style:{margin:0,marginTop:4,fontSize:11,color:"var(--v2-ink-secondary)"},children:[r.progress.current,"/",r.progress.total," — ",r.progress.label??""]}),n&&(r==null?void 0:r.message)&&e.jsxs("p",{role:"status",style:{margin:0,marginTop:4,fontSize:11,color:"var(--v2-verified)"},children:["✓ ",r.message]}),g&&(r==null?void 0:r.message)&&e.jsx("p",{role:"alert",style:{margin:0,marginTop:4,fontSize:11,color:"var(--v2-critical)"},children:r.message})]})}function _({label:t,description:a,onClick:r}){return e.jsxs("button",{type:"button",onClick:r,style:{appearance:"none",cursor:"pointer",display:"flex",flexDirection:"column",gap:4,padding:"var(--v2-pad-3) var(--v2-pad-4)",border:"1px solid var(--v2-border)",borderRadius:4,background:"var(--v2-bg)",textAlign:"left",font:"inherit",color:"var(--v2-ink-primary)",width:"100%"},children:[e.jsxs("span",{style:{fontSize:13,fontWeight:500},children:[t," →"]}),e.jsx("span",{style:{fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.5},children:a})]})}const je="https://wcagcheckr.com/tutorials/";function Bt(){var l,i;const t=f(n=>n.siteCrawlReport),a=f(n=>n.results),[r,o]=c.useState(!1),s=(t==null?void 0:t.startUrl)??((l=a[0])==null?void 0:l.pageUrl)??((i=a[0])==null?void 0:i.scope)??null;return e.jsxs(e.Fragment,{children:[e.jsxs("header",{role:"banner",style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)",padding:"var(--v2-pad-3) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)"},children:[e.jsx("a",{href:"#main-content",className:"v2-skip-link",style:{position:"absolute",left:-9999},onFocus:n=>{n.currentTarget.style.left="var(--v2-pad-4)",n.currentTarget.style.top="var(--v2-pad-4)"},onBlur:n=>{n.currentTarget.style.left="-9999px"},children:"Skip to main content"}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-3)",minWidth:0,minHeight:28},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)"},children:[e.jsx("span",{className:"v2-display",style:{fontSize:18,fontWeight:600,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)"},children:"wcagcheckr"}),e.jsx("span",{className:"v2-eyebrow",children:"v2"})]}),s&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",minWidth:0,flex:1},children:[e.jsx("span",{className:"v2-eyebrow",children:"scope"}),e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:s,children:s})]}),e.jsx("div",{style:{marginLeft:"auto"},children:e.jsx(Oe,{})})]}),e.jsxs("nav",{"aria-label":"Application",style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-2)",justifyContent:"flex-end"},children:[e.jsx("a",{href:je,className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:n=>{n.preventDefault(),Ue(je)},title:"Open the wcagcheckr tutorials in a new tab",children:"Tutorials"}),e.jsx($e,{}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>o(!0),"aria-label":"Open tools and exports drawer","aria-expanded":r,title:"Exports, baselines, schedules, forensic log, settings, more",children:"Tools"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>void S({type:"OPEN_SETTINGS"}),"aria-label":"Open settings",title:"Settings",children:"⚙"})]})]}),e.jsx(Ht,{open:r,onClose:()=>o(!1)})]})}function Vt(){return c.useEffect(()=>{const t=He(),r=new URLSearchParams(window.location.search).get("context")==="overlay"?null:chrome.runtime.connect({name:"sidepanel-tracker"}),o=Be();Ve({forceRefresh:!0}).catch(()=>{}),qe().catch(()=>{}),Ke().catch(()=>{}),Ye().catch(()=>{}),Qe().catch(()=>{}),Ze().catch(()=>{}),pt().then(l=>{f.getState().setAcknowledgedKeys(new Set(l.map(i=>i.matchKey)))}).catch(()=>{});let s=!1;return vt().then(l=>{s||l&&f.setState(i=>i.siteCrawlStatus==="running"?{siteCrawlReport:l}:{siteCrawlReport:l,siteCrawlStatus:"complete"})}).catch(()=>{}),()=>{s=!0,o();try{t.disconnect()}catch{}try{r==null||r.disconnect()}catch{}}},[]),e.jsxs("div",{className:"v2-root",children:[e.jsx(Bt,{}),e.jsx(Xe,{}),e.jsx(Je,{}),e.jsxs("main",{id:"main-content","aria-label":"wcagcheckr findings",children:[e.jsx(jt,{}),e.jsx(Ft,{})]})]})}function qt({persona:t,children:a}){const r=t==="power"?"Power user":"Dev",[o,s]=c.useState(!1),l=c.useRef(null);c.useEffect(()=>{const n=l.current;n&&(n.inert=!0)},[]);function i(){chrome.storage.local.set({userMode:"owner",v2UiEnabled:!1}),S({type:"SETTINGS_SET",key:"userMode",value:"owner"})}return e.jsxs("div",{className:"relative h-screen overflow-hidden",children:[e.jsx("div",{ref:l,"aria-hidden":"true",className:"h-full overflow-hidden blur-[2px] opacity-50 pointer-events-none select-none",children:a}),e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-slate-900/40 p-4",children:e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"locked-persona-title",className:"max-w-sm w-full bg-white border border-slate-200 rounded-xl shadow-xl p-5 space-y-3 text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xl","aria-hidden":"true",children:"🔒"}),e.jsxs("h2",{id:"locked-persona-title",className:"text-base font-semibold text-slate-900",children:[r," mode is a paid feature"]})]}),e.jsxs("p",{className:"text-xs text-slate-600 leading-snug",children:[r," mode unlocks the full WCAG findings, fix recipes, and exports for every page — that needs a license. On the free plan, ",e.jsx("strong",{children:"Owner mode"})," ","(the lawsuit-target screener) is yours to use, no license required."]}),e.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>s(!0),className:"w-full text-sm px-4 py-2 bg-brand-500 text-white rounded hover:bg-brand-600 font-medium",children:"Upgrade to unlock →"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("button",{type:"button",onClick:()=>void S({type:"OPEN_SETTINGS"}),className:"text-xs text-slate-600 hover:text-slate-900 underline-offset-2 hover:underline",children:"I have a license token"}),e.jsx("button",{type:"button",onClick:i,className:"text-xs font-medium text-brand-700 hover:underline",children:"← Back to Owner mode"})]})]})]})}),e.jsx(Se,{open:o,onClose:()=>s(!1)})]})}function Kt(){return e.jsxs("div",{role:"alert",className:"flex flex-col items-center justify-center min-h-screen gap-4 px-6 py-10 text-center",children:[e.jsx("div",{className:"text-3xl","aria-hidden":"true",children:"📡"}),e.jsx("h1",{className:"text-base font-semibold text-slate-800",children:"Internet connection required"}),e.jsx("p",{className:"max-w-xs text-sm leading-relaxed text-slate-600",children:"wcagcheckr needs to reach its license server to run. Connect to the internet and reload."}),e.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"rounded bg-slate-800 px-4 py-1.5 text-sm font-medium text-white hover:bg-slate-700",children:"Reload"})]})}at("side-panel");function Yt(){const[t,a]=c.useState(null),[r,o]=c.useState(!1),[,s]=c.useState(0),[l,i]=c.useState(null),[n,g]=c.useState(!1),[y,h]=c.useState(!1);if(c.useEffect(()=>{let b=!1;(async()=>{if(await Promise.all([ve(),me()]),!b){if(o(!0),await ge()){b||i(!0),Promise.all([he(),fe()]).then(()=>{b||s(w=>w+1)}).catch(()=>{});return}await Promise.all([he(),fe()]).catch(()=>{}),!b&&(s(w=>w+1),i(await ge()))}})(),chrome.storage.local.get("licenseToken").then(w=>{b||h(!!w.licenseToken)}).catch(()=>{}).finally(()=>{b||g(!0)});function k(w){const m=w.userMode,E=!!w.v2UiEnabled;let P;m==="owner"||m==="power"||m==="dev"?P=m:P=E?"power":"owner",b||a(P)}chrome.storage.local.get(["userMode","v2UiEnabled"]).then(k).catch(()=>a("owner"));const j=(w,m)=>{m==="local"&&("tierConfig:cache"in w&&ve().then(()=>{b||s(E=>E+1)}),"rubricConfigCache"in w&&me().then(()=>{b||s(E=>E+1)}),"licenseToken"in w&&chrome.storage.local.get("licenseToken").then(E=>{b||h(!!E.licenseToken)}),!(!("userMode"in w)&&!("v2UiEnabled"in w))&&chrome.storage.local.get(["userMode","v2UiEnabled"]).then(k))};return chrome.storage.onChanged.addListener(j),()=>{b=!0,chrome.storage.onChanged.removeListener(j)}},[]),t===null||!r||!n||l===null)return null;if(!l)return e.jsx(Kt,{});const p=t==="power"?e.jsx(Vt,{}):e.jsx(tt,{});return(t==="power"||t==="dev")&&!y?e.jsx(qt,{persona:t,children:p}):p}const Ae=document.getElementById("root");if(!Ae)throw new Error("side-panel: #root not found");ze(Ae).render(e.jsx(Pe.StrictMode,{children:e.jsx(et,{children:e.jsx(Yt,{})})}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aZ as R,a2 as $,a_ as S,a$ as F,U as G,b0 as D,b1 as I}from"./scheduled-audit-runner-BJXKsQZK.js";import"./preload-helper-D7HrI6pR.js";import"./crash-reporter-DAZnNefT.js";import"./diff-CECbooHD.js";import"./ai-usage-log-DVzy9AU1.js";const h={A:"#15803d",B:"#4d7c0f",C:"#a16207",D:"#dc2626",F:"#7f1d1d"},O={low:"#15803d",moderate:"#a16207",high:"#dc2626",critical:"#7f1d1d"},m={critical:"#7f1d1d",serious:"#dc2626",moderate:"#a16207",minor:"#4d7c0f"},v={critical:"#fca5a5",serious:"#fdba74",moderate:"#fcd34d",minor:"#bef264"};function n(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function w(e){if(e<1e3)return`${e}ms`;const t=Math.round(e/100)/10;if(t<60)return`${t}s`;const i=Math.floor(t/60),s=Math.round(t-i*60);return`${i}m ${s}s`}function L(e){return`<span style="display:inline-block;background:${h[e]};color:#fff;font-weight:700;padding:2px 10px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;">${e}</span>`}const y={A:"#047857",C:"#a16207",D:"#c2410c",F:"#be123c"};function T(e){return`<span style="display:inline-block;background:${y[e]};color:#fff;font-weight:700;padding:2px 10px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;">${e}</span>`}function _(e){return $(e.findingGroups??[]).map(t=>{const i=[...new Set(t.pages.map(s=>s.url))];return{ruleId:t.ruleId,description:t.axeDescription,impact:t.impact,urlsAffected:i.length,totalOccurrences:t.totalOccurrences,sampleUrls:i.slice(0,5)}}).sort((t,i)=>i.urlsAffected-t.urlsAffected||i.totalOccurrences-t.totalOccurrences)}function b(e){return`<span style="display:inline-block;background:${O[e]};color:#fff;font-weight:600;padding:2px 10px;border-radius:12px;font-size:11px;text-transform:uppercase;letter-spacing:0.05em;">${e}</span>`}function U(e){return`<span style="display:inline-block;background:${m[e]};color:#fff;font-weight:600;padding:1px 8px;border-radius:10px;font-size:11px;">${e}</span>`}function j(e,t){var r,g,f;const i=`
|
|
2
2
|
${e.pagesAudited} page${e.pagesAudited===1?"":"s"} audited
|
|
3
3
|
${e.pagesFailed>0?`· <span style="color:#fca5a5;">${e.pagesFailed} failed</span>`:""}
|
|
4
4
|
· ${w(e.totalDurationMs)}
|
|
@@ -81,4 +81,4 @@ Error generating stack: `+o.message+`
|
|
|
81
81
|
|
|
82
82
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
83
83
|
|
|
84
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Gh="DialogDescriptionWarning",Zh=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Af(Gh).contentName}}.`;return h.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Jh=Pf,qh=Rf,bh=jf,ev=Lf,tv=Df,nv=If,rv=Ff;function $f({open:e,onClose:t,title:n,description:r,children:l}){const o=h.useRef(null);return h.useEffect(()=>{if(e){const i=document.activeElement;o.current=i instanceof HTMLElement?i:null}},[e]),y.jsx(Jh,{open:e,onOpenChange:i=>!i&&t(),children:y.jsxs(qh,{children:[y.jsx(bh,{className:"fixed inset-0 bg-black/40 z-40"}),y.jsxs(ev,{onCloseAutoFocus:i=>{const u=o.current;u&&u.isConnected&&(i.preventDefault(),u.focus())},className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg p-4 w-[min(28rem,90vw)] z-50 shadow-xl",children:[y.jsxs("div",{className:"flex items-center justify-between mb-3",children:[y.jsx(tv,{className:"font-semibold text-sm",children:n}),y.jsx(rv,{className:"text-slate-500 hover:text-slate-700 text-lg leading-none inline-flex items-center justify-center w-6 h-6 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-brand-500","aria-label":"Close",children:"×"})]}),y.jsx(nv,{className:r?"text-xs text-slate-600 mb-2":"sr-only",children:r??`${n} dialog`}),l]})]})})}const Hs=Ys("checkout-client"),lv="https://api.wcagcheckr.com",ov="wcagcheckr",iv=15e3;async function uv(e){const t=e.uiMode??"hosted",n=`${lv}/v1/products/${ov}/checkout`;try{const r=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({planCode:e.planCode,email:e.email,uiMode:t}),signal:AbortSignal.timeout(iv)}),l=await r.json().catch(()=>null);return r.ok?t==="embedded"?l!=null&&l.clientSecret?{ok:!0,mode:"embedded",clientSecret:l.clientSecret,sessionId:l.sessionId,stub:l.stub===!0}:{ok:!1,error:"malformed response — no clientSecret",status:r.status}:l!=null&&l.checkoutUrl?{ok:!0,mode:"hosted",checkoutUrl:l.checkoutUrl,sessionId:l.sessionId,stub:l.stub===!0}:{ok:!1,error:"malformed response — no checkoutUrl",status:r.status}:(Hs.warn(`checkout HTTP ${r.status}`,l),{ok:!1,status:r.status,error:(l==null?void 0:l.hint)??(l==null?void 0:l.error)??`HTTP ${r.status}`})}catch(r){return Hs.warn("checkout request failed",r),{ok:!1,error:r instanceof Error?r.message:String(r)}}}const We={solo:{monthlyUsd:99,yearlyUsd:990,singleMonthUsd:149},team:{fiveSeatMonthlyUsd:149,fifteenSeatMonthlyUsd:299,fiveSeatYearlyUsd:1490,fifteenSeatYearlyUsd:2990}};function sv(e){const t=(n,r)=>{const l=e.plans.find(o=>o.code===n);return l&&typeof l.priceCents=="number"?l.priceCents/100:r};return{solo:{monthlyUsd:t("solo",We.solo.monthlyUsd),yearlyUsd:t("solo-yearly",We.solo.yearlyUsd),singleMonthUsd:t("solo-single-month",We.solo.singleMonthUsd)},team:{fiveSeatMonthlyUsd:t("team",We.team.fiveSeatMonthlyUsd),fifteenSeatMonthlyUsd:t("team-15",We.team.fifteenSeatMonthlyUsd),fiveSeatYearlyUsd:t("team-yearly",We.team.fiveSeatYearlyUsd),fifteenSeatYearlyUsd:t("team-15-yearly",We.team.fifteenSeatYearlyUsd)}}}function Wf(e,t){return Math.round(100-t/(e*12)*100)}async function av(){try{const e=await Vf();return e?sv(e.config):We}catch{return We}}function cv(){const[e,t]=h.useState(We);return h.useEffect(()=>{let n=!0;return av().then(r=>{n&&t(r)}),()=>{n=!1}},[]),e}const Qs=Ys("sales-inquiry-client"),fv="https://api.wcagcheckr.com",dv="wcagcheckr",pv=15e3;async function mv(e){const t=`${fv}/v1/products/${dv}/sales-inquiry`;try{const n=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...e,source:e.source??"extension"}),signal:AbortSignal.timeout(pv)}),r=await n.json().catch(()=>null);return!n.ok||!(r!=null&&r.success)?(Qs.warn(`sales-inquiry HTTP ${n.status}`,r),{ok:!1,status:n.status,error:(r==null?void 0:r.error)??`HTTP ${n.status}`}):typeof r.inquiryId!="number"?{ok:!1,error:"malformed response — no inquiryId"}:{ok:!0,inquiryId:r.inquiryId}}catch(n){return Qs.warn("sales-inquiry request failed",n),{ok:!1,error:n instanceof Error?n.message:String(n)}}}function hv({open:e,onClose:t,initialSeatEstimate:n}){const[r,l]=h.useState("form"),[o,i]=h.useState(""),[u,s]=h.useState(""),[a,v]=h.useState(""),[m,p]=h.useState(n!=null?String(n):""),[x,S]=h.useState(""),[g,P]=h.useState(null),[f,c]=h.useState(null);function d(){l("form"),i(""),s(""),v(""),p(n!=null?String(n):""),S(""),P(null),c(null)}function w(){d(),t()}async function C(){if(P(null),!o.trim()||!o.includes("@")){P("Please enter a valid email address.");return}l("submitting");const N=m.trim()?parseInt(m,10):null,k=await mv({email:o.trim(),name:u.trim()||void 0,company:a.trim()||void 0,seatCountEstimate:N!=null&&Number.isFinite(N)&&N>0?N:void 0,message:x.trim()||void 0});k.ok?(c(k.inquiryId),l("success")):(P(k.error),l("error"))}return y.jsxs($f,{open:e,onClose:w,title:r==="success"?"Thanks — we got it":"Contact sales",description:r==="success"?"We received your inquiry. A human will reply from support@wcagcheckr.com.":"For Team plans larger than 15 seats. Email is the only required field — leave the rest blank if you want.",children:[r==="success"&&y.jsx(vv,{inquiryId:f,email:o,onClose:w}),r==="error"&&y.jsx(yv,{message:g,onRetry:()=>{P(null),l("form")},onClose:w}),(r==="form"||r==="submitting")&&y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{children:[y.jsxs("label",{htmlFor:"sales-email",className:"block text-[11px] font-medium mb-1",children:["Email ",y.jsx("span",{className:"text-rose-700",children:"*"})]}),y.jsx("input",{id:"sales-email",type:"email",autoComplete:"email",value:o,onChange:N=>i(N.target.value),placeholder:"you@company.com",className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-name",className:"block text-[11px] font-medium mb-1",children:"Name"}),y.jsx("input",{id:"sales-name",type:"text",autoComplete:"name",value:u,onChange:N=>s(N.target.value),className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-company",className:"block text-[11px] font-medium mb-1",children:"Company"}),y.jsx("input",{id:"sales-company",type:"text",autoComplete:"organization",value:a,onChange:N=>v(N.target.value),className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-seats",className:"block text-[11px] font-medium mb-1",children:"Roughly how many seats?"}),y.jsx("input",{id:"sales-seats",type:"number",min:1,max:1e5,inputMode:"numeric",value:m,onChange:N=>p(N.target.value),placeholder:"e.g. 50",className:"w-32 text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-message",className:"block text-[11px] font-medium mb-1",children:"Anything else? (optional)"}),y.jsx("textarea",{id:"sales-message",value:x,onChange:N=>S(N.target.value),placeholder:"Compliance timeline, procurement quirks, ICP questions — whatever's useful for our reply.",rows:4,className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5 resize-y",disabled:r==="submitting"})]}),g&&y.jsx("div",{className:"bg-rose-50 border border-rose-200 rounded p-2 text-rose-900",children:g}),y.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[y.jsx("button",{type:"button",onClick:w,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",disabled:r==="submitting",children:"Cancel"}),y.jsx("button",{type:"button",onClick:C,disabled:r==="submitting"||!o.trim(),className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600 disabled:opacity-50",children:r==="submitting"?"Sending…":"Send inquiry"})]})]})]})}function vv({inquiryId:e,email:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded p-3 text-emerald-900",children:[y.jsx("p",{className:"font-semibold",children:"✓ Inquiry received."}),y.jsxs("p",{className:"mt-1 text-[11px]",children:["We'll reply to ",y.jsx("strong",{children:t})," within a couple of business days.",e!=null&&y.jsxs(y.Fragment,{children:[" ","Reference #",y.jsx("code",{className:"font-mono",children:e}),"."]})]})]}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Close"})})]})}function yv({message:e,onRetry:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded p-3 text-rose-900",children:[y.jsx("p",{className:"font-semibold",children:"✗ Couldn't send your inquiry."}),y.jsx("p",{className:"mt-1 text-[11px]",children:e??"Unknown error."}),y.jsxs("p",{className:"mt-2 text-[11px]",children:["If this keeps happening, email"," ",y.jsx("a",{href:"mailto:support@wcagcheckr.com",className:"underline",children:"support@wcagcheckr.com"})," ","directly."]})]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),y.jsx("button",{onClick:t,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Try again"})]})]})}const gv="pk_live_LT0oTyV8a5uI7dOcJIY849aq";function wv(e){return[{code:"team",seats:5,monthlyUsd:e.team.fiveSeatMonthlyUsd,yearlyUsd:e.team.fiveSeatYearlyUsd},{code:"team-15",seats:15,monthlyUsd:e.team.fifteenSeatMonthlyUsd,yearlyUsd:e.team.fifteenSeatYearlyUsd}]}function Mv({open:e,onClose:t,initialPlan:n="solo"}){const[r,l]=h.useState("form"),[o,i]=h.useState(n),[u,s]=h.useState("month"),[a,v]=h.useState("team"),[m,p]=h.useState("month"),[x,S]=h.useState(!1),[g,P]=h.useState(""),[f,c]=h.useState(!1),[d,w]=h.useState(null),[C,N]=h.useState(null),k=h.useRef(null),R=h.useRef(null),M=h.useRef(null);function L(){return o==="team"?m==="year"?a==="team-15"?"team-15-yearly":"team-yearly":a:u==="year"?"solo-yearly":u==="single-month"?"solo-single-month":"solo"}function J(){l("form"),w(null),P(""),i(n),s("month"),v("team"),p("month"),c(!1),N(null),k.current=null,R.current=null}function de(){J(),t()}h.useEffect(()=>{if(r!=="paying")return;function X(Ke){if(!M.current||Ke.source!==M.current.contentWindow)return;const je=Ke.data;if(!(!je||typeof je.type!="string"))switch(je.type){case"ready":M.current.contentWindow&&k.current&&M.current.contentWindow.postMessage({type:"init",clientSecret:k.current,publishableKey:gv},"*");break;case"mounted":break;case"complete":l("success");break;case"error":w(je.message??"Checkout failed inside Stripe iframe."),l("error");break}}return window.addEventListener("message",X),()=>window.removeEventListener("message",X)},[r]),h.useEffect(()=>{if(r!=="success"||C)return;const X=R.current;if(!X)return;let Ke=!1,je=0;const Nn=20,_=1500;async function j(){if(!Ke){je++;try{const F=await(await fetch(`https://api.wcagcheckr.com/v1/products/wcagcheckr/checkout-status?session_id=${encodeURIComponent(X)}`)).json().catch(()=>null);if(Ke)return;if((F==null?void 0:F.state)==="ready"){N(F.licenseToken);return}}catch{}je<Nn&&!Ke&&setTimeout(j,_)}}return j(),()=>{Ke=!0}},[r,C]);async function Pt(){if(w(null),!g.trim()||!g.includes("@")){w("Please enter a valid email address.");return}c(!0);try{const X=await uv({planCode:L(),email:g.trim(),uiMode:"embedded"});if(!X.ok){w(X.error),l("error");return}if(X.mode!=="embedded"){w("Server returned the wrong checkout mode."),l("error");return}if(X.stub){l("stub");return}k.current=X.clientSecret,R.current=X.sessionId??null,l("paying")}catch(X){w(X instanceof Error?X.message:String(X)),l("error")}finally{c(!1)}}return y.jsxs($f,{open:e,onClose:de,title:r==="success"?"Payment complete":r==="paying"?"Complete your payment":"Upgrade your plan",description:r==="success"?"Your subscription is active. Copy your license token below and paste it into Settings → License to activate the extension.":r==="paying"?"Your card is processed by Stripe — we never see it. Your license token will appear here when payment finishes.":"Pick a plan and enter your email — payment happens here, no new tab. Your license token will appear on the success screen.",children:[r==="success"&&y.jsx(Cv,{email:g,licenseToken:C,onClose:de}),r==="stub"&&y.jsx(Nv,{onClose:de}),r==="error"&&y.jsx(Pv,{message:d,onRetry:()=>{w(null),l("form")},onClose:de}),r==="paying"&&y.jsxs("div",{className:"space-y-3",children:[y.jsx("iframe",{ref:M,title:"Stripe checkout",src:"https://api.wcagcheckr.com/v1/products/wcagcheckr/checkout-embed",className:"w-full min-h-[540px] border-0"}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{type:"button",onClick:()=>{k.current=null,l("form")},className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"← Back to plan selection"})})]}),r==="form"&&y.jsx(xv,{planFamily:o,setPlanFamily:i,soloInterval:u,setSoloInterval:s,teamSeatTier:a,setTeamSeatTier:v,teamInterval:m,setTeamInterval:p,email:g,setEmail:P,errorMessage:d,submitting:f,onSubmit:Pt,onCancel:de,onContactSales:()=>S(!0)}),y.jsx(hv,{open:x,onClose:()=>S(!1),initialSeatEstimate:20})]})}function xv({planFamily:e,setPlanFamily:t,soloInterval:n,setSoloInterval:r,teamSeatTier:l,setTeamSeatTier:o,teamInterval:i,setTeamInterval:u,email:s,setEmail:a,errorMessage:v,submitting:m,onSubmit:p,onCancel:x,onContactSales:S}){const g=cv(),P=wv(g),f=P.find(w=>w.code===l)??P[0],c=i==="year"?f.yearlyUsd:f.monthlyUsd,d=i==="year"?"/yr":"/mo";return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("fieldset",{className:"space-y-2",children:[y.jsx("legend",{className:"text-[11px] font-medium uppercase tracking-wide text-slate-500",children:"Plan"}),y.jsxs("label",{className:`flex items-start gap-2 p-2 rounded border cursor-pointer transition-colors ${e==="solo"?"border-brand-500 bg-brand-50/40":"border-slate-200 hover:bg-slate-50"}`,children:[y.jsx("input",{type:"radio",name:"plan-family",value:"solo",checked:e==="solo",onChange:()=>t("solo"),className:"mt-0.5"}),y.jsxs("span",{className:"flex-1",children:[y.jsx("span",{className:"block font-medium",children:"Solo"}),y.jsx("span",{className:"block text-[11px] text-slate-500 mt-0.5",children:"Single user. Unlimited components, baselines, full state matrix, all exports, forensic anchoring."}),e==="solo"&&y.jsx(Ev,{value:n,onChange:r,solo:g.solo})]})]}),y.jsxs("label",{className:`flex items-start gap-2 p-2 rounded border cursor-pointer transition-colors ${e==="team"?"border-brand-500 bg-brand-50/40":"border-slate-200 hover:bg-slate-50"}`,children:[y.jsx("input",{type:"radio",name:"plan-family",value:"team",checked:e==="team",onChange:()=>t("team"),className:"mt-0.5"}),y.jsxs("span",{className:"flex-1",children:[y.jsxs("span",{className:"block font-medium",children:["Team — $",c,d,y.jsxs("span",{className:"text-[11px] text-slate-500 font-normal",children:[" ","· ",f.seats," seats"]})]}),y.jsx("span",{className:"block text-[11px] text-slate-500 mt-0.5",children:"Everything in Solo, plus baseline cloud-sync across teammates."}),e==="team"&&y.jsxs(y.Fragment,{children:[y.jsx(Sv,{value:l,onChange:o,teamTiers:P}),y.jsx(kv,{value:i,onChange:u,activeTeam:f}),y.jsxs("p",{className:"text-[11px] text-slate-500 mt-2",children:["Need more than 15 seats?"," ",y.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),S()},className:"text-brand-600 hover:underline underline-offset-2",children:"Talk to us →"})]})]})]})]})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"checkout-email",className:"block text-[11px] font-medium mb-1",children:"Email (where we send your license token)"}),y.jsx("input",{id:"checkout-email",type:"email",autoComplete:"email",value:s,onChange:w=>a(w.target.value),placeholder:"you@example.com",className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5"})]}),v&&y.jsx("div",{className:"bg-rose-50 border border-rose-200 rounded p-2 text-rose-900",children:v}),y.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[y.jsx("button",{onClick:x,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Cancel"}),y.jsx("button",{onClick:p,disabled:m||!s.trim(),className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600 disabled:opacity-50",children:m?"Preparing checkout…":"Continue →"})]})]})}function Sv({value:e,onChange:t,teamTiers:n}){return y.jsx("div",{role:"radiogroup","aria-label":"Team seat count",className:"mt-2 inline-flex rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:n.map(r=>{const l=r.code===e,o=(r.monthlyUsd/r.seats).toFixed(2);return y.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>t(r.code),className:l?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",title:`$${o} per seat per month at ${r.seats} seats`,children:[r.seats," seats · $",r.monthlyUsd,"/mo"]},r.code)})})}function kv({value:e,onChange:t,activeTeam:n}){return y.jsxs("div",{role:"radiogroup","aria-label":"Team billing interval",className:"mt-2 inline-flex flex-wrap rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:[y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="month",onClick:()=>t("month"),className:e==="month"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Monthly · $",n.monthlyUsd,"/mo"]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="year",onClick:()=>t("year"),className:e==="year"?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",children:["Yearly · $",n.yearlyUsd,"/yr"," ",y.jsxs("span",{className:e==="year"?"text-emerald-100 font-medium":"text-emerald-700 font-medium",children:["(save ",Wf(n.monthlyUsd,n.yearlyUsd),"%)"]})]})]})}function Ev({value:e,onChange:t,solo:n}){return y.jsxs("div",{role:"radiogroup","aria-label":"Solo billing interval",className:"mt-2 inline-flex flex-wrap rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:[y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="month",onClick:()=>t("month"),className:e==="month"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Monthly · $",n.monthlyUsd,"/mo"]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="year",onClick:()=>t("year"),className:e==="year"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Yearly · $",n.yearlyUsd,"/yr"," ",y.jsxs("span",{className:e==="year"?"text-emerald-100 font-medium":"text-emerald-700 font-medium",children:["(save ",Wf(n.monthlyUsd,n.yearlyUsd),"%)"]})]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="single-month",onClick:()=>t("single-month"),className:e==="single-month"?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",title:"One-time payment for 30 days of access — no recurring charge. Buy again whenever you need it.",children:["Single month · $",n.singleMonthUsd," ",y.jsx("span",{className:e==="single-month"?"text-amber-100":"text-amber-700",children:"(no recurring)"})]})]})}function Cv({email:e,licenseToken:t,onClose:n}){const[r,l]=h.useState(!1);async function o(){if(t)try{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}const[i,u]=h.useState(null);async function s(){if(t){u(null);try{const a=await Bf({type:"LICENSE_SET_REQUEST",token:t});if(!a.seatClaim.ok&&a.seatClaim.reason==="cap-reached"){u(`Activated, but the license is at its seat capacity (${a.seatClaim.seatsUsed} of ${a.seatClaim.seatsTotal} seats). Release a seat on another device from Settings → License, then re-activate here.`);return}if(a.seatClaim.ok&&a.seatClaim.overCapacity){u(`Activated. Note: this license is currently OVER its seat cap (${a.seatClaim.seatsUsed} of ${a.seatClaim.seatsTotal}). Release a seat or upgrade the plan.`),setTimeout(()=>n(),1500);return}n()}catch{}}}return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded p-3 text-emerald-900",children:[y.jsx("p",{className:"font-semibold",children:"✓ Payment received."}),y.jsxs("p",{className:"mt-1 text-[11px]",children:["Subscription active for ",y.jsx("strong",{children:e}),".",t===null?" Issuing your license — this usually takes a few seconds…":" Your license token is ready below."]})]}),t===null?y.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-600",children:[y.jsx("span",{className:"inline-block w-3 h-3 border-2 border-brand-500 border-t-transparent rounded-full animate-spin motion-reduce:animate-none","aria-hidden":"true"}),"Waiting for license server to finish issuing…"]}):y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wide text-slate-500",children:"License token"}),y.jsxs("div",{className:"flex items-stretch gap-1",children:[y.jsx("code",{className:"flex-1 font-mono text-[11px] bg-slate-100 border border-slate-200 rounded px-2 py-1.5 select-all break-all","aria-label":"Your license token",children:t}),y.jsx("button",{type:"button",onClick:o,className:"text-[11px] px-2 py-1.5 border border-slate-300 rounded bg-white hover:bg-slate-50 shrink-0",title:"Copy token to clipboard",children:r?"Copied ✓":"Copy"})]}),y.jsx("p",{className:"text-[11px] text-slate-500",children:"Save this somewhere safe. (Email delivery is coming — until then, this screen is the only place it'll show.)"})]}),i&&y.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded p-2 text-[11px] text-amber-900",children:i}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),t&&y.jsx("button",{onClick:s,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",title:"Save this token to the extension's settings and activate your plan immediately",children:"Activate now →"})]})]})}function Nv({onClose:e}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded p-3 text-amber-900",children:"Checkout is not yet activated. The product owner needs to finish Stripe setup. Please email support — your interest is noted!"}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{onClick:e,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded",children:"OK"})})]})}function Pv({message:e,onRetry:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded p-3 text-rose-900",children:[y.jsx("p",{className:"font-semibold",children:"✗ Checkout couldn't start."}),y.jsx("p",{className:"mt-1 text-[11px]",children:e??"Unknown error."})]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),y.jsx("button",{onClick:t,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Try again"})]})]})}const Ei="autoDownloadReports";async function Iv(){return(await chrome.storage.local.get(Ei))[Ei]===!0}const zv=Ei;function _v(e,t){const r=/^text\/(markdown|plain|csv)\b/i.test(t)?"\uFEFF"+e:e,l=/charset=/i.test(t)?t:`${t};charset=utf-8`;return{body:r,type:l}}function Fv(e,t,n="text/html"){const r=(t.split(".").pop()??"").toLowerCase(),l=n==="text/html"&&(r==="md"||r==="markdown")?"text/markdown":n==="text/html"&&r==="txt"?"text/plain":n,{body:o,type:i}=_v(e,l),u=new Blob([o],{type:i}),s=URL.createObjectURL(u),a=document.createElement("a");a.href=s,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(s),5e3)}function Uv(e){var t;typeof chrome<"u"&&((t=chrome.tabs)!=null&&t.create)?chrome.tabs.create({url:e,active:!0}).catch(n=>{console.warn("[download-helper] chrome.tabs.create failed; falling back to window.open",n),window.open(e,"_blank","noopener,noreferrer")}):window.open(e,"_blank","noopener,noreferrer")}function Av(e,t="text/html"){var l;const n=new Blob([e],{type:t}),r=URL.createObjectURL(n);return typeof chrome<"u"&&((l=chrome.tabs)!=null&&l.create)?chrome.tabs.create({url:r,active:!0}).catch(o=>{console.warn("[download-helper] chrome.tabs.create failed; falling back to window.open",o),window.open(r,"_blank","noopener,noreferrer")}):window.open(r,"_blank","noopener,noreferrer"),setTimeout(()=>URL.revokeObjectURL(r),6e4),r}function $v(e,t){const n=new Date().toISOString().slice(0,10),r=(t??"audit").replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,24).toLowerCase()||"audit";return`wcagcheckr-${e}-${n}-${r}.${e==="ai-prompt"?"md":"html"}`}function Wv(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}export{zv as A,Mv as C,$f as M,rt as P,id as R,xm as a,Ht as b,gm as c,af as d,So as e,xt as f,Nm as g,pr as h,Hl as i,y as j,cv as k,Lv as l,Ov as m,Wv as n,Av as o,$v as p,Uv as q,h as r,Iv as s,Fv as t,_v as u,Wf as y};
|
|
84
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Gh="DialogDescriptionWarning",Zh=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Af(Gh).contentName}}.`;return h.useEffect(()=>{var o;const l=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Jh=Pf,qh=Rf,bh=jf,ev=Lf,tv=Df,nv=If,rv=Ff;function $f({open:e,onClose:t,title:n,description:r,children:l}){const o=h.useRef(null);return h.useEffect(()=>{if(e){const i=document.activeElement;o.current=i instanceof HTMLElement?i:null}},[e]),y.jsx(Jh,{open:e,onOpenChange:i=>!i&&t(),children:y.jsxs(qh,{children:[y.jsx(bh,{className:"fixed inset-0 bg-black/40 z-40"}),y.jsxs(ev,{onCloseAutoFocus:i=>{const u=o.current;u&&u.isConnected&&(i.preventDefault(),u.focus())},className:"fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg p-4 w-[min(28rem,90vw)] z-50 shadow-xl",children:[y.jsxs("div",{className:"flex items-center justify-between mb-3",children:[y.jsx(tv,{className:"font-semibold text-sm",children:n}),y.jsx(rv,{className:"text-slate-500 hover:text-slate-700 text-lg leading-none inline-flex items-center justify-center w-6 h-6 rounded focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-brand-500","aria-label":"Close",children:"×"})]}),y.jsx(nv,{className:r?"text-xs text-slate-600 mb-2":"sr-only",children:r??`${n} dialog`}),l]})]})})}const Ei="autoDownloadReports";async function Mv(){return(await chrome.storage.local.get(Ei))[Ei]===!0}const Iv=Ei;function lv(e,t){const r=/^text\/(markdown|plain|csv)\b/i.test(t)?"\uFEFF"+e:e,l=/charset=/i.test(t)?t:`${t};charset=utf-8`;return{body:r,type:l}}function zv(e,t,n="text/html"){const r=(t.split(".").pop()??"").toLowerCase(),l=n==="text/html"&&(r==="md"||r==="markdown")?"text/markdown":n==="text/html"&&r==="txt"?"text/plain":n,{body:o,type:i}=lv(e,l),u=new Blob([o],{type:i}),s=URL.createObjectURL(u),a=document.createElement("a");a.href=s,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(s),5e3)}function Fv(e){var t;typeof chrome<"u"&&((t=chrome.tabs)!=null&&t.create)?chrome.tabs.create({url:e,active:!0}).catch(n=>{console.warn("[download-helper] chrome.tabs.create failed; falling back to window.open",n),window.open(e,"_blank","noopener,noreferrer")}):window.open(e,"_blank","noopener,noreferrer")}function Uv(e,t="text/html"){var l;const n=new Blob([e],{type:t}),r=URL.createObjectURL(n);return typeof chrome<"u"&&((l=chrome.tabs)!=null&&l.create)?chrome.tabs.create({url:r,active:!0}).catch(o=>{console.warn("[download-helper] chrome.tabs.create failed; falling back to window.open",o),window.open(r,"_blank","noopener,noreferrer")}):window.open(r,"_blank","noopener,noreferrer"),setTimeout(()=>URL.revokeObjectURL(r),6e4),r}function Av(e,t){const n=new Date().toISOString().slice(0,10),r=(t??"audit").replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").slice(0,24).toLowerCase()||"audit";return`wcagcheckr-${e}-${n}-${r}.${e==="ai-prompt"?"md":"html"}`}function $v(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}const Hs=Ys("checkout-client"),ov="https://api.wcagcheckr.com",iv="wcagcheckr",uv=15e3;async function sv(e){const t=e.uiMode??"hosted",n=`${ov}/v1/products/${iv}/checkout`;try{const r=await fetch(n,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({planCode:e.planCode,email:e.email,uiMode:t}),signal:AbortSignal.timeout(uv)}),l=await r.json().catch(()=>null);return r.ok?t==="embedded"?l!=null&&l.clientSecret?{ok:!0,mode:"embedded",clientSecret:l.clientSecret,sessionId:l.sessionId,stub:l.stub===!0}:{ok:!1,error:"malformed response — no clientSecret",status:r.status}:l!=null&&l.checkoutUrl?{ok:!0,mode:"hosted",checkoutUrl:l.checkoutUrl,sessionId:l.sessionId,stub:l.stub===!0}:{ok:!1,error:"malformed response — no checkoutUrl",status:r.status}:(Hs.warn(`checkout HTTP ${r.status}`,l),{ok:!1,status:r.status,error:(l==null?void 0:l.hint)??(l==null?void 0:l.error)??`HTTP ${r.status}`})}catch(r){return Hs.warn("checkout request failed",r),{ok:!1,error:r instanceof Error?r.message:String(r)}}}const We={solo:{monthlyUsd:99,yearlyUsd:990,singleMonthUsd:149},team:{fiveSeatMonthlyUsd:149,fifteenSeatMonthlyUsd:299,fiveSeatYearlyUsd:1490,fifteenSeatYearlyUsd:2990}};function av(e){const t=(n,r)=>{const l=e.plans.find(o=>o.code===n);return l&&typeof l.priceCents=="number"?l.priceCents/100:r};return{solo:{monthlyUsd:t("solo",We.solo.monthlyUsd),yearlyUsd:t("solo-yearly",We.solo.yearlyUsd),singleMonthUsd:t("solo-single-month",We.solo.singleMonthUsd)},team:{fiveSeatMonthlyUsd:t("team",We.team.fiveSeatMonthlyUsd),fifteenSeatMonthlyUsd:t("team-15",We.team.fifteenSeatMonthlyUsd),fiveSeatYearlyUsd:t("team-yearly",We.team.fiveSeatYearlyUsd),fifteenSeatYearlyUsd:t("team-15-yearly",We.team.fifteenSeatYearlyUsd)}}}function Wf(e,t){return Math.round(100-t/(e*12)*100)}async function cv(){try{const e=await Vf();return e?av(e.config):We}catch{return We}}function fv(){const[e,t]=h.useState(We);return h.useEffect(()=>{let n=!0;return cv().then(r=>{n&&t(r)}),()=>{n=!1}},[]),e}const Qs=Ys("sales-inquiry-client"),dv="https://api.wcagcheckr.com",pv="wcagcheckr",mv=15e3;async function hv(e){const t=`${dv}/v1/products/${pv}/sales-inquiry`;try{const n=await fetch(t,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...e,source:e.source??"extension"}),signal:AbortSignal.timeout(mv)}),r=await n.json().catch(()=>null);return!n.ok||!(r!=null&&r.success)?(Qs.warn(`sales-inquiry HTTP ${n.status}`,r),{ok:!1,status:n.status,error:(r==null?void 0:r.error)??`HTTP ${n.status}`}):typeof r.inquiryId!="number"?{ok:!1,error:"malformed response — no inquiryId"}:{ok:!0,inquiryId:r.inquiryId}}catch(n){return Qs.warn("sales-inquiry request failed",n),{ok:!1,error:n instanceof Error?n.message:String(n)}}}function vv({open:e,onClose:t,initialSeatEstimate:n}){const[r,l]=h.useState("form"),[o,i]=h.useState(""),[u,s]=h.useState(""),[a,v]=h.useState(""),[m,p]=h.useState(n!=null?String(n):""),[x,S]=h.useState(""),[g,P]=h.useState(null),[f,c]=h.useState(null);function d(){l("form"),i(""),s(""),v(""),p(n!=null?String(n):""),S(""),P(null),c(null)}function w(){d(),t()}async function C(){if(P(null),!o.trim()||!o.includes("@")){P("Please enter a valid email address.");return}l("submitting");const N=m.trim()?parseInt(m,10):null,k=await hv({email:o.trim(),name:u.trim()||void 0,company:a.trim()||void 0,seatCountEstimate:N!=null&&Number.isFinite(N)&&N>0?N:void 0,message:x.trim()||void 0});k.ok?(c(k.inquiryId),l("success")):(P(k.error),l("error"))}return y.jsxs($f,{open:e,onClose:w,title:r==="success"?"Thanks — we got it":"Contact sales",description:r==="success"?"We received your inquiry. A human will reply from support@wcagcheckr.com.":"For Team plans larger than 15 seats. Email is the only required field — leave the rest blank if you want.",children:[r==="success"&&y.jsx(yv,{inquiryId:f,email:o,onClose:w}),r==="error"&&y.jsx(gv,{message:g,onRetry:()=>{P(null),l("form")},onClose:w}),(r==="form"||r==="submitting")&&y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{children:[y.jsxs("label",{htmlFor:"sales-email",className:"block text-[11px] font-medium mb-1",children:["Email ",y.jsx("span",{className:"text-rose-700",children:"*"})]}),y.jsx("input",{id:"sales-email",type:"email",autoComplete:"email",value:o,onChange:N=>i(N.target.value),placeholder:"you@company.com",className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-name",className:"block text-[11px] font-medium mb-1",children:"Name"}),y.jsx("input",{id:"sales-name",type:"text",autoComplete:"name",value:u,onChange:N=>s(N.target.value),className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-company",className:"block text-[11px] font-medium mb-1",children:"Company"}),y.jsx("input",{id:"sales-company",type:"text",autoComplete:"organization",value:a,onChange:N=>v(N.target.value),className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-seats",className:"block text-[11px] font-medium mb-1",children:"Roughly how many seats?"}),y.jsx("input",{id:"sales-seats",type:"number",min:1,max:1e5,inputMode:"numeric",value:m,onChange:N=>p(N.target.value),placeholder:"e.g. 50",className:"w-32 text-xs border border-slate-300 rounded px-2 py-1.5",disabled:r==="submitting"})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"sales-message",className:"block text-[11px] font-medium mb-1",children:"Anything else? (optional)"}),y.jsx("textarea",{id:"sales-message",value:x,onChange:N=>S(N.target.value),placeholder:"Compliance timeline, procurement quirks, ICP questions — whatever's useful for our reply.",rows:4,className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5 resize-y",disabled:r==="submitting"})]}),g&&y.jsx("div",{className:"bg-rose-50 border border-rose-200 rounded p-2 text-rose-900",children:g}),y.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[y.jsx("button",{type:"button",onClick:w,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",disabled:r==="submitting",children:"Cancel"}),y.jsx("button",{type:"button",onClick:C,disabled:r==="submitting"||!o.trim(),className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600 disabled:opacity-50",children:r==="submitting"?"Sending…":"Send inquiry"})]})]})]})}function yv({inquiryId:e,email:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded p-3 text-emerald-900",children:[y.jsx("p",{className:"font-semibold",children:"✓ Inquiry received."}),y.jsxs("p",{className:"mt-1 text-[11px]",children:["We'll reply to ",y.jsx("strong",{children:t})," within a couple of business days.",e!=null&&y.jsxs(y.Fragment,{children:[" ","Reference #",y.jsx("code",{className:"font-mono",children:e}),"."]})]})]}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Close"})})]})}function gv({message:e,onRetry:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded p-3 text-rose-900",children:[y.jsx("p",{className:"font-semibold",children:"✗ Couldn't send your inquiry."}),y.jsx("p",{className:"mt-1 text-[11px]",children:e??"Unknown error."}),y.jsxs("p",{className:"mt-2 text-[11px]",children:["If this keeps happening, email"," ",y.jsx("a",{href:"mailto:support@wcagcheckr.com",className:"underline",children:"support@wcagcheckr.com"})," ","directly."]})]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),y.jsx("button",{onClick:t,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Try again"})]})]})}const wv="pk_live_LT0oTyV8a5uI7dOcJIY849aq";function xv(e){return[{code:"team",seats:5,monthlyUsd:e.team.fiveSeatMonthlyUsd,yearlyUsd:e.team.fiveSeatYearlyUsd},{code:"team-15",seats:15,monthlyUsd:e.team.fifteenSeatMonthlyUsd,yearlyUsd:e.team.fifteenSeatYearlyUsd}]}function Wv({open:e,onClose:t,initialPlan:n="solo"}){const[r,l]=h.useState("form"),[o,i]=h.useState(n),[u,s]=h.useState("month"),[a,v]=h.useState("team"),[m,p]=h.useState("month"),[x,S]=h.useState(!1),[g,P]=h.useState(""),[f,c]=h.useState(!1),[d,w]=h.useState(null),[C,N]=h.useState(null),k=h.useRef(null),R=h.useRef(null),M=h.useRef(null);function L(){return o==="team"?m==="year"?a==="team-15"?"team-15-yearly":"team-yearly":a:u==="year"?"solo-yearly":u==="single-month"?"solo-single-month":"solo"}function J(){l("form"),w(null),P(""),i(n),s("month"),v("team"),p("month"),c(!1),N(null),k.current=null,R.current=null}function de(){J(),t()}h.useEffect(()=>{if(r!=="paying")return;function X(Ke){if(!M.current||Ke.source!==M.current.contentWindow)return;const je=Ke.data;if(!(!je||typeof je.type!="string"))switch(je.type){case"ready":M.current.contentWindow&&k.current&&M.current.contentWindow.postMessage({type:"init",clientSecret:k.current,publishableKey:wv},"*");break;case"mounted":break;case"complete":l("success");break;case"error":w(je.message??"Checkout failed inside Stripe iframe."),l("error");break}}return window.addEventListener("message",X),()=>window.removeEventListener("message",X)},[r]),h.useEffect(()=>{if(r!=="success"||C)return;const X=R.current;if(!X)return;let Ke=!1,je=0;const Nn=20,_=1500;async function j(){if(!Ke){je++;try{const F=await(await fetch(`https://api.wcagcheckr.com/v1/products/wcagcheckr/checkout-status?session_id=${encodeURIComponent(X)}`)).json().catch(()=>null);if(Ke)return;if((F==null?void 0:F.state)==="ready"){N(F.licenseToken);return}}catch{}je<Nn&&!Ke&&setTimeout(j,_)}}return j(),()=>{Ke=!0}},[r,C]);async function Pt(){if(w(null),!g.trim()||!g.includes("@")){w("Please enter a valid email address.");return}c(!0);try{const X=await sv({planCode:L(),email:g.trim(),uiMode:"embedded"});if(!X.ok){w(X.error),l("error");return}if(X.mode!=="embedded"){w("Server returned the wrong checkout mode."),l("error");return}if(X.stub){l("stub");return}k.current=X.clientSecret,R.current=X.sessionId??null,l("paying")}catch(X){w(X instanceof Error?X.message:String(X)),l("error")}finally{c(!1)}}return y.jsxs($f,{open:e,onClose:de,title:r==="success"?"Payment complete":r==="paying"?"Complete your payment":"Upgrade your plan",description:r==="success"?"Your subscription is active. Copy your license token below and paste it into Settings → License to activate the extension.":r==="paying"?"Your card is processed by Stripe — we never see it. Your license token will appear here when payment finishes.":"Pick a plan and enter your email — payment happens here, no new tab. Your license token will appear on the success screen.",children:[r==="success"&&y.jsx(Nv,{email:g,licenseToken:C,onClose:de}),r==="stub"&&y.jsx(Pv,{onClose:de}),r==="error"&&y.jsx(_v,{message:d,onRetry:()=>{w(null),l("form")},onClose:de}),r==="paying"&&y.jsxs("div",{className:"space-y-3",children:[y.jsx("iframe",{ref:M,title:"Stripe checkout",src:"https://api.wcagcheckr.com/v1/products/wcagcheckr/checkout-embed",className:"w-full min-h-[540px] border-0"}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{type:"button",onClick:()=>{k.current=null,l("form")},className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"← Back to plan selection"})})]}),r==="form"&&y.jsx(Sv,{planFamily:o,setPlanFamily:i,soloInterval:u,setSoloInterval:s,teamSeatTier:a,setTeamSeatTier:v,teamInterval:m,setTeamInterval:p,email:g,setEmail:P,errorMessage:d,submitting:f,onSubmit:Pt,onCancel:de,onContactSales:()=>S(!0)}),y.jsx(vv,{open:x,onClose:()=>S(!1),initialSeatEstimate:20})]})}function Sv({planFamily:e,setPlanFamily:t,soloInterval:n,setSoloInterval:r,teamSeatTier:l,setTeamSeatTier:o,teamInterval:i,setTeamInterval:u,email:s,setEmail:a,errorMessage:v,submitting:m,onSubmit:p,onCancel:x,onContactSales:S}){const g=fv(),P=xv(g),f=P.find(w=>w.code===l)??P[0],c=i==="year"?f.yearlyUsd:f.monthlyUsd,d=i==="year"?"/yr":"/mo";return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("fieldset",{className:"space-y-2",children:[y.jsx("legend",{className:"text-[11px] font-medium uppercase tracking-wide text-slate-500",children:"Plan"}),y.jsxs("label",{className:`flex items-start gap-2 p-2 rounded border cursor-pointer transition-colors ${e==="solo"?"border-brand-500 bg-brand-50/40":"border-slate-200 hover:bg-slate-50"}`,children:[y.jsx("input",{type:"radio",name:"plan-family",value:"solo",checked:e==="solo",onChange:()=>t("solo"),className:"mt-0.5"}),y.jsxs("span",{className:"flex-1",children:[y.jsx("span",{className:"block font-medium",children:"Solo"}),y.jsx("span",{className:"block text-[11px] text-slate-500 mt-0.5",children:"Single user. Unlimited components, baselines, full state matrix, all exports, forensic anchoring."}),e==="solo"&&y.jsx(Cv,{value:n,onChange:r,solo:g.solo})]})]}),y.jsxs("label",{className:`flex items-start gap-2 p-2 rounded border cursor-pointer transition-colors ${e==="team"?"border-brand-500 bg-brand-50/40":"border-slate-200 hover:bg-slate-50"}`,children:[y.jsx("input",{type:"radio",name:"plan-family",value:"team",checked:e==="team",onChange:()=>t("team"),className:"mt-0.5"}),y.jsxs("span",{className:"flex-1",children:[y.jsxs("span",{className:"block font-medium",children:["Team — $",c,d,y.jsxs("span",{className:"text-[11px] text-slate-500 font-normal",children:[" ","· ",f.seats," seats"]})]}),y.jsx("span",{className:"block text-[11px] text-slate-500 mt-0.5",children:"Everything in Solo, plus baseline cloud-sync across teammates."}),e==="team"&&y.jsxs(y.Fragment,{children:[y.jsx(kv,{value:l,onChange:o,teamTiers:P}),y.jsx(Ev,{value:i,onChange:u,activeTeam:f}),y.jsxs("p",{className:"text-[11px] text-slate-500 mt-2",children:["Need more than 15 seats?"," ",y.jsx("button",{type:"button",onClick:w=>{w.stopPropagation(),S()},className:"text-brand-600 hover:underline underline-offset-2",children:"Talk to us →"})]})]})]})]})]}),y.jsxs("div",{children:[y.jsx("label",{htmlFor:"checkout-email",className:"block text-[11px] font-medium mb-1",children:"Email (where we send your license token)"}),y.jsx("input",{id:"checkout-email",type:"email",autoComplete:"email",value:s,onChange:w=>a(w.target.value),placeholder:"you@example.com",className:"w-full text-xs border border-slate-300 rounded px-2 py-1.5"})]}),v&&y.jsx("div",{className:"bg-rose-50 border border-rose-200 rounded p-2 text-rose-900",children:v}),y.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[y.jsx("button",{onClick:x,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Cancel"}),y.jsx("button",{onClick:p,disabled:m||!s.trim(),className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600 disabled:opacity-50",children:m?"Preparing checkout…":"Continue →"})]})]})}function kv({value:e,onChange:t,teamTiers:n}){return y.jsx("div",{role:"radiogroup","aria-label":"Team seat count",className:"mt-2 inline-flex rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:n.map(r=>{const l=r.code===e,o=(r.monthlyUsd/r.seats).toFixed(2);return y.jsxs("button",{type:"button",role:"radio","aria-checked":l,onClick:()=>t(r.code),className:l?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",title:`$${o} per seat per month at ${r.seats} seats`,children:[r.seats," seats · $",r.monthlyUsd,"/mo"]},r.code)})})}function Ev({value:e,onChange:t,activeTeam:n}){return y.jsxs("div",{role:"radiogroup","aria-label":"Team billing interval",className:"mt-2 inline-flex flex-wrap rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:[y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="month",onClick:()=>t("month"),className:e==="month"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Monthly · $",n.monthlyUsd,"/mo"]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="year",onClick:()=>t("year"),className:e==="year"?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",children:["Yearly · $",n.yearlyUsd,"/yr"," ",y.jsxs("span",{className:e==="year"?"text-emerald-100 font-medium":"text-emerald-700 font-medium",children:["(save ",Wf(n.monthlyUsd,n.yearlyUsd),"%)"]})]})]})}function Cv({value:e,onChange:t,solo:n}){return y.jsxs("div",{role:"radiogroup","aria-label":"Solo billing interval",className:"mt-2 inline-flex flex-wrap rounded border border-slate-300 overflow-hidden text-[11px] bg-white",onClick:r=>r.stopPropagation(),children:[y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="month",onClick:()=>t("month"),className:e==="month"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Monthly · $",n.monthlyUsd,"/mo"]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="year",onClick:()=>t("year"),className:e==="year"?"px-2.5 py-1 bg-brand-500 text-white border-r border-slate-300 last:border-r-0":"px-2.5 py-1 text-slate-700 hover:bg-slate-50 border-r border-slate-300 last:border-r-0",children:["Yearly · $",n.yearlyUsd,"/yr"," ",y.jsxs("span",{className:e==="year"?"text-emerald-100 font-medium":"text-emerald-700 font-medium",children:["(save ",Wf(n.monthlyUsd,n.yearlyUsd),"%)"]})]}),y.jsxs("button",{type:"button",role:"radio","aria-checked":e==="single-month",onClick:()=>t("single-month"),className:e==="single-month"?"px-2.5 py-1 bg-brand-500 text-white":"px-2.5 py-1 text-slate-700 hover:bg-slate-50",title:"One-time payment for 30 days of access — no recurring charge. Buy again whenever you need it.",children:["Single month · $",n.singleMonthUsd," ",y.jsx("span",{className:e==="single-month"?"text-amber-100":"text-amber-700",children:"(no recurring)"})]})]})}function Nv({email:e,licenseToken:t,onClose:n}){const[r,l]=h.useState(!1);async function o(){if(t)try{await navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}const[i,u]=h.useState(null);async function s(){if(t){u(null);try{const a=await Bf({type:"LICENSE_SET_REQUEST",token:t});if(!a.seatClaim.ok&&a.seatClaim.reason==="cap-reached"){u(`Activated, but the license is at its seat capacity (${a.seatClaim.seatsUsed} of ${a.seatClaim.seatsTotal} seats). Release a seat on another device from Settings → License, then re-activate here.`);return}if(a.seatClaim.ok&&a.seatClaim.overCapacity){u(`Activated. Note: this license is currently OVER its seat cap (${a.seatClaim.seatsUsed} of ${a.seatClaim.seatsTotal}). Release a seat or upgrade the plan.`),setTimeout(()=>n(),1500);return}n()}catch{}}}return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-emerald-50 border border-emerald-200 rounded p-3 text-emerald-900",children:[y.jsx("p",{className:"font-semibold",children:"✓ Payment received."}),y.jsxs("p",{className:"mt-1 text-[11px]",children:["Subscription active for ",y.jsx("strong",{children:e}),".",t===null?" Issuing your license — this usually takes a few seconds…":" Your license token is ready below."]})]}),t===null?y.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-600",children:[y.jsx("span",{className:"inline-block w-3 h-3 border-2 border-brand-500 border-t-transparent rounded-full animate-spin motion-reduce:animate-none","aria-hidden":"true"}),"Waiting for license server to finish issuing…"]}):y.jsxs("div",{className:"space-y-2",children:[y.jsx("label",{className:"block text-[11px] font-medium uppercase tracking-wide text-slate-500",children:"License token"}),y.jsxs("div",{className:"flex items-stretch gap-1",children:[y.jsx("code",{className:"flex-1 font-mono text-[11px] bg-slate-100 border border-slate-200 rounded px-2 py-1.5 select-all break-all","aria-label":"Your license token",children:t}),y.jsx("button",{type:"button",onClick:o,className:"text-[11px] px-2 py-1.5 border border-slate-300 rounded bg-white hover:bg-slate-50 shrink-0",title:"Copy token to clipboard",children:r?"Copied ✓":"Copy"})]}),y.jsx("p",{className:"text-[11px] text-slate-500",children:"Save this somewhere safe. (Email delivery is coming — until then, this screen is the only place it'll show.)"})]}),i&&y.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded p-2 text-[11px] text-amber-900",children:i}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),t&&y.jsx("button",{onClick:s,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",title:"Save this token to the extension's settings and activate your plan immediately",children:"Activate now →"})]})]})}function Pv({onClose:e}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded p-3 text-amber-900",children:"Checkout is not yet activated. The product owner needs to finish Stripe setup. Please email support — your interest is noted!"}),y.jsx("div",{className:"flex justify-end",children:y.jsx("button",{onClick:e,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded",children:"OK"})})]})}function _v({message:e,onRetry:t,onClose:n}){return y.jsxs("div",{className:"space-y-3 text-xs",children:[y.jsxs("div",{className:"bg-rose-50 border border-rose-200 rounded p-3 text-rose-900",children:[y.jsx("p",{className:"font-semibold",children:"✗ Checkout couldn't start."}),y.jsx("p",{className:"mt-1 text-[11px]",children:e??"Unknown error."})]}),y.jsxs("div",{className:"flex justify-end gap-2",children:[y.jsx("button",{onClick:n,className:"text-xs px-3 py-1.5 rounded border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Close"}),y.jsx("button",{onClick:t,className:"text-xs px-3 py-1.5 bg-brand-500 text-white rounded hover:bg-brand-600",children:"Try again"})]})]})}export{Iv as A,Wv as C,$f as M,rt as P,id as R,xm as a,Ht as b,gm as c,af as d,So as e,xt as f,Nm as g,pr as h,Hl as i,y as j,fv as k,Lv as l,Ov as m,$v as n,Fv as o,Uv as p,Av as q,h as r,Mv as s,zv as t,lv as u,Wf as y};
|
package/dist/devtools/panel.html
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<title>wcagcheckr</title>
|
|
6
|
-
<script type="module" crossorigin src="/assets/devtools-panel-
|
|
6
|
+
<script type="module" crossorigin src="/assets/devtools-panel-DZkip4u6.js"></script>
|
|
7
7
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/crash-reporter-DAZnNefT.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/ai-usage-log-DVzy9AU1.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/styles-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/styles-BsDacBC8.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-D7HrI6pR.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/diff-CECbooHD.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/scheduled-audit-runner-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/scheduled-audit-runner-BJXKsQZK.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/design-system-audit-DpxJrxnb.js">
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/ErrorBoundary-
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/ErrorBoundary-Dz8MotbH.js">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/styles-BwnbwQRf.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body class="bg-slate-50">
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "wcagcheckr",
|
|
4
4
|
"description": "Audit your real site for WCAG issues across hover, focus, dark mode & RTL states — baselines surface only NEW violations.",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.25",
|
|
6
6
|
"author": "Locustware",
|
|
7
7
|
"homepage_url": "https://wcagcheckr.com",
|
|
8
8
|
"icons": {
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>wcagcheckr — Settings</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/options-
|
|
7
|
+
<script type="module" crossorigin src="/assets/options-DjXDOL93.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/crash-reporter-DAZnNefT.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/ai-usage-log-DVzy9AU1.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/styles-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/styles-BsDacBC8.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/tier-config-client-CimEdyEg.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/custom-rules-CAe0nbES.js">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/styles-BwnbwQRf.css">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './assets/service-worker.ts-
|
|
1
|
+
import './assets/service-worker.ts-GP6asxWi.js';
|
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>WCAG Component Auditor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/side-panel-
|
|
7
|
+
<script type="module" crossorigin src="/assets/side-panel-BcBA4SnN.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/crash-reporter-DAZnNefT.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/ai-usage-log-DVzy9AU1.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/styles-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/styles-BsDacBC8.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-D7HrI6pR.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/diff-CECbooHD.js">
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/scheduled-audit-runner-
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/scheduled-audit-runner-BJXKsQZK.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/design-system-audit-DpxJrxnb.js">
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/ErrorBoundary-
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/copy-ai-fixer-prompt-
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/ErrorBoundary-Dz8MotbH.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/copy-ai-fixer-prompt-zCj1CiZK.js">
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/tier-config-client-CimEdyEg.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/assets/rubric-config-client-
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/rubric-config-client-VuUmF7Y1.js">
|
|
21
21
|
<link rel="stylesheet" crossorigin href="/assets/styles-BwnbwQRf.css">
|
|
22
22
|
<link rel="stylesheet" crossorigin href="/assets/side-panel-Cq-w2yTn.css">
|
|
23
23
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcag-checkr/ci",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Headless wcagcheckr accessibility audit runner for CI/CD pipelines. Drives the wcagcheckr Chrome extension via Playwright, runs full-page audits across the state matrix (108 combinations: hover, focus, dark mode, RTL, breakpoints), outputs JSON / SARIF / JUnit, exits with severity-aware codes.",
|
|
6
6
|
"license": "UNLICENSED",
|