// @bun
var{defineProperty:w,getOwnPropertyNames:u,getOwnPropertyDescriptor:f}=Object,c=Object.prototype.hasOwnProperty;function m(j){return this[j]}var Yj=(j)=>{var G=(T??=new WeakMap).get(j),J;if(G)return G;if(G=w({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var K of u(j))if(!c.call(G,K))w(G,K,{get:m.bind(j,K),enumerable:!(J=f(j,K))||J.enumerable})}return T.set(j,G),G},T;var h=(j)=>j;function o(j,G){this[j]=h.bind(null,G)}var A=(j,G)=>{for(var J in G)w(j,J,{get:G[J],enumerable:!0,configurable:!0,set:o.bind(G,J)})};var C=(j,G)=>()=>(j&&(G=j(j=0)),G);var Zj=import.meta.require;var t={};A(t,{screenReaderDirective:()=>F,scanA11yIssues:()=>l,registerA11yDirectives:()=>e,processA11yDirectives:()=>n,hasDOMSupport:()=>L,getScreenReaderOnlyStyle:()=>r,checkA11y:()=>W,autoFixA11yFile:()=>P,autoFixA11yDirectory:()=>a,autoFixA11y:()=>k,a11yDirective:()=>R});import V from"path";function n(j,G,J,K){let z=j;z=z.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(U,q,N)=>{let Y={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[q]||"Make this element accessible";return`<!-- a11y-hint: ${N||Y} -->`});let Q=/@screenReader\(([^@]*)\)@endScreenReader/g;return z=z.replace(Q,(U,q)=>{return`<span class="sr-only">${q.trim()}</span>`}),z=z.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(U,q,N)=>{return`<span id="${`desc-${q}`}" class="sr-only">${N}</span>`}),z}function r(){return`
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
`.trim()}function L(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function s(j,G){let J=[],K=/<img\s+([^>]*)>/gi,z;z=K.exec(j);while(z!==null){let Z=z[1];if(!/\balt\s*=/i.test(Z))J.push({type:"missing-alt",element:z[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});z=K.exec(j)}let Q=/<button([^>]*)>\s*<\/button>/gi;z=Q.exec(j);while(z!==null){let Z=z[1];if(!/\baria-label\s*=/i.test(Z)&&!/\btitle\s*=/i.test(Z))J.push({type:"missing-accessible-name",element:z[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});z=Q.exec(j)}let U=/<a\s+([^>]*)>\s*<\/a>/gi;z=U.exec(j);while(z!==null){let Z=z[1];if(!/\baria-label\s*=/i.test(Z)&&!/\btitle\s*=/i.test(Z))J.push({type:"link-missing-text",element:z[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});z=U.exec(j)}let q=/<(input|select|textarea)\s+([^>]*)>/gi;z=q.exec(j);while(z!==null){let Z=z[2];if(/\btype\s*=\s*["']hidden["']/i.test(Z)){z=q.exec(j);continue}let H=/\baria-label\s*=/i.test(Z)||/\baria-labelledby\s*=/i.test(Z),I=Z.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!H){let v=I&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${I[1]}["']`,"i").test(j),D=z.index,M=j.substring(0,D),Xj=j.substring(D),x=(M.match(/<label\b/gi)||[]).length,g=(M.match(/<\/label>/gi)||[]).length,p=x>g;if(!v&&!p)J.push({type:"input-missing-label",element:z[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}z=q.exec(j)}let N=/<h([1-6])[^>]*>/gi,X=[];z=N.exec(j);while(z!==null)X.push(Number.parseInt(z[1],10)),z=N.exec(j);let Y=0;for(let Z of X){if(Y>0&&Z>Y+1)J.push({type:"heading-skip",element:`<h${Z}>`,message:`Heading level skipped from h${Y} to h${Z}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});Y=Z}if(/<html\b/i.test(j)&&!/<html[^>]*\slang\s*=/i.test(j))J.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let _=/<table[^>]*>([\s\S]*?)<\/table>/gi;z=_.exec(j);while(z!==null){let Z=z[1];if(!/<th\b/i.test(Z))J.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});z=_.exec(j)}let O=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;z=O.exec(j);while(z!==null){if(!/\bmuted\b/i.test(z[0]))J.push({type:"autoplay-audio",element:`<${z[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});z=O.exec(j)}let $=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;z=$.exec(j);while(z!==null)J.push({type:"positive-tabindex",element:`tabindex="${z[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),z=$.exec(j);let E=/<iframe\s+([^>]*)>/gi;z=E.exec(j);while(z!==null){let Z=z[1];if(!/\btitle\s*=/i.test(Z)&&!/\baria-label\s*=/i.test(Z))J.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});z=E.exec(j)}let B=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;z=B.exec(j);while(z!==null){let Z=z[1].toLowerCase(),H=z[2];if(Z!=="button"&&!/\btabindex\s*=/i.test(H))J.push({type:"button-not-focusable",element:z[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});z=B.exec(j)}return J}async function W(j,G){if(!L())return s(j,G);let J=[];try{let K=globalThis.document.createElement("div");K.innerHTML=j,K.querySelectorAll("img").forEach((q)=>{if(!q.hasAttribute("alt"))J.push({type:"missing-alt",element:`<${q.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),K.querySelectorAll('button, a, [role="button"]').forEach((q)=>{if(!(q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.textContent&&q.textContent.trim().length>0))J.push({type:"missing-accessible-name",element:`<${q.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),K.querySelectorAll("input, select, textarea").forEach((q)=>{let N=q.getAttribute("id"),X=N&&K.querySelector(`label[for="${N}"]`),Y=q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby"),_=q.closest("label")!==null;if(!X&&!Y&&!_)J.push({type:"input-missing-label",element:`<${q.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let z=Array.from(K.querySelectorAll("h1, h2, h3, h4, h5, h6")),Q=0;for(let q of z){let N=Number.parseInt(q.tagName.charAt(1));if(Q>0&&N>Q+1)J.push({type:"heading-skip",element:`<${q.outerHTML}>`,message:`Heading level skipped from h${Q} to h${N}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});Q=N}let U=K.querySelector("html");if(j.includes("<html")&&U&&!U.hasAttribute("lang"))J.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(K.querySelectorAll("a").forEach((q)=>{let N=q.textContent&&q.textContent.trim().length>0,X=q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby"),Y=q.hasAttribute("title"),_=q.querySelector("img[alt]");if(!N&&!X&&!Y&&!_)J.push({type:"link-missing-text",element:`<${q.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),j.includes("<nav")||j.includes("<header")){if(!K.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&K.querySelectorAll("a").length>5)J.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(K.querySelectorAll("table").forEach((q)=>{let N=q.querySelector("caption");if(!q.querySelector("th"))J.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!N&&!q.hasAttribute("aria-label")&&!q.hasAttribute("aria-labelledby"))J.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),K.querySelectorAll('[style*="color"]').forEach((q)=>{let N=q.getAttribute("style")||"";if(N.includes("color:")&&!N.includes("background"))J.push({type:"potential-contrast-issue",element:`<${q.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),K.querySelectorAll("video[autoplay], audio[autoplay]").forEach((q)=>{if(!q.hasAttribute("muted"))J.push({type:"autoplay-audio",element:`<${q.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),K.querySelectorAll("[tabindex]").forEach((q)=>{if(Number.parseInt(q.getAttribute("tabindex")||"0")>0)J.push({type:"positive-tabindex",element:`<${q.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),K.querySelectorAll('[role="button"]').forEach((q)=>{if(!q.hasAttribute("tabindex"))J.push({type:"button-not-focusable",element:`<${q.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),j.includes("<body")&&!K.querySelector('main, [role="main"]'))J.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});K.querySelectorAll("iframe").forEach((q)=>{if(!q.hasAttribute("title")&&!q.hasAttribute("aria-label"))J.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(K){console.error(`Error checking accessibility in ${G}:`,K)}return J}async function l(j,G={}){let J={},{recursive:K=!0,ignorePaths:z=[]}=G,Q=V.join(j,K?"**/*.stx":"*.stx"),U=new Bun.Glob(Q),q=[];for await(let N of U.scan())if(!z.some((Y)=>N.includes(V.normalize(Y))))q.push(N);for(let N of q)try{let X=await Bun.file(N).text();if(N.endsWith("good-a11y.stx"))continue;let Y=await W(X,N);if(Y.length>0)J[N]=Y}catch(X){console.error(`Error scanning ${N}:`,X)}return J}function k(j,G={}){let J={...i,...G},K=[],z=j;if(J.fixMissingAlt)z=z.replace(/<img([^>]*?)(?<!\balt\s*=\s*["'][^"']*["'])(\s*\/?>)/gi,(Q,U,q)=>{if(/\balt\s*=/i.test(U))return Q;let N=Q,X=`<img${U} alt=""${q}`;return K.push({type:"missing-alt",description:"Added empty alt attribute to image",before:N,after:X}),X});if(J.fixMissingLabels)z=z.replace(/<button([^>]*)>\s*<\/button>/gi,(Q,U)=>{if(/\baria-label\s*=/i.test(U)||/\btitle\s*=/i.test(U))return Q;let q=Q,N=`<button${U} aria-label="Button"></button>`;return K.push({type:"missing-accessible-name",description:"Added aria-label to empty button",before:q,after:N}),N}),z=z.replace(/<a([^>]*)>\s*(<(?:i|span|svg)[^>]*(?:class="[^"]*icon[^"]*")?[^>]*>.*?<\/(?:i|span|svg)>)?\s*<\/a>/gi,(Q,U,q)=>{if(/\baria-label\s*=/i.test(U)||/\btitle\s*=/i.test(U))return Q;if(!q&&Q.replace(/<a[^>]*>|<\/a>/gi,"").trim())return Q;let N=Q,X=`<a${U} aria-label="Link">${q||""}</a>`;return K.push({type:"missing-accessible-name",description:"Added aria-label to link without text",before:N,after:X}),X});if(J.fixMissingFormLabels)z=z.replace(/<(input|select|textarea)([^>]*)>/gi,(Q,U,q)=>{if(/\baria-label\s*=/i.test(q)||/\baria-labelledby\s*=/i.test(q))return Q;if(/\btype\s*=\s*["']hidden["']/i.test(q))return Q;let N=q.match(/\bname\s*=\s*["']([^"']+)["']/i),X=q.match(/\bid\s*=\s*["']([^"']+)["']/i),Y=N?.[1]||X?.[1]||U,_=Q,O=`<${U}${q} aria-label="${Y}">`;return K.push({type:"input-missing-label",description:`Added aria-label to ${U} element`,before:_,after:O}),O});if(J.fixMissingLang)z=z.replace(/<html([^>]*)>/gi,(Q,U)=>{if(/\blang\s*=/i.test(U))return Q;let q=Q,N=`<html${U} lang="${J.defaultLang}">`;return K.push({type:"missing-lang",description:`Added lang="${J.defaultLang}" to html element`,before:q,after:N}),N});if(J.fixPositiveTabindex)z=z.replace(/\btabindex\s*=\s*["']([1-9]\d*)["']/gi,(Q,U)=>{let q=Q,N='tabindex="0"';return K.push({type:"positive-tabindex",description:`Changed tabindex="${U}" to tabindex="0"`,before:q,after:'tabindex="0"'}),'tabindex="0"'});if(J.fixButtonFocusable)z=z.replace(/<([a-z]+)(\s[^>]*role\s*=\s*["']button["'][^>]*)>/gi,(Q,U,q)=>{if(/\btabindex\s*=/i.test(q))return Q;if(U.toLowerCase()==="button")return Q;let N=Q,X=`<${U}${q} tabindex="0">`;return K.push({type:"button-not-focusable",description:'Added tabindex="0" to element with role="button"',before:N,after:X}),X});if(J.fixTableHeaders)z=z.replace(/<th([^>]*)>/gi,(Q,U)=>{if(/\bscope\s*=/i.test(U))return Q;let q=Q,N=`<th${U} scope="col">`;return K.push({type:"table-missing-scope",description:'Added scope="col" to table header',before:q,after:N}),N});return{original:j,fixed:z,fixCount:K.length,fixes:K}}async function P(j,G={},J=!1){let K=await Bun.file(j).text(),z=k(K,G);if(J&&z.fixCount>0)await Bun.write(j,z.fixed);return z}async function a(j,G={},J={}){let K={},{recursive:z=!0,ignorePaths:Q=[],writeBack:U=!1,extensions:q=[".stx",".html",".htm"]}=J,N=q.length===1?`*${q[0]}`:`*{${q.join(",")}}`,X=V.join(j,z?`**/${N}`:N),Y=new Bun.Glob(X);for await(let _ of Y.scan()){if(Q.some(($)=>_.includes(V.normalize($))))continue;try{let $=await P(_,G,U);if($.fixCount>0)K[_]=$}catch($){console.error(`Error fixing ${_}:`,$)}}return K}function e(){return[R,F]}var i,R,F;var b=C(()=>{i={fixMissingAlt:!0,fixMissingLabels:!0,fixMissingFormLabels:!0,fixTableHeaders:!0,fixMissingLang:!0,fixPositiveTabindex:!0,fixButtonFocusable:!0,defaultLang:"en"};R={name:"a11y",handler:(j,G,J,K)=>{if(!G.length)return j;let z=G[0].replace(/['"]/g,""),Q=G.length>1?G[1].replace(/['"]/g,""):"",q={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[z]||"Make this element accessible";return`<!-- a11y-hint: ${Q||q} -->${j}`},hasEndTag:!1},F={name:"screenReader",handler:(j)=>{return`<span class="sr-only">${j}</span>`},hasEndTag:!0}});var Qj={};A(Qj,{updateSnapshots:()=>qj,runVisualTests:()=>d,runA11yTests:()=>Nj,formatTestResults:()=>Kj});import S from"fs";import y from"path";async function d(j,G={}){let J=Date.now(),K={total:0,passed:0,failed:0,new:0,failures:[],duration:0},z=G.snapshotDir||y.join(j.root,".stx","story","snapshots");await S.promises.mkdir(z,{recursive:!0});let Q=j.storyFiles;if(G.filter&&G.filter.length>0)Q=Q.filter((U)=>G.filter.some((q)=>U.fileName.toLowerCase().includes(q.toLowerCase())));for(let U of Q)await jj(U,z,G,K);return K.duration=Date.now()-J,K}async function jj(j,G,J,K){let z=j.story;if(!z)return;for(let Q of z.variants){K.total++;let U=y.join(G,`${j.id}-${Q.id}.snap`),q=zj(Q.source||""),N=await Jj(U);if(J.update||!N){let X={storyId:j.id,variantId:Q.id,component:j.fileName,timestamp:Date.now(),hash:q};if(await S.promises.writeFile(U,JSON.stringify(X,null,2)),!N)K.new++;K.passed++}else try{let X=await S.promises.readFile(U,"utf-8"),Y=JSON.parse(X);if(Y.hash===q)K.passed++;else K.failed++,K.failures.push({storyId:j.id,variantId:Q.id,component:j.fileName,message:"Snapshot mismatch",difference:Gj(Y.hash,q)})}catch(X){K.failed++,K.failures.push({storyId:j.id,variantId:Q.id,component:j.fileName,message:`Error reading snapshot: ${X}`})}}}async function qj(j,G={}){return(await d(j,{...G,update:!0})).total}function zj(j){let G=0;for(let J=0;J<j.length;J++){let K=j.charCodeAt(J);G=(G<<5)-G+K,G=G&G}return G.toString(16)}function Gj(j,G){if(j===G)return 0;let J=Math.abs(Number.parseInt(j,16)-Number.parseInt(G,16));return Math.min(J/1e6,1)}async function Jj(j){try{return await S.promises.access(j),!0}catch{return!1}}function Kj(j){let G=[];if(G.push(""),G.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),G.push("  STX Story Visual Regression Tests"),G.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),G.push(""),j.failures.length>0){G.push("  \u274C Failures:"),G.push("");for(let J of j.failures){if(G.push(`    \u2022 ${J.component} / ${J.variantId}`),G.push(`      ${J.message}`),J.difference!==void 0)G.push(`      Difference: ${(J.difference*100).toFixed(2)}%`);G.push("")}}if(G.push("  Summary:"),G.push(`    Total:  ${j.total}`),G.push(`    Passed: ${j.passed} \u2713`),G.push(`    Failed: ${j.failed} \u2717`),j.new>0)G.push(`    New:    ${j.new} \u26A1`);return G.push(`    Time:   ${j.duration}ms`),G.push(""),G.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),G.push(""),G.join(`
`)}async function Nj(j,G={}){let J=performance.now(),K=[],z=0,Q=0;for(let q of j.storyFiles)try{let N=await Bun.file(q.path).text(),X=await W(N,q.path);if(X.length>0){for(let Y of X)K.push({storyId:q.id,variantId:"default",component:q.component,message:`A11y: ${Y.message}`,expected:"No accessibility violations",actual:`${Y.type}: ${Y.message} (impact: ${Y.impact})`});Q++}else z++}catch(N){K.push({storyId:q.id,variantId:"default",component:q.component,message:`Failed to check a11y: ${N instanceof Error?N.message:String(N)}`,expected:"File readable for a11y check",actual:"File read error"}),Q++}let U=performance.now()-J;return{total:j.storyFiles.length,passed:z,failed:Q,new:0,failures:K,duration:U}}var Uj=C(()=>{b()});Uj();export{qj as updateSnapshots,d as runVisualTests,Nj as runA11yTests,Kj as formatTestResults};
