import"../test_runner/test_runner.js";import"../third_party/axe-core/axe.js";self.AxeCoreTestRunner=self.AxeCoreTestRunner||{};const DISABLED_RULES={"aria-hidden-focus":{enabled:!1},"aria-input-field-name":{enabled:!1},"aria-toggle-field-name":{enabled:!1},"color-contrast":{enabled:!1},"image-redundant-alt":{enabled:!1},"aria-required-children":{enabled:!1},"aria-allowed-role":{enabled:!1},"aria-dpub-role-fallback":{enabled:!1},"audio-caption":{enabled:!1},blink:{enabled:!1},"form-field-multiple-labels":{enabled:!1},"frame-tested":{enabled:!1},"html-has-lang":{enabled:!1},"html-lang-valid":{enabled:!1},"html-xml-lang-mismatch":{enabled:!1},"landmark-banner-is-top-level":{enabled:!1},"landmark-complementary-is-top-level":{enabled:!1},"landmark-contentinfo-is-top-level":{enabled:!1},"landmark-main-is-top-level":{enabled:!1},"landmark-no-duplicate-banner":{enabled:!1},"landmark-no-duplicate-contentinfo":{enabled:!1},"landmark-one-main":{enabled:!1},"landmark-unique":{enabled:!1},marquee:{enabled:!1},"meta-refresh":{enabled:!1},"meta-viewport":{enabled:!1},"meta-viewport-large":{enabled:!1},"object-alt":{enabled:!1},"page-has-heading-one":{enabled:!1},"scrollable-region-focusable":{enabled:!1},"video-caption":{enabled:!1},"video-description":{enabled:!1},"valid-lang":{enabled:!1}},DEFAULT_CONFIG={checks:[{id:"aria-valid-attr",options:["aria-placeholder"]}],runOnly:{type:"tags",values:{include:["wcag2a","best-practice"],exclude:["experimental"]}}};AxeCoreTestRunner.processAxeResult=function(e){const a=e.map((function(e){return{ruleDescription:e.description,helpUrl:e.helpUrl,ruleId:e.id,impact:e.impact,failedNodes:AxeCoreTestRunner.processAxeResultNodesArray(e.nodes)}}));return JSON.stringify(a,void 0,2)},AxeCoreTestRunner.processAxeResultNodesArray=function(e){return e.map((function(e){return{target:e.target,html:e.html,failureSummary:e.failureSummary}}))},AxeCoreTestRunner.runValidation=async function(e,a,n){axe.configure({...DEFAULT_CONFIG,...n});try{const n=await axe.run(e,{rules:{...DISABLED_RULES,...a}}),l=AxeCoreTestRunner.processAxeResult(n.violations);TestRunner.addResult(`aXe violations: ${l}\n`)}catch(l){TestRunner.addResult(`aXe threw an error: '${l}'`)}};