1import{r as f,j as b}from"./index-Bz_gH6uL.js";import{T as d}from"./ToolAnalysisLayout-9qXFRABo.js";import{p as A,b as m}from"./parsingUtils-DhbIw5xT.js";import"./textarea-8chg0if2.js";import"./tabs-DP4VFpC6.js";import"./index-D4RehSaz.js";import"./table-CZZoHoDo.js";import"./scoringUtils-Dprupo87.js";import"./useAnalysisPersistence-UgBeclv_.js";import"./shield-DJMnoBgF.js";import"./chart-column-7BGpquxA.js";import"./code-ByKkvRKm.js";import"./file-text-Bepy2Z1A.js";import"./circle-alert-CiuvQiZ1.js";import"./loader-circle-Ovh9YlES.js";import"./download-CJEf19Vz.js";import"./file-down-DYSm0Su8.js";import"./clock-on2Nz2q2.js";const u={correct:`<h1>OfertÄ specialÄ</h1> 2<p>Reducere de 30% la toate produsele din categoria electronice.</p> 3<img src="decorative-pattern.svg" alt="" role="presentation" />`,incorrect:`<img src="banner-text-oferta.png" alt="banner" /> 4<img src="menu-items.jpg" alt="" /> 5<svg viewBox="0 0 200 50"> 6 <text x="10" y="35" font-size="24">PreÈ: 99 RON</text> 7</svg> 8<div style="background-image: url('promo-text.jpg')" class="hero-banner"> 9 <span class="sr-only"></span> 10</div>`},g=[/text/i,/banner/i,/menu/i,/header/i,/title/i,/price/i,/pret/i,/ofert/i,/button/i,/cta/i,/logo.*text/i,/screenshot/i,/flyer/i,/poster/i,/infographic/i];function y(c){const o=A(c),i=[];return Array.from(o.querySelectorAll("img")).forEach((t,s)=>{const e=(t.getAttribute("src")||"").toLowerCase(),a=(t.getAttribute("alt")||"").toLowerCase(),r=m(t);if(t.getAttribute("role")==="presentation"||t.getAttribute("role")==="none")return;const p=g.some(l=>l.test(e)),x=g.some(l=>l.test(a));(p||x)&&i.push({id:`ocr-img-text-${s}`,label:`PosibilÄ imagine cu text ${r}`,status:"warning",details:`Numele fiÈierului sau alt text-ul sugereazÄ cÄ imaginea conÈine text ("${e.substring(0,30)}"). UtilizaÈi text HTML real în loc de imagini cu text.`,wcagCriterion:"WCAG 1.4.5 Images of Text"})}),Array.from(o.querySelectorAll("svg")).forEach((t,s)=>{const e=t.querySelectorAll("text");if(e.length>0){const a=Array.from(e).map(r=>{var n;return(n=r.textContent)==null?void 0:n.trim()}).filter(Boolean).join(", ");i.push({id:`ocr-svg-text-${s}`,label:`SVG cu text: ${m(t)}`,status:"warning",details:`SVG-ul conÈine elemente <text> ("${a.substring(0,40)}"). VerificaÈi dacÄ acest text trebuie sÄ fie HTML real accesibil.`,wcagCriterion:"WCAG 1.4.5 Images of Text"})}}),Array.from(o.querySelectorAll("[style*='background-image'], [style*='background:']")).forEach((t,s)=>{var r;const e=t.getAttribute("style")||"";/url\s*\(/i.test(e)&&((r=t.textContent)!=null&&r.trim()||i.push({id:`ocr-bg-notext-${s}`,label:"Background image fÄrÄ text alternativ",status:"warning",details:"Element cu background-image dar fÄrÄ conÈinut text accesibil. DacÄ imaginea conÈine text, adÄugaÈi text HTML vizibil sau ascuns.",wcagCriterion:"WCAG 1.4.5 Images of Text"}))}),i.length===0&&i.push({id:"ocr-ok",label:"Imagini cu text",status:"pass",details:"Nu au fost detectate imagini suspecte de a conÈine text în loc de HTML."}),i}const P=()=>{const c=f.useCallback(o=>y(o),[]);return b.jsx(d,{title:"Detector Imagini cu Text",description:"DetecteazÄ imagini care probabil conÈin text (prin heuristici pe filename, SVG text, background-image) â text-ul ar trebui sÄ fie HTML real.",wcagCriterion:"WCAG 1.4.5 Images of Text (Level AA)",correctExample:u.correct,incorrectExample:u.incorrect,onAnalyze:c})};export{P as OcrAccessibilityScanner};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.