web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23113 lines
845 KiB

  1. /*! axe v4.1.4
  2. * Copyright (c) 2021 Deque Systems, Inc.
  3. *
  4. * Your use of this Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. *
  8. * This entire copyright notice must appear in every copy of this file you
  9. * distribute or in any file that contains substantial portions of this source
  10. * code.
  11. */
  12. (function axeFunction(window) {
  13. var global = window;
  14. var document = window.document;
  15. 'use strict';
  16. function _typeof(obj) {
  17. '@babel/helpers - typeof';
  18. if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
  19. _typeof = function _typeof(obj) {
  20. return typeof obj;
  21. };
  22. } else {
  23. _typeof = function _typeof(obj) {
  24. return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
  25. };
  26. }
  27. return _typeof(obj);
  28. }
  29. var axe = axe || {};
  30. axe.version = '4.1.4';
  31. if (typeof define === 'function' && define.amd) {
  32. define('axe-core', [], function() {
  33. return axe;
  34. });
  35. }
  36. if ((typeof module === 'undefined' ? 'undefined' : _typeof(module)) === 'object' && module.exports && typeof axeFunction.toString === 'function') {
  37. axe.source = '(' + axeFunction.toString() + ')(typeof window === "object" ? window : this);';
  38. module.exports = axe;
  39. }
  40. if (typeof window.getComputedStyle === 'function') {
  41. window.axe = axe;
  42. }
  43. var commons;
  44. function SupportError(error) {
  45. this.name = 'SupportError';
  46. this.cause = error.cause;
  47. this.message = '`'.concat(error.cause, '` - feature unsupported in your environment.');
  48. if (error.ruleId) {
  49. this.ruleId = error.ruleId;
  50. this.message += ' Skipping '.concat(this.ruleId, ' rule.');
  51. }
  52. this.stack = new Error().stack;
  53. }
  54. SupportError.prototype = Object.create(Error.prototype);
  55. SupportError.prototype.constructor = SupportError;
  56. 'use strict';
  57. function _objectWithoutProperties(source, excluded) {
  58. if (source == null) {
  59. return {};
  60. }
  61. var target = _objectWithoutPropertiesLoose(source, excluded);
  62. var key, i;
  63. if (Object.getOwnPropertySymbols) {
  64. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  65. for (i = 0; i < sourceSymbolKeys.length; i++) {
  66. key = sourceSymbolKeys[i];
  67. if (excluded.indexOf(key) >= 0) {
  68. continue;
  69. }
  70. if (!Object.prototype.propertyIsEnumerable.call(source, key)) {
  71. continue;
  72. }
  73. target[key] = source[key];
  74. }
  75. }
  76. return target;
  77. }
  78. function _objectWithoutPropertiesLoose(source, excluded) {
  79. if (source == null) {
  80. return {};
  81. }
  82. var target = {};
  83. var sourceKeys = Object.keys(source);
  84. var key, i;
  85. for (i = 0; i < sourceKeys.length; i++) {
  86. key = sourceKeys[i];
  87. if (excluded.indexOf(key) >= 0) {
  88. continue;
  89. }
  90. target[key] = source[key];
  91. }
  92. return target;
  93. }
  94. function _defineProperty(obj, key, value) {
  95. if (key in obj) {
  96. Object.defineProperty(obj, key, {
  97. value: value,
  98. enumerable: true,
  99. configurable: true,
  100. writable: true
  101. });
  102. } else {
  103. obj[key] = value;
  104. }
  105. return obj;
  106. }
  107. function _inherits(subClass, superClass) {
  108. if (typeof superClass !== 'function' && superClass !== null) {
  109. throw new TypeError('Super expression must either be null or a function');
  110. }
  111. subClass.prototype = Object.create(superClass && superClass.prototype, {
  112. constructor: {
  113. value: subClass,
  114. writable: true,
  115. configurable: true
  116. }
  117. });
  118. if (superClass) {
  119. _setPrototypeOf(subClass, superClass);
  120. }
  121. }
  122. function _setPrototypeOf(o, p) {
  123. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  124. o.__proto__ = p;
  125. return o;
  126. };
  127. return _setPrototypeOf(o, p);
  128. }
  129. function _createSuper(Derived) {
  130. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  131. return function _createSuperInternal() {
  132. var Super = _getPrototypeOf(Derived), result;
  133. if (hasNativeReflectConstruct) {
  134. var NewTarget = _getPrototypeOf(this).constructor;
  135. result = Reflect.construct(Super, arguments, NewTarget);
  136. } else {
  137. result = Super.apply(this, arguments);
  138. }
  139. return _possibleConstructorReturn(this, result);
  140. };
  141. }
  142. function _possibleConstructorReturn(self, call) {
  143. if (call && (_typeof(call) === 'object' || typeof call === 'function')) {
  144. return call;
  145. }
  146. return _assertThisInitialized(self);
  147. }
  148. function _assertThisInitialized(self) {
  149. if (self === void 0) {
  150. throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');
  151. }
  152. return self;
  153. }
  154. function _isNativeReflectConstruct() {
  155. if (typeof Reflect === 'undefined' || !Reflect.construct) {
  156. return false;
  157. }
  158. if (Reflect.construct.sham) {
  159. return false;
  160. }
  161. if (typeof Proxy === 'function') {
  162. return true;
  163. }
  164. try {
  165. Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
  166. return true;
  167. } catch (e) {
  168. return false;
  169. }
  170. }
  171. function _getPrototypeOf(o) {
  172. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  173. return o.__proto__ || Object.getPrototypeOf(o);
  174. };
  175. return _getPrototypeOf(o);
  176. }
  177. function _toConsumableArray(arr) {
  178. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  179. }
  180. function _nonIterableSpread() {
  181. throw new TypeError('Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  182. }
  183. function _iterableToArray(iter) {
  184. if (typeof Symbol !== 'undefined' && Symbol.iterator in Object(iter)) {
  185. return Array.from(iter);
  186. }
  187. }
  188. function _arrayWithoutHoles(arr) {
  189. if (Array.isArray(arr)) {
  190. return _arrayLikeToArray(arr);
  191. }
  192. }
  193. function _extends() {
  194. _extends = Object.assign || function(target) {
  195. for (var i = 1; i < arguments.length; i++) {
  196. var source = arguments[i];
  197. for (var key in source) {
  198. if (Object.prototype.hasOwnProperty.call(source, key)) {
  199. target[key] = source[key];
  200. }
  201. }
  202. }
  203. return target;
  204. };
  205. return _extends.apply(this, arguments);
  206. }
  207. function _slicedToArray(arr, i) {
  208. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  209. }
  210. function _nonIterableRest() {
  211. throw new TypeError('Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  212. }
  213. function _iterableToArrayLimit(arr, i) {
  214. if (typeof Symbol === 'undefined' || !(Symbol.iterator in Object(arr))) {
  215. return;
  216. }
  217. var _arr = [];
  218. var _n = true;
  219. var _d = false;
  220. var _e = undefined;
  221. try {
  222. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  223. _arr.push(_s.value);
  224. if (i && _arr.length === i) {
  225. break;
  226. }
  227. }
  228. } catch (err) {
  229. _d = true;
  230. _e = err;
  231. } finally {
  232. try {
  233. if (!_n && _i['return'] != null) {
  234. _i['return']();
  235. }
  236. } finally {
  237. if (_d) {
  238. throw _e;
  239. }
  240. }
  241. }
  242. return _arr;
  243. }
  244. function _arrayWithHoles(arr) {
  245. if (Array.isArray(arr)) {
  246. return arr;
  247. }
  248. }
  249. function _classCallCheck(instance, Constructor) {
  250. if (!(instance instanceof Constructor)) {
  251. throw new TypeError('Cannot call a class as a function');
  252. }
  253. }
  254. function _defineProperties(target, props) {
  255. for (var i = 0; i < props.length; i++) {
  256. var descriptor = props[i];
  257. descriptor.enumerable = descriptor.enumerable || false;
  258. descriptor.configurable = true;
  259. if ('value' in descriptor) {
  260. descriptor.writable = true;
  261. }
  262. Object.defineProperty(target, descriptor.key, descriptor);
  263. }
  264. }
  265. function _createClass(Constructor, protoProps, staticProps) {
  266. if (protoProps) {
  267. _defineProperties(Constructor.prototype, protoProps);
  268. }
  269. if (staticProps) {
  270. _defineProperties(Constructor, staticProps);
  271. }
  272. return Constructor;
  273. }
  274. function _createForOfIteratorHelper(o, allowArrayLike) {
  275. var it;
  276. if (typeof Symbol === 'undefined' || o[Symbol.iterator] == null) {
  277. if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === 'number') {
  278. if (it) {
  279. o = it;
  280. }
  281. var i = 0;
  282. var F = function F() {};
  283. return {
  284. s: F,
  285. n: function n() {
  286. if (i >= o.length) {
  287. return {
  288. done: true
  289. };
  290. }
  291. return {
  292. done: false,
  293. value: o[i++]
  294. };
  295. },
  296. e: function e(_e2) {
  297. throw _e2;
  298. },
  299. f: F
  300. };
  301. }
  302. throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
  303. }
  304. var normalCompletion = true, didErr = false, err;
  305. return {
  306. s: function s() {
  307. it = o[Symbol.iterator]();
  308. },
  309. n: function n() {
  310. var step = it.next();
  311. normalCompletion = step.done;
  312. return step;
  313. },
  314. e: function e(_e3) {
  315. didErr = true;
  316. err = _e3;
  317. },
  318. f: function f() {
  319. try {
  320. if (!normalCompletion && it['return'] != null) {
  321. it['return']();
  322. }
  323. } finally {
  324. if (didErr) {
  325. throw err;
  326. }
  327. }
  328. }
  329. };
  330. }
  331. function _unsupportedIterableToArray(o, minLen) {
  332. if (!o) {
  333. return;
  334. }
  335. if (typeof o === 'string') {
  336. return _arrayLikeToArray(o, minLen);
  337. }
  338. var n = Object.prototype.toString.call(o).slice(8, -1);
  339. if (n === 'Object' && o.constructor) {
  340. n = o.constructor.name;
  341. }
  342. if (n === 'Map' || n === 'Set') {
  343. return Array.from(o);
  344. }
  345. if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
  346. return _arrayLikeToArray(o, minLen);
  347. }
  348. }
  349. function _arrayLikeToArray(arr, len) {
  350. if (len == null || len > arr.length) {
  351. len = arr.length;
  352. }
  353. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  354. arr2[i] = arr[i];
  355. }
  356. return arr2;
  357. }
  358. function _typeof(obj) {
  359. '@babel/helpers - typeof';
  360. if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
  361. _typeof = function _typeof(obj) {
  362. return typeof obj;
  363. };
  364. } else {
  365. _typeof = function _typeof(obj) {
  366. return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype ? 'symbol' : typeof obj;
  367. };
  368. }
  369. return _typeof(obj);
  370. }
  371. (function() {
  372. var __create = Object.create;
  373. var __defProp = Object.defineProperty;
  374. var __getProtoOf = Object.getPrototypeOf;
  375. var __hasOwnProp = Object.prototype.hasOwnProperty;
  376. var __getOwnPropNames = Object.getOwnPropertyNames;
  377. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  378. var __markAsModule = function __markAsModule(target) {
  379. return __defProp(target, '__esModule', {
  380. value: true
  381. });
  382. };
  383. var __commonJS = function __commonJS(callback, module) {
  384. return function() {
  385. if (!module) {
  386. module = {
  387. exports: {}
  388. };
  389. callback(module.exports, module);
  390. }
  391. return module.exports;
  392. };
  393. };
  394. var __export = function __export(target, all) {
  395. __markAsModule(target);
  396. for (var name in all) {
  397. __defProp(target, name, {
  398. get: all[name],
  399. enumerable: true
  400. });
  401. }
  402. };
  403. var __exportStar = function __exportStar(target, module) {
  404. __markAsModule(target);
  405. if (_typeof(module) === 'object' || typeof module === 'function') {
  406. var _iterator = _createForOfIteratorHelper(__getOwnPropNames(module)), _step;
  407. try {
  408. var _loop = function _loop() {
  409. var key = _step.value;
  410. if (!__hasOwnProp.call(target, key) && key !== 'default') {
  411. __defProp(target, key, {
  412. get: function get() {
  413. return module[key];
  414. },
  415. enumerable: __getOwnPropDesc(module, key).enumerable
  416. });
  417. }
  418. };
  419. for (_iterator.s(); !(_step = _iterator.n()).done; ) {
  420. _loop();
  421. }
  422. } catch (err) {
  423. _iterator.e(err);
  424. } finally {
  425. _iterator.f();
  426. }
  427. }
  428. return target;
  429. };
  430. var __toModule = function __toModule(module) {
  431. if (module && module.__esModule) {
  432. return module;
  433. }
  434. return __exportStar(__defProp(__create(__getProtoOf(module)), 'default', {
  435. value: module,
  436. enumerable: true
  437. }), module);
  438. };
  439. var require_utils = __commonJS(function(exports) {
  440. 'use strict';
  441. Object.defineProperty(exports, '__esModule', {
  442. value: true
  443. });
  444. function isIdentStart(c) {
  445. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c === '-' || c === '_';
  446. }
  447. exports.isIdentStart = isIdentStart;
  448. function isIdent(c) {
  449. return c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || c === '-' || c === '_';
  450. }
  451. exports.isIdent = isIdent;
  452. function isHex(c) {
  453. return c >= 'a' && c <= 'f' || c >= 'A' && c <= 'F' || c >= '0' && c <= '9';
  454. }
  455. exports.isHex = isHex;
  456. function escapeIdentifier(s) {
  457. var len = s.length;
  458. var result = '';
  459. var i = 0;
  460. while (i < len) {
  461. var chr = s.charAt(i);
  462. if (exports.identSpecialChars[chr]) {
  463. result += '\\' + chr;
  464. } else {
  465. if (!(chr === '_' || chr === '-' || chr >= 'A' && chr <= 'Z' || chr >= 'a' && chr <= 'z' || i !== 0 && chr >= '0' && chr <= '9')) {
  466. var charCode = chr.charCodeAt(0);
  467. if ((charCode & 63488) === 55296) {
  468. var extraCharCode = s.charCodeAt(i++);
  469. if ((charCode & 64512) !== 55296 || (extraCharCode & 64512) !== 56320) {
  470. throw Error('UCS-2(decode): illegal sequence');
  471. }
  472. charCode = ((charCode & 1023) << 10) + (extraCharCode & 1023) + 65536;
  473. }
  474. result += '\\' + charCode.toString(16) + ' ';
  475. } else {
  476. result += chr;
  477. }
  478. }
  479. i++;
  480. }
  481. return result;
  482. }
  483. exports.escapeIdentifier = escapeIdentifier;
  484. function escapeStr(s) {
  485. var len = s.length;
  486. var result = '';
  487. var i = 0;
  488. var replacement;
  489. while (i < len) {
  490. var chr = s.charAt(i);
  491. if (chr === '"') {
  492. chr = '\\"';
  493. } else if (chr === '\\') {
  494. chr = '\\\\';
  495. } else if ((replacement = exports.strReplacementsRev[chr]) !== void 0) {
  496. chr = replacement;
  497. }
  498. result += chr;
  499. i++;
  500. }
  501. return '"' + result + '"';
  502. }
  503. exports.escapeStr = escapeStr;
  504. exports.identSpecialChars = {
  505. '!': true,
  506. '"': true,
  507. '#': true,
  508. $: true,
  509. '%': true,
  510. '&': true,
  511. '\'': true,
  512. '(': true,
  513. ')': true,
  514. '*': true,
  515. '+': true,
  516. ',': true,
  517. '.': true,
  518. '/': true,
  519. ';': true,
  520. '<': true,
  521. '=': true,
  522. '>': true,
  523. '?': true,
  524. '@': true,
  525. '[': true,
  526. '\\': true,
  527. ']': true,
  528. '^': true,
  529. '`': true,
  530. '{': true,
  531. '|': true,
  532. '}': true,
  533. '~': true
  534. };
  535. exports.strReplacementsRev = {
  536. '\n': '\\n',
  537. '\r': '\\r',
  538. '\t': '\\t',
  539. '\f': '\\f',
  540. '\v': '\\v'
  541. };
  542. exports.singleQuoteEscapeChars = {
  543. n: '\n',
  544. r: '\r',
  545. t: '\t',
  546. f: '\f',
  547. '\\': '\\',
  548. '\'': '\''
  549. };
  550. exports.doubleQuotesEscapeChars = {
  551. n: '\n',
  552. r: '\r',
  553. t: '\t',
  554. f: '\f',
  555. '\\': '\\',
  556. '"': '"'
  557. };
  558. });
  559. var require_parser_context = __commonJS(function(exports) {
  560. 'use strict';
  561. Object.defineProperty(exports, '__esModule', {
  562. value: true
  563. });
  564. var utils_1 = require_utils();
  565. function parseCssSelector(str, pos, pseudos, attrEqualityMods, ruleNestingOperators, substitutesEnabled) {
  566. var l = str.length;
  567. var chr = '';
  568. function getStr(quote, escapeTable) {
  569. var result = '';
  570. pos++;
  571. chr = str.charAt(pos);
  572. while (pos < l) {
  573. if (chr === quote) {
  574. pos++;
  575. return result;
  576. } else if (chr === '\\') {
  577. pos++;
  578. chr = str.charAt(pos);
  579. var esc = void 0;
  580. if (chr === quote) {
  581. result += quote;
  582. } else if ((esc = escapeTable[chr]) !== void 0) {
  583. result += esc;
  584. } else if (utils_1.isHex(chr)) {
  585. var hex = chr;
  586. pos++;
  587. chr = str.charAt(pos);
  588. while (utils_1.isHex(chr)) {
  589. hex += chr;
  590. pos++;
  591. chr = str.charAt(pos);
  592. }
  593. if (chr === ' ') {
  594. pos++;
  595. chr = str.charAt(pos);
  596. }
  597. result += String.fromCharCode(parseInt(hex, 16));
  598. continue;
  599. } else {
  600. result += chr;
  601. }
  602. } else {
  603. result += chr;
  604. }
  605. pos++;
  606. chr = str.charAt(pos);
  607. }
  608. return result;
  609. }
  610. function getIdent() {
  611. var result = '';
  612. chr = str.charAt(pos);
  613. while (pos < l) {
  614. if (utils_1.isIdent(chr)) {
  615. result += chr;
  616. } else if (chr === '\\') {
  617. pos++;
  618. if (pos >= l) {
  619. throw Error('Expected symbol but end of file reached.');
  620. }
  621. chr = str.charAt(pos);
  622. if (utils_1.identSpecialChars[chr]) {
  623. result += chr;
  624. } else if (utils_1.isHex(chr)) {
  625. var hex = chr;
  626. pos++;
  627. chr = str.charAt(pos);
  628. while (utils_1.isHex(chr)) {
  629. hex += chr;
  630. pos++;
  631. chr = str.charAt(pos);
  632. }
  633. if (chr === ' ') {
  634. pos++;
  635. chr = str.charAt(pos);
  636. }
  637. result += String.fromCharCode(parseInt(hex, 16));
  638. continue;
  639. } else {
  640. result += chr;
  641. }
  642. } else {
  643. return result;
  644. }
  645. pos++;
  646. chr = str.charAt(pos);
  647. }
  648. return result;
  649. }
  650. function skipWhitespace() {
  651. chr = str.charAt(pos);
  652. var result = false;
  653. while (chr === ' ' || chr === '\t' || chr === '\n' || chr === '\r' || chr === '\f') {
  654. result = true;
  655. pos++;
  656. chr = str.charAt(pos);
  657. }
  658. return result;
  659. }
  660. function parse2() {
  661. var res = parseSelector();
  662. if (pos < l) {
  663. throw Error('Rule expected but "' + str.charAt(pos) + '" found.');
  664. }
  665. return res;
  666. }
  667. function parseSelector() {
  668. var selector = parseSingleSelector();
  669. if (!selector) {
  670. return null;
  671. }
  672. var res = selector;
  673. chr = str.charAt(pos);
  674. while (chr === ',') {
  675. pos++;
  676. skipWhitespace();
  677. if (res.type !== 'selectors') {
  678. res = {
  679. type: 'selectors',
  680. selectors: [ selector ]
  681. };
  682. }
  683. selector = parseSingleSelector();
  684. if (!selector) {
  685. throw Error('Rule expected after ",".');
  686. }
  687. res.selectors.push(selector);
  688. }
  689. return res;
  690. }
  691. function parseSingleSelector() {
  692. skipWhitespace();
  693. var selector = {
  694. type: 'ruleSet'
  695. };
  696. var rule3 = parseRule();
  697. if (!rule3) {
  698. return null;
  699. }
  700. var currentRule = selector;
  701. while (rule3) {
  702. rule3.type = 'rule';
  703. currentRule.rule = rule3;
  704. currentRule = rule3;
  705. skipWhitespace();
  706. chr = str.charAt(pos);
  707. if (pos >= l || chr === ',' || chr === ')') {
  708. break;
  709. }
  710. if (ruleNestingOperators[chr]) {
  711. var op = chr;
  712. pos++;
  713. skipWhitespace();
  714. rule3 = parseRule();
  715. if (!rule3) {
  716. throw Error('Rule expected after "' + op + '".');
  717. }
  718. rule3.nestingOperator = op;
  719. } else {
  720. rule3 = parseRule();
  721. if (rule3) {
  722. rule3.nestingOperator = null;
  723. }
  724. }
  725. }
  726. return selector;
  727. }
  728. function parseRule() {
  729. var rule3 = null;
  730. while (pos < l) {
  731. chr = str.charAt(pos);
  732. if (chr === '*') {
  733. pos++;
  734. (rule3 = rule3 || {}).tagName = '*';
  735. } else if (utils_1.isIdentStart(chr) || chr === '\\') {
  736. (rule3 = rule3 || {}).tagName = getIdent();
  737. } else if (chr === '.') {
  738. pos++;
  739. rule3 = rule3 || {};
  740. (rule3.classNames = rule3.classNames || []).push(getIdent());
  741. } else if (chr === '#') {
  742. pos++;
  743. (rule3 = rule3 || {}).id = getIdent();
  744. } else if (chr === '[') {
  745. pos++;
  746. skipWhitespace();
  747. var attr = {
  748. name: getIdent()
  749. };
  750. skipWhitespace();
  751. if (chr === ']') {
  752. pos++;
  753. } else {
  754. var operator = '';
  755. if (attrEqualityMods[chr]) {
  756. operator = chr;
  757. pos++;
  758. chr = str.charAt(pos);
  759. }
  760. if (pos >= l) {
  761. throw Error('Expected "=" but end of file reached.');
  762. }
  763. if (chr !== '=') {
  764. throw Error('Expected "=" but "' + chr + '" found.');
  765. }
  766. attr.operator = operator + '=';
  767. pos++;
  768. skipWhitespace();
  769. var attrValue = '';
  770. attr.valueType = 'string';
  771. if (chr === '"') {
  772. attrValue = getStr('"', utils_1.doubleQuotesEscapeChars);
  773. } else if (chr === '\'') {
  774. attrValue = getStr('\'', utils_1.singleQuoteEscapeChars);
  775. } else if (substitutesEnabled && chr === '$') {
  776. pos++;
  777. attrValue = getIdent();
  778. attr.valueType = 'substitute';
  779. } else {
  780. while (pos < l) {
  781. if (chr === ']') {
  782. break;
  783. }
  784. attrValue += chr;
  785. pos++;
  786. chr = str.charAt(pos);
  787. }
  788. attrValue = attrValue.trim();
  789. }
  790. skipWhitespace();
  791. if (pos >= l) {
  792. throw Error('Expected "]" but end of file reached.');
  793. }
  794. if (chr !== ']') {
  795. throw Error('Expected "]" but "' + chr + '" found.');
  796. }
  797. pos++;
  798. attr.value = attrValue;
  799. }
  800. rule3 = rule3 || {};
  801. (rule3.attrs = rule3.attrs || []).push(attr);
  802. } else if (chr === ':') {
  803. pos++;
  804. var pseudoName = getIdent();
  805. var pseudo = {
  806. name: pseudoName
  807. };
  808. if (chr === '(') {
  809. pos++;
  810. var value = '';
  811. skipWhitespace();
  812. if (pseudos[pseudoName] === 'selector') {
  813. pseudo.valueType = 'selector';
  814. value = parseSelector();
  815. } else {
  816. pseudo.valueType = pseudos[pseudoName] || 'string';
  817. if (chr === '"') {
  818. value = getStr('"', utils_1.doubleQuotesEscapeChars);
  819. } else if (chr === '\'') {
  820. value = getStr('\'', utils_1.singleQuoteEscapeChars);
  821. } else if (substitutesEnabled && chr === '$') {
  822. pos++;
  823. value = getIdent();
  824. pseudo.valueType = 'substitute';
  825. } else {
  826. while (pos < l) {
  827. if (chr === ')') {
  828. break;
  829. }
  830. value += chr;
  831. pos++;
  832. chr = str.charAt(pos);
  833. }
  834. value = value.trim();
  835. }
  836. skipWhitespace();
  837. }
  838. if (pos >= l) {
  839. throw Error('Expected ")" but end of file reached.');
  840. }
  841. if (chr !== ')') {
  842. throw Error('Expected ")" but "' + chr + '" found.');
  843. }
  844. pos++;
  845. pseudo.value = value;
  846. }
  847. rule3 = rule3 || {};
  848. (rule3.pseudos = rule3.pseudos || []).push(pseudo);
  849. } else {
  850. break;
  851. }
  852. }
  853. return rule3;
  854. }
  855. return parse2();
  856. }
  857. exports.parseCssSelector = parseCssSelector;
  858. });
  859. var require_render = __commonJS(function(exports) {
  860. 'use strict';
  861. Object.defineProperty(exports, '__esModule', {
  862. value: true
  863. });
  864. var utils_1 = require_utils();
  865. function renderEntity(entity) {
  866. var res = '';
  867. switch (entity.type) {
  868. case 'ruleSet':
  869. var currentEntity = entity.rule;
  870. var parts = [];
  871. while (currentEntity) {
  872. if (currentEntity.nestingOperator) {
  873. parts.push(currentEntity.nestingOperator);
  874. }
  875. parts.push(renderEntity(currentEntity));
  876. currentEntity = currentEntity.rule;
  877. }
  878. res = parts.join(' ');
  879. break;
  880. case 'selectors':
  881. res = entity.selectors.map(renderEntity).join(', ');
  882. break;
  883. case 'rule':
  884. if (entity.tagName) {
  885. if (entity.tagName === '*') {
  886. res = '*';
  887. } else {
  888. res = utils_1.escapeIdentifier(entity.tagName);
  889. }
  890. }
  891. if (entity.id) {
  892. res += '#' + utils_1.escapeIdentifier(entity.id);
  893. }
  894. if (entity.classNames) {
  895. res += entity.classNames.map(function(cn) {
  896. return '.' + utils_1.escapeIdentifier(cn);
  897. }).join('');
  898. }
  899. if (entity.attrs) {
  900. res += entity.attrs.map(function(attr) {
  901. if ('operator' in attr) {
  902. if (attr.valueType === 'substitute') {
  903. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + '$' + attr.value + ']';
  904. } else {
  905. return '[' + utils_1.escapeIdentifier(attr.name) + attr.operator + utils_1.escapeStr(attr.value) + ']';
  906. }
  907. } else {
  908. return '[' + utils_1.escapeIdentifier(attr.name) + ']';
  909. }
  910. }).join('');
  911. }
  912. if (entity.pseudos) {
  913. res += entity.pseudos.map(function(pseudo) {
  914. if (pseudo.valueType) {
  915. if (pseudo.valueType === 'selector') {
  916. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + renderEntity(pseudo.value) + ')';
  917. } else if (pseudo.valueType === 'substitute') {
  918. return ':' + utils_1.escapeIdentifier(pseudo.name) + '($' + pseudo.value + ')';
  919. } else if (pseudo.valueType === 'numeric') {
  920. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + pseudo.value + ')';
  921. } else {
  922. return ':' + utils_1.escapeIdentifier(pseudo.name) + '(' + utils_1.escapeIdentifier(pseudo.value) + ')';
  923. }
  924. } else {
  925. return ':' + utils_1.escapeIdentifier(pseudo.name);
  926. }
  927. }).join('');
  928. }
  929. break;
  930. default:
  931. throw Error('Unknown entity type: "' + entity.type + '".');
  932. }
  933. return res;
  934. }
  935. exports.renderEntity = renderEntity;
  936. });
  937. var require_lib = __commonJS(function(exports) {
  938. 'use strict';
  939. Object.defineProperty(exports, '__esModule', {
  940. value: true
  941. });
  942. var parser_context_1 = require_parser_context();
  943. var render_1 = require_render();
  944. var CssSelectorParser3 = function() {
  945. function CssSelectorParser4() {
  946. this.pseudos = {};
  947. this.attrEqualityMods = {};
  948. this.ruleNestingOperators = {};
  949. this.substitutesEnabled = false;
  950. }
  951. CssSelectorParser4.prototype.registerSelectorPseudos = function() {
  952. var pseudos = [];
  953. for (var _i = 0; _i < arguments.length; _i++) {
  954. pseudos[_i] = arguments[_i];
  955. }
  956. for (var _a = 0, pseudos_1 = pseudos; _a < pseudos_1.length; _a++) {
  957. var pseudo = pseudos_1[_a];
  958. this.pseudos[pseudo] = 'selector';
  959. }
  960. return this;
  961. };
  962. CssSelectorParser4.prototype.unregisterSelectorPseudos = function() {
  963. var pseudos = [];
  964. for (var _i = 0; _i < arguments.length; _i++) {
  965. pseudos[_i] = arguments[_i];
  966. }
  967. for (var _a = 0, pseudos_2 = pseudos; _a < pseudos_2.length; _a++) {
  968. var pseudo = pseudos_2[_a];
  969. delete this.pseudos[pseudo];
  970. }
  971. return this;
  972. };
  973. CssSelectorParser4.prototype.registerNumericPseudos = function() {
  974. var pseudos = [];
  975. for (var _i = 0; _i < arguments.length; _i++) {
  976. pseudos[_i] = arguments[_i];
  977. }
  978. for (var _a = 0, pseudos_3 = pseudos; _a < pseudos_3.length; _a++) {
  979. var pseudo = pseudos_3[_a];
  980. this.pseudos[pseudo] = 'numeric';
  981. }
  982. return this;
  983. };
  984. CssSelectorParser4.prototype.unregisterNumericPseudos = function() {
  985. var pseudos = [];
  986. for (var _i = 0; _i < arguments.length; _i++) {
  987. pseudos[_i] = arguments[_i];
  988. }
  989. for (var _a = 0, pseudos_4 = pseudos; _a < pseudos_4.length; _a++) {
  990. var pseudo = pseudos_4[_a];
  991. delete this.pseudos[pseudo];
  992. }
  993. return this;
  994. };
  995. CssSelectorParser4.prototype.registerNestingOperators = function() {
  996. var operators = [];
  997. for (var _i = 0; _i < arguments.length; _i++) {
  998. operators[_i] = arguments[_i];
  999. }
  1000. for (var _a = 0, operators_1 = operators; _a < operators_1.length; _a++) {
  1001. var operator = operators_1[_a];
  1002. this.ruleNestingOperators[operator] = true;
  1003. }
  1004. return this;
  1005. };
  1006. CssSelectorParser4.prototype.unregisterNestingOperators = function() {
  1007. var operators = [];
  1008. for (var _i = 0; _i < arguments.length; _i++) {
  1009. operators[_i] = arguments[_i];
  1010. }
  1011. for (var _a = 0, operators_2 = operators; _a < operators_2.length; _a++) {
  1012. var operator = operators_2[_a];
  1013. delete this.ruleNestingOperators[operator];
  1014. }
  1015. return this;
  1016. };
  1017. CssSelectorParser4.prototype.registerAttrEqualityMods = function() {
  1018. var mods = [];
  1019. for (var _i = 0; _i < arguments.length; _i++) {
  1020. mods[_i] = arguments[_i];
  1021. }
  1022. for (var _a = 0, mods_1 = mods; _a < mods_1.length; _a++) {
  1023. var mod = mods_1[_a];
  1024. this.attrEqualityMods[mod] = true;
  1025. }
  1026. return this;
  1027. };
  1028. CssSelectorParser4.prototype.unregisterAttrEqualityMods = function() {
  1029. var mods = [];
  1030. for (var _i = 0; _i < arguments.length; _i++) {
  1031. mods[_i] = arguments[_i];
  1032. }
  1033. for (var _a = 0, mods_2 = mods; _a < mods_2.length; _a++) {
  1034. var mod = mods_2[_a];
  1035. delete this.attrEqualityMods[mod];
  1036. }
  1037. return this;
  1038. };
  1039. CssSelectorParser4.prototype.enableSubstitutes = function() {
  1040. this.substitutesEnabled = true;
  1041. return this;
  1042. };
  1043. CssSelectorParser4.prototype.disableSubstitutes = function() {
  1044. this.substitutesEnabled = false;
  1045. return this;
  1046. };
  1047. CssSelectorParser4.prototype.parse = function(str) {
  1048. return parser_context_1.parseCssSelector(str, 0, this.pseudos, this.attrEqualityMods, this.ruleNestingOperators, this.substitutesEnabled);
  1049. };
  1050. CssSelectorParser4.prototype.render = function(path) {
  1051. return render_1.renderEntity(path).trim();
  1052. };
  1053. return CssSelectorParser4;
  1054. }();
  1055. exports.CssSelectorParser = CssSelectorParser3;
  1056. });
  1057. var require_noop = __commonJS(function(exports, module) {
  1058. 'use strict';
  1059. module.exports = function() {};
  1060. });
  1061. var require_is_value = __commonJS(function(exports, module) {
  1062. 'use strict';
  1063. var _undefined = require_noop()();
  1064. module.exports = function(val) {
  1065. return val !== _undefined && val !== null;
  1066. };
  1067. });
  1068. var require_normalize_options = __commonJS(function(exports, module) {
  1069. 'use strict';
  1070. var isValue = require_is_value();
  1071. var forEach = Array.prototype.forEach;
  1072. var create = Object.create;
  1073. var process2 = function process2(src, obj) {
  1074. var key;
  1075. for (key in src) {
  1076. obj[key] = src[key];
  1077. }
  1078. };
  1079. module.exports = function(opts1) {
  1080. var result = create(null);
  1081. forEach.call(arguments, function(options) {
  1082. if (!isValue(options)) {
  1083. return;
  1084. }
  1085. process2(Object(options), result);
  1086. });
  1087. return result;
  1088. };
  1089. });
  1090. var require_is_implemented = __commonJS(function(exports, module) {
  1091. 'use strict';
  1092. module.exports = function() {
  1093. var sign = Math.sign;
  1094. if (typeof sign !== 'function') {
  1095. return false;
  1096. }
  1097. return sign(10) === 1 && sign(-20) === -1;
  1098. };
  1099. });
  1100. var require_shim = __commonJS(function(exports, module) {
  1101. 'use strict';
  1102. module.exports = function(value) {
  1103. value = Number(value);
  1104. if (isNaN(value) || value === 0) {
  1105. return value;
  1106. }
  1107. return value > 0 ? 1 : -1;
  1108. };
  1109. });
  1110. var require_sign = __commonJS(function(exports, module) {
  1111. 'use strict';
  1112. module.exports = require_is_implemented()() ? Math.sign : require_shim();
  1113. });
  1114. var require_to_integer = __commonJS(function(exports, module) {
  1115. 'use strict';
  1116. var sign = require_sign();
  1117. var abs = Math.abs;
  1118. var floor = Math.floor;
  1119. module.exports = function(value) {
  1120. if (isNaN(value)) {
  1121. return 0;
  1122. }
  1123. value = Number(value);
  1124. if (value === 0 || !isFinite(value)) {
  1125. return value;
  1126. }
  1127. return sign(value) * floor(abs(value));
  1128. };
  1129. });
  1130. var require_to_pos_integer = __commonJS(function(exports, module) {
  1131. 'use strict';
  1132. var toInteger = require_to_integer();
  1133. var max = Math.max;
  1134. module.exports = function(value) {
  1135. return max(0, toInteger(value));
  1136. };
  1137. });
  1138. var require_resolve_length = __commonJS(function(exports, module) {
  1139. 'use strict';
  1140. var toPosInt = require_to_pos_integer();
  1141. module.exports = function(optsLength, fnLength, isAsync) {
  1142. var length;
  1143. if (isNaN(optsLength)) {
  1144. length = fnLength;
  1145. if (!(length >= 0)) {
  1146. return 1;
  1147. }
  1148. if (isAsync && length) {
  1149. return length - 1;
  1150. }
  1151. return length;
  1152. }
  1153. if (optsLength === false) {
  1154. return false;
  1155. }
  1156. return toPosInt(optsLength);
  1157. };
  1158. });
  1159. var require_valid_callable = __commonJS(function(exports, module) {
  1160. 'use strict';
  1161. module.exports = function(fn) {
  1162. if (typeof fn !== 'function') {
  1163. throw new TypeError(fn + ' is not a function');
  1164. }
  1165. return fn;
  1166. };
  1167. });
  1168. var require_valid_value = __commonJS(function(exports, module) {
  1169. 'use strict';
  1170. var isValue = require_is_value();
  1171. module.exports = function(value) {
  1172. if (!isValue(value)) {
  1173. throw new TypeError('Cannot use null or undefined');
  1174. }
  1175. return value;
  1176. };
  1177. });
  1178. var require_iterate = __commonJS(function(exports, module) {
  1179. 'use strict';
  1180. var callable = require_valid_callable();
  1181. var value = require_valid_value();
  1182. var bind = Function.prototype.bind;
  1183. var call = Function.prototype.call;
  1184. var keys = Object.keys;
  1185. var objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  1186. module.exports = function(method, defVal) {
  1187. return function(obj, cb) {
  1188. var list, thisArg = arguments[2], compareFn = arguments[3];
  1189. obj = Object(value(obj));
  1190. callable(cb);
  1191. list = keys(obj);
  1192. if (compareFn) {
  1193. list.sort(typeof compareFn === 'function' ? bind.call(compareFn, obj) : void 0);
  1194. }
  1195. if (typeof method !== 'function') {
  1196. method = list[method];
  1197. }
  1198. return call.call(method, list, function(key, index) {
  1199. if (!objPropertyIsEnumerable.call(obj, key)) {
  1200. return defVal;
  1201. }
  1202. return call.call(cb, thisArg, obj[key], key, obj, index);
  1203. });
  1204. };
  1205. };
  1206. });
  1207. var require_for_each = __commonJS(function(exports, module) {
  1208. 'use strict';
  1209. module.exports = require_iterate()('forEach');
  1210. });
  1211. var require_registered_extensions = __commonJS(function() {
  1212. 'use strict';
  1213. });
  1214. var require_is_implemented2 = __commonJS(function(exports, module) {
  1215. 'use strict';
  1216. module.exports = function() {
  1217. var assign = Object.assign, obj;
  1218. if (typeof assign !== 'function') {
  1219. return false;
  1220. }
  1221. obj = {
  1222. foo: 'raz'
  1223. };
  1224. assign(obj, {
  1225. bar: 'dwa'
  1226. }, {
  1227. trzy: 'trzy'
  1228. });
  1229. return obj.foo + obj.bar + obj.trzy === 'razdwatrzy';
  1230. };
  1231. });
  1232. var require_is_implemented3 = __commonJS(function(exports, module) {
  1233. 'use strict';
  1234. module.exports = function() {
  1235. try {
  1236. Object.keys('primitive');
  1237. return true;
  1238. } catch (e) {
  1239. return false;
  1240. }
  1241. };
  1242. });
  1243. var require_shim2 = __commonJS(function(exports, module) {
  1244. 'use strict';
  1245. var isValue = require_is_value();
  1246. var keys = Object.keys;
  1247. module.exports = function(object) {
  1248. return keys(isValue(object) ? Object(object) : object);
  1249. };
  1250. });
  1251. var require_keys = __commonJS(function(exports, module) {
  1252. 'use strict';
  1253. module.exports = require_is_implemented3()() ? Object.keys : require_shim2();
  1254. });
  1255. var require_shim3 = __commonJS(function(exports, module) {
  1256. 'use strict';
  1257. var keys = require_keys();
  1258. var value = require_valid_value();
  1259. var max = Math.max;
  1260. module.exports = function(dest, src) {
  1261. var error, i, length = max(arguments.length, 2), assign;
  1262. dest = Object(value(dest));
  1263. assign = function assign(key) {
  1264. try {
  1265. dest[key] = src[key];
  1266. } catch (e) {
  1267. if (!error) {
  1268. error = e;
  1269. }
  1270. }
  1271. };
  1272. for (i = 1; i < length; ++i) {
  1273. src = arguments[i];
  1274. keys(src).forEach(assign);
  1275. }
  1276. if (error !== void 0) {
  1277. throw error;
  1278. }
  1279. return dest;
  1280. };
  1281. });
  1282. var require_assign = __commonJS(function(exports, module) {
  1283. 'use strict';
  1284. module.exports = require_is_implemented2()() ? Object.assign : require_shim3();
  1285. });
  1286. var require_is_object = __commonJS(function(exports, module) {
  1287. 'use strict';
  1288. var isValue = require_is_value();
  1289. var map = {
  1290. function: true,
  1291. object: true
  1292. };
  1293. module.exports = function(value) {
  1294. return isValue(value) && map[_typeof(value)] || false;
  1295. };
  1296. });
  1297. var require_custom = __commonJS(function(exports, module) {
  1298. 'use strict';
  1299. var assign = require_assign();
  1300. var isObject = require_is_object();
  1301. var isValue = require_is_value();
  1302. var captureStackTrace = Error.captureStackTrace;
  1303. module.exports = function(message) {
  1304. var err2 = new Error(message), code = arguments[1], ext = arguments[2];
  1305. if (!isValue(ext)) {
  1306. if (isObject(code)) {
  1307. ext = code;
  1308. code = null;
  1309. }
  1310. }
  1311. if (isValue(ext)) {
  1312. assign(err2, ext);
  1313. }
  1314. if (isValue(code)) {
  1315. err2.code = code;
  1316. }
  1317. if (captureStackTrace) {
  1318. captureStackTrace(err2, module.exports);
  1319. }
  1320. return err2;
  1321. };
  1322. });
  1323. var require_mixin = __commonJS(function(exports, module) {
  1324. 'use strict';
  1325. var value = require_valid_value();
  1326. var defineProperty = Object.defineProperty;
  1327. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  1328. var getOwnPropertyNames = Object.getOwnPropertyNames;
  1329. var getOwnPropertySymbols = Object.getOwnPropertySymbols;
  1330. module.exports = function(target, source) {
  1331. var error, sourceObject = Object(value(source));
  1332. target = Object(value(target));
  1333. getOwnPropertyNames(sourceObject).forEach(function(name) {
  1334. try {
  1335. defineProperty(target, name, getOwnPropertyDescriptor(source, name));
  1336. } catch (e) {
  1337. error = e;
  1338. }
  1339. });
  1340. if (typeof getOwnPropertySymbols === 'function') {
  1341. getOwnPropertySymbols(sourceObject).forEach(function(symbol) {
  1342. try {
  1343. defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol));
  1344. } catch (e) {
  1345. error = e;
  1346. }
  1347. });
  1348. }
  1349. if (error !== void 0) {
  1350. throw error;
  1351. }
  1352. return target;
  1353. };
  1354. });
  1355. var require_define_length = __commonJS(function(exports, module) {
  1356. 'use strict';
  1357. var toPosInt = require_to_pos_integer();
  1358. var test = function test(arg1, arg2) {
  1359. return arg2;
  1360. };
  1361. var desc;
  1362. var defineProperty;
  1363. var generate;
  1364. var mixin;
  1365. try {
  1366. Object.defineProperty(test, 'length', {
  1367. configurable: true,
  1368. writable: false,
  1369. enumerable: false,
  1370. value: 1
  1371. });
  1372. } catch (ignore) {}
  1373. if (test.length === 1) {
  1374. desc = {
  1375. configurable: true,
  1376. writable: false,
  1377. enumerable: false
  1378. };
  1379. defineProperty = Object.defineProperty;
  1380. module.exports = function(fn, length) {
  1381. length = toPosInt(length);
  1382. if (fn.length === length) {
  1383. return fn;
  1384. }
  1385. desc.value = length;
  1386. return defineProperty(fn, 'length', desc);
  1387. };
  1388. } else {
  1389. mixin = require_mixin();
  1390. generate = function() {
  1391. var cache18 = [];
  1392. return function(length) {
  1393. var args, i = 0;
  1394. if (cache18[length]) {
  1395. return cache18[length];
  1396. }
  1397. args = [];
  1398. while (length--) {
  1399. args.push('a' + (++i).toString(36));
  1400. }
  1401. return new Function('fn', 'return function (' + args.join(', ') + ') { return fn.apply(this, arguments); };');
  1402. };
  1403. }();
  1404. module.exports = function(src, length) {
  1405. var target;
  1406. length = toPosInt(length);
  1407. if (src.length === length) {
  1408. return src;
  1409. }
  1410. target = generate(length)(src);
  1411. try {
  1412. mixin(target, src);
  1413. } catch (ignore) {}
  1414. return target;
  1415. };
  1416. }
  1417. });
  1418. var require_is = __commonJS(function(exports, module) {
  1419. 'use strict';
  1420. var _undefined = void 0;
  1421. module.exports = function(value) {
  1422. return value !== _undefined && value !== null;
  1423. };
  1424. });
  1425. var require_is2 = __commonJS(function(exports, module) {
  1426. 'use strict';
  1427. var isValue = require_is();
  1428. var possibleTypes = {
  1429. object: true,
  1430. function: true,
  1431. undefined: true
  1432. };
  1433. module.exports = function(value) {
  1434. if (!isValue(value)) {
  1435. return false;
  1436. }
  1437. return hasOwnProperty.call(possibleTypes, _typeof(value));
  1438. };
  1439. });
  1440. var require_is3 = __commonJS(function(exports, module) {
  1441. 'use strict';
  1442. var isObject = require_is2();
  1443. module.exports = function(value) {
  1444. if (!isObject(value)) {
  1445. return false;
  1446. }
  1447. try {
  1448. if (!value.constructor) {
  1449. return false;
  1450. }
  1451. return value.constructor.prototype === value;
  1452. } catch (error) {
  1453. return false;
  1454. }
  1455. };
  1456. });
  1457. var require_is4 = __commonJS(function(exports, module) {
  1458. 'use strict';
  1459. var isPrototype = require_is3();
  1460. module.exports = function(value) {
  1461. if (typeof value !== 'function') {
  1462. return false;
  1463. }
  1464. if (!hasOwnProperty.call(value, 'length')) {
  1465. return false;
  1466. }
  1467. try {
  1468. if (typeof value.length !== 'number') {
  1469. return false;
  1470. }
  1471. if (typeof value.call !== 'function') {
  1472. return false;
  1473. }
  1474. if (typeof value.apply !== 'function') {
  1475. return false;
  1476. }
  1477. } catch (error) {
  1478. return false;
  1479. }
  1480. return !isPrototype(value);
  1481. };
  1482. });
  1483. var require_is5 = __commonJS(function(exports, module) {
  1484. 'use strict';
  1485. var isFunction = require_is4();
  1486. var classRe = /^\s*class[\s{/}]/;
  1487. var functionToString = Function.prototype.toString;
  1488. module.exports = function(value) {
  1489. if (!isFunction(value)) {
  1490. return false;
  1491. }
  1492. if (classRe.test(functionToString.call(value))) {
  1493. return false;
  1494. }
  1495. return true;
  1496. };
  1497. });
  1498. var require_is_implemented4 = __commonJS(function(exports, module) {
  1499. 'use strict';
  1500. var str = 'razdwatrzy';
  1501. module.exports = function() {
  1502. if (typeof str.contains !== 'function') {
  1503. return false;
  1504. }
  1505. return str.contains('dwa') === true && str.contains('foo') === false;
  1506. };
  1507. });
  1508. var require_shim4 = __commonJS(function(exports, module) {
  1509. 'use strict';
  1510. var indexOf = String.prototype.indexOf;
  1511. module.exports = function(searchString) {
  1512. return indexOf.call(this, searchString, arguments[1]) > -1;
  1513. };
  1514. });
  1515. var require_contains = __commonJS(function(exports, module) {
  1516. 'use strict';
  1517. module.exports = require_is_implemented4()() ? String.prototype.contains : require_shim4();
  1518. });
  1519. var require_d = __commonJS(function(exports, module) {
  1520. 'use strict';
  1521. var isValue = require_is();
  1522. var isPlainFunction = require_is5();
  1523. var assign = require_assign();
  1524. var normalizeOpts = require_normalize_options();
  1525. var contains6 = require_contains();
  1526. var d = module.exports = function(dscr, value) {
  1527. var c, e, w, options, desc;
  1528. if (arguments.length < 2 || typeof dscr !== 'string') {
  1529. options = value;
  1530. value = dscr;
  1531. dscr = null;
  1532. } else {
  1533. options = arguments[2];
  1534. }
  1535. if (isValue(dscr)) {
  1536. c = contains6.call(dscr, 'c');
  1537. e = contains6.call(dscr, 'e');
  1538. w = contains6.call(dscr, 'w');
  1539. } else {
  1540. c = w = true;
  1541. e = false;
  1542. }
  1543. desc = {
  1544. value: value,
  1545. configurable: c,
  1546. enumerable: e,
  1547. writable: w
  1548. };
  1549. return !options ? desc : assign(normalizeOpts(options), desc);
  1550. };
  1551. d.gs = function(dscr, get, set) {
  1552. var c, e, options, desc;
  1553. if (typeof dscr !== 'string') {
  1554. options = set;
  1555. set = get;
  1556. get = dscr;
  1557. dscr = null;
  1558. } else {
  1559. options = arguments[3];
  1560. }
  1561. if (!isValue(get)) {
  1562. get = void 0;
  1563. } else if (!isPlainFunction(get)) {
  1564. options = get;
  1565. get = set = void 0;
  1566. } else if (!isValue(set)) {
  1567. set = void 0;
  1568. } else if (!isPlainFunction(set)) {
  1569. options = set;
  1570. set = void 0;
  1571. }
  1572. if (isValue(dscr)) {
  1573. c = contains6.call(dscr, 'c');
  1574. e = contains6.call(dscr, 'e');
  1575. } else {
  1576. c = true;
  1577. e = false;
  1578. }
  1579. desc = {
  1580. get: get,
  1581. set: set,
  1582. configurable: c,
  1583. enumerable: e
  1584. };
  1585. return !options ? desc : assign(normalizeOpts(options), desc);
  1586. };
  1587. });
  1588. var require_event_emitter = __commonJS(function(exports, module) {
  1589. 'use strict';
  1590. var d = require_d();
  1591. var callable = require_valid_callable();
  1592. var apply = Function.prototype.apply;
  1593. var call = Function.prototype.call;
  1594. var create = Object.create;
  1595. var defineProperty = Object.defineProperty;
  1596. var defineProperties = Object.defineProperties;
  1597. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  1598. var descriptor = {
  1599. configurable: true,
  1600. enumerable: false,
  1601. writable: true
  1602. };
  1603. var on;
  1604. var once;
  1605. var off;
  1606. var emit;
  1607. var methods;
  1608. var descriptors;
  1609. var base;
  1610. on = function on(type, listener) {
  1611. var data2;
  1612. callable(listener);
  1613. if (!hasOwnProperty2.call(this, '__ee__')) {
  1614. data2 = descriptor.value = create(null);
  1615. defineProperty(this, '__ee__', descriptor);
  1616. descriptor.value = null;
  1617. } else {
  1618. data2 = this.__ee__;
  1619. }
  1620. if (!data2[type]) {
  1621. data2[type] = listener;
  1622. } else if (_typeof(data2[type]) === 'object') {
  1623. data2[type].push(listener);
  1624. } else {
  1625. data2[type] = [ data2[type], listener ];
  1626. }
  1627. return this;
  1628. };
  1629. once = function once(type, listener) {
  1630. var _once, self2;
  1631. callable(listener);
  1632. self2 = this;
  1633. on.call(this, type, _once = function once2() {
  1634. off.call(self2, type, _once);
  1635. apply.call(listener, this, arguments);
  1636. });
  1637. _once.__eeOnceListener__ = listener;
  1638. return this;
  1639. };
  1640. off = function off(type, listener) {
  1641. var data2, listeners, candidate, i;
  1642. callable(listener);
  1643. if (!hasOwnProperty2.call(this, '__ee__')) {
  1644. return this;
  1645. }
  1646. data2 = this.__ee__;
  1647. if (!data2[type]) {
  1648. return this;
  1649. }
  1650. listeners = data2[type];
  1651. if (_typeof(listeners) === 'object') {
  1652. for (i = 0; candidate = listeners[i]; ++i) {
  1653. if (candidate === listener || candidate.__eeOnceListener__ === listener) {
  1654. if (listeners.length === 2) {
  1655. data2[type] = listeners[i ? 0 : 1];
  1656. } else {
  1657. listeners.splice(i, 1);
  1658. }
  1659. }
  1660. }
  1661. } else {
  1662. if (listeners === listener || listeners.__eeOnceListener__ === listener) {
  1663. delete data2[type];
  1664. }
  1665. }
  1666. return this;
  1667. };
  1668. emit = function emit(type) {
  1669. var i, l, listener, listeners, args;
  1670. if (!hasOwnProperty2.call(this, '__ee__')) {
  1671. return;
  1672. }
  1673. listeners = this.__ee__[type];
  1674. if (!listeners) {
  1675. return;
  1676. }
  1677. if (_typeof(listeners) === 'object') {
  1678. l = arguments.length;
  1679. args = new Array(l - 1);
  1680. for (i = 1; i < l; ++i) {
  1681. args[i - 1] = arguments[i];
  1682. }
  1683. listeners = listeners.slice();
  1684. for (i = 0; listener = listeners[i]; ++i) {
  1685. apply.call(listener, this, args);
  1686. }
  1687. } else {
  1688. switch (arguments.length) {
  1689. case 1:
  1690. call.call(listeners, this);
  1691. break;
  1692. case 2:
  1693. call.call(listeners, this, arguments[1]);
  1694. break;
  1695. case 3:
  1696. call.call(listeners, this, arguments[1], arguments[2]);
  1697. break;
  1698. default:
  1699. l = arguments.length;
  1700. args = new Array(l - 1);
  1701. for (i = 1; i < l; ++i) {
  1702. args[i - 1] = arguments[i];
  1703. }
  1704. apply.call(listeners, this, args);
  1705. }
  1706. }
  1707. };
  1708. methods = {
  1709. on: on,
  1710. once: once,
  1711. off: off,
  1712. emit: emit
  1713. };
  1714. descriptors = {
  1715. on: d(on),
  1716. once: d(once),
  1717. off: d(off),
  1718. emit: d(emit)
  1719. };
  1720. base = defineProperties({}, descriptors);
  1721. module.exports = exports = function exports(o) {
  1722. return o == null ? create(base) : defineProperties(Object(o), descriptors);
  1723. };
  1724. exports.methods = methods;
  1725. });
  1726. var require_is_implemented5 = __commonJS(function(exports, module) {
  1727. 'use strict';
  1728. module.exports = function() {
  1729. var from = Array.from, arr, result;
  1730. if (typeof from !== 'function') {
  1731. return false;
  1732. }
  1733. arr = [ 'raz', 'dwa' ];
  1734. result = from(arr);
  1735. return Boolean(result && result !== arr && result[1] === 'dwa');
  1736. };
  1737. });
  1738. var require_is_implemented6 = __commonJS(function(exports, module) {
  1739. 'use strict';
  1740. module.exports = function() {
  1741. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) !== 'object') {
  1742. return false;
  1743. }
  1744. if (!globalThis) {
  1745. return false;
  1746. }
  1747. return globalThis.Array === Array;
  1748. };
  1749. });
  1750. var require_implementation = __commonJS(function(exports, module) {
  1751. var naiveFallback = function naiveFallback() {
  1752. if ((typeof self === 'undefined' ? 'undefined' : _typeof(self)) === 'object' && self) {
  1753. return self;
  1754. }
  1755. if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window) {
  1756. return window;
  1757. }
  1758. throw new Error('Unable to resolve global `this`');
  1759. };
  1760. module.exports = function() {
  1761. if (this) {
  1762. return this;
  1763. }
  1764. try {
  1765. Object.defineProperty(Object.prototype, '__global__', {
  1766. get: function get() {
  1767. return this;
  1768. },
  1769. configurable: true
  1770. });
  1771. } catch (error) {
  1772. return naiveFallback();
  1773. }
  1774. try {
  1775. if (!__global__) {
  1776. return naiveFallback();
  1777. }
  1778. return __global__;
  1779. } finally {
  1780. delete Object.prototype.__global__;
  1781. }
  1782. }();
  1783. });
  1784. var require_global_this = __commonJS(function(exports, module) {
  1785. 'use strict';
  1786. module.exports = require_is_implemented6()() ? globalThis : require_implementation();
  1787. });
  1788. var require_is_implemented7 = __commonJS(function(exports, module) {
  1789. 'use strict';
  1790. var global2 = require_global_this();
  1791. var validTypes = {
  1792. object: true,
  1793. symbol: true
  1794. };
  1795. module.exports = function() {
  1796. var _Symbol = global2.Symbol;
  1797. var symbol;
  1798. if (typeof _Symbol !== 'function') {
  1799. return false;
  1800. }
  1801. symbol = _Symbol('test symbol');
  1802. try {
  1803. String(symbol);
  1804. } catch (e) {
  1805. return false;
  1806. }
  1807. if (!validTypes[_typeof(_Symbol.iterator)]) {
  1808. return false;
  1809. }
  1810. if (!validTypes[_typeof(_Symbol.toPrimitive)]) {
  1811. return false;
  1812. }
  1813. if (!validTypes[_typeof(_Symbol.toStringTag)]) {
  1814. return false;
  1815. }
  1816. return true;
  1817. };
  1818. });
  1819. var require_is_symbol = __commonJS(function(exports, module) {
  1820. 'use strict';
  1821. module.exports = function(value) {
  1822. if (!value) {
  1823. return false;
  1824. }
  1825. if (_typeof(value) === 'symbol') {
  1826. return true;
  1827. }
  1828. if (!value.constructor) {
  1829. return false;
  1830. }
  1831. if (value.constructor.name !== 'Symbol') {
  1832. return false;
  1833. }
  1834. return value[value.constructor.toStringTag] === 'Symbol';
  1835. };
  1836. });
  1837. var require_validate_symbol = __commonJS(function(exports, module) {
  1838. 'use strict';
  1839. var isSymbol = require_is_symbol();
  1840. module.exports = function(value) {
  1841. if (!isSymbol(value)) {
  1842. throw new TypeError(value + ' is not a symbol');
  1843. }
  1844. return value;
  1845. };
  1846. });
  1847. var require_generate_name = __commonJS(function(exports, module) {
  1848. 'use strict';
  1849. var d = require_d();
  1850. var create = Object.create;
  1851. var defineProperty = Object.defineProperty;
  1852. var objPrototype = Object.prototype;
  1853. var created = create(null);
  1854. module.exports = function(desc) {
  1855. var postfix = 0, name, ie11BugWorkaround;
  1856. while (created[desc + (postfix || '')]) {
  1857. ++postfix;
  1858. }
  1859. desc += postfix || '';
  1860. created[desc] = true;
  1861. name = '@@' + desc;
  1862. defineProperty(objPrototype, name, d.gs(null, function(value) {
  1863. if (ie11BugWorkaround) {
  1864. return;
  1865. }
  1866. ie11BugWorkaround = true;
  1867. defineProperty(this, name, d(value));
  1868. ie11BugWorkaround = false;
  1869. }));
  1870. return name;
  1871. };
  1872. });
  1873. var require_standard_symbols = __commonJS(function(exports, module) {
  1874. 'use strict';
  1875. var d = require_d();
  1876. var NativeSymbol = require_global_this().Symbol;
  1877. module.exports = function(SymbolPolyfill) {
  1878. return Object.defineProperties(SymbolPolyfill, {
  1879. hasInstance: d('', NativeSymbol && NativeSymbol.hasInstance || SymbolPolyfill('hasInstance')),
  1880. isConcatSpreadable: d('', NativeSymbol && NativeSymbol.isConcatSpreadable || SymbolPolyfill('isConcatSpreadable')),
  1881. iterator: d('', NativeSymbol && NativeSymbol.iterator || SymbolPolyfill('iterator')),
  1882. match: d('', NativeSymbol && NativeSymbol.match || SymbolPolyfill('match')),
  1883. replace: d('', NativeSymbol && NativeSymbol.replace || SymbolPolyfill('replace')),
  1884. search: d('', NativeSymbol && NativeSymbol.search || SymbolPolyfill('search')),
  1885. species: d('', NativeSymbol && NativeSymbol.species || SymbolPolyfill('species')),
  1886. split: d('', NativeSymbol && NativeSymbol.split || SymbolPolyfill('split')),
  1887. toPrimitive: d('', NativeSymbol && NativeSymbol.toPrimitive || SymbolPolyfill('toPrimitive')),
  1888. toStringTag: d('', NativeSymbol && NativeSymbol.toStringTag || SymbolPolyfill('toStringTag')),
  1889. unscopables: d('', NativeSymbol && NativeSymbol.unscopables || SymbolPolyfill('unscopables'))
  1890. });
  1891. };
  1892. });
  1893. var require_symbol_registry = __commonJS(function(exports, module) {
  1894. 'use strict';
  1895. var d = require_d();
  1896. var validateSymbol = require_validate_symbol();
  1897. var registry = Object.create(null);
  1898. module.exports = function(SymbolPolyfill) {
  1899. return Object.defineProperties(SymbolPolyfill, {
  1900. for: d(function(key) {
  1901. if (registry[key]) {
  1902. return registry[key];
  1903. }
  1904. return registry[key] = SymbolPolyfill(String(key));
  1905. }),
  1906. keyFor: d(function(symbol) {
  1907. var key;
  1908. validateSymbol(symbol);
  1909. for (key in registry) {
  1910. if (registry[key] === symbol) {
  1911. return key;
  1912. }
  1913. }
  1914. return void 0;
  1915. })
  1916. });
  1917. };
  1918. });
  1919. var require_polyfill = __commonJS(function(exports, module) {
  1920. 'use strict';
  1921. var d = require_d();
  1922. var validateSymbol = require_validate_symbol();
  1923. var NativeSymbol = require_global_this().Symbol;
  1924. var generateName = require_generate_name();
  1925. var setupStandardSymbols = require_standard_symbols();
  1926. var setupSymbolRegistry = require_symbol_registry();
  1927. var create = Object.create;
  1928. var defineProperties = Object.defineProperties;
  1929. var defineProperty = Object.defineProperty;
  1930. var SymbolPolyfill;
  1931. var HiddenSymbol;
  1932. var isNativeSafe;
  1933. if (typeof NativeSymbol === 'function') {
  1934. try {
  1935. String(NativeSymbol());
  1936. isNativeSafe = true;
  1937. } catch (ignore) {}
  1938. } else {
  1939. NativeSymbol = null;
  1940. }
  1941. HiddenSymbol = function _Symbol2(description) {
  1942. if (this instanceof HiddenSymbol) {
  1943. throw new TypeError('Symbol is not a constructor');
  1944. }
  1945. return SymbolPolyfill(description);
  1946. };
  1947. module.exports = SymbolPolyfill = function _Symbol3(description) {
  1948. var symbol;
  1949. if (this instanceof _Symbol3) {
  1950. throw new TypeError('Symbol is not a constructor');
  1951. }
  1952. if (isNativeSafe) {
  1953. return NativeSymbol(description);
  1954. }
  1955. symbol = create(HiddenSymbol.prototype);
  1956. description = description === void 0 ? '' : String(description);
  1957. return defineProperties(symbol, {
  1958. __description__: d('', description),
  1959. __name__: d('', generateName(description))
  1960. });
  1961. };
  1962. setupStandardSymbols(SymbolPolyfill);
  1963. setupSymbolRegistry(SymbolPolyfill);
  1964. defineProperties(HiddenSymbol.prototype, {
  1965. constructor: d(SymbolPolyfill),
  1966. toString: d('', function() {
  1967. return this.__name__;
  1968. })
  1969. });
  1970. defineProperties(SymbolPolyfill.prototype, {
  1971. toString: d(function() {
  1972. return 'Symbol (' + validateSymbol(this).__description__ + ')';
  1973. }),
  1974. valueOf: d(function() {
  1975. return validateSymbol(this);
  1976. })
  1977. });
  1978. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function() {
  1979. var symbol = validateSymbol(this);
  1980. if (_typeof(symbol) === 'symbol') {
  1981. return symbol;
  1982. }
  1983. return symbol.toString();
  1984. }));
  1985. defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol'));
  1986. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toStringTag, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toStringTag]));
  1987. defineProperty(HiddenSymbol.prototype, SymbolPolyfill.toPrimitive, d('c', SymbolPolyfill.prototype[SymbolPolyfill.toPrimitive]));
  1988. });
  1989. var require_es6_symbol = __commonJS(function(exports, module) {
  1990. 'use strict';
  1991. module.exports = require_is_implemented7()() ? require_global_this().Symbol : require_polyfill();
  1992. });
  1993. var require_is_arguments = __commonJS(function(exports, module) {
  1994. 'use strict';
  1995. var objToString = Object.prototype.toString;
  1996. var id = objToString.call(function() {
  1997. return arguments;
  1998. }());
  1999. module.exports = function(value) {
  2000. return objToString.call(value) === id;
  2001. };
  2002. });
  2003. var require_is_function = __commonJS(function(exports, module) {
  2004. 'use strict';
  2005. var objToString = Object.prototype.toString;
  2006. var isFunctionStringTag = RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);
  2007. module.exports = function(value) {
  2008. return typeof value === 'function' && isFunctionStringTag(objToString.call(value));
  2009. };
  2010. });
  2011. var require_is_string = __commonJS(function(exports, module) {
  2012. 'use strict';
  2013. var objToString = Object.prototype.toString;
  2014. var id = objToString.call('');
  2015. module.exports = function(value) {
  2016. return typeof value === 'string' || value && _typeof(value) === 'object' && (value instanceof String || objToString.call(value) === id) || false;
  2017. };
  2018. });
  2019. var require_shim5 = __commonJS(function(exports, module) {
  2020. 'use strict';
  2021. var iteratorSymbol = require_es6_symbol().iterator;
  2022. var isArguments = require_is_arguments();
  2023. var isFunction = require_is_function();
  2024. var toPosInt = require_to_pos_integer();
  2025. var callable = require_valid_callable();
  2026. var validValue = require_valid_value();
  2027. var isValue = require_is_value();
  2028. var isString = require_is_string();
  2029. var isArray = Array.isArray;
  2030. var call = Function.prototype.call;
  2031. var desc = {
  2032. configurable: true,
  2033. enumerable: true,
  2034. writable: true,
  2035. value: null
  2036. };
  2037. var defineProperty = Object.defineProperty;
  2038. module.exports = function(arrayLike) {
  2039. var mapFn = arguments[1], thisArg = arguments[2], Context2, i, j, arr, length, code, iterator, result, getIterator, value;
  2040. arrayLike = Object(validValue(arrayLike));
  2041. if (isValue(mapFn)) {
  2042. callable(mapFn);
  2043. }
  2044. if (!this || this === Array || !isFunction(this)) {
  2045. if (!mapFn) {
  2046. if (isArguments(arrayLike)) {
  2047. length = arrayLike.length;
  2048. if (length !== 1) {
  2049. return Array.apply(null, arrayLike);
  2050. }
  2051. arr = new Array(1);
  2052. arr[0] = arrayLike[0];
  2053. return arr;
  2054. }
  2055. if (isArray(arrayLike)) {
  2056. arr = new Array(length = arrayLike.length);
  2057. for (i = 0; i < length; ++i) {
  2058. arr[i] = arrayLike[i];
  2059. }
  2060. return arr;
  2061. }
  2062. }
  2063. arr = [];
  2064. } else {
  2065. Context2 = this;
  2066. }
  2067. if (!isArray(arrayLike)) {
  2068. if ((getIterator = arrayLike[iteratorSymbol]) !== void 0) {
  2069. iterator = callable(getIterator).call(arrayLike);
  2070. if (Context2) {
  2071. arr = new Context2();
  2072. }
  2073. result = iterator.next();
  2074. i = 0;
  2075. while (!result.done) {
  2076. value = mapFn ? call.call(mapFn, thisArg, result.value, i) : result.value;
  2077. if (Context2) {
  2078. desc.value = value;
  2079. defineProperty(arr, i, desc);
  2080. } else {
  2081. arr[i] = value;
  2082. }
  2083. result = iterator.next();
  2084. ++i;
  2085. }
  2086. length = i;
  2087. } else if (isString(arrayLike)) {
  2088. length = arrayLike.length;
  2089. if (Context2) {
  2090. arr = new Context2();
  2091. }
  2092. for (i = 0, j = 0; i < length; ++i) {
  2093. value = arrayLike[i];
  2094. if (i + 1 < length) {
  2095. code = value.charCodeAt(0);
  2096. if (code >= 55296 && code <= 56319) {
  2097. value += arrayLike[++i];
  2098. }
  2099. }
  2100. value = mapFn ? call.call(mapFn, thisArg, value, j) : value;
  2101. if (Context2) {
  2102. desc.value = value;
  2103. defineProperty(arr, j, desc);
  2104. } else {
  2105. arr[j] = value;
  2106. }
  2107. ++j;
  2108. }
  2109. length = j;
  2110. }
  2111. }
  2112. if (length === void 0) {
  2113. length = toPosInt(arrayLike.length);
  2114. if (Context2) {
  2115. arr = new Context2(length);
  2116. }
  2117. for (i = 0; i < length; ++i) {
  2118. value = mapFn ? call.call(mapFn, thisArg, arrayLike[i], i) : arrayLike[i];
  2119. if (Context2) {
  2120. desc.value = value;
  2121. defineProperty(arr, i, desc);
  2122. } else {
  2123. arr[i] = value;
  2124. }
  2125. }
  2126. }
  2127. if (Context2) {
  2128. desc.value = null;
  2129. arr.length = length;
  2130. }
  2131. return arr;
  2132. };
  2133. });
  2134. var require_from = __commonJS(function(exports, module) {
  2135. 'use strict';
  2136. module.exports = require_is_implemented5()() ? Array.from : require_shim5();
  2137. });
  2138. var require_to_array = __commonJS(function(exports, module) {
  2139. 'use strict';
  2140. var from = require_from();
  2141. var isArray = Array.isArray;
  2142. module.exports = function(arrayLike) {
  2143. return isArray(arrayLike) ? arrayLike : from(arrayLike);
  2144. };
  2145. });
  2146. var require_resolve_resolve = __commonJS(function(exports, module) {
  2147. 'use strict';
  2148. var toArray2 = require_to_array();
  2149. var isValue = require_is_value();
  2150. var callable = require_valid_callable();
  2151. var slice = Array.prototype.slice;
  2152. var resolveArgs;
  2153. resolveArgs = function resolveArgs(args) {
  2154. return this.map(function(resolve, i) {
  2155. return resolve ? resolve(args[i]) : args[i];
  2156. }).concat(slice.call(args, this.length));
  2157. };
  2158. module.exports = function(resolvers) {
  2159. resolvers = toArray2(resolvers);
  2160. resolvers.forEach(function(resolve) {
  2161. if (isValue(resolve)) {
  2162. callable(resolve);
  2163. }
  2164. });
  2165. return resolveArgs.bind(resolvers);
  2166. };
  2167. });
  2168. var require_resolve_normalize = __commonJS(function(exports, module) {
  2169. 'use strict';
  2170. var callable = require_valid_callable();
  2171. module.exports = function(userNormalizer) {
  2172. var normalizer;
  2173. if (typeof userNormalizer === 'function') {
  2174. return {
  2175. set: userNormalizer,
  2176. get: userNormalizer
  2177. };
  2178. }
  2179. normalizer = {
  2180. get: callable(userNormalizer.get)
  2181. };
  2182. if (userNormalizer.set !== void 0) {
  2183. normalizer.set = callable(userNormalizer.set);
  2184. if (userNormalizer['delete']) {
  2185. normalizer['delete'] = callable(userNormalizer['delete']);
  2186. }
  2187. if (userNormalizer.clear) {
  2188. normalizer.clear = callable(userNormalizer.clear);
  2189. }
  2190. return normalizer;
  2191. }
  2192. normalizer.set = normalizer.get;
  2193. return normalizer;
  2194. };
  2195. });
  2196. var require_configure_map = __commonJS(function(exports, module) {
  2197. 'use strict';
  2198. var customError = require_custom();
  2199. var defineLength = require_define_length();
  2200. var d = require_d();
  2201. var ee = require_event_emitter().methods;
  2202. var resolveResolve = require_resolve_resolve();
  2203. var resolveNormalize = require_resolve_normalize();
  2204. var apply = Function.prototype.apply;
  2205. var call = Function.prototype.call;
  2206. var create = Object.create;
  2207. var defineProperties = Object.defineProperties;
  2208. var _on = ee.on;
  2209. var emit = ee.emit;
  2210. module.exports = function(original, length, options) {
  2211. var cache18 = create(null), conf, memLength, _get, set, del, _clear, extDel, extGet, extHas, normalizer, getListeners, setListeners, deleteListeners, memoized, resolve;
  2212. if (length !== false) {
  2213. memLength = length;
  2214. } else if (isNaN(original.length)) {
  2215. memLength = 1;
  2216. } else {
  2217. memLength = original.length;
  2218. }
  2219. if (options.normalizer) {
  2220. normalizer = resolveNormalize(options.normalizer);
  2221. _get = normalizer.get;
  2222. set = normalizer.set;
  2223. del = normalizer['delete'];
  2224. _clear = normalizer.clear;
  2225. }
  2226. if (options.resolvers != null) {
  2227. resolve = resolveResolve(options.resolvers);
  2228. }
  2229. if (_get) {
  2230. memoized = defineLength(function(arg) {
  2231. var id, result, args = arguments;
  2232. if (resolve) {
  2233. args = resolve(args);
  2234. }
  2235. id = _get(args);
  2236. if (id !== null) {
  2237. if (hasOwnProperty.call(cache18, id)) {
  2238. if (getListeners) {
  2239. conf.emit('get', id, args, this);
  2240. }
  2241. return cache18[id];
  2242. }
  2243. }
  2244. if (args.length === 1) {
  2245. result = call.call(original, this, args[0]);
  2246. } else {
  2247. result = apply.call(original, this, args);
  2248. }
  2249. if (id === null) {
  2250. id = _get(args);
  2251. if (id !== null) {
  2252. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2253. }
  2254. id = set(args);
  2255. } else if (hasOwnProperty.call(cache18, id)) {
  2256. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2257. }
  2258. cache18[id] = result;
  2259. if (setListeners) {
  2260. conf.emit('set', id, null, result);
  2261. }
  2262. return result;
  2263. }, memLength);
  2264. } else if (length === 0) {
  2265. memoized = function memoized() {
  2266. var result;
  2267. if (hasOwnProperty.call(cache18, 'data')) {
  2268. if (getListeners) {
  2269. conf.emit('get', 'data', arguments, this);
  2270. }
  2271. return cache18.data;
  2272. }
  2273. if (arguments.length) {
  2274. result = apply.call(original, this, arguments);
  2275. } else {
  2276. result = call.call(original, this);
  2277. }
  2278. if (hasOwnProperty.call(cache18, 'data')) {
  2279. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2280. }
  2281. cache18.data = result;
  2282. if (setListeners) {
  2283. conf.emit('set', 'data', null, result);
  2284. }
  2285. return result;
  2286. };
  2287. } else {
  2288. memoized = function memoized(arg) {
  2289. var result, args = arguments, id;
  2290. if (resolve) {
  2291. args = resolve(arguments);
  2292. }
  2293. id = String(args[0]);
  2294. if (hasOwnProperty.call(cache18, id)) {
  2295. if (getListeners) {
  2296. conf.emit('get', id, args, this);
  2297. }
  2298. return cache18[id];
  2299. }
  2300. if (args.length === 1) {
  2301. result = call.call(original, this, args[0]);
  2302. } else {
  2303. result = apply.call(original, this, args);
  2304. }
  2305. if (hasOwnProperty.call(cache18, id)) {
  2306. throw customError('Circular invocation', 'CIRCULAR_INVOCATION');
  2307. }
  2308. cache18[id] = result;
  2309. if (setListeners) {
  2310. conf.emit('set', id, null, result);
  2311. }
  2312. return result;
  2313. };
  2314. }
  2315. conf = {
  2316. original: original,
  2317. memoized: memoized,
  2318. profileName: options.profileName,
  2319. get: function get(args) {
  2320. if (resolve) {
  2321. args = resolve(args);
  2322. }
  2323. if (_get) {
  2324. return _get(args);
  2325. }
  2326. return String(args[0]);
  2327. },
  2328. has: function has(id) {
  2329. return hasOwnProperty.call(cache18, id);
  2330. },
  2331. delete: function _delete(id) {
  2332. var result;
  2333. if (!hasOwnProperty.call(cache18, id)) {
  2334. return;
  2335. }
  2336. if (del) {
  2337. del(id);
  2338. }
  2339. result = cache18[id];
  2340. delete cache18[id];
  2341. if (deleteListeners) {
  2342. conf.emit('delete', id, result);
  2343. }
  2344. },
  2345. clear: function clear() {
  2346. var oldCache = cache18;
  2347. if (_clear) {
  2348. _clear();
  2349. }
  2350. cache18 = create(null);
  2351. conf.emit('clear', oldCache);
  2352. },
  2353. on: function on(type, listener) {
  2354. if (type === 'get') {
  2355. getListeners = true;
  2356. } else if (type === 'set') {
  2357. setListeners = true;
  2358. } else if (type === 'delete') {
  2359. deleteListeners = true;
  2360. }
  2361. return _on.call(this, type, listener);
  2362. },
  2363. emit: emit,
  2364. updateEnv: function updateEnv() {
  2365. original = conf.original;
  2366. }
  2367. };
  2368. if (_get) {
  2369. extDel = defineLength(function(arg) {
  2370. var id, args = arguments;
  2371. if (resolve) {
  2372. args = resolve(args);
  2373. }
  2374. id = _get(args);
  2375. if (id === null) {
  2376. return;
  2377. }
  2378. conf['delete'](id);
  2379. }, memLength);
  2380. } else if (length === 0) {
  2381. extDel = function extDel() {
  2382. return conf['delete']('data');
  2383. };
  2384. } else {
  2385. extDel = function extDel(arg) {
  2386. if (resolve) {
  2387. arg = resolve(arguments)[0];
  2388. }
  2389. return conf['delete'](arg);
  2390. };
  2391. }
  2392. extGet = defineLength(function() {
  2393. var id, args = arguments;
  2394. if (length === 0) {
  2395. return cache18.data;
  2396. }
  2397. if (resolve) {
  2398. args = resolve(args);
  2399. }
  2400. if (_get) {
  2401. id = _get(args);
  2402. } else {
  2403. id = String(args[0]);
  2404. }
  2405. return cache18[id];
  2406. });
  2407. extHas = defineLength(function() {
  2408. var id, args = arguments;
  2409. if (length === 0) {
  2410. return conf.has('data');
  2411. }
  2412. if (resolve) {
  2413. args = resolve(args);
  2414. }
  2415. if (_get) {
  2416. id = _get(args);
  2417. } else {
  2418. id = String(args[0]);
  2419. }
  2420. if (id === null) {
  2421. return false;
  2422. }
  2423. return conf.has(id);
  2424. });
  2425. defineProperties(memoized, {
  2426. __memoized__: d(true),
  2427. delete: d(extDel),
  2428. clear: d(conf.clear),
  2429. _get: d(extGet),
  2430. _has: d(extHas)
  2431. });
  2432. return conf;
  2433. };
  2434. });
  2435. var require_plain = __commonJS(function(exports, module) {
  2436. 'use strict';
  2437. var callable = require_valid_callable();
  2438. var forEach = require_for_each();
  2439. var extensions = require_registered_extensions();
  2440. var configure3 = require_configure_map();
  2441. var resolveLength = require_resolve_length();
  2442. module.exports = function self2(fn) {
  2443. var options, length, conf;
  2444. callable(fn);
  2445. options = Object(arguments[1]);
  2446. if (options.async && options.promise) {
  2447. throw new Error('Options \'async\' and \'promise\' cannot be used together');
  2448. }
  2449. if (hasOwnProperty.call(fn, '__memoized__') && !options.force) {
  2450. return fn;
  2451. }
  2452. length = resolveLength(options.length, fn.length, options.async && extensions.async);
  2453. conf = configure3(fn, length, options);
  2454. forEach(extensions, function(extFn, name) {
  2455. if (options[name]) {
  2456. extFn(options[name], conf, options);
  2457. }
  2458. });
  2459. if (self2.__profiler__) {
  2460. self2.__profiler__(conf);
  2461. }
  2462. conf.updateEnv();
  2463. return conf.memoized;
  2464. };
  2465. });
  2466. var require_primitive = __commonJS(function(exports, module) {
  2467. 'use strict';
  2468. module.exports = function(args) {
  2469. var id, i, length = args.length;
  2470. if (!length) {
  2471. return '\x02';
  2472. }
  2473. id = String(args[i = 0]);
  2474. while (--length) {
  2475. id += '\x01' + args[++i];
  2476. }
  2477. return id;
  2478. };
  2479. });
  2480. var require_get_primitive_fixed = __commonJS(function(exports, module) {
  2481. 'use strict';
  2482. module.exports = function(length) {
  2483. if (!length) {
  2484. return function() {
  2485. return '';
  2486. };
  2487. }
  2488. return function(args) {
  2489. var id = String(args[0]), i = 0, currentLength = length;
  2490. while (--currentLength) {
  2491. id += '\x01' + args[++i];
  2492. }
  2493. return id;
  2494. };
  2495. };
  2496. });
  2497. var require_is_implemented8 = __commonJS(function(exports, module) {
  2498. 'use strict';
  2499. module.exports = function() {
  2500. var numberIsNaN = Number.isNaN;
  2501. if (typeof numberIsNaN !== 'function') {
  2502. return false;
  2503. }
  2504. return !numberIsNaN({}) && numberIsNaN(NaN) && !numberIsNaN(34);
  2505. };
  2506. });
  2507. var require_shim6 = __commonJS(function(exports, module) {
  2508. 'use strict';
  2509. module.exports = function(value) {
  2510. return value !== value;
  2511. };
  2512. });
  2513. var require_is_nan = __commonJS(function(exports, module) {
  2514. 'use strict';
  2515. module.exports = require_is_implemented8()() ? Number.isNaN : require_shim6();
  2516. });
  2517. var require_e_index_of = __commonJS(function(exports, module) {
  2518. 'use strict';
  2519. var numberIsNaN = require_is_nan();
  2520. var toPosInt = require_to_pos_integer();
  2521. var value = require_valid_value();
  2522. var indexOf = Array.prototype.indexOf;
  2523. var objHasOwnProperty = Object.prototype.hasOwnProperty;
  2524. var abs = Math.abs;
  2525. var floor = Math.floor;
  2526. module.exports = function(searchElement) {
  2527. var i, length, fromIndex, val;
  2528. if (!numberIsNaN(searchElement)) {
  2529. return indexOf.apply(this, arguments);
  2530. }
  2531. length = toPosInt(value(this).length);
  2532. fromIndex = arguments[1];
  2533. if (isNaN(fromIndex)) {
  2534. fromIndex = 0;
  2535. } else if (fromIndex >= 0) {
  2536. fromIndex = floor(fromIndex);
  2537. } else {
  2538. fromIndex = toPosInt(this.length) - floor(abs(fromIndex));
  2539. }
  2540. for (i = fromIndex; i < length; ++i) {
  2541. if (objHasOwnProperty.call(this, i)) {
  2542. val = this[i];
  2543. if (numberIsNaN(val)) {
  2544. return i;
  2545. }
  2546. }
  2547. }
  2548. return -1;
  2549. };
  2550. });
  2551. var require_get = __commonJS(function(exports, module) {
  2552. 'use strict';
  2553. var indexOf = require_e_index_of();
  2554. var create = Object.create;
  2555. module.exports = function() {
  2556. var lastId = 0, map = [], cache18 = create(null);
  2557. return {
  2558. get: function get(args) {
  2559. var index = 0, set = map, i, length = args.length;
  2560. if (length === 0) {
  2561. return set[length] || null;
  2562. }
  2563. if (set = set[length]) {
  2564. while (index < length - 1) {
  2565. i = indexOf.call(set[0], args[index]);
  2566. if (i === -1) {
  2567. return null;
  2568. }
  2569. set = set[1][i];
  2570. ++index;
  2571. }
  2572. i = indexOf.call(set[0], args[index]);
  2573. if (i === -1) {
  2574. return null;
  2575. }
  2576. return set[1][i] || null;
  2577. }
  2578. return null;
  2579. },
  2580. set: function set(args) {
  2581. var index = 0, set = map, i, length = args.length;
  2582. if (length === 0) {
  2583. set[length] = ++lastId;
  2584. } else {
  2585. if (!set[length]) {
  2586. set[length] = [ [], [] ];
  2587. }
  2588. set = set[length];
  2589. while (index < length - 1) {
  2590. i = indexOf.call(set[0], args[index]);
  2591. if (i === -1) {
  2592. i = set[0].push(args[index]) - 1;
  2593. set[1].push([ [], [] ]);
  2594. }
  2595. set = set[1][i];
  2596. ++index;
  2597. }
  2598. i = indexOf.call(set[0], args[index]);
  2599. if (i === -1) {
  2600. i = set[0].push(args[index]) - 1;
  2601. }
  2602. set[1][i] = ++lastId;
  2603. }
  2604. cache18[lastId] = args;
  2605. return lastId;
  2606. },
  2607. delete: function _delete(id) {
  2608. var index = 0, set = map, i, args = cache18[id], length = args.length, path = [];
  2609. if (length === 0) {
  2610. delete set[length];
  2611. } else if (set = set[length]) {
  2612. while (index < length - 1) {
  2613. i = indexOf.call(set[0], args[index]);
  2614. if (i === -1) {
  2615. return;
  2616. }
  2617. path.push(set, i);
  2618. set = set[1][i];
  2619. ++index;
  2620. }
  2621. i = indexOf.call(set[0], args[index]);
  2622. if (i === -1) {
  2623. return;
  2624. }
  2625. id = set[1][i];
  2626. set[0].splice(i, 1);
  2627. set[1].splice(i, 1);
  2628. while (!set[0].length && path.length) {
  2629. i = path.pop();
  2630. set = path.pop();
  2631. set[0].splice(i, 1);
  2632. set[1].splice(i, 1);
  2633. }
  2634. }
  2635. delete cache18[id];
  2636. },
  2637. clear: function clear() {
  2638. map = [];
  2639. cache18 = create(null);
  2640. }
  2641. };
  2642. };
  2643. });
  2644. var require_get_1 = __commonJS(function(exports, module) {
  2645. 'use strict';
  2646. var indexOf = require_e_index_of();
  2647. module.exports = function() {
  2648. var lastId = 0, argsMap = [], cache18 = [];
  2649. return {
  2650. get: function get(args) {
  2651. var index = indexOf.call(argsMap, args[0]);
  2652. return index === -1 ? null : cache18[index];
  2653. },
  2654. set: function set(args) {
  2655. argsMap.push(args[0]);
  2656. cache18.push(++lastId);
  2657. return lastId;
  2658. },
  2659. delete: function _delete(id) {
  2660. var index = indexOf.call(cache18, id);
  2661. if (index !== -1) {
  2662. argsMap.splice(index, 1);
  2663. cache18.splice(index, 1);
  2664. }
  2665. },
  2666. clear: function clear() {
  2667. argsMap = [];
  2668. cache18 = [];
  2669. }
  2670. };
  2671. };
  2672. });
  2673. var require_get_fixed = __commonJS(function(exports, module) {
  2674. 'use strict';
  2675. var indexOf = require_e_index_of();
  2676. var create = Object.create;
  2677. module.exports = function(length) {
  2678. var lastId = 0, map = [ [], [] ], cache18 = create(null);
  2679. return {
  2680. get: function get(args) {
  2681. var index = 0, set = map, i;
  2682. while (index < length - 1) {
  2683. i = indexOf.call(set[0], args[index]);
  2684. if (i === -1) {
  2685. return null;
  2686. }
  2687. set = set[1][i];
  2688. ++index;
  2689. }
  2690. i = indexOf.call(set[0], args[index]);
  2691. if (i === -1) {
  2692. return null;
  2693. }
  2694. return set[1][i] || null;
  2695. },
  2696. set: function set(args) {
  2697. var index = 0, set = map, i;
  2698. while (index < length - 1) {
  2699. i = indexOf.call(set[0], args[index]);
  2700. if (i === -1) {
  2701. i = set[0].push(args[index]) - 1;
  2702. set[1].push([ [], [] ]);
  2703. }
  2704. set = set[1][i];
  2705. ++index;
  2706. }
  2707. i = indexOf.call(set[0], args[index]);
  2708. if (i === -1) {
  2709. i = set[0].push(args[index]) - 1;
  2710. }
  2711. set[1][i] = ++lastId;
  2712. cache18[lastId] = args;
  2713. return lastId;
  2714. },
  2715. delete: function _delete(id) {
  2716. var index = 0, set = map, i, path = [], args = cache18[id];
  2717. while (index < length - 1) {
  2718. i = indexOf.call(set[0], args[index]);
  2719. if (i === -1) {
  2720. return;
  2721. }
  2722. path.push(set, i);
  2723. set = set[1][i];
  2724. ++index;
  2725. }
  2726. i = indexOf.call(set[0], args[index]);
  2727. if (i === -1) {
  2728. return;
  2729. }
  2730. id = set[1][i];
  2731. set[0].splice(i, 1);
  2732. set[1].splice(i, 1);
  2733. while (!set[0].length && path.length) {
  2734. i = path.pop();
  2735. set = path.pop();
  2736. set[0].splice(i, 1);
  2737. set[1].splice(i, 1);
  2738. }
  2739. delete cache18[id];
  2740. },
  2741. clear: function clear() {
  2742. map = [ [], [] ];
  2743. cache18 = create(null);
  2744. }
  2745. };
  2746. };
  2747. });
  2748. var require_map = __commonJS(function(exports, module) {
  2749. 'use strict';
  2750. var callable = require_valid_callable();
  2751. var forEach = require_for_each();
  2752. var call = Function.prototype.call;
  2753. module.exports = function(obj, cb) {
  2754. var result = {}, thisArg = arguments[2];
  2755. callable(cb);
  2756. forEach(obj, function(value, key, targetObj, index) {
  2757. result[key] = call.call(cb, thisArg, value, key, targetObj, index);
  2758. });
  2759. return result;
  2760. };
  2761. });
  2762. var require_next_tick = __commonJS(function(exports, module) {
  2763. 'use strict';
  2764. var callable;
  2765. var byObserver;
  2766. callable = function callable(fn) {
  2767. if (typeof fn !== 'function') {
  2768. throw new TypeError(fn + ' is not a function');
  2769. }
  2770. return fn;
  2771. };
  2772. byObserver = function byObserver(Observer) {
  2773. var node = document.createTextNode(''), queue4, currentQueue, i = 0;
  2774. new Observer(function() {
  2775. var callback;
  2776. if (!queue4) {
  2777. if (!currentQueue) {
  2778. return;
  2779. }
  2780. queue4 = currentQueue;
  2781. } else if (currentQueue) {
  2782. queue4 = currentQueue.concat(queue4);
  2783. }
  2784. currentQueue = queue4;
  2785. queue4 = null;
  2786. if (typeof currentQueue === 'function') {
  2787. callback = currentQueue;
  2788. currentQueue = null;
  2789. callback();
  2790. return;
  2791. }
  2792. node.data = i = ++i % 2;
  2793. while (currentQueue) {
  2794. callback = currentQueue.shift();
  2795. if (!currentQueue.length) {
  2796. currentQueue = null;
  2797. }
  2798. callback();
  2799. }
  2800. }).observe(node, {
  2801. characterData: true
  2802. });
  2803. return function(fn) {
  2804. callable(fn);
  2805. if (queue4) {
  2806. if (typeof queue4 === 'function') {
  2807. queue4 = [ queue4, fn ];
  2808. } else {
  2809. queue4.push(fn);
  2810. }
  2811. return;
  2812. }
  2813. queue4 = fn;
  2814. node.data = i = ++i % 2;
  2815. };
  2816. };
  2817. module.exports = function() {
  2818. if ((typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process && typeof process.nextTick === 'function') {
  2819. return process.nextTick;
  2820. }
  2821. if ((typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object' && document) {
  2822. if (typeof MutationObserver === 'function') {
  2823. return byObserver(MutationObserver);
  2824. }
  2825. if (typeof WebKitMutationObserver === 'function') {
  2826. return byObserver(WebKitMutationObserver);
  2827. }
  2828. }
  2829. if (typeof setImmediate === 'function') {
  2830. return function(cb) {
  2831. setImmediate(callable(cb));
  2832. };
  2833. }
  2834. if (typeof setTimeout === 'function' || (typeof setTimeout === 'undefined' ? 'undefined' : _typeof(setTimeout)) === 'object') {
  2835. return function(cb) {
  2836. setTimeout(callable(cb), 0);
  2837. };
  2838. }
  2839. return null;
  2840. }();
  2841. });
  2842. var require_async = __commonJS(function() {
  2843. 'use strict';
  2844. var aFrom = require_from();
  2845. var objectMap = require_map();
  2846. var mixin = require_mixin();
  2847. var defineLength = require_define_length();
  2848. var nextTick = require_next_tick();
  2849. var slice = Array.prototype.slice;
  2850. var apply = Function.prototype.apply;
  2851. var create = Object.create;
  2852. require_registered_extensions().async = function(tbi, conf) {
  2853. var waiting = create(null), cache18 = create(null), base = conf.memoized, original = conf.original, currentCallback, currentContext, currentArgs;
  2854. conf.memoized = defineLength(function(arg) {
  2855. var args = arguments, last = args[args.length - 1];
  2856. if (typeof last === 'function') {
  2857. currentCallback = last;
  2858. args = slice.call(args, 0, -1);
  2859. }
  2860. return base.apply(currentContext = this, currentArgs = args);
  2861. }, base);
  2862. try {
  2863. mixin(conf.memoized, base);
  2864. } catch (ignore) {}
  2865. conf.on('get', function(id) {
  2866. var cb, context3, args;
  2867. if (!currentCallback) {
  2868. return;
  2869. }
  2870. if (waiting[id]) {
  2871. if (typeof waiting[id] === 'function') {
  2872. waiting[id] = [ waiting[id], currentCallback ];
  2873. } else {
  2874. waiting[id].push(currentCallback);
  2875. }
  2876. currentCallback = null;
  2877. return;
  2878. }
  2879. cb = currentCallback;
  2880. context3 = currentContext;
  2881. args = currentArgs;
  2882. currentCallback = currentContext = currentArgs = null;
  2883. nextTick(function() {
  2884. var data2;
  2885. if (hasOwnProperty.call(cache18, id)) {
  2886. data2 = cache18[id];
  2887. conf.emit('getasync', id, args, context3);
  2888. apply.call(cb, data2.context, data2.args);
  2889. } else {
  2890. currentCallback = cb;
  2891. currentContext = context3;
  2892. currentArgs = args;
  2893. base.apply(context3, args);
  2894. }
  2895. });
  2896. });
  2897. conf.original = function() {
  2898. var args, cb, origCb, result;
  2899. if (!currentCallback) {
  2900. return apply.call(original, this, arguments);
  2901. }
  2902. args = aFrom(arguments);
  2903. cb = function self2(err2) {
  2904. var cb2, args2, id = self2.id;
  2905. if (id == null) {
  2906. nextTick(apply.bind(self2, this, arguments));
  2907. return void 0;
  2908. }
  2909. delete self2.id;
  2910. cb2 = waiting[id];
  2911. delete waiting[id];
  2912. if (!cb2) {
  2913. return void 0;
  2914. }
  2915. args2 = aFrom(arguments);
  2916. if (conf.has(id)) {
  2917. if (err2) {
  2918. conf['delete'](id);
  2919. } else {
  2920. cache18[id] = {
  2921. context: this,
  2922. args: args2
  2923. };
  2924. conf.emit('setasync', id, typeof cb2 === 'function' ? 1 : cb2.length);
  2925. }
  2926. }
  2927. if (typeof cb2 === 'function') {
  2928. result = apply.call(cb2, this, args2);
  2929. } else {
  2930. cb2.forEach(function(cb3) {
  2931. result = apply.call(cb3, this, args2);
  2932. }, this);
  2933. }
  2934. return result;
  2935. };
  2936. origCb = currentCallback;
  2937. currentCallback = currentContext = currentArgs = null;
  2938. args.push(cb);
  2939. result = apply.call(original, this, args);
  2940. cb.cb = origCb;
  2941. currentCallback = cb;
  2942. return result;
  2943. };
  2944. conf.on('set', function(id) {
  2945. if (!currentCallback) {
  2946. conf['delete'](id);
  2947. return;
  2948. }
  2949. if (waiting[id]) {
  2950. if (typeof waiting[id] === 'function') {
  2951. waiting[id] = [ waiting[id], currentCallback.cb ];
  2952. } else {
  2953. waiting[id].push(currentCallback.cb);
  2954. }
  2955. } else {
  2956. waiting[id] = currentCallback.cb;
  2957. }
  2958. delete currentCallback.cb;
  2959. currentCallback.id = id;
  2960. currentCallback = null;
  2961. });
  2962. conf.on('delete', function(id) {
  2963. var result;
  2964. if (hasOwnProperty.call(waiting, id)) {
  2965. return;
  2966. }
  2967. if (!cache18[id]) {
  2968. return;
  2969. }
  2970. result = cache18[id];
  2971. delete cache18[id];
  2972. conf.emit('deleteasync', id, slice.call(result.args, 1));
  2973. });
  2974. conf.on('clear', function() {
  2975. var oldCache = cache18;
  2976. cache18 = create(null);
  2977. conf.emit('clearasync', objectMap(oldCache, function(data2) {
  2978. return slice.call(data2.args, 1);
  2979. }));
  2980. });
  2981. };
  2982. });
  2983. var require_primitive_set = __commonJS(function(exports, module) {
  2984. 'use strict';
  2985. var forEach = Array.prototype.forEach;
  2986. var create = Object.create;
  2987. module.exports = function(arg) {
  2988. var set = create(null);
  2989. forEach.call(arguments, function(name) {
  2990. set[name] = true;
  2991. });
  2992. return set;
  2993. };
  2994. });
  2995. var require_is_callable = __commonJS(function(exports, module) {
  2996. 'use strict';
  2997. module.exports = function(obj) {
  2998. return typeof obj === 'function';
  2999. };
  3000. });
  3001. var require_validate_stringifiable = __commonJS(function(exports, module) {
  3002. 'use strict';
  3003. var isCallable = require_is_callable();
  3004. module.exports = function(stringifiable) {
  3005. try {
  3006. if (stringifiable && isCallable(stringifiable.toString)) {
  3007. return stringifiable.toString();
  3008. }
  3009. return String(stringifiable);
  3010. } catch (e) {
  3011. throw new TypeError('Passed argument cannot be stringifed');
  3012. }
  3013. };
  3014. });
  3015. var require_validate_stringifiable_value = __commonJS(function(exports, module) {
  3016. 'use strict';
  3017. var ensureValue = require_valid_value();
  3018. var stringifiable = require_validate_stringifiable();
  3019. module.exports = function(value) {
  3020. return stringifiable(ensureValue(value));
  3021. };
  3022. });
  3023. var require_safe_to_string = __commonJS(function(exports, module) {
  3024. 'use strict';
  3025. var isCallable = require_is_callable();
  3026. module.exports = function(value) {
  3027. try {
  3028. if (value && isCallable(value.toString)) {
  3029. return value.toString();
  3030. }
  3031. return String(value);
  3032. } catch (e) {
  3033. return '<Non-coercible to string value>';
  3034. }
  3035. };
  3036. });
  3037. var require_to_short_string_representation = __commonJS(function(exports, module) {
  3038. 'use strict';
  3039. var safeToString = require_safe_to_string();
  3040. var reNewLine = /[\n\r\u2028\u2029]/g;
  3041. module.exports = function(value) {
  3042. var string = safeToString(value);
  3043. if (string.length > 100) {
  3044. string = string.slice(0, 99) + '\u2026';
  3045. }
  3046. string = string.replace(reNewLine, function(_char) {
  3047. return JSON.stringify(_char).slice(1, -1);
  3048. });
  3049. return string;
  3050. };
  3051. });
  3052. var require_is_promise = __commonJS(function(exports, module) {
  3053. module.exports = isPromise;
  3054. module.exports['default'] = isPromise;
  3055. function isPromise(obj) {
  3056. return !!obj && (_typeof(obj) === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  3057. }
  3058. });
  3059. var require_promise = __commonJS(function() {
  3060. 'use strict';
  3061. var objectMap = require_map();
  3062. var primitiveSet = require_primitive_set();
  3063. var ensureString = require_validate_stringifiable_value();
  3064. var toShortString = require_to_short_string_representation();
  3065. var isPromise = require_is_promise();
  3066. var nextTick = require_next_tick();
  3067. var create = Object.create;
  3068. var supportedModes = primitiveSet('then', 'then:finally', 'done', 'done:finally');
  3069. require_registered_extensions().promise = function(mode, conf) {
  3070. var waiting = create(null), cache18 = create(null), promises = create(null);
  3071. if (mode === true) {
  3072. mode = null;
  3073. } else {
  3074. mode = ensureString(mode);
  3075. if (!supportedModes[mode]) {
  3076. throw new TypeError('\'' + toShortString(mode) + '\' is not valid promise mode');
  3077. }
  3078. }
  3079. conf.on('set', function(id, ignore, promise) {
  3080. var isFailed = false;
  3081. if (!isPromise(promise)) {
  3082. cache18[id] = promise;
  3083. conf.emit('setasync', id, 1);
  3084. return;
  3085. }
  3086. waiting[id] = 1;
  3087. promises[id] = promise;
  3088. var onSuccess = function onSuccess(result) {
  3089. var count = waiting[id];
  3090. if (isFailed) {
  3091. throw new Error('Memoizee error: Detected unordered then|done & finally resolution, which in turn makes proper detection of success/failure impossible (when in \'done:finally\' mode)\nConsider to rely on \'then\' or \'done\' mode instead.');
  3092. }
  3093. if (!count) {
  3094. return;
  3095. }
  3096. delete waiting[id];
  3097. cache18[id] = result;
  3098. conf.emit('setasync', id, count);
  3099. };
  3100. var onFailure = function onFailure() {
  3101. isFailed = true;
  3102. if (!waiting[id]) {
  3103. return;
  3104. }
  3105. delete waiting[id];
  3106. delete promises[id];
  3107. conf['delete'](id);
  3108. };
  3109. var resolvedMode = mode;
  3110. if (!resolvedMode) {
  3111. resolvedMode = 'then';
  3112. }
  3113. if (resolvedMode === 'then') {
  3114. var nextTickFailure = function nextTickFailure() {
  3115. nextTick(onFailure);
  3116. };
  3117. promise = promise.then(function(result) {
  3118. nextTick(onSuccess.bind(this, result));
  3119. }, nextTickFailure);
  3120. if (typeof promise['finally'] === 'function') {
  3121. promise['finally'](nextTickFailure);
  3122. }
  3123. } else if (resolvedMode === 'done') {
  3124. if (typeof promise.done !== 'function') {
  3125. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done\' mode');
  3126. }
  3127. promise.done(onSuccess, onFailure);
  3128. } else if (resolvedMode === 'done:finally') {
  3129. if (typeof promise.done !== 'function') {
  3130. throw new Error('Memoizee error: Retrieved promise does not implement \'done\' in \'done:finally\' mode');
  3131. }
  3132. if (typeof promise['finally'] !== 'function') {
  3133. throw new Error('Memoizee error: Retrieved promise does not implement \'finally\' in \'done:finally\' mode');
  3134. }
  3135. promise.done(onSuccess);
  3136. promise['finally'](onFailure);
  3137. }
  3138. });
  3139. conf.on('get', function(id, args, context3) {
  3140. var promise;
  3141. if (waiting[id]) {
  3142. ++waiting[id];
  3143. return;
  3144. }
  3145. promise = promises[id];
  3146. var emit = function emit() {
  3147. conf.emit('getasync', id, args, context3);
  3148. };
  3149. if (isPromise(promise)) {
  3150. if (typeof promise.done === 'function') {
  3151. promise.done(emit);
  3152. } else {
  3153. promise.then(function() {
  3154. nextTick(emit);
  3155. });
  3156. }
  3157. } else {
  3158. emit();
  3159. }
  3160. });
  3161. conf.on('delete', function(id) {
  3162. delete promises[id];
  3163. if (waiting[id]) {
  3164. delete waiting[id];
  3165. return;
  3166. }
  3167. if (!hasOwnProperty.call(cache18, id)) {
  3168. return;
  3169. }
  3170. var result = cache18[id];
  3171. delete cache18[id];
  3172. conf.emit('deleteasync', id, [ result ]);
  3173. });
  3174. conf.on('clear', function() {
  3175. var oldCache = cache18;
  3176. cache18 = create(null);
  3177. waiting = create(null);
  3178. promises = create(null);
  3179. conf.emit('clearasync', objectMap(oldCache, function(data2) {
  3180. return [ data2 ];
  3181. }));
  3182. });
  3183. };
  3184. });
  3185. var require_dispose = __commonJS(function() {
  3186. 'use strict';
  3187. var callable = require_valid_callable();
  3188. var forEach = require_for_each();
  3189. var extensions = require_registered_extensions();
  3190. var apply = Function.prototype.apply;
  3191. extensions.dispose = function(dispose, conf, options) {
  3192. var del;
  3193. callable(dispose);
  3194. if (options.async && extensions.async || options.promise && extensions.promise) {
  3195. conf.on('deleteasync', del = function del(id, resultArray) {
  3196. apply.call(dispose, null, resultArray);
  3197. });
  3198. conf.on('clearasync', function(cache18) {
  3199. forEach(cache18, function(result, id) {
  3200. del(id, result);
  3201. });
  3202. });
  3203. return;
  3204. }
  3205. conf.on('delete', del = function del(id, result) {
  3206. dispose(result);
  3207. });
  3208. conf.on('clear', function(cache18) {
  3209. forEach(cache18, function(result, id) {
  3210. del(id, result);
  3211. });
  3212. });
  3213. };
  3214. });
  3215. var require_max_timeout = __commonJS(function(exports, module) {
  3216. 'use strict';
  3217. module.exports = 2147483647;
  3218. });
  3219. var require_valid_timeout = __commonJS(function(exports, module) {
  3220. 'use strict';
  3221. var toPosInt = require_to_pos_integer();
  3222. var maxTimeout = require_max_timeout();
  3223. module.exports = function(value) {
  3224. value = toPosInt(value);
  3225. if (value > maxTimeout) {
  3226. throw new TypeError(value + ' exceeds maximum possible timeout');
  3227. }
  3228. return value;
  3229. };
  3230. });
  3231. var require_max_age = __commonJS(function() {
  3232. 'use strict';
  3233. var aFrom = require_from();
  3234. var forEach = require_for_each();
  3235. var nextTick = require_next_tick();
  3236. var isPromise = require_is_promise();
  3237. var timeout = require_valid_timeout();
  3238. var extensions = require_registered_extensions();
  3239. var noop3 = Function.prototype;
  3240. var max = Math.max;
  3241. var min = Math.min;
  3242. var create = Object.create;
  3243. extensions.maxAge = function(maxAge, conf, options) {
  3244. var timeouts, postfix, preFetchAge, preFetchTimeouts;
  3245. maxAge = timeout(maxAge);
  3246. if (!maxAge) {
  3247. return;
  3248. }
  3249. timeouts = create(null);
  3250. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3251. conf.on('set' + postfix, function(id) {
  3252. timeouts[id] = setTimeout(function() {
  3253. conf['delete'](id);
  3254. }, maxAge);
  3255. if (typeof timeouts[id].unref === 'function') {
  3256. timeouts[id].unref();
  3257. }
  3258. if (!preFetchTimeouts) {
  3259. return;
  3260. }
  3261. if (preFetchTimeouts[id]) {
  3262. if (preFetchTimeouts[id] !== 'nextTick') {
  3263. clearTimeout(preFetchTimeouts[id]);
  3264. }
  3265. }
  3266. preFetchTimeouts[id] = setTimeout(function() {
  3267. delete preFetchTimeouts[id];
  3268. }, preFetchAge);
  3269. if (typeof preFetchTimeouts[id].unref === 'function') {
  3270. preFetchTimeouts[id].unref();
  3271. }
  3272. });
  3273. conf.on('delete' + postfix, function(id) {
  3274. clearTimeout(timeouts[id]);
  3275. delete timeouts[id];
  3276. if (!preFetchTimeouts) {
  3277. return;
  3278. }
  3279. if (preFetchTimeouts[id] !== 'nextTick') {
  3280. clearTimeout(preFetchTimeouts[id]);
  3281. }
  3282. delete preFetchTimeouts[id];
  3283. });
  3284. if (options.preFetch) {
  3285. if (options.preFetch === true || isNaN(options.preFetch)) {
  3286. preFetchAge = .333;
  3287. } else {
  3288. preFetchAge = max(min(Number(options.preFetch), 1), 0);
  3289. }
  3290. if (preFetchAge) {
  3291. preFetchTimeouts = {};
  3292. preFetchAge = (1 - preFetchAge) * maxAge;
  3293. conf.on('get' + postfix, function(id, args, context3) {
  3294. if (!preFetchTimeouts[id]) {
  3295. preFetchTimeouts[id] = 'nextTick';
  3296. nextTick(function() {
  3297. var result;
  3298. if (preFetchTimeouts[id] !== 'nextTick') {
  3299. return;
  3300. }
  3301. delete preFetchTimeouts[id];
  3302. conf['delete'](id);
  3303. if (options.async) {
  3304. args = aFrom(args);
  3305. args.push(noop3);
  3306. }
  3307. result = conf.memoized.apply(context3, args);
  3308. if (options.promise) {
  3309. if (isPromise(result)) {
  3310. if (typeof result.done === 'function') {
  3311. result.done(noop3, noop3);
  3312. } else {
  3313. result.then(noop3, noop3);
  3314. }
  3315. }
  3316. }
  3317. });
  3318. }
  3319. });
  3320. }
  3321. }
  3322. conf.on('clear' + postfix, function() {
  3323. forEach(timeouts, function(id) {
  3324. clearTimeout(id);
  3325. });
  3326. timeouts = {};
  3327. if (preFetchTimeouts) {
  3328. forEach(preFetchTimeouts, function(id) {
  3329. if (id !== 'nextTick') {
  3330. clearTimeout(id);
  3331. }
  3332. });
  3333. preFetchTimeouts = {};
  3334. }
  3335. });
  3336. };
  3337. });
  3338. var require_lru_queue = __commonJS(function(exports, module) {
  3339. 'use strict';
  3340. var toPosInt = require_to_pos_integer();
  3341. var create = Object.create;
  3342. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  3343. module.exports = function(limit) {
  3344. var size = 0, base = 1, queue4 = create(null), map = create(null), index = 0, del;
  3345. limit = toPosInt(limit);
  3346. return {
  3347. hit: function hit(id) {
  3348. var oldIndex = map[id], nuIndex = ++index;
  3349. queue4[nuIndex] = id;
  3350. map[id] = nuIndex;
  3351. if (!oldIndex) {
  3352. ++size;
  3353. if (size <= limit) {
  3354. return;
  3355. }
  3356. id = queue4[base];
  3357. del(id);
  3358. return id;
  3359. }
  3360. delete queue4[oldIndex];
  3361. if (base !== oldIndex) {
  3362. return;
  3363. }
  3364. while (!hasOwnProperty2.call(queue4, ++base)) {
  3365. continue;
  3366. }
  3367. },
  3368. delete: del = function del(id) {
  3369. var oldIndex = map[id];
  3370. if (!oldIndex) {
  3371. return;
  3372. }
  3373. delete queue4[oldIndex];
  3374. delete map[id];
  3375. --size;
  3376. if (base !== oldIndex) {
  3377. return;
  3378. }
  3379. if (!size) {
  3380. index = 0;
  3381. base = 1;
  3382. return;
  3383. }
  3384. while (!hasOwnProperty2.call(queue4, ++base)) {
  3385. continue;
  3386. }
  3387. },
  3388. clear: function clear() {
  3389. size = 0;
  3390. base = 1;
  3391. queue4 = create(null);
  3392. map = create(null);
  3393. index = 0;
  3394. }
  3395. };
  3396. };
  3397. });
  3398. var require_max = __commonJS(function() {
  3399. 'use strict';
  3400. var toPosInteger = require_to_pos_integer();
  3401. var lruQueue = require_lru_queue();
  3402. var extensions = require_registered_extensions();
  3403. extensions.max = function(max, conf, options) {
  3404. var postfix, queue4, hit;
  3405. max = toPosInteger(max);
  3406. if (!max) {
  3407. return;
  3408. }
  3409. queue4 = lruQueue(max);
  3410. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3411. conf.on('set' + postfix, hit = function hit(id) {
  3412. id = queue4.hit(id);
  3413. if (id === void 0) {
  3414. return;
  3415. }
  3416. conf['delete'](id);
  3417. });
  3418. conf.on('get' + postfix, hit);
  3419. conf.on('delete' + postfix, queue4['delete']);
  3420. conf.on('clear' + postfix, queue4.clear);
  3421. };
  3422. });
  3423. var require_ref_counter = __commonJS(function() {
  3424. 'use strict';
  3425. var d = require_d();
  3426. var extensions = require_registered_extensions();
  3427. var create = Object.create;
  3428. var defineProperties = Object.defineProperties;
  3429. extensions.refCounter = function(ignore, conf, options) {
  3430. var cache18, postfix;
  3431. cache18 = create(null);
  3432. postfix = options.async && extensions.async || options.promise && extensions.promise ? 'async' : '';
  3433. conf.on('set' + postfix, function(id, length) {
  3434. cache18[id] = length || 1;
  3435. });
  3436. conf.on('get' + postfix, function(id) {
  3437. ++cache18[id];
  3438. });
  3439. conf.on('delete' + postfix, function(id) {
  3440. delete cache18[id];
  3441. });
  3442. conf.on('clear' + postfix, function() {
  3443. cache18 = {};
  3444. });
  3445. defineProperties(conf.memoized, {
  3446. deleteRef: d(function() {
  3447. var id = conf.get(arguments);
  3448. if (id === null) {
  3449. return null;
  3450. }
  3451. if (!cache18[id]) {
  3452. return null;
  3453. }
  3454. if (!--cache18[id]) {
  3455. conf['delete'](id);
  3456. return true;
  3457. }
  3458. return false;
  3459. }),
  3460. getRefCount: d(function() {
  3461. var id = conf.get(arguments);
  3462. if (id === null) {
  3463. return 0;
  3464. }
  3465. if (!cache18[id]) {
  3466. return 0;
  3467. }
  3468. return cache18[id];
  3469. })
  3470. });
  3471. };
  3472. });
  3473. var require_memoizee = __commonJS(function(exports, module) {
  3474. 'use strict';
  3475. var normalizeOpts = require_normalize_options();
  3476. var resolveLength = require_resolve_length();
  3477. var plain = require_plain();
  3478. module.exports = function(fn) {
  3479. var options = normalizeOpts(arguments[1]), length;
  3480. if (!options.normalizer) {
  3481. length = options.length = resolveLength(options.length, fn.length, options.async);
  3482. if (length !== 0) {
  3483. if (options.primitive) {
  3484. if (length === false) {
  3485. options.normalizer = require_primitive();
  3486. } else if (length > 1) {
  3487. options.normalizer = require_get_primitive_fixed()(length);
  3488. }
  3489. } else if (length === false) {
  3490. options.normalizer = require_get()();
  3491. } else if (length === 1) {
  3492. options.normalizer = require_get_1()();
  3493. } else {
  3494. options.normalizer = require_get_fixed()(length);
  3495. }
  3496. }
  3497. }
  3498. if (options.async) {
  3499. require_async();
  3500. }
  3501. if (options.promise) {
  3502. require_promise();
  3503. }
  3504. if (options.dispose) {
  3505. require_dispose();
  3506. }
  3507. if (options.maxAge) {
  3508. require_max_age();
  3509. }
  3510. if (options.max) {
  3511. require_max();
  3512. }
  3513. if (options.refCounter) {
  3514. require_ref_counter();
  3515. }
  3516. return plain(fn, options);
  3517. };
  3518. });
  3519. var require_emoji_regex = __commonJS(function(exports, module) {
  3520. 'use strict';
  3521. module.exports = function() {
  3522. return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\
  3523. };
  3524. });
  3525. var require_doT = __commonJS(function(exports, module) {
  3526. (function() {
  3527. 'use strict';
  3528. var doT3 = {
  3529. name: 'doT',
  3530. version: '1.1.1',
  3531. templateSettings: {
  3532. evaluate: /\{\{([\s\S]+?(\}?)+)\}\}/g,
  3533. interpolate: /\{\{=([\s\S]+?)\}\}/g,
  3534. encode: /\{\{!([\s\S]+?)\}\}/g,
  3535. use: /\{\{#([\s\S]+?)\}\}/g,
  3536. useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
  3537. define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
  3538. defineParams: /^\s*([\w$]+):([\s\S]+)/,
  3539. conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
  3540. iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
  3541. varname: 'it',
  3542. strip: true,
  3543. append: true,
  3544. selfcontained: false,
  3545. doNotSkipEncoded: false
  3546. },
  3547. template: void 0,
  3548. compile: void 0,
  3549. log: true
  3550. };
  3551. (function() {
  3552. if ((typeof globalThis === 'undefined' ? 'undefined' : _typeof(globalThis)) === 'object') {
  3553. return;
  3554. }
  3555. try {
  3556. Object.defineProperty(Object.prototype, '__magic__', {
  3557. get: function get() {
  3558. return this;
  3559. },
  3560. configurable: true
  3561. });
  3562. __magic__.globalThis = __magic__;
  3563. delete Object.prototype.__magic__;
  3564. } catch (e) {
  3565. window.globalThis = function() {
  3566. if (typeof self !== 'undefined') {
  3567. return self;
  3568. }
  3569. if (typeof window !== 'undefined') {
  3570. return window;
  3571. }
  3572. if (typeof global !== 'undefined') {
  3573. return global;
  3574. }
  3575. if (typeof this !== 'undefined') {
  3576. return this;
  3577. }
  3578. throw new Error('Unable to locate global `this`');
  3579. }();
  3580. }
  3581. })();
  3582. doT3.encodeHTMLSource = function(doNotSkipEncoded) {
  3583. var encodeHTMLRules = {
  3584. '&': '&#38;',
  3585. '<': '&#60;',
  3586. '>': '&#62;',
  3587. '"': '&#34;',
  3588. '\'': '&#39;',
  3589. '/': '&#47;'
  3590. }, matchHTML = doNotSkipEncoded ? /[&<>"'\/]/g : /&(?!#?\w+;)|<|>|"|'|\//g;
  3591. return function(code) {
  3592. return code ? code.toString().replace(matchHTML, function(m) {
  3593. return encodeHTMLRules[m] || m;
  3594. }) : '';
  3595. };
  3596. };
  3597. if (typeof module !== 'undefined' && module.exports) {
  3598. module.exports = doT3;
  3599. } else if (typeof define === 'function' && define.amd) {
  3600. define(function() {
  3601. return doT3;
  3602. });
  3603. } else {
  3604. globalThis.doT = doT3;
  3605. }
  3606. var startend = {
  3607. append: {
  3608. start: '\'+(',
  3609. end: ')+\'',
  3610. startencode: '\'+encodeHTML('
  3611. },
  3612. split: {
  3613. start: '\';out+=(',
  3614. end: ');out+=\'',
  3615. startencode: '\';out+=encodeHTML('
  3616. }
  3617. }, skip = /$^/;
  3618. function resolveDefs(c, block, def) {
  3619. return (typeof block === 'string' ? block : block.toString()).replace(c.define || skip, function(m, code, assign, value) {
  3620. if (code.indexOf('def.') === 0) {
  3621. code = code.substring(4);
  3622. }
  3623. if (!(code in def)) {
  3624. if (assign === ':') {
  3625. if (c.defineParams) {
  3626. value.replace(c.defineParams, function(m2, param, v) {
  3627. def[code] = {
  3628. arg: param,
  3629. text: v
  3630. };
  3631. });
  3632. }
  3633. if (!(code in def)) {
  3634. def[code] = value;
  3635. }
  3636. } else {
  3637. new Function('def', 'def[\'' + code + '\']=' + value)(def);
  3638. }
  3639. }
  3640. return '';
  3641. }).replace(c.use || skip, function(m, code) {
  3642. if (c.useParams) {
  3643. code = code.replace(c.useParams, function(m2, s, d, param) {
  3644. if (def[d] && def[d].arg && param) {
  3645. var rw = (d + ':' + param).replace(/'|\\/g, '_');
  3646. def.__exp = def.__exp || {};
  3647. def.__exp[rw] = def[d].text.replace(new RegExp('(^|[^\\w$])' + def[d].arg + '([^\\w$])', 'g'), '$1' + param + '$2');
  3648. return s + 'def.__exp[\'' + rw + '\']';
  3649. }
  3650. });
  3651. }
  3652. var v = new Function('def', 'return ' + code)(def);
  3653. return v ? resolveDefs(c, v, def) : v;
  3654. });
  3655. }
  3656. function unescape(code) {
  3657. return code.replace(/\\('|\\)/g, '$1').replace(/[\r\t\n]/g, ' ');
  3658. }
  3659. doT3.template = function(tmpl, c, def) {
  3660. c = c || doT3.templateSettings;
  3661. var cse = c.append ? startend.append : startend.split, needhtmlencode, sid = 0, indv, str = c.use || c.define ? resolveDefs(c, tmpl, def || {}) : tmpl;
  3662. str = ('var out=\'' + (c.strip ? str.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, ' ').replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, '') : str).replace(/'|\\/g, '\\$&').replace(c.interpolate || skip, function(m, code) {
  3663. return cse.start + unescape(code) + cse.end;
  3664. }).replace(c.encode || skip, function(m, code) {
  3665. needhtmlencode = true;
  3666. return cse.startencode + unescape(code) + cse.end;
  3667. }).replace(c.conditional || skip, function(m, elsecase, code) {
  3668. return elsecase ? code ? '\';}else if(' + unescape(code) + '){out+=\'' : '\';}else{out+=\'' : code ? '\';if(' + unescape(code) + '){out+=\'' : '\';}out+=\'';
  3669. }).replace(c.iterate || skip, function(m, iterate, vname, iname) {
  3670. if (!iterate) {
  3671. return '\';} } out+=\'';
  3672. }
  3673. sid += 1;
  3674. indv = iname || 'i' + sid;
  3675. iterate = unescape(iterate);
  3676. return '\';var arr' + sid + '=' + iterate + ';if(arr' + sid + '){var ' + vname + ',' + indv + '=-1,l' + sid + '=arr' + sid + '.length-1;while(' + indv + '<l' + sid + '){' + vname + '=arr' + sid + '[' + indv + '+=1];out+=\'';
  3677. }).replace(c.evaluate || skip, function(m, code) {
  3678. return '\';' + unescape(code) + 'out+=\'';
  3679. }) + '\';return out;').replace(/\n/g, '\\n').replace(/\t/g, '\\t').replace(/\r/g, '\\r').replace(/(\s|;|\}|^|\{)out\+='';/g, '$1').replace(/\+''/g, '');
  3680. if (needhtmlencode) {
  3681. if (!c.selfcontained && globalThis && !globalThis._encodeHTML) {
  3682. globalThis._encodeHTML = doT3.encodeHTMLSource(c.doNotSkipEncoded);
  3683. }
  3684. str = 'var encodeHTML = typeof _encodeHTML !== \'undefined\' ? _encodeHTML : (' + doT3.encodeHTMLSource.toString() + '(' + (c.doNotSkipEncoded || '') + '));' + str;
  3685. }
  3686. try {
  3687. return new Function(c.varname, str);
  3688. } catch (e) {
  3689. if (typeof console !== 'undefined') {
  3690. console.log('Could not create a template function: ' + str);
  3691. }
  3692. throw e;
  3693. }
  3694. };
  3695. doT3.compile = function(tmpl, def) {
  3696. return doT3.template(tmpl, null, def);
  3697. };
  3698. })();
  3699. });
  3700. var require_es6_promise = __commonJS(function(exports, module) {
  3701. (function(global2, factory) {
  3702. _typeof(exports) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global2.ES6Promise = factory();
  3703. })(exports, function() {
  3704. 'use strict';
  3705. function objectOrFunction(x) {
  3706. var type = _typeof(x);
  3707. return x !== null && (type === 'object' || type === 'function');
  3708. }
  3709. function isFunction(x) {
  3710. return typeof x === 'function';
  3711. }
  3712. var _isArray = void 0;
  3713. if (Array.isArray) {
  3714. _isArray = Array.isArray;
  3715. } else {
  3716. _isArray = function _isArray(x) {
  3717. return Object.prototype.toString.call(x) === '[object Array]';
  3718. };
  3719. }
  3720. var isArray = _isArray;
  3721. var len = 0;
  3722. var vertxNext = void 0;
  3723. var customSchedulerFn = void 0;
  3724. var asap = function asap2(callback, arg) {
  3725. queue4[len] = callback;
  3726. queue4[len + 1] = arg;
  3727. len += 2;
  3728. if (len === 2) {
  3729. if (customSchedulerFn) {
  3730. customSchedulerFn(flush);
  3731. } else {
  3732. scheduleFlush();
  3733. }
  3734. }
  3735. };
  3736. function setScheduler(scheduleFn) {
  3737. customSchedulerFn = scheduleFn;
  3738. }
  3739. function setAsap(asapFn) {
  3740. asap = asapFn;
  3741. }
  3742. var browserWindow = typeof window !== 'undefined' ? window : void 0;
  3743. var browserGlobal = browserWindow || {};
  3744. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  3745. var isNode2 = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
  3746. var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
  3747. function useNextTick() {
  3748. return function() {
  3749. return process.nextTick(flush);
  3750. };
  3751. }
  3752. function useVertxTimer() {
  3753. if (typeof vertxNext !== 'undefined') {
  3754. return function() {
  3755. vertxNext(flush);
  3756. };
  3757. }
  3758. return useSetTimeout();
  3759. }
  3760. function useMutationObserver() {
  3761. var iterations = 0;
  3762. var observer = new BrowserMutationObserver(flush);
  3763. var node = document.createTextNode('');
  3764. observer.observe(node, {
  3765. characterData: true
  3766. });
  3767. return function() {
  3768. node.data = iterations = ++iterations % 2;
  3769. };
  3770. }
  3771. function useMessageChannel() {
  3772. var channel = new MessageChannel();
  3773. channel.port1.onmessage = flush;
  3774. return function() {
  3775. return channel.port2.postMessage(0);
  3776. };
  3777. }
  3778. function useSetTimeout() {
  3779. var globalSetTimeout = setTimeout;
  3780. return function() {
  3781. return globalSetTimeout(flush, 1);
  3782. };
  3783. }
  3784. var queue4 = new Array(1e3);
  3785. function flush() {
  3786. for (var i = 0; i < len; i += 2) {
  3787. var callback = queue4[i];
  3788. var arg = queue4[i + 1];
  3789. callback(arg);
  3790. queue4[i] = void 0;
  3791. queue4[i + 1] = void 0;
  3792. }
  3793. len = 0;
  3794. }
  3795. function attemptVertx() {
  3796. try {
  3797. var vertx = Function('return this')().require('vertx');
  3798. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  3799. return useVertxTimer();
  3800. } catch (e) {
  3801. return useSetTimeout();
  3802. }
  3803. }
  3804. var scheduleFlush = void 0;
  3805. if (isNode2) {
  3806. scheduleFlush = useNextTick();
  3807. } else if (BrowserMutationObserver) {
  3808. scheduleFlush = useMutationObserver();
  3809. } else if (isWorker) {
  3810. scheduleFlush = useMessageChannel();
  3811. } else if (browserWindow === void 0 && true) {
  3812. scheduleFlush = attemptVertx();
  3813. } else {
  3814. scheduleFlush = useSetTimeout();
  3815. }
  3816. function then(onFulfillment, onRejection) {
  3817. var parent = this;
  3818. var child = new this.constructor(noop3);
  3819. if (child[PROMISE_ID] === void 0) {
  3820. makePromise(child);
  3821. }
  3822. var _state = parent._state;
  3823. if (_state) {
  3824. var callback = arguments[_state - 1];
  3825. asap(function() {
  3826. return invokeCallback(_state, child, callback, parent._result);
  3827. });
  3828. } else {
  3829. subscribe2(parent, child, onFulfillment, onRejection);
  3830. }
  3831. return child;
  3832. }
  3833. function resolve$1(object) {
  3834. var Constructor = this;
  3835. if (object && _typeof(object) === 'object' && object.constructor === Constructor) {
  3836. return object;
  3837. }
  3838. var promise = new Constructor(noop3);
  3839. resolve(promise, object);
  3840. return promise;
  3841. }
  3842. var PROMISE_ID = Math.random().toString(36).substring(2);
  3843. function noop3() {}
  3844. var PENDING = void 0;
  3845. var FULFILLED = 1;
  3846. var REJECTED = 2;
  3847. function selfFulfillment() {
  3848. return new TypeError('You cannot resolve a promise with itself');
  3849. }
  3850. function cannotReturnOwn() {
  3851. return new TypeError('A promises callback cannot return that same promise.');
  3852. }
  3853. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  3854. try {
  3855. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  3856. } catch (e) {
  3857. return e;
  3858. }
  3859. }
  3860. function handleForeignThenable(promise, thenable, then$$1) {
  3861. asap(function(promise2) {
  3862. var sealed = false;
  3863. var error = tryThen(then$$1, thenable, function(value) {
  3864. if (sealed) {
  3865. return;
  3866. }
  3867. sealed = true;
  3868. if (thenable !== value) {
  3869. resolve(promise2, value);
  3870. } else {
  3871. fulfill(promise2, value);
  3872. }
  3873. }, function(reason) {
  3874. if (sealed) {
  3875. return;
  3876. }
  3877. sealed = true;
  3878. reject(promise2, reason);
  3879. }, 'Settle: ' + (promise2._label || ' unknown promise'));
  3880. if (!sealed && error) {
  3881. sealed = true;
  3882. reject(promise2, error);
  3883. }
  3884. }, promise);
  3885. }
  3886. function handleOwnThenable(promise, thenable) {
  3887. if (thenable._state === FULFILLED) {
  3888. fulfill(promise, thenable._result);
  3889. } else if (thenable._state === REJECTED) {
  3890. reject(promise, thenable._result);
  3891. } else {
  3892. subscribe2(thenable, void 0, function(value) {
  3893. return resolve(promise, value);
  3894. }, function(reason) {
  3895. return reject(promise, reason);
  3896. });
  3897. }
  3898. }
  3899. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  3900. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  3901. handleOwnThenable(promise, maybeThenable);
  3902. } else {
  3903. if (then$$1 === void 0) {
  3904. fulfill(promise, maybeThenable);
  3905. } else if (isFunction(then$$1)) {
  3906. handleForeignThenable(promise, maybeThenable, then$$1);
  3907. } else {
  3908. fulfill(promise, maybeThenable);
  3909. }
  3910. }
  3911. }
  3912. function resolve(promise, value) {
  3913. if (promise === value) {
  3914. reject(promise, selfFulfillment());
  3915. } else if (objectOrFunction(value)) {
  3916. var then$$1 = void 0;
  3917. try {
  3918. then$$1 = value.then;
  3919. } catch (error) {
  3920. reject(promise, error);
  3921. return;
  3922. }
  3923. handleMaybeThenable(promise, value, then$$1);
  3924. } else {
  3925. fulfill(promise, value);
  3926. }
  3927. }
  3928. function publishRejection(promise) {
  3929. if (promise._onerror) {
  3930. promise._onerror(promise._result);
  3931. }
  3932. publish(promise);
  3933. }
  3934. function fulfill(promise, value) {
  3935. if (promise._state !== PENDING) {
  3936. return;
  3937. }
  3938. promise._result = value;
  3939. promise._state = FULFILLED;
  3940. if (promise._subscribers.length !== 0) {
  3941. asap(publish, promise);
  3942. }
  3943. }
  3944. function reject(promise, reason) {
  3945. if (promise._state !== PENDING) {
  3946. return;
  3947. }
  3948. promise._state = REJECTED;
  3949. promise._result = reason;
  3950. asap(publishRejection, promise);
  3951. }
  3952. function subscribe2(parent, child, onFulfillment, onRejection) {
  3953. var _subscribers = parent._subscribers;
  3954. var length = _subscribers.length;
  3955. parent._onerror = null;
  3956. _subscribers[length] = child;
  3957. _subscribers[length + FULFILLED] = onFulfillment;
  3958. _subscribers[length + REJECTED] = onRejection;
  3959. if (length === 0 && parent._state) {
  3960. asap(publish, parent);
  3961. }
  3962. }
  3963. function publish(promise) {
  3964. var subscribers2 = promise._subscribers;
  3965. var settled = promise._state;
  3966. if (subscribers2.length === 0) {
  3967. return;
  3968. }
  3969. var child = void 0, callback = void 0, detail = promise._result;
  3970. for (var i = 0; i < subscribers2.length; i += 3) {
  3971. child = subscribers2[i];
  3972. callback = subscribers2[i + settled];
  3973. if (child) {
  3974. invokeCallback(settled, child, callback, detail);
  3975. } else {
  3976. callback(detail);
  3977. }
  3978. }
  3979. promise._subscribers.length = 0;
  3980. }
  3981. function invokeCallback(settled, promise, callback, detail) {
  3982. var hasCallback = isFunction(callback), value = void 0, error = void 0, succeeded = true;
  3983. if (hasCallback) {
  3984. try {
  3985. value = callback(detail);
  3986. } catch (e) {
  3987. succeeded = false;
  3988. error = e;
  3989. }
  3990. if (promise === value) {
  3991. reject(promise, cannotReturnOwn());
  3992. return;
  3993. }
  3994. } else {
  3995. value = detail;
  3996. }
  3997. if (promise._state !== PENDING) {} else if (hasCallback && succeeded) {
  3998. resolve(promise, value);
  3999. } else if (succeeded === false) {
  4000. reject(promise, error);
  4001. } else if (settled === FULFILLED) {
  4002. fulfill(promise, value);
  4003. } else if (settled === REJECTED) {
  4004. reject(promise, value);
  4005. }
  4006. }
  4007. function initializePromise(promise, resolver) {
  4008. try {
  4009. resolver(function resolvePromise(value) {
  4010. resolve(promise, value);
  4011. }, function rejectPromise(reason) {
  4012. reject(promise, reason);
  4013. });
  4014. } catch (e) {
  4015. reject(promise, e);
  4016. }
  4017. }
  4018. var id = 0;
  4019. function nextId() {
  4020. return id++;
  4021. }
  4022. function makePromise(promise) {
  4023. promise[PROMISE_ID] = id++;
  4024. promise._state = void 0;
  4025. promise._result = void 0;
  4026. promise._subscribers = [];
  4027. }
  4028. function validationError() {
  4029. return new Error('Array Methods must be provided an Array');
  4030. }
  4031. var Enumerator = function() {
  4032. function Enumerator2(Constructor, input) {
  4033. this._instanceConstructor = Constructor;
  4034. this.promise = new Constructor(noop3);
  4035. if (!this.promise[PROMISE_ID]) {
  4036. makePromise(this.promise);
  4037. }
  4038. if (isArray(input)) {
  4039. this.length = input.length;
  4040. this._remaining = input.length;
  4041. this._result = new Array(this.length);
  4042. if (this.length === 0) {
  4043. fulfill(this.promise, this._result);
  4044. } else {
  4045. this.length = this.length || 0;
  4046. this._enumerate(input);
  4047. if (this._remaining === 0) {
  4048. fulfill(this.promise, this._result);
  4049. }
  4050. }
  4051. } else {
  4052. reject(this.promise, validationError());
  4053. }
  4054. }
  4055. Enumerator2.prototype._enumerate = function _enumerate(input) {
  4056. for (var i = 0; this._state === PENDING && i < input.length; i++) {
  4057. this._eachEntry(input[i], i);
  4058. }
  4059. };
  4060. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i) {
  4061. var c = this._instanceConstructor;
  4062. var resolve$$1 = c.resolve;
  4063. if (resolve$$1 === resolve$1) {
  4064. var _then = void 0;
  4065. var error = void 0;
  4066. var didError = false;
  4067. try {
  4068. _then = entry.then;
  4069. } catch (e) {
  4070. didError = true;
  4071. error = e;
  4072. }
  4073. if (_then === then && entry._state !== PENDING) {
  4074. this._settledAt(entry._state, i, entry._result);
  4075. } else if (typeof _then !== 'function') {
  4076. this._remaining--;
  4077. this._result[i] = entry;
  4078. } else if (c === Promise$1) {
  4079. var promise = new c(noop3);
  4080. if (didError) {
  4081. reject(promise, error);
  4082. } else {
  4083. handleMaybeThenable(promise, entry, _then);
  4084. }
  4085. this._willSettleAt(promise, i);
  4086. } else {
  4087. this._willSettleAt(new c(function(resolve$$12) {
  4088. return resolve$$12(entry);
  4089. }), i);
  4090. }
  4091. } else {
  4092. this._willSettleAt(resolve$$1(entry), i);
  4093. }
  4094. };
  4095. Enumerator2.prototype._settledAt = function _settledAt(state, i, value) {
  4096. var promise = this.promise;
  4097. if (promise._state === PENDING) {
  4098. this._remaining--;
  4099. if (state === REJECTED) {
  4100. reject(promise, value);
  4101. } else {
  4102. this._result[i] = value;
  4103. }
  4104. }
  4105. if (this._remaining === 0) {
  4106. fulfill(promise, this._result);
  4107. }
  4108. };
  4109. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i) {
  4110. var enumerator = this;
  4111. subscribe2(promise, void 0, function(value) {
  4112. return enumerator._settledAt(FULFILLED, i, value);
  4113. }, function(reason) {
  4114. return enumerator._settledAt(REJECTED, i, reason);
  4115. });
  4116. };
  4117. return Enumerator2;
  4118. }();
  4119. function all(entries) {
  4120. return new Enumerator(this, entries).promise;
  4121. }
  4122. function race(entries) {
  4123. var Constructor = this;
  4124. if (!isArray(entries)) {
  4125. return new Constructor(function(_, reject2) {
  4126. return reject2(new TypeError('You must pass an array to race.'));
  4127. });
  4128. } else {
  4129. return new Constructor(function(resolve2, reject2) {
  4130. var length = entries.length;
  4131. for (var i = 0; i < length; i++) {
  4132. Constructor.resolve(entries[i]).then(resolve2, reject2);
  4133. }
  4134. });
  4135. }
  4136. }
  4137. function reject$1(reason) {
  4138. var Constructor = this;
  4139. var promise = new Constructor(noop3);
  4140. reject(promise, reason);
  4141. return promise;
  4142. }
  4143. function needsResolver() {
  4144. throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
  4145. }
  4146. function needsNew() {
  4147. throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
  4148. }
  4149. var Promise$1 = function() {
  4150. function Promise2(resolver) {
  4151. this[PROMISE_ID] = nextId();
  4152. this._result = this._state = void 0;
  4153. this._subscribers = [];
  4154. if (noop3 !== resolver) {
  4155. typeof resolver !== 'function' && needsResolver();
  4156. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  4157. }
  4158. }
  4159. Promise2.prototype['catch'] = function _catch(onRejection) {
  4160. return this.then(null, onRejection);
  4161. };
  4162. Promise2.prototype['finally'] = function _finally(callback) {
  4163. var promise = this;
  4164. var constructor = promise.constructor;
  4165. if (isFunction(callback)) {
  4166. return promise.then(function(value) {
  4167. return constructor.resolve(callback()).then(function() {
  4168. return value;
  4169. });
  4170. }, function(reason) {
  4171. return constructor.resolve(callback()).then(function() {
  4172. throw reason;
  4173. });
  4174. });
  4175. }
  4176. return promise.then(callback, callback);
  4177. };
  4178. return Promise2;
  4179. }();
  4180. Promise$1.prototype.then = then;
  4181. Promise$1.all = all;
  4182. Promise$1.race = race;
  4183. Promise$1.resolve = resolve$1;
  4184. Promise$1.reject = reject$1;
  4185. Promise$1._setScheduler = setScheduler;
  4186. Promise$1._setAsap = setAsap;
  4187. Promise$1._asap = asap;
  4188. function polyfill() {
  4189. var local = void 0;
  4190. if (typeof global !== 'undefined') {
  4191. local = global;
  4192. } else if (typeof self !== 'undefined') {
  4193. local = self;
  4194. } else {
  4195. try {
  4196. local = Function('return this')();
  4197. } catch (e) {
  4198. throw new Error('polyfill failed because global object is unavailable in this environment');
  4199. }
  4200. }
  4201. var P = local.Promise;
  4202. if (P) {
  4203. var promiseToString = null;
  4204. try {
  4205. promiseToString = Object.prototype.toString.call(P.resolve());
  4206. } catch (e) {}
  4207. if (promiseToString === '[object Promise]' && !P.cast) {
  4208. return;
  4209. }
  4210. }
  4211. local.Promise = Promise$1;
  4212. }
  4213. Promise$1.polyfill = polyfill;
  4214. Promise$1.Promise = Promise$1;
  4215. return Promise$1;
  4216. });
  4217. });
  4218. var require_typedarray = __commonJS(function(exports) {
  4219. var undefined2 = void 0;
  4220. var MAX_ARRAY_LENGTH = 1e5;
  4221. var ECMAScript = function() {
  4222. var opts = Object.prototype.toString, ophop = Object.prototype.hasOwnProperty;
  4223. return {
  4224. Class: function Class(v) {
  4225. return opts.call(v).replace(/^\[object *|\]$/g, '');
  4226. },
  4227. HasProperty: function HasProperty(o, p) {
  4228. return p in o;
  4229. },
  4230. HasOwnProperty: function HasOwnProperty(o, p) {
  4231. return ophop.call(o, p);
  4232. },
  4233. IsCallable: function IsCallable(o) {
  4234. return typeof o === 'function';
  4235. },
  4236. ToInt32: function ToInt32(v) {
  4237. return v >> 0;
  4238. },
  4239. ToUint32: function ToUint32(v) {
  4240. return v >>> 0;
  4241. }
  4242. };
  4243. }();
  4244. var LN2 = Math.LN2;
  4245. var abs = Math.abs;
  4246. var floor = Math.floor;
  4247. var log10 = Math.log;
  4248. var min = Math.min;
  4249. var pow = Math.pow;
  4250. var round = Math.round;
  4251. function configureProperties(obj) {
  4252. if (getOwnPropNames && defineProp) {
  4253. var props = getOwnPropNames(obj), i;
  4254. for (i = 0; i < props.length; i += 1) {
  4255. defineProp(obj, props[i], {
  4256. value: obj[props[i]],
  4257. writable: false,
  4258. enumerable: false,
  4259. configurable: false
  4260. });
  4261. }
  4262. }
  4263. }
  4264. var defineProp;
  4265. if (Object.defineProperty && function() {
  4266. try {
  4267. Object.defineProperty({}, 'x', {});
  4268. return true;
  4269. } catch (e) {
  4270. return false;
  4271. }
  4272. }()) {
  4273. defineProp = Object.defineProperty;
  4274. } else {
  4275. defineProp = function defineProp(o, p, desc) {
  4276. if (!o === Object(o)) {
  4277. throw new TypeError('Object.defineProperty called on non-object');
  4278. }
  4279. if (ECMAScript.HasProperty(desc, 'get') && Object.prototype.__defineGetter__) {
  4280. Object.prototype.__defineGetter__.call(o, p, desc.get);
  4281. }
  4282. if (ECMAScript.HasProperty(desc, 'set') && Object.prototype.__defineSetter__) {
  4283. Object.prototype.__defineSetter__.call(o, p, desc.set);
  4284. }
  4285. if (ECMAScript.HasProperty(desc, 'value')) {
  4286. o[p] = desc.value;
  4287. }
  4288. return o;
  4289. };
  4290. }
  4291. var getOwnPropNames = Object.getOwnPropertyNames || function(o) {
  4292. if (o !== Object(o)) {
  4293. throw new TypeError('Object.getOwnPropertyNames called on non-object');
  4294. }
  4295. var props = [], p;
  4296. for (p in o) {
  4297. if (ECMAScript.HasOwnProperty(o, p)) {
  4298. props.push(p);
  4299. }
  4300. }
  4301. return props;
  4302. };
  4303. function makeArrayAccessors(obj) {
  4304. if (!defineProp) {
  4305. return;
  4306. }
  4307. if (obj.length > MAX_ARRAY_LENGTH) {
  4308. throw new RangeError('Array too large for polyfill');
  4309. }
  4310. function makeArrayAccessor(index) {
  4311. defineProp(obj, index, {
  4312. get: function get() {
  4313. return obj._getter(index);
  4314. },
  4315. set: function set(v) {
  4316. obj._setter(index, v);
  4317. },
  4318. enumerable: true,
  4319. configurable: false
  4320. });
  4321. }
  4322. var i;
  4323. for (i = 0; i < obj.length; i += 1) {
  4324. makeArrayAccessor(i);
  4325. }
  4326. }
  4327. function as_signed(value, bits) {
  4328. var s = 32 - bits;
  4329. return value << s >> s;
  4330. }
  4331. function as_unsigned(value, bits) {
  4332. var s = 32 - bits;
  4333. return value << s >>> s;
  4334. }
  4335. function packI8(n) {
  4336. return [ n & 255 ];
  4337. }
  4338. function unpackI8(bytes) {
  4339. return as_signed(bytes[0], 8);
  4340. }
  4341. function packU8(n) {
  4342. return [ n & 255 ];
  4343. }
  4344. function unpackU8(bytes) {
  4345. return as_unsigned(bytes[0], 8);
  4346. }
  4347. function packU8Clamped(n) {
  4348. n = round(Number(n));
  4349. return [ n < 0 ? 0 : n > 255 ? 255 : n & 255 ];
  4350. }
  4351. function packI16(n) {
  4352. return [ n >> 8 & 255, n & 255 ];
  4353. }
  4354. function unpackI16(bytes) {
  4355. return as_signed(bytes[0] << 8 | bytes[1], 16);
  4356. }
  4357. function packU16(n) {
  4358. return [ n >> 8 & 255, n & 255 ];
  4359. }
  4360. function unpackU16(bytes) {
  4361. return as_unsigned(bytes[0] << 8 | bytes[1], 16);
  4362. }
  4363. function packI32(n) {
  4364. return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
  4365. }
  4366. function unpackI32(bytes) {
  4367. return as_signed(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4368. }
  4369. function packU32(n) {
  4370. return [ n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255 ];
  4371. }
  4372. function unpackU32(bytes) {
  4373. return as_unsigned(bytes[0] << 24 | bytes[1] << 16 | bytes[2] << 8 | bytes[3], 32);
  4374. }
  4375. function packIEEE754(v, ebits, fbits) {
  4376. var bias = (1 << ebits - 1) - 1, s, e, f, ln, i, bits, str, bytes;
  4377. function roundToEven(n) {
  4378. var w = floor(n), f2 = n - w;
  4379. if (f2 < .5) {
  4380. return w;
  4381. }
  4382. if (f2 > .5) {
  4383. return w + 1;
  4384. }
  4385. return w % 2 ? w + 1 : w;
  4386. }
  4387. if (v !== v) {
  4388. e = (1 << ebits) - 1;
  4389. f = pow(2, fbits - 1);
  4390. s = 0;
  4391. } else if (v === Infinity || v === -Infinity) {
  4392. e = (1 << ebits) - 1;
  4393. f = 0;
  4394. s = v < 0 ? 1 : 0;
  4395. } else if (v === 0) {
  4396. e = 0;
  4397. f = 0;
  4398. s = 1 / v === -Infinity ? 1 : 0;
  4399. } else {
  4400. s = v < 0;
  4401. v = abs(v);
  4402. if (v >= pow(2, 1 - bias)) {
  4403. e = min(floor(log10(v) / LN2), 1023);
  4404. f = roundToEven(v / pow(2, e) * pow(2, fbits));
  4405. if (f / pow(2, fbits) >= 2) {
  4406. e = e + 1;
  4407. f = 1;
  4408. }
  4409. if (e > bias) {
  4410. e = (1 << ebits) - 1;
  4411. f = 0;
  4412. } else {
  4413. e = e + bias;
  4414. f = f - pow(2, fbits);
  4415. }
  4416. } else {
  4417. e = 0;
  4418. f = roundToEven(v / pow(2, 1 - bias - fbits));
  4419. }
  4420. }
  4421. bits = [];
  4422. for (i = fbits; i; i -= 1) {
  4423. bits.push(f % 2 ? 1 : 0);
  4424. f = floor(f / 2);
  4425. }
  4426. for (i = ebits; i; i -= 1) {
  4427. bits.push(e % 2 ? 1 : 0);
  4428. e = floor(e / 2);
  4429. }
  4430. bits.push(s ? 1 : 0);
  4431. bits.reverse();
  4432. str = bits.join('');
  4433. bytes = [];
  4434. while (str.length) {
  4435. bytes.push(parseInt(str.substring(0, 8), 2));
  4436. str = str.substring(8);
  4437. }
  4438. return bytes;
  4439. }
  4440. function unpackIEEE754(bytes, ebits, fbits) {
  4441. var bits = [], i, j, b, str, bias, s, e, f;
  4442. for (i = bytes.length; i; i -= 1) {
  4443. b = bytes[i - 1];
  4444. for (j = 8; j; j -= 1) {
  4445. bits.push(b % 2 ? 1 : 0);
  4446. b = b >> 1;
  4447. }
  4448. }
  4449. bits.reverse();
  4450. str = bits.join('');
  4451. bias = (1 << ebits - 1) - 1;
  4452. s = parseInt(str.substring(0, 1), 2) ? -1 : 1;
  4453. e = parseInt(str.substring(1, 1 + ebits), 2);
  4454. f = parseInt(str.substring(1 + ebits), 2);
  4455. if (e === (1 << ebits) - 1) {
  4456. return f !== 0 ? NaN : s * Infinity;
  4457. } else if (e > 0) {
  4458. return s * pow(2, e - bias) * (1 + f / pow(2, fbits));
  4459. } else if (f !== 0) {
  4460. return s * pow(2, -(bias - 1)) * (f / pow(2, fbits));
  4461. } else {
  4462. return s < 0 ? -0 : 0;
  4463. }
  4464. }
  4465. function unpackF64(b) {
  4466. return unpackIEEE754(b, 11, 52);
  4467. }
  4468. function packF64(v) {
  4469. return packIEEE754(v, 11, 52);
  4470. }
  4471. function unpackF32(b) {
  4472. return unpackIEEE754(b, 8, 23);
  4473. }
  4474. function packF32(v) {
  4475. return packIEEE754(v, 8, 23);
  4476. }
  4477. (function() {
  4478. var ArrayBuffer = function ArrayBuffer2(length) {
  4479. length = ECMAScript.ToInt32(length);
  4480. if (length < 0) {
  4481. throw new RangeError('ArrayBuffer size is not a small enough positive integer');
  4482. }
  4483. this.byteLength = length;
  4484. this._bytes = [];
  4485. this._bytes.length = length;
  4486. var i;
  4487. for (i = 0; i < this.byteLength; i += 1) {
  4488. this._bytes[i] = 0;
  4489. }
  4490. configureProperties(this);
  4491. };
  4492. exports.ArrayBuffer = exports.ArrayBuffer || ArrayBuffer;
  4493. var ArrayBufferView = function ArrayBufferView2() {};
  4494. function makeConstructor(bytesPerElement, pack, unpack) {
  4495. var _ctor;
  4496. _ctor = function ctor(buffer, byteOffset, length) {
  4497. var array, sequence, i, s;
  4498. if (!arguments.length || typeof arguments[0] === 'number') {
  4499. this.length = ECMAScript.ToInt32(arguments[0]);
  4500. if (length < 0) {
  4501. throw new RangeError('ArrayBufferView size is not a small enough positive integer');
  4502. }
  4503. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4504. this.buffer = new ArrayBuffer(this.byteLength);
  4505. this.byteOffset = 0;
  4506. } else if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === _ctor) {
  4507. array = arguments[0];
  4508. this.length = array.length;
  4509. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4510. this.buffer = new ArrayBuffer(this.byteLength);
  4511. this.byteOffset = 0;
  4512. for (i = 0; i < this.length; i += 1) {
  4513. this._setter(i, array._getter(i));
  4514. }
  4515. } else if (_typeof(arguments[0]) === 'object' && !(arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4516. sequence = arguments[0];
  4517. this.length = ECMAScript.ToUint32(sequence.length);
  4518. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4519. this.buffer = new ArrayBuffer(this.byteLength);
  4520. this.byteOffset = 0;
  4521. for (i = 0; i < this.length; i += 1) {
  4522. s = sequence[i];
  4523. this._setter(i, Number(s));
  4524. }
  4525. } else if (_typeof(arguments[0]) === 'object' && (arguments[0] instanceof ArrayBuffer || ECMAScript.Class(arguments[0]) === 'ArrayBuffer')) {
  4526. this.buffer = buffer;
  4527. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4528. if (this.byteOffset > this.buffer.byteLength) {
  4529. throw new RangeError('byteOffset out of range');
  4530. }
  4531. if (this.byteOffset % this.BYTES_PER_ELEMENT) {
  4532. throw new RangeError('ArrayBuffer length minus the byteOffset is not a multiple of the element size.');
  4533. }
  4534. if (arguments.length < 3) {
  4535. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4536. if (this.byteLength % this.BYTES_PER_ELEMENT) {
  4537. throw new RangeError('length of buffer minus byteOffset not a multiple of the element size');
  4538. }
  4539. this.length = this.byteLength / this.BYTES_PER_ELEMENT;
  4540. } else {
  4541. this.length = ECMAScript.ToUint32(length);
  4542. this.byteLength = this.length * this.BYTES_PER_ELEMENT;
  4543. }
  4544. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4545. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4546. }
  4547. } else {
  4548. throw new TypeError('Unexpected argument type(s)');
  4549. }
  4550. this.constructor = _ctor;
  4551. configureProperties(this);
  4552. makeArrayAccessors(this);
  4553. };
  4554. _ctor.prototype = new ArrayBufferView();
  4555. _ctor.prototype.BYTES_PER_ELEMENT = bytesPerElement;
  4556. _ctor.prototype._pack = pack;
  4557. _ctor.prototype._unpack = unpack;
  4558. _ctor.BYTES_PER_ELEMENT = bytesPerElement;
  4559. _ctor.prototype._getter = function(index) {
  4560. if (arguments.length < 1) {
  4561. throw new SyntaxError('Not enough arguments');
  4562. }
  4563. index = ECMAScript.ToUint32(index);
  4564. if (index >= this.length) {
  4565. return undefined2;
  4566. }
  4567. var bytes = [], i, o;
  4568. for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4569. o += 1) {
  4570. bytes.push(this.buffer._bytes[o]);
  4571. }
  4572. return this._unpack(bytes);
  4573. };
  4574. _ctor.prototype.get = _ctor.prototype._getter;
  4575. _ctor.prototype._setter = function(index, value) {
  4576. if (arguments.length < 2) {
  4577. throw new SyntaxError('Not enough arguments');
  4578. }
  4579. index = ECMAScript.ToUint32(index);
  4580. if (index >= this.length) {
  4581. return undefined2;
  4582. }
  4583. var bytes = this._pack(value), i, o;
  4584. for (i = 0, o = this.byteOffset + index * this.BYTES_PER_ELEMENT; i < this.BYTES_PER_ELEMENT; i += 1,
  4585. o += 1) {
  4586. this.buffer._bytes[o] = bytes[i];
  4587. }
  4588. };
  4589. _ctor.prototype.set = function(index, value) {
  4590. if (arguments.length < 1) {
  4591. throw new SyntaxError('Not enough arguments');
  4592. }
  4593. var array, sequence, offset, len, i, s, d, byteOffset, byteLength, tmp;
  4594. if (_typeof(arguments[0]) === 'object' && arguments[0].constructor === this.constructor) {
  4595. array = arguments[0];
  4596. offset = ECMAScript.ToUint32(arguments[1]);
  4597. if (offset + array.length > this.length) {
  4598. throw new RangeError('Offset plus length of array is out of range');
  4599. }
  4600. byteOffset = this.byteOffset + offset * this.BYTES_PER_ELEMENT;
  4601. byteLength = array.length * this.BYTES_PER_ELEMENT;
  4602. if (array.buffer === this.buffer) {
  4603. tmp = [];
  4604. for (i = 0, s = array.byteOffset; i < byteLength; i += 1, s += 1) {
  4605. tmp[i] = array.buffer._bytes[s];
  4606. }
  4607. for (i = 0, d = byteOffset; i < byteLength; i += 1, d += 1) {
  4608. this.buffer._bytes[d] = tmp[i];
  4609. }
  4610. } else {
  4611. for (i = 0, s = array.byteOffset, d = byteOffset; i < byteLength; i += 1, s += 1,
  4612. d += 1) {
  4613. this.buffer._bytes[d] = array.buffer._bytes[s];
  4614. }
  4615. }
  4616. } else if (_typeof(arguments[0]) === 'object' && typeof arguments[0].length !== 'undefined') {
  4617. sequence = arguments[0];
  4618. len = ECMAScript.ToUint32(sequence.length);
  4619. offset = ECMAScript.ToUint32(arguments[1]);
  4620. if (offset + len > this.length) {
  4621. throw new RangeError('Offset plus length of array is out of range');
  4622. }
  4623. for (i = 0; i < len; i += 1) {
  4624. s = sequence[i];
  4625. this._setter(offset + i, Number(s));
  4626. }
  4627. } else {
  4628. throw new TypeError('Unexpected argument type(s)');
  4629. }
  4630. };
  4631. _ctor.prototype.subarray = function(start, end) {
  4632. function clamp(v, min2, max) {
  4633. return v < min2 ? min2 : v > max ? max : v;
  4634. }
  4635. start = ECMAScript.ToInt32(start);
  4636. end = ECMAScript.ToInt32(end);
  4637. if (arguments.length < 1) {
  4638. start = 0;
  4639. }
  4640. if (arguments.length < 2) {
  4641. end = this.length;
  4642. }
  4643. if (start < 0) {
  4644. start = this.length + start;
  4645. }
  4646. if (end < 0) {
  4647. end = this.length + end;
  4648. }
  4649. start = clamp(start, 0, this.length);
  4650. end = clamp(end, 0, this.length);
  4651. var len = end - start;
  4652. if (len < 0) {
  4653. len = 0;
  4654. }
  4655. return new this.constructor(this.buffer, this.byteOffset + start * this.BYTES_PER_ELEMENT, len);
  4656. };
  4657. return _ctor;
  4658. }
  4659. var Int8Array = makeConstructor(1, packI8, unpackI8);
  4660. var Uint8Array2 = makeConstructor(1, packU8, unpackU8);
  4661. var Uint8ClampedArray2 = makeConstructor(1, packU8Clamped, unpackU8);
  4662. var Int16Array = makeConstructor(2, packI16, unpackI16);
  4663. var Uint16Array = makeConstructor(2, packU16, unpackU16);
  4664. var Int32Array = makeConstructor(4, packI32, unpackI32);
  4665. var Uint32Array3 = makeConstructor(4, packU32, unpackU32);
  4666. var Float32Array = makeConstructor(4, packF32, unpackF32);
  4667. var Float64Array = makeConstructor(8, packF64, unpackF64);
  4668. exports.Int8Array = exports.Int8Array || Int8Array;
  4669. exports.Uint8Array = exports.Uint8Array || Uint8Array2;
  4670. exports.Uint8ClampedArray = exports.Uint8ClampedArray || Uint8ClampedArray2;
  4671. exports.Int16Array = exports.Int16Array || Int16Array;
  4672. exports.Uint16Array = exports.Uint16Array || Uint16Array;
  4673. exports.Int32Array = exports.Int32Array || Int32Array;
  4674. exports.Uint32Array = exports.Uint32Array || Uint32Array3;
  4675. exports.Float32Array = exports.Float32Array || Float32Array;
  4676. exports.Float64Array = exports.Float64Array || Float64Array;
  4677. })();
  4678. (function() {
  4679. function r(array, index) {
  4680. return ECMAScript.IsCallable(array.get) ? array.get(index) : array[index];
  4681. }
  4682. var IS_BIG_ENDIAN = function() {
  4683. var u16array = new exports.Uint16Array([ 4660 ]), u8array = new exports.Uint8Array(u16array.buffer);
  4684. return r(u8array, 0) === 18;
  4685. }();
  4686. var DataView = function DataView2(buffer, byteOffset, byteLength) {
  4687. if (arguments.length === 0) {
  4688. buffer = new exports.ArrayBuffer(0);
  4689. } else if (!(buffer instanceof exports.ArrayBuffer || ECMAScript.Class(buffer) === 'ArrayBuffer')) {
  4690. throw new TypeError('TypeError');
  4691. }
  4692. this.buffer = buffer || new exports.ArrayBuffer(0);
  4693. this.byteOffset = ECMAScript.ToUint32(byteOffset);
  4694. if (this.byteOffset > this.buffer.byteLength) {
  4695. throw new RangeError('byteOffset out of range');
  4696. }
  4697. if (arguments.length < 3) {
  4698. this.byteLength = this.buffer.byteLength - this.byteOffset;
  4699. } else {
  4700. this.byteLength = ECMAScript.ToUint32(byteLength);
  4701. }
  4702. if (this.byteOffset + this.byteLength > this.buffer.byteLength) {
  4703. throw new RangeError('byteOffset and length reference an area beyond the end of the buffer');
  4704. }
  4705. configureProperties(this);
  4706. };
  4707. function makeGetter(arrayType) {
  4708. return function(byteOffset, littleEndian) {
  4709. byteOffset = ECMAScript.ToUint32(byteOffset);
  4710. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4711. throw new RangeError('Array index out of range');
  4712. }
  4713. byteOffset += this.byteOffset;
  4714. var uint8Array = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT), bytes = [], i;
  4715. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4716. bytes.push(r(uint8Array, i));
  4717. }
  4718. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4719. bytes.reverse();
  4720. }
  4721. return r(new arrayType(new exports.Uint8Array(bytes).buffer), 0);
  4722. };
  4723. }
  4724. DataView.prototype.getUint8 = makeGetter(exports.Uint8Array);
  4725. DataView.prototype.getInt8 = makeGetter(exports.Int8Array);
  4726. DataView.prototype.getUint16 = makeGetter(exports.Uint16Array);
  4727. DataView.prototype.getInt16 = makeGetter(exports.Int16Array);
  4728. DataView.prototype.getUint32 = makeGetter(exports.Uint32Array);
  4729. DataView.prototype.getInt32 = makeGetter(exports.Int32Array);
  4730. DataView.prototype.getFloat32 = makeGetter(exports.Float32Array);
  4731. DataView.prototype.getFloat64 = makeGetter(exports.Float64Array);
  4732. function makeSetter(arrayType) {
  4733. return function(byteOffset, value, littleEndian) {
  4734. byteOffset = ECMAScript.ToUint32(byteOffset);
  4735. if (byteOffset + arrayType.BYTES_PER_ELEMENT > this.byteLength) {
  4736. throw new RangeError('Array index out of range');
  4737. }
  4738. var typeArray = new arrayType([ value ]), byteArray = new exports.Uint8Array(typeArray.buffer), bytes = [], i, byteView;
  4739. for (i = 0; i < arrayType.BYTES_PER_ELEMENT; i += 1) {
  4740. bytes.push(r(byteArray, i));
  4741. }
  4742. if (Boolean(littleEndian) === Boolean(IS_BIG_ENDIAN)) {
  4743. bytes.reverse();
  4744. }
  4745. byteView = new exports.Uint8Array(this.buffer, byteOffset, arrayType.BYTES_PER_ELEMENT);
  4746. byteView.set(bytes);
  4747. };
  4748. }
  4749. DataView.prototype.setUint8 = makeSetter(exports.Uint8Array);
  4750. DataView.prototype.setInt8 = makeSetter(exports.Int8Array);
  4751. DataView.prototype.setUint16 = makeSetter(exports.Uint16Array);
  4752. DataView.prototype.setInt16 = makeSetter(exports.Int16Array);
  4753. DataView.prototype.setUint32 = makeSetter(exports.Uint32Array);
  4754. DataView.prototype.setInt32 = makeSetter(exports.Int32Array);
  4755. DataView.prototype.setFloat32 = makeSetter(exports.Float32Array);
  4756. DataView.prototype.setFloat64 = makeSetter(exports.Float64Array);
  4757. exports.DataView = exports.DataView || DataView;
  4758. })();
  4759. });
  4760. var require_weakmap_polyfill = __commonJS(function(exports) {
  4761. (function(self2) {
  4762. 'use strict';
  4763. if (self2.WeakMap) {
  4764. return;
  4765. }
  4766. var hasOwnProperty2 = Object.prototype.hasOwnProperty;
  4767. var defineProperty = function defineProperty(object, name, value) {
  4768. if (Object.defineProperty) {
  4769. Object.defineProperty(object, name, {
  4770. configurable: true,
  4771. writable: true,
  4772. value: value
  4773. });
  4774. } else {
  4775. object[name] = value;
  4776. }
  4777. };
  4778. self2.WeakMap = function() {
  4779. function WeakMap2() {
  4780. if (this === void 0) {
  4781. throw new TypeError('Constructor WeakMap requires \'new\'');
  4782. }
  4783. defineProperty(this, '_id', genId('_WeakMap'));
  4784. if (arguments.length > 0) {
  4785. throw new TypeError('WeakMap iterable is not supported');
  4786. }
  4787. }
  4788. defineProperty(WeakMap2.prototype, 'delete', function(key) {
  4789. checkInstance(this, 'delete');
  4790. if (!isObject(key)) {
  4791. return false;
  4792. }
  4793. var entry = key[this._id];
  4794. if (entry && entry[0] === key) {
  4795. delete key[this._id];
  4796. return true;
  4797. }
  4798. return false;
  4799. });
  4800. defineProperty(WeakMap2.prototype, 'get', function(key) {
  4801. checkInstance(this, 'get');
  4802. if (!isObject(key)) {
  4803. return void 0;
  4804. }
  4805. var entry = key[this._id];
  4806. if (entry && entry[0] === key) {
  4807. return entry[1];
  4808. }
  4809. return void 0;
  4810. });
  4811. defineProperty(WeakMap2.prototype, 'has', function(key) {
  4812. checkInstance(this, 'has');
  4813. if (!isObject(key)) {
  4814. return false;
  4815. }
  4816. var entry = key[this._id];
  4817. if (entry && entry[0] === key) {
  4818. return true;
  4819. }
  4820. return false;
  4821. });
  4822. defineProperty(WeakMap2.prototype, 'set', function(key, value) {
  4823. checkInstance(this, 'set');
  4824. if (!isObject(key)) {
  4825. throw new TypeError('Invalid value used as weak map key');
  4826. }
  4827. var entry = key[this._id];
  4828. if (entry && entry[0] === key) {
  4829. entry[1] = value;
  4830. return this;
  4831. }
  4832. defineProperty(key, this._id, [ key, value ]);
  4833. return this;
  4834. });
  4835. function checkInstance(x, methodName) {
  4836. if (!isObject(x) || !hasOwnProperty2.call(x, '_id')) {
  4837. throw new TypeError(methodName + ' method called on incompatible receiver ' + _typeof(x));
  4838. }
  4839. }
  4840. function genId(prefix) {
  4841. return prefix + '_' + rand() + '.' + rand();
  4842. }
  4843. function rand() {
  4844. return Math.random().toString().substring(2);
  4845. }
  4846. defineProperty(WeakMap2, '_polyfill', true);
  4847. return WeakMap2;
  4848. }();
  4849. function isObject(x) {
  4850. return Object(x) === x;
  4851. }
  4852. })(typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : exports);
  4853. });
  4854. var definitions = [ {
  4855. name: 'NA',
  4856. value: 'inapplicable',
  4857. priority: 0,
  4858. group: 'inapplicable'
  4859. }, {
  4860. name: 'PASS',
  4861. value: 'passed',
  4862. priority: 1,
  4863. group: 'passes'
  4864. }, {
  4865. name: 'CANTTELL',
  4866. value: 'cantTell',
  4867. priority: 2,
  4868. group: 'incomplete'
  4869. }, {
  4870. name: 'FAIL',
  4871. value: 'failed',
  4872. priority: 3,
  4873. group: 'violations'
  4874. } ];
  4875. var constants = {
  4876. helpUrlBase: 'https://dequeuniversity.com/rules/',
  4877. results: [],
  4878. resultGroups: [],
  4879. resultGroupMap: {},
  4880. impact: Object.freeze([ 'minor', 'moderate', 'serious', 'critical' ]),
  4881. preload: Object.freeze({
  4882. assets: [ 'cssom', 'media' ],
  4883. timeout: 1e4
  4884. })
  4885. };
  4886. definitions.forEach(function(definition) {
  4887. var name = definition.name;
  4888. var value = definition.value;
  4889. var priority = definition.priority;
  4890. var group = definition.group;
  4891. constants[name] = value;
  4892. constants[name + '_PRIO'] = priority;
  4893. constants[name + '_GROUP'] = group;
  4894. constants.results[priority] = value;
  4895. constants.resultGroups[priority] = group;
  4896. constants.resultGroupMap[value] = group;
  4897. });
  4898. Object.freeze(constants.results);
  4899. Object.freeze(constants.resultGroups);
  4900. Object.freeze(constants.resultGroupMap);
  4901. Object.freeze(constants);
  4902. var constants_default = constants;
  4903. function log() {
  4904. if ((typeof console === 'undefined' ? 'undefined' : _typeof(console)) === 'object' && console.log) {
  4905. Function.prototype.apply.call(console.log, console, arguments);
  4906. }
  4907. }
  4908. var log_default = log;
  4909. var whitespaceRegex = /[\t\r\n\f]/g;
  4910. var AbstractVirtualNode = function() {
  4911. function AbstractVirtualNode() {
  4912. _classCallCheck(this, AbstractVirtualNode);
  4913. this.parent = void 0;
  4914. }
  4915. _createClass(AbstractVirtualNode, [ {
  4916. key: 'attr',
  4917. value: function attr() {
  4918. throw new Error('VirtualNode class must have a "attr" function');
  4919. }
  4920. }, {
  4921. key: 'hasAttr',
  4922. value: function hasAttr() {
  4923. throw new Error('VirtualNode class must have a "hasAttr" function');
  4924. }
  4925. }, {
  4926. key: 'hasClass',
  4927. value: function hasClass(className) {
  4928. var classAttr = this.attr('class');
  4929. if (!classAttr) {
  4930. return false;
  4931. }
  4932. var selector = ' ' + className + ' ';
  4933. return (' ' + classAttr + ' ').replace(whitespaceRegex, ' ').indexOf(selector) >= 0;
  4934. }
  4935. }, {
  4936. key: 'props',
  4937. get: function get() {
  4938. throw new Error('VirtualNode class must have a "props" object consisting of "nodeType" and "nodeName" properties');
  4939. }
  4940. } ]);
  4941. return AbstractVirtualNode;
  4942. }();
  4943. var abstract_virtual_node_default = AbstractVirtualNode;
  4944. var utils_exports = {};
  4945. __export(utils_exports, {
  4946. DqElement: function DqElement() {
  4947. return dq_element_default;
  4948. },
  4949. aggregate: function aggregate() {
  4950. return aggregate_default;
  4951. },
  4952. aggregateChecks: function aggregateChecks() {
  4953. return aggregate_checks_default;
  4954. },
  4955. aggregateNodeResults: function aggregateNodeResults() {
  4956. return aggregate_node_results_default;
  4957. },
  4958. aggregateResult: function aggregateResult() {
  4959. return aggregate_result_default;
  4960. },
  4961. areStylesSet: function areStylesSet() {
  4962. return are_styles_set_default;
  4963. },
  4964. assert: function assert() {
  4965. return assert_default;
  4966. },
  4967. checkHelper: function checkHelper() {
  4968. return check_helper_default;
  4969. },
  4970. clone: function clone() {
  4971. return clone_default;
  4972. },
  4973. closest: function closest() {
  4974. return closest_default;
  4975. },
  4976. collectResultsFromFrames: function collectResultsFromFrames() {
  4977. return collect_results_from_frames_default;
  4978. },
  4979. contains: function contains() {
  4980. return contains_default;
  4981. },
  4982. convertSelector: function convertSelector() {
  4983. return _convertSelector;
  4984. },
  4985. cssParser: function cssParser() {
  4986. return css_parser_default;
  4987. },
  4988. deepMerge: function deepMerge() {
  4989. return deep_merge_default;
  4990. },
  4991. escapeSelector: function escapeSelector() {
  4992. return escape_selector_default;
  4993. },
  4994. extendMetaData: function extendMetaData() {
  4995. return extend_meta_data_default;
  4996. },
  4997. finalizeRuleResult: function finalizeRuleResult() {
  4998. return finalize_result_default;
  4999. },
  5000. findBy: function findBy() {
  5001. return find_by_default;
  5002. },
  5003. getAllChecks: function getAllChecks() {
  5004. return get_all_checks_default;
  5005. },
  5006. getAncestry: function getAncestry() {
  5007. return _getAncestry;
  5008. },
  5009. getBaseLang: function getBaseLang() {
  5010. return get_base_lang_default;
  5011. },
  5012. getCheckMessage: function getCheckMessage() {
  5013. return get_check_message_default;
  5014. },
  5015. getCheckOption: function getCheckOption() {
  5016. return get_check_option_default;
  5017. },
  5018. getFlattenedTree: function getFlattenedTree() {
  5019. return get_flattened_tree_default;
  5020. },
  5021. getFriendlyUriEnd: function getFriendlyUriEnd() {
  5022. return get_friendly_uri_end_default;
  5023. },
  5024. getNodeAttributes: function getNodeAttributes() {
  5025. return get_node_attributes_default;
  5026. },
  5027. getNodeFromTree: function getNodeFromTree() {
  5028. return get_node_from_tree_default;
  5029. },
  5030. getPreloadConfig: function getPreloadConfig() {
  5031. return _getPreloadConfig;
  5032. },
  5033. getRootNode: function getRootNode() {
  5034. return get_root_node_default;
  5035. },
  5036. getScroll: function getScroll() {
  5037. return get_scroll_default;
  5038. },
  5039. getScrollState: function getScrollState() {
  5040. return get_scroll_state_default;
  5041. },
  5042. getSelector: function getSelector() {
  5043. return _getSelector;
  5044. },
  5045. getSelectorData: function getSelectorData() {
  5046. return _getSelectorData;
  5047. },
  5048. getShadowSelector: function getShadowSelector() {
  5049. return get_shadow_selector_default;
  5050. },
  5051. getStyleSheetFactory: function getStyleSheetFactory() {
  5052. return get_stylesheet_factory_default;
  5053. },
  5054. getXpath: function getXpath() {
  5055. return get_xpath_default;
  5056. },
  5057. injectStyle: function injectStyle() {
  5058. return inject_style_default;
  5059. },
  5060. isHidden: function isHidden() {
  5061. return is_hidden_default;
  5062. },
  5063. isHtmlElement: function isHtmlElement() {
  5064. return is_html_element_default;
  5065. },
  5066. isNodeInContext: function isNodeInContext() {
  5067. return is_node_in_context_default;
  5068. },
  5069. isShadowRoot: function isShadowRoot() {
  5070. return is_shadow_root_default;
  5071. },
  5072. isValidLang: function isValidLang() {
  5073. return valid_langs_default;
  5074. },
  5075. isXHTML: function isXHTML() {
  5076. return is_xhtml_default;
  5077. },
  5078. matches: function matches() {
  5079. return matches_default;
  5080. },
  5081. matchesExpression: function matchesExpression() {
  5082. return _matchesExpression;
  5083. },
  5084. matchesSelector: function matchesSelector() {
  5085. return element_matches_default;
  5086. },
  5087. memoize: function memoize() {
  5088. return memoize_default;
  5089. },
  5090. mergeResults: function mergeResults() {
  5091. return merge_results_default;
  5092. },
  5093. nodeSorter: function nodeSorter() {
  5094. return node_sorter_default;
  5095. },
  5096. parseCrossOriginStylesheet: function parseCrossOriginStylesheet() {
  5097. return parse_crossorigin_stylesheet_default;
  5098. },
  5099. parseSameOriginStylesheet: function parseSameOriginStylesheet() {
  5100. return parse_sameorigin_stylesheet_default;
  5101. },
  5102. parseStylesheet: function parseStylesheet() {
  5103. return parse_stylesheet_default;
  5104. },
  5105. performanceTimer: function performanceTimer() {
  5106. return performance_timer_default;
  5107. },
  5108. pollyfillElementsFromPoint: function pollyfillElementsFromPoint() {
  5109. return _pollyfillElementsFromPoint;
  5110. },
  5111. preload: function preload() {
  5112. return preload_default;
  5113. },
  5114. preloadCssom: function preloadCssom() {
  5115. return preload_cssom_default;
  5116. },
  5117. preloadMedia: function preloadMedia() {
  5118. return preload_media_default;
  5119. },
  5120. processMessage: function processMessage() {
  5121. return process_message_default;
  5122. },
  5123. publishMetaData: function publishMetaData() {
  5124. return publish_metadata_default;
  5125. },
  5126. querySelectorAll: function querySelectorAll() {
  5127. return query_selector_all_default;
  5128. },
  5129. querySelectorAllFilter: function querySelectorAllFilter() {
  5130. return query_selector_all_filter_default;
  5131. },
  5132. queue: function queue() {
  5133. return queue_default;
  5134. },
  5135. respondable: function respondable() {
  5136. return _respondable;
  5137. },
  5138. ruleShouldRun: function ruleShouldRun() {
  5139. return rule_should_run_default;
  5140. },
  5141. select: function select() {
  5142. return select_default;
  5143. },
  5144. sendCommandToFrame: function sendCommandToFrame() {
  5145. return send_command_to_frame_default;
  5146. },
  5147. setScrollState: function setScrollState() {
  5148. return set_scroll_state_default;
  5149. },
  5150. shouldPreload: function shouldPreload() {
  5151. return _shouldPreload;
  5152. },
  5153. toArray: function toArray() {
  5154. return to_array_default;
  5155. },
  5156. tokenList: function tokenList() {
  5157. return token_list_default;
  5158. },
  5159. uniqueArray: function uniqueArray() {
  5160. return unique_array_default;
  5161. },
  5162. uuid: function uuid() {
  5163. return uuid_default;
  5164. },
  5165. validInputTypes: function validInputTypes() {
  5166. return valid_input_type_default;
  5167. },
  5168. validLangs: function validLangs() {
  5169. return _validLangs;
  5170. }
  5171. });
  5172. function aggregate(map, values, initial) {
  5173. values = values.slice();
  5174. if (initial) {
  5175. values.push(initial);
  5176. }
  5177. var sorting = values.map(function(val) {
  5178. return map.indexOf(val);
  5179. }).sort();
  5180. return map[sorting.pop()];
  5181. }
  5182. var aggregate_default = aggregate;
  5183. var CANTTELL_PRIO = constants_default.CANTTELL_PRIO, FAIL_PRIO = constants_default.FAIL_PRIO;
  5184. var checkMap = [];
  5185. checkMap[constants_default.PASS_PRIO] = true;
  5186. checkMap[constants_default.CANTTELL_PRIO] = null;
  5187. checkMap[constants_default.FAIL_PRIO] = false;
  5188. var checkTypes = [ 'any', 'all', 'none' ];
  5189. function anyAllNone(obj, functor) {
  5190. return checkTypes.reduce(function(out, type) {
  5191. out[type] = (obj[type] || []).map(function(val) {
  5192. return functor(val, type);
  5193. });
  5194. return out;
  5195. }, {});
  5196. }
  5197. function aggregateChecks(nodeResOriginal) {
  5198. var nodeResult = Object.assign({}, nodeResOriginal);
  5199. anyAllNone(nodeResult, function(check4, type) {
  5200. var i = typeof check4.result === 'undefined' ? -1 : checkMap.indexOf(check4.result);
  5201. check4.priority = i !== -1 ? i : constants_default.CANTTELL_PRIO;
  5202. if (type === 'none') {
  5203. if (check4.priority === constants_default.PASS_PRIO) {
  5204. check4.priority = constants_default.FAIL_PRIO;
  5205. } else if (check4.priority === constants_default.FAIL_PRIO) {
  5206. check4.priority = constants_default.PASS_PRIO;
  5207. }
  5208. }
  5209. });
  5210. var priorities = {
  5211. all: nodeResult.all.reduce(function(a, b) {
  5212. return Math.max(a, b.priority);
  5213. }, 0),
  5214. none: nodeResult.none.reduce(function(a, b) {
  5215. return Math.max(a, b.priority);
  5216. }, 0),
  5217. any: nodeResult.any.reduce(function(a, b) {
  5218. return Math.min(a, b.priority);
  5219. }, 4) % 4
  5220. };
  5221. nodeResult.priority = Math.max(priorities.all, priorities.none, priorities.any);
  5222. var impacts = [];
  5223. checkTypes.forEach(function(type) {
  5224. nodeResult[type] = nodeResult[type].filter(function(check4) {
  5225. return check4.priority === nodeResult.priority && check4.priority === priorities[type];
  5226. });
  5227. nodeResult[type].forEach(function(check4) {
  5228. return impacts.push(check4.impact);
  5229. });
  5230. });
  5231. if ([ CANTTELL_PRIO, FAIL_PRIO ].includes(nodeResult.priority)) {
  5232. nodeResult.impact = aggregate_default(constants_default.impact, impacts);
  5233. } else {
  5234. nodeResult.impact = null;
  5235. }
  5236. anyAllNone(nodeResult, function(c) {
  5237. delete c.result;
  5238. delete c.priority;
  5239. });
  5240. nodeResult.result = constants_default.results[nodeResult.priority];
  5241. delete nodeResult.priority;
  5242. return nodeResult;
  5243. }
  5244. var aggregate_checks_default = aggregateChecks;
  5245. function finalizeRuleResult(ruleResult) {
  5246. var rule3 = axe._audit.rules.find(function(rule4) {
  5247. return rule4.id === ruleResult.id;
  5248. });
  5249. if (rule3 && rule3.impact) {
  5250. ruleResult.nodes.forEach(function(node) {
  5251. [ 'any', 'all', 'none' ].forEach(function(checkType) {
  5252. (node[checkType] || []).forEach(function(checkResult) {
  5253. checkResult.impact = rule3.impact;
  5254. });
  5255. });
  5256. });
  5257. }
  5258. Object.assign(ruleResult, aggregate_node_results_default(ruleResult.nodes));
  5259. delete ruleResult.nodes;
  5260. return ruleResult;
  5261. }
  5262. var finalize_result_default = finalizeRuleResult;
  5263. function aggregateNodeResults(nodeResults) {
  5264. var ruleResult = {};
  5265. nodeResults = nodeResults.map(function(nodeResult) {
  5266. if (nodeResult.any && nodeResult.all && nodeResult.none) {
  5267. return aggregate_checks_default(nodeResult);
  5268. } else if (Array.isArray(nodeResult.node)) {
  5269. return finalize_result_default(nodeResult);
  5270. } else {
  5271. throw new TypeError('Invalid Result type');
  5272. }
  5273. });
  5274. if (nodeResults && nodeResults.length) {
  5275. var resultList = nodeResults.map(function(node) {
  5276. return node.result;
  5277. });
  5278. ruleResult.result = aggregate_default(constants_default.results, resultList, ruleResult.result);
  5279. } else {
  5280. ruleResult.result = 'inapplicable';
  5281. }
  5282. constants_default.resultGroups.forEach(function(group) {
  5283. return ruleResult[group] = [];
  5284. });
  5285. nodeResults.forEach(function(nodeResult) {
  5286. var groupName = constants_default.resultGroupMap[nodeResult.result];
  5287. ruleResult[groupName].push(nodeResult);
  5288. });
  5289. var impactGroup = constants_default.FAIL_GROUP;
  5290. if (ruleResult[impactGroup].length === 0) {
  5291. impactGroup = constants_default.CANTTELL_GROUP;
  5292. }
  5293. if (ruleResult[impactGroup].length > 0) {
  5294. var impactList = ruleResult[impactGroup].map(function(failure) {
  5295. return failure.impact;
  5296. });
  5297. ruleResult.impact = aggregate_default(constants_default.impact, impactList) || null;
  5298. } else {
  5299. ruleResult.impact = null;
  5300. }
  5301. return ruleResult;
  5302. }
  5303. var aggregate_node_results_default = aggregateNodeResults;
  5304. function copyToGroup(resultObject, subResult, group) {
  5305. var resultCopy = Object.assign({}, subResult);
  5306. resultCopy.nodes = (resultCopy[group] || []).concat();
  5307. constants_default.resultGroups.forEach(function(group2) {
  5308. delete resultCopy[group2];
  5309. });
  5310. resultObject[group].push(resultCopy);
  5311. }
  5312. function aggregateResult(results) {
  5313. var resultObject = {};
  5314. constants_default.resultGroups.forEach(function(groupName) {
  5315. return resultObject[groupName] = [];
  5316. });
  5317. results.forEach(function(subResult) {
  5318. if (subResult.error) {
  5319. copyToGroup(resultObject, subResult, constants_default.CANTTELL_GROUP);
  5320. } else if (subResult.result === constants_default.NA) {
  5321. copyToGroup(resultObject, subResult, constants_default.NA_GROUP);
  5322. } else {
  5323. constants_default.resultGroups.forEach(function(group) {
  5324. if (Array.isArray(subResult[group]) && subResult[group].length > 0) {
  5325. copyToGroup(resultObject, subResult, group);
  5326. }
  5327. });
  5328. }
  5329. });
  5330. return resultObject;
  5331. }
  5332. var aggregate_result_default = aggregateResult;
  5333. function areStylesSet(el, styles, stopAt) {
  5334. var styl = window.getComputedStyle(el, null);
  5335. if (!styl) {
  5336. return false;
  5337. }
  5338. for (var i = 0; i < styles.length; ++i) {
  5339. var att = styles[i];
  5340. if (styl.getPropertyValue(att.property) === att.value) {
  5341. return true;
  5342. }
  5343. }
  5344. if (!el.parentNode || el.nodeName.toUpperCase() === stopAt.toUpperCase()) {
  5345. return false;
  5346. }
  5347. return areStylesSet(el.parentNode, styles, stopAt);
  5348. }
  5349. var are_styles_set_default = areStylesSet;
  5350. function assert(bool, message) {
  5351. if (!bool) {
  5352. throw new Error(message);
  5353. }
  5354. }
  5355. var assert_default = assert;
  5356. function toArray(thing) {
  5357. return Array.prototype.slice.call(thing);
  5358. }
  5359. var to_array_default = toArray;
  5360. function escapeSelector(value) {
  5361. var string = String(value);
  5362. var length = string.length;
  5363. var index = -1;
  5364. var codeUnit;
  5365. var result = '';
  5366. var firstCodeUnit = string.charCodeAt(0);
  5367. while (++index < length) {
  5368. codeUnit = string.charCodeAt(index);
  5369. if (codeUnit == 0) {
  5370. result += '\ufffd';
  5371. continue;
  5372. }
  5373. if (codeUnit >= 1 && codeUnit <= 31 || codeUnit == 127 || index == 0 && codeUnit >= 48 && codeUnit <= 57 || index == 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit == 45) {
  5374. result += '\\' + codeUnit.toString(16) + ' ';
  5375. continue;
  5376. }
  5377. if (index == 0 && length == 1 && codeUnit == 45) {
  5378. result += '\\' + string.charAt(index);
  5379. continue;
  5380. }
  5381. if (codeUnit >= 128 || codeUnit == 45 || codeUnit == 95 || codeUnit >= 48 && codeUnit <= 57 || codeUnit >= 65 && codeUnit <= 90 || codeUnit >= 97 && codeUnit <= 122) {
  5382. result += string.charAt(index);
  5383. continue;
  5384. }
  5385. result += '\\' + string.charAt(index);
  5386. }
  5387. return result;
  5388. }
  5389. var escape_selector_default = escapeSelector;
  5390. function isMostlyNumbers() {
  5391. var str = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  5392. return str.length !== 0 && (str.match(/[0-9]/g) || '').length >= str.length / 2;
  5393. }
  5394. function splitString(str, splitIndex) {
  5395. return [ str.substring(0, splitIndex), str.substring(splitIndex) ];
  5396. }
  5397. function trimRight(str) {
  5398. return str.replace(/\s+$/, '');
  5399. }
  5400. function uriParser(url) {
  5401. var original = url;
  5402. var protocol = '', domain = '', port = '', path = '', query = '', hash = '';
  5403. if (url.includes('#')) {
  5404. var _splitString = splitString(url, url.indexOf('#'));
  5405. var _splitString2 = _slicedToArray(_splitString, 2);
  5406. url = _splitString2[0];
  5407. hash = _splitString2[1];
  5408. }
  5409. if (url.includes('?')) {
  5410. var _splitString3 = splitString(url, url.indexOf('?'));
  5411. var _splitString4 = _slicedToArray(_splitString3, 2);
  5412. url = _splitString4[0];
  5413. query = _splitString4[1];
  5414. }
  5415. if (url.includes('://')) {
  5416. var _url$split = url.split('://');
  5417. var _url$split2 = _slicedToArray(_url$split, 2);
  5418. protocol = _url$split2[0];
  5419. url = _url$split2[1];
  5420. var _splitString5 = splitString(url, url.indexOf('/'));
  5421. var _splitString6 = _slicedToArray(_splitString5, 2);
  5422. domain = _splitString6[0];
  5423. url = _splitString6[1];
  5424. } else if (url.substr(0, 2) === '//') {
  5425. url = url.substr(2);
  5426. var _splitString7 = splitString(url, url.indexOf('/'));
  5427. var _splitString8 = _slicedToArray(_splitString7, 2);
  5428. domain = _splitString8[0];
  5429. url = _splitString8[1];
  5430. }
  5431. if (domain.substr(0, 4) === 'www.') {
  5432. domain = domain.substr(4);
  5433. }
  5434. if (domain && domain.includes(':')) {
  5435. var _splitString9 = splitString(domain, domain.indexOf(':'));
  5436. var _splitString10 = _slicedToArray(_splitString9, 2);
  5437. domain = _splitString10[0];
  5438. port = _splitString10[1];
  5439. }
  5440. path = url;
  5441. return {
  5442. original: original,
  5443. protocol: protocol,
  5444. domain: domain,
  5445. port: port,
  5446. path: path,
  5447. query: query,
  5448. hash: hash
  5449. };
  5450. }
  5451. function getFriendlyUriEnd() {
  5452. var uri = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  5453. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  5454. if (uri.length <= 1 || uri.substr(0, 5) === 'data:' || uri.substr(0, 11) === 'javascript:' || uri.includes('?')) {
  5455. return;
  5456. }
  5457. var currentDomain = options.currentDomain, _options$maxLength = options.maxLength, maxLength = _options$maxLength === void 0 ? 25 : _options$maxLength;
  5458. var _uriParser = uriParser(uri), path = _uriParser.path, domain = _uriParser.domain, hash = _uriParser.hash;
  5459. var pathEnd = path.substr(path.substr(0, path.length - 2).lastIndexOf('/') + 1);
  5460. if (hash) {
  5461. if (pathEnd && (pathEnd + hash).length <= maxLength) {
  5462. return trimRight(pathEnd + hash);
  5463. } else if (pathEnd.length < 2 && hash.length > 2 && hash.length <= maxLength) {
  5464. return trimRight(hash);
  5465. } else {
  5466. return;
  5467. }
  5468. } else if (domain && domain.length < maxLength && path.length <= 1) {
  5469. return trimRight(domain + path);
  5470. }
  5471. if (path === '/' + pathEnd && domain && currentDomain && domain !== currentDomain && (domain + path).length <= maxLength) {
  5472. return trimRight(domain + path);
  5473. }
  5474. var lastDotIndex = pathEnd.lastIndexOf('.');
  5475. if ((lastDotIndex === -1 || lastDotIndex > 1) && (lastDotIndex !== -1 || pathEnd.length > 2) && pathEnd.length <= maxLength && !pathEnd.match(/index(\.[a-zA-Z]{2-4})?/) && !isMostlyNumbers(pathEnd)) {
  5476. return trimRight(pathEnd);
  5477. }
  5478. }
  5479. var get_friendly_uri_end_default = getFriendlyUriEnd;
  5480. function getNodeAttributes(node) {
  5481. if (node.attributes instanceof window.NamedNodeMap) {
  5482. return node.attributes;
  5483. }
  5484. return node.cloneNode(false).attributes;
  5485. }
  5486. var get_node_attributes_default = getNodeAttributes;
  5487. var matchesSelector = function() {
  5488. var method;
  5489. function getMethod(node) {
  5490. var index, candidate, candidates = [ 'matches', 'matchesSelector', 'mozMatchesSelector', 'webkitMatchesSelector', 'msMatchesSelector' ], length = candidates.length;
  5491. for (index = 0; index < length; index++) {
  5492. candidate = candidates[index];
  5493. if (node[candidate]) {
  5494. return candidate;
  5495. }
  5496. }
  5497. }
  5498. return function(node, selector) {
  5499. if (!method || !node[method]) {
  5500. method = getMethod(node);
  5501. }
  5502. if (node[method]) {
  5503. return node[method](selector);
  5504. }
  5505. return false;
  5506. };
  5507. }();
  5508. var element_matches_default = matchesSelector;
  5509. function isXHTML(doc) {
  5510. if (!doc.createElement) {
  5511. return false;
  5512. }
  5513. return doc.createElement('A').localName === 'A';
  5514. }
  5515. var is_xhtml_default = isXHTML;
  5516. function getShadowSelector(generateSelector2, elm) {
  5517. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  5518. if (!elm) {
  5519. return '';
  5520. }
  5521. var doc = elm.getRootNode && elm.getRootNode() || document;
  5522. if (doc.nodeType !== 11) {
  5523. return generateSelector2(elm, options, doc);
  5524. }
  5525. var stack = [];
  5526. while (doc.nodeType === 11) {
  5527. if (!doc.host) {
  5528. return '';
  5529. }
  5530. stack.unshift({
  5531. elm: elm,
  5532. doc: doc
  5533. });
  5534. elm = doc.host;
  5535. doc = elm.getRootNode();
  5536. }
  5537. stack.unshift({
  5538. elm: elm,
  5539. doc: doc
  5540. });
  5541. return stack.map(function(_ref) {
  5542. var elm2 = _ref.elm, doc2 = _ref.doc;
  5543. return generateSelector2(elm2, options, doc2);
  5544. });
  5545. }
  5546. var get_shadow_selector_default = getShadowSelector;
  5547. var xhtml;
  5548. var ignoredAttributes = [ 'class', 'style', 'id', 'selected', 'checked', 'disabled', 'tabindex', 'aria-checked', 'aria-selected', 'aria-invalid', 'aria-activedescendant', 'aria-busy', 'aria-disabled', 'aria-expanded', 'aria-grabbed', 'aria-pressed', 'aria-valuenow' ];
  5549. var MAXATTRIBUTELENGTH = 31;
  5550. function getAttributeNameValue(node, at) {
  5551. var name = at.name;
  5552. var atnv;
  5553. if (name.indexOf('href') !== -1 || name.indexOf('src') !== -1) {
  5554. var friendly = get_friendly_uri_end_default(node.getAttribute(name));
  5555. if (friendly) {
  5556. var value = encodeURI(friendly);
  5557. if (value) {
  5558. atnv = escape_selector_default(at.name) + '$="' + escape_selector_default(value) + '"';
  5559. } else {
  5560. return;
  5561. }
  5562. } else {
  5563. atnv = escape_selector_default(at.name) + '="' + escape_selector_default(node.getAttribute(name)) + '"';
  5564. }
  5565. } else {
  5566. atnv = escape_selector_default(name) + '="' + escape_selector_default(at.value) + '"';
  5567. }
  5568. return atnv;
  5569. }
  5570. function countSort(a, b) {
  5571. return a.count < b.count ? -1 : a.count === b.count ? 0 : 1;
  5572. }
  5573. function filterAttributes(at) {
  5574. return !ignoredAttributes.includes(at.name) && at.name.indexOf(':') === -1 && (!at.value || at.value.length < MAXATTRIBUTELENGTH);
  5575. }
  5576. function _getSelectorData(domTree) {
  5577. var data2 = {
  5578. classes: {},
  5579. tags: {},
  5580. attributes: {}
  5581. };
  5582. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  5583. var currentLevel = domTree.slice();
  5584. var stack = [];
  5585. var _loop2 = function _loop2() {
  5586. var current = currentLevel.pop();
  5587. var node = current.actualNode;
  5588. if (!!node.querySelectorAll) {
  5589. var tag = node.nodeName;
  5590. if (data2.tags[tag]) {
  5591. data2.tags[tag]++;
  5592. } else {
  5593. data2.tags[tag] = 1;
  5594. }
  5595. if (node.classList) {
  5596. Array.from(node.classList).forEach(function(cl) {
  5597. var ind = escape_selector_default(cl);
  5598. if (data2.classes[ind]) {
  5599. data2.classes[ind]++;
  5600. } else {
  5601. data2.classes[ind] = 1;
  5602. }
  5603. });
  5604. }
  5605. if (node.hasAttributes()) {
  5606. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  5607. var atnv = getAttributeNameValue(node, at);
  5608. if (atnv) {
  5609. if (data2.attributes[atnv]) {
  5610. data2.attributes[atnv]++;
  5611. } else {
  5612. data2.attributes[atnv] = 1;
  5613. }
  5614. }
  5615. });
  5616. }
  5617. }
  5618. if (current.children.length) {
  5619. stack.push(currentLevel);
  5620. currentLevel = current.children.slice();
  5621. }
  5622. while (!currentLevel.length && stack.length) {
  5623. currentLevel = stack.pop();
  5624. }
  5625. };
  5626. while (currentLevel.length) {
  5627. _loop2();
  5628. }
  5629. return data2;
  5630. }
  5631. function uncommonClasses(node, selectorData) {
  5632. var retVal = [];
  5633. var classData = selectorData.classes;
  5634. var tagData = selectorData.tags;
  5635. if (node.classList) {
  5636. Array.from(node.classList).forEach(function(cl) {
  5637. var ind = escape_selector_default(cl);
  5638. if (classData[ind] < tagData[node.nodeName]) {
  5639. retVal.push({
  5640. name: ind,
  5641. count: classData[ind],
  5642. species: 'class'
  5643. });
  5644. }
  5645. });
  5646. }
  5647. return retVal.sort(countSort);
  5648. }
  5649. function getNthChildString(elm, selector) {
  5650. var siblings = elm.parentNode && Array.from(elm.parentNode.children || '') || [];
  5651. var hasMatchingSiblings = siblings.find(function(sibling) {
  5652. return sibling !== elm && element_matches_default(sibling, selector);
  5653. });
  5654. if (hasMatchingSiblings) {
  5655. var nthChild = 1 + siblings.indexOf(elm);
  5656. return ':nth-child(' + nthChild + ')';
  5657. } else {
  5658. return '';
  5659. }
  5660. }
  5661. function getElmId(elm) {
  5662. if (!elm.getAttribute('id')) {
  5663. return;
  5664. }
  5665. var doc = elm.getRootNode && elm.getRootNode() || document;
  5666. var id = '#' + escape_selector_default(elm.getAttribute('id') || '');
  5667. if (!id.match(/player_uid_/) && doc.querySelectorAll(id).length === 1) {
  5668. return id;
  5669. }
  5670. }
  5671. function getBaseSelector(elm) {
  5672. if (typeof xhtml === 'undefined') {
  5673. xhtml = is_xhtml_default(document);
  5674. }
  5675. return escape_selector_default(xhtml ? elm.localName : elm.nodeName.toLowerCase());
  5676. }
  5677. function uncommonAttributes(node, selectorData) {
  5678. var retVal = [];
  5679. var attData = selectorData.attributes;
  5680. var tagData = selectorData.tags;
  5681. if (node.hasAttributes()) {
  5682. Array.from(get_node_attributes_default(node)).filter(filterAttributes).forEach(function(at) {
  5683. var atnv = getAttributeNameValue(node, at);
  5684. if (atnv && attData[atnv] < tagData[node.nodeName]) {
  5685. retVal.push({
  5686. name: atnv,
  5687. count: attData[atnv],
  5688. species: 'attribute'
  5689. });
  5690. }
  5691. });
  5692. }
  5693. return retVal.sort(countSort);
  5694. }
  5695. function getThreeLeastCommonFeatures(elm, selectorData) {
  5696. var selector = '';
  5697. var features;
  5698. var clss = uncommonClasses(elm, selectorData);
  5699. var atts = uncommonAttributes(elm, selectorData);
  5700. if (clss.length && clss[0].count === 1) {
  5701. features = [ clss[0] ];
  5702. } else if (atts.length && atts[0].count === 1) {
  5703. features = [ atts[0] ];
  5704. selector = getBaseSelector(elm);
  5705. } else {
  5706. features = clss.concat(atts);
  5707. features.sort(countSort);
  5708. features = features.slice(0, 3);
  5709. if (!features.some(function(feat) {
  5710. return feat.species === 'class';
  5711. })) {
  5712. selector = getBaseSelector(elm);
  5713. } else {
  5714. features.sort(function(a, b) {
  5715. return a.species !== b.species && a.species === 'class' ? -1 : a.species === b.species ? 0 : 1;
  5716. });
  5717. }
  5718. }
  5719. return selector += features.reduce(function(val, feat) {
  5720. switch (feat.species) {
  5721. case 'class':
  5722. return val + '.' + feat.name;
  5723. case 'attribute':
  5724. return val + '[' + feat.name + ']';
  5725. }
  5726. return val;
  5727. }, '');
  5728. }
  5729. function generateSelector(elm, options, doc) {
  5730. if (!axe._selectorData) {
  5731. throw new Error('Expect axe._selectorData to be set up');
  5732. }
  5733. var _options$toRoot = options.toRoot, toRoot = _options$toRoot === void 0 ? false : _options$toRoot;
  5734. var selector;
  5735. var similar;
  5736. do {
  5737. var features = getElmId(elm);
  5738. if (!features) {
  5739. features = getThreeLeastCommonFeatures(elm, axe._selectorData);
  5740. features += getNthChildString(elm, features);
  5741. }
  5742. if (selector) {
  5743. selector = features + ' > ' + selector;
  5744. } else {
  5745. selector = features;
  5746. }
  5747. if (!similar) {
  5748. similar = Array.from(doc.querySelectorAll(selector));
  5749. } else {
  5750. similar = similar.filter(function(item) {
  5751. return element_matches_default(item, selector);
  5752. });
  5753. }
  5754. elm = elm.parentElement;
  5755. } while ((similar.length > 1 || toRoot) && elm && elm.nodeType !== 11);
  5756. if (similar.length === 1) {
  5757. return selector;
  5758. } else if (selector.indexOf(' > ') !== -1) {
  5759. return ':root' + selector.substring(selector.indexOf(' > '));
  5760. }
  5761. return ':root';
  5762. }
  5763. function _getSelector(elm, options) {
  5764. return get_shadow_selector_default(generateSelector, elm, options);
  5765. }
  5766. function generateAncestry(node) {
  5767. var nodeName2 = node.nodeName.toLowerCase();
  5768. var parent = node.parentElement;
  5769. if (!parent) {
  5770. return nodeName2;
  5771. }
  5772. var nthChild = '';
  5773. if (nodeName2 !== 'head' && nodeName2 !== 'body' && parent.children.length > 1) {
  5774. var index = Array.prototype.indexOf.call(parent.children, node) + 1;
  5775. nthChild = ':nth-child('.concat(index, ')');
  5776. }
  5777. return generateAncestry(parent) + ' > ' + nodeName2 + nthChild;
  5778. }
  5779. function _getAncestry(elm, options) {
  5780. return get_shadow_selector_default(generateAncestry, elm, options);
  5781. }
  5782. function getXPathArray(node, path) {
  5783. var sibling, count;
  5784. if (!node) {
  5785. return [];
  5786. }
  5787. if (!path && node.nodeType === 9) {
  5788. path = [ {
  5789. str: 'html'
  5790. } ];
  5791. return path;
  5792. }
  5793. path = path || [];
  5794. if (node.parentNode && node.parentNode !== node) {
  5795. path = getXPathArray(node.parentNode, path);
  5796. }
  5797. if (node.previousSibling) {
  5798. count = 1;
  5799. sibling = node.previousSibling;
  5800. do {
  5801. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  5802. count++;
  5803. }
  5804. sibling = sibling.previousSibling;
  5805. } while (sibling);
  5806. if (count === 1) {
  5807. count = null;
  5808. }
  5809. } else if (node.nextSibling) {
  5810. sibling = node.nextSibling;
  5811. do {
  5812. if (sibling.nodeType === 1 && sibling.nodeName === node.nodeName) {
  5813. count = 1;
  5814. sibling = null;
  5815. } else {
  5816. count = null;
  5817. sibling = sibling.previousSibling;
  5818. }
  5819. } while (sibling);
  5820. }
  5821. if (node.nodeType === 1) {
  5822. var element = {};
  5823. element.str = node.nodeName.toLowerCase();
  5824. var id = node.getAttribute && escape_selector_default(node.getAttribute('id'));
  5825. if (id && node.ownerDocument.querySelectorAll('#' + id).length === 1) {
  5826. element.id = node.getAttribute('id');
  5827. }
  5828. if (count > 1) {
  5829. element.count = count;
  5830. }
  5831. path.push(element);
  5832. }
  5833. return path;
  5834. }
  5835. function xpathToString(xpathArray) {
  5836. return xpathArray.reduce(function(str, elm) {
  5837. if (elm.id) {
  5838. return '/'.concat(elm.str, '[@id=\'').concat(elm.id, '\']');
  5839. } else {
  5840. return str + '/'.concat(elm.str) + (elm.count > 0 ? '['.concat(elm.count, ']') : '');
  5841. }
  5842. }, '');
  5843. }
  5844. function getXpath(node) {
  5845. var xpathArray = getXPathArray(node);
  5846. return xpathToString(xpathArray);
  5847. }
  5848. var get_xpath_default = getXpath;
  5849. function truncate(str, maxLength) {
  5850. maxLength = maxLength || 300;
  5851. if (str.length > maxLength) {
  5852. var index = str.indexOf('>');
  5853. str = str.substring(0, index + 1);
  5854. }
  5855. return str;
  5856. }
  5857. function getSource(element) {
  5858. var source = element.outerHTML;
  5859. if (!source && typeof XMLSerializer === 'function') {
  5860. source = new XMLSerializer().serializeToString(element);
  5861. }
  5862. return truncate(source || '');
  5863. }
  5864. function DqElement(element, options, spec) {
  5865. this._fromFrame = !!spec;
  5866. this.spec = spec || {};
  5867. if (options && options.absolutePaths) {
  5868. this._options = {
  5869. toRoot: true
  5870. };
  5871. }
  5872. if (axe._audit && axe._audit.noHtml) {
  5873. this.source = null;
  5874. } else if (this.spec.source !== void 0) {
  5875. this.source = this.spec.source;
  5876. } else {
  5877. this.source = getSource(element);
  5878. }
  5879. this._element = element;
  5880. }
  5881. DqElement.prototype = {
  5882. get selector() {
  5883. return this.spec.selector || [ _getSelector(this.element, this._options) ];
  5884. },
  5885. get ancestry() {
  5886. return this.spec.ancestry || [ _getAncestry(this.element) ];
  5887. },
  5888. get xpath() {
  5889. return this.spec.xpath || [ get_xpath_default(this.element) ];
  5890. },
  5891. get element() {
  5892. return this._element;
  5893. },
  5894. get fromFrame() {
  5895. return this._fromFrame;
  5896. },
  5897. toJSON: function toJSON() {
  5898. return {
  5899. selector: this.selector,
  5900. source: this.source,
  5901. xpath: this.xpath,
  5902. ancestry: this.ancestry
  5903. };
  5904. }
  5905. };
  5906. DqElement.fromFrame = function(node, options, frame) {
  5907. var spec = _extends({}, node, {
  5908. selector: [].concat(_toConsumableArray(frame.selector), _toConsumableArray(node.selector)),
  5909. ancestry: [].concat(_toConsumableArray(frame.ancestry), _toConsumableArray(node.ancestry)),
  5910. xpath: [].concat(_toConsumableArray(frame.xpath), _toConsumableArray(node.xpath))
  5911. });
  5912. return new DqElement(frame.element, options, spec);
  5913. };
  5914. var dq_element_default = DqElement;
  5915. function checkHelper(checkResult, options, resolve, reject) {
  5916. return {
  5917. isAsync: false,
  5918. async: function async() {
  5919. this.isAsync = true;
  5920. return function(result) {
  5921. if (result instanceof Error === false) {
  5922. checkResult.result = result;
  5923. resolve(checkResult);
  5924. } else {
  5925. reject(result);
  5926. }
  5927. };
  5928. },
  5929. data: function data(data2) {
  5930. checkResult.data = data2;
  5931. },
  5932. relatedNodes: function relatedNodes(nodes) {
  5933. nodes = nodes instanceof window.Node ? [ nodes ] : to_array_default(nodes);
  5934. checkResult.relatedNodes = nodes.map(function(element) {
  5935. return new dq_element_default(element, options);
  5936. });
  5937. }
  5938. };
  5939. }
  5940. var check_helper_default = checkHelper;
  5941. function clone(obj) {
  5942. var index, length, out = obj;
  5943. if (obj !== null && _typeof(obj) === 'object') {
  5944. if (Array.isArray(obj)) {
  5945. out = [];
  5946. for (index = 0, length = obj.length; index < length; index++) {
  5947. out[index] = clone(obj[index]);
  5948. }
  5949. } else {
  5950. out = {};
  5951. for (index in obj) {
  5952. out[index] = clone(obj[index]);
  5953. }
  5954. }
  5955. }
  5956. return out;
  5957. }
  5958. var clone_default = clone;
  5959. var css_selector_parser = __toModule(require_lib());
  5960. var parser = new css_selector_parser.CssSelectorParser();
  5961. parser.registerSelectorPseudos('not');
  5962. parser.registerNestingOperators('>');
  5963. parser.registerAttrEqualityMods('^', '$', '*', '~');
  5964. var css_parser_default = parser;
  5965. function matchesTag(vNode, exp) {
  5966. return vNode.props.nodeType === 1 && (exp.tag === '*' || vNode.props.nodeName === exp.tag);
  5967. }
  5968. function matchesClasses(vNode, exp) {
  5969. return !exp.classes || exp.classes.every(function(cl) {
  5970. return vNode.hasClass(cl.value);
  5971. });
  5972. }
  5973. function matchesAttributes(vNode, exp) {
  5974. return !exp.attributes || exp.attributes.every(function(att) {
  5975. var nodeAtt = vNode.attr(att.key);
  5976. return nodeAtt !== null && (!att.value || att.test(nodeAtt));
  5977. });
  5978. }
  5979. function matchesId(vNode, exp) {
  5980. return !exp.id || vNode.props.id === exp.id;
  5981. }
  5982. function matchesPseudos(target, exp) {
  5983. if (!exp.pseudos || exp.pseudos.every(function(pseudo) {
  5984. if (pseudo.name === 'not') {
  5985. return !_matchesExpression(target, pseudo.expressions[0]);
  5986. }
  5987. throw new Error('the pseudo selector ' + pseudo.name + ' has not yet been implemented');
  5988. })) {
  5989. return true;
  5990. }
  5991. return false;
  5992. }
  5993. function matchExpression(vNode, expression) {
  5994. return matchesTag(vNode, expression) && matchesClasses(vNode, expression) && matchesAttributes(vNode, expression) && matchesId(vNode, expression) && matchesPseudos(vNode, expression);
  5995. }
  5996. var escapeRegExp = function() {
  5997. var from = /(?=[\-\[\]{}()*+?.\\\^$|,#\s])/g;
  5998. var to = '\\';
  5999. return function(string) {
  6000. return string.replace(from, to);
  6001. };
  6002. }();
  6003. var reUnescape = /\\/g;
  6004. function convertAttributes(atts) {
  6005. if (!atts) {
  6006. return;
  6007. }
  6008. return atts.map(function(att) {
  6009. var attributeKey = att.name.replace(reUnescape, '');
  6010. var attributeValue = (att.value || '').replace(reUnescape, '');
  6011. var test, regexp;
  6012. switch (att.operator) {
  6013. case '^=':
  6014. regexp = new RegExp('^' + escapeRegExp(attributeValue));
  6015. break;
  6016. case '$=':
  6017. regexp = new RegExp(escapeRegExp(attributeValue) + '$');
  6018. break;
  6019. case '~=':
  6020. regexp = new RegExp('(^|\\s)' + escapeRegExp(attributeValue) + '(\\s|$)');
  6021. break;
  6022. case '|=':
  6023. regexp = new RegExp('^' + escapeRegExp(attributeValue) + '(-|$)');
  6024. break;
  6025. case '=':
  6026. test = function test(value) {
  6027. return attributeValue === value;
  6028. };
  6029. break;
  6030. case '*=':
  6031. test = function test(value) {
  6032. return value && value.includes(attributeValue);
  6033. };
  6034. break;
  6035. case '!=':
  6036. test = function test(value) {
  6037. return attributeValue !== value;
  6038. };
  6039. break;
  6040. default:
  6041. test = function test(value) {
  6042. return !!value;
  6043. };
  6044. }
  6045. if (attributeValue === '' && /^[*$^]=$/.test(att.operator)) {
  6046. test = function test() {
  6047. return false;
  6048. };
  6049. }
  6050. if (!test) {
  6051. test = function test(value) {
  6052. return value && regexp.test(value);
  6053. };
  6054. }
  6055. return {
  6056. key: attributeKey,
  6057. value: attributeValue,
  6058. test: test
  6059. };
  6060. });
  6061. }
  6062. function convertClasses(classes) {
  6063. if (!classes) {
  6064. return;
  6065. }
  6066. return classes.map(function(className) {
  6067. className = className.replace(reUnescape, '');
  6068. return {
  6069. value: className,
  6070. regexp: new RegExp('(^|\\s)' + escapeRegExp(className) + '(\\s|$)')
  6071. };
  6072. });
  6073. }
  6074. function convertPseudos(pseudos) {
  6075. if (!pseudos) {
  6076. return;
  6077. }
  6078. return pseudos.map(function(p) {
  6079. var expressions;
  6080. if (p.name === 'not') {
  6081. expressions = p.value;
  6082. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  6083. expressions = convertExpressions(expressions);
  6084. }
  6085. return {
  6086. name: p.name,
  6087. expressions: expressions,
  6088. value: p.value
  6089. };
  6090. });
  6091. }
  6092. function convertExpressions(expressions) {
  6093. return expressions.map(function(exp) {
  6094. var newExp = [];
  6095. var rule3 = exp.rule;
  6096. while (rule3) {
  6097. newExp.push({
  6098. tag: rule3.tagName ? rule3.tagName.toLowerCase() : '*',
  6099. combinator: rule3.nestingOperator ? rule3.nestingOperator : ' ',
  6100. id: rule3.id,
  6101. attributes: convertAttributes(rule3.attrs),
  6102. classes: convertClasses(rule3.classNames),
  6103. pseudos: convertPseudos(rule3.pseudos)
  6104. });
  6105. rule3 = rule3.rule;
  6106. }
  6107. return newExp;
  6108. });
  6109. }
  6110. function _convertSelector(selector) {
  6111. var expressions = css_parser_default.parse(selector);
  6112. expressions = expressions.selectors ? expressions.selectors : [ expressions ];
  6113. return convertExpressions(expressions);
  6114. }
  6115. function _matchesExpression(vNode, expressions, matchAnyParent) {
  6116. var exps = [].concat(expressions);
  6117. var expression = exps.pop();
  6118. var matches13 = matchExpression(vNode, expression);
  6119. while (!matches13 && matchAnyParent && vNode.parent) {
  6120. vNode = vNode.parent;
  6121. matches13 = matchExpression(vNode, expression);
  6122. }
  6123. if (exps.length) {
  6124. if ([ ' ', '>' ].includes(expression.combinator) === false) {
  6125. throw new Error('axe.utils.matchesExpression does not support the combinator: ' + expression.combinator);
  6126. }
  6127. matches13 = matches13 && _matchesExpression(vNode.parent, exps, expression.combinator === ' ');
  6128. }
  6129. return matches13;
  6130. }
  6131. function matches(vNode, selector) {
  6132. var expressions = _convertSelector(selector);
  6133. return expressions.some(function(expression) {
  6134. return _matchesExpression(vNode, expression);
  6135. });
  6136. }
  6137. var matches_default = matches;
  6138. function closest(vNode, selector) {
  6139. while (vNode) {
  6140. if (matches_default(vNode, selector)) {
  6141. return vNode;
  6142. }
  6143. if (typeof vNode.parent === 'undefined') {
  6144. throw new TypeError('Cannot resolve parent for non-DOM nodes');
  6145. }
  6146. vNode = vNode.parent;
  6147. }
  6148. return null;
  6149. }
  6150. var closest_default = closest;
  6151. function noop() {}
  6152. function funcGuard(f) {
  6153. if (typeof f !== 'function') {
  6154. throw new TypeError('Queue methods require functions as arguments');
  6155. }
  6156. }
  6157. function queue() {
  6158. var tasks = [];
  6159. var started = 0;
  6160. var remaining = 0;
  6161. var completeQueue = noop;
  6162. var complete = false;
  6163. var err2;
  6164. var defaultFail = function defaultFail(e) {
  6165. err2 = e;
  6166. setTimeout(function() {
  6167. if (err2 !== void 0 && err2 !== null) {
  6168. log_default('Uncaught error (of queue)', err2);
  6169. }
  6170. }, 1);
  6171. };
  6172. var failed = defaultFail;
  6173. function createResolve(i) {
  6174. return function(r) {
  6175. tasks[i] = r;
  6176. remaining -= 1;
  6177. if (!remaining && completeQueue !== noop) {
  6178. complete = true;
  6179. completeQueue(tasks);
  6180. }
  6181. };
  6182. }
  6183. function abort(msg) {
  6184. completeQueue = noop;
  6185. failed(msg);
  6186. return tasks;
  6187. }
  6188. function pop() {
  6189. var length = tasks.length;
  6190. for (;started < length; started++) {
  6191. var task = tasks[started];
  6192. try {
  6193. task.call(null, createResolve(started), abort);
  6194. } catch (e) {
  6195. abort(e);
  6196. }
  6197. }
  6198. }
  6199. var q = {
  6200. defer: function defer(fn) {
  6201. if (_typeof(fn) === 'object' && fn.then && fn['catch']) {
  6202. var defer = fn;
  6203. fn = function fn(resolve, reject) {
  6204. defer.then(resolve)['catch'](reject);
  6205. };
  6206. }
  6207. funcGuard(fn);
  6208. if (err2 !== void 0) {
  6209. return;
  6210. } else if (complete) {
  6211. throw new Error('Queue already completed');
  6212. }
  6213. tasks.push(fn);
  6214. ++remaining;
  6215. pop();
  6216. return q;
  6217. },
  6218. then: function then(fn) {
  6219. funcGuard(fn);
  6220. if (completeQueue !== noop) {
  6221. throw new Error('queue `then` already set');
  6222. }
  6223. if (!err2) {
  6224. completeQueue = fn;
  6225. if (!remaining) {
  6226. complete = true;
  6227. completeQueue(tasks);
  6228. }
  6229. }
  6230. return q;
  6231. },
  6232. catch: function _catch(fn) {
  6233. funcGuard(fn);
  6234. if (failed !== defaultFail) {
  6235. throw new Error('queue `catch` already set');
  6236. }
  6237. if (!err2) {
  6238. failed = fn;
  6239. } else {
  6240. fn(err2);
  6241. err2 = null;
  6242. }
  6243. return q;
  6244. },
  6245. abort: abort
  6246. };
  6247. return q;
  6248. }
  6249. var queue_default = queue;
  6250. var uuid;
  6251. var _rng;
  6252. var _crypto = window.crypto || window.msCrypto;
  6253. if (!_rng && _crypto && _crypto.getRandomValues) {
  6254. var _rnds8 = new Uint8Array(16);
  6255. _rng = function whatwgRNG() {
  6256. _crypto.getRandomValues(_rnds8);
  6257. return _rnds8;
  6258. };
  6259. }
  6260. try {
  6261. if (!_rng) {
  6262. var nodeCrypto = require('crypto');
  6263. _rng = function _rng() {
  6264. return nodeCrypto.randomBytes(16);
  6265. };
  6266. }
  6267. } catch (e) {}
  6268. if (!_rng) {
  6269. var _rnds = new Array(16);
  6270. _rng = function _rng() {
  6271. for (var i = 0, r; i < 16; i++) {
  6272. if ((i & 3) === 0) {
  6273. r = Math.random() * 4294967296;
  6274. }
  6275. _rnds[i] = r >>> ((i & 3) << 3) & 255;
  6276. }
  6277. return _rnds;
  6278. };
  6279. }
  6280. var BufferClass = typeof window.Buffer == 'function' ? window.Buffer : Array;
  6281. var _byteToHex = [];
  6282. var _hexToByte = {};
  6283. for (var i = 0; i < 256; i++) {
  6284. _byteToHex[i] = (i + 256).toString(16).substr(1);
  6285. _hexToByte[_byteToHex[i]] = i;
  6286. }
  6287. function parse(s, buf, offset) {
  6288. var i = buf && offset || 0, ii = 0;
  6289. buf = buf || [];
  6290. s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
  6291. if (ii < 16) {
  6292. buf[i + ii++] = _hexToByte[oct];
  6293. }
  6294. });
  6295. while (ii < 16) {
  6296. buf[i + ii++] = 0;
  6297. }
  6298. return buf;
  6299. }
  6300. function unparse(buf, offset) {
  6301. var i = offset || 0, bth = _byteToHex;
  6302. return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]];
  6303. }
  6304. var _seedBytes = _rng();
  6305. var _nodeId = [ _seedBytes[0] | 1, _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] ];
  6306. var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 16383;
  6307. var _lastMSecs = 0;
  6308. var _lastNSecs = 0;
  6309. function v1(options, buf, offset) {
  6310. var i = buf && offset || 0;
  6311. var b = buf || [];
  6312. options = options || {};
  6313. var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
  6314. var msecs = options.msecs != null ? options.msecs : new Date().getTime();
  6315. var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
  6316. var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
  6317. if (dt < 0 && options.clockseq == null) {
  6318. clockseq = clockseq + 1 & 16383;
  6319. }
  6320. if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
  6321. nsecs = 0;
  6322. }
  6323. if (nsecs >= 1e4) {
  6324. throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
  6325. }
  6326. _lastMSecs = msecs;
  6327. _lastNSecs = nsecs;
  6328. _clockseq = clockseq;
  6329. msecs += 122192928e5;
  6330. var tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
  6331. b[i++] = tl >>> 24 & 255;
  6332. b[i++] = tl >>> 16 & 255;
  6333. b[i++] = tl >>> 8 & 255;
  6334. b[i++] = tl & 255;
  6335. var tmh = msecs / 4294967296 * 1e4 & 268435455;
  6336. b[i++] = tmh >>> 8 & 255;
  6337. b[i++] = tmh & 255;
  6338. b[i++] = tmh >>> 24 & 15 | 16;
  6339. b[i++] = tmh >>> 16 & 255;
  6340. b[i++] = clockseq >>> 8 | 128;
  6341. b[i++] = clockseq & 255;
  6342. var node = options.node || _nodeId;
  6343. for (var n = 0; n < 6; n++) {
  6344. b[i + n] = node[n];
  6345. }
  6346. return buf ? buf : unparse(b);
  6347. }
  6348. function v4(options, buf, offset) {
  6349. var i = buf && offset || 0;
  6350. if (typeof options == 'string') {
  6351. buf = options == 'binary' ? new BufferClass(16) : null;
  6352. options = null;
  6353. }
  6354. options = options || {};
  6355. var rnds = options.random || (options.rng || _rng)();
  6356. rnds[6] = rnds[6] & 15 | 64;
  6357. rnds[8] = rnds[8] & 63 | 128;
  6358. if (buf) {
  6359. for (var ii = 0; ii < 16; ii++) {
  6360. buf[i + ii] = rnds[ii];
  6361. }
  6362. }
  6363. return buf || unparse(rnds);
  6364. }
  6365. uuid = v4;
  6366. uuid.v1 = v1;
  6367. uuid.v4 = v4;
  6368. uuid.parse = parse;
  6369. uuid.unparse = unparse;
  6370. uuid.BufferClass = BufferClass;
  6371. axe._uuid = v1();
  6372. var uuid_default = v4;
  6373. var subscribers = {};
  6374. var channels = {};
  6375. function storeCallback(_ref2, callback) {
  6376. var topic = _ref2.topic, channelId = _ref2.channelId;
  6377. var sendToParent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  6378. if (topic) {
  6379. assert_default(!subscribers[topic], 'Topic '.concat(topic, ' is already registered to.'));
  6380. subscribers[topic] = {
  6381. callback: callback,
  6382. sendToParent: sendToParent
  6383. };
  6384. } else if (channelId) {
  6385. assert_default(!channels[channelId], 'A callback already exists for this message channel.');
  6386. channels[channelId] = {
  6387. callback: callback,
  6388. sendToParent: sendToParent
  6389. };
  6390. }
  6391. }
  6392. function getCallback(_ref3) {
  6393. var topic = _ref3.topic, channelId = _ref3.channelId;
  6394. if (topic) {
  6395. return subscribers[topic];
  6396. } else if (channelId) {
  6397. return channels[channelId];
  6398. }
  6399. }
  6400. function deleteCallback(_ref4) {
  6401. var topic = _ref4.topic, channelId = _ref4.channelId;
  6402. if (topic) {
  6403. delete subscribers[topic];
  6404. } else if (channelId) {
  6405. delete channels[channelId];
  6406. }
  6407. }
  6408. var errorTypes = Object.freeze([ 'EvalError', 'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError', 'URIError' ]);
  6409. function stringifyMessage(_ref5) {
  6410. var topic = _ref5.topic, channelId = _ref5.channelId, message = _ref5.message, messageId = _ref5.messageId, keepalive = _ref5.keepalive;
  6411. var data2 = {
  6412. channelId: channelId,
  6413. topic: topic,
  6414. messageId: messageId,
  6415. keepalive: keepalive,
  6416. source: getSource2()
  6417. };
  6418. if (message instanceof Error) {
  6419. data2.error = {
  6420. name: message.name,
  6421. message: message.message,
  6422. stack: message.stack
  6423. };
  6424. } else {
  6425. data2.payload = message;
  6426. }
  6427. return JSON.stringify(data2);
  6428. }
  6429. function parseMessage(dataString) {
  6430. var data2;
  6431. try {
  6432. data2 = JSON.parse(dataString);
  6433. } catch (e) {}
  6434. if (!isRespondableMessage(data2)) {
  6435. return;
  6436. }
  6437. var _data = data2, topic = _data.topic, channelId = _data.channelId, messageId = _data.messageId, keepalive = _data.keepalive;
  6438. var message = _typeof(data2.error) === 'object' ? buildErrorObject(data2.error) : data2.payload;
  6439. return {
  6440. topic: topic,
  6441. message: message,
  6442. messageId: messageId,
  6443. channelId: channelId,
  6444. keepalive: keepalive
  6445. };
  6446. }
  6447. function isRespondableMessage(postedMessage) {
  6448. return _typeof(postedMessage) === 'object' && typeof postedMessage.channelId === 'string' && postedMessage.source === getSource2();
  6449. }
  6450. function buildErrorObject(error) {
  6451. var msg = error.message || 'Unknown error occurred';
  6452. var errorName = errorTypes.includes(error.name) ? error.name : 'Error';
  6453. var ErrConstructor = window[errorName] || Error;
  6454. if (error.stack) {
  6455. msg += '\n' + error.stack.replace(error.message, '');
  6456. }
  6457. return new ErrConstructor(msg);
  6458. }
  6459. function getSource2() {
  6460. var application = 'axeAPI';
  6461. var version = '';
  6462. if (typeof axe !== 'undefined' && axe._audit && axe._audit.application) {
  6463. application = axe._audit.application;
  6464. }
  6465. if (typeof axe !== 'undefined') {
  6466. version = axe.version;
  6467. }
  6468. return application + '.' + version;
  6469. }
  6470. function assertIsParentWindow(win) {
  6471. assetNotGlobalWindow(win);
  6472. assert_default(window.parent === win, 'Source of the response must be the parent window.');
  6473. }
  6474. function assertIsFrameWindow(win) {
  6475. assetNotGlobalWindow(win);
  6476. assert_default(win.parent === window, 'Respondable target must be a frame in the current window');
  6477. }
  6478. function assetNotGlobalWindow(win) {
  6479. assert_default(window !== win, 'Messages can not be sent to the same window.');
  6480. }
  6481. function post(win, _ref6) {
  6482. var topic = _ref6.topic, message = _ref6.message, messageId = _ref6.messageId, channelId = _ref6.channelId, keepalive = _ref6.keepalive, sendToParent = _ref6.sendToParent;
  6483. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  6484. if (message instanceof Error && !sendToParent) {
  6485. return axe.log(message);
  6486. }
  6487. var dataString = stringifyMessage({
  6488. topic: topic,
  6489. message: message,
  6490. messageId: messageId,
  6491. channelId: channelId,
  6492. keepalive: keepalive
  6493. });
  6494. win.postMessage(dataString, '*');
  6495. }
  6496. var messageIds = [];
  6497. function createMessageId() {
  6498. var uuid5 = ''.concat(v4(), ':').concat(v4());
  6499. if (messageIds.includes(uuid5)) {
  6500. return createMessageId();
  6501. }
  6502. messageIds.push(uuid5);
  6503. return uuid5;
  6504. }
  6505. function isNewMessage(uuid5) {
  6506. if (messageIds.includes(uuid5)) {
  6507. return false;
  6508. }
  6509. messageIds.push(uuid5);
  6510. return true;
  6511. }
  6512. function _respondable(win, topic, message, keepalive, callback) {
  6513. var channelId = ''.concat(v4(), ':').concat(v4());
  6514. if (typeof callback === 'function') {
  6515. storeCallback({
  6516. channelId: channelId
  6517. }, callback, false);
  6518. }
  6519. post(win, {
  6520. topic: topic,
  6521. channelId: channelId,
  6522. message: message,
  6523. messageId: createMessageId(),
  6524. keepalive: !!keepalive,
  6525. sendToParent: false
  6526. });
  6527. }
  6528. if (typeof window.addEventListener === 'function') {
  6529. window.addEventListener('message', messageListener, false);
  6530. }
  6531. function messageListener(_ref7) {
  6532. var dataString = _ref7.data, win = _ref7.source;
  6533. var _ref8 = parseMessage(dataString) || {}, channelId = _ref8.channelId, topic = _ref8.topic, message = _ref8.message, messageId = _ref8.messageId, keepalive = _ref8.keepalive;
  6534. var _ref9 = getCallback({
  6535. channelId: channelId,
  6536. topic: topic
  6537. }) || {}, callback = _ref9.callback, sendToParent = _ref9.sendToParent;
  6538. if (!shouldRunCallback({
  6539. message: message,
  6540. messageId: messageId,
  6541. callback: callback,
  6542. sendToParent: sendToParent
  6543. })) {
  6544. return;
  6545. }
  6546. if (!keepalive && channelId) {
  6547. deleteCallback({
  6548. channelId: channelId
  6549. });
  6550. }
  6551. runCallback(win, {
  6552. channelId: channelId,
  6553. message: message,
  6554. keepalive: keepalive,
  6555. sendToParent: sendToParent,
  6556. callback: callback
  6557. });
  6558. }
  6559. _respondable.subscribe = function subscribe(topic, callback) {
  6560. assert_default(typeof callback === 'function', 'Subscriber callback must be a function');
  6561. storeCallback({
  6562. topic: topic
  6563. }, callback);
  6564. };
  6565. _respondable.isInFrame = function isInFrame() {
  6566. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  6567. return !!win.frameElement;
  6568. };
  6569. function shouldRunCallback(_ref10) {
  6570. var message = _ref10.message, messageId = _ref10.messageId, callback = _ref10.callback, sendToParent = _ref10.sendToParent;
  6571. if (message instanceof Error && sendToParent) {
  6572. axe.log(message);
  6573. return false;
  6574. }
  6575. return !!callback && isNewMessage(messageId);
  6576. }
  6577. function runCallback(win, _ref11) {
  6578. var channelId = _ref11.channelId, message = _ref11.message, keepalive = _ref11.keepalive, sendToParent = _ref11.sendToParent, callback = _ref11.callback;
  6579. try {
  6580. sendToParent ? assertIsParentWindow(win) : assertIsFrameWindow(win);
  6581. var responder = createResponder(win, channelId, sendToParent);
  6582. callback(message, keepalive, responder);
  6583. } catch (error) {
  6584. processError(win, error, channelId, sendToParent);
  6585. }
  6586. }
  6587. function processError(win, error, channelId, sendToParent) {
  6588. if (!sendToParent) {
  6589. return axe.log(error);
  6590. }
  6591. try {
  6592. post(win, {
  6593. topic: null,
  6594. channelId: channelId,
  6595. message: error,
  6596. messageId: createMessageId(),
  6597. keepalive: true,
  6598. sendToParent: sendToParent
  6599. });
  6600. } catch (err2) {
  6601. return axe.log(err2);
  6602. }
  6603. }
  6604. function createResponder(win, channelId, sendToParent) {
  6605. return function respond(message, keepalive, callback) {
  6606. if (typeof callback === 'function') {
  6607. storeCallback({
  6608. channelId: channelId
  6609. }, callback, sendToParent);
  6610. }
  6611. post(win, {
  6612. topic: null,
  6613. channelId: channelId,
  6614. message: message,
  6615. messageId: createMessageId(),
  6616. keepalive: !!keepalive,
  6617. sendToParent: sendToParent
  6618. });
  6619. };
  6620. }
  6621. function err(message, node) {
  6622. var selector;
  6623. if (axe._tree) {
  6624. selector = _getSelector(node);
  6625. }
  6626. return new Error(message + ': ' + (selector || node));
  6627. }
  6628. function sendCommandToFrame(node, parameters, resolve, reject) {
  6629. var win = node.contentWindow;
  6630. if (!win) {
  6631. log_default('Frame does not have a content window', node);
  6632. resolve(null);
  6633. return;
  6634. }
  6635. var timeout = setTimeout(function() {
  6636. timeout = setTimeout(function() {
  6637. if (!parameters.debug) {
  6638. resolve(null);
  6639. } else {
  6640. reject(err('No response from frame', node));
  6641. }
  6642. }, 0);
  6643. }, 500);
  6644. _respondable(win, 'axe.ping', null, void 0, function() {
  6645. clearTimeout(timeout);
  6646. var frameWaitTime = parameters.options && parameters.options.frameWaitTime || 6e4;
  6647. timeout = setTimeout(function collectResultFramesTimeout() {
  6648. reject(err('Axe in frame timed out', node));
  6649. }, frameWaitTime);
  6650. _respondable(win, 'axe.start', parameters, void 0, function(data2) {
  6651. clearTimeout(timeout);
  6652. if (data2 instanceof Error === false) {
  6653. resolve(data2);
  6654. } else {
  6655. reject(data2);
  6656. }
  6657. });
  6658. });
  6659. }
  6660. var send_command_to_frame_default = sendCommandToFrame;
  6661. function getAllChecks(object) {
  6662. var result = [];
  6663. return result.concat(object.any || []).concat(object.all || []).concat(object.none || []);
  6664. }
  6665. var get_all_checks_default = getAllChecks;
  6666. function nodeSorter(nodeA, nodeB) {
  6667. nodeA = nodeA.actualNode || nodeA;
  6668. nodeB = nodeB.actualNode || nodeB;
  6669. if (nodeA === nodeB) {
  6670. return 0;
  6671. }
  6672. if (nodeA.compareDocumentPosition(nodeB) & 4) {
  6673. return -1;
  6674. } else {
  6675. return 1;
  6676. }
  6677. }
  6678. var node_sorter_default = nodeSorter;
  6679. function findBy(array, key, value) {
  6680. if (Array.isArray(array)) {
  6681. return array.find(function(obj) {
  6682. return _typeof(obj) === 'object' && obj[key] === value;
  6683. });
  6684. }
  6685. }
  6686. var find_by_default = findBy;
  6687. function pushFrame(resultSet, dqFrame, options) {
  6688. resultSet.forEach(function(res) {
  6689. res.node = dq_element_default.fromFrame(res.node, options, dqFrame);
  6690. var checks = get_all_checks_default(res);
  6691. checks.forEach(function(check4) {
  6692. check4.relatedNodes = check4.relatedNodes.map(function(node) {
  6693. return dq_element_default.fromFrame(node, options, dqFrame);
  6694. });
  6695. });
  6696. });
  6697. }
  6698. function spliceNodes(target, to) {
  6699. var firstFromFrame = to[0].node;
  6700. for (var _i2 = 0; _i2 < target.length; _i2++) {
  6701. var node = target[_i2].node;
  6702. var sorterResult = node_sorter_default({
  6703. actualNode: node.element
  6704. }, {
  6705. actualNode: firstFromFrame.element
  6706. });
  6707. if (sorterResult > 0 || sorterResult === 0 && firstFromFrame.selector.length < node.selector.length) {
  6708. target.splice.apply(target, [ _i2, 0 ].concat(to));
  6709. return;
  6710. }
  6711. }
  6712. target.push.apply(target, to);
  6713. }
  6714. function normalizeResult(result) {
  6715. if (!result || !result.results) {
  6716. return null;
  6717. }
  6718. if (!Array.isArray(result.results)) {
  6719. return [ result.results ];
  6720. }
  6721. if (!result.results.length) {
  6722. return null;
  6723. }
  6724. return result.results;
  6725. }
  6726. function mergeResults(frameResults, options) {
  6727. var mergedResult = [];
  6728. frameResults.forEach(function(frameResult) {
  6729. var results = normalizeResult(frameResult);
  6730. if (!results || !results.length) {
  6731. return;
  6732. }
  6733. var dqFrame;
  6734. if (frameResult.frameElement) {
  6735. var spec = {
  6736. selector: [ frameResult.frame ]
  6737. };
  6738. dqFrame = new dq_element_default(frameResult.frameElement, options, spec);
  6739. }
  6740. results.forEach(function(ruleResult) {
  6741. if (ruleResult.nodes && dqFrame) {
  6742. pushFrame(ruleResult.nodes, dqFrame, options);
  6743. }
  6744. var res = find_by_default(mergedResult, 'id', ruleResult.id);
  6745. if (!res) {
  6746. mergedResult.push(ruleResult);
  6747. } else {
  6748. if (ruleResult.nodes.length) {
  6749. spliceNodes(res.nodes, ruleResult.nodes);
  6750. }
  6751. }
  6752. });
  6753. });
  6754. if (frameResults.length > 1 && window && window.Node) {
  6755. mergedResult.forEach(function(result) {
  6756. if (result.nodes) {
  6757. result.nodes.sort(function(a, b) {
  6758. var aNode = a.node.element;
  6759. var bNode = b.node.element;
  6760. if (aNode !== bNode && (a.node._fromFrame || b.node._fromFrame)) {
  6761. return node_sorter_default(aNode, bNode);
  6762. }
  6763. return 0;
  6764. });
  6765. }
  6766. });
  6767. }
  6768. return mergedResult;
  6769. }
  6770. var merge_results_default = mergeResults;
  6771. function collectResultsFromFrames(context3, options, command, parameter, resolve, reject) {
  6772. var q = queue_default();
  6773. var frames = context3.frames;
  6774. frames.forEach(function(frame) {
  6775. var params = {
  6776. options: options,
  6777. command: command,
  6778. parameter: parameter,
  6779. context: {
  6780. initiator: false,
  6781. page: context3.page,
  6782. include: frame.include || [],
  6783. exclude: frame.exclude || []
  6784. }
  6785. };
  6786. q.defer(function(res, rej) {
  6787. var node = frame.node;
  6788. send_command_to_frame_default(node, params, function(data2) {
  6789. if (data2) {
  6790. return res({
  6791. results: data2,
  6792. frameElement: node,
  6793. frame: _getSelector(node)
  6794. });
  6795. }
  6796. res(null);
  6797. }, rej);
  6798. });
  6799. });
  6800. q.then(function(data2) {
  6801. resolve(merge_results_default(data2, options));
  6802. })['catch'](reject);
  6803. }
  6804. var collect_results_from_frames_default = collectResultsFromFrames;
  6805. function contains(vNode, otherVNode) {
  6806. function containsShadowChild(vNode2, otherVNode2) {
  6807. if (vNode2.shadowId === otherVNode2.shadowId) {
  6808. return true;
  6809. }
  6810. return !!vNode2.children.find(function(child) {
  6811. return containsShadowChild(child, otherVNode2);
  6812. });
  6813. }
  6814. if (vNode.shadowId || otherVNode.shadowId) {
  6815. return containsShadowChild(vNode, otherVNode);
  6816. }
  6817. if (vNode.actualNode) {
  6818. if (typeof vNode.actualNode.contains === 'function') {
  6819. return vNode.actualNode.contains(otherVNode.actualNode);
  6820. }
  6821. return !!(vNode.actualNode.compareDocumentPosition(otherVNode.actualNode) & 16);
  6822. } else {
  6823. do {
  6824. if (otherVNode === vNode) {
  6825. return true;
  6826. }
  6827. } while (otherVNode = otherVNode && otherVNode.parent);
  6828. }
  6829. return false;
  6830. }
  6831. var contains_default = contains;
  6832. function deepMerge() {
  6833. var target = {};
  6834. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  6835. sources[_key] = arguments[_key];
  6836. }
  6837. sources.forEach(function(source) {
  6838. if (!source || _typeof(source) !== 'object' || Array.isArray(source)) {
  6839. return;
  6840. }
  6841. for (var _i3 = 0, _Object$keys = Object.keys(source); _i3 < _Object$keys.length; _i3++) {
  6842. var key = _Object$keys[_i3];
  6843. if (!target.hasOwnProperty(key) || _typeof(source[key]) !== 'object' || Array.isArray(target[key])) {
  6844. target[key] = source[key];
  6845. } else {
  6846. target[key] = deepMerge(target[key], source[key]);
  6847. }
  6848. }
  6849. });
  6850. return target;
  6851. }
  6852. var deep_merge_default = deepMerge;
  6853. function extendMetaData(to, from) {
  6854. Object.assign(to, from);
  6855. Object.keys(from).filter(function(prop) {
  6856. return typeof from[prop] === 'function';
  6857. }).forEach(function(prop) {
  6858. to[prop] = null;
  6859. try {
  6860. to[prop] = from[prop](to);
  6861. } catch (e) {}
  6862. });
  6863. }
  6864. var extend_meta_data_default = extendMetaData;
  6865. var possibleShadowRoots = [ 'article', 'aside', 'blockquote', 'body', 'div', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'main', 'nav', 'p', 'section', 'span' ];
  6866. function isShadowRoot(node) {
  6867. if (node.shadowRoot) {
  6868. var nodeName2 = node.nodeName.toLowerCase();
  6869. if (possibleShadowRoots.includes(nodeName2) || /^[a-z][a-z0-9_.-]*-[a-z0-9_.-]*$/.test(nodeName2)) {
  6870. return true;
  6871. }
  6872. }
  6873. return false;
  6874. }
  6875. var is_shadow_root_default = isShadowRoot;
  6876. var dom_exports = {};
  6877. __export(dom_exports, {
  6878. findElmsInContext: function findElmsInContext() {
  6879. return find_elms_in_context_default;
  6880. },
  6881. findUp: function findUp() {
  6882. return find_up_default;
  6883. },
  6884. findUpVirtual: function findUpVirtual() {
  6885. return find_up_virtual_default;
  6886. },
  6887. getComposedParent: function getComposedParent() {
  6888. return get_composed_parent_default;
  6889. },
  6890. getElementByReference: function getElementByReference() {
  6891. return get_element_by_reference_default;
  6892. },
  6893. getElementCoordinates: function getElementCoordinates() {
  6894. return get_element_coordinates_default;
  6895. },
  6896. getElementStack: function getElementStack() {
  6897. return get_element_stack_default;
  6898. },
  6899. getRootNode: function getRootNode() {
  6900. return get_root_node_default2;
  6901. },
  6902. getScrollOffset: function getScrollOffset() {
  6903. return get_scroll_offset_default;
  6904. },
  6905. getTabbableElements: function getTabbableElements() {
  6906. return get_tabbable_elements_default;
  6907. },
  6908. getTextElementStack: function getTextElementStack() {
  6909. return get_text_element_stack_default;
  6910. },
  6911. getViewportSize: function getViewportSize() {
  6912. return get_viewport_size_default;
  6913. },
  6914. hasContent: function hasContent() {
  6915. return has_content_default;
  6916. },
  6917. hasContentVirtual: function hasContentVirtual() {
  6918. return has_content_virtual_default;
  6919. },
  6920. idrefs: function idrefs() {
  6921. return idrefs_default;
  6922. },
  6923. insertedIntoFocusOrder: function insertedIntoFocusOrder() {
  6924. return inserted_into_focus_order_default;
  6925. },
  6926. isFocusable: function isFocusable() {
  6927. return is_focusable_default;
  6928. },
  6929. isHTML5: function isHTML5() {
  6930. return is_html5_default;
  6931. },
  6932. isHiddenWithCSS: function isHiddenWithCSS() {
  6933. return is_hidden_with_css_default;
  6934. },
  6935. isInTextBlock: function isInTextBlock() {
  6936. return is_in_text_block_default;
  6937. },
  6938. isModalOpen: function isModalOpen() {
  6939. return is_modal_open_default;
  6940. },
  6941. isNativelyFocusable: function isNativelyFocusable() {
  6942. return is_natively_focusable_default;
  6943. },
  6944. isNode: function isNode() {
  6945. return is_node_default;
  6946. },
  6947. isOffscreen: function isOffscreen() {
  6948. return is_offscreen_default;
  6949. },
  6950. isOpaque: function isOpaque() {
  6951. return is_opaque_default;
  6952. },
  6953. isSkipLink: function isSkipLink() {
  6954. return is_skip_link_default;
  6955. },
  6956. isVisible: function isVisible() {
  6957. return is_visible_default;
  6958. },
  6959. isVisualContent: function isVisualContent() {
  6960. return is_visual_content_default;
  6961. },
  6962. reduceToElementsBelowFloating: function reduceToElementsBelowFloating() {
  6963. return reduce_to_elements_below_floating_default;
  6964. },
  6965. shadowElementsFromPoint: function shadowElementsFromPoint() {
  6966. return shadow_elements_from_point_default;
  6967. },
  6968. urlPropsFromAttribute: function urlPropsFromAttribute() {
  6969. return url_props_from_attribute_default;
  6970. },
  6971. visuallyContains: function visuallyContains() {
  6972. return visually_contains_default;
  6973. },
  6974. visuallyOverlaps: function visuallyOverlaps() {
  6975. return visually_overlaps_default;
  6976. }
  6977. });
  6978. function getRootNode(node) {
  6979. var doc = node.getRootNode && node.getRootNode() || document;
  6980. if (doc === node) {
  6981. doc = document;
  6982. }
  6983. return doc;
  6984. }
  6985. var get_root_node_default = getRootNode;
  6986. var get_root_node_default2 = get_root_node_default;
  6987. function findElmsInContext(_ref12) {
  6988. var context3 = _ref12.context, value = _ref12.value, attr = _ref12.attr, _ref12$elm = _ref12.elm, elm = _ref12$elm === void 0 ? '' : _ref12$elm;
  6989. var root;
  6990. var escapedValue = escape_selector_default(value);
  6991. if (context3.nodeType === 9 || context3.nodeType === 11) {
  6992. root = context3;
  6993. } else {
  6994. root = get_root_node_default2(context3);
  6995. }
  6996. return Array.from(root.querySelectorAll(elm + '[' + attr + '=' + escapedValue + ']'));
  6997. }
  6998. var find_elms_in_context_default = findElmsInContext;
  6999. function findUpVirtual(element, target) {
  7000. var parent;
  7001. parent = element.actualNode;
  7002. if (!element.shadowId && typeof element.actualNode.closest === 'function') {
  7003. var match = element.actualNode.closest(target);
  7004. if (match) {
  7005. return match;
  7006. }
  7007. return null;
  7008. }
  7009. do {
  7010. parent = parent.assignedSlot ? parent.assignedSlot : parent.parentNode;
  7011. if (parent && parent.nodeType === 11) {
  7012. parent = parent.host;
  7013. }
  7014. } while (parent && !element_matches_default(parent, target) && parent !== document.documentElement);
  7015. if (!parent) {
  7016. return null;
  7017. }
  7018. if (!element_matches_default(parent, target)) {
  7019. return null;
  7020. }
  7021. return parent;
  7022. }
  7023. var find_up_virtual_default = findUpVirtual;
  7024. function findUp(element, target) {
  7025. return find_up_virtual_default(get_node_from_tree_default(element), target);
  7026. }
  7027. var find_up_default = findUp;
  7028. function getComposedParent(element) {
  7029. if (element.assignedSlot) {
  7030. return getComposedParent(element.assignedSlot);
  7031. } else if (element.parentNode) {
  7032. var parentNode = element.parentNode;
  7033. if (parentNode.nodeType === 1) {
  7034. return parentNode;
  7035. } else if (parentNode.host) {
  7036. return parentNode.host;
  7037. }
  7038. }
  7039. return null;
  7040. }
  7041. var get_composed_parent_default = getComposedParent;
  7042. function getElementByReference(node, attr) {
  7043. var fragment = node.getAttribute(attr);
  7044. if (!fragment) {
  7045. return null;
  7046. }
  7047. if (fragment.charAt(0) === '#') {
  7048. fragment = decodeURIComponent(fragment.substring(1));
  7049. } else if (fragment.substr(0, 2) === '/#') {
  7050. fragment = decodeURIComponent(fragment.substring(2));
  7051. }
  7052. var candidate = document.getElementById(fragment);
  7053. if (candidate) {
  7054. return candidate;
  7055. }
  7056. candidate = document.getElementsByName(fragment);
  7057. if (candidate.length) {
  7058. return candidate[0];
  7059. }
  7060. return null;
  7061. }
  7062. var get_element_by_reference_default = getElementByReference;
  7063. function getScrollOffset(element) {
  7064. if (!element.nodeType && element.document) {
  7065. element = element.document;
  7066. }
  7067. if (element.nodeType === 9) {
  7068. var docElement = element.documentElement, body = element.body;
  7069. return {
  7070. left: docElement && docElement.scrollLeft || body && body.scrollLeft || 0,
  7071. top: docElement && docElement.scrollTop || body && body.scrollTop || 0
  7072. };
  7073. }
  7074. return {
  7075. left: element.scrollLeft,
  7076. top: element.scrollTop
  7077. };
  7078. }
  7079. var get_scroll_offset_default = getScrollOffset;
  7080. function getElementCoordinates(element) {
  7081. var scrollOffset = get_scroll_offset_default(document), xOffset = scrollOffset.left, yOffset = scrollOffset.top, coords = element.getBoundingClientRect();
  7082. return {
  7083. top: coords.top + yOffset,
  7084. right: coords.right + xOffset,
  7085. bottom: coords.bottom + yOffset,
  7086. left: coords.left + xOffset,
  7087. width: coords.right - coords.left,
  7088. height: coords.bottom - coords.top
  7089. };
  7090. }
  7091. var get_element_coordinates_default = getElementCoordinates;
  7092. function getViewportSize(win) {
  7093. var doc = win.document;
  7094. var docElement = doc.documentElement;
  7095. if (win.innerWidth) {
  7096. return {
  7097. width: win.innerWidth,
  7098. height: win.innerHeight
  7099. };
  7100. }
  7101. if (docElement) {
  7102. return {
  7103. width: docElement.clientWidth,
  7104. height: docElement.clientHeight
  7105. };
  7106. }
  7107. var body = doc.body;
  7108. return {
  7109. width: body.clientWidth,
  7110. height: body.clientHeight
  7111. };
  7112. }
  7113. var get_viewport_size_default = getViewportSize;
  7114. function noParentScrolled(element, offset) {
  7115. element = get_composed_parent_default(element);
  7116. while (element && element.nodeName.toLowerCase() !== 'html') {
  7117. if (element.scrollTop) {
  7118. offset += element.scrollTop;
  7119. if (offset >= 0) {
  7120. return false;
  7121. }
  7122. }
  7123. element = get_composed_parent_default(element);
  7124. }
  7125. return true;
  7126. }
  7127. function isOffscreen(element) {
  7128. var leftBoundary;
  7129. var docElement = document.documentElement;
  7130. var styl = window.getComputedStyle(element);
  7131. var dir = window.getComputedStyle(document.body || docElement).getPropertyValue('direction');
  7132. var coords = get_element_coordinates_default(element);
  7133. if (coords.bottom < 0 && (noParentScrolled(element, coords.bottom) || styl.position === 'absolute')) {
  7134. return true;
  7135. }
  7136. if (coords.left === 0 && coords.right === 0) {
  7137. return false;
  7138. }
  7139. if (dir === 'ltr') {
  7140. if (coords.right <= 0) {
  7141. return true;
  7142. }
  7143. } else {
  7144. leftBoundary = Math.max(docElement.scrollWidth, get_viewport_size_default(window).width);
  7145. if (coords.left >= leftBoundary) {
  7146. return true;
  7147. }
  7148. }
  7149. return false;
  7150. }
  7151. var is_offscreen_default = isOffscreen;
  7152. var clipRegex = /rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/;
  7153. var clipPathRegex = /(\w+)\((\d+)/;
  7154. function isClipped(style) {
  7155. var matchesClip = style.getPropertyValue('clip').match(clipRegex);
  7156. var matchesClipPath = style.getPropertyValue('clip-path').match(clipPathRegex);
  7157. if (matchesClip && matchesClip.length === 5) {
  7158. return matchesClip[3] - matchesClip[1] <= 0 && matchesClip[2] - matchesClip[4] <= 0;
  7159. }
  7160. if (matchesClipPath) {
  7161. var type = matchesClipPath[1];
  7162. var value = parseInt(matchesClipPath[2], 10);
  7163. switch (type) {
  7164. case 'inset':
  7165. return value >= 50;
  7166. case 'circle':
  7167. return value === 0;
  7168. default:
  7169. }
  7170. }
  7171. return false;
  7172. }
  7173. function isAreaVisible(el, screenReader, recursed) {
  7174. var mapEl = find_up_default(el, 'map');
  7175. if (!mapEl) {
  7176. return false;
  7177. }
  7178. var mapElName = mapEl.getAttribute('name');
  7179. if (!mapElName) {
  7180. return false;
  7181. }
  7182. var mapElRootNode = get_root_node_default2(el);
  7183. if (!mapElRootNode || mapElRootNode.nodeType !== 9) {
  7184. return false;
  7185. }
  7186. var refs = query_selector_all_default(axe._tree, 'img[usemap="#'.concat(escape_selector_default(mapElName), '"]'));
  7187. if (!refs || !refs.length) {
  7188. return false;
  7189. }
  7190. return refs.some(function(_ref13) {
  7191. var actualNode = _ref13.actualNode;
  7192. return isVisible(actualNode, screenReader, recursed);
  7193. });
  7194. }
  7195. function isVisible(el, screenReader, recursed) {
  7196. if (!el) {
  7197. throw new TypeError('Cannot determine if element is visible for non-DOM nodes');
  7198. }
  7199. var vNode = get_node_from_tree_default(el);
  7200. var cacheName = '_isVisible' + (screenReader ? 'ScreenReader' : '');
  7201. if (el.nodeType === 9) {
  7202. return true;
  7203. }
  7204. if (el.nodeType === 11) {
  7205. el = el.host;
  7206. }
  7207. if (vNode && typeof vNode[cacheName] !== 'undefined') {
  7208. return vNode[cacheName];
  7209. }
  7210. var style = window.getComputedStyle(el, null);
  7211. if (style === null) {
  7212. return false;
  7213. }
  7214. var nodeName2 = el.nodeName.toUpperCase();
  7215. if (nodeName2 === 'AREA') {
  7216. return isAreaVisible(el, screenReader, recursed);
  7217. }
  7218. if (style.getPropertyValue('display') === 'none' || [ 'STYLE', 'SCRIPT', 'NOSCRIPT', 'TEMPLATE' ].includes(nodeName2)) {
  7219. return false;
  7220. }
  7221. if (screenReader && el.getAttribute('aria-hidden') === 'true') {
  7222. return false;
  7223. }
  7224. if (!screenReader && (isClipped(style) || style.getPropertyValue('opacity') === '0' || get_scroll_default(el) && parseInt(style.getPropertyValue('height')) === 0)) {
  7225. return false;
  7226. }
  7227. if (!recursed && (style.getPropertyValue('visibility') === 'hidden' || !screenReader && is_offscreen_default(el))) {
  7228. return false;
  7229. }
  7230. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  7231. var visible4 = false;
  7232. if (parent) {
  7233. visible4 = isVisible(parent, screenReader, true);
  7234. }
  7235. if (vNode) {
  7236. vNode[cacheName] = visible4;
  7237. }
  7238. return visible4;
  7239. }
  7240. var is_visible_default = isVisible;
  7241. var gridSize = 200;
  7242. function isStackingContext(vNode, parentVNode) {
  7243. var position = vNode.getComputedStylePropertyValue('position');
  7244. var zIndex = vNode.getComputedStylePropertyValue('z-index');
  7245. if (position === 'fixed' || position === 'sticky') {
  7246. return true;
  7247. }
  7248. if (zIndex !== 'auto' && position !== 'static') {
  7249. return true;
  7250. }
  7251. if (vNode.getComputedStylePropertyValue('opacity') !== '1') {
  7252. return true;
  7253. }
  7254. var transform = vNode.getComputedStylePropertyValue('-webkit-transform') || vNode.getComputedStylePropertyValue('-ms-transform') || vNode.getComputedStylePropertyValue('transform') || 'none';
  7255. if (transform !== 'none') {
  7256. return true;
  7257. }
  7258. var mixBlendMode = vNode.getComputedStylePropertyValue('mix-blend-mode');
  7259. if (mixBlendMode && mixBlendMode !== 'normal') {
  7260. return true;
  7261. }
  7262. var filter = vNode.getComputedStylePropertyValue('filter');
  7263. if (filter && filter !== 'none') {
  7264. return true;
  7265. }
  7266. var perspective = vNode.getComputedStylePropertyValue('perspective');
  7267. if (perspective && perspective !== 'none') {
  7268. return true;
  7269. }
  7270. var clipPath = vNode.getComputedStylePropertyValue('clip-path');
  7271. if (clipPath && clipPath !== 'none') {
  7272. return true;
  7273. }
  7274. var mask = vNode.getComputedStylePropertyValue('-webkit-mask') || vNode.getComputedStylePropertyValue('mask') || 'none';
  7275. if (mask !== 'none') {
  7276. return true;
  7277. }
  7278. var maskImage = vNode.getComputedStylePropertyValue('-webkit-mask-image') || vNode.getComputedStylePropertyValue('mask-image') || 'none';
  7279. if (maskImage !== 'none') {
  7280. return true;
  7281. }
  7282. var maskBorder = vNode.getComputedStylePropertyValue('-webkit-mask-border') || vNode.getComputedStylePropertyValue('mask-border') || 'none';
  7283. if (maskBorder !== 'none') {
  7284. return true;
  7285. }
  7286. if (vNode.getComputedStylePropertyValue('isolation') === 'isolate') {
  7287. return true;
  7288. }
  7289. var willChange = vNode.getComputedStylePropertyValue('will-change');
  7290. if (willChange === 'transform' || willChange === 'opacity') {
  7291. return true;
  7292. }
  7293. if (vNode.getComputedStylePropertyValue('-webkit-overflow-scrolling') === 'touch') {
  7294. return true;
  7295. }
  7296. var contain = vNode.getComputedStylePropertyValue('contain');
  7297. if ([ 'layout', 'paint', 'strict', 'content' ].includes(contain)) {
  7298. return true;
  7299. }
  7300. if (zIndex !== 'auto' && parentVNode) {
  7301. var parentDsiplay = parentVNode.getComputedStylePropertyValue('display');
  7302. if ([ 'flex', 'inline-flex', 'inline flex', 'grid', 'inline-grid', 'inline grid' ].includes(parentDsiplay)) {
  7303. return true;
  7304. }
  7305. }
  7306. return false;
  7307. }
  7308. function isFloated(vNode) {
  7309. if (!vNode) {
  7310. return false;
  7311. }
  7312. if (vNode._isFloated !== void 0) {
  7313. return vNode._isFloated;
  7314. }
  7315. var floatStyle = vNode.getComputedStylePropertyValue('float');
  7316. if (floatStyle !== 'none') {
  7317. vNode._isFloated = true;
  7318. return true;
  7319. }
  7320. var floated = isFloated(vNode.parent);
  7321. vNode._isFloated = floated;
  7322. return floated;
  7323. }
  7324. function getPositionOrder(vNode) {
  7325. if (vNode.getComputedStylePropertyValue('position') === 'static') {
  7326. if (vNode.getComputedStylePropertyValue('display').indexOf('inline') !== -1) {
  7327. return 2;
  7328. }
  7329. if (isFloated(vNode)) {
  7330. return 1;
  7331. }
  7332. return 0;
  7333. }
  7334. return 3;
  7335. }
  7336. function visuallySort(a, b) {
  7337. for (var _i4 = 0; _i4 < a._stackingOrder.length; _i4++) {
  7338. if (typeof b._stackingOrder[_i4] === 'undefined') {
  7339. return -1;
  7340. }
  7341. if (b._stackingOrder[_i4] > a._stackingOrder[_i4]) {
  7342. return 1;
  7343. }
  7344. if (b._stackingOrder[_i4] < a._stackingOrder[_i4]) {
  7345. return -1;
  7346. }
  7347. }
  7348. var aNode = a.actualNode;
  7349. var bNode = b.actualNode;
  7350. if (aNode.getRootNode && aNode.getRootNode() !== bNode.getRootNode()) {
  7351. var boundaries = [];
  7352. while (aNode) {
  7353. boundaries.push({
  7354. root: aNode.getRootNode(),
  7355. node: aNode
  7356. });
  7357. aNode = aNode.getRootNode().host;
  7358. }
  7359. while (bNode && !boundaries.find(function(boundary) {
  7360. return boundary.root === bNode.getRootNode();
  7361. })) {
  7362. bNode = bNode.getRootNode().host;
  7363. }
  7364. aNode = boundaries.find(function(boundary) {
  7365. return boundary.root === bNode.getRootNode();
  7366. }).node;
  7367. if (aNode === bNode) {
  7368. return a.actualNode.getRootNode() !== aNode.getRootNode() ? -1 : 1;
  7369. }
  7370. }
  7371. var _window$Node = window.Node, DOCUMENT_POSITION_FOLLOWING = _window$Node.DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_CONTAINS = _window$Node.DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_CONTAINED_BY = _window$Node.DOCUMENT_POSITION_CONTAINED_BY;
  7372. var docPosition = aNode.compareDocumentPosition(bNode);
  7373. var DOMOrder = docPosition & DOCUMENT_POSITION_FOLLOWING ? 1 : -1;
  7374. var isDescendant = docPosition & DOCUMENT_POSITION_CONTAINS || docPosition & DOCUMENT_POSITION_CONTAINED_BY;
  7375. var aPosition = getPositionOrder(a);
  7376. var bPosition = getPositionOrder(b);
  7377. if (aPosition === bPosition || isDescendant) {
  7378. return DOMOrder;
  7379. }
  7380. return bPosition - aPosition;
  7381. }
  7382. function getStackingOrder(vNode, parentVNode) {
  7383. var stackingOrder = parentVNode._stackingOrder.slice();
  7384. var zIndex = vNode.getComputedStylePropertyValue('z-index');
  7385. if (zIndex !== 'auto') {
  7386. stackingOrder[stackingOrder.length - 1] = parseInt(zIndex);
  7387. }
  7388. if (isStackingContext(vNode, parentVNode)) {
  7389. stackingOrder.push(0);
  7390. }
  7391. return stackingOrder;
  7392. }
  7393. function findScrollRegionParent(vNode, parentVNode) {
  7394. var scrollRegionParent = null;
  7395. var checkedNodes = [ vNode ];
  7396. while (parentVNode) {
  7397. if (parentVNode._scrollRegionParent) {
  7398. scrollRegionParent = parentVNode._scrollRegionParent;
  7399. break;
  7400. }
  7401. if (get_scroll_default(parentVNode.actualNode)) {
  7402. scrollRegionParent = parentVNode;
  7403. break;
  7404. }
  7405. checkedNodes.push(parentVNode);
  7406. parentVNode = get_node_from_tree_default(parentVNode.actualNode.parentElement || parentVNode.actualNode.parentNode);
  7407. }
  7408. checkedNodes.forEach(function(vNode2) {
  7409. return vNode2._scrollRegionParent = scrollRegionParent;
  7410. });
  7411. return scrollRegionParent;
  7412. }
  7413. function addNodeToGrid(grid, vNode) {
  7414. vNode._grid = grid;
  7415. vNode.clientRects.forEach(function(rect) {
  7416. var x = rect.left;
  7417. var y = rect.top;
  7418. var startRow = y / gridSize | 0;
  7419. var startCol = x / gridSize | 0;
  7420. var endRow = (y + rect.height) / gridSize | 0;
  7421. var endCol = (x + rect.width) / gridSize | 0;
  7422. for (var row = startRow; row <= endRow; row++) {
  7423. grid.cells[row] = grid.cells[row] || [];
  7424. for (var col = startCol; col <= endCol; col++) {
  7425. grid.cells[row][col] = grid.cells[row][col] || [];
  7426. if (!grid.cells[row][col].includes(vNode)) {
  7427. grid.cells[row][col].push(vNode);
  7428. }
  7429. }
  7430. }
  7431. });
  7432. }
  7433. function createGrid() {
  7434. var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.body;
  7435. var rootGrid = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
  7436. container: null,
  7437. cells: []
  7438. };
  7439. var parentVNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  7440. if (!parentVNode) {
  7441. var vNode = get_node_from_tree_default(document.documentElement);
  7442. if (!vNode) {
  7443. vNode = new virtual_node_default(document.documentElement);
  7444. }
  7445. vNode._stackingOrder = [ 0 ];
  7446. addNodeToGrid(rootGrid, vNode);
  7447. if (get_scroll_default(vNode.actualNode)) {
  7448. var subGrid = {
  7449. container: vNode,
  7450. cells: []
  7451. };
  7452. vNode._subGrid = subGrid;
  7453. }
  7454. }
  7455. var treeWalker = document.createTreeWalker(root, window.NodeFilter.SHOW_ELEMENT, null, false);
  7456. var node = parentVNode ? treeWalker.nextNode() : treeWalker.currentNode;
  7457. while (node) {
  7458. var _vNode = get_node_from_tree_default(node);
  7459. if (node.parentElement) {
  7460. parentVNode = get_node_from_tree_default(node.parentElement);
  7461. } else if (node.parentNode && get_node_from_tree_default(node.parentNode)) {
  7462. parentVNode = get_node_from_tree_default(node.parentNode);
  7463. }
  7464. if (!_vNode) {
  7465. _vNode = new axe.VirtualNode(node, parentVNode);
  7466. }
  7467. _vNode._stackingOrder = getStackingOrder(_vNode, parentVNode);
  7468. var scrollRegionParent = findScrollRegionParent(_vNode, parentVNode);
  7469. var grid = scrollRegionParent ? scrollRegionParent._subGrid : rootGrid;
  7470. if (get_scroll_default(_vNode.actualNode)) {
  7471. var _subGrid = {
  7472. container: _vNode,
  7473. cells: []
  7474. };
  7475. _vNode._subGrid = _subGrid;
  7476. }
  7477. var rect = _vNode.boundingClientRect;
  7478. if (rect.width !== 0 && rect.height !== 0 && is_visible_default(node)) {
  7479. addNodeToGrid(grid, _vNode);
  7480. }
  7481. if (is_shadow_root_default(node)) {
  7482. createGrid(node.shadowRoot, grid, _vNode);
  7483. }
  7484. node = treeWalker.nextNode();
  7485. }
  7486. }
  7487. function getRectStack(grid, rect) {
  7488. var recursed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  7489. var x = rect.left + rect.width / 2;
  7490. var y = rect.top + rect.height / 2;
  7491. var row = y / gridSize | 0;
  7492. var col = x / gridSize | 0;
  7493. var stack = grid.cells[row][col].filter(function(gridCellNode) {
  7494. return gridCellNode.clientRects.find(function(clientRect) {
  7495. var rectX = clientRect.left;
  7496. var rectY = clientRect.top;
  7497. return x <= rectX + clientRect.width && x >= rectX && y <= rectY + clientRect.height && y >= rectY;
  7498. });
  7499. });
  7500. var gridContainer = grid.container;
  7501. if (gridContainer) {
  7502. stack = getRectStack(gridContainer._grid, gridContainer.boundingClientRect, true).concat(stack);
  7503. }
  7504. if (!recursed) {
  7505. stack = stack.sort(visuallySort).map(function(vNode) {
  7506. return vNode.actualNode;
  7507. }).concat(document.documentElement).filter(function(node, index, array) {
  7508. return array.indexOf(node) === index;
  7509. });
  7510. }
  7511. return stack;
  7512. }
  7513. var _cache = {};
  7514. var cache = {
  7515. set: function set(key, value) {
  7516. _cache[key] = value;
  7517. },
  7518. get: function get(key) {
  7519. return _cache[key];
  7520. },
  7521. clear: function clear() {
  7522. _cache = {};
  7523. }
  7524. };
  7525. var cache_default = cache;
  7526. function getElementStack(node) {
  7527. if (!cache_default.get('gridCreated')) {
  7528. createGrid();
  7529. cache_default.set('gridCreated', true);
  7530. }
  7531. var vNode = get_node_from_tree_default(node);
  7532. var grid = vNode._grid;
  7533. if (!grid) {
  7534. return [];
  7535. }
  7536. return getRectStack(grid, vNode.boundingClientRect);
  7537. }
  7538. var get_element_stack_default = getElementStack;
  7539. function getTabbableElements(virtualNode) {
  7540. var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
  7541. var tabbableElements = nodeAndDescendents.filter(function(vNode) {
  7542. var isFocusable2 = vNode.isFocusable;
  7543. var tabIndex = vNode.actualNode.getAttribute('tabindex');
  7544. tabIndex = tabIndex && !isNaN(parseInt(tabIndex, 10)) ? parseInt(tabIndex) : null;
  7545. return tabIndex ? isFocusable2 && tabIndex >= 0 : isFocusable2;
  7546. });
  7547. return tabbableElements;
  7548. }
  7549. var get_tabbable_elements_default = getTabbableElements;
  7550. function sanitize(str) {
  7551. if (!str) {
  7552. return '';
  7553. }
  7554. return str.replace(/\r\n/g, '\n').replace(/\u00A0/g, ' ').replace(/[\s]{2,}/g, ' ').trim();
  7555. }
  7556. var sanitize_default = sanitize;
  7557. function getTextElementStack(node) {
  7558. if (!cache_default.get('gridCreated')) {
  7559. createGrid();
  7560. cache_default.set('gridCreated', true);
  7561. }
  7562. var vNode = get_node_from_tree_default(node);
  7563. var grid = vNode._grid;
  7564. if (!grid) {
  7565. return [];
  7566. }
  7567. var nodeRect = vNode.boundingClientRect;
  7568. var clientRects = [];
  7569. Array.from(node.childNodes).forEach(function(elm) {
  7570. if (elm.nodeType === 3 && sanitize_default(elm.textContent) !== '') {
  7571. var range = document.createRange();
  7572. range.selectNodeContents(elm);
  7573. var rects = range.getClientRects();
  7574. if (Array.from(rects).some(function(rect) {
  7575. return rect.width > nodeRect.width;
  7576. })) {
  7577. return;
  7578. }
  7579. for (var _i5 = 0; _i5 < rects.length; _i5++) {
  7580. var rect = rects[_i5];
  7581. if (rect.width >= 1 && rect.height >= 1) {
  7582. clientRects.push(rect);
  7583. }
  7584. }
  7585. }
  7586. });
  7587. if (!clientRects.length) {
  7588. return [ get_element_stack_default(node) ];
  7589. }
  7590. return clientRects.map(function(rect) {
  7591. return getRectStack(grid, rect);
  7592. });
  7593. }
  7594. var get_text_element_stack_default = getTextElementStack;
  7595. var visualRoles = [ 'checkbox', 'img', 'radio', 'range', 'slider', 'spinbutton', 'textbox' ];
  7596. function isVisualContent(element) {
  7597. var role = element.getAttribute('role');
  7598. if (role) {
  7599. return visualRoles.indexOf(role) !== -1;
  7600. }
  7601. switch (element.nodeName.toUpperCase()) {
  7602. case 'IMG':
  7603. case 'IFRAME':
  7604. case 'OBJECT':
  7605. case 'VIDEO':
  7606. case 'AUDIO':
  7607. case 'CANVAS':
  7608. case 'SVG':
  7609. case 'MATH':
  7610. case 'BUTTON':
  7611. case 'SELECT':
  7612. case 'TEXTAREA':
  7613. case 'KEYGEN':
  7614. case 'PROGRESS':
  7615. case 'METER':
  7616. return true;
  7617. case 'INPUT':
  7618. return element.type !== 'hidden';
  7619. default:
  7620. return false;
  7621. }
  7622. }
  7623. var is_visual_content_default = isVisualContent;
  7624. function idrefs(node, attr) {
  7625. node = node.actualNode || node;
  7626. try {
  7627. var doc = get_root_node_default2(node);
  7628. var result = [];
  7629. var attrValue = node.getAttribute(attr);
  7630. if (attrValue) {
  7631. attrValue = token_list_default(attrValue);
  7632. for (var index = 0; index < attrValue.length; index++) {
  7633. result.push(doc.getElementById(attrValue[index]));
  7634. }
  7635. }
  7636. return result;
  7637. } catch (e) {
  7638. throw new TypeError('Cannot resolve id references for non-DOM nodes');
  7639. }
  7640. }
  7641. var idrefs_default = idrefs;
  7642. function visibleVirtual(element, screenReader, noRecursing) {
  7643. var vNode = element instanceof abstract_virtual_node_default ? element : get_node_from_tree_default(element);
  7644. var visible4 = !element.actualNode || element.actualNode && is_visible_default(element.actualNode, screenReader);
  7645. var result = vNode.children.map(function(child) {
  7646. var _child$props = child.props, nodeType = _child$props.nodeType, nodeValue = _child$props.nodeValue;
  7647. if (nodeType === 3) {
  7648. if (nodeValue && visible4) {
  7649. return nodeValue;
  7650. }
  7651. } else if (!noRecursing) {
  7652. return visibleVirtual(child, screenReader);
  7653. }
  7654. }).join('');
  7655. return sanitize_default(result);
  7656. }
  7657. var visible_virtual_default = visibleVirtual;
  7658. function labelVirtual(virtualNode) {
  7659. var ref, candidate;
  7660. if (virtualNode.attr('aria-labelledby')) {
  7661. ref = idrefs_default(virtualNode.actualNode, 'aria-labelledby');
  7662. candidate = ref.map(function(thing) {
  7663. var vNode = get_node_from_tree_default(thing);
  7664. return vNode ? visible_virtual_default(vNode, true) : '';
  7665. }).join(' ').trim();
  7666. if (candidate) {
  7667. return candidate;
  7668. }
  7669. }
  7670. candidate = virtualNode.attr('aria-label');
  7671. if (candidate) {
  7672. candidate = sanitize_default(candidate);
  7673. if (candidate) {
  7674. return candidate;
  7675. }
  7676. }
  7677. return null;
  7678. }
  7679. var label_virtual_default = labelVirtual;
  7680. var hiddenTextElms = [ 'HEAD', 'TITLE', 'TEMPLATE', 'SCRIPT', 'STYLE', 'IFRAME', 'OBJECT', 'VIDEO', 'AUDIO', 'NOSCRIPT' ];
  7681. function hasChildTextNodes(elm) {
  7682. if (!hiddenTextElms.includes(elm.actualNode.nodeName.toUpperCase())) {
  7683. return elm.children.some(function(_ref14) {
  7684. var actualNode = _ref14.actualNode;
  7685. return actualNode.nodeType === 3 && actualNode.nodeValue.trim();
  7686. });
  7687. }
  7688. }
  7689. function hasContentVirtual(elm, noRecursion, ignoreAria) {
  7690. return hasChildTextNodes(elm) || is_visual_content_default(elm.actualNode) || !ignoreAria && !!label_virtual_default(elm) || !noRecursion && elm.children.some(function(child) {
  7691. return child.actualNode.nodeType === 1 && hasContentVirtual(child);
  7692. });
  7693. }
  7694. var has_content_virtual_default = hasContentVirtual;
  7695. function hasContent(elm, noRecursion, ignoreAria) {
  7696. elm = get_node_from_tree_default(elm);
  7697. return has_content_virtual_default(elm, noRecursion, ignoreAria);
  7698. }
  7699. var has_content_default = hasContent;
  7700. function isHiddenWithCSS(el, descendentVisibilityValue) {
  7701. var vNode = get_node_from_tree_default(el);
  7702. if (!vNode) {
  7703. return _isHiddenWithCSS(el, descendentVisibilityValue);
  7704. }
  7705. if (vNode._isHiddenWithCSS === void 0) {
  7706. vNode._isHiddenWithCSS = _isHiddenWithCSS(el, descendentVisibilityValue);
  7707. }
  7708. return vNode._isHiddenWithCSS;
  7709. }
  7710. function _isHiddenWithCSS(el, descendentVisibilityValue) {
  7711. if (el.nodeType === 9) {
  7712. return false;
  7713. }
  7714. if (el.nodeType === 11) {
  7715. el = el.host;
  7716. }
  7717. if ([ 'STYLE', 'SCRIPT' ].includes(el.nodeName.toUpperCase())) {
  7718. return false;
  7719. }
  7720. var style = window.getComputedStyle(el, null);
  7721. if (!style) {
  7722. throw new Error('Style does not exist for the given element.');
  7723. }
  7724. var displayValue = style.getPropertyValue('display');
  7725. if (displayValue === 'none') {
  7726. return true;
  7727. }
  7728. var HIDDEN_VISIBILITY_VALUES = [ 'hidden', 'collapse' ];
  7729. var visibilityValue = style.getPropertyValue('visibility');
  7730. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && !descendentVisibilityValue) {
  7731. return true;
  7732. }
  7733. if (HIDDEN_VISIBILITY_VALUES.includes(visibilityValue) && descendentVisibilityValue && HIDDEN_VISIBILITY_VALUES.includes(descendentVisibilityValue)) {
  7734. return true;
  7735. }
  7736. var parent = get_composed_parent_default(el);
  7737. if (parent && !HIDDEN_VISIBILITY_VALUES.includes(visibilityValue)) {
  7738. return isHiddenWithCSS(parent, visibilityValue);
  7739. }
  7740. return false;
  7741. }
  7742. var is_hidden_with_css_default = isHiddenWithCSS;
  7743. function focusDisabled(el) {
  7744. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  7745. if (vNode.hasAttr('disabled')) {
  7746. return true;
  7747. }
  7748. if (vNode.props.nodeName !== 'area') {
  7749. if (!vNode.actualNode) {
  7750. return false;
  7751. }
  7752. return is_hidden_with_css_default(vNode.actualNode);
  7753. }
  7754. return false;
  7755. }
  7756. var focus_disabled_default = focusDisabled;
  7757. function isNativelyFocusable(el) {
  7758. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  7759. if (!vNode || focus_disabled_default(vNode)) {
  7760. return false;
  7761. }
  7762. switch (vNode.props.nodeName) {
  7763. case 'a':
  7764. case 'area':
  7765. if (vNode.hasAttr('href')) {
  7766. return true;
  7767. }
  7768. break;
  7769. case 'input':
  7770. return vNode.props.type !== 'hidden';
  7771. case 'textarea':
  7772. case 'select':
  7773. case 'summary':
  7774. case 'button':
  7775. return true;
  7776. case 'details':
  7777. return !query_selector_all_default(vNode, 'summary').length;
  7778. }
  7779. return false;
  7780. }
  7781. var is_natively_focusable_default = isNativelyFocusable;
  7782. function isFocusable(el) {
  7783. var vNode = el instanceof abstract_virtual_node_default ? el : get_node_from_tree_default(el);
  7784. if (focus_disabled_default(vNode)) {
  7785. return false;
  7786. } else if (is_natively_focusable_default(vNode)) {
  7787. return true;
  7788. }
  7789. var tabindex = vNode.attr('tabindex');
  7790. if (tabindex && !isNaN(parseInt(tabindex, 10))) {
  7791. return true;
  7792. }
  7793. return false;
  7794. }
  7795. var is_focusable_default = isFocusable;
  7796. function insertedIntoFocusOrder(el) {
  7797. var tabIndex = parseInt(el.getAttribute('tabindex'), 10);
  7798. return tabIndex > -1 && is_focusable_default(el) && !is_natively_focusable_default(el);
  7799. }
  7800. var inserted_into_focus_order_default = insertedIntoFocusOrder;
  7801. function isHTML5(doc) {
  7802. var node = doc.doctype;
  7803. if (node === null) {
  7804. return false;
  7805. }
  7806. return node.name === 'html' && !node.publicId && !node.systemId;
  7807. }
  7808. var is_html5_default = isHTML5;
  7809. function walkDomNode(node, functor) {
  7810. if (functor(node.actualNode) !== false) {
  7811. node.children.forEach(function(child) {
  7812. return walkDomNode(child, functor);
  7813. });
  7814. }
  7815. }
  7816. var blockLike = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  7817. function isBlock(elm) {
  7818. var display = window.getComputedStyle(elm).getPropertyValue('display');
  7819. return blockLike.includes(display) || display.substr(0, 6) === 'table-';
  7820. }
  7821. function getBlockParent(node) {
  7822. var parentBlock = get_composed_parent_default(node);
  7823. while (parentBlock && !isBlock(parentBlock)) {
  7824. parentBlock = get_composed_parent_default(parentBlock);
  7825. }
  7826. return get_node_from_tree_default(parentBlock);
  7827. }
  7828. function isInTextBlock(node) {
  7829. if (isBlock(node)) {
  7830. return false;
  7831. }
  7832. var virtualParent = getBlockParent(node);
  7833. var parentText = '';
  7834. var linkText = '';
  7835. var inBrBlock = 0;
  7836. walkDomNode(virtualParent, function(currNode) {
  7837. if (inBrBlock === 2) {
  7838. return false;
  7839. }
  7840. if (currNode.nodeType === 3) {
  7841. parentText += currNode.nodeValue;
  7842. }
  7843. if (currNode.nodeType !== 1) {
  7844. return;
  7845. }
  7846. var nodeName2 = (currNode.nodeName || '').toUpperCase();
  7847. if ([ 'BR', 'HR' ].includes(nodeName2)) {
  7848. if (inBrBlock === 0) {
  7849. parentText = '';
  7850. linkText = '';
  7851. } else {
  7852. inBrBlock = 2;
  7853. }
  7854. } else if (currNode.style.display === 'none' || currNode.style.overflow === 'hidden' || ![ '', null, 'none' ].includes(currNode.style['float']) || ![ '', null, 'relative' ].includes(currNode.style.position)) {
  7855. return false;
  7856. } else if (nodeName2 === 'A' && currNode.href || (currNode.getAttribute('role') || '').toLowerCase() === 'link') {
  7857. if (currNode === node) {
  7858. inBrBlock = 1;
  7859. }
  7860. linkText += currNode.textContent;
  7861. return false;
  7862. }
  7863. });
  7864. parentText = sanitize_default(parentText);
  7865. linkText = sanitize_default(linkText);
  7866. return parentText.length > linkText.length;
  7867. }
  7868. var is_in_text_block_default = isInTextBlock;
  7869. function isModalOpen(options) {
  7870. options = options || {};
  7871. var modalPercent = options.modalPercent || .75;
  7872. if (cache_default.get('isModalOpen')) {
  7873. return cache_default.get('isModalOpen');
  7874. }
  7875. var definiteModals = query_selector_all_filter_default(axe._tree[0], 'dialog, [role=dialog], [aria-modal=true]', function(vNode) {
  7876. return is_visible_default(vNode.actualNode);
  7877. });
  7878. if (definiteModals.length) {
  7879. cache_default.set('isModalOpen', true);
  7880. return true;
  7881. }
  7882. var viewport = get_viewport_size_default(window);
  7883. var percentWidth = viewport.width * modalPercent;
  7884. var percentHeight = viewport.height * modalPercent;
  7885. var x = (viewport.width - percentWidth) / 2;
  7886. var y = (viewport.height - percentHeight) / 2;
  7887. var points = [ {
  7888. x: x,
  7889. y: y
  7890. }, {
  7891. x: viewport.width - x,
  7892. y: y
  7893. }, {
  7894. x: viewport.width / 2,
  7895. y: viewport.height / 2
  7896. }, {
  7897. x: x,
  7898. y: viewport.height - y
  7899. }, {
  7900. x: viewport.width - x,
  7901. y: viewport.height - y
  7902. } ];
  7903. var stacks = points.map(function(point) {
  7904. return Array.from(document.elementsFromPoint(point.x, point.y));
  7905. });
  7906. var _loop3 = function _loop3(_i6) {
  7907. var modalElement = stacks[_i6].find(function(elm) {
  7908. var style = window.getComputedStyle(elm);
  7909. return parseInt(style.width, 10) >= percentWidth && parseInt(style.height, 10) >= percentHeight && style.getPropertyValue('pointer-events') !== 'none' && (style.position === 'absolute' || style.position === 'fixed');
  7910. });
  7911. if (modalElement && stacks.every(function(stack) {
  7912. return stack.includes(modalElement);
  7913. })) {
  7914. cache_default.set('isModalOpen', true);
  7915. return {
  7916. v: true
  7917. };
  7918. }
  7919. };
  7920. for (var _i6 = 0; _i6 < stacks.length; _i6++) {
  7921. var _ret = _loop3(_i6);
  7922. if (_typeof(_ret) === 'object') {
  7923. return _ret.v;
  7924. }
  7925. }
  7926. cache_default.set('isModalOpen', void 0);
  7927. return void 0;
  7928. }
  7929. var is_modal_open_default = isModalOpen;
  7930. function isNode(element) {
  7931. return element instanceof window.Node;
  7932. }
  7933. var is_node_default = isNode;
  7934. var data = {};
  7935. var incompleteData = {
  7936. set: function set(key, reason) {
  7937. if (typeof key !== 'string') {
  7938. throw new Error('Incomplete data: key must be a string');
  7939. }
  7940. if (reason) {
  7941. data[key] = reason;
  7942. }
  7943. return data[key];
  7944. },
  7945. get: function get(key) {
  7946. return data[key];
  7947. },
  7948. clear: function clear() {
  7949. data = {};
  7950. }
  7951. };
  7952. var incomplete_data_default = incompleteData;
  7953. function elementHasImage(elm, style) {
  7954. var graphicNodes = [ 'IMG', 'CANVAS', 'OBJECT', 'IFRAME', 'VIDEO', 'SVG' ];
  7955. var nodeName2 = elm.nodeName.toUpperCase();
  7956. if (graphicNodes.includes(nodeName2)) {
  7957. incomplete_data_default.set('bgColor', 'imgNode');
  7958. return true;
  7959. }
  7960. style = style || window.getComputedStyle(elm);
  7961. var bgImageStyle = style.getPropertyValue('background-image');
  7962. var hasBgImage = bgImageStyle !== 'none';
  7963. if (hasBgImage) {
  7964. var hasGradient = /gradient/.test(bgImageStyle);
  7965. incomplete_data_default.set('bgColor', hasGradient ? 'bgGradient' : 'bgImage');
  7966. }
  7967. return hasBgImage;
  7968. }
  7969. var element_has_image_default = elementHasImage;
  7970. var ariaAttrs = {
  7971. 'aria-activedescendant': {
  7972. type: 'idref',
  7973. allowEmpty: true
  7974. },
  7975. 'aria-atomic': {
  7976. type: 'boolean',
  7977. global: true
  7978. },
  7979. 'aria-autocomplete': {
  7980. type: 'nmtoken',
  7981. values: [ 'inline', 'list', 'both', 'none' ]
  7982. },
  7983. 'aria-busy': {
  7984. type: 'boolean',
  7985. global: true
  7986. },
  7987. 'aria-checked': {
  7988. type: 'nmtoken',
  7989. values: [ 'false', 'mixed', 'true', 'undefined' ]
  7990. },
  7991. 'aria-colcount': {
  7992. type: 'int'
  7993. },
  7994. 'aria-colindex': {
  7995. type: 'int'
  7996. },
  7997. 'aria-colspan': {
  7998. type: 'int'
  7999. },
  8000. 'aria-controls': {
  8001. type: 'idrefs',
  8002. allowEmpty: true,
  8003. global: true
  8004. },
  8005. 'aria-current': {
  8006. type: 'nmtoken',
  8007. allowEmpty: true,
  8008. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  8009. global: true
  8010. },
  8011. 'aria-describedby': {
  8012. type: 'idrefs',
  8013. allowEmpty: true,
  8014. global: true
  8015. },
  8016. 'aria-details': {
  8017. type: 'idref',
  8018. allowEmpty: true,
  8019. global: true
  8020. },
  8021. 'aria-disabled': {
  8022. type: 'boolean',
  8023. global: true
  8024. },
  8025. 'aria-dropeffect': {
  8026. type: 'nmtokens',
  8027. values: [ 'copy', 'execute', 'link', 'move', 'none', 'popup' ],
  8028. global: true
  8029. },
  8030. 'aria-errormessage': {
  8031. type: 'idref',
  8032. allowEmpty: true,
  8033. global: true
  8034. },
  8035. 'aria-expanded': {
  8036. type: 'nmtoken',
  8037. values: [ 'true', 'false', 'undefined' ]
  8038. },
  8039. 'aria-flowto': {
  8040. type: 'idrefs',
  8041. allowEmpty: true,
  8042. global: true
  8043. },
  8044. 'aria-grabbed': {
  8045. type: 'nmtoken',
  8046. values: [ 'true', 'false', 'undefined' ],
  8047. global: true
  8048. },
  8049. 'aria-haspopup': {
  8050. type: 'nmtoken',
  8051. allowEmpty: true,
  8052. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  8053. global: true
  8054. },
  8055. 'aria-hidden': {
  8056. type: 'nmtoken',
  8057. values: [ 'true', 'false', 'undefined' ],
  8058. global: true
  8059. },
  8060. 'aria-invalid': {
  8061. type: 'nmtoken',
  8062. allowEmpty: true,
  8063. values: [ 'grammar', 'false', 'spelling', 'true' ],
  8064. global: true
  8065. },
  8066. 'aria-keyshortcuts': {
  8067. type: 'string',
  8068. allowEmpty: true,
  8069. global: true
  8070. },
  8071. 'aria-label': {
  8072. type: 'string',
  8073. allowEmpty: true,
  8074. global: true
  8075. },
  8076. 'aria-labelledby': {
  8077. type: 'idrefs',
  8078. allowEmpty: true,
  8079. global: true
  8080. },
  8081. 'aria-level': {
  8082. type: 'int'
  8083. },
  8084. 'aria-live': {
  8085. type: 'nmtoken',
  8086. values: [ 'assertive', 'off', 'polite' ],
  8087. global: true
  8088. },
  8089. 'aria-modal': {
  8090. type: 'boolean'
  8091. },
  8092. 'aria-multiline': {
  8093. type: 'boolean'
  8094. },
  8095. 'aria-multiselectable': {
  8096. type: 'boolean'
  8097. },
  8098. 'aria-orientation': {
  8099. type: 'nmtoken',
  8100. values: [ 'horizontal', 'undefined', 'vertical' ]
  8101. },
  8102. 'aria-owns': {
  8103. type: 'idrefs',
  8104. allowEmpty: true,
  8105. global: true
  8106. },
  8107. 'aria-placeholder': {
  8108. type: 'string',
  8109. allowEmpty: true
  8110. },
  8111. 'aria-posinset': {
  8112. type: 'int'
  8113. },
  8114. 'aria-pressed': {
  8115. type: 'nmtoken',
  8116. values: [ 'false', 'mixed', 'true', 'undefined' ]
  8117. },
  8118. 'aria-readonly': {
  8119. type: 'boolean'
  8120. },
  8121. 'aria-relevant': {
  8122. type: 'nmtokens',
  8123. values: [ 'additions', 'all', 'removals', 'text' ],
  8124. global: true
  8125. },
  8126. 'aria-required': {
  8127. type: 'boolean'
  8128. },
  8129. 'aria-roledescription': {
  8130. type: 'string',
  8131. allowEmpty: true,
  8132. global: true
  8133. },
  8134. 'aria-rowcount': {
  8135. type: 'int'
  8136. },
  8137. 'aria-rowindex': {
  8138. type: 'int'
  8139. },
  8140. 'aria-rowspan': {
  8141. type: 'int'
  8142. },
  8143. 'aria-selected': {
  8144. type: 'nmtoken',
  8145. values: [ 'false', 'true', 'undefined' ]
  8146. },
  8147. 'aria-setsize': {
  8148. type: 'int'
  8149. },
  8150. 'aria-sort': {
  8151. type: 'nmtoken',
  8152. values: [ 'ascending', 'descending', 'none', 'other' ]
  8153. },
  8154. 'aria-valuemax': {
  8155. type: 'decimal'
  8156. },
  8157. 'aria-valuemin': {
  8158. type: 'decimal'
  8159. },
  8160. 'aria-valuenow': {
  8161. type: 'decimal'
  8162. },
  8163. 'aria-valuetext': {
  8164. type: 'string'
  8165. }
  8166. };
  8167. var aria_attrs_default = ariaAttrs;
  8168. var ariaRoles = {
  8169. alert: {
  8170. type: 'widget',
  8171. allowedAttrs: [ 'aria-expanded' ],
  8172. superclassRole: [ 'section' ]
  8173. },
  8174. alertdialog: {
  8175. type: 'widget',
  8176. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  8177. superclassRole: [ 'alert', 'dialog' ],
  8178. accessibleNameRequired: true
  8179. },
  8180. application: {
  8181. type: 'landmark',
  8182. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  8183. superclassRole: [ 'structure' ],
  8184. accessibleNameRequired: true
  8185. },
  8186. article: {
  8187. type: 'structure',
  8188. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  8189. superclassRole: [ 'document' ]
  8190. },
  8191. banner: {
  8192. type: 'landmark',
  8193. allowedAttrs: [ 'aria-expanded' ],
  8194. superclassRole: [ 'landmark' ]
  8195. },
  8196. blockquote: {
  8197. type: 'structure',
  8198. superclassRole: [ 'section' ]
  8199. },
  8200. button: {
  8201. type: 'widget',
  8202. allowedAttrs: [ 'aria-expanded', 'aria-pressed' ],
  8203. superclassRole: [ 'command' ],
  8204. accessibleNameRequired: true,
  8205. nameFromContent: true
  8206. },
  8207. caption: {
  8208. type: 'structure',
  8209. requiredContext: [ 'figure', 'table', 'grid', 'treegrid' ],
  8210. superclassRole: [ 'section' ]
  8211. },
  8212. cell: {
  8213. type: 'structure',
  8214. requiredContext: [ 'row' ],
  8215. allowedAttrs: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-expanded' ],
  8216. superclassRole: [ 'section' ],
  8217. nameFromContent: true
  8218. },
  8219. checkbox: {
  8220. type: 'widget',
  8221. allowedAttrs: [ 'aria-checked', 'aria-readonly', 'aria-required' ],
  8222. superclassRole: [ 'input' ],
  8223. accessibleNameRequired: true,
  8224. nameFromContent: true
  8225. },
  8226. code: {
  8227. type: 'structure',
  8228. superclassRole: [ 'section' ]
  8229. },
  8230. columnheader: {
  8231. type: 'structure',
  8232. requiredContext: [ 'row' ],
  8233. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  8234. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  8235. accessibleNameRequired: false,
  8236. nameFromContent: true
  8237. },
  8238. combobox: {
  8239. type: 'composite',
  8240. requiredOwned: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ],
  8241. requiredAttrs: [ 'aria-expanded' ],
  8242. allowedAttrs: [ 'aria-controls', 'aria-autocomplete', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-orientation' ],
  8243. superclassRole: [ 'select' ],
  8244. accessibleNameRequired: true
  8245. },
  8246. command: {
  8247. type: 'abstract',
  8248. superclassRole: [ 'widget' ]
  8249. },
  8250. complementary: {
  8251. type: 'landmark',
  8252. allowedAttrs: [ 'aria-expanded' ],
  8253. superclassRole: [ 'landmark' ]
  8254. },
  8255. composite: {
  8256. type: 'abstract',
  8257. superclassRole: [ 'widget' ]
  8258. },
  8259. contentinfo: {
  8260. type: 'landmark',
  8261. allowedAttrs: [ 'aria-expanded' ],
  8262. superclassRole: [ 'landmark' ]
  8263. },
  8264. definition: {
  8265. type: 'structure',
  8266. allowedAttrs: [ 'aria-expanded' ],
  8267. superclassRole: [ 'section' ]
  8268. },
  8269. deletion: {
  8270. type: 'structure',
  8271. superclassRole: [ 'section' ]
  8272. },
  8273. dialog: {
  8274. type: 'widget',
  8275. allowedAttrs: [ 'aria-expanded', 'aria-modal' ],
  8276. superclassRole: [ 'window' ],
  8277. accessibleNameRequired: true
  8278. },
  8279. directory: {
  8280. type: 'structure',
  8281. allowedAttrs: [ 'aria-expanded' ],
  8282. superclassRole: [ 'list' ],
  8283. nameFromContent: true
  8284. },
  8285. document: {
  8286. type: 'structure',
  8287. allowedAttrs: [ 'aria-expanded' ],
  8288. superclassRole: [ 'structure' ]
  8289. },
  8290. emphasis: {
  8291. type: 'structure',
  8292. superclassRole: [ 'section' ]
  8293. },
  8294. feed: {
  8295. type: 'structure',
  8296. requiredOwned: [ 'article' ],
  8297. allowedAttrs: [ 'aria-expanded' ],
  8298. superclassRole: [ 'list' ]
  8299. },
  8300. figure: {
  8301. type: 'structure',
  8302. allowedAttrs: [ 'aria-expanded' ],
  8303. superclassRole: [ 'section' ],
  8304. nameFromContent: true
  8305. },
  8306. form: {
  8307. type: 'landmark',
  8308. allowedAttrs: [ 'aria-expanded' ],
  8309. superclassRole: [ 'landmark' ]
  8310. },
  8311. grid: {
  8312. type: 'composite',
  8313. requiredOwned: [ 'rowgroup', 'row' ],
  8314. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-rowcount' ],
  8315. superclassRole: [ 'composite', 'table' ],
  8316. accessibleNameRequired: false
  8317. },
  8318. gridcell: {
  8319. type: 'widget',
  8320. requiredContext: [ 'row' ],
  8321. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-selected', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan' ],
  8322. superclassRole: [ 'cell', 'widget' ],
  8323. nameFromContent: true
  8324. },
  8325. group: {
  8326. type: 'structure',
  8327. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded' ],
  8328. superclassRole: [ 'section' ]
  8329. },
  8330. heading: {
  8331. type: 'structure',
  8332. requiredAttrs: [ 'aria-level' ],
  8333. allowedAttrs: [ 'aria-expanded' ],
  8334. superclassRole: [ 'sectionhead' ],
  8335. accessibleNameRequired: false,
  8336. nameFromContent: true
  8337. },
  8338. img: {
  8339. type: 'structure',
  8340. allowedAttrs: [ 'aria-expanded' ],
  8341. superclassRole: [ 'section' ],
  8342. accessibleNameRequired: true
  8343. },
  8344. input: {
  8345. type: 'abstract',
  8346. superclassRole: [ 'widget' ]
  8347. },
  8348. insertion: {
  8349. type: 'structure',
  8350. superclassRole: [ 'section' ]
  8351. },
  8352. landmark: {
  8353. type: 'abstract',
  8354. superclassRole: [ 'section' ]
  8355. },
  8356. link: {
  8357. type: 'widget',
  8358. allowedAttrs: [ 'aria-expanded' ],
  8359. superclassRole: [ 'command' ],
  8360. accessibleNameRequired: true,
  8361. nameFromContent: true
  8362. },
  8363. list: {
  8364. type: 'structure',
  8365. requiredOwned: [ 'listitem' ],
  8366. allowedAttrs: [ 'aria-expanded' ],
  8367. superclassRole: [ 'section' ]
  8368. },
  8369. listbox: {
  8370. type: 'composite',
  8371. requiredOwned: [ 'option' ],
  8372. allowedAttrs: [ 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8373. superclassRole: [ 'select' ],
  8374. accessibleNameRequired: true
  8375. },
  8376. listitem: {
  8377. type: 'structure',
  8378. requiredContext: [ 'list' ],
  8379. allowedAttrs: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  8380. superclassRole: [ 'section' ],
  8381. nameFromContent: true
  8382. },
  8383. log: {
  8384. type: 'widget',
  8385. allowedAttrs: [ 'aria-expanded' ],
  8386. superclassRole: [ 'section' ]
  8387. },
  8388. main: {
  8389. type: 'landmark',
  8390. allowedAttrs: [ 'aria-expanded' ],
  8391. superclassRole: [ 'landmark' ]
  8392. },
  8393. marquee: {
  8394. type: 'widget',
  8395. allowedAttrs: [ 'aria-expanded' ],
  8396. superclassRole: [ 'section' ]
  8397. },
  8398. math: {
  8399. type: 'structure',
  8400. allowedAttrs: [ 'aria-expanded' ],
  8401. superclassRole: [ 'section' ]
  8402. },
  8403. menu: {
  8404. type: 'composite',
  8405. requiredOwned: [ 'menuitemradio', 'menuitem', 'menuitemcheckbox' ],
  8406. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8407. superclassRole: [ 'select' ]
  8408. },
  8409. menubar: {
  8410. type: 'composite',
  8411. requiredOwned: [ 'menuitemradio', 'menuitem', 'menuitemcheckbox' ],
  8412. allowedAttrs: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8413. superclassRole: [ 'menu' ]
  8414. },
  8415. menuitem: {
  8416. type: 'widget',
  8417. requiredContext: [ 'menu', 'menubar' ],
  8418. allowedAttrs: [ 'aria-posinset', 'aria-setsize', 'aria-expanded' ],
  8419. superclassRole: [ 'command' ],
  8420. accessibleNameRequired: true,
  8421. nameFromContent: true
  8422. },
  8423. menuitemcheckbox: {
  8424. type: 'widget',
  8425. requiredContext: [ 'menu', 'menubar' ],
  8426. allowedAttrs: [ 'aria-checked', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  8427. superclassRole: [ 'checkbox', 'menuitem' ],
  8428. accessibleNameRequired: true,
  8429. nameFromContent: true
  8430. },
  8431. menuitemradio: {
  8432. type: 'widget',
  8433. requiredContext: [ 'menu', 'menubar', 'group' ],
  8434. allowedAttrs: [ 'aria-checked', 'aria-posinset', 'aria-readonly', 'aria-setsize' ],
  8435. superclassRole: [ 'menuitemcheckbox', 'radio' ],
  8436. accessibleNameRequired: true,
  8437. nameFromContent: true
  8438. },
  8439. meter: {
  8440. type: 'structure',
  8441. allowedAttrs: [ 'aria-valuetext' ],
  8442. requiredAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuenow' ],
  8443. superclassRole: [ 'range' ],
  8444. accessibleNameRequired: true
  8445. },
  8446. navigation: {
  8447. type: 'landmark',
  8448. allowedAttrs: [ 'aria-expanded' ],
  8449. superclassRole: [ 'landmark' ]
  8450. },
  8451. none: {
  8452. type: 'structure',
  8453. superclassRole: [ 'structure' ]
  8454. },
  8455. note: {
  8456. type: 'structure',
  8457. allowedAttrs: [ 'aria-expanded' ],
  8458. superclassRole: [ 'section' ]
  8459. },
  8460. option: {
  8461. type: 'widget',
  8462. requiredContext: [ 'listbox' ],
  8463. allowedAttrs: [ 'aria-selected', 'aria-checked', 'aria-posinset', 'aria-setsize' ],
  8464. superclassRole: [ 'input' ],
  8465. accessibleNameRequired: true,
  8466. nameFromContent: true
  8467. },
  8468. paragraph: {
  8469. type: 'structure',
  8470. superclassRole: [ 'section' ]
  8471. },
  8472. presentation: {
  8473. type: 'structure',
  8474. superclassRole: [ 'structure' ]
  8475. },
  8476. progressbar: {
  8477. type: 'widget',
  8478. allowedAttrs: [ 'aria-expanded', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext' ],
  8479. superclassRole: [ 'range' ],
  8480. accessibleNameRequired: true
  8481. },
  8482. radio: {
  8483. type: 'widget',
  8484. allowedAttrs: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-required' ],
  8485. superclassRole: [ 'input' ],
  8486. accessibleNameRequired: true,
  8487. nameFromContent: true
  8488. },
  8489. radiogroup: {
  8490. type: 'composite',
  8491. requiredOwned: [ 'radio' ],
  8492. allowedAttrs: [ 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8493. superclassRole: [ 'select' ],
  8494. accessibleNameRequired: false
  8495. },
  8496. range: {
  8497. type: 'abstract',
  8498. superclassRole: [ 'widget' ]
  8499. },
  8500. region: {
  8501. type: 'landmark',
  8502. allowedAttrs: [ 'aria-expanded' ],
  8503. superclassRole: [ 'landmark' ],
  8504. accessibleNameRequired: false
  8505. },
  8506. roletype: {
  8507. type: 'abstract',
  8508. superclassRole: []
  8509. },
  8510. row: {
  8511. type: 'structure',
  8512. requiredContext: [ 'grid', 'rowgroup', 'table', 'treegrid' ],
  8513. requiredOwned: [ 'cell', 'columnheader', 'gridcell', 'rowheader' ],
  8514. allowedAttrs: [ 'aria-colindex', 'aria-level', 'aria-rowindex', 'aria-selected', 'aria-activedescendant', 'aria-expanded' ],
  8515. superclassRole: [ 'group', 'widget' ],
  8516. nameFromContent: true
  8517. },
  8518. rowgroup: {
  8519. type: 'structure',
  8520. requiredContext: [ 'grid', 'table', 'treegrid' ],
  8521. requiredOwned: [ 'row' ],
  8522. superclassRole: [ 'structure' ],
  8523. nameFromContent: true
  8524. },
  8525. rowheader: {
  8526. type: 'structure',
  8527. requiredContext: [ 'row' ],
  8528. allowedAttrs: [ 'aria-sort', 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-readonly', 'aria-required', 'aria-rowindex', 'aria-rowspan', 'aria-selected' ],
  8529. superclassRole: [ 'cell', 'gridcell', 'sectionhead' ],
  8530. accessibleNameRequired: false,
  8531. nameFromContent: true
  8532. },
  8533. scrollbar: {
  8534. type: 'widget',
  8535. requiredAttrs: [ 'aria-valuenow' ],
  8536. allowedAttrs: [ 'aria-controls', 'aria-orientation', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext' ],
  8537. superclassRole: [ 'range' ]
  8538. },
  8539. search: {
  8540. type: 'landmark',
  8541. allowedAttrs: [ 'aria-expanded' ],
  8542. superclassRole: [ 'landmark' ]
  8543. },
  8544. searchbox: {
  8545. type: 'widget',
  8546. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  8547. superclassRole: [ 'textbox' ],
  8548. accessibleNameRequired: true
  8549. },
  8550. section: {
  8551. type: 'abstract',
  8552. superclassRole: [ 'structure' ],
  8553. nameFromContent: true
  8554. },
  8555. sectionhead: {
  8556. type: 'abstract',
  8557. superclassRole: [ 'structure' ],
  8558. nameFromContent: true
  8559. },
  8560. select: {
  8561. type: 'abstract',
  8562. superclassRole: [ 'composite', 'group' ]
  8563. },
  8564. separator: {
  8565. type: 'structure',
  8566. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-orientation', 'aria-valuetext' ],
  8567. superclassRole: [ 'structure', 'widget' ]
  8568. },
  8569. slider: {
  8570. type: 'widget',
  8571. requiredAttrs: [ 'aria-valuenow' ],
  8572. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-orientation', 'aria-readonly', 'aria-valuetext' ],
  8573. superclassRole: [ 'input', 'range' ],
  8574. accessibleNameRequired: true
  8575. },
  8576. spinbutton: {
  8577. type: 'widget',
  8578. requiredAttrs: [ 'aria-valuenow' ],
  8579. allowedAttrs: [ 'aria-valuemax', 'aria-valuemin', 'aria-readonly', 'aria-required', 'aria-activedescendant', 'aria-valuetext' ],
  8580. superclassRole: [ 'composite', 'input', 'range' ],
  8581. accessibleNameRequired: true
  8582. },
  8583. status: {
  8584. type: 'widget',
  8585. allowedAttrs: [ 'aria-expanded' ],
  8586. superclassRole: [ 'section' ]
  8587. },
  8588. strong: {
  8589. type: 'structure',
  8590. superclassRole: [ 'section' ]
  8591. },
  8592. structure: {
  8593. type: 'abstract',
  8594. superclassRole: [ 'roletype' ]
  8595. },
  8596. subscript: {
  8597. type: 'structure',
  8598. superclassRole: [ 'section' ]
  8599. },
  8600. superscript: {
  8601. type: 'structure',
  8602. superclassRole: [ 'section' ]
  8603. },
  8604. switch: {
  8605. type: 'widget',
  8606. requiredAttrs: [ 'aria-checked' ],
  8607. allowedAttrs: [ 'aria-readonly' ],
  8608. superclassRole: [ 'checkbox' ],
  8609. accessibleNameRequired: true,
  8610. nameFromContent: true
  8611. },
  8612. tab: {
  8613. type: 'widget',
  8614. requiredContext: [ 'tablist' ],
  8615. allowedAttrs: [ 'aria-posinset', 'aria-selected', 'aria-setsize', 'aria-expanded' ],
  8616. superclassRole: [ 'sectionhead', 'widget' ],
  8617. nameFromContent: true
  8618. },
  8619. table: {
  8620. type: 'structure',
  8621. requiredOwned: [ 'rowgroup', 'row' ],
  8622. allowedAttrs: [ 'aria-colcount', 'aria-rowcount', 'aria-expanded' ],
  8623. superclassRole: [ 'section' ],
  8624. accessibleNameRequired: false,
  8625. nameFromContent: true
  8626. },
  8627. tablist: {
  8628. type: 'composite',
  8629. requiredOwned: [ 'tab' ],
  8630. allowedAttrs: [ 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  8631. superclassRole: [ 'composite' ]
  8632. },
  8633. tabpanel: {
  8634. type: 'widget',
  8635. allowedAttrs: [ 'aria-expanded' ],
  8636. superclassRole: [ 'section' ],
  8637. accessibleNameRequired: false
  8638. },
  8639. term: {
  8640. type: 'structure',
  8641. allowedAttrs: [ 'aria-expanded' ],
  8642. superclassRole: [ 'section' ],
  8643. nameFromContent: true
  8644. },
  8645. textbox: {
  8646. type: 'widget',
  8647. allowedAttrs: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-placeholder', 'aria-readonly', 'aria-required' ],
  8648. superclassRole: [ 'input' ],
  8649. accessibleNameRequired: true
  8650. },
  8651. time: {
  8652. type: 'structure',
  8653. superclassRole: [ 'section' ]
  8654. },
  8655. timer: {
  8656. type: 'widget',
  8657. allowedAttrs: [ 'aria-expanded' ],
  8658. superclassRole: [ 'status' ]
  8659. },
  8660. toolbar: {
  8661. type: 'structure',
  8662. allowedAttrs: [ 'aria-orientation', 'aria-activedescendant', 'aria-expanded' ],
  8663. superclassRole: [ 'group' ],
  8664. accessibleNameRequired: true
  8665. },
  8666. tooltip: {
  8667. type: 'structure',
  8668. allowedAttrs: [ 'aria-expanded' ],
  8669. superclassRole: [ 'section' ],
  8670. nameFromContent: true
  8671. },
  8672. tree: {
  8673. type: 'composite',
  8674. requiredOwned: [ 'treeitem' ],
  8675. allowedAttrs: [ 'aria-multiselectable', 'aria-required', 'aria-activedescendant', 'aria-expanded', 'aria-orientation' ],
  8676. superclassRole: [ 'select' ],
  8677. accessibleNameRequired: false
  8678. },
  8679. treegrid: {
  8680. type: 'composite',
  8681. requiredOwned: [ 'rowgroup', 'row' ],
  8682. allowedAttrs: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-readonly', 'aria-required', 'aria-rowcount' ],
  8683. superclassRole: [ 'grid', 'tree' ],
  8684. accessibleNameRequired: false
  8685. },
  8686. treeitem: {
  8687. type: 'widget',
  8688. requiredContext: [ 'group', 'tree' ],
  8689. allowedAttrs: [ 'aria-checked', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-selected', 'aria-setsize' ],
  8690. superclassRole: [ 'listitem', 'option' ],
  8691. accessibleNameRequired: true,
  8692. nameFromContent: true
  8693. },
  8694. widget: {
  8695. type: 'abstract',
  8696. superclassRole: [ 'roletype' ]
  8697. },
  8698. window: {
  8699. type: 'abstract',
  8700. superclassRole: [ 'roletype' ]
  8701. }
  8702. };
  8703. var aria_roles_default = ariaRoles;
  8704. var dpubRoles = {
  8705. 'doc-abstract': {
  8706. type: 'section',
  8707. allowedAttrs: [ 'aria-expanded' ],
  8708. superclassRole: [ 'section' ]
  8709. },
  8710. 'doc-acknowledgments': {
  8711. type: 'landmark',
  8712. allowedAttrs: [ 'aria-expanded' ],
  8713. superclassRole: [ 'landmark' ]
  8714. },
  8715. 'doc-afterword': {
  8716. type: 'landmark',
  8717. allowedAttrs: [ 'aria-expanded' ],
  8718. superclassRole: [ 'landmark' ]
  8719. },
  8720. 'doc-appendix': {
  8721. type: 'landmark',
  8722. allowedAttrs: [ 'aria-expanded' ],
  8723. superclassRole: [ 'landmark' ]
  8724. },
  8725. 'doc-backlink': {
  8726. type: 'link',
  8727. allowedAttrs: [ 'aria-expanded' ],
  8728. nameFromContent: true,
  8729. superclassRole: [ 'link' ]
  8730. },
  8731. 'doc-biblioentry': {
  8732. type: 'listitem',
  8733. requiredContext: [ 'doc-bibliography' ],
  8734. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  8735. superclassRole: [ 'listitem' ]
  8736. },
  8737. 'doc-bibliography': {
  8738. type: 'landmark',
  8739. requiredOwned: [ 'doc-biblioentry' ],
  8740. allowedAttrs: [ 'aria-expanded' ],
  8741. superclassRole: [ 'landmark' ]
  8742. },
  8743. 'doc-biblioref': {
  8744. type: 'link',
  8745. allowedAttrs: [ 'aria-expanded' ],
  8746. nameFromContent: true,
  8747. superclassRole: [ 'link' ]
  8748. },
  8749. 'doc-chapter': {
  8750. type: 'landmark',
  8751. allowedAttrs: [ 'aria-expanded' ],
  8752. superclassRole: [ 'landmark' ]
  8753. },
  8754. 'doc-colophon': {
  8755. type: 'section',
  8756. allowedAttrs: [ 'aria-expanded' ],
  8757. superclassRole: [ 'section' ]
  8758. },
  8759. 'doc-conclusion': {
  8760. type: 'landmark',
  8761. allowedAttrs: [ 'aria-expanded' ],
  8762. superclassRole: [ 'landmark' ]
  8763. },
  8764. 'doc-cover': {
  8765. type: 'img',
  8766. allowedAttrs: [ 'aria-expanded' ],
  8767. superclassRole: [ 'img' ]
  8768. },
  8769. 'doc-credit': {
  8770. type: 'section',
  8771. allowedAttrs: [ 'aria-expanded' ],
  8772. superclassRole: [ 'section' ]
  8773. },
  8774. 'doc-credits': {
  8775. type: 'landmark',
  8776. allowedAttrs: [ 'aria-expanded' ],
  8777. superclassRole: [ 'landmark' ]
  8778. },
  8779. 'doc-dedication': {
  8780. type: 'section',
  8781. allowedAttrs: [ 'aria-expanded' ],
  8782. superclassRole: [ 'section' ]
  8783. },
  8784. 'doc-endnote': {
  8785. type: 'listitem',
  8786. requiredContext: [ 'doc-endnotes' ],
  8787. allowedAttrs: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize' ],
  8788. superclassRole: [ 'listitem' ]
  8789. },
  8790. 'doc-endnotes': {
  8791. type: 'landmark',
  8792. requiredOwned: [ 'doc-endnote' ],
  8793. allowedAttrs: [ 'aria-expanded' ],
  8794. superclassRole: [ 'landmark' ]
  8795. },
  8796. 'doc-epigraph': {
  8797. type: 'section',
  8798. allowedAttrs: [ 'aria-expanded' ],
  8799. superclassRole: [ 'section' ]
  8800. },
  8801. 'doc-epilogue': {
  8802. type: 'landmark',
  8803. allowedAttrs: [ 'aria-expanded' ],
  8804. superclassRole: [ 'landmark' ]
  8805. },
  8806. 'doc-errata': {
  8807. type: 'landmark',
  8808. allowedAttrs: [ 'aria-expanded' ],
  8809. superclassRole: [ 'landmark' ]
  8810. },
  8811. 'doc-example': {
  8812. type: 'section',
  8813. allowedAttrs: [ 'aria-expanded' ],
  8814. superclassRole: [ 'section' ]
  8815. },
  8816. 'doc-footnote': {
  8817. type: 'section',
  8818. allowedAttrs: [ 'aria-expanded' ],
  8819. superclassRole: [ 'section' ]
  8820. },
  8821. 'doc-foreword': {
  8822. type: 'landmark',
  8823. allowedAttrs: [ 'aria-expanded' ],
  8824. superclassRole: [ 'landmark' ]
  8825. },
  8826. 'doc-glossary': {
  8827. type: 'landmark',
  8828. requiredOwned: [ 'definition', 'term' ],
  8829. allowedAttrs: [ 'aria-expanded' ],
  8830. superclassRole: [ 'landmark' ]
  8831. },
  8832. 'doc-glossref': {
  8833. type: 'link',
  8834. allowedAttrs: [ 'aria-expanded' ],
  8835. nameFromContent: true,
  8836. superclassRole: [ 'link' ]
  8837. },
  8838. 'doc-index': {
  8839. type: 'navigation',
  8840. allowedAttrs: [ 'aria-expanded' ],
  8841. superclassRole: [ 'navigation' ]
  8842. },
  8843. 'doc-introduction': {
  8844. type: 'landmark',
  8845. allowedAttrs: [ 'aria-expanded' ],
  8846. superclassRole: [ 'landmark' ]
  8847. },
  8848. 'doc-noteref': {
  8849. type: 'link',
  8850. allowedAttrs: [ 'aria-expanded' ],
  8851. nameFromContent: true,
  8852. superclassRole: [ 'link' ]
  8853. },
  8854. 'doc-notice': {
  8855. type: 'note',
  8856. allowedAttrs: [ 'aria-expanded' ],
  8857. superclassRole: [ 'note' ]
  8858. },
  8859. 'doc-pagebreak': {
  8860. type: 'separator',
  8861. allowedAttrs: [ 'aria-expanded', 'aria-orientation' ],
  8862. superclassRole: [ 'separator' ]
  8863. },
  8864. 'doc-pagelist': {
  8865. type: 'navigation',
  8866. allowedAttrs: [ 'aria-expanded' ],
  8867. superclassRole: [ 'navigation' ]
  8868. },
  8869. 'doc-part': {
  8870. type: 'landmark',
  8871. allowedAttrs: [ 'aria-expanded' ],
  8872. superclassRole: [ 'landmark' ]
  8873. },
  8874. 'doc-preface': {
  8875. type: 'landmark',
  8876. allowedAttrs: [ 'aria-expanded' ],
  8877. superclassRole: [ 'landmark' ]
  8878. },
  8879. 'doc-prologue': {
  8880. type: 'landmark',
  8881. allowedAttrs: [ 'aria-expanded' ],
  8882. superclassRole: [ 'landmark' ]
  8883. },
  8884. 'doc-pullquote': {
  8885. type: 'none',
  8886. superclassRole: [ 'none' ]
  8887. },
  8888. 'doc-qna': {
  8889. type: 'section',
  8890. allowedAttrs: [ 'aria-expanded' ],
  8891. superclassRole: [ 'section' ]
  8892. },
  8893. 'doc-subtitle': {
  8894. type: 'sectionhead',
  8895. allowedAttrs: [ 'aria-expanded' ],
  8896. superclassRole: [ 'sectionhead' ]
  8897. },
  8898. 'doc-tip': {
  8899. type: 'note',
  8900. allowedAttrs: [ 'aria-expanded' ],
  8901. superclassRole: [ 'note' ]
  8902. },
  8903. 'doc-toc': {
  8904. type: 'navigation',
  8905. allowedAttrs: [ 'aria-expanded' ],
  8906. superclassRole: [ 'navigation' ]
  8907. }
  8908. };
  8909. var dpub_roles_default = dpubRoles;
  8910. var htmlElms = {
  8911. a: {
  8912. variant: {
  8913. href: {
  8914. matches: '[href]',
  8915. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  8916. allowedRoles: [ 'button', 'checkbox', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab', 'treeitem', 'doc-backlink', 'doc-biblioref', 'doc-glossref', 'doc-noteref' ],
  8917. namingMethods: [ 'subtreeText' ]
  8918. },
  8919. default: {
  8920. contentTypes: [ 'phrasing', 'flow' ],
  8921. allowedRoles: true
  8922. }
  8923. }
  8924. },
  8925. abbr: {
  8926. contentTypes: [ 'phrasing', 'flow' ],
  8927. allowedRoles: true
  8928. },
  8929. addres: {
  8930. contentTypes: [ 'flow' ],
  8931. allowedRoles: true
  8932. },
  8933. area: {
  8934. contentTypes: [ 'phrasing', 'flow' ],
  8935. allowedRoles: false,
  8936. namingMethods: [ 'altText' ]
  8937. },
  8938. article: {
  8939. contentTypes: [ 'sectioning', 'flow' ],
  8940. allowedRoles: [ 'feed', 'presentation', 'none', 'document', 'application', 'main', 'region' ],
  8941. shadowRoot: true
  8942. },
  8943. aside: {
  8944. contentTypes: [ 'sectioning', 'flow' ],
  8945. allowedRoles: [ 'feed', 'note', 'presentation', 'none', 'region', 'search', 'doc-dedication', 'doc-example', 'doc-footnote', 'doc-pullquote', 'doc-tip' ]
  8946. },
  8947. audio: {
  8948. variant: {
  8949. controls: {
  8950. matches: '[controls]',
  8951. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  8952. },
  8953. default: {
  8954. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  8955. }
  8956. },
  8957. allowedRoles: [ 'application' ]
  8958. },
  8959. b: {
  8960. contentTypes: [ 'phrasing', 'flow' ],
  8961. allowedRoles: false
  8962. },
  8963. base: {
  8964. allowedRoles: false,
  8965. noAriaAttrs: true
  8966. },
  8967. bdi: {
  8968. contentTypes: [ 'phrasing', 'flow' ],
  8969. allowedRoles: true
  8970. },
  8971. bdo: {
  8972. contentTypes: [ 'phrasing', 'flow' ],
  8973. allowedRoles: true
  8974. },
  8975. blockquote: {
  8976. contentTypes: [ 'flow' ],
  8977. allowedRoles: true,
  8978. shadowRoot: true
  8979. },
  8980. body: {
  8981. allowedRoles: false,
  8982. shadowRoot: true
  8983. },
  8984. br: {
  8985. contentTypes: [ 'phrasing', 'flow' ],
  8986. allowedRoles: [ 'presentation', 'none' ],
  8987. namingMethods: [ 'titleText', 'singleSpace' ]
  8988. },
  8989. button: {
  8990. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  8991. allowedRoles: [ 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ],
  8992. namingMethods: [ 'subtreeText' ]
  8993. },
  8994. canvas: {
  8995. allowedRoles: true,
  8996. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  8997. },
  8998. caption: {
  8999. allowedRoles: false
  9000. },
  9001. cite: {
  9002. contentTypes: [ 'phrasing', 'flow' ],
  9003. allowedRoles: true
  9004. },
  9005. code: {
  9006. contentTypes: [ 'phrasing', 'flow' ],
  9007. allowedRoles: true
  9008. },
  9009. col: {
  9010. allowedRoles: false,
  9011. noAriaAttrs: true
  9012. },
  9013. colgroup: {
  9014. allowedRoles: false,
  9015. noAriaAttrs: true
  9016. },
  9017. data: {
  9018. contentTypes: [ 'phrasing', 'flow' ],
  9019. allowedRoles: true
  9020. },
  9021. datalist: {
  9022. contentTypes: [ 'phrasing', 'flow' ],
  9023. allowedRoles: false,
  9024. implicitAttrs: {
  9025. 'aria-multiselectable': 'false'
  9026. }
  9027. },
  9028. dd: {
  9029. allowedRoles: false
  9030. },
  9031. del: {
  9032. contentTypes: [ 'phrasing', 'flow' ],
  9033. allowedRoles: true
  9034. },
  9035. dfn: {
  9036. contentTypes: [ 'phrasing', 'flow' ],
  9037. allowedRoles: true
  9038. },
  9039. details: {
  9040. contentTypes: [ 'interactive', 'flow' ],
  9041. allowedRoles: false
  9042. },
  9043. dialog: {
  9044. contentTypes: [ 'flow' ],
  9045. allowedRoles: [ 'alertdialog' ]
  9046. },
  9047. div: {
  9048. contentTypes: [ 'flow' ],
  9049. allowedRoles: true,
  9050. shadowRoot: true
  9051. },
  9052. dl: {
  9053. contentTypes: [ 'flow' ],
  9054. allowedRoles: [ 'group', 'list', 'presentation', 'none' ]
  9055. },
  9056. dt: {
  9057. allowedRoles: [ 'listitem' ]
  9058. },
  9059. em: {
  9060. contentTypes: [ 'phrasing', 'flow' ],
  9061. allowedRoles: true
  9062. },
  9063. embed: {
  9064. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  9065. allowedRoles: [ 'application', 'document', 'img', 'presentation', 'none' ]
  9066. },
  9067. fieldset: {
  9068. contentTypes: [ 'flow' ],
  9069. allowedRoles: [ 'none', 'presentation', 'radiogroup' ],
  9070. namingMethods: [ 'fieldsetLegendText' ]
  9071. },
  9072. figcaption: {
  9073. allowedRoles: [ 'group', 'none', 'presentation' ]
  9074. },
  9075. figure: {
  9076. contentTypes: [ 'flow' ],
  9077. allowedRoles: true,
  9078. namingMethods: [ 'figureText', 'titleText' ]
  9079. },
  9080. footer: {
  9081. contentTypes: [ 'flow' ],
  9082. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  9083. shadowRoot: true
  9084. },
  9085. form: {
  9086. contentTypes: [ 'flow' ],
  9087. allowedRoles: [ 'search', 'none', 'presentation' ]
  9088. },
  9089. h1: {
  9090. contentTypes: [ 'heading', 'flow' ],
  9091. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9092. shadowRoot: true,
  9093. implicitAttrs: {
  9094. 'aria-level': '1'
  9095. }
  9096. },
  9097. h2: {
  9098. contentTypes: [ 'heading', 'flow' ],
  9099. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9100. shadowRoot: true,
  9101. implicitAttrs: {
  9102. 'aria-level': '2'
  9103. }
  9104. },
  9105. h3: {
  9106. contentTypes: [ 'heading', 'flow' ],
  9107. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9108. shadowRoot: true,
  9109. implicitAttrs: {
  9110. 'aria-level': '3'
  9111. }
  9112. },
  9113. h4: {
  9114. contentTypes: [ 'heading', 'flow' ],
  9115. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9116. shadowRoot: true,
  9117. implicitAttrs: {
  9118. 'aria-level': '4'
  9119. }
  9120. },
  9121. h5: {
  9122. contentTypes: [ 'heading', 'flow' ],
  9123. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9124. shadowRoot: true,
  9125. implicitAttrs: {
  9126. 'aria-level': '5'
  9127. }
  9128. },
  9129. h6: {
  9130. contentTypes: [ 'heading', 'flow' ],
  9131. allowedRoles: [ 'none', 'presentation', 'tab', 'doc-subtitle' ],
  9132. shadowRoot: true,
  9133. implicitAttrs: {
  9134. 'aria-level': '6'
  9135. }
  9136. },
  9137. head: {
  9138. allowedRoles: false,
  9139. noAriaAttrs: true
  9140. },
  9141. header: {
  9142. contentTypes: [ 'flow' ],
  9143. allowedRoles: [ 'group', 'none', 'presentation', 'doc-footnote' ],
  9144. shadowRoot: true
  9145. },
  9146. hgroup: {
  9147. contentTypes: [ 'heading', 'flow' ],
  9148. allowedRoles: true
  9149. },
  9150. hr: {
  9151. contentTypes: [ 'flow' ],
  9152. allowedRoles: [ 'none', 'presentation', 'doc-pagebreak' ],
  9153. namingMethods: [ 'titleText', 'singleSpace' ]
  9154. },
  9155. html: {
  9156. allowedRoles: false,
  9157. noAriaAttrs: true
  9158. },
  9159. i: {
  9160. contentTypes: [ 'phrasing', 'flow' ],
  9161. allowedRoles: true
  9162. },
  9163. iframe: {
  9164. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ],
  9165. allowedRoles: [ 'application', 'document', 'img', 'none', 'presentation' ]
  9166. },
  9167. img: {
  9168. variant: {
  9169. nonEmptyAlt: {
  9170. matches: {
  9171. attributes: {
  9172. alt: '/.+/'
  9173. }
  9174. },
  9175. allowedRoles: [ 'button', 'checkbox', 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'scrollbar', 'separator', 'slider', 'switch', 'tab', 'treeitem', 'doc-cover' ]
  9176. },
  9177. usemap: {
  9178. matches: '[usemap]',
  9179. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  9180. },
  9181. default: {
  9182. allowedRoles: [ 'presentation', 'none' ],
  9183. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  9184. }
  9185. },
  9186. namingMethods: [ 'altText' ]
  9187. },
  9188. input: {
  9189. variant: {
  9190. button: {
  9191. matches: {
  9192. properties: {
  9193. type: 'button'
  9194. }
  9195. },
  9196. allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'radio', 'switch', 'tab' ]
  9197. },
  9198. buttonType: {
  9199. matches: {
  9200. properties: {
  9201. type: [ 'button', 'submit', 'reset' ]
  9202. }
  9203. },
  9204. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  9205. },
  9206. checkboxPressed: {
  9207. matches: {
  9208. properties: {
  9209. type: 'checkbox'
  9210. },
  9211. attributes: {
  9212. 'aria-pressed': '/.*/'
  9213. }
  9214. },
  9215. allowedRoles: [ 'button', 'menuitemcheckbox', 'option', 'switch' ],
  9216. implicitAttrs: {
  9217. 'aria-checked': 'false'
  9218. }
  9219. },
  9220. checkbox: {
  9221. matches: {
  9222. properties: {
  9223. type: 'checkbox'
  9224. },
  9225. attributes: {
  9226. 'aria-pressed': null
  9227. }
  9228. },
  9229. allowedRoles: [ 'menuitemcheckbox', 'option', 'switch' ],
  9230. implicitAttrs: {
  9231. 'aria-checked': 'false'
  9232. }
  9233. },
  9234. noRoles: {
  9235. matches: {
  9236. properties: {
  9237. type: [ 'color', 'date', 'datetime-local', 'file', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  9238. }
  9239. },
  9240. allowedRoles: false
  9241. },
  9242. hidden: {
  9243. matches: {
  9244. properties: {
  9245. type: 'hidden'
  9246. }
  9247. },
  9248. contentTypes: [ 'phrasing', 'flow' ],
  9249. allowedRoles: false,
  9250. noAriaAttrs: true
  9251. },
  9252. image: {
  9253. matches: {
  9254. properties: {
  9255. type: 'image'
  9256. }
  9257. },
  9258. allowedRoles: [ 'link', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'radio', 'switch' ],
  9259. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  9260. },
  9261. radio: {
  9262. matches: {
  9263. properties: {
  9264. type: 'radio'
  9265. }
  9266. },
  9267. allowedRoles: [ 'menuitemradio' ],
  9268. implicitAttrs: {
  9269. 'aria-checked': 'false'
  9270. }
  9271. },
  9272. textWithList: {
  9273. matches: {
  9274. properties: {
  9275. type: 'text'
  9276. },
  9277. attributes: {
  9278. list: '/.*/'
  9279. }
  9280. },
  9281. allowedRoles: false
  9282. },
  9283. default: {
  9284. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9285. allowedRoles: [ 'combobox', 'searchbox', 'spinbutton' ],
  9286. implicitAttrs: {
  9287. 'aria-valuenow': ''
  9288. },
  9289. namingMethods: [ 'labelText', 'placeholderText' ]
  9290. }
  9291. }
  9292. },
  9293. ins: {
  9294. contentTypes: [ 'phrasing', 'flow' ],
  9295. allowedRoles: true
  9296. },
  9297. kbd: {
  9298. contentTypes: [ 'phrasing', 'flow' ],
  9299. allowedRoles: true
  9300. },
  9301. label: {
  9302. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9303. allowedRoles: false
  9304. },
  9305. legend: {
  9306. allowedRoles: false
  9307. },
  9308. li: {
  9309. allowedRoles: [ 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'none', 'presentation', 'radio', 'separator', 'tab', 'treeitem', 'doc-biblioentry', 'doc-endnote' ],
  9310. implicitAttrs: {
  9311. 'aria-setsize': '1',
  9312. 'aria-posinset': '1'
  9313. }
  9314. },
  9315. link: {
  9316. contentTypes: [ 'phrasing', 'flow' ],
  9317. allowedRoles: false,
  9318. noAriaAttrs: true
  9319. },
  9320. main: {
  9321. contentTypes: [ 'flow' ],
  9322. allowedRoles: false,
  9323. shadowRoot: true
  9324. },
  9325. map: {
  9326. contentTypes: [ 'phrasing', 'flow' ],
  9327. allowedRoles: false,
  9328. noAriaAttrs: true
  9329. },
  9330. math: {
  9331. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  9332. allowedRoles: false
  9333. },
  9334. mark: {
  9335. contentTypes: [ 'phrasing', 'flow' ],
  9336. allowedRoles: true
  9337. },
  9338. menu: {
  9339. contentTypes: [ 'flow' ],
  9340. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  9341. },
  9342. meta: {
  9343. variant: {
  9344. itemprop: {
  9345. matches: '[itemprop]',
  9346. contentTypes: [ 'phrasing', 'flow' ]
  9347. }
  9348. },
  9349. allowedRoles: false,
  9350. noAriaAttrs: true
  9351. },
  9352. meter: {
  9353. contentTypes: [ 'phrasing', 'flow' ],
  9354. allowedRoles: false
  9355. },
  9356. nav: {
  9357. contentTypes: [ 'sectioning', 'flow' ],
  9358. allowedRoles: [ 'doc-index', 'doc-pagelist', 'doc-toc' ],
  9359. shadowRoot: true
  9360. },
  9361. noscript: {
  9362. contentTypes: [ 'phrasing', 'flow' ],
  9363. allowedRoles: false,
  9364. noAriaAttrs: true
  9365. },
  9366. object: {
  9367. variant: {
  9368. usemap: {
  9369. matches: '[usemap]',
  9370. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  9371. },
  9372. default: {
  9373. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  9374. }
  9375. },
  9376. allowedRoles: [ 'application', 'document', 'img' ]
  9377. },
  9378. ol: {
  9379. contentTypes: [ 'flow' ],
  9380. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  9381. },
  9382. optgroup: {
  9383. allowedRoles: false
  9384. },
  9385. option: {
  9386. allowedRoles: false,
  9387. implicitAttrs: {
  9388. 'aria-selected': 'false'
  9389. }
  9390. },
  9391. output: {
  9392. contentTypes: [ 'phrasing', 'flow' ],
  9393. allowedRoles: true,
  9394. namingMethods: [ 'subtreeText' ]
  9395. },
  9396. p: {
  9397. contentTypes: [ 'flow' ],
  9398. allowedRoles: true,
  9399. shadowRoot: true
  9400. },
  9401. param: {
  9402. allowedRoles: false,
  9403. noAriaAttrs: true
  9404. },
  9405. picture: {
  9406. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  9407. allowedRoles: false,
  9408. noAriaAttrs: true
  9409. },
  9410. pre: {
  9411. contentTypes: [ 'flow' ],
  9412. allowedRoles: true
  9413. },
  9414. progress: {
  9415. contentTypes: [ 'phrasing', 'flow' ],
  9416. allowedRoles: true,
  9417. implicitAttrs: {
  9418. 'aria-valuemax': '100',
  9419. 'aria-valuemin': '0',
  9420. 'aria-valuenow': '0'
  9421. }
  9422. },
  9423. q: {
  9424. contentTypes: [ 'phrasing', 'flow' ],
  9425. allowedRoles: true
  9426. },
  9427. rp: {
  9428. allowedRoles: true
  9429. },
  9430. rt: {
  9431. allowedRoles: true
  9432. },
  9433. ruby: {
  9434. contentTypes: [ 'phrasing', 'flow' ],
  9435. allowedRoles: true
  9436. },
  9437. s: {
  9438. contentTypes: [ 'phrasing', 'flow' ],
  9439. allowedRoles: true
  9440. },
  9441. samp: {
  9442. contentTypes: [ 'phrasing', 'flow' ],
  9443. allowedRoles: true
  9444. },
  9445. script: {
  9446. contentTypes: [ 'phrasing', 'flow' ],
  9447. allowedRoles: false,
  9448. noAriaAttrs: true
  9449. },
  9450. section: {
  9451. contentTypes: [ 'sectioning', 'flow' ],
  9452. allowedRoles: [ 'alert', 'alertdialog', 'application', 'banner', 'complementary', 'contentinfo', 'dialog', 'document', 'feed', 'log', 'main', 'marquee', 'navigation', 'none', 'note', 'presentation', 'search', 'status', 'tabpanel', 'doc-abstract', 'doc-acknowledgments', 'doc-afterword', 'doc-appendix', 'doc-bibliography', 'doc-chapter', 'doc-colophon', 'doc-conclusion', 'doc-credit', 'doc-credits', 'doc-dedication', 'doc-endnotes', 'doc-epigraph', 'doc-epilogue', 'doc-errata', 'doc-example', 'doc-foreword', 'doc-glossary', 'doc-index', 'doc-introduction', 'doc-notice', 'doc-pagelist', 'doc-part', 'doc-preface', 'doc-prologue', 'doc-pullquote', 'doc-qna', 'doc-toc' ],
  9453. shadowRoot: true
  9454. },
  9455. select: {
  9456. variant: {
  9457. combobox: {
  9458. matches: {
  9459. attributes: {
  9460. multiple: null,
  9461. size: [ null, '1' ]
  9462. }
  9463. },
  9464. allowedRoles: [ 'menu' ]
  9465. },
  9466. default: {
  9467. allowedRoles: false
  9468. }
  9469. },
  9470. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9471. implicitAttrs: {
  9472. 'aria-valuenow': ''
  9473. },
  9474. namingMethods: [ 'labelText' ]
  9475. },
  9476. slot: {
  9477. contentTypes: [ 'phrasing', 'flow' ],
  9478. allowedRoles: false,
  9479. noAriaAttrs: true
  9480. },
  9481. small: {
  9482. contentTypes: [ 'phrasing', 'flow' ],
  9483. allowedRoles: true
  9484. },
  9485. source: {
  9486. allowedRoles: false,
  9487. noAriaAttrs: true
  9488. },
  9489. span: {
  9490. contentTypes: [ 'phrasing', 'flow' ],
  9491. allowedRoles: true,
  9492. shadowRoot: true
  9493. },
  9494. strong: {
  9495. contentTypes: [ 'phrasing', 'flow' ],
  9496. allowedRoles: true
  9497. },
  9498. style: {
  9499. allowedRoles: false,
  9500. noAriaAttrs: true
  9501. },
  9502. svg: {
  9503. contentTypes: [ 'embedded', 'phrasing', 'flow' ],
  9504. allowedRoles: [ 'application', 'document', 'img' ],
  9505. namingMethods: [ 'svgTitleText' ]
  9506. },
  9507. sub: {
  9508. contentTypes: [ 'phrasing', 'flow' ],
  9509. allowedRoles: true
  9510. },
  9511. summary: {
  9512. allowedRoles: false,
  9513. namingMethods: [ 'subtreeText' ]
  9514. },
  9515. sup: {
  9516. contentTypes: [ 'phrasing', 'flow' ],
  9517. allowedRoles: true
  9518. },
  9519. table: {
  9520. contentTypes: [ 'flow' ],
  9521. allowedRoles: true,
  9522. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  9523. },
  9524. tbody: {
  9525. allowedRoles: true
  9526. },
  9527. template: {
  9528. contentTypes: [ 'phrasing', 'flow' ],
  9529. allowedRoles: false,
  9530. noAriaAttrs: true
  9531. },
  9532. textarea: {
  9533. contentTypes: [ 'interactive', 'phrasing', 'flow' ],
  9534. allowedRoles: false,
  9535. implicitAttrs: {
  9536. 'aria-valuenow': '',
  9537. 'aria-multiline': 'true'
  9538. },
  9539. namingMethods: [ 'labelText', 'placeholderText' ]
  9540. },
  9541. tfoot: {
  9542. allowedRoles: true
  9543. },
  9544. thead: {
  9545. allowedRoles: true
  9546. },
  9547. time: {
  9548. contentTypes: [ 'phrasing', 'flow' ],
  9549. allowedRoles: true
  9550. },
  9551. title: {
  9552. allowedRoles: false,
  9553. noAriaAttrs: true
  9554. },
  9555. td: {
  9556. allowedRoles: true
  9557. },
  9558. th: {
  9559. allowedRoles: true
  9560. },
  9561. tr: {
  9562. allowedRoles: true
  9563. },
  9564. track: {
  9565. allowedRoles: false,
  9566. noAriaAttrs: true
  9567. },
  9568. u: {
  9569. contentTypes: [ 'phrasing', 'flow' ],
  9570. allowedRoles: true
  9571. },
  9572. ul: {
  9573. contentTypes: [ 'flow' ],
  9574. allowedRoles: [ 'directory', 'group', 'listbox', 'menu', 'menubar', 'none', 'presentation', 'radiogroup', 'tablist', 'toolbar', 'tree' ]
  9575. },
  9576. var: {
  9577. contentTypes: [ 'phrasing', 'flow' ],
  9578. allowedRoles: true
  9579. },
  9580. video: {
  9581. variant: {
  9582. controls: {
  9583. matches: '[controls]',
  9584. contentTypes: [ 'interactive', 'embedded', 'phrasing', 'flow' ]
  9585. },
  9586. default: {
  9587. contentTypes: [ 'embedded', 'phrasing', 'flow' ]
  9588. }
  9589. },
  9590. allowedRoles: [ 'application' ]
  9591. },
  9592. wbr: {
  9593. contentTypes: [ 'phrasing', 'flow' ],
  9594. allowedRoles: true
  9595. }
  9596. };
  9597. var html_elms_default = htmlElms;
  9598. var cssColors = {
  9599. aliceblue: [ 240, 248, 255 ],
  9600. antiquewhite: [ 250, 235, 215 ],
  9601. aqua: [ 0, 255, 255 ],
  9602. aquamarine: [ 127, 255, 212 ],
  9603. azure: [ 240, 255, 255 ],
  9604. beige: [ 245, 245, 220 ],
  9605. bisque: [ 255, 228, 196 ],
  9606. black: [ 0, 0, 0 ],
  9607. blanchedalmond: [ 255, 235, 205 ],
  9608. blue: [ 0, 0, 255 ],
  9609. blueviolet: [ 138, 43, 226 ],
  9610. brown: [ 165, 42, 42 ],
  9611. burlywood: [ 222, 184, 135 ],
  9612. cadetblue: [ 95, 158, 160 ],
  9613. chartreuse: [ 127, 255, 0 ],
  9614. chocolate: [ 210, 105, 30 ],
  9615. coral: [ 255, 127, 80 ],
  9616. cornflowerblue: [ 100, 149, 237 ],
  9617. cornsilk: [ 255, 248, 220 ],
  9618. crimson: [ 220, 20, 60 ],
  9619. cyan: [ 0, 255, 255 ],
  9620. darkblue: [ 0, 0, 139 ],
  9621. darkcyan: [ 0, 139, 139 ],
  9622. darkgoldenrod: [ 184, 134, 11 ],
  9623. darkgray: [ 169, 169, 169 ],
  9624. darkgreen: [ 0, 100, 0 ],
  9625. darkgrey: [ 169, 169, 169 ],
  9626. darkkhaki: [ 189, 183, 107 ],
  9627. darkmagenta: [ 139, 0, 139 ],
  9628. darkolivegreen: [ 85, 107, 47 ],
  9629. darkorange: [ 255, 140, 0 ],
  9630. darkorchid: [ 153, 50, 204 ],
  9631. darkred: [ 139, 0, 0 ],
  9632. darksalmon: [ 233, 150, 122 ],
  9633. darkseagreen: [ 143, 188, 143 ],
  9634. darkslateblue: [ 72, 61, 139 ],
  9635. darkslategray: [ 47, 79, 79 ],
  9636. darkslategrey: [ 47, 79, 79 ],
  9637. darkturquoise: [ 0, 206, 209 ],
  9638. darkviolet: [ 148, 0, 211 ],
  9639. deeppink: [ 255, 20, 147 ],
  9640. deepskyblue: [ 0, 191, 255 ],
  9641. dimgray: [ 105, 105, 105 ],
  9642. dimgrey: [ 105, 105, 105 ],
  9643. dodgerblue: [ 30, 144, 255 ],
  9644. firebrick: [ 178, 34, 34 ],
  9645. floralwhite: [ 255, 250, 240 ],
  9646. forestgreen: [ 34, 139, 34 ],
  9647. fuchsia: [ 255, 0, 255 ],
  9648. gainsboro: [ 220, 220, 220 ],
  9649. ghostwhite: [ 248, 248, 255 ],
  9650. gold: [ 255, 215, 0 ],
  9651. goldenrod: [ 218, 165, 32 ],
  9652. gray: [ 128, 128, 128 ],
  9653. green: [ 0, 128, 0 ],
  9654. greenyellow: [ 173, 255, 47 ],
  9655. grey: [ 128, 128, 128 ],
  9656. honeydew: [ 240, 255, 240 ],
  9657. hotpink: [ 255, 105, 180 ],
  9658. indianred: [ 205, 92, 92 ],
  9659. indigo: [ 75, 0, 130 ],
  9660. ivory: [ 255, 255, 240 ],
  9661. khaki: [ 240, 230, 140 ],
  9662. lavender: [ 230, 230, 250 ],
  9663. lavenderblush: [ 255, 240, 245 ],
  9664. lawngreen: [ 124, 252, 0 ],
  9665. lemonchiffon: [ 255, 250, 205 ],
  9666. lightblue: [ 173, 216, 230 ],
  9667. lightcoral: [ 240, 128, 128 ],
  9668. lightcyan: [ 224, 255, 255 ],
  9669. lightgoldenrodyellow: [ 250, 250, 210 ],
  9670. lightgray: [ 211, 211, 211 ],
  9671. lightgreen: [ 144, 238, 144 ],
  9672. lightgrey: [ 211, 211, 211 ],
  9673. lightpink: [ 255, 182, 193 ],
  9674. lightsalmon: [ 255, 160, 122 ],
  9675. lightseagreen: [ 32, 178, 170 ],
  9676. lightskyblue: [ 135, 206, 250 ],
  9677. lightslategray: [ 119, 136, 153 ],
  9678. lightslategrey: [ 119, 136, 153 ],
  9679. lightsteelblue: [ 176, 196, 222 ],
  9680. lightyellow: [ 255, 255, 224 ],
  9681. lime: [ 0, 255, 0 ],
  9682. limegreen: [ 50, 205, 50 ],
  9683. linen: [ 250, 240, 230 ],
  9684. magenta: [ 255, 0, 255 ],
  9685. maroon: [ 128, 0, 0 ],
  9686. mediumaquamarine: [ 102, 205, 170 ],
  9687. mediumblue: [ 0, 0, 205 ],
  9688. mediumorchid: [ 186, 85, 211 ],
  9689. mediumpurple: [ 147, 112, 219 ],
  9690. mediumseagreen: [ 60, 179, 113 ],
  9691. mediumslateblue: [ 123, 104, 238 ],
  9692. mediumspringgreen: [ 0, 250, 154 ],
  9693. mediumturquoise: [ 72, 209, 204 ],
  9694. mediumvioletred: [ 199, 21, 133 ],
  9695. midnightblue: [ 25, 25, 112 ],
  9696. mintcream: [ 245, 255, 250 ],
  9697. mistyrose: [ 255, 228, 225 ],
  9698. moccasin: [ 255, 228, 181 ],
  9699. navajowhite: [ 255, 222, 173 ],
  9700. navy: [ 0, 0, 128 ],
  9701. oldlace: [ 253, 245, 230 ],
  9702. olive: [ 128, 128, 0 ],
  9703. olivedrab: [ 107, 142, 35 ],
  9704. orange: [ 255, 165, 0 ],
  9705. orangered: [ 255, 69, 0 ],
  9706. orchid: [ 218, 112, 214 ],
  9707. palegoldenrod: [ 238, 232, 170 ],
  9708. palegreen: [ 152, 251, 152 ],
  9709. paleturquoise: [ 175, 238, 238 ],
  9710. palevioletred: [ 219, 112, 147 ],
  9711. papayawhip: [ 255, 239, 213 ],
  9712. peachpuff: [ 255, 218, 185 ],
  9713. peru: [ 205, 133, 63 ],
  9714. pink: [ 255, 192, 203 ],
  9715. plum: [ 221, 160, 221 ],
  9716. powderblue: [ 176, 224, 230 ],
  9717. purple: [ 128, 0, 128 ],
  9718. rebeccapurple: [ 102, 51, 153 ],
  9719. red: [ 255, 0, 0 ],
  9720. rosybrown: [ 188, 143, 143 ],
  9721. royalblue: [ 65, 105, 225 ],
  9722. saddlebrown: [ 139, 69, 19 ],
  9723. salmon: [ 250, 128, 114 ],
  9724. sandybrown: [ 244, 164, 96 ],
  9725. seagreen: [ 46, 139, 87 ],
  9726. seashell: [ 255, 245, 238 ],
  9727. sienna: [ 160, 82, 45 ],
  9728. silver: [ 192, 192, 192 ],
  9729. skyblue: [ 135, 206, 235 ],
  9730. slateblue: [ 106, 90, 205 ],
  9731. slategray: [ 112, 128, 144 ],
  9732. slategrey: [ 112, 128, 144 ],
  9733. snow: [ 255, 250, 250 ],
  9734. springgreen: [ 0, 255, 127 ],
  9735. steelblue: [ 70, 130, 180 ],
  9736. tan: [ 210, 180, 140 ],
  9737. teal: [ 0, 128, 128 ],
  9738. thistle: [ 216, 191, 216 ],
  9739. tomato: [ 255, 99, 71 ],
  9740. turquoise: [ 64, 224, 208 ],
  9741. violet: [ 238, 130, 238 ],
  9742. wheat: [ 245, 222, 179 ],
  9743. white: [ 255, 255, 255 ],
  9744. whitesmoke: [ 245, 245, 245 ],
  9745. yellow: [ 255, 255, 0 ],
  9746. yellowgreen: [ 154, 205, 50 ]
  9747. };
  9748. var css_colors_default = cssColors;
  9749. var originals = {
  9750. ariaAttrs: aria_attrs_default,
  9751. ariaRoles: _extends({}, aria_roles_default, dpub_roles_default),
  9752. htmlElms: html_elms_default,
  9753. cssColors: css_colors_default
  9754. };
  9755. var standards = _extends({}, originals);
  9756. function configureStandards(config) {
  9757. Object.keys(standards).forEach(function(propName) {
  9758. if (config[propName]) {
  9759. standards[propName] = deep_merge_default(standards[propName], config[propName]);
  9760. }
  9761. });
  9762. }
  9763. function resetStandards() {
  9764. Object.keys(standards).forEach(function(propName) {
  9765. standards[propName] = originals[propName];
  9766. });
  9767. }
  9768. var standards_default = standards;
  9769. function convertColorVal(colorFunc, value, index) {
  9770. if (/%$/.test(value)) {
  9771. if (index === 3) {
  9772. return parseFloat(value) / 100;
  9773. }
  9774. return parseFloat(value) * 255 / 100;
  9775. }
  9776. if (colorFunc[index] === 'h') {
  9777. if (/turn$/.test(value)) {
  9778. return parseFloat(value) * 360;
  9779. }
  9780. if (/rad$/.test(value)) {
  9781. return parseFloat(value) * 57.3;
  9782. }
  9783. }
  9784. return parseFloat(value);
  9785. }
  9786. function hslToRgb(_ref15) {
  9787. var _ref16 = _slicedToArray(_ref15, 4), hue = _ref16[0], saturation = _ref16[1], lightness = _ref16[2], alpha = _ref16[3];
  9788. saturation /= 255;
  9789. lightness /= 255;
  9790. var high = (1 - Math.abs(2 * lightness - 1)) * saturation;
  9791. var low = high * (1 - Math.abs(hue / 60 % 2 - 1));
  9792. var base = lightness - high / 2;
  9793. var colors;
  9794. if (hue < 60) {
  9795. colors = [ high, low, 0 ];
  9796. } else if (hue < 120) {
  9797. colors = [ low, high, 0 ];
  9798. } else if (hue < 180) {
  9799. colors = [ 0, high, low ];
  9800. } else if (hue < 240) {
  9801. colors = [ 0, low, high ];
  9802. } else if (hue < 300) {
  9803. colors = [ low, 0, high ];
  9804. } else {
  9805. colors = [ high, 0, low ];
  9806. }
  9807. return colors.map(function(color10) {
  9808. return Math.round((color10 + base) * 255);
  9809. }).concat(alpha);
  9810. }
  9811. function Color(red, green, blue, alpha) {
  9812. this.red = red;
  9813. this.green = green;
  9814. this.blue = blue;
  9815. this.alpha = alpha;
  9816. this.toHexString = function() {
  9817. var redString = Math.round(this.red).toString(16);
  9818. var greenString = Math.round(this.green).toString(16);
  9819. var blueString = Math.round(this.blue).toString(16);
  9820. return '#' + (this.red > 15.5 ? redString : '0' + redString) + (this.green > 15.5 ? greenString : '0' + greenString) + (this.blue > 15.5 ? blueString : '0' + blueString);
  9821. };
  9822. var hexRegex = /^#[0-9a-f]{3,8}$/i;
  9823. var colorFnRegex = /^((?:rgb|hsl)a?)\s*\(([^\)]*)\)/i;
  9824. this.parseString = function(colorString) {
  9825. if (standards_default.cssColors[colorString] || colorString === 'transparent') {
  9826. var _ref17 = standards_default.cssColors[colorString] || [ 0, 0, 0 ], _ref18 = _slicedToArray(_ref17, 3), red2 = _ref18[0], green2 = _ref18[1], blue2 = _ref18[2];
  9827. this.red = red2;
  9828. this.green = green2;
  9829. this.blue = blue2;
  9830. this.alpha = colorString === 'transparent' ? 0 : 1;
  9831. return;
  9832. }
  9833. if (colorString.match(colorFnRegex)) {
  9834. this.parseColorFnString(colorString);
  9835. return;
  9836. }
  9837. if (colorString.match(hexRegex)) {
  9838. this.parseHexString(colorString);
  9839. return;
  9840. }
  9841. throw new Error('Unable to parse color "'.concat(colorString, '"'));
  9842. };
  9843. this.parseRgbString = function(colorString) {
  9844. if (colorString === 'transparent') {
  9845. this.red = 0;
  9846. this.green = 0;
  9847. this.blue = 0;
  9848. this.alpha = 0;
  9849. return;
  9850. }
  9851. this.parseColorFnString(colorString);
  9852. };
  9853. this.parseHexString = function(colorString) {
  9854. if (!colorString.match(hexRegex) || [ 6, 8 ].includes(colorString.length)) {
  9855. return;
  9856. }
  9857. colorString = colorString.replace('#', '');
  9858. if (colorString.length < 6) {
  9859. var _colorString = colorString, _colorString2 = _slicedToArray(_colorString, 4), r = _colorString2[0], g = _colorString2[1], b = _colorString2[2], a = _colorString2[3];
  9860. colorString = r + r + g + g + b + b;
  9861. if (a) {
  9862. colorString += a + a;
  9863. }
  9864. }
  9865. var aRgbHex = colorString.match(/.{1,2}/g);
  9866. this.red = parseInt(aRgbHex[0], 16);
  9867. this.green = parseInt(aRgbHex[1], 16);
  9868. this.blue = parseInt(aRgbHex[2], 16);
  9869. if (aRgbHex[3]) {
  9870. this.alpha = parseInt(aRgbHex[3], 16) / 255;
  9871. } else {
  9872. this.alpha = 1;
  9873. }
  9874. };
  9875. this.parseColorFnString = function parseColorFnString(colorString) {
  9876. var _ref19 = colorString.match(colorFnRegex) || [], _ref20 = _slicedToArray(_ref19, 3), colorFunc = _ref20[1], colorValStr = _ref20[2];
  9877. if (!colorFunc || !colorValStr) {
  9878. return;
  9879. }
  9880. var colorVals = colorValStr.split(/\s*[,\/\s]\s*/).map(function(str) {
  9881. return str.replace(',', '').trim();
  9882. }).filter(function(str) {
  9883. return str !== '';
  9884. });
  9885. var colorNums = colorVals.map(function(val, index) {
  9886. return convertColorVal(colorFunc, val, index);
  9887. });
  9888. if (colorFunc.substr(0, 3) === 'hsl') {
  9889. colorNums = hslToRgb(colorNums);
  9890. }
  9891. this.red = colorNums[0];
  9892. this.green = colorNums[1];
  9893. this.blue = colorNums[2];
  9894. this.alpha = typeof colorNums[3] === 'number' ? colorNums[3] : 1;
  9895. };
  9896. this.getRelativeLuminance = function() {
  9897. var rSRGB = this.red / 255;
  9898. var gSRGB = this.green / 255;
  9899. var bSRGB = this.blue / 255;
  9900. var r = rSRGB <= .03928 ? rSRGB / 12.92 : Math.pow((rSRGB + .055) / 1.055, 2.4);
  9901. var g = gSRGB <= .03928 ? gSRGB / 12.92 : Math.pow((gSRGB + .055) / 1.055, 2.4);
  9902. var b = bSRGB <= .03928 ? bSRGB / 12.92 : Math.pow((bSRGB + .055) / 1.055, 2.4);
  9903. return .2126 * r + .7152 * g + .0722 * b;
  9904. };
  9905. }
  9906. var color_default = Color;
  9907. function getOwnBackgroundColor(elmStyle) {
  9908. var bgColor = new color_default();
  9909. bgColor.parseString(elmStyle.getPropertyValue('background-color'));
  9910. if (bgColor.alpha !== 0) {
  9911. var opacity = elmStyle.getPropertyValue('opacity');
  9912. bgColor.alpha = bgColor.alpha * opacity;
  9913. }
  9914. return bgColor;
  9915. }
  9916. var get_own_background_color_default = getOwnBackgroundColor;
  9917. function isOpaque(node) {
  9918. var style = window.getComputedStyle(node);
  9919. return element_has_image_default(node, style) || get_own_background_color_default(style).alpha === 1;
  9920. }
  9921. var is_opaque_default = isOpaque;
  9922. var isInternalLinkRegex = /^\/?#[^/!]/;
  9923. function isSkipLink(element) {
  9924. if (!isInternalLinkRegex.test(element.getAttribute('href'))) {
  9925. return false;
  9926. }
  9927. var firstPageLink;
  9928. if (typeof cache_default.get('firstPageLink') !== 'undefined') {
  9929. firstPageLink = cache_default.get('firstPageLink');
  9930. } else {
  9931. firstPageLink = query_selector_all_default(axe._tree, 'a:not([href^="#"]):not([href^="/#"]):not([href^="javascript"])')[0];
  9932. cache_default.set('firstPageLink', firstPageLink || null);
  9933. }
  9934. if (!firstPageLink) {
  9935. return true;
  9936. }
  9937. return element.compareDocumentPosition(firstPageLink.actualNode) === element.DOCUMENT_POSITION_FOLLOWING;
  9938. }
  9939. var is_skip_link_default = isSkipLink;
  9940. function reduceToElementsBelowFloating(elements, targetNode) {
  9941. var floatingPositions = [ 'fixed', 'sticky' ];
  9942. var finalElements = [];
  9943. var targetFound = false;
  9944. for (var index = 0; index < elements.length; ++index) {
  9945. var currentNode = elements[index];
  9946. if (currentNode === targetNode) {
  9947. targetFound = true;
  9948. }
  9949. var style = window.getComputedStyle(currentNode);
  9950. if (!targetFound && floatingPositions.indexOf(style.position) !== -1) {
  9951. finalElements = [];
  9952. continue;
  9953. }
  9954. finalElements.push(currentNode);
  9955. }
  9956. return finalElements;
  9957. }
  9958. var reduce_to_elements_below_floating_default = reduceToElementsBelowFloating;
  9959. function getScrollAncestor(node) {
  9960. var vNode = get_node_from_tree_default(node);
  9961. var ancestor = vNode.parent;
  9962. while (ancestor) {
  9963. if (get_scroll_default(ancestor.actualNode)) {
  9964. return ancestor.actualNode;
  9965. }
  9966. ancestor = ancestor.parent;
  9967. }
  9968. }
  9969. function contains2(node, parent) {
  9970. var rectBound = node.getBoundingClientRect();
  9971. var margin = .01;
  9972. var rect = {
  9973. top: rectBound.top + margin,
  9974. bottom: rectBound.bottom - margin,
  9975. left: rectBound.left + margin,
  9976. right: rectBound.right - margin
  9977. };
  9978. var parentRect = parent.getBoundingClientRect();
  9979. var parentTop = parentRect.top;
  9980. var parentLeft = parentRect.left;
  9981. var parentScrollArea = {
  9982. top: parentTop - parent.scrollTop,
  9983. bottom: parentTop - parent.scrollTop + parent.scrollHeight,
  9984. left: parentLeft - parent.scrollLeft,
  9985. right: parentLeft - parent.scrollLeft + parent.scrollWidth
  9986. };
  9987. var style = window.getComputedStyle(parent);
  9988. if (style.getPropertyValue('display') === 'inline') {
  9989. return true;
  9990. }
  9991. if (rect.left < parentScrollArea.left && rect.left < parentRect.left || rect.top < parentScrollArea.top && rect.top < parentRect.top || rect.right > parentScrollArea.right && rect.right > parentRect.right || rect.bottom > parentScrollArea.bottom && rect.bottom > parentRect.bottom) {
  9992. return false;
  9993. }
  9994. if (rect.right > parentRect.right || rect.bottom > parentRect.bottom) {
  9995. return style.overflow === 'scroll' || style.overflow === 'auto' || style.overflow === 'hidden' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
  9996. }
  9997. return true;
  9998. }
  9999. function visuallyContains(node, parent) {
  10000. var parentScrollAncestor = getScrollAncestor(parent);
  10001. do {
  10002. var nextScrollAncestor = getScrollAncestor(node);
  10003. if (nextScrollAncestor === parentScrollAncestor || nextScrollAncestor === parent) {
  10004. return contains2(node, parent);
  10005. }
  10006. node = nextScrollAncestor;
  10007. } while (node);
  10008. return false;
  10009. }
  10010. var visually_contains_default = visuallyContains;
  10011. function shadowElementsFromPoint(nodeX, nodeY) {
  10012. var root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
  10013. var i = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
  10014. if (i > 999) {
  10015. throw new Error('Infinite loop detected');
  10016. }
  10017. return Array.from(root.elementsFromPoint(nodeX, nodeY) || []).filter(function(nodes) {
  10018. return get_root_node_default2(nodes) === root;
  10019. }).reduce(function(stack, elm) {
  10020. if (is_shadow_root_default(elm)) {
  10021. var shadowStack = shadowElementsFromPoint(nodeX, nodeY, elm.shadowRoot, i + 1);
  10022. stack = stack.concat(shadowStack);
  10023. if (stack.length && visually_contains_default(stack[0], elm)) {
  10024. stack.push(elm);
  10025. }
  10026. } else {
  10027. stack.push(elm);
  10028. }
  10029. return stack;
  10030. }, []);
  10031. }
  10032. var shadow_elements_from_point_default = shadowElementsFromPoint;
  10033. function urlPropsFromAttribute(node, attribute) {
  10034. if (!node.hasAttribute(attribute)) {
  10035. return void 0;
  10036. }
  10037. var nodeName2 = node.nodeName.toUpperCase();
  10038. var parser2 = node;
  10039. if (![ 'A', 'AREA' ].includes(nodeName2) || node.ownerSVGElement) {
  10040. parser2 = document.createElement('a');
  10041. parser2.href = node.getAttribute(attribute);
  10042. }
  10043. var protocol = [ 'https:', 'ftps:' ].includes(parser2.protocol) ? parser2.protocol.replace(/s:$/, ':') : parser2.protocol;
  10044. var parserPathname = /^\//.test(parser2.pathname) ? parser2.pathname : '/'.concat(parser2.pathname);
  10045. var _getPathnameOrFilenam = getPathnameOrFilename(parserPathname), pathname = _getPathnameOrFilenam.pathname, filename = _getPathnameOrFilenam.filename;
  10046. return {
  10047. protocol: protocol,
  10048. hostname: parser2.hostname,
  10049. port: getPort(parser2.port),
  10050. pathname: /\/$/.test(pathname) ? pathname : ''.concat(pathname, '/'),
  10051. search: getSearchPairs(parser2.search),
  10052. hash: getHashRoute(parser2.hash),
  10053. filename: filename
  10054. };
  10055. }
  10056. function getPort(port) {
  10057. var excludePorts = [ '443', '80' ];
  10058. return !excludePorts.includes(port) ? port : '';
  10059. }
  10060. function getPathnameOrFilename(pathname) {
  10061. var filename = pathname.split('/').pop();
  10062. if (!filename || filename.indexOf('.') === -1) {
  10063. return {
  10064. pathname: pathname,
  10065. filename: ''
  10066. };
  10067. }
  10068. return {
  10069. pathname: pathname.replace(filename, ''),
  10070. filename: /index./.test(filename) ? '' : filename
  10071. };
  10072. }
  10073. function getSearchPairs(searchStr) {
  10074. var query = {};
  10075. if (!searchStr || !searchStr.length) {
  10076. return query;
  10077. }
  10078. var pairs = searchStr.substring(1).split('&');
  10079. if (!pairs || !pairs.length) {
  10080. return query;
  10081. }
  10082. for (var index = 0; index < pairs.length; index++) {
  10083. var pair = pairs[index];
  10084. var _pair$split = pair.split('='), _pair$split2 = _slicedToArray(_pair$split, 2), key = _pair$split2[0], _pair$split2$ = _pair$split2[1], value = _pair$split2$ === void 0 ? '' : _pair$split2$;
  10085. query[decodeURIComponent(key)] = decodeURIComponent(value);
  10086. }
  10087. return query;
  10088. }
  10089. function getHashRoute(hash) {
  10090. if (!hash) {
  10091. return '';
  10092. }
  10093. var hashRegex = /#!?\/?/g;
  10094. var hasMatch = hash.match(hashRegex);
  10095. if (!hasMatch) {
  10096. return '';
  10097. }
  10098. var _hasMatch = _slicedToArray(hasMatch, 1), matchedStr = _hasMatch[0];
  10099. if (matchedStr === '#') {
  10100. return '';
  10101. }
  10102. return hash;
  10103. }
  10104. var url_props_from_attribute_default = urlPropsFromAttribute;
  10105. function visuallyOverlaps(rect, parent) {
  10106. var parentRect = parent.getBoundingClientRect();
  10107. var parentTop = parentRect.top;
  10108. var parentLeft = parentRect.left;
  10109. var parentScrollArea = {
  10110. top: parentTop - parent.scrollTop,
  10111. bottom: parentTop - parent.scrollTop + parent.scrollHeight,
  10112. left: parentLeft - parent.scrollLeft,
  10113. right: parentLeft - parent.scrollLeft + parent.scrollWidth
  10114. };
  10115. if (rect.left > parentScrollArea.right && rect.left > parentRect.right || rect.top > parentScrollArea.bottom && rect.top > parentRect.bottom || rect.right < parentScrollArea.left && rect.right < parentRect.left || rect.bottom < parentScrollArea.top && rect.bottom < parentRect.top) {
  10116. return false;
  10117. }
  10118. var style = window.getComputedStyle(parent);
  10119. if (rect.left > parentRect.right || rect.top > parentRect.bottom) {
  10120. return style.overflow === 'scroll' || style.overflow === 'auto' || parent instanceof window.HTMLBodyElement || parent instanceof window.HTMLHtmlElement;
  10121. }
  10122. return true;
  10123. }
  10124. var visually_overlaps_default = visuallyOverlaps;
  10125. var isXHTMLGlobal;
  10126. var VirtualNode = function(_abstract_virtual_nod) {
  10127. _inherits(VirtualNode, _abstract_virtual_nod);
  10128. var _super = _createSuper(VirtualNode);
  10129. function VirtualNode(node, parent, shadowId) {
  10130. var _this;
  10131. _classCallCheck(this, VirtualNode);
  10132. _this = _super.call(this);
  10133. _this.shadowId = shadowId;
  10134. _this.children = [];
  10135. _this.actualNode = node;
  10136. _this.parent = parent;
  10137. _this._isHidden = null;
  10138. _this._cache = {};
  10139. if (typeof isXHTMLGlobal === 'undefined') {
  10140. isXHTMLGlobal = is_xhtml_default(node.ownerDocument);
  10141. }
  10142. _this._isXHTML = isXHTMLGlobal;
  10143. if (node.nodeName.toLowerCase() === 'input') {
  10144. var type = node.getAttribute('type');
  10145. type = _this._isXHTML ? type : (type || '').toLowerCase();
  10146. if (!valid_input_type_default().includes(type)) {
  10147. type = 'text';
  10148. }
  10149. _this._type = type;
  10150. }
  10151. if (cache_default.get('nodeMap')) {
  10152. cache_default.get('nodeMap').set(node, _assertThisInitialized(_this));
  10153. }
  10154. return _this;
  10155. }
  10156. _createClass(VirtualNode, [ {
  10157. key: 'attr',
  10158. value: function attr(attrName) {
  10159. if (typeof this.actualNode.getAttribute !== 'function') {
  10160. return null;
  10161. }
  10162. return this.actualNode.getAttribute(attrName);
  10163. }
  10164. }, {
  10165. key: 'hasAttr',
  10166. value: function hasAttr(attrName) {
  10167. if (typeof this.actualNode.hasAttribute !== 'function') {
  10168. return false;
  10169. }
  10170. return this.actualNode.hasAttribute(attrName);
  10171. }
  10172. }, {
  10173. key: 'getComputedStylePropertyValue',
  10174. value: function getComputedStylePropertyValue(property) {
  10175. var key = 'computedStyle_' + property;
  10176. if (!this._cache.hasOwnProperty(key)) {
  10177. if (!this._cache.hasOwnProperty('computedStyle')) {
  10178. this._cache.computedStyle = window.getComputedStyle(this.actualNode);
  10179. }
  10180. this._cache[key] = this._cache.computedStyle.getPropertyValue(property);
  10181. }
  10182. return this._cache[key];
  10183. }
  10184. }, {
  10185. key: 'props',
  10186. get: function get() {
  10187. var _this$actualNode = this.actualNode, nodeType = _this$actualNode.nodeType, nodeName2 = _this$actualNode.nodeName, id = _this$actualNode.id, multiple = _this$actualNode.multiple, nodeValue = _this$actualNode.nodeValue, value = _this$actualNode.value;
  10188. return {
  10189. nodeType: nodeType,
  10190. nodeName: this._isXHTML ? nodeName2 : nodeName2.toLowerCase(),
  10191. id: id,
  10192. type: this._type,
  10193. multiple: multiple,
  10194. nodeValue: nodeValue,
  10195. value: value
  10196. };
  10197. }
  10198. }, {
  10199. key: 'isFocusable',
  10200. get: function get() {
  10201. if (!this._cache.hasOwnProperty('isFocusable')) {
  10202. this._cache.isFocusable = is_focusable_default(this.actualNode);
  10203. }
  10204. return this._cache.isFocusable;
  10205. }
  10206. }, {
  10207. key: 'tabbableElements',
  10208. get: function get() {
  10209. if (!this._cache.hasOwnProperty('tabbableElements')) {
  10210. this._cache.tabbableElements = get_tabbable_elements_default(this);
  10211. }
  10212. return this._cache.tabbableElements;
  10213. }
  10214. }, {
  10215. key: 'clientRects',
  10216. get: function get() {
  10217. if (!this._cache.hasOwnProperty('clientRects')) {
  10218. this._cache.clientRects = Array.from(this.actualNode.getClientRects()).filter(function(rect) {
  10219. return rect.width > 0;
  10220. });
  10221. }
  10222. return this._cache.clientRects;
  10223. }
  10224. }, {
  10225. key: 'boundingClientRect',
  10226. get: function get() {
  10227. if (!this._cache.hasOwnProperty('boundingClientRect')) {
  10228. this._cache.boundingClientRect = this.actualNode.getBoundingClientRect();
  10229. }
  10230. return this._cache.boundingClientRect;
  10231. }
  10232. } ]);
  10233. return VirtualNode;
  10234. }(abstract_virtual_node_default);
  10235. var virtual_node_default = VirtualNode;
  10236. function getSlotChildren(node) {
  10237. var retVal = [];
  10238. node = node.firstChild;
  10239. while (node) {
  10240. retVal.push(node);
  10241. node = node.nextSibling;
  10242. }
  10243. return retVal;
  10244. }
  10245. function flattenTree(node, shadowId, parent) {
  10246. var retVal, realArray, nodeName2;
  10247. function reduceShadowDOM(res, child, parent2) {
  10248. var replacements = flattenTree(child, shadowId, parent2);
  10249. if (replacements) {
  10250. res = res.concat(replacements);
  10251. }
  10252. return res;
  10253. }
  10254. if (node.documentElement) {
  10255. node = node.documentElement;
  10256. }
  10257. nodeName2 = node.nodeName.toLowerCase();
  10258. if (is_shadow_root_default(node)) {
  10259. retVal = new virtual_node_default(node, parent, shadowId);
  10260. shadowId = 'a' + Math.random().toString().substring(2);
  10261. realArray = Array.from(node.shadowRoot.childNodes);
  10262. retVal.children = realArray.reduce(function(res, child) {
  10263. return reduceShadowDOM(res, child, retVal);
  10264. }, []);
  10265. return [ retVal ];
  10266. } else {
  10267. if (nodeName2 === 'content' && typeof node.getDistributedNodes === 'function') {
  10268. realArray = Array.from(node.getDistributedNodes());
  10269. return realArray.reduce(function(res, child) {
  10270. return reduceShadowDOM(res, child, parent);
  10271. }, []);
  10272. } else if (nodeName2 === 'slot' && typeof node.assignedNodes === 'function') {
  10273. realArray = Array.from(node.assignedNodes());
  10274. if (!realArray.length) {
  10275. realArray = getSlotChildren(node);
  10276. }
  10277. var styl = window.getComputedStyle(node);
  10278. if (false) {
  10279. retVal = new virtual_node_default(node, parent, shadowId);
  10280. retVal.children = realArray.reduce(function(res, child) {
  10281. return reduceShadowDOM(res, child, retVal);
  10282. }, []);
  10283. return [ retVal ];
  10284. } else {
  10285. return realArray.reduce(function(res, child) {
  10286. return reduceShadowDOM(res, child, parent);
  10287. }, []);
  10288. }
  10289. } else {
  10290. if (node.nodeType === 1) {
  10291. retVal = new virtual_node_default(node, parent, shadowId);
  10292. realArray = Array.from(node.childNodes);
  10293. retVal.children = realArray.reduce(function(res, child) {
  10294. return reduceShadowDOM(res, child, retVal);
  10295. }, []);
  10296. return [ retVal ];
  10297. } else if (node.nodeType === 3) {
  10298. return [ new virtual_node_default(node, parent) ];
  10299. }
  10300. return void 0;
  10301. }
  10302. }
  10303. }
  10304. function getFlattenedTree() {
  10305. var node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.documentElement;
  10306. var shadowId = arguments.length > 1 ? arguments[1] : undefined;
  10307. cache_default.set('nodeMap', new WeakMap());
  10308. return flattenTree(node, shadowId, null);
  10309. }
  10310. var get_flattened_tree_default = getFlattenedTree;
  10311. function getBaseLang(lang) {
  10312. if (!lang) {
  10313. return '';
  10314. }
  10315. return lang.trim().split('-')[0].toLowerCase();
  10316. }
  10317. var get_base_lang_default = getBaseLang;
  10318. function failureSummary(nodeData) {
  10319. var failingChecks = {};
  10320. failingChecks.none = nodeData.none.concat(nodeData.all);
  10321. failingChecks.any = nodeData.any;
  10322. return Object.keys(failingChecks).map(function(key) {
  10323. if (!failingChecks[key].length) {
  10324. return;
  10325. }
  10326. var sum = axe._audit.data.failureSummaries[key];
  10327. if (sum && typeof sum.failureMessage === 'function') {
  10328. return sum.failureMessage(failingChecks[key].map(function(check4) {
  10329. return check4.message || '';
  10330. }));
  10331. }
  10332. }).filter(function(i) {
  10333. return i !== void 0;
  10334. }).join('\n\n');
  10335. }
  10336. var failure_summary_default = failureSummary;
  10337. function getEnvironmentData() {
  10338. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  10339. var _win$screen = win.screen, screen = _win$screen === void 0 ? {} : _win$screen, _win$navigator = win.navigator, navigator = _win$navigator === void 0 ? {} : _win$navigator, _win$location = win.location, location = _win$location === void 0 ? {} : _win$location, innerHeight = win.innerHeight, innerWidth = win.innerWidth;
  10340. var orientation = screen.msOrientation || screen.orientation || screen.mozOrientation || {};
  10341. return {
  10342. testEngine: {
  10343. name: 'axe-core',
  10344. version: axe.version
  10345. },
  10346. testRunner: {
  10347. name: axe._audit.brand
  10348. },
  10349. testEnvironment: {
  10350. userAgent: navigator.userAgent,
  10351. windowWidth: innerWidth,
  10352. windowHeight: innerHeight,
  10353. orientationAngle: orientation.angle,
  10354. orientationType: orientation.type
  10355. },
  10356. timestamp: new Date().toISOString(),
  10357. url: location.href
  10358. };
  10359. }
  10360. var get_environment_data_default = getEnvironmentData;
  10361. function incompleteFallbackMessage() {
  10362. return typeof axe._audit.data.incompleteFallbackMessage === 'function' ? axe._audit.data.incompleteFallbackMessage() : axe._audit.data.incompleteFallbackMessage;
  10363. }
  10364. var incomplete_fallback_msg_default = incompleteFallbackMessage;
  10365. function normalizeRelatedNodes(node, options) {
  10366. [ 'any', 'all', 'none' ].forEach(function(type) {
  10367. if (!Array.isArray(node[type])) {
  10368. return;
  10369. }
  10370. node[type].filter(function(checkRes) {
  10371. return Array.isArray(checkRes.relatedNodes);
  10372. }).forEach(function(checkRes) {
  10373. checkRes.relatedNodes = checkRes.relatedNodes.map(function(relatedNode) {
  10374. var res = {
  10375. html: relatedNode.source
  10376. };
  10377. if (options.elementRef && !relatedNode.fromFrame) {
  10378. res.element = relatedNode.element;
  10379. }
  10380. if (options.selectors !== false || relatedNode.fromFrame) {
  10381. res.target = relatedNode.selector;
  10382. }
  10383. if (options.ancestry) {
  10384. res.ancestry = relatedNode.ancestry;
  10385. }
  10386. if (options.xpath) {
  10387. res.xpath = relatedNode.xpath;
  10388. }
  10389. return res;
  10390. });
  10391. });
  10392. });
  10393. }
  10394. var resultKeys = constants_default.resultGroups;
  10395. function processAggregate(results, options) {
  10396. var resultObject = axe.utils.aggregateResult(results);
  10397. resultKeys.forEach(function(key) {
  10398. if (options.resultTypes && !options.resultTypes.includes(key)) {
  10399. (resultObject[key] || []).forEach(function(ruleResult) {
  10400. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  10401. ruleResult.nodes = [ ruleResult.nodes[0] ];
  10402. }
  10403. });
  10404. }
  10405. resultObject[key] = (resultObject[key] || []).map(function(ruleResult) {
  10406. ruleResult = Object.assign({}, ruleResult);
  10407. if (Array.isArray(ruleResult.nodes) && ruleResult.nodes.length > 0) {
  10408. ruleResult.nodes = ruleResult.nodes.map(function(subResult) {
  10409. if (_typeof(subResult.node) === 'object') {
  10410. subResult.html = subResult.node.source;
  10411. if (options.elementRef && !subResult.node.fromFrame) {
  10412. subResult.element = subResult.node.element;
  10413. }
  10414. if (options.selectors !== false || subResult.node.fromFrame) {
  10415. subResult.target = subResult.node.selector;
  10416. }
  10417. if (options.ancestry) {
  10418. subResult.ancestry = subResult.node.ancestry;
  10419. }
  10420. if (options.xpath) {
  10421. subResult.xpath = subResult.node.xpath;
  10422. }
  10423. }
  10424. delete subResult.result;
  10425. delete subResult.node;
  10426. normalizeRelatedNodes(subResult, options);
  10427. return subResult;
  10428. });
  10429. }
  10430. resultKeys.forEach(function(key2) {
  10431. return delete ruleResult[key2];
  10432. });
  10433. delete ruleResult.pageLevel;
  10434. delete ruleResult.result;
  10435. return ruleResult;
  10436. });
  10437. });
  10438. return resultObject;
  10439. }
  10440. var process_aggregate_default = processAggregate;
  10441. axe._thisWillBeDeletedDoNotUse = axe._thisWillBeDeletedDoNotUse || {};
  10442. axe._thisWillBeDeletedDoNotUse.helpers = {
  10443. failureSummary: failure_summary_default,
  10444. getEnvironmentData: get_environment_data_default,
  10445. incompleteFallbackMessage: incomplete_fallback_msg_default,
  10446. processAggregate: process_aggregate_default
  10447. };
  10448. var dataRegex = /\$\{\s?data\s?\}/g;
  10449. function substitute(str, data2) {
  10450. if (typeof data2 === 'string') {
  10451. return str.replace(dataRegex, data2);
  10452. }
  10453. for (var prop in data2) {
  10454. if (data2.hasOwnProperty(prop)) {
  10455. var regex = new RegExp('\\${\\s?data\\.' + prop + '\\s?}', 'g');
  10456. str = str.replace(regex, data2[prop]);
  10457. }
  10458. }
  10459. return str;
  10460. }
  10461. function processMessage(message, data2) {
  10462. if (!message) {
  10463. return;
  10464. }
  10465. if (Array.isArray(data2)) {
  10466. data2.values = data2.join(', ');
  10467. if (typeof message.singular === 'string' && typeof message.plural === 'string') {
  10468. var str2 = data2.length === 1 ? message.singular : message.plural;
  10469. return substitute(str2, data2);
  10470. }
  10471. return substitute(message, data2);
  10472. }
  10473. if (typeof message === 'string') {
  10474. return substitute(message, data2);
  10475. }
  10476. if (typeof data2 === 'string') {
  10477. var _str = message[data2];
  10478. return substitute(_str, data2);
  10479. }
  10480. var str = message['default'] || incomplete_fallback_msg_default();
  10481. if (data2 && data2.messageKey && message[data2.messageKey]) {
  10482. str = message[data2.messageKey];
  10483. }
  10484. return processMessage(str, data2);
  10485. }
  10486. var process_message_default = processMessage;
  10487. function getCheckMessage(checkId, type, data2) {
  10488. var check4 = axe._audit.data.checks[checkId];
  10489. if (!check4) {
  10490. throw new Error('Cannot get message for unknown check: '.concat(checkId, '.'));
  10491. }
  10492. if (!check4.messages[type]) {
  10493. throw new Error('Check "'.concat(checkId, '"" does not have a "').concat(type, '" message.'));
  10494. }
  10495. return process_message_default(check4.messages[type], data2);
  10496. }
  10497. var get_check_message_default = getCheckMessage;
  10498. function getCheckOption(check4, ruleID, options) {
  10499. var ruleCheckOption = ((options.rules && options.rules[ruleID] || {}).checks || {})[check4.id];
  10500. var checkOption = (options.checks || {})[check4.id];
  10501. var enabled = check4.enabled;
  10502. var opts = check4.options;
  10503. if (checkOption) {
  10504. if (checkOption.hasOwnProperty('enabled')) {
  10505. enabled = checkOption.enabled;
  10506. }
  10507. if (checkOption.hasOwnProperty('options')) {
  10508. opts = checkOption.options;
  10509. }
  10510. }
  10511. if (ruleCheckOption) {
  10512. if (ruleCheckOption.hasOwnProperty('enabled')) {
  10513. enabled = ruleCheckOption.enabled;
  10514. }
  10515. if (ruleCheckOption.hasOwnProperty('options')) {
  10516. opts = ruleCheckOption.options;
  10517. }
  10518. }
  10519. return {
  10520. enabled: enabled,
  10521. options: opts,
  10522. absolutePaths: options.absolutePaths
  10523. };
  10524. }
  10525. var get_check_option_default = getCheckOption;
  10526. function getNodeFromTree(vNode, node) {
  10527. var el = node || vNode;
  10528. return cache_default.get('nodeMap') ? cache_default.get('nodeMap').get(el) : null;
  10529. }
  10530. var get_node_from_tree_default = getNodeFromTree;
  10531. function getScroll(elm) {
  10532. var buffer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  10533. var overflowX = elm.scrollWidth > elm.clientWidth + buffer;
  10534. var overflowY = elm.scrollHeight > elm.clientHeight + buffer;
  10535. if (!(overflowX || overflowY)) {
  10536. return;
  10537. }
  10538. var style = window.getComputedStyle(elm);
  10539. var overflowXStyle = style.getPropertyValue('overflow-x');
  10540. var overflowYStyle = style.getPropertyValue('overflow-y');
  10541. var scrollableX = overflowXStyle !== 'visible' && overflowXStyle !== 'hidden';
  10542. var scrollableY = overflowYStyle !== 'visible' && overflowYStyle !== 'hidden';
  10543. if (overflowX && scrollableX || overflowY && scrollableY) {
  10544. return {
  10545. elm: elm,
  10546. top: elm.scrollTop,
  10547. left: elm.scrollLeft
  10548. };
  10549. }
  10550. }
  10551. var get_scroll_default = getScroll;
  10552. function getElmScrollRecursive(root) {
  10553. return Array.from(root.children || root.childNodes || []).reduce(function(scrolls, elm) {
  10554. var scroll = get_scroll_default(elm);
  10555. if (scroll) {
  10556. scrolls.push(scroll);
  10557. }
  10558. return scrolls.concat(getElmScrollRecursive(elm));
  10559. }, []);
  10560. }
  10561. function getScrollState() {
  10562. var win = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;
  10563. var root = win.document.documentElement;
  10564. var windowScroll = [ win.pageXOffset !== void 0 ? {
  10565. elm: win,
  10566. top: win.pageYOffset,
  10567. left: win.pageXOffset
  10568. } : {
  10569. elm: root,
  10570. top: root.scrollTop,
  10571. left: root.scrollLeft
  10572. } ];
  10573. return windowScroll.concat(getElmScrollRecursive(document.body));
  10574. }
  10575. var get_scroll_state_default = getScrollState;
  10576. function getStyleSheetFactory(dynamicDoc) {
  10577. if (!dynamicDoc) {
  10578. throw new Error('axe.utils.getStyleSheetFactory should be invoked with an argument');
  10579. }
  10580. return function(options) {
  10581. var data2 = options.data, _options$isCrossOrigi = options.isCrossOrigin, isCrossOrigin = _options$isCrossOrigi === void 0 ? false : _options$isCrossOrigi, shadowId = options.shadowId, root = options.root, priority = options.priority, _options$isLink = options.isLink, isLink = _options$isLink === void 0 ? false : _options$isLink;
  10582. var style = dynamicDoc.createElement('style');
  10583. if (isLink) {
  10584. var text31 = dynamicDoc.createTextNode('@import "'.concat(data2.href, '"'));
  10585. style.appendChild(text31);
  10586. } else {
  10587. style.appendChild(dynamicDoc.createTextNode(data2));
  10588. }
  10589. dynamicDoc.head.appendChild(style);
  10590. return {
  10591. sheet: style.sheet,
  10592. isCrossOrigin: isCrossOrigin,
  10593. shadowId: shadowId,
  10594. root: root,
  10595. priority: priority
  10596. };
  10597. };
  10598. }
  10599. var get_stylesheet_factory_default = getStyleSheetFactory;
  10600. var styleSheet;
  10601. function injectStyle(style) {
  10602. if (styleSheet && styleSheet.parentNode) {
  10603. if (styleSheet.styleSheet === void 0) {
  10604. styleSheet.appendChild(document.createTextNode(style));
  10605. } else {
  10606. styleSheet.styleSheet.cssText += style;
  10607. }
  10608. return styleSheet;
  10609. }
  10610. if (!style) {
  10611. return;
  10612. }
  10613. var head = document.head || document.getElementsByTagName('head')[0];
  10614. styleSheet = document.createElement('style');
  10615. styleSheet.type = 'text/css';
  10616. if (styleSheet.styleSheet === void 0) {
  10617. styleSheet.appendChild(document.createTextNode(style));
  10618. } else {
  10619. styleSheet.styleSheet.cssText = style;
  10620. }
  10621. head.appendChild(styleSheet);
  10622. return styleSheet;
  10623. }
  10624. var inject_style_default = injectStyle;
  10625. function isHidden(el, recursed) {
  10626. var node = get_node_from_tree_default(el);
  10627. if (el.nodeType === 9) {
  10628. return false;
  10629. }
  10630. if (el.nodeType === 11) {
  10631. el = el.host;
  10632. }
  10633. if (node && node._isHidden !== null) {
  10634. return node._isHidden;
  10635. }
  10636. var style = window.getComputedStyle(el, null);
  10637. if (!style || !el.parentNode || style.getPropertyValue('display') === 'none' || !recursed && style.getPropertyValue('visibility') === 'hidden' || el.getAttribute('aria-hidden') === 'true') {
  10638. return true;
  10639. }
  10640. var parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
  10641. var hidden = isHidden(parent, true);
  10642. if (node) {
  10643. node._isHidden = hidden;
  10644. }
  10645. return hidden;
  10646. }
  10647. var is_hidden_default = isHidden;
  10648. var htmlTags = [ 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'math', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rb', 'rp', 'rt', 'rtc', 'ruby', 's', 'samp', 'script', 'section', 'select', 'slot', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'svg', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr' ];
  10649. function isHtmlElement(node) {
  10650. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  10651. return false;
  10652. }
  10653. return htmlTags.includes(node.nodeName.toLowerCase());
  10654. }
  10655. var is_html_element_default = isHtmlElement;
  10656. function getDeepest(collection) {
  10657. return collection.sort(function(a, b) {
  10658. if (contains_default(a, b)) {
  10659. return 1;
  10660. }
  10661. return -1;
  10662. })[0];
  10663. }
  10664. function isNodeInContext(node, context3) {
  10665. var include = context3.include && getDeepest(context3.include.filter(function(candidate) {
  10666. return contains_default(candidate, node);
  10667. }));
  10668. var exclude = context3.exclude && getDeepest(context3.exclude.filter(function(candidate) {
  10669. return contains_default(candidate, node);
  10670. }));
  10671. if (!exclude && include || exclude && contains_default(exclude, include)) {
  10672. return true;
  10673. }
  10674. return false;
  10675. }
  10676. var is_node_in_context_default = isNodeInContext;
  10677. var memoizee = __toModule(require_memoizee());
  10678. axe._memoizedFns = [];
  10679. function memoizeImplementation(fn) {
  10680. var memoized = memoizee['default'](fn);
  10681. axe._memoizedFns.push(memoized);
  10682. return memoized;
  10683. }
  10684. var memoize_default = memoizeImplementation;
  10685. function parseSameOriginStylesheet(sheet, options, priority, importedUrls) {
  10686. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  10687. var rules = Array.from(sheet.cssRules);
  10688. if (!rules) {
  10689. return Promise.resolve();
  10690. }
  10691. var cssImportRules = rules.filter(function(r) {
  10692. return r.type === 3;
  10693. });
  10694. if (!cssImportRules.length) {
  10695. return Promise.resolve({
  10696. isCrossOrigin: isCrossOrigin,
  10697. priority: priority,
  10698. root: options.rootNode,
  10699. shadowId: options.shadowId,
  10700. sheet: sheet
  10701. });
  10702. }
  10703. var cssImportUrlsNotAlreadyImported = cssImportRules.filter(function(rule3) {
  10704. return rule3.href;
  10705. }).map(function(rule3) {
  10706. return rule3.href;
  10707. }).filter(function(url) {
  10708. return !importedUrls.includes(url);
  10709. });
  10710. var promises = cssImportUrlsNotAlreadyImported.map(function(importUrl, cssRuleIndex) {
  10711. var newPriority = [].concat(_toConsumableArray(priority), [ cssRuleIndex ]);
  10712. var isCrossOriginRequest = /^https?:\/\/|^\/\//i.test(importUrl);
  10713. return parse_crossorigin_stylesheet_default(importUrl, options, newPriority, importedUrls, isCrossOriginRequest);
  10714. });
  10715. var nonImportCSSRules = rules.filter(function(r) {
  10716. return r.type !== 3;
  10717. });
  10718. if (!nonImportCSSRules.length) {
  10719. return Promise.all(promises);
  10720. }
  10721. promises.push(Promise.resolve(options.convertDataToStylesheet({
  10722. data: nonImportCSSRules.map(function(rule3) {
  10723. return rule3.cssText;
  10724. }).join(),
  10725. isCrossOrigin: isCrossOrigin,
  10726. priority: priority,
  10727. root: options.rootNode,
  10728. shadowId: options.shadowId
  10729. })));
  10730. return Promise.all(promises);
  10731. }
  10732. var parse_sameorigin_stylesheet_default = parseSameOriginStylesheet;
  10733. function parseStylesheet(sheet, options, priority, importedUrls) {
  10734. var isCrossOrigin = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  10735. var isSameOrigin = isSameOriginStylesheet(sheet);
  10736. if (isSameOrigin) {
  10737. return parse_sameorigin_stylesheet_default(sheet, options, priority, importedUrls, isCrossOrigin);
  10738. }
  10739. return parse_crossorigin_stylesheet_default(sheet.href, options, priority, importedUrls, true);
  10740. }
  10741. function isSameOriginStylesheet(sheet) {
  10742. try {
  10743. var rules = sheet.cssRules;
  10744. if (!rules && sheet.href) {
  10745. return false;
  10746. }
  10747. return true;
  10748. } catch (e) {
  10749. return false;
  10750. }
  10751. }
  10752. var parse_stylesheet_default = parseStylesheet;
  10753. function parseCrossOriginStylesheet(url, options, priority, importedUrls, isCrossOrigin) {
  10754. importedUrls.push(url);
  10755. return new Promise(function(resolve, reject) {
  10756. var request = new XMLHttpRequest();
  10757. request.open('GET', url);
  10758. request.timeout = constants_default.preload.timeout;
  10759. request.addEventListener('error', reject);
  10760. request.addEventListener('timeout', reject);
  10761. request.addEventListener('loadend', function(event) {
  10762. if (event.loaded && request.responseText) {
  10763. return resolve(request.responseText);
  10764. }
  10765. reject(request.responseText);
  10766. });
  10767. request.send();
  10768. }).then(function(data2) {
  10769. var result = options.convertDataToStylesheet({
  10770. data: data2,
  10771. isCrossOrigin: isCrossOrigin,
  10772. priority: priority,
  10773. root: options.rootNode,
  10774. shadowId: options.shadowId
  10775. });
  10776. return parse_stylesheet_default(result.sheet, options, priority, importedUrls, result.isCrossOrigin);
  10777. });
  10778. }
  10779. var parse_crossorigin_stylesheet_default = parseCrossOriginStylesheet;
  10780. var performanceTimer = function() {
  10781. function now() {
  10782. if (window.performance && window.performance) {
  10783. return window.performance.now();
  10784. }
  10785. }
  10786. var originalTime = null;
  10787. var lastRecordedTime = now();
  10788. return {
  10789. start: function start() {
  10790. this.mark('mark_axe_start');
  10791. },
  10792. end: function end() {
  10793. this.mark('mark_axe_end');
  10794. this.measure('axe', 'mark_axe_start', 'mark_axe_end');
  10795. this.logMeasures('axe');
  10796. },
  10797. auditStart: function auditStart() {
  10798. this.mark('mark_audit_start');
  10799. },
  10800. auditEnd: function auditEnd() {
  10801. this.mark('mark_audit_end');
  10802. this.measure('audit_start_to_end', 'mark_audit_start', 'mark_audit_end');
  10803. this.logMeasures();
  10804. },
  10805. mark: function mark(markName) {
  10806. if (window.performance && window.performance.mark !== void 0) {
  10807. window.performance.mark(markName);
  10808. }
  10809. },
  10810. measure: function measure(measureName, startMark, endMark) {
  10811. if (window.performance && window.performance.measure !== void 0) {
  10812. window.performance.measure(measureName, startMark, endMark);
  10813. }
  10814. },
  10815. logMeasures: function logMeasures(measureName) {
  10816. function logMeasure(req2) {
  10817. log_default('Measure ' + req2.name + ' took ' + req2.duration + 'ms');
  10818. }
  10819. if (window.performance && window.performance.getEntriesByType !== void 0) {
  10820. var axeStart = window.performance.getEntriesByName('mark_axe_start')[0];
  10821. var measures = window.performance.getEntriesByType('measure').filter(function(measure) {
  10822. return measure.startTime >= axeStart.startTime;
  10823. });
  10824. for (var i = 0; i < measures.length; ++i) {
  10825. var req = measures[i];
  10826. if (req.name === measureName) {
  10827. logMeasure(req);
  10828. return;
  10829. }
  10830. logMeasure(req);
  10831. }
  10832. }
  10833. },
  10834. timeElapsed: function timeElapsed() {
  10835. return now() - lastRecordedTime;
  10836. },
  10837. reset: function reset() {
  10838. if (!originalTime) {
  10839. originalTime = now();
  10840. }
  10841. lastRecordedTime = now();
  10842. }
  10843. };
  10844. }();
  10845. var performance_timer_default = performanceTimer;
  10846. if (typeof Object.assign !== 'function') {
  10847. (function() {
  10848. Object.assign = function(target) {
  10849. if (target === void 0 || target === null) {
  10850. throw new TypeError('Cannot convert undefined or null to object');
  10851. }
  10852. var output = Object(target);
  10853. for (var index = 1; index < arguments.length; index++) {
  10854. var source = arguments[index];
  10855. if (source !== void 0 && source !== null) {
  10856. for (var nextKey in source) {
  10857. if (source.hasOwnProperty(nextKey)) {
  10858. output[nextKey] = source[nextKey];
  10859. }
  10860. }
  10861. }
  10862. }
  10863. return output;
  10864. };
  10865. })();
  10866. }
  10867. if (!Array.prototype.find) {
  10868. Object.defineProperty(Array.prototype, 'find', {
  10869. value: function value(predicate) {
  10870. if (this === null) {
  10871. throw new TypeError('Array.prototype.find called on null or undefined');
  10872. }
  10873. if (typeof predicate !== 'function') {
  10874. throw new TypeError('predicate must be a function');
  10875. }
  10876. var list = Object(this);
  10877. var length = list.length >>> 0;
  10878. var thisArg = arguments[1];
  10879. var value;
  10880. for (var i = 0; i < length; i++) {
  10881. value = list[i];
  10882. if (predicate.call(thisArg, value, i, list)) {
  10883. return value;
  10884. }
  10885. }
  10886. return void 0;
  10887. }
  10888. });
  10889. }
  10890. function _pollyfillElementsFromPoint() {
  10891. if (document.elementsFromPoint) {
  10892. return document.elementsFromPoint;
  10893. }
  10894. if (document.msElementsFromPoint) {
  10895. return document.msElementsFromPoint;
  10896. }
  10897. var usePointer = function() {
  10898. var element = document.createElement('x');
  10899. element.style.cssText = 'pointer-events:auto';
  10900. return element.style.pointerEvents === 'auto';
  10901. }();
  10902. var cssProp = usePointer ? 'pointer-events' : 'visibility';
  10903. var cssDisableVal = usePointer ? 'none' : 'hidden';
  10904. var style = document.createElement('style');
  10905. style.innerHTML = usePointer ? '* { pointer-events: all }' : '* { visibility: visible }';
  10906. return function(x, y) {
  10907. var current, i, d;
  10908. var elements = [];
  10909. var previousPointerEvents = [];
  10910. document.head.appendChild(style);
  10911. while ((current = document.elementFromPoint(x, y)) && elements.indexOf(current) === -1) {
  10912. elements.push(current);
  10913. previousPointerEvents.push({
  10914. value: current.style.getPropertyValue(cssProp),
  10915. priority: current.style.getPropertyPriority(cssProp)
  10916. });
  10917. current.style.setProperty(cssProp, cssDisableVal, 'important');
  10918. }
  10919. if (elements.indexOf(document.documentElement) < elements.length - 1) {
  10920. elements.splice(elements.indexOf(document.documentElement), 1);
  10921. elements.push(document.documentElement);
  10922. }
  10923. for (i = previousPointerEvents.length; !!(d = previousPointerEvents[--i]); ) {
  10924. elements[i].style.setProperty(cssProp, d.value ? d.value : '', d.priority);
  10925. }
  10926. document.head.removeChild(style);
  10927. return elements;
  10928. };
  10929. }
  10930. if (typeof window.addEventListener === 'function') {
  10931. document.elementsFromPoint = _pollyfillElementsFromPoint();
  10932. }
  10933. if (!Array.prototype.includes) {
  10934. Object.defineProperty(Array.prototype, 'includes', {
  10935. value: function value(searchElement) {
  10936. var O = Object(this);
  10937. var len = parseInt(O.length, 10) || 0;
  10938. if (len === 0) {
  10939. return false;
  10940. }
  10941. var n = parseInt(arguments[1], 10) || 0;
  10942. var k;
  10943. if (n >= 0) {
  10944. k = n;
  10945. } else {
  10946. k = len + n;
  10947. if (k < 0) {
  10948. k = 0;
  10949. }
  10950. }
  10951. var currentElement;
  10952. while (k < len) {
  10953. currentElement = O[k];
  10954. if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) {
  10955. return true;
  10956. }
  10957. k++;
  10958. }
  10959. return false;
  10960. }
  10961. });
  10962. }
  10963. if (!Array.prototype.some) {
  10964. Object.defineProperty(Array.prototype, 'some', {
  10965. value: function value(fun) {
  10966. if (this == null) {
  10967. throw new TypeError('Array.prototype.some called on null or undefined');
  10968. }
  10969. if (typeof fun !== 'function') {
  10970. throw new TypeError();
  10971. }
  10972. var t = Object(this);
  10973. var len = t.length >>> 0;
  10974. var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
  10975. for (var i = 0; i < len; i++) {
  10976. if (i in t && fun.call(thisArg, t[i], i, t)) {
  10977. return true;
  10978. }
  10979. }
  10980. return false;
  10981. }
  10982. });
  10983. }
  10984. if (!Array.from) {
  10985. Object.defineProperty(Array, 'from', {
  10986. value: function() {
  10987. var toStr = Object.prototype.toString;
  10988. var isCallable = function isCallable(fn) {
  10989. return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
  10990. };
  10991. var toInteger = function toInteger(value) {
  10992. var number = Number(value);
  10993. if (isNaN(number)) {
  10994. return 0;
  10995. }
  10996. if (number === 0 || !isFinite(number)) {
  10997. return number;
  10998. }
  10999. return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
  11000. };
  11001. var maxSafeInteger = Math.pow(2, 53) - 1;
  11002. var toLength = function toLength(value) {
  11003. var len = toInteger(value);
  11004. return Math.min(Math.max(len, 0), maxSafeInteger);
  11005. };
  11006. return function from(arrayLike) {
  11007. var C = this;
  11008. var items = Object(arrayLike);
  11009. if (arrayLike == null) {
  11010. throw new TypeError('Array.from requires an array-like object - not null or undefined');
  11011. }
  11012. var mapFn = arguments.length > 1 ? arguments[1] : void 0;
  11013. var T;
  11014. if (typeof mapFn !== 'undefined') {
  11015. if (!isCallable(mapFn)) {
  11016. throw new TypeError('Array.from: when provided, the second argument must be a function');
  11017. }
  11018. if (arguments.length > 2) {
  11019. T = arguments[2];
  11020. }
  11021. }
  11022. var len = toLength(items.length);
  11023. var A = isCallable(C) ? Object(new C(len)) : new Array(len);
  11024. var k = 0;
  11025. var kValue;
  11026. while (k < len) {
  11027. kValue = items[k];
  11028. if (mapFn) {
  11029. A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
  11030. } else {
  11031. A[k] = kValue;
  11032. }
  11033. k += 1;
  11034. }
  11035. A.length = len;
  11036. return A;
  11037. };
  11038. }()
  11039. });
  11040. }
  11041. if (!String.prototype.includes) {
  11042. String.prototype.includes = function(search, start) {
  11043. if (typeof start !== 'number') {
  11044. start = 0;
  11045. }
  11046. if (start + search.length > this.length) {
  11047. return false;
  11048. } else {
  11049. return this.indexOf(search, start) !== -1;
  11050. }
  11051. };
  11052. }
  11053. function uniqueArray(arr1, arr2) {
  11054. return arr1.concat(arr2).filter(function(elem, pos, arr) {
  11055. return arr.indexOf(elem) === pos;
  11056. });
  11057. }
  11058. var unique_array_default = uniqueArray;
  11059. function createLocalVariables(vNodes, anyLevel, thisLevel, parentShadowId) {
  11060. var retVal = {
  11061. vNodes: vNodes.slice(),
  11062. anyLevel: anyLevel,
  11063. thisLevel: thisLevel,
  11064. parentShadowId: parentShadowId
  11065. };
  11066. retVal.vNodes.reverse();
  11067. return retVal;
  11068. }
  11069. function matchExpressions(domTree, expressions, filter) {
  11070. var stack = [];
  11071. var vNodes = Array.isArray(domTree) ? domTree : [ domTree ];
  11072. var currentLevel = createLocalVariables(vNodes, expressions, [], domTree[0].shadowId);
  11073. var result = [];
  11074. while (currentLevel.vNodes.length) {
  11075. var vNode = currentLevel.vNodes.pop();
  11076. var childOnly = [];
  11077. var childAny = [];
  11078. var combined = currentLevel.anyLevel.slice().concat(currentLevel.thisLevel);
  11079. var added = false;
  11080. for (var _i7 = 0; _i7 < combined.length; _i7++) {
  11081. var exp = combined[_i7];
  11082. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && _matchesExpression(vNode, exp[0])) {
  11083. if (exp.length === 1) {
  11084. if (!added && (!filter || filter(vNode))) {
  11085. result.push(vNode);
  11086. added = true;
  11087. }
  11088. } else {
  11089. var rest = exp.slice(1);
  11090. if ([ ' ', '>' ].includes(rest[0].combinator) === false) {
  11091. throw new Error('axe.utils.querySelectorAll does not support the combinator: ' + exp[1].combinator);
  11092. }
  11093. if (rest[0].combinator === '>') {
  11094. childOnly.push(rest);
  11095. } else {
  11096. childAny.push(rest);
  11097. }
  11098. }
  11099. }
  11100. if ((!exp[0].id || vNode.shadowId === currentLevel.parentShadowId) && currentLevel.anyLevel.includes(exp)) {
  11101. childAny.push(exp);
  11102. }
  11103. }
  11104. if (vNode.children && vNode.children.length) {
  11105. stack.push(currentLevel);
  11106. currentLevel = createLocalVariables(vNode.children, childAny, childOnly, vNode.shadowId);
  11107. }
  11108. while (!currentLevel.vNodes.length && stack.length) {
  11109. currentLevel = stack.pop();
  11110. }
  11111. }
  11112. return result;
  11113. }
  11114. function querySelectorAllFilter(domTree, selector, filter) {
  11115. domTree = Array.isArray(domTree) ? domTree : [ domTree ];
  11116. var expressions = _convertSelector(selector);
  11117. return matchExpressions(domTree, expressions, filter);
  11118. }
  11119. var query_selector_all_filter_default = querySelectorAllFilter;
  11120. function preloadCssom(_ref21) {
  11121. var _ref21$treeRoot = _ref21.treeRoot, treeRoot = _ref21$treeRoot === void 0 ? axe._tree[0] : _ref21$treeRoot;
  11122. var rootNodes = getAllRootNodesInTree(treeRoot);
  11123. if (!rootNodes.length) {
  11124. return Promise.resolve();
  11125. }
  11126. var dynamicDoc = document.implementation.createHTMLDocument('Dynamic document for loading cssom');
  11127. var convertDataToStylesheet = get_stylesheet_factory_default(dynamicDoc);
  11128. return getCssomForAllRootNodes(rootNodes, convertDataToStylesheet).then(function(assets) {
  11129. return flattenAssets(assets);
  11130. });
  11131. }
  11132. var preload_cssom_default = preloadCssom;
  11133. function getAllRootNodesInTree(tree) {
  11134. var ids = [];
  11135. var rootNodes = query_selector_all_filter_default(tree, '*', function(node) {
  11136. if (ids.includes(node.shadowId)) {
  11137. return false;
  11138. }
  11139. ids.push(node.shadowId);
  11140. return true;
  11141. }).map(function(node) {
  11142. return {
  11143. shadowId: node.shadowId,
  11144. rootNode: get_root_node_default(node.actualNode)
  11145. };
  11146. });
  11147. return unique_array_default(rootNodes, []);
  11148. }
  11149. function getCssomForAllRootNodes(rootNodes, convertDataToStylesheet) {
  11150. var promises = [];
  11151. rootNodes.forEach(function(_ref22, index) {
  11152. var rootNode = _ref22.rootNode, shadowId = _ref22.shadowId;
  11153. var sheets = getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet);
  11154. if (!sheets) {
  11155. return Promise.all(promises);
  11156. }
  11157. var rootIndex = index + 1;
  11158. var parseOptions = {
  11159. rootNode: rootNode,
  11160. shadowId: shadowId,
  11161. convertDataToStylesheet: convertDataToStylesheet,
  11162. rootIndex: rootIndex
  11163. };
  11164. var importedUrls = [];
  11165. var p = Promise.all(sheets.map(function(sheet, sheetIndex) {
  11166. var priority = [ rootIndex, sheetIndex ];
  11167. return parse_stylesheet_default(sheet, parseOptions, priority, importedUrls);
  11168. }));
  11169. promises.push(p);
  11170. });
  11171. return Promise.all(promises);
  11172. }
  11173. function flattenAssets(assets) {
  11174. return assets.reduce(function(acc, val) {
  11175. return Array.isArray(val) ? acc.concat(flattenAssets(val)) : acc.concat(val);
  11176. }, []);
  11177. }
  11178. function getStylesheetsOfRootNode(rootNode, shadowId, convertDataToStylesheet) {
  11179. var sheets;
  11180. if (rootNode.nodeType === 11 && shadowId) {
  11181. sheets = getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet);
  11182. } else {
  11183. sheets = getStylesheetsFromDocument(rootNode);
  11184. }
  11185. return filterStylesheetsWithSameHref(sheets);
  11186. }
  11187. function getStylesheetsFromDocumentFragment(rootNode, convertDataToStylesheet) {
  11188. return Array.from(rootNode.children).filter(filerStyleAndLinkAttributesInDocumentFragment).reduce(function(out, node) {
  11189. var nodeName2 = node.nodeName.toUpperCase();
  11190. var data2 = nodeName2 === 'STYLE' ? node.textContent : node;
  11191. var isLink = nodeName2 === 'LINK';
  11192. var stylesheet = convertDataToStylesheet({
  11193. data: data2,
  11194. isLink: isLink,
  11195. root: rootNode
  11196. });
  11197. out.push(stylesheet.sheet);
  11198. return out;
  11199. }, []);
  11200. }
  11201. function getStylesheetsFromDocument(rootNode) {
  11202. return Array.from(rootNode.styleSheets).filter(function(sheet) {
  11203. return filterMediaIsPrint(sheet.media.mediaText);
  11204. });
  11205. }
  11206. function filerStyleAndLinkAttributesInDocumentFragment(node) {
  11207. var nodeName2 = node.nodeName.toUpperCase();
  11208. var linkHref = node.getAttribute('href');
  11209. var linkRel = node.getAttribute('rel');
  11210. var isLink = nodeName2 === 'LINK' && linkHref && linkRel && node.rel.toUpperCase().includes('STYLESHEET');
  11211. var isStyle = nodeName2 === 'STYLE';
  11212. return isStyle || isLink && filterMediaIsPrint(node.media);
  11213. }
  11214. function filterMediaIsPrint(media) {
  11215. if (!media) {
  11216. return true;
  11217. }
  11218. return !media.toUpperCase().includes('PRINT');
  11219. }
  11220. function filterStylesheetsWithSameHref(sheets) {
  11221. var hrefs = [];
  11222. return sheets.filter(function(sheet) {
  11223. if (!sheet.href) {
  11224. return true;
  11225. }
  11226. if (hrefs.includes(sheet.href)) {
  11227. return false;
  11228. }
  11229. hrefs.push(sheet.href);
  11230. return true;
  11231. });
  11232. }
  11233. function preloadMedia(_ref23) {
  11234. var _ref23$treeRoot = _ref23.treeRoot, treeRoot = _ref23$treeRoot === void 0 ? axe._tree[0] : _ref23$treeRoot;
  11235. var mediaVirtualNodes = query_selector_all_filter_default(treeRoot, 'video, audio', function(_ref24) {
  11236. var actualNode = _ref24.actualNode;
  11237. if (actualNode.hasAttribute('src')) {
  11238. return !!actualNode.getAttribute('src');
  11239. }
  11240. var sourceWithSrc = Array.from(actualNode.getElementsByTagName('source')).filter(function(source) {
  11241. return !!source.getAttribute('src');
  11242. });
  11243. if (sourceWithSrc.length <= 0) {
  11244. return false;
  11245. }
  11246. return true;
  11247. });
  11248. return Promise.all(mediaVirtualNodes.map(function(_ref25) {
  11249. var actualNode = _ref25.actualNode;
  11250. return isMediaElementReady(actualNode);
  11251. }));
  11252. }
  11253. var preload_media_default = preloadMedia;
  11254. function isMediaElementReady(elm) {
  11255. return new Promise(function(resolve) {
  11256. if (elm.readyState > 0) {
  11257. resolve(elm);
  11258. }
  11259. function onMediaReady() {
  11260. elm.removeEventListener('loadedmetadata', onMediaReady);
  11261. resolve(elm);
  11262. }
  11263. elm.addEventListener('loadedmetadata', onMediaReady);
  11264. });
  11265. }
  11266. function isValidPreloadObject(preload3) {
  11267. return _typeof(preload3) === 'object' && Array.isArray(preload3.assets);
  11268. }
  11269. function _shouldPreload(options) {
  11270. if (!options || options.preload === void 0 || options.preload === null) {
  11271. return true;
  11272. }
  11273. if (typeof options.preload === 'boolean') {
  11274. return options.preload;
  11275. }
  11276. return isValidPreloadObject(options.preload);
  11277. }
  11278. function _getPreloadConfig(options) {
  11279. var _constants_default$pr = constants_default.preload, assets = _constants_default$pr.assets, timeout = _constants_default$pr.timeout;
  11280. var config = {
  11281. assets: assets,
  11282. timeout: timeout
  11283. };
  11284. if (!options.preload) {
  11285. return config;
  11286. }
  11287. if (typeof options.preload === 'boolean') {
  11288. return config;
  11289. }
  11290. var areRequestedAssetsValid = options.preload.assets.every(function(a) {
  11291. return assets.includes(a.toLowerCase());
  11292. });
  11293. if (!areRequestedAssetsValid) {
  11294. throw new Error('Requested assets, not supported. Supported assets are: '.concat(assets.join(', '), '.'));
  11295. }
  11296. config.assets = unique_array_default(options.preload.assets.map(function(a) {
  11297. return a.toLowerCase();
  11298. }), []);
  11299. if (options.preload.timeout && typeof options.preload.timeout === 'number' && !isNaN(options.preload.timeout)) {
  11300. config.timeout = options.preload.timeout;
  11301. }
  11302. return config;
  11303. }
  11304. function preload(options) {
  11305. var preloadFunctionsMap = {
  11306. cssom: preload_cssom_default,
  11307. media: preload_media_default
  11308. };
  11309. if (!_shouldPreload(options)) {
  11310. return Promise.resolve();
  11311. }
  11312. return new Promise(function(resolve, reject) {
  11313. var _getPreloadConfig2 = _getPreloadConfig(options), assets = _getPreloadConfig2.assets, timeout = _getPreloadConfig2.timeout;
  11314. var preloadTimeout = setTimeout(function() {
  11315. return reject(new Error('Preload assets timed out.'));
  11316. }, timeout);
  11317. Promise.all(assets.map(function(asset) {
  11318. return preloadFunctionsMap[asset](options).then(function(results) {
  11319. return _defineProperty({}, asset, results);
  11320. });
  11321. })).then(function(results) {
  11322. var preloadAssets = results.reduce(function(out, result) {
  11323. return _extends({}, out, result);
  11324. }, {});
  11325. clearTimeout(preloadTimeout);
  11326. resolve(preloadAssets);
  11327. })['catch'](function(err2) {
  11328. clearTimeout(preloadTimeout);
  11329. reject(err2);
  11330. });
  11331. });
  11332. }
  11333. var preload_default = preload;
  11334. function getIncompleteReason(checkData, messages) {
  11335. function getDefaultMsg(messages2) {
  11336. if (messages2.incomplete && messages2.incomplete['default']) {
  11337. return messages2.incomplete['default'];
  11338. } else {
  11339. return incomplete_fallback_msg_default();
  11340. }
  11341. }
  11342. if (checkData && checkData.missingData) {
  11343. try {
  11344. var msg = messages.incomplete[checkData.missingData[0].reason];
  11345. if (!msg) {
  11346. throw new Error();
  11347. }
  11348. return msg;
  11349. } catch (e) {
  11350. if (typeof checkData.missingData === 'string') {
  11351. return messages.incomplete[checkData.missingData];
  11352. } else {
  11353. return getDefaultMsg(messages);
  11354. }
  11355. }
  11356. } else if (checkData && checkData.messageKey) {
  11357. return messages.incomplete[checkData.messageKey];
  11358. } else {
  11359. return getDefaultMsg(messages);
  11360. }
  11361. }
  11362. function extender(checksData, shouldBeTrue) {
  11363. return function(check4) {
  11364. var sourceData = checksData[check4.id] || {};
  11365. var messages = sourceData.messages || {};
  11366. var data2 = Object.assign({}, sourceData);
  11367. delete data2.messages;
  11368. if (check4.result === void 0) {
  11369. if (_typeof(messages.incomplete) === 'object' && !Array.isArray(check4.data)) {
  11370. data2.message = getIncompleteReason(check4.data, messages);
  11371. }
  11372. if (!data2.message) {
  11373. data2.message = messages.incomplete;
  11374. }
  11375. } else {
  11376. data2.message = check4.result === shouldBeTrue ? messages.pass : messages.fail;
  11377. }
  11378. if (typeof data2.message !== 'function') {
  11379. data2.message = process_message_default(data2.message, check4.data);
  11380. }
  11381. extend_meta_data_default(check4, data2);
  11382. };
  11383. }
  11384. function publishMetaData(ruleResult) {
  11385. var checksData = axe._audit.data.checks || {};
  11386. var rulesData = axe._audit.data.rules || {};
  11387. var rule3 = find_by_default(axe._audit.rules, 'id', ruleResult.id) || {};
  11388. ruleResult.tags = clone_default(rule3.tags || []);
  11389. var shouldBeTrue = extender(checksData, true);
  11390. var shouldBeFalse = extender(checksData, false);
  11391. ruleResult.nodes.forEach(function(detail) {
  11392. detail.any.forEach(shouldBeTrue);
  11393. detail.all.forEach(shouldBeTrue);
  11394. detail.none.forEach(shouldBeFalse);
  11395. });
  11396. extend_meta_data_default(ruleResult, clone_default(rulesData[ruleResult.id] || {}));
  11397. }
  11398. var publish_metadata_default = publishMetaData;
  11399. function querySelectorAll(domTree, selector) {
  11400. return query_selector_all_filter_default(domTree, selector);
  11401. }
  11402. var query_selector_all_default = querySelectorAll;
  11403. function matchTags(rule3, runOnly) {
  11404. var include, exclude, matching;
  11405. var defaultExclude = axe._audit && axe._audit.tagExclude ? axe._audit.tagExclude : [];
  11406. if (runOnly.hasOwnProperty('include') || runOnly.hasOwnProperty('exclude')) {
  11407. include = runOnly.include || [];
  11408. include = Array.isArray(include) ? include : [ include ];
  11409. exclude = runOnly.exclude || [];
  11410. exclude = Array.isArray(exclude) ? exclude : [ exclude ];
  11411. exclude = exclude.concat(defaultExclude.filter(function(tag) {
  11412. return include.indexOf(tag) === -1;
  11413. }));
  11414. } else {
  11415. include = Array.isArray(runOnly) ? runOnly : [ runOnly ];
  11416. exclude = defaultExclude.filter(function(tag) {
  11417. return include.indexOf(tag) === -1;
  11418. });
  11419. }
  11420. matching = include.some(function(tag) {
  11421. return rule3.tags.indexOf(tag) !== -1;
  11422. });
  11423. if (matching || include.length === 0 && rule3.enabled !== false) {
  11424. return exclude.every(function(tag) {
  11425. return rule3.tags.indexOf(tag) === -1;
  11426. });
  11427. } else {
  11428. return false;
  11429. }
  11430. }
  11431. function ruleShouldRun(rule3, context3, options) {
  11432. var runOnly = options.runOnly || {};
  11433. var ruleOptions = (options.rules || {})[rule3.id];
  11434. if (rule3.pageLevel && !context3.page) {
  11435. return false;
  11436. } else if (runOnly.type === 'rule') {
  11437. return runOnly.values.indexOf(rule3.id) !== -1;
  11438. } else if (ruleOptions && typeof ruleOptions.enabled === 'boolean') {
  11439. return ruleOptions.enabled;
  11440. } else if (runOnly.type === 'tag' && runOnly.values) {
  11441. return matchTags(rule3, runOnly.values);
  11442. } else {
  11443. return matchTags(rule3, []);
  11444. }
  11445. }
  11446. var rule_should_run_default = ruleShouldRun;
  11447. function pushNode(result, nodes) {
  11448. var temp;
  11449. if (result.length === 0) {
  11450. return nodes;
  11451. }
  11452. if (result.length < nodes.length) {
  11453. temp = result;
  11454. result = nodes;
  11455. nodes = temp;
  11456. }
  11457. for (var _i8 = 0, l = nodes.length; _i8 < l; _i8++) {
  11458. if (!result.includes(nodes[_i8])) {
  11459. result.push(nodes[_i8]);
  11460. }
  11461. }
  11462. return result;
  11463. }
  11464. function reduceIncludes(includes) {
  11465. return includes.reduce(function(res, el) {
  11466. if (!res.length || !contains_default(res[res.length - 1], el)) {
  11467. res.push(el);
  11468. }
  11469. return res;
  11470. }, []);
  11471. }
  11472. function select(selector, context3) {
  11473. var result = [];
  11474. var candidate;
  11475. if (axe._selectCache) {
  11476. for (var j = 0, l = axe._selectCache.length; j < l; j++) {
  11477. var item = axe._selectCache[j];
  11478. if (item.selector === selector) {
  11479. return item.result;
  11480. }
  11481. }
  11482. }
  11483. var curried = function(context4) {
  11484. return function(node) {
  11485. return is_node_in_context_default(node, context4);
  11486. };
  11487. }(context3);
  11488. var reducedIncludes = reduceIncludes(context3.include);
  11489. for (var _i9 = 0; _i9 < reducedIncludes.length; _i9++) {
  11490. candidate = reducedIncludes[_i9];
  11491. result = pushNode(result, query_selector_all_filter_default(candidate, selector, curried));
  11492. }
  11493. if (axe._selectCache) {
  11494. axe._selectCache.push({
  11495. selector: selector,
  11496. result: result
  11497. });
  11498. }
  11499. return result;
  11500. }
  11501. var select_default = select;
  11502. function setScroll(elm, top, left) {
  11503. if (elm === window) {
  11504. return elm.scroll(left, top);
  11505. } else {
  11506. elm.scrollTop = top;
  11507. elm.scrollLeft = left;
  11508. }
  11509. }
  11510. function setScrollState(scrollState) {
  11511. scrollState.forEach(function(_ref27) {
  11512. var elm = _ref27.elm, top = _ref27.top, left = _ref27.left;
  11513. return setScroll(elm, top, left);
  11514. });
  11515. }
  11516. var set_scroll_state_default = setScrollState;
  11517. function tokenList(str) {
  11518. return (str || '').trim().replace(/\s{2,}/g, ' ').split(' ');
  11519. }
  11520. var token_list_default = tokenList;
  11521. function validInputTypes() {
  11522. return [ 'hidden', 'text', 'search', 'tel', 'url', 'email', 'password', 'date', 'month', 'week', 'time', 'datetime-local', 'number', 'range', 'color', 'checkbox', 'radio', 'file', 'submit', 'image', 'reset', 'button' ];
  11523. }
  11524. var valid_input_type_default = validInputTypes;
  11525. var langs = [ , [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, , , , , , 1, 1, 1, 1, , , 1, 1, 1, , 1, , 1, , 1, 1 ], [ 1, 1, 1, , 1, 1, , 1, 1, 1, , 1, , , 1, 1, 1, , , 1, 1, 1, , , , , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , , , , 1, 1, 1, , 1, 1, 1, 1, 1, 1, , 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ , 1, , , , , , 1, , 1, , , , , 1, , 1, , , , 1, 1, , 1, , , 1 ], [ 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , , , 1, 1, 1, 1, , , 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, , 1, 1, , , 1, , , , , 1, 1, 1, , 1, , 1, , 1, , , , , , 1 ], [ 1, , 1, 1, 1, 1, , , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, , 1, , 1, , , , , 1, , 1, 1, 1, 1, 1, , , , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, , 1, 1, 1, , 1, , 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , , 1, , , 1, , 1, , , , 1, 1, 1, , , , , , , , , , , 1 ], [ 1, 1, 1, 1, 1, 1, , 1, 1, 1, , 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1 ], [ 1, 1, 1, 1, 1, , , 1, , , 1, , , 1, 1, 1, , , , , 1, , , , , , 1 ] ], [ , [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, , 1, , , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, , 1, 1, 1, 1, , 1 ], [ , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  11526. function isValidLang(lang) {
  11527. var array = langs;
  11528. while (lang.length < 3) {
  11529. lang += '`';
  11530. }
  11531. for (var _i10 = 0; _i10 <= lang.length - 1; _i10++) {
  11532. var index = lang.charCodeAt(_i10) - 96;
  11533. array = array[index];
  11534. if (!array) {
  11535. return false;
  11536. }
  11537. }
  11538. return true;
  11539. }
  11540. function _validLangs(langArray) {
  11541. langArray = Array.isArray(langArray) ? langArray : langs;
  11542. var codes = [];
  11543. langArray.forEach(function(lang, index) {
  11544. var _char2 = String.fromCharCode(index + 96).replace('`', '');
  11545. if (Array.isArray(lang)) {
  11546. codes = codes.concat(_validLangs(lang).map(function(newLang) {
  11547. return _char2 + newLang;
  11548. }));
  11549. } else {
  11550. codes.push(_char2);
  11551. }
  11552. });
  11553. return codes;
  11554. }
  11555. var valid_langs_default = isValidLang;
  11556. var SerialVirtualNode = function(_abstract_virtual_nod2) {
  11557. _inherits(SerialVirtualNode, _abstract_virtual_nod2);
  11558. var _super2 = _createSuper(SerialVirtualNode);
  11559. function SerialVirtualNode(serialNode) {
  11560. var _this2;
  11561. _classCallCheck(this, SerialVirtualNode);
  11562. _this2 = _super2.call(this);
  11563. _this2._props = normaliseProps(serialNode);
  11564. _this2._attrs = normaliseAttrs(serialNode);
  11565. return _this2;
  11566. }
  11567. _createClass(SerialVirtualNode, [ {
  11568. key: 'attr',
  11569. value: function attr(attrName) {
  11570. return this._attrs[attrName] || null;
  11571. }
  11572. }, {
  11573. key: 'hasAttr',
  11574. value: function hasAttr(attrName) {
  11575. return this._attrs[attrName] !== void 0;
  11576. }
  11577. }, {
  11578. key: 'props',
  11579. get: function get() {
  11580. return this._props;
  11581. }
  11582. } ]);
  11583. return SerialVirtualNode;
  11584. }(abstract_virtual_node_default);
  11585. function normaliseProps(serialNode) {
  11586. var nodeName2 = serialNode.nodeName, _serialNode$nodeType = serialNode.nodeType, nodeType = _serialNode$nodeType === void 0 ? 1 : _serialNode$nodeType;
  11587. assert_default(typeof nodeType === 'number', 'nodeType has to be a number, got \''.concat(nodeType, '\''));
  11588. assert_default(typeof nodeName2 === 'string', 'nodeName has to be a string, got \''.concat(nodeName2, '\''));
  11589. nodeName2 = nodeName2.toLowerCase();
  11590. var type = null;
  11591. if (nodeName2 === 'input') {
  11592. type = (serialNode.type || serialNode.attributes && serialNode.attributes.type || '').toLowerCase();
  11593. if (!valid_input_type_default().includes(type)) {
  11594. type = 'text';
  11595. }
  11596. }
  11597. var props = _extends({}, serialNode, {
  11598. nodeType: nodeType,
  11599. nodeName: nodeName2
  11600. });
  11601. if (type) {
  11602. props.type = type;
  11603. }
  11604. delete props.attributes;
  11605. return Object.freeze(props);
  11606. }
  11607. function normaliseAttrs(_ref28) {
  11608. var _ref28$attributes = _ref28.attributes, attributes4 = _ref28$attributes === void 0 ? {} : _ref28$attributes;
  11609. var attrMap = {
  11610. htmlFor: 'for',
  11611. className: 'class'
  11612. };
  11613. return Object.keys(attributes4).reduce(function(attrs, attrName) {
  11614. var value = attributes4[attrName];
  11615. assert_default(_typeof(value) !== 'object' || value === null, 'expects attributes not to be an object, \''.concat(attrName, '\' was'));
  11616. if (value !== void 0) {
  11617. var mappedName = attrMap[attrName] || attrName;
  11618. attrs[mappedName] = value !== null ? String(value) : null;
  11619. }
  11620. return attrs;
  11621. }, {});
  11622. }
  11623. var serial_virtual_node_default = SerialVirtualNode;
  11624. var aria_exports = {};
  11625. __export(aria_exports, {
  11626. allowedAttr: function allowedAttr() {
  11627. return allowed_attr_default;
  11628. },
  11629. arialabelText: function arialabelText() {
  11630. return arialabel_text_default;
  11631. },
  11632. arialabelledbyText: function arialabelledbyText() {
  11633. return arialabelledby_text_default;
  11634. },
  11635. getAccessibleRefs: function getAccessibleRefs() {
  11636. return get_accessible_refs_default;
  11637. },
  11638. getElementUnallowedRoles: function getElementUnallowedRoles() {
  11639. return get_element_unallowed_roles_default;
  11640. },
  11641. getExplicitRole: function getExplicitRole() {
  11642. return get_explicit_role_default;
  11643. },
  11644. getOwnedVirtual: function getOwnedVirtual() {
  11645. return get_owned_virtual_default;
  11646. },
  11647. getRole: function getRole() {
  11648. return get_role_default;
  11649. },
  11650. getRoleType: function getRoleType() {
  11651. return get_role_type_default;
  11652. },
  11653. getRolesByType: function getRolesByType() {
  11654. return get_roles_by_type_default;
  11655. },
  11656. getRolesWithNameFromContents: function getRolesWithNameFromContents() {
  11657. return get_roles_with_name_from_contents_default;
  11658. },
  11659. implicitNodes: function implicitNodes() {
  11660. return implicit_nodes_default;
  11661. },
  11662. implicitRole: function implicitRole() {
  11663. return implicit_role_default;
  11664. },
  11665. isAccessibleRef: function isAccessibleRef() {
  11666. return is_accessible_ref_default;
  11667. },
  11668. isAriaRoleAllowedOnElement: function isAriaRoleAllowedOnElement() {
  11669. return is_aria_role_allowed_on_element_default;
  11670. },
  11671. isUnsupportedRole: function isUnsupportedRole() {
  11672. return is_unsupported_role_default;
  11673. },
  11674. isValidRole: function isValidRole() {
  11675. return is_valid_role_default;
  11676. },
  11677. label: function label() {
  11678. return label_default2;
  11679. },
  11680. labelVirtual: function labelVirtual() {
  11681. return label_virtual_default;
  11682. },
  11683. lookupTable: function lookupTable() {
  11684. return lookup_table_default;
  11685. },
  11686. namedFromContents: function namedFromContents() {
  11687. return named_from_contents_default;
  11688. },
  11689. requiredAttr: function requiredAttr() {
  11690. return required_attr_default;
  11691. },
  11692. requiredContext: function requiredContext() {
  11693. return required_context_default;
  11694. },
  11695. requiredOwned: function requiredOwned() {
  11696. return required_owned_default;
  11697. },
  11698. validateAttr: function validateAttr() {
  11699. return validate_attr_default;
  11700. },
  11701. validateAttrValue: function validateAttrValue() {
  11702. return validate_attr_value_default;
  11703. }
  11704. });
  11705. function getGlobalAriaAttrs() {
  11706. if (cache_default.get('globalAriaAttrs')) {
  11707. return cache_default.get('globalAriaAttrs');
  11708. }
  11709. var globalAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attrName) {
  11710. return standards_default.ariaAttrs[attrName].global;
  11711. });
  11712. cache_default.set('globalAriaAttrs', globalAttrs);
  11713. return globalAttrs;
  11714. }
  11715. var get_global_aria_attrs_default = getGlobalAriaAttrs;
  11716. function allowedAttr(role) {
  11717. var roleDef = standards_default.ariaRoles[role];
  11718. var attrs = _toConsumableArray(get_global_aria_attrs_default());
  11719. if (!roleDef) {
  11720. return attrs;
  11721. }
  11722. if (roleDef.allowedAttrs) {
  11723. attrs.push.apply(attrs, _toConsumableArray(roleDef.allowedAttrs));
  11724. }
  11725. if (roleDef.requiredAttrs) {
  11726. attrs.push.apply(attrs, _toConsumableArray(roleDef.requiredAttrs));
  11727. }
  11728. return attrs;
  11729. }
  11730. var allowed_attr_default = allowedAttr;
  11731. function arialabelText(vNode) {
  11732. if (!(vNode instanceof abstract_virtual_node_default)) {
  11733. if (vNode.nodeType !== 1) {
  11734. return '';
  11735. }
  11736. vNode = get_node_from_tree_default(vNode);
  11737. }
  11738. return vNode.attr('aria-label') || '';
  11739. }
  11740. var arialabel_text_default = arialabelText;
  11741. function isUnsupportedRole(role) {
  11742. var roleDefinition = standards_default.ariaRoles[role];
  11743. return roleDefinition ? !!roleDefinition.unsupported : false;
  11744. }
  11745. var is_unsupported_role_default = isUnsupportedRole;
  11746. function isValidRole(role) {
  11747. var _ref29 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, allowAbstract = _ref29.allowAbstract, _ref29$flagUnsupporte = _ref29.flagUnsupported, flagUnsupported = _ref29$flagUnsupporte === void 0 ? false : _ref29$flagUnsupporte;
  11748. var roleDefinition = standards_default.ariaRoles[role];
  11749. var isRoleUnsupported = is_unsupported_role_default(role);
  11750. if (!roleDefinition || flagUnsupported && isRoleUnsupported) {
  11751. return false;
  11752. }
  11753. return allowAbstract ? true : roleDefinition.type !== 'abstract';
  11754. }
  11755. var is_valid_role_default = isValidRole;
  11756. function getExplicitRole(vNode) {
  11757. var _ref30 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, fallback = _ref30.fallback, abstracts = _ref30.abstracts, dpub = _ref30.dpub;
  11758. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  11759. if (vNode.props.nodeType !== 1) {
  11760. return null;
  11761. }
  11762. var roleAttr = (vNode.attr('role') || '').trim().toLowerCase();
  11763. var roleList = fallback ? token_list_default(roleAttr) : [ roleAttr ];
  11764. var firstValidRole = roleList.find(function(role) {
  11765. if (!dpub && role.substr(0, 4) === 'doc-') {
  11766. return false;
  11767. }
  11768. return is_valid_role_default(role, {
  11769. allowAbstract: abstracts
  11770. });
  11771. });
  11772. return firstValidRole || null;
  11773. }
  11774. var get_explicit_role_default = getExplicitRole;
  11775. function getElementsByContentType(type) {
  11776. return Object.keys(standards_default.htmlElms).filter(function(nodeName2) {
  11777. var elm = standards_default.htmlElms[nodeName2];
  11778. if (elm.contentTypes) {
  11779. return elm.contentTypes.includes(type);
  11780. }
  11781. if (!elm.variant) {
  11782. return false;
  11783. }
  11784. if (elm.variant['default'] && elm.variant['default'].contentTypes) {
  11785. return elm.variant['default'].contentTypes.includes(type);
  11786. }
  11787. return false;
  11788. });
  11789. }
  11790. var get_elements_by_content_type_default = getElementsByContentType;
  11791. function toGrid(node) {
  11792. var table5 = [];
  11793. var rows = node.rows;
  11794. for (var i = 0, rowLength = rows.length; i < rowLength; i++) {
  11795. var cells = rows[i].cells;
  11796. table5[i] = table5[i] || [];
  11797. var columnIndex = 0;
  11798. for (var j = 0, cellLength = cells.length; j < cellLength; j++) {
  11799. for (var colSpan = 0; colSpan < cells[j].colSpan; colSpan++) {
  11800. for (var rowSpan = 0; rowSpan < cells[j].rowSpan; rowSpan++) {
  11801. table5[i + rowSpan] = table5[i + rowSpan] || [];
  11802. while (table5[i + rowSpan][columnIndex]) {
  11803. columnIndex++;
  11804. }
  11805. table5[i + rowSpan][columnIndex] = cells[j];
  11806. }
  11807. columnIndex++;
  11808. }
  11809. }
  11810. }
  11811. return table5;
  11812. }
  11813. var to_grid_default = memoize_default(toGrid);
  11814. function getCellPosition(cell, tableGrid) {
  11815. var rowIndex, index;
  11816. if (!tableGrid) {
  11817. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  11818. }
  11819. for (rowIndex = 0; rowIndex < tableGrid.length; rowIndex++) {
  11820. if (tableGrid[rowIndex]) {
  11821. index = tableGrid[rowIndex].indexOf(cell);
  11822. if (index !== -1) {
  11823. return {
  11824. x: index,
  11825. y: rowIndex
  11826. };
  11827. }
  11828. }
  11829. }
  11830. }
  11831. var get_cell_position_default = memoize_default(getCellPosition);
  11832. function getScope(cell) {
  11833. var scope = cell.getAttribute('scope');
  11834. var role = cell.getAttribute('role');
  11835. if (cell instanceof window.Element === false || [ 'TD', 'TH' ].indexOf(cell.nodeName.toUpperCase()) === -1) {
  11836. throw new TypeError('Expected TD or TH element');
  11837. }
  11838. if (role === 'columnheader') {
  11839. return 'col';
  11840. } else if (role === 'rowheader') {
  11841. return 'row';
  11842. } else if (scope === 'col' || scope === 'row') {
  11843. return scope;
  11844. } else if (cell.nodeName.toUpperCase() !== 'TH') {
  11845. return false;
  11846. }
  11847. var tableGrid = to_grid_default(find_up_default(cell, 'table'));
  11848. var pos = get_cell_position_default(cell, tableGrid);
  11849. var headerRow = tableGrid[pos.y].reduce(function(headerRow2, cell2) {
  11850. return headerRow2 && cell2.nodeName.toUpperCase() === 'TH';
  11851. }, true);
  11852. if (headerRow) {
  11853. return 'col';
  11854. }
  11855. var headerCol = tableGrid.map(function(col) {
  11856. return col[pos.x];
  11857. }).reduce(function(headerCol2, cell2) {
  11858. return headerCol2 && cell2 && cell2.nodeName.toUpperCase() === 'TH';
  11859. }, true);
  11860. if (headerCol) {
  11861. return 'row';
  11862. }
  11863. return 'auto';
  11864. }
  11865. var get_scope_default = getScope;
  11866. function isColumnHeader(element) {
  11867. return [ 'col', 'auto' ].indexOf(get_scope_default(element)) !== -1;
  11868. }
  11869. var is_column_header_default = isColumnHeader;
  11870. function isRowHeader(cell) {
  11871. return [ 'row', 'auto' ].includes(get_scope_default(cell));
  11872. }
  11873. var is_row_header_default = isRowHeader;
  11874. var sectioningElementSelector = get_elements_by_content_type_default('sectioning').map(function(nodeName2) {
  11875. return ''.concat(nodeName2, ':not([role])');
  11876. }).join(', ') + ' , main:not([role]), [role=article], [role=complementary], [role=main], [role=navigation], [role=region]';
  11877. function hasAccessibleName(vNode) {
  11878. var ariaLabelledby = sanitize_default(arialabelledby_text_default(vNode));
  11879. var ariaLabel = sanitize_default(arialabel_text_default(vNode));
  11880. return !!(ariaLabelledby || ariaLabel);
  11881. }
  11882. var implicitHtmlRoles = {
  11883. a: function a(vNode) {
  11884. return vNode.hasAttr('href') ? 'link' : null;
  11885. },
  11886. area: function area(vNode) {
  11887. return vNode.hasAttr('href') ? 'link' : null;
  11888. },
  11889. article: 'article',
  11890. aside: 'complementary',
  11891. body: 'document',
  11892. button: 'button',
  11893. datalist: 'listbox',
  11894. dd: 'definition',
  11895. dfn: 'term',
  11896. details: 'group',
  11897. dialog: 'dialog',
  11898. dt: 'term',
  11899. fieldset: 'group',
  11900. figure: 'figure',
  11901. footer: function footer(vNode) {
  11902. var sectioningElement = closest_default(vNode, sectioningElementSelector);
  11903. return !sectioningElement ? 'contentinfo' : null;
  11904. },
  11905. form: function form(vNode) {
  11906. return hasAccessibleName(vNode) ? 'form' : null;
  11907. },
  11908. h1: 'heading',
  11909. h2: 'heading',
  11910. h3: 'heading',
  11911. h4: 'heading',
  11912. h5: 'heading',
  11913. h6: 'heading',
  11914. header: function header(vNode) {
  11915. var sectioningElement = closest_default(vNode, sectioningElementSelector);
  11916. return !sectioningElement ? 'banner' : null;
  11917. },
  11918. hr: 'separator',
  11919. img: function img(vNode) {
  11920. var emptyAlt = vNode.hasAttr('alt') && !vNode.attr('alt');
  11921. var hasGlobalAria = get_global_aria_attrs_default().find(function(attr) {
  11922. return vNode.hasAttr(attr);
  11923. });
  11924. return emptyAlt && !hasGlobalAria && !is_focusable_default(vNode) ? 'presentation' : 'img';
  11925. },
  11926. input: function input(vNode) {
  11927. var suggestionsSourceElement;
  11928. if (vNode.hasAttr('list')) {
  11929. var listElement = idrefs_default(vNode.actualNode, 'list').filter(function(node) {
  11930. return !!node;
  11931. })[0];
  11932. suggestionsSourceElement = listElement && listElement.nodeName.toLowerCase() === 'datalist';
  11933. }
  11934. switch (vNode.props.type) {
  11935. case 'button':
  11936. case 'image':
  11937. case 'reset':
  11938. case 'submit':
  11939. return 'button';
  11940. case 'checkbox':
  11941. return 'checkbox';
  11942. case 'email':
  11943. case 'tel':
  11944. case 'text':
  11945. case 'url':
  11946. case '':
  11947. return !suggestionsSourceElement ? 'textbox' : 'combobox';
  11948. case 'number':
  11949. return 'spinbutton';
  11950. case 'radio':
  11951. return 'radio';
  11952. case 'range':
  11953. return 'slider';
  11954. case 'search':
  11955. return !suggestionsSourceElement ? 'searchbox' : 'combobox';
  11956. }
  11957. },
  11958. li: 'listitem',
  11959. main: 'main',
  11960. math: 'math',
  11961. menu: 'list',
  11962. nav: 'navigation',
  11963. ol: 'list',
  11964. optgroup: 'group',
  11965. option: 'option',
  11966. output: 'status',
  11967. progress: 'progressbar',
  11968. section: function section(vNode) {
  11969. return hasAccessibleName(vNode) ? 'region' : null;
  11970. },
  11971. select: function select(vNode) {
  11972. return vNode.hasAttr('multiple') || parseInt(vNode.attr('size')) > 1 ? 'listbox' : 'combobox';
  11973. },
  11974. summary: 'button',
  11975. table: 'table',
  11976. tbody: 'rowgroup',
  11977. td: function td(vNode) {
  11978. var table5 = closest_default(vNode, 'table');
  11979. var role = get_explicit_role_default(table5);
  11980. return [ 'grid', 'treegrid' ].includes(role) ? 'gridcell' : 'cell';
  11981. },
  11982. textarea: 'textbox',
  11983. tfoot: 'rowgroup',
  11984. th: function th(vNode) {
  11985. if (is_column_header_default(vNode.actualNode)) {
  11986. return 'columnheader';
  11987. }
  11988. if (is_row_header_default(vNode.actualNode)) {
  11989. return 'rowheader';
  11990. }
  11991. },
  11992. thead: 'rowgroup',
  11993. tr: 'row',
  11994. ul: 'list'
  11995. };
  11996. var implicit_html_roles_default = implicitHtmlRoles;
  11997. function implicitRole(node) {
  11998. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  11999. node = vNode.actualNode;
  12000. if (!vNode) {
  12001. throw new ReferenceError('Cannot get implicit role of a node outside the current scope.');
  12002. }
  12003. if (node && node.namespaceURI === 'http://www.w3.org/2000/svg') {
  12004. return null;
  12005. }
  12006. var nodeName2 = vNode.props.nodeName;
  12007. var role = implicit_html_roles_default[nodeName2];
  12008. if (!role) {
  12009. return null;
  12010. }
  12011. if (typeof role === 'function') {
  12012. return role(vNode);
  12013. }
  12014. return role;
  12015. }
  12016. var implicit_role_default = implicitRole;
  12017. var inheritsPresentationChain = {
  12018. td: [ 'tr' ],
  12019. th: [ 'tr' ],
  12020. tr: [ 'thead', 'tbody', 'tfoot', 'table' ],
  12021. thead: [ 'table' ],
  12022. tbody: [ 'table' ],
  12023. tfoot: [ 'table' ],
  12024. li: [ 'ol', 'ul' ],
  12025. dt: [ 'dl', 'div' ],
  12026. dd: [ 'dl', 'div' ],
  12027. div: [ 'dl' ]
  12028. };
  12029. function getInheritedRole(vNode, explicitRoleOptions) {
  12030. var parentNodeNames = inheritsPresentationChain[vNode.props.nodeName];
  12031. if (!parentNodeNames) {
  12032. return null;
  12033. }
  12034. if (!vNode.parent) {
  12035. throw new ReferenceError('Cannot determine role presentational inheritance of a required parent outside the current scope.');
  12036. }
  12037. if (!parentNodeNames.includes(vNode.parent.props.nodeName)) {
  12038. return null;
  12039. }
  12040. var parentRole = get_explicit_role_default(vNode.parent, explicitRoleOptions);
  12041. if ([ 'none', 'presentation' ].includes(parentRole) && !hasConflictResolution(vNode.parent)) {
  12042. return parentRole;
  12043. }
  12044. if (parentRole) {
  12045. return null;
  12046. }
  12047. return getInheritedRole(vNode.parent, explicitRoleOptions);
  12048. }
  12049. function resolveImplicitRole(vNode, explicitRoleOptions) {
  12050. var implicitRole3 = implicit_role_default(vNode);
  12051. if (!implicitRole3) {
  12052. return null;
  12053. }
  12054. var presentationalRole = getInheritedRole(vNode, explicitRoleOptions);
  12055. if (presentationalRole) {
  12056. return presentationalRole;
  12057. }
  12058. return implicitRole3;
  12059. }
  12060. function hasConflictResolution(vNode) {
  12061. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  12062. return vNode.hasAttr(attr);
  12063. });
  12064. return hasGlobalAria || is_focusable_default(vNode);
  12065. }
  12066. function resolveRole(node) {
  12067. var _ref31 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12068. var noImplicit = _ref31.noImplicit, explicitRoleOptions = _objectWithoutProperties(_ref31, [ 'noImplicit' ]);
  12069. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12070. if (vNode.props.nodeType !== 1) {
  12071. return null;
  12072. }
  12073. var explicitRole2 = get_explicit_role_default(vNode, explicitRoleOptions);
  12074. if (!explicitRole2) {
  12075. return noImplicit ? null : resolveImplicitRole(vNode, explicitRoleOptions);
  12076. }
  12077. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  12078. return explicitRole2;
  12079. }
  12080. if (hasConflictResolution(vNode)) {
  12081. return noImplicit ? null : resolveImplicitRole(vNode, explicitRoleOptions);
  12082. }
  12083. return explicitRole2;
  12084. }
  12085. function getRole(node) {
  12086. var _ref32 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12087. var noPresentational = _ref32.noPresentational, options = _objectWithoutProperties(_ref32, [ 'noPresentational' ]);
  12088. var role = resolveRole(node, options);
  12089. if (noPresentational && [ 'presentation', 'none' ].includes(role)) {
  12090. return null;
  12091. }
  12092. return role;
  12093. }
  12094. var get_role_default = getRole;
  12095. function fromPrimative(someString, matcher) {
  12096. var matcherType = _typeof(matcher);
  12097. if (Array.isArray(matcher) && typeof someString !== 'undefined') {
  12098. return matcher.includes(someString);
  12099. }
  12100. if (matcherType === 'function') {
  12101. return !!matcher(someString);
  12102. }
  12103. if (someString !== null && someString !== void 0) {
  12104. if (matcher instanceof RegExp) {
  12105. return matcher.test(someString);
  12106. }
  12107. if (/^\/.*\/$/.test(matcher)) {
  12108. var pattern = matcher.substring(1, matcher.length - 1);
  12109. return new RegExp(pattern).test(someString);
  12110. }
  12111. }
  12112. return matcher === someString;
  12113. }
  12114. var from_primative_default = fromPrimative;
  12115. function fromFunction(getValue, matcher) {
  12116. var matcherType = _typeof(matcher);
  12117. if (matcherType !== 'object' || Array.isArray(matcher) || matcher instanceof RegExp) {
  12118. throw new Error('Expect matcher to be an object');
  12119. }
  12120. return Object.keys(matcher).every(function(propName) {
  12121. return from_primative_default(getValue(propName), matcher[propName]);
  12122. });
  12123. }
  12124. var from_function_default = fromFunction;
  12125. function attributes(vNode, matcher) {
  12126. if (!(vNode instanceof abstract_virtual_node_default)) {
  12127. vNode = get_node_from_tree_default(vNode);
  12128. }
  12129. return from_function_default(function(attrName) {
  12130. return vNode.attr(attrName);
  12131. }, matcher);
  12132. }
  12133. var attributes_default = attributes;
  12134. function condition(arg, condition4) {
  12135. return !!condition4(arg);
  12136. }
  12137. var condition_default = condition;
  12138. function explicitRole(vNode, matcher) {
  12139. return from_primative_default(get_explicit_role_default(vNode), matcher);
  12140. }
  12141. var explicit_role_default = explicitRole;
  12142. function implicitRole2(vNode, matcher) {
  12143. return from_primative_default(implicit_role_default(vNode), matcher);
  12144. }
  12145. var implicit_role_default2 = implicitRole2;
  12146. function nodeName(vNode, matcher) {
  12147. if (!(vNode instanceof abstract_virtual_node_default)) {
  12148. vNode = get_node_from_tree_default(vNode);
  12149. }
  12150. return from_primative_default(vNode.props.nodeName, matcher);
  12151. }
  12152. var node_name_default = nodeName;
  12153. function properties(vNode, matcher) {
  12154. if (!(vNode instanceof abstract_virtual_node_default)) {
  12155. vNode = get_node_from_tree_default(vNode);
  12156. }
  12157. return from_function_default(function(propName) {
  12158. return vNode.props[propName];
  12159. }, matcher);
  12160. }
  12161. var properties_default = properties;
  12162. function semanticRole(vNode, matcher) {
  12163. return from_primative_default(get_role_default(vNode), matcher);
  12164. }
  12165. var semantic_role_default = semanticRole;
  12166. var matchers = {
  12167. attributes: attributes_default,
  12168. condition: condition_default,
  12169. explicitRole: explicit_role_default,
  12170. implicitRole: implicit_role_default2,
  12171. nodeName: node_name_default,
  12172. properties: properties_default,
  12173. semanticRole: semantic_role_default
  12174. };
  12175. function fromDefinition(vNode, definition) {
  12176. if (!(vNode instanceof abstract_virtual_node_default)) {
  12177. vNode = get_node_from_tree_default(vNode);
  12178. }
  12179. if (Array.isArray(definition)) {
  12180. return definition.some(function(definitionItem) {
  12181. return fromDefinition(vNode, definitionItem);
  12182. });
  12183. }
  12184. if (typeof definition === 'string') {
  12185. return matches_default(vNode, definition);
  12186. }
  12187. return Object.keys(definition).every(function(matcherName) {
  12188. if (!matchers[matcherName]) {
  12189. throw new Error('Unknown matcher type "'.concat(matcherName, '"'));
  12190. }
  12191. var matchMethod = matchers[matcherName];
  12192. var matcher = definition[matcherName];
  12193. return matchMethod(vNode, matcher);
  12194. });
  12195. }
  12196. var from_definition_default = fromDefinition;
  12197. function matches5(vNode, definition) {
  12198. return from_definition_default(vNode, definition);
  12199. }
  12200. var matches_default2 = matches5;
  12201. matches_default2.attributes = attributes_default;
  12202. matches_default2.condition = condition_default;
  12203. matches_default2.explicitRole = explicit_role_default;
  12204. matches_default2.fromDefinition = from_definition_default;
  12205. matches_default2.fromFunction = from_function_default;
  12206. matches_default2.fromPrimative = from_primative_default;
  12207. matches_default2.implicitRole = implicit_role_default2;
  12208. matches_default2.nodeName = node_name_default;
  12209. matches_default2.properties = properties_default;
  12210. matches_default2.semanticRole = semantic_role_default;
  12211. var matches_default3 = matches_default2;
  12212. function getElementSpec(vNode) {
  12213. var standard = standards_default.htmlElms[vNode.props.nodeName];
  12214. if (!standard) {
  12215. return {};
  12216. }
  12217. if (!standard.variant) {
  12218. return standard;
  12219. }
  12220. var variant = standard.variant, spec = _objectWithoutProperties(standard, [ 'variant' ]);
  12221. for (var variantName in variant) {
  12222. if (!variant.hasOwnProperty(variantName) || variantName === 'default') {
  12223. continue;
  12224. }
  12225. var _variant$variantName = variant[variantName], matches13 = _variant$variantName.matches, props = _objectWithoutProperties(_variant$variantName, [ 'matches' ]);
  12226. if (matches_default3(vNode, matches13)) {
  12227. for (var propName in props) {
  12228. if (props.hasOwnProperty(propName)) {
  12229. spec[propName] = props[propName];
  12230. }
  12231. }
  12232. }
  12233. }
  12234. for (var _propName in variant['default']) {
  12235. if (variant['default'].hasOwnProperty(_propName) && typeof spec[_propName] === 'undefined') {
  12236. spec[_propName] = variant['default'][_propName];
  12237. }
  12238. }
  12239. return spec;
  12240. }
  12241. var get_element_spec_default = getElementSpec;
  12242. var alwaysTitleElements = [ 'iframe' ];
  12243. function titleText(node) {
  12244. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12245. if (vNode.props.nodeType !== 1 || !node.hasAttr('title')) {
  12246. return '';
  12247. }
  12248. if (!matches_default2(vNode, alwaysTitleElements) && [ 'none', 'presentation' ].includes(get_role_default(vNode))) {
  12249. return '';
  12250. }
  12251. return vNode.attr('title');
  12252. }
  12253. var title_text_default = titleText;
  12254. function namedFromContents(vNode) {
  12255. var _ref33 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, strict = _ref33.strict;
  12256. vNode = vNode instanceof abstract_virtual_node_default ? vNode : get_node_from_tree_default(vNode);
  12257. if (vNode.props.nodeType !== 1) {
  12258. return false;
  12259. }
  12260. var role = get_role_default(vNode);
  12261. var roleDef = standards_default.ariaRoles[role];
  12262. if (roleDef && roleDef.nameFromContent) {
  12263. return true;
  12264. }
  12265. if (strict) {
  12266. return false;
  12267. }
  12268. return !roleDef || [ 'presentation', 'none' ].includes(role);
  12269. }
  12270. var named_from_contents_default = namedFromContents;
  12271. function getOwnedVirtual(virtualNode) {
  12272. var actualNode = virtualNode.actualNode, children = virtualNode.children;
  12273. if (!children) {
  12274. throw new Error('getOwnedVirtual requires a virtual node');
  12275. }
  12276. if (virtualNode.hasAttr('aria-owns')) {
  12277. var owns = idrefs_default(actualNode, 'aria-owns').filter(function(element) {
  12278. return !!element;
  12279. }).map(function(element) {
  12280. return axe.utils.getNodeFromTree(element);
  12281. });
  12282. return [].concat(_toConsumableArray(children), _toConsumableArray(owns));
  12283. }
  12284. return _toConsumableArray(children);
  12285. }
  12286. var get_owned_virtual_default = getOwnedVirtual;
  12287. function subtreeText(virtualNode) {
  12288. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12289. var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
  12290. context3.startNode = context3.startNode || virtualNode;
  12291. var _context = context3, strict = _context.strict, inControlContext = _context.inControlContext, inLabelledByContext = _context.inLabelledByContext;
  12292. if (alreadyProcessed2(virtualNode, context3) || virtualNode.props.nodeType !== 1) {
  12293. return '';
  12294. }
  12295. if (!named_from_contents_default(virtualNode, {
  12296. strict: strict
  12297. }) && !context3.subtreeDescendant) {
  12298. return '';
  12299. }
  12300. if (!strict) {
  12301. var subtreeDescendant = !inControlContext && !inLabelledByContext;
  12302. context3 = _extends({
  12303. subtreeDescendant: subtreeDescendant
  12304. }, context3);
  12305. }
  12306. return get_owned_virtual_default(virtualNode).reduce(function(contentText, child) {
  12307. return appendAccessibleText(contentText, child, context3);
  12308. }, '');
  12309. }
  12310. var phrasingElements = [ '#text', 'a', 'abbr', 'area', 'b', 'bdi', 'bdo', 'button', 'canvas', 'cite', 'code', 'command', 'datalist', 'del', 'dfn', 'em', 'i', 'ins', 'kbd', 'keygen', 'label', 'map', 'mark', 'meter', 'noscript', 'output', 'progress', 'q', 'ruby', 's', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'time', 'u', 'var', 'wbr' ];
  12311. function appendAccessibleText(contentText, virtualNode, context3) {
  12312. var nodeName2 = virtualNode.props.nodeName;
  12313. var contentTextAdd = accessible_text_virtual_default(virtualNode, context3);
  12314. if (!contentTextAdd) {
  12315. return contentText;
  12316. }
  12317. if (!phrasingElements.includes(nodeName2)) {
  12318. if (contentTextAdd[0] !== ' ') {
  12319. contentTextAdd += ' ';
  12320. }
  12321. if (contentText && contentText[contentText.length - 1] !== ' ') {
  12322. contentTextAdd = ' ' + contentTextAdd;
  12323. }
  12324. }
  12325. return contentText + contentTextAdd;
  12326. }
  12327. var subtree_text_default = subtreeText;
  12328. function labelText(virtualNode) {
  12329. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12330. var alreadyProcessed2 = accessible_text_virtual_default.alreadyProcessed;
  12331. if (context3.inControlContext || context3.inLabelledByContext || alreadyProcessed2(virtualNode, context3)) {
  12332. return '';
  12333. }
  12334. if (!context3.startNode) {
  12335. context3.startNode = virtualNode;
  12336. }
  12337. var labelContext = _extends({
  12338. inControlContext: true
  12339. }, context3);
  12340. var explicitLabels = getExplicitLabels(virtualNode);
  12341. var implicitLabel = closest_default(virtualNode, 'label');
  12342. var labels;
  12343. if (implicitLabel) {
  12344. labels = [].concat(_toConsumableArray(explicitLabels), [ implicitLabel.actualNode ]);
  12345. labels.sort(node_sorter_default);
  12346. } else {
  12347. labels = explicitLabels;
  12348. }
  12349. return labels.map(function(label5) {
  12350. return accessible_text_default(label5, labelContext);
  12351. }).filter(function(text31) {
  12352. return text31 !== '';
  12353. }).join(' ');
  12354. }
  12355. function getExplicitLabels(virtualNode) {
  12356. if (!virtualNode.attr('id')) {
  12357. return [];
  12358. }
  12359. if (!virtualNode.actualNode) {
  12360. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  12361. }
  12362. return find_elms_in_context_default({
  12363. elm: 'label',
  12364. attr: 'for',
  12365. value: virtualNode.attr('id'),
  12366. context: virtualNode.actualNode
  12367. });
  12368. }
  12369. var label_text_default = labelText;
  12370. var defaultButtonValues = {
  12371. submit: 'Submit',
  12372. image: 'Submit',
  12373. reset: 'Reset',
  12374. button: ''
  12375. };
  12376. var nativeTextMethods = {
  12377. valueText: function valueText(_ref34) {
  12378. var actualNode = _ref34.actualNode;
  12379. return actualNode.value || '';
  12380. },
  12381. buttonDefaultText: function buttonDefaultText(_ref35) {
  12382. var actualNode = _ref35.actualNode;
  12383. return defaultButtonValues[actualNode.type] || '';
  12384. },
  12385. tableCaptionText: descendantText.bind(null, 'caption'),
  12386. figureText: descendantText.bind(null, 'figcaption'),
  12387. svgTitleText: descendantText.bind(null, 'title'),
  12388. fieldsetLegendText: descendantText.bind(null, 'legend'),
  12389. altText: attrText.bind(null, 'alt'),
  12390. tableSummaryText: attrText.bind(null, 'summary'),
  12391. titleText: title_text_default,
  12392. subtreeText: subtree_text_default,
  12393. labelText: label_text_default,
  12394. singleSpace: function singleSpace() {
  12395. return ' ';
  12396. },
  12397. placeholderText: attrText.bind(null, 'placeholder')
  12398. };
  12399. function attrText(attr, vNode) {
  12400. return vNode.attr(attr) || '';
  12401. }
  12402. function descendantText(nodeName2, _ref36, context3) {
  12403. var actualNode = _ref36.actualNode;
  12404. nodeName2 = nodeName2.toLowerCase();
  12405. var nodeNames = [ nodeName2, actualNode.nodeName.toLowerCase() ].join(',');
  12406. var candidate = actualNode.querySelector(nodeNames);
  12407. if (!candidate || candidate.nodeName.toLowerCase() !== nodeName2) {
  12408. return '';
  12409. }
  12410. return accessible_text_default(candidate, context3);
  12411. }
  12412. var native_text_methods_default = nativeTextMethods;
  12413. function nativeTextAlternative(virtualNode) {
  12414. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12415. var actualNode = virtualNode.actualNode;
  12416. if (virtualNode.props.nodeType !== 1 || [ 'presentation', 'none' ].includes(get_role_default(virtualNode))) {
  12417. return '';
  12418. }
  12419. var textMethods = findTextMethods(virtualNode);
  12420. var accName = textMethods.reduce(function(accName2, step) {
  12421. return accName2 || step(virtualNode, context3);
  12422. }, '');
  12423. if (context3.debug) {
  12424. axe.log(accName || '{empty-value}', actualNode, context3);
  12425. }
  12426. return accName;
  12427. }
  12428. function findTextMethods(virtualNode) {
  12429. var elmSpec = get_element_spec_default(virtualNode);
  12430. var methods = elmSpec.namingMethods || [];
  12431. return methods.map(function(methodName) {
  12432. return native_text_methods_default[methodName];
  12433. });
  12434. }
  12435. var native_text_alternative_default = nativeTextAlternative;
  12436. var unsupported = {
  12437. accessibleNameFromFieldValue: [ 'combobox', 'listbox', 'progressbar' ]
  12438. };
  12439. var unsupported_default = unsupported;
  12440. var nonTextInputTypes = [ 'button', 'checkbox', 'color', 'file', 'hidden', 'image', 'password', 'radio', 'reset', 'submit' ];
  12441. function isNativeTextbox(node) {
  12442. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12443. var nodeName2 = node.props.nodeName;
  12444. return nodeName2 === 'textarea' || nodeName2 === 'input' && !nonTextInputTypes.includes((node.attr('type') || '').toLowerCase());
  12445. }
  12446. var is_native_textbox_default = isNativeTextbox;
  12447. function isNativeSelect(node) {
  12448. node = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12449. var nodeName2 = node.props.nodeName;
  12450. return nodeName2 === 'select';
  12451. }
  12452. var is_native_select_default = isNativeSelect;
  12453. function isAriaTextbox(node) {
  12454. var role = get_explicit_role_default(node);
  12455. return role === 'textbox';
  12456. }
  12457. var is_aria_textbox_default = isAriaTextbox;
  12458. function isAriaListbox(node) {
  12459. var role = get_explicit_role_default(node);
  12460. return role === 'listbox';
  12461. }
  12462. var is_aria_listbox_default = isAriaListbox;
  12463. function isAriaCombobox(node) {
  12464. var role = get_explicit_role_default(node);
  12465. return role === 'combobox';
  12466. }
  12467. var is_aria_combobox_default = isAriaCombobox;
  12468. var rangeRoles = [ 'progressbar', 'scrollbar', 'slider', 'spinbutton' ];
  12469. function isAriaRange(node) {
  12470. var role = get_explicit_role_default(node);
  12471. return rangeRoles.includes(role);
  12472. }
  12473. var is_aria_range_default = isAriaRange;
  12474. var controlValueRoles = [ 'textbox', 'progressbar', 'scrollbar', 'slider', 'spinbutton', 'combobox', 'listbox' ];
  12475. var _formControlValueMethods = {
  12476. nativeTextboxValue: nativeTextboxValue,
  12477. nativeSelectValue: nativeSelectValue,
  12478. ariaTextboxValue: ariaTextboxValue,
  12479. ariaListboxValue: ariaListboxValue,
  12480. ariaComboboxValue: ariaComboboxValue,
  12481. ariaRangeValue: ariaRangeValue
  12482. };
  12483. function formControlValue(virtualNode) {
  12484. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12485. var actualNode = virtualNode.actualNode;
  12486. var unsupportedRoles = unsupported_default.accessibleNameFromFieldValue || [];
  12487. var role = get_role_default(virtualNode);
  12488. if (context3.startNode === virtualNode || !controlValueRoles.includes(role) || unsupportedRoles.includes(role)) {
  12489. return '';
  12490. }
  12491. var valueMethods = Object.keys(_formControlValueMethods).map(function(name) {
  12492. return _formControlValueMethods[name];
  12493. });
  12494. var valueString = valueMethods.reduce(function(accName, step) {
  12495. return accName || step(virtualNode, context3);
  12496. }, '');
  12497. if (context3.debug) {
  12498. log_default(valueString || '{empty-value}', actualNode, context3);
  12499. }
  12500. return valueString;
  12501. }
  12502. function nativeTextboxValue(node) {
  12503. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12504. if (is_native_textbox_default(vNode)) {
  12505. return vNode.props.value || '';
  12506. }
  12507. return '';
  12508. }
  12509. function nativeSelectValue(node) {
  12510. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12511. if (!is_native_select_default(vNode)) {
  12512. return '';
  12513. }
  12514. var options = query_selector_all_default(vNode, 'option');
  12515. var selectedOptions = options.filter(function(option) {
  12516. return option.hasAttr('selected');
  12517. });
  12518. if (!selectedOptions.length) {
  12519. selectedOptions.push(options[0]);
  12520. }
  12521. return selectedOptions.map(function(option) {
  12522. return visible_virtual_default(option);
  12523. }).join(' ') || '';
  12524. }
  12525. function ariaTextboxValue(node) {
  12526. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12527. var actualNode = vNode.actualNode;
  12528. if (!is_aria_textbox_default(vNode)) {
  12529. return '';
  12530. }
  12531. if (!actualNode || actualNode && !is_hidden_with_css_default(actualNode)) {
  12532. return visible_virtual_default(vNode, true);
  12533. } else {
  12534. return actualNode.textContent;
  12535. }
  12536. }
  12537. function ariaListboxValue(node, context3) {
  12538. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12539. if (!is_aria_listbox_default(vNode)) {
  12540. return '';
  12541. }
  12542. var selected = get_owned_virtual_default(vNode).filter(function(owned) {
  12543. return get_role_default(owned) === 'option' && owned.attr('aria-selected') === 'true';
  12544. });
  12545. if (selected.length === 0) {
  12546. return '';
  12547. }
  12548. return accessible_text_virtual_default(selected[0], context3);
  12549. }
  12550. function ariaComboboxValue(node, context3) {
  12551. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12552. var listbox;
  12553. if (!is_aria_combobox_default(vNode)) {
  12554. return '';
  12555. }
  12556. listbox = get_owned_virtual_default(vNode).filter(function(elm) {
  12557. return get_role_default(elm) === 'listbox';
  12558. })[0];
  12559. return listbox ? ariaListboxValue(listbox, context3) : '';
  12560. }
  12561. function ariaRangeValue(node) {
  12562. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  12563. if (!is_aria_range_default(vNode) || !vNode.hasAttr('aria-valuenow')) {
  12564. return '';
  12565. }
  12566. var valueNow = +vNode.attr('aria-valuenow');
  12567. return !isNaN(valueNow) ? String(valueNow) : '0';
  12568. }
  12569. var form_control_value_default = formControlValue;
  12570. function accessibleTextVirtual(virtualNode) {
  12571. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12572. var actualNode = virtualNode.actualNode;
  12573. context3 = prepareContext(virtualNode, context3);
  12574. if (shouldIgnoreHidden(virtualNode, context3)) {
  12575. return '';
  12576. }
  12577. var computationSteps = [ arialabelledby_text_default, arialabel_text_default, native_text_alternative_default, form_control_value_default, subtree_text_default, textNodeValue, title_text_default ];
  12578. var accName = computationSteps.reduce(function(accName2, step) {
  12579. if (context3.startNode === virtualNode) {
  12580. accName2 = sanitize_default(accName2);
  12581. }
  12582. if (accName2 !== '') {
  12583. return accName2;
  12584. }
  12585. return step(virtualNode, context3);
  12586. }, '');
  12587. if (context3.debug) {
  12588. axe.log(accName || '{empty-value}', actualNode, context3);
  12589. }
  12590. return accName;
  12591. }
  12592. function textNodeValue(virtualNode) {
  12593. if (virtualNode.props.nodeType !== 3) {
  12594. return '';
  12595. }
  12596. return virtualNode.props.nodeValue;
  12597. }
  12598. function shouldIgnoreHidden(_ref37, context3) {
  12599. var actualNode = _ref37.actualNode;
  12600. if (!actualNode) {
  12601. return false;
  12602. }
  12603. if (actualNode.nodeType !== 1 || context3.includeHidden) {
  12604. return false;
  12605. }
  12606. return !is_visible_default(actualNode, true);
  12607. }
  12608. function prepareContext(virtualNode, context3) {
  12609. var actualNode = virtualNode.actualNode;
  12610. if (!context3.startNode) {
  12611. context3 = _extends({
  12612. startNode: virtualNode
  12613. }, context3);
  12614. }
  12615. if (!actualNode) {
  12616. return context3;
  12617. }
  12618. if (actualNode.nodeType === 1 && context3.inLabelledByContext && context3.includeHidden === void 0) {
  12619. context3 = _extends({
  12620. includeHidden: !is_visible_default(actualNode, true)
  12621. }, context3);
  12622. }
  12623. return context3;
  12624. }
  12625. accessibleTextVirtual.alreadyProcessed = function alreadyProcessed(virtualnode, context3) {
  12626. context3.processed = context3.processed || [];
  12627. if (context3.processed.includes(virtualnode)) {
  12628. return true;
  12629. }
  12630. context3.processed.push(virtualnode);
  12631. return false;
  12632. };
  12633. var accessible_text_virtual_default = accessibleTextVirtual;
  12634. function accessibleText(element, context3) {
  12635. var virtualNode = get_node_from_tree_default(element);
  12636. return accessible_text_virtual_default(virtualNode, context3);
  12637. }
  12638. var accessible_text_default = accessibleText;
  12639. function arialabelledbyText(vNode) {
  12640. var context3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  12641. if (!(vNode instanceof abstract_virtual_node_default)) {
  12642. if (vNode.nodeType !== 1) {
  12643. return '';
  12644. }
  12645. vNode = get_node_from_tree_default(vNode);
  12646. }
  12647. if (vNode.props.nodeType !== 1 || context3.inLabelledByContext || context3.inControlContext || !vNode.attr('aria-labelledby')) {
  12648. return '';
  12649. }
  12650. var refs = idrefs_default(vNode, 'aria-labelledby').filter(function(elm) {
  12651. return elm;
  12652. });
  12653. return refs.reduce(function(accessibleName, elm) {
  12654. var accessibleNameAdd = accessible_text_default(elm, _extends({
  12655. inLabelledByContext: true,
  12656. startNode: context3.startNode || vNode
  12657. }, context3));
  12658. if (!accessibleName) {
  12659. return accessibleNameAdd;
  12660. } else {
  12661. return ''.concat(accessibleName, ' ').concat(accessibleNameAdd);
  12662. }
  12663. }, '');
  12664. }
  12665. var arialabelledby_text_default = arialabelledbyText;
  12666. var text_exports = {};
  12667. __export(text_exports, {
  12668. accessibleText: function accessibleText() {
  12669. return accessible_text_default;
  12670. },
  12671. accessibleTextVirtual: function accessibleTextVirtual() {
  12672. return accessible_text_virtual_default;
  12673. },
  12674. autocomplete: function autocomplete() {
  12675. return _autocomplete;
  12676. },
  12677. formControlValue: function formControlValue() {
  12678. return form_control_value_default;
  12679. },
  12680. formControlValueMethods: function formControlValueMethods() {
  12681. return _formControlValueMethods;
  12682. },
  12683. hasUnicode: function hasUnicode() {
  12684. return has_unicode_default;
  12685. },
  12686. isHumanInterpretable: function isHumanInterpretable() {
  12687. return is_human_interpretable_default;
  12688. },
  12689. isIconLigature: function isIconLigature() {
  12690. return is_icon_ligature_default;
  12691. },
  12692. isValidAutocomplete: function isValidAutocomplete() {
  12693. return is_valid_autocomplete_default;
  12694. },
  12695. label: function label() {
  12696. return label_default;
  12697. },
  12698. labelText: function labelText() {
  12699. return label_text_default;
  12700. },
  12701. labelVirtual: function labelVirtual() {
  12702. return label_virtual_default2;
  12703. },
  12704. nativeElementType: function nativeElementType() {
  12705. return native_element_type_default;
  12706. },
  12707. nativeTextAlternative: function nativeTextAlternative() {
  12708. return native_text_alternative_default;
  12709. },
  12710. nativeTextMethods: function nativeTextMethods() {
  12711. return native_text_methods_default;
  12712. },
  12713. removeUnicode: function removeUnicode() {
  12714. return remove_unicode_default;
  12715. },
  12716. sanitize: function sanitize() {
  12717. return sanitize_default;
  12718. },
  12719. subtreeText: function subtreeText() {
  12720. return subtree_text_default;
  12721. },
  12722. titleText: function titleText() {
  12723. return title_text_default;
  12724. },
  12725. unsupported: function unsupported() {
  12726. return unsupported_default;
  12727. },
  12728. visible: function visible() {
  12729. return visible_default;
  12730. },
  12731. visibleTextNodes: function visibleTextNodes() {
  12732. return visible_text_nodes_default;
  12733. },
  12734. visibleVirtual: function visibleVirtual() {
  12735. return visible_virtual_default;
  12736. }
  12737. });
  12738. function getUnicodeNonBmpRegExp() {
  12739. return /[\u1D00-\u1D7F\u1D80-\u1DBF\u1DC0-\u1DFF\u20A0-\u20CF\u20D0-\u20FF\u2100-\u214F\u2150-\u218F\u2190-\u21FF\u2200-\u22FF\u2300-\u23FF\u2400-\u243F\u2440-\u245F\u2460-\u24FF\u2500-\u257F\u2580-\u259F\u25A0-\u25FF\u2600-\u26FF\u2700-\u27BF\uE000-\uF8FF]/g;
  12740. }
  12741. function getPunctuationRegExp() {
  12742. return /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&\xa3\xa2\xa5\xa7\u20ac()*+,\-.\/:;<=>?@\[\]^_`{|}~\xb1]/g;
  12743. }
  12744. function getSupplementaryPrivateUseRegExp() {
  12745. return /[\uDB80-\uDBBF][\uDC00-\uDFFF]/g;
  12746. }
  12747. var emoji_regex = __toModule(require_emoji_regex());
  12748. function hasUnicode(str, options) {
  12749. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  12750. if (emoji) {
  12751. return emoji_regex['default']().test(str);
  12752. }
  12753. if (nonBmp) {
  12754. return getUnicodeNonBmpRegExp().test(str) || getSupplementaryPrivateUseRegExp().test(str);
  12755. }
  12756. if (punctuations) {
  12757. return getPunctuationRegExp().test(str);
  12758. }
  12759. return false;
  12760. }
  12761. var has_unicode_default = hasUnicode;
  12762. var emoji_regex2 = __toModule(require_emoji_regex());
  12763. function removeUnicode(str, options) {
  12764. var emoji = options.emoji, nonBmp = options.nonBmp, punctuations = options.punctuations;
  12765. if (emoji) {
  12766. str = str.replace(emoji_regex2['default'](), '');
  12767. }
  12768. if (nonBmp) {
  12769. str = str.replace(getUnicodeNonBmpRegExp(), '');
  12770. str = str.replace(getSupplementaryPrivateUseRegExp(), '');
  12771. }
  12772. if (punctuations) {
  12773. str = str.replace(getPunctuationRegExp(), '');
  12774. }
  12775. return str;
  12776. }
  12777. var remove_unicode_default = removeUnicode;
  12778. function isHumanInterpretable(str) {
  12779. if (!str.length) {
  12780. return 0;
  12781. }
  12782. var alphaNumericIconMap = [ 'x', 'i' ];
  12783. if (alphaNumericIconMap.includes(str)) {
  12784. return 0;
  12785. }
  12786. var noUnicodeStr = remove_unicode_default(str, {
  12787. emoji: true,
  12788. nonBmp: true,
  12789. punctuations: true
  12790. });
  12791. if (!sanitize_default(noUnicodeStr)) {
  12792. return 0;
  12793. }
  12794. return 1;
  12795. }
  12796. var is_human_interpretable_default = isHumanInterpretable;
  12797. function isIconLigature(textVNode) {
  12798. var differenceThreshold = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : .15;
  12799. var occuranceThreshold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
  12800. var nodeValue = textVNode.actualNode.nodeValue.trim();
  12801. if (!sanitize_default(nodeValue) || has_unicode_default(nodeValue, {
  12802. emoji: true,
  12803. nonBmp: true
  12804. })) {
  12805. return false;
  12806. }
  12807. if (!cache_default.get('canvasContext')) {
  12808. cache_default.set('canvasContext', document.createElement('canvas').getContext('2d'));
  12809. }
  12810. var canvasContext = cache_default.get('canvasContext');
  12811. var canvas = canvasContext.canvas;
  12812. if (!cache_default.get('fonts')) {
  12813. cache_default.set('fonts', {});
  12814. }
  12815. var fonts = cache_default.get('fonts');
  12816. var style = window.getComputedStyle(textVNode.parent.actualNode);
  12817. var fontFamily = style.getPropertyValue('font-family');
  12818. if (!fonts[fontFamily]) {
  12819. fonts[fontFamily] = {
  12820. occurances: 0,
  12821. numLigatures: 0
  12822. };
  12823. }
  12824. var font = fonts[fontFamily];
  12825. if (font.occurances >= occuranceThreshold) {
  12826. if (font.numLigatures / font.occurances === 1) {
  12827. return true;
  12828. } else if (font.numLigatures === 0) {
  12829. return false;
  12830. }
  12831. }
  12832. font.occurances++;
  12833. var fontSize = 30;
  12834. var fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  12835. canvasContext.font = fontStyle;
  12836. var firstChar = nodeValue.charAt(0);
  12837. var width = canvasContext.measureText(firstChar).width;
  12838. if (width < 30) {
  12839. var diff = 30 / width;
  12840. width *= diff;
  12841. fontSize *= diff;
  12842. fontStyle = ''.concat(fontSize, 'px ').concat(fontFamily);
  12843. }
  12844. canvas.width = width;
  12845. canvas.height = fontSize;
  12846. canvasContext.font = fontStyle;
  12847. canvasContext.textAlign = 'left';
  12848. canvasContext.textBaseline = 'top';
  12849. canvasContext.fillText(firstChar, 0, 0);
  12850. var compareData = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  12851. if (!compareData.some(function(pixel) {
  12852. return pixel;
  12853. })) {
  12854. font.numLigatures++;
  12855. return true;
  12856. }
  12857. canvasContext.clearRect(0, 0, width, fontSize);
  12858. canvasContext.fillText(nodeValue, 0, 0);
  12859. var compareWith = new Uint32Array(canvasContext.getImageData(0, 0, width, fontSize).data.buffer);
  12860. var differences = compareData.reduce(function(diff, pixel, i) {
  12861. if (pixel === 0 && compareWith[i] === 0) {
  12862. return diff;
  12863. }
  12864. if (pixel !== 0 && compareWith[i] !== 0) {
  12865. return diff;
  12866. }
  12867. return ++diff;
  12868. }, 0);
  12869. var expectedWidth = nodeValue.split('').reduce(function(width2, _char3) {
  12870. return width2 + canvasContext.measureText(_char3).width;
  12871. }, 0);
  12872. var actualWidth = canvasContext.measureText(nodeValue).width;
  12873. var pixelDifference = differences / compareData.length;
  12874. var sizeDifference = 1 - actualWidth / expectedWidth;
  12875. if (pixelDifference >= differenceThreshold && sizeDifference >= differenceThreshold) {
  12876. font.numLigatures++;
  12877. return true;
  12878. }
  12879. return false;
  12880. }
  12881. var is_icon_ligature_default = isIconLigature;
  12882. var _autocomplete = {
  12883. stateTerms: [ 'on', 'off' ],
  12884. standaloneTerms: [ 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'username', 'new-password', 'current-password', 'organization-title', 'organization', 'street-address', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'url', 'photo', 'one-time-code' ],
  12885. qualifiers: [ 'home', 'work', 'mobile', 'fax', 'pager' ],
  12886. qualifiedTerms: [ 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-local-prefix', 'tel-local-suffix', 'tel-extension', 'email', 'impp' ],
  12887. locations: [ 'billing', 'shipping' ]
  12888. };
  12889. function isValidAutocomplete(autocompleteValue) {
  12890. var _ref38 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref38$looseTyped = _ref38.looseTyped, looseTyped = _ref38$looseTyped === void 0 ? false : _ref38$looseTyped, _ref38$stateTerms = _ref38.stateTerms, stateTerms = _ref38$stateTerms === void 0 ? [] : _ref38$stateTerms, _ref38$locations = _ref38.locations, locations = _ref38$locations === void 0 ? [] : _ref38$locations, _ref38$qualifiers = _ref38.qualifiers, qualifiers = _ref38$qualifiers === void 0 ? [] : _ref38$qualifiers, _ref38$standaloneTerm = _ref38.standaloneTerms, standaloneTerms = _ref38$standaloneTerm === void 0 ? [] : _ref38$standaloneTerm, _ref38$qualifiedTerms = _ref38.qualifiedTerms, qualifiedTerms = _ref38$qualifiedTerms === void 0 ? [] : _ref38$qualifiedTerms;
  12891. autocompleteValue = autocompleteValue.toLowerCase().trim();
  12892. stateTerms = stateTerms.concat(_autocomplete.stateTerms);
  12893. if (stateTerms.includes(autocompleteValue) || autocompleteValue === '') {
  12894. return true;
  12895. }
  12896. qualifiers = qualifiers.concat(_autocomplete.qualifiers);
  12897. locations = locations.concat(_autocomplete.locations);
  12898. standaloneTerms = standaloneTerms.concat(_autocomplete.standaloneTerms);
  12899. qualifiedTerms = qualifiedTerms.concat(_autocomplete.qualifiedTerms);
  12900. var autocompleteTerms = autocompleteValue.split(/\s+/g);
  12901. if (!looseTyped) {
  12902. if (autocompleteTerms[0].length > 8 && autocompleteTerms[0].substr(0, 8) === 'section-') {
  12903. autocompleteTerms.shift();
  12904. }
  12905. if (locations.includes(autocompleteTerms[0])) {
  12906. autocompleteTerms.shift();
  12907. }
  12908. if (qualifiers.includes(autocompleteTerms[0])) {
  12909. autocompleteTerms.shift();
  12910. standaloneTerms = [];
  12911. }
  12912. if (autocompleteTerms.length !== 1) {
  12913. return false;
  12914. }
  12915. }
  12916. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  12917. return standaloneTerms.includes(purposeTerm) || qualifiedTerms.includes(purposeTerm);
  12918. }
  12919. var is_valid_autocomplete_default = isValidAutocomplete;
  12920. function visible(element, screenReader, noRecursing) {
  12921. element = get_node_from_tree_default(element);
  12922. return visible_virtual_default(element, screenReader, noRecursing);
  12923. }
  12924. var visible_default = visible;
  12925. function labelVirtual2(virtualNode) {
  12926. var ref, candidate, doc;
  12927. candidate = label_virtual_default(virtualNode);
  12928. if (candidate) {
  12929. return candidate;
  12930. }
  12931. if (virtualNode.attr('id')) {
  12932. if (!virtualNode.actualNode) {
  12933. throw new TypeError('Cannot resolve explicit label reference for non-DOM nodes');
  12934. }
  12935. var id = escape_selector_default(virtualNode.attr('id'));
  12936. doc = get_root_node_default2(virtualNode.actualNode);
  12937. ref = doc.querySelector('label[for="' + id + '"]');
  12938. candidate = ref && visible_default(ref, true);
  12939. if (candidate) {
  12940. return candidate;
  12941. }
  12942. }
  12943. ref = closest_default(virtualNode, 'label');
  12944. candidate = ref && visible_virtual_default(ref, true);
  12945. if (candidate) {
  12946. return candidate;
  12947. }
  12948. return null;
  12949. }
  12950. var label_virtual_default2 = labelVirtual2;
  12951. function label(node) {
  12952. node = get_node_from_tree_default(node);
  12953. return label_virtual_default2(node);
  12954. }
  12955. var label_default = label;
  12956. var nativeElementType = [ {
  12957. matches: [ {
  12958. nodeName: 'textarea'
  12959. }, {
  12960. nodeName: 'input',
  12961. properties: {
  12962. type: [ 'text', 'password', 'search', 'tel', 'email', 'url' ]
  12963. }
  12964. } ],
  12965. namingMethods: 'labelText'
  12966. }, {
  12967. matches: {
  12968. nodeName: 'input',
  12969. properties: {
  12970. type: [ 'button', 'submit', 'reset' ]
  12971. }
  12972. },
  12973. namingMethods: [ 'valueText', 'titleText', 'buttonDefaultText' ]
  12974. }, {
  12975. matches: {
  12976. nodeName: 'input',
  12977. properties: {
  12978. type: 'image'
  12979. }
  12980. },
  12981. namingMethods: [ 'altText', 'valueText', 'labelText', 'titleText', 'buttonDefaultText' ]
  12982. }, {
  12983. matches: 'button',
  12984. namingMethods: 'subtreeText'
  12985. }, {
  12986. matches: 'fieldset',
  12987. namingMethods: 'fieldsetLegendText'
  12988. }, {
  12989. matches: 'OUTPUT',
  12990. namingMethods: 'subtreeText'
  12991. }, {
  12992. matches: [ {
  12993. nodeName: 'select'
  12994. }, {
  12995. nodeName: 'input',
  12996. properties: {
  12997. type: /^(?!text|password|search|tel|email|url|button|submit|reset)/
  12998. }
  12999. } ],
  13000. namingMethods: 'labelText'
  13001. }, {
  13002. matches: 'summary',
  13003. namingMethods: 'subtreeText'
  13004. }, {
  13005. matches: 'figure',
  13006. namingMethods: [ 'figureText', 'titleText' ]
  13007. }, {
  13008. matches: 'img',
  13009. namingMethods: 'altText'
  13010. }, {
  13011. matches: 'table',
  13012. namingMethods: [ 'tableCaptionText', 'tableSummaryText' ]
  13013. }, {
  13014. matches: [ 'hr', 'br' ],
  13015. namingMethods: [ 'titleText', 'singleSpace' ]
  13016. } ];
  13017. var native_element_type_default = nativeElementType;
  13018. function visibleTextNodes(vNode) {
  13019. var parentVisible = is_visible_default(vNode.actualNode);
  13020. var nodes = [];
  13021. vNode.children.forEach(function(child) {
  13022. if (child.actualNode.nodeType === 3) {
  13023. if (parentVisible) {
  13024. nodes.push(child);
  13025. }
  13026. } else {
  13027. nodes = nodes.concat(visibleTextNodes(child));
  13028. }
  13029. });
  13030. return nodes;
  13031. }
  13032. var visible_text_nodes_default = visibleTextNodes;
  13033. var idRefsRegex = /^idrefs?$/;
  13034. function cacheIdRefs(node, idRefs, refAttrs) {
  13035. if (node.hasAttribute) {
  13036. if (node.nodeName.toUpperCase() === 'LABEL' && node.hasAttribute('for')) {
  13037. var id = node.getAttribute('for');
  13038. idRefs[id] = idRefs[id] || [];
  13039. idRefs[id].push(node);
  13040. }
  13041. for (var _i11 = 0; _i11 < refAttrs.length; ++_i11) {
  13042. var attr = refAttrs[_i11];
  13043. var attrValue = sanitize_default(node.getAttribute(attr) || '');
  13044. if (!attrValue) {
  13045. continue;
  13046. }
  13047. var tokens = token_list_default(attrValue);
  13048. for (var k = 0; k < tokens.length; ++k) {
  13049. idRefs[tokens[k]] = idRefs[tokens[k]] || [];
  13050. idRefs[tokens[k]].push(node);
  13051. }
  13052. }
  13053. }
  13054. for (var _i12 = 0; _i12 < node.children.length; _i12++) {
  13055. cacheIdRefs(node.children[_i12], idRefs, refAttrs);
  13056. }
  13057. }
  13058. function getAccessibleRefs(node) {
  13059. node = node.actualNode || node;
  13060. var root = get_root_node_default2(node);
  13061. root = root.documentElement || root;
  13062. var idRefsByRoot = cache_default.get('idRefsByRoot');
  13063. if (!idRefsByRoot) {
  13064. idRefsByRoot = new WeakMap();
  13065. cache_default.set('idRefsByRoot', idRefsByRoot);
  13066. }
  13067. var idRefs = idRefsByRoot.get(root);
  13068. if (!idRefs) {
  13069. idRefs = {};
  13070. idRefsByRoot.set(root, idRefs);
  13071. var refAttrs = Object.keys(standards_default.ariaAttrs).filter(function(attr) {
  13072. var type = standards_default.ariaAttrs[attr].type;
  13073. return idRefsRegex.test(type);
  13074. });
  13075. cacheIdRefs(root, idRefs, refAttrs);
  13076. }
  13077. return idRefs[node.id] || [];
  13078. }
  13079. var get_accessible_refs_default = getAccessibleRefs;
  13080. function getRoleType(role) {
  13081. var roleDef = standards_default.ariaRoles[role];
  13082. if (!roleDef) {
  13083. return null;
  13084. }
  13085. return roleDef.type;
  13086. }
  13087. var get_role_type_default = getRoleType;
  13088. function isAriaRoleAllowedOnElement(node, role) {
  13089. var vNode = node instanceof abstract_virtual_node_default ? node : get_node_from_tree_default(node);
  13090. var implicitRole3 = implicit_role_default(vNode);
  13091. if (role === implicitRole3) {
  13092. return true;
  13093. }
  13094. var spec = get_element_spec_default(vNode);
  13095. if (Array.isArray(spec.allowedRoles)) {
  13096. return spec.allowedRoles.includes(role);
  13097. }
  13098. return !!spec.allowedRoles;
  13099. }
  13100. var is_aria_role_allowed_on_element_default = isAriaRoleAllowedOnElement;
  13101. var dpubRoles2 = [ 'doc-backlink', 'doc-biblioentry', 'doc-biblioref', 'doc-cover', 'doc-endnote', 'doc-glossref', 'doc-noteref' ];
  13102. function getRoleSegments(node) {
  13103. var roles = [];
  13104. if (!node) {
  13105. return roles;
  13106. }
  13107. if (node.hasAttribute('role')) {
  13108. var nodeRoles = token_list_default(node.getAttribute('role').toLowerCase());
  13109. roles = roles.concat(nodeRoles);
  13110. }
  13111. if (node.hasAttributeNS('http://www.idpf.org/2007/ops', 'type')) {
  13112. var epubRoles = token_list_default(node.getAttributeNS('http://www.idpf.org/2007/ops', 'type').toLowerCase()).map(function(role) {
  13113. return 'doc-'.concat(role);
  13114. });
  13115. roles = roles.concat(epubRoles);
  13116. }
  13117. roles = roles.filter(function(role) {
  13118. return is_valid_role_default(role);
  13119. });
  13120. return roles;
  13121. }
  13122. function getElementUnallowedRoles(node) {
  13123. var allowImplicit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  13124. var tagName = node.nodeName.toUpperCase();
  13125. if (!is_html_element_default(node)) {
  13126. return [];
  13127. }
  13128. var roleSegments = getRoleSegments(node);
  13129. var implicitRole3 = implicit_role_default(node);
  13130. var unallowedRoles = roleSegments.filter(function(role) {
  13131. if (allowImplicit && role === implicitRole3) {
  13132. return false;
  13133. }
  13134. if (allowImplicit && dpubRoles2.includes(role)) {
  13135. var roleType = get_role_type_default(role);
  13136. if (implicitRole3 !== roleType) {
  13137. return true;
  13138. }
  13139. }
  13140. if (!allowImplicit && !(role === 'row' && tagName === 'TR' && element_matches_default(node, 'table[role="grid"] > tr'))) {
  13141. return true;
  13142. }
  13143. return !is_aria_role_allowed_on_element_default(node, role);
  13144. });
  13145. return unallowedRoles;
  13146. }
  13147. var get_element_unallowed_roles_default = getElementUnallowedRoles;
  13148. function getAriaRolesByType(type) {
  13149. return Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  13150. return standards_default.ariaRoles[roleName].type === type;
  13151. });
  13152. }
  13153. var get_aria_roles_by_type_default = getAriaRolesByType;
  13154. function getRolesByType(roleType) {
  13155. return get_aria_roles_by_type_default(roleType);
  13156. }
  13157. var get_roles_by_type_default = getRolesByType;
  13158. function getAriaRolesSupportingNameFromContent() {
  13159. if (cache_default.get('ariaRolesNameFromContent')) {
  13160. return cache_default.get('ariaRolesNameFromContent');
  13161. }
  13162. var contentRoles = Object.keys(standards_default.ariaRoles).filter(function(roleName) {
  13163. return standards_default.ariaRoles[roleName].nameFromContent;
  13164. });
  13165. cache_default.set('ariaRolesNameFromContent', contentRoles);
  13166. return contentRoles;
  13167. }
  13168. var get_aria_roles_supporting_name_from_content_default = getAriaRolesSupportingNameFromContent;
  13169. function getRolesWithNameFromContents() {
  13170. return get_aria_roles_supporting_name_from_content_default();
  13171. }
  13172. var get_roles_with_name_from_contents_default = getRolesWithNameFromContents;
  13173. var isNull = function isNull(value) {
  13174. return value === null;
  13175. };
  13176. var isNotNull = function isNotNull(value) {
  13177. return value !== null;
  13178. };
  13179. var lookupTable = {};
  13180. lookupTable.attributes = {
  13181. 'aria-activedescendant': {
  13182. type: 'idref',
  13183. allowEmpty: true,
  13184. unsupported: false
  13185. },
  13186. 'aria-atomic': {
  13187. type: 'boolean',
  13188. values: [ 'true', 'false' ],
  13189. unsupported: false
  13190. },
  13191. 'aria-autocomplete': {
  13192. type: 'nmtoken',
  13193. values: [ 'inline', 'list', 'both', 'none' ],
  13194. unsupported: false
  13195. },
  13196. 'aria-busy': {
  13197. type: 'boolean',
  13198. values: [ 'true', 'false' ],
  13199. unsupported: false
  13200. },
  13201. 'aria-checked': {
  13202. type: 'nmtoken',
  13203. values: [ 'true', 'false', 'mixed', 'undefined' ],
  13204. unsupported: false
  13205. },
  13206. 'aria-colcount': {
  13207. type: 'int',
  13208. unsupported: false
  13209. },
  13210. 'aria-colindex': {
  13211. type: 'int',
  13212. unsupported: false
  13213. },
  13214. 'aria-colspan': {
  13215. type: 'int',
  13216. unsupported: false
  13217. },
  13218. 'aria-controls': {
  13219. type: 'idrefs',
  13220. allowEmpty: true,
  13221. unsupported: false
  13222. },
  13223. 'aria-current': {
  13224. type: 'nmtoken',
  13225. allowEmpty: true,
  13226. values: [ 'page', 'step', 'location', 'date', 'time', 'true', 'false' ],
  13227. unsupported: false
  13228. },
  13229. 'aria-describedby': {
  13230. type: 'idrefs',
  13231. allowEmpty: true,
  13232. unsupported: false
  13233. },
  13234. 'aria-describedat': {
  13235. unsupported: true,
  13236. unstandardized: true
  13237. },
  13238. 'aria-details': {
  13239. type: 'idref',
  13240. allowEmpty: true,
  13241. unsupported: false
  13242. },
  13243. 'aria-disabled': {
  13244. type: 'boolean',
  13245. values: [ 'true', 'false' ],
  13246. unsupported: false
  13247. },
  13248. 'aria-dropeffect': {
  13249. type: 'nmtokens',
  13250. values: [ 'copy', 'move', 'reference', 'execute', 'popup', 'none' ],
  13251. unsupported: false
  13252. },
  13253. 'aria-errormessage': {
  13254. type: 'idref',
  13255. allowEmpty: true,
  13256. unsupported: false
  13257. },
  13258. 'aria-expanded': {
  13259. type: 'nmtoken',
  13260. values: [ 'true', 'false', 'undefined' ],
  13261. unsupported: false
  13262. },
  13263. 'aria-flowto': {
  13264. type: 'idrefs',
  13265. allowEmpty: true,
  13266. unsupported: false
  13267. },
  13268. 'aria-grabbed': {
  13269. type: 'nmtoken',
  13270. values: [ 'true', 'false', 'undefined' ],
  13271. unsupported: false
  13272. },
  13273. 'aria-haspopup': {
  13274. type: 'nmtoken',
  13275. allowEmpty: true,
  13276. values: [ 'true', 'false', 'menu', 'listbox', 'tree', 'grid', 'dialog' ],
  13277. unsupported: false
  13278. },
  13279. 'aria-hidden': {
  13280. type: 'boolean',
  13281. values: [ 'true', 'false' ],
  13282. unsupported: false
  13283. },
  13284. 'aria-invalid': {
  13285. type: 'nmtoken',
  13286. allowEmpty: true,
  13287. values: [ 'true', 'false', 'spelling', 'grammar' ],
  13288. unsupported: false
  13289. },
  13290. 'aria-keyshortcuts': {
  13291. type: 'string',
  13292. allowEmpty: true,
  13293. unsupported: false
  13294. },
  13295. 'aria-label': {
  13296. type: 'string',
  13297. allowEmpty: true,
  13298. unsupported: false
  13299. },
  13300. 'aria-labelledby': {
  13301. type: 'idrefs',
  13302. allowEmpty: true,
  13303. unsupported: false
  13304. },
  13305. 'aria-level': {
  13306. type: 'int',
  13307. unsupported: false
  13308. },
  13309. 'aria-live': {
  13310. type: 'nmtoken',
  13311. values: [ 'off', 'polite', 'assertive' ],
  13312. unsupported: false
  13313. },
  13314. 'aria-modal': {
  13315. type: 'boolean',
  13316. values: [ 'true', 'false' ],
  13317. unsupported: false
  13318. },
  13319. 'aria-multiline': {
  13320. type: 'boolean',
  13321. values: [ 'true', 'false' ],
  13322. unsupported: false
  13323. },
  13324. 'aria-multiselectable': {
  13325. type: 'boolean',
  13326. values: [ 'true', 'false' ],
  13327. unsupported: false
  13328. },
  13329. 'aria-orientation': {
  13330. type: 'nmtoken',
  13331. values: [ 'horizontal', 'vertical' ],
  13332. unsupported: false
  13333. },
  13334. 'aria-owns': {
  13335. type: 'idrefs',
  13336. allowEmpty: true,
  13337. unsupported: false
  13338. },
  13339. 'aria-placeholder': {
  13340. type: 'string',
  13341. allowEmpty: true,
  13342. unsupported: false
  13343. },
  13344. 'aria-posinset': {
  13345. type: 'int',
  13346. unsupported: false
  13347. },
  13348. 'aria-pressed': {
  13349. type: 'nmtoken',
  13350. values: [ 'true', 'false', 'mixed', 'undefined' ],
  13351. unsupported: false
  13352. },
  13353. 'aria-readonly': {
  13354. type: 'boolean',
  13355. values: [ 'true', 'false' ],
  13356. unsupported: false
  13357. },
  13358. 'aria-relevant': {
  13359. type: 'nmtokens',
  13360. values: [ 'additions', 'removals', 'text', 'all' ],
  13361. unsupported: false
  13362. },
  13363. 'aria-required': {
  13364. type: 'boolean',
  13365. values: [ 'true', 'false' ],
  13366. unsupported: false
  13367. },
  13368. 'aria-roledescription': {
  13369. type: 'string',
  13370. allowEmpty: true,
  13371. unsupported: false
  13372. },
  13373. 'aria-rowcount': {
  13374. type: 'int',
  13375. unsupported: false
  13376. },
  13377. 'aria-rowindex': {
  13378. type: 'int',
  13379. unsupported: false
  13380. },
  13381. 'aria-rowspan': {
  13382. type: 'int',
  13383. unsupported: false
  13384. },
  13385. 'aria-selected': {
  13386. type: 'nmtoken',
  13387. values: [ 'true', 'false', 'undefined' ],
  13388. unsupported: false
  13389. },
  13390. 'aria-setsize': {
  13391. type: 'int',
  13392. unsupported: false
  13393. },
  13394. 'aria-sort': {
  13395. type: 'nmtoken',
  13396. values: [ 'ascending', 'descending', 'other', 'none' ],
  13397. unsupported: false
  13398. },
  13399. 'aria-valuemax': {
  13400. type: 'decimal',
  13401. unsupported: false
  13402. },
  13403. 'aria-valuemin': {
  13404. type: 'decimal',
  13405. unsupported: false
  13406. },
  13407. 'aria-valuenow': {
  13408. type: 'decimal',
  13409. unsupported: false
  13410. },
  13411. 'aria-valuetext': {
  13412. type: 'string',
  13413. unsupported: false
  13414. }
  13415. };
  13416. lookupTable.globalAttributes = [ 'aria-atomic', 'aria-busy', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-live', 'aria-owns', 'aria-relevant', 'aria-roledescription' ];
  13417. lookupTable.role = {
  13418. alert: {
  13419. type: 'widget',
  13420. attributes: {
  13421. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13422. },
  13423. owned: null,
  13424. nameFrom: [ 'author' ],
  13425. context: null,
  13426. unsupported: false,
  13427. allowedElements: [ 'section' ]
  13428. },
  13429. alertdialog: {
  13430. type: 'widget',
  13431. attributes: {
  13432. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  13433. },
  13434. owned: null,
  13435. nameFrom: [ 'author' ],
  13436. context: null,
  13437. unsupported: false,
  13438. allowedElements: [ 'dialog', 'section' ]
  13439. },
  13440. application: {
  13441. type: 'landmark',
  13442. attributes: {
  13443. allowed: [ 'aria-expanded', 'aria-errormessage', 'aria-activedescendant' ]
  13444. },
  13445. owned: null,
  13446. nameFrom: [ 'author' ],
  13447. context: null,
  13448. unsupported: false,
  13449. allowedElements: [ 'article', 'audio', 'embed', 'iframe', 'object', 'section', 'svg', 'video' ]
  13450. },
  13451. article: {
  13452. type: 'structure',
  13453. attributes: {
  13454. allowed: [ 'aria-expanded', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  13455. },
  13456. owned: null,
  13457. nameFrom: [ 'author' ],
  13458. context: null,
  13459. implicit: [ 'article' ],
  13460. unsupported: false
  13461. },
  13462. banner: {
  13463. type: 'landmark',
  13464. attributes: {
  13465. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13466. },
  13467. owned: null,
  13468. nameFrom: [ 'author' ],
  13469. context: null,
  13470. implicit: [ 'header' ],
  13471. unsupported: false,
  13472. allowedElements: [ 'section' ]
  13473. },
  13474. button: {
  13475. type: 'widget',
  13476. attributes: {
  13477. allowed: [ 'aria-expanded', 'aria-pressed', 'aria-errormessage' ]
  13478. },
  13479. owned: null,
  13480. nameFrom: [ 'author', 'contents' ],
  13481. context: null,
  13482. implicit: [ 'button', 'input[type="button"]', 'input[type="image"]', 'input[type="reset"]', 'input[type="submit"]', 'summary' ],
  13483. unsupported: false,
  13484. allowedElements: [ {
  13485. nodeName: 'a',
  13486. attributes: {
  13487. href: isNotNull
  13488. }
  13489. } ]
  13490. },
  13491. cell: {
  13492. type: 'structure',
  13493. attributes: {
  13494. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-rowindex', 'aria-rowspan', 'aria-errormessage' ]
  13495. },
  13496. owned: null,
  13497. nameFrom: [ 'author', 'contents' ],
  13498. context: [ 'row' ],
  13499. implicit: [ 'td', 'th' ],
  13500. unsupported: false
  13501. },
  13502. checkbox: {
  13503. type: 'widget',
  13504. attributes: {
  13505. allowed: [ 'aria-checked', 'aria-required', 'aria-readonly', 'aria-errormessage' ]
  13506. },
  13507. owned: null,
  13508. nameFrom: [ 'author', 'contents' ],
  13509. context: null,
  13510. implicit: [ 'input[type="checkbox"]' ],
  13511. unsupported: false,
  13512. allowedElements: [ 'button' ]
  13513. },
  13514. columnheader: {
  13515. type: 'structure',
  13516. attributes: {
  13517. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  13518. },
  13519. owned: null,
  13520. nameFrom: [ 'author', 'contents' ],
  13521. context: [ 'row' ],
  13522. implicit: [ 'th' ],
  13523. unsupported: false
  13524. },
  13525. combobox: {
  13526. type: 'composite',
  13527. attributes: {
  13528. allowed: [ 'aria-autocomplete', 'aria-required', 'aria-activedescendant', 'aria-orientation', 'aria-errormessage' ],
  13529. required: [ 'aria-expanded' ]
  13530. },
  13531. owned: {
  13532. all: [ 'listbox', 'tree', 'grid', 'dialog', 'textbox' ]
  13533. },
  13534. nameFrom: [ 'author' ],
  13535. context: null,
  13536. unsupported: false,
  13537. allowedElements: [ {
  13538. nodeName: 'input',
  13539. properties: {
  13540. type: [ 'text', 'search', 'tel', 'url', 'email' ]
  13541. }
  13542. } ]
  13543. },
  13544. command: {
  13545. nameFrom: [ 'author' ],
  13546. type: 'abstract',
  13547. unsupported: false
  13548. },
  13549. complementary: {
  13550. type: 'landmark',
  13551. attributes: {
  13552. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13553. },
  13554. owned: null,
  13555. nameFrom: [ 'author' ],
  13556. context: null,
  13557. implicit: [ 'aside' ],
  13558. unsupported: false,
  13559. allowedElements: [ 'section' ]
  13560. },
  13561. composite: {
  13562. nameFrom: [ 'author' ],
  13563. type: 'abstract',
  13564. unsupported: false
  13565. },
  13566. contentinfo: {
  13567. type: 'landmark',
  13568. attributes: {
  13569. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13570. },
  13571. owned: null,
  13572. nameFrom: [ 'author' ],
  13573. context: null,
  13574. implicit: [ 'footer' ],
  13575. unsupported: false,
  13576. allowedElements: [ 'section' ]
  13577. },
  13578. definition: {
  13579. type: 'structure',
  13580. attributes: {
  13581. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13582. },
  13583. owned: null,
  13584. nameFrom: [ 'author' ],
  13585. context: null,
  13586. implicit: [ 'dd', 'dfn' ],
  13587. unsupported: false
  13588. },
  13589. dialog: {
  13590. type: 'widget',
  13591. attributes: {
  13592. allowed: [ 'aria-expanded', 'aria-modal', 'aria-errormessage' ]
  13593. },
  13594. owned: null,
  13595. nameFrom: [ 'author' ],
  13596. context: null,
  13597. implicit: [ 'dialog' ],
  13598. unsupported: false,
  13599. allowedElements: [ 'section' ]
  13600. },
  13601. directory: {
  13602. type: 'structure',
  13603. attributes: {
  13604. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13605. },
  13606. owned: null,
  13607. nameFrom: [ 'author', 'contents' ],
  13608. context: null,
  13609. unsupported: false,
  13610. allowedElements: [ 'ol', 'ul' ]
  13611. },
  13612. document: {
  13613. type: 'structure',
  13614. attributes: {
  13615. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13616. },
  13617. owned: null,
  13618. nameFrom: [ 'author' ],
  13619. context: null,
  13620. implicit: [ 'body' ],
  13621. unsupported: false,
  13622. allowedElements: [ 'article', 'embed', 'iframe', 'object', 'section', 'svg' ]
  13623. },
  13624. 'doc-abstract': {
  13625. type: 'section',
  13626. attributes: {
  13627. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13628. },
  13629. owned: null,
  13630. nameFrom: [ 'author' ],
  13631. context: null,
  13632. unsupported: false,
  13633. allowedElements: [ 'section' ]
  13634. },
  13635. 'doc-acknowledgments': {
  13636. type: 'landmark',
  13637. attributes: {
  13638. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13639. },
  13640. owned: null,
  13641. nameFrom: [ 'author' ],
  13642. context: null,
  13643. unsupported: false,
  13644. allowedElements: [ 'section' ]
  13645. },
  13646. 'doc-afterword': {
  13647. type: 'landmark',
  13648. attributes: {
  13649. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13650. },
  13651. owned: null,
  13652. nameFrom: [ 'author' ],
  13653. context: null,
  13654. unsupported: false,
  13655. allowedElements: [ 'section' ]
  13656. },
  13657. 'doc-appendix': {
  13658. type: 'landmark',
  13659. attributes: {
  13660. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13661. },
  13662. owned: null,
  13663. nameFrom: [ 'author' ],
  13664. context: null,
  13665. unsupported: false,
  13666. allowedElements: [ 'section' ]
  13667. },
  13668. 'doc-backlink': {
  13669. type: 'link',
  13670. attributes: {
  13671. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13672. },
  13673. owned: null,
  13674. nameFrom: [ 'author', 'contents' ],
  13675. context: null,
  13676. unsupported: false,
  13677. allowedElements: [ {
  13678. nodeName: 'a',
  13679. attributes: {
  13680. href: isNotNull
  13681. }
  13682. } ]
  13683. },
  13684. 'doc-biblioentry': {
  13685. type: 'listitem',
  13686. attributes: {
  13687. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  13688. },
  13689. owned: null,
  13690. nameFrom: [ 'author' ],
  13691. context: [ 'doc-bibliography' ],
  13692. unsupported: false,
  13693. allowedElements: [ 'li' ]
  13694. },
  13695. 'doc-bibliography': {
  13696. type: 'landmark',
  13697. attributes: {
  13698. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13699. },
  13700. owned: {
  13701. one: [ 'doc-biblioentry' ]
  13702. },
  13703. nameFrom: [ 'author' ],
  13704. context: null,
  13705. unsupported: false,
  13706. allowedElements: [ 'section' ]
  13707. },
  13708. 'doc-biblioref': {
  13709. type: 'link',
  13710. attributes: {
  13711. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13712. },
  13713. owned: null,
  13714. nameFrom: [ 'author', 'contents' ],
  13715. context: null,
  13716. unsupported: false,
  13717. allowedElements: [ {
  13718. nodeName: 'a',
  13719. attributes: {
  13720. href: isNotNull
  13721. }
  13722. } ]
  13723. },
  13724. 'doc-chapter': {
  13725. type: 'landmark',
  13726. attributes: {
  13727. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13728. },
  13729. owned: null,
  13730. namefrom: [ 'author' ],
  13731. context: null,
  13732. unsupported: false,
  13733. allowedElements: [ 'section' ]
  13734. },
  13735. 'doc-colophon': {
  13736. type: 'section',
  13737. attributes: {
  13738. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13739. },
  13740. owned: null,
  13741. namefrom: [ 'author' ],
  13742. context: null,
  13743. unsupported: false,
  13744. allowedElements: [ 'section' ]
  13745. },
  13746. 'doc-conclusion': {
  13747. type: 'landmark',
  13748. attributes: {
  13749. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13750. },
  13751. owned: null,
  13752. namefrom: [ 'author' ],
  13753. context: null,
  13754. unsupported: false,
  13755. allowedElements: [ 'section' ]
  13756. },
  13757. 'doc-cover': {
  13758. type: 'img',
  13759. attributes: {
  13760. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13761. },
  13762. owned: null,
  13763. namefrom: [ 'author' ],
  13764. context: null,
  13765. unsupported: false
  13766. },
  13767. 'doc-credit': {
  13768. type: 'section',
  13769. attributes: {
  13770. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13771. },
  13772. owned: null,
  13773. namefrom: [ 'author' ],
  13774. context: null,
  13775. unsupported: false,
  13776. allowedElements: [ 'section' ]
  13777. },
  13778. 'doc-credits': {
  13779. type: 'landmark',
  13780. attributes: {
  13781. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13782. },
  13783. owned: null,
  13784. namefrom: [ 'author' ],
  13785. context: null,
  13786. unsupported: false,
  13787. allowedElements: [ 'section' ]
  13788. },
  13789. 'doc-dedication': {
  13790. type: 'section',
  13791. attributes: {
  13792. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13793. },
  13794. owned: null,
  13795. namefrom: [ 'author' ],
  13796. context: null,
  13797. unsupported: false,
  13798. allowedElements: [ 'section' ]
  13799. },
  13800. 'doc-endnote': {
  13801. type: 'listitem',
  13802. attributes: {
  13803. allowed: [ 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  13804. },
  13805. owned: null,
  13806. namefrom: [ 'author' ],
  13807. context: [ 'doc-endnotes' ],
  13808. unsupported: false,
  13809. allowedElements: [ 'li' ]
  13810. },
  13811. 'doc-endnotes': {
  13812. type: 'landmark',
  13813. attributes: {
  13814. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13815. },
  13816. owned: {
  13817. one: [ 'doc-endnote' ]
  13818. },
  13819. namefrom: [ 'author' ],
  13820. context: null,
  13821. unsupported: false,
  13822. allowedElements: [ 'section' ]
  13823. },
  13824. 'doc-epigraph': {
  13825. type: 'section',
  13826. attributes: {
  13827. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13828. },
  13829. owned: null,
  13830. namefrom: [ 'author' ],
  13831. context: null,
  13832. unsupported: false
  13833. },
  13834. 'doc-epilogue': {
  13835. type: 'landmark',
  13836. attributes: {
  13837. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13838. },
  13839. owned: null,
  13840. namefrom: [ 'author' ],
  13841. context: null,
  13842. unsupported: false,
  13843. allowedElements: [ 'section' ]
  13844. },
  13845. 'doc-errata': {
  13846. type: 'landmark',
  13847. attributes: {
  13848. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13849. },
  13850. owned: null,
  13851. namefrom: [ 'author' ],
  13852. context: null,
  13853. unsupported: false,
  13854. allowedElements: [ 'section' ]
  13855. },
  13856. 'doc-example': {
  13857. type: 'section',
  13858. attributes: {
  13859. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13860. },
  13861. owned: null,
  13862. namefrom: [ 'author' ],
  13863. context: null,
  13864. unsupported: false,
  13865. allowedElements: [ 'aside', 'section' ]
  13866. },
  13867. 'doc-footnote': {
  13868. type: 'section',
  13869. attributes: {
  13870. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13871. },
  13872. owned: null,
  13873. namefrom: [ 'author' ],
  13874. context: null,
  13875. unsupported: false,
  13876. allowedElements: [ 'aside', 'footer', 'header' ]
  13877. },
  13878. 'doc-foreword': {
  13879. type: 'landmark',
  13880. attributes: {
  13881. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13882. },
  13883. owned: null,
  13884. namefrom: [ 'author' ],
  13885. context: null,
  13886. unsupported: false,
  13887. allowedElements: [ 'section' ]
  13888. },
  13889. 'doc-glossary': {
  13890. type: 'landmark',
  13891. attributes: {
  13892. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13893. },
  13894. owned: [ 'term', 'definition' ],
  13895. namefrom: [ 'author' ],
  13896. context: null,
  13897. unsupported: false,
  13898. allowedElements: [ 'dl' ]
  13899. },
  13900. 'doc-glossref': {
  13901. type: 'link',
  13902. attributes: {
  13903. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13904. },
  13905. owned: null,
  13906. namefrom: [ 'author', 'contents' ],
  13907. context: null,
  13908. unsupported: false,
  13909. allowedElements: [ {
  13910. nodeName: 'a',
  13911. attributes: {
  13912. href: isNotNull
  13913. }
  13914. } ]
  13915. },
  13916. 'doc-index': {
  13917. type: 'navigation',
  13918. attributes: {
  13919. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13920. },
  13921. owned: null,
  13922. namefrom: [ 'author' ],
  13923. context: null,
  13924. unsupported: false,
  13925. allowedElements: [ 'nav', 'section' ]
  13926. },
  13927. 'doc-introduction': {
  13928. type: 'landmark',
  13929. attributes: {
  13930. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  13931. },
  13932. owned: null,
  13933. namefrom: [ 'author' ],
  13934. context: null,
  13935. unsupported: false,
  13936. allowedElements: [ 'section' ]
  13937. },
  13938. 'doc-noteref': {
  13939. type: 'link',
  13940. attributes: {
  13941. allowed: [ 'aria-expanded' ]
  13942. },
  13943. owned: null,
  13944. namefrom: [ 'author', 'contents' ],
  13945. context: null,
  13946. unsupported: false,
  13947. allowedElements: [ {
  13948. nodeName: 'a',
  13949. attributes: {
  13950. href: isNotNull
  13951. }
  13952. } ]
  13953. },
  13954. 'doc-notice': {
  13955. type: 'note',
  13956. attributes: {
  13957. allowed: [ 'aria-expanded' ]
  13958. },
  13959. owned: null,
  13960. namefrom: [ 'author' ],
  13961. context: null,
  13962. unsupported: false,
  13963. allowedElements: [ 'section' ]
  13964. },
  13965. 'doc-pagebreak': {
  13966. type: 'separator',
  13967. attributes: {
  13968. allowed: [ 'aria-expanded' ]
  13969. },
  13970. owned: null,
  13971. namefrom: [ 'author' ],
  13972. context: null,
  13973. unsupported: false,
  13974. allowedElements: [ 'hr' ]
  13975. },
  13976. 'doc-pagelist': {
  13977. type: 'navigation',
  13978. attributes: {
  13979. allowed: [ 'aria-expanded' ]
  13980. },
  13981. owned: null,
  13982. namefrom: [ 'author' ],
  13983. context: null,
  13984. unsupported: false,
  13985. allowedElements: [ 'nav', 'section' ]
  13986. },
  13987. 'doc-part': {
  13988. type: 'landmark',
  13989. attributes: {
  13990. allowed: [ 'aria-expanded' ]
  13991. },
  13992. owned: null,
  13993. namefrom: [ 'author' ],
  13994. context: null,
  13995. unsupported: false,
  13996. allowedElements: [ 'section' ]
  13997. },
  13998. 'doc-preface': {
  13999. type: 'landmark',
  14000. attributes: {
  14001. allowed: [ 'aria-expanded' ]
  14002. },
  14003. owned: null,
  14004. namefrom: [ 'author' ],
  14005. context: null,
  14006. unsupported: false,
  14007. allowedElements: [ 'section' ]
  14008. },
  14009. 'doc-prologue': {
  14010. type: 'landmark',
  14011. attributes: {
  14012. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14013. },
  14014. owned: null,
  14015. namefrom: [ 'author' ],
  14016. context: null,
  14017. unsupported: false,
  14018. allowedElements: [ 'section' ]
  14019. },
  14020. 'doc-pullquote': {
  14021. type: 'none',
  14022. attributes: {
  14023. allowed: [ 'aria-expanded' ]
  14024. },
  14025. owned: null,
  14026. namefrom: [ 'author' ],
  14027. context: null,
  14028. unsupported: false,
  14029. allowedElements: [ 'aside', 'section' ]
  14030. },
  14031. 'doc-qna': {
  14032. type: 'section',
  14033. attributes: {
  14034. allowed: [ 'aria-expanded' ]
  14035. },
  14036. owned: null,
  14037. namefrom: [ 'author' ],
  14038. context: null,
  14039. unsupported: false,
  14040. allowedElements: [ 'section' ]
  14041. },
  14042. 'doc-subtitle': {
  14043. type: 'sectionhead',
  14044. attributes: {
  14045. allowed: [ 'aria-expanded' ]
  14046. },
  14047. owned: null,
  14048. namefrom: [ 'author' ],
  14049. context: null,
  14050. unsupported: false,
  14051. allowedElements: {
  14052. nodeName: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ]
  14053. }
  14054. },
  14055. 'doc-tip': {
  14056. type: 'note',
  14057. attributes: {
  14058. allowed: [ 'aria-expanded' ]
  14059. },
  14060. owned: null,
  14061. namefrom: [ 'author' ],
  14062. context: null,
  14063. unsupported: false,
  14064. allowedElements: [ 'aside' ]
  14065. },
  14066. 'doc-toc': {
  14067. type: 'navigation',
  14068. attributes: {
  14069. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14070. },
  14071. owned: null,
  14072. namefrom: [ 'author' ],
  14073. context: null,
  14074. unsupported: false,
  14075. allowedElements: [ 'nav', 'section' ]
  14076. },
  14077. feed: {
  14078. type: 'structure',
  14079. attributes: {
  14080. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14081. },
  14082. owned: {
  14083. one: [ 'article' ]
  14084. },
  14085. nameFrom: [ 'author' ],
  14086. context: null,
  14087. unsupported: false,
  14088. allowedElements: [ 'article', 'aside', 'section' ]
  14089. },
  14090. figure: {
  14091. type: 'structure',
  14092. attributes: {
  14093. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14094. },
  14095. owned: null,
  14096. nameFrom: [ 'author', 'contents' ],
  14097. context: null,
  14098. implicit: [ 'figure' ],
  14099. unsupported: false
  14100. },
  14101. form: {
  14102. type: 'landmark',
  14103. attributes: {
  14104. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14105. },
  14106. owned: null,
  14107. nameFrom: [ 'author' ],
  14108. context: null,
  14109. implicit: [ 'form' ],
  14110. unsupported: false
  14111. },
  14112. grid: {
  14113. type: 'composite',
  14114. attributes: {
  14115. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-colcount', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-rowcount', 'aria-errormessage' ]
  14116. },
  14117. owned: {
  14118. one: [ 'rowgroup', 'row' ]
  14119. },
  14120. nameFrom: [ 'author' ],
  14121. context: null,
  14122. implicit: [ 'table' ],
  14123. unsupported: false
  14124. },
  14125. gridcell: {
  14126. type: 'widget',
  14127. attributes: {
  14128. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-readonly', 'aria-required', 'aria-errormessage' ]
  14129. },
  14130. owned: null,
  14131. nameFrom: [ 'author', 'contents' ],
  14132. context: [ 'row' ],
  14133. implicit: [ 'td', 'th' ],
  14134. unsupported: false
  14135. },
  14136. group: {
  14137. type: 'structure',
  14138. attributes: {
  14139. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  14140. },
  14141. owned: null,
  14142. nameFrom: [ 'author' ],
  14143. context: null,
  14144. implicit: [ 'details', 'optgroup' ],
  14145. unsupported: false,
  14146. allowedElements: [ 'dl', 'figcaption', 'fieldset', 'figure', 'footer', 'header', 'ol', 'ul' ]
  14147. },
  14148. heading: {
  14149. type: 'structure',
  14150. attributes: {
  14151. required: [ 'aria-level' ],
  14152. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14153. },
  14154. owned: null,
  14155. nameFrom: [ 'author', 'contents' ],
  14156. context: null,
  14157. implicit: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ],
  14158. unsupported: false
  14159. },
  14160. img: {
  14161. type: 'structure',
  14162. attributes: {
  14163. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14164. },
  14165. owned: null,
  14166. nameFrom: [ 'author' ],
  14167. context: null,
  14168. implicit: [ 'img' ],
  14169. unsupported: false,
  14170. allowedElements: [ 'embed', 'iframe', 'object', 'svg' ]
  14171. },
  14172. input: {
  14173. nameFrom: [ 'author' ],
  14174. type: 'abstract',
  14175. unsupported: false
  14176. },
  14177. landmark: {
  14178. nameFrom: [ 'author' ],
  14179. type: 'abstract',
  14180. unsupported: false
  14181. },
  14182. link: {
  14183. type: 'widget',
  14184. attributes: {
  14185. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14186. },
  14187. owned: null,
  14188. nameFrom: [ 'author', 'contents' ],
  14189. context: null,
  14190. implicit: [ 'a[href]', 'area[href]' ],
  14191. unsupported: false,
  14192. allowedElements: [ 'button', {
  14193. nodeName: 'input',
  14194. properties: {
  14195. type: [ 'image', 'button' ]
  14196. }
  14197. } ]
  14198. },
  14199. list: {
  14200. type: 'structure',
  14201. attributes: {
  14202. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14203. },
  14204. owned: {
  14205. all: [ 'listitem' ]
  14206. },
  14207. nameFrom: [ 'author' ],
  14208. context: null,
  14209. implicit: [ 'ol', 'ul', 'dl' ],
  14210. unsupported: false
  14211. },
  14212. listbox: {
  14213. type: 'composite',
  14214. attributes: {
  14215. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  14216. },
  14217. owned: {
  14218. all: [ 'option' ]
  14219. },
  14220. nameFrom: [ 'author' ],
  14221. context: null,
  14222. implicit: [ 'select' ],
  14223. unsupported: false,
  14224. allowedElements: [ 'ol', 'ul' ]
  14225. },
  14226. listitem: {
  14227. type: 'structure',
  14228. attributes: {
  14229. allowed: [ 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  14230. },
  14231. owned: null,
  14232. nameFrom: [ 'author', 'contents' ],
  14233. context: [ 'list' ],
  14234. implicit: [ 'li', 'dt' ],
  14235. unsupported: false
  14236. },
  14237. log: {
  14238. type: 'widget',
  14239. attributes: {
  14240. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14241. },
  14242. owned: null,
  14243. nameFrom: [ 'author' ],
  14244. context: null,
  14245. unsupported: false,
  14246. allowedElements: [ 'section' ]
  14247. },
  14248. main: {
  14249. type: 'landmark',
  14250. attributes: {
  14251. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14252. },
  14253. owned: null,
  14254. nameFrom: [ 'author' ],
  14255. context: null,
  14256. implicit: [ 'main' ],
  14257. unsupported: false,
  14258. allowedElements: [ 'article', 'section' ]
  14259. },
  14260. marquee: {
  14261. type: 'widget',
  14262. attributes: {
  14263. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14264. },
  14265. owned: null,
  14266. nameFrom: [ 'author' ],
  14267. context: null,
  14268. unsupported: false,
  14269. allowedElements: [ 'section' ]
  14270. },
  14271. math: {
  14272. type: 'structure',
  14273. attributes: {
  14274. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14275. },
  14276. owned: null,
  14277. nameFrom: [ 'author' ],
  14278. context: null,
  14279. implicit: [ 'math' ],
  14280. unsupported: false
  14281. },
  14282. menu: {
  14283. type: 'composite',
  14284. attributes: {
  14285. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  14286. },
  14287. owned: {
  14288. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  14289. },
  14290. nameFrom: [ 'author' ],
  14291. context: null,
  14292. implicit: [ 'menu[type="context"]' ],
  14293. unsupported: false,
  14294. allowedElements: [ 'ol', 'ul' ]
  14295. },
  14296. menubar: {
  14297. type: 'composite',
  14298. attributes: {
  14299. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  14300. },
  14301. owned: {
  14302. one: [ 'menuitem', 'menuitemradio', 'menuitemcheckbox' ]
  14303. },
  14304. nameFrom: [ 'author' ],
  14305. context: null,
  14306. unsupported: false,
  14307. allowedElements: [ 'ol', 'ul' ]
  14308. },
  14309. menuitem: {
  14310. type: 'widget',
  14311. attributes: {
  14312. allowed: [ 'aria-posinset', 'aria-setsize', 'aria-expanded', 'aria-errormessage' ]
  14313. },
  14314. owned: null,
  14315. nameFrom: [ 'author', 'contents' ],
  14316. context: [ 'menu', 'menubar' ],
  14317. implicit: [ 'menuitem[type="command"]' ],
  14318. unsupported: false,
  14319. allowedElements: [ 'button', 'li', {
  14320. nodeName: 'iput',
  14321. properties: {
  14322. type: [ 'image', 'button' ]
  14323. }
  14324. }, {
  14325. nodeName: 'a',
  14326. attributes: {
  14327. href: isNotNull
  14328. }
  14329. } ]
  14330. },
  14331. menuitemcheckbox: {
  14332. type: 'widget',
  14333. attributes: {
  14334. allowed: [ 'aria-checked', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  14335. },
  14336. owned: null,
  14337. nameFrom: [ 'author', 'contents' ],
  14338. context: [ 'menu', 'menubar' ],
  14339. implicit: [ 'menuitem[type="checkbox"]' ],
  14340. unsupported: false,
  14341. allowedElements: [ {
  14342. nodeName: [ 'button', 'li' ]
  14343. }, {
  14344. nodeName: 'input',
  14345. properties: {
  14346. type: [ 'checkbox', 'image', 'button' ]
  14347. }
  14348. }, {
  14349. nodeName: 'a',
  14350. attributes: {
  14351. href: isNotNull
  14352. }
  14353. } ]
  14354. },
  14355. menuitemradio: {
  14356. type: 'widget',
  14357. attributes: {
  14358. allowed: [ 'aria-checked', 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  14359. },
  14360. owned: null,
  14361. nameFrom: [ 'author', 'contents' ],
  14362. context: [ 'menu', 'menubar' ],
  14363. implicit: [ 'menuitem[type="radio"]' ],
  14364. unsupported: false,
  14365. allowedElements: [ {
  14366. nodeName: [ 'button', 'li' ]
  14367. }, {
  14368. nodeName: 'input',
  14369. properties: {
  14370. type: [ 'image', 'button', 'radio' ]
  14371. }
  14372. }, {
  14373. nodeName: 'a',
  14374. attributes: {
  14375. href: isNotNull
  14376. }
  14377. } ]
  14378. },
  14379. navigation: {
  14380. type: 'landmark',
  14381. attributes: {
  14382. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14383. },
  14384. owned: null,
  14385. nameFrom: [ 'author' ],
  14386. context: null,
  14387. implicit: [ 'nav' ],
  14388. unsupported: false,
  14389. allowedElements: [ 'section' ]
  14390. },
  14391. none: {
  14392. type: 'structure',
  14393. attributes: null,
  14394. owned: null,
  14395. nameFrom: [ 'author' ],
  14396. context: null,
  14397. unsupported: false,
  14398. allowedElements: [ {
  14399. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  14400. }, {
  14401. nodeName: 'img',
  14402. attributes: {
  14403. alt: isNotNull
  14404. }
  14405. } ]
  14406. },
  14407. note: {
  14408. type: 'structure',
  14409. attributes: {
  14410. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14411. },
  14412. owned: null,
  14413. nameFrom: [ 'author' ],
  14414. context: null,
  14415. unsupported: false,
  14416. allowedElements: [ 'aside' ]
  14417. },
  14418. option: {
  14419. type: 'widget',
  14420. attributes: {
  14421. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-checked', 'aria-errormessage' ]
  14422. },
  14423. owned: null,
  14424. nameFrom: [ 'author', 'contents' ],
  14425. context: [ 'listbox' ],
  14426. implicit: [ 'option' ],
  14427. unsupported: false,
  14428. allowedElements: [ {
  14429. nodeName: [ 'button', 'li' ]
  14430. }, {
  14431. nodeName: 'input',
  14432. properties: {
  14433. type: [ 'checkbox', 'button' ]
  14434. }
  14435. }, {
  14436. nodeName: 'a',
  14437. attributes: {
  14438. href: isNotNull
  14439. }
  14440. } ]
  14441. },
  14442. presentation: {
  14443. type: 'structure',
  14444. attributes: null,
  14445. owned: null,
  14446. nameFrom: [ 'author' ],
  14447. context: null,
  14448. unsupported: false,
  14449. allowedElements: [ {
  14450. nodeName: [ 'article', 'aside', 'dl', 'embed', 'figcaption', 'fieldset', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hr', 'iframe', 'li', 'ol', 'section', 'ul' ]
  14451. }, {
  14452. nodeName: 'img',
  14453. attributes: {
  14454. alt: isNotNull
  14455. }
  14456. } ]
  14457. },
  14458. progressbar: {
  14459. type: 'widget',
  14460. attributes: {
  14461. allowed: [ 'aria-valuetext', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-expanded', 'aria-errormessage' ]
  14462. },
  14463. owned: null,
  14464. nameFrom: [ 'author' ],
  14465. context: null,
  14466. implicit: [ 'progress' ],
  14467. unsupported: false
  14468. },
  14469. radio: {
  14470. type: 'widget',
  14471. attributes: {
  14472. allowed: [ 'aria-selected', 'aria-posinset', 'aria-setsize', 'aria-required', 'aria-errormessage', 'aria-checked' ]
  14473. },
  14474. owned: null,
  14475. nameFrom: [ 'author', 'contents' ],
  14476. context: null,
  14477. implicit: [ 'input[type="radio"]' ],
  14478. unsupported: false,
  14479. allowedElements: [ {
  14480. nodeName: [ 'button', 'li' ]
  14481. }, {
  14482. nodeName: 'input',
  14483. properties: {
  14484. type: [ 'image', 'button' ]
  14485. }
  14486. } ]
  14487. },
  14488. radiogroup: {
  14489. type: 'composite',
  14490. attributes: {
  14491. allowed: [ 'aria-activedescendant', 'aria-required', 'aria-expanded', 'aria-readonly', 'aria-errormessage', 'aria-orientation' ]
  14492. },
  14493. owned: {
  14494. all: [ 'radio' ]
  14495. },
  14496. nameFrom: [ 'author' ],
  14497. context: null,
  14498. unsupported: false,
  14499. allowedElements: {
  14500. nodeName: [ 'ol', 'ul', 'fieldset' ]
  14501. }
  14502. },
  14503. range: {
  14504. nameFrom: [ 'author' ],
  14505. type: 'abstract',
  14506. unsupported: false
  14507. },
  14508. region: {
  14509. type: 'landmark',
  14510. attributes: {
  14511. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14512. },
  14513. owned: null,
  14514. nameFrom: [ 'author' ],
  14515. context: null,
  14516. implicit: [ 'section[aria-label]', 'section[aria-labelledby]', 'section[title]' ],
  14517. unsupported: false,
  14518. allowedElements: {
  14519. nodeName: [ 'article', 'aside' ]
  14520. }
  14521. },
  14522. roletype: {
  14523. type: 'abstract',
  14524. unsupported: false
  14525. },
  14526. row: {
  14527. type: 'structure',
  14528. attributes: {
  14529. allowed: [ 'aria-activedescendant', 'aria-colindex', 'aria-expanded', 'aria-level', 'aria-selected', 'aria-rowindex', 'aria-errormessage' ]
  14530. },
  14531. owned: {
  14532. one: [ 'cell', 'columnheader', 'rowheader', 'gridcell' ]
  14533. },
  14534. nameFrom: [ 'author', 'contents' ],
  14535. context: [ 'rowgroup', 'grid', 'treegrid', 'table' ],
  14536. implicit: [ 'tr' ],
  14537. unsupported: false
  14538. },
  14539. rowgroup: {
  14540. type: 'structure',
  14541. attributes: {
  14542. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-errormessage' ]
  14543. },
  14544. owned: {
  14545. all: [ 'row' ]
  14546. },
  14547. nameFrom: [ 'author', 'contents' ],
  14548. context: [ 'grid', 'table', 'treegrid' ],
  14549. implicit: [ 'tbody', 'thead', 'tfoot' ],
  14550. unsupported: false
  14551. },
  14552. rowheader: {
  14553. type: 'structure',
  14554. attributes: {
  14555. allowed: [ 'aria-colindex', 'aria-colspan', 'aria-expanded', 'aria-rowindex', 'aria-rowspan', 'aria-required', 'aria-readonly', 'aria-selected', 'aria-sort', 'aria-errormessage' ]
  14556. },
  14557. owned: null,
  14558. nameFrom: [ 'author', 'contents' ],
  14559. context: [ 'row' ],
  14560. implicit: [ 'th' ],
  14561. unsupported: false
  14562. },
  14563. scrollbar: {
  14564. type: 'widget',
  14565. attributes: {
  14566. required: [ 'aria-controls', 'aria-valuenow' ],
  14567. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ]
  14568. },
  14569. owned: null,
  14570. nameFrom: [ 'author' ],
  14571. context: null,
  14572. unsupported: false
  14573. },
  14574. search: {
  14575. type: 'landmark',
  14576. attributes: {
  14577. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14578. },
  14579. owned: null,
  14580. nameFrom: [ 'author' ],
  14581. context: null,
  14582. unsupported: false,
  14583. allowedElements: {
  14584. nodeName: [ 'aside', 'form', 'section' ]
  14585. }
  14586. },
  14587. searchbox: {
  14588. type: 'widget',
  14589. attributes: {
  14590. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  14591. },
  14592. owned: null,
  14593. nameFrom: [ 'author' ],
  14594. context: null,
  14595. implicit: [ 'input[type="search"]' ],
  14596. unsupported: false,
  14597. allowedElements: {
  14598. nodeName: 'input',
  14599. properties: {
  14600. type: 'text'
  14601. }
  14602. }
  14603. },
  14604. section: {
  14605. nameFrom: [ 'author', 'contents' ],
  14606. type: 'abstract',
  14607. unsupported: false
  14608. },
  14609. sectionhead: {
  14610. nameFrom: [ 'author', 'contents' ],
  14611. type: 'abstract',
  14612. unsupported: false
  14613. },
  14614. select: {
  14615. nameFrom: [ 'author' ],
  14616. type: 'abstract',
  14617. unsupported: false
  14618. },
  14619. separator: {
  14620. type: 'structure',
  14621. attributes: {
  14622. allowed: [ 'aria-expanded', 'aria-orientation', 'aria-valuenow', 'aria-valuemax', 'aria-valuemin', 'aria-valuetext', 'aria-errormessage' ]
  14623. },
  14624. owned: null,
  14625. nameFrom: [ 'author' ],
  14626. context: null,
  14627. implicit: [ 'hr' ],
  14628. unsupported: false,
  14629. allowedElements: [ 'li' ]
  14630. },
  14631. slider: {
  14632. type: 'widget',
  14633. attributes: {
  14634. allowed: [ 'aria-valuetext', 'aria-orientation', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  14635. required: [ 'aria-valuenow' ]
  14636. },
  14637. owned: null,
  14638. nameFrom: [ 'author' ],
  14639. context: null,
  14640. implicit: [ 'input[type="range"]' ],
  14641. unsupported: false
  14642. },
  14643. spinbutton: {
  14644. type: 'widget',
  14645. attributes: {
  14646. allowed: [ 'aria-valuetext', 'aria-required', 'aria-readonly', 'aria-errormessage', 'aria-valuemax', 'aria-valuemin' ],
  14647. required: [ 'aria-valuenow' ]
  14648. },
  14649. owned: null,
  14650. nameFrom: [ 'author' ],
  14651. context: null,
  14652. implicit: [ 'input[type="number"]' ],
  14653. unsupported: false,
  14654. allowedElements: {
  14655. nodeName: 'input',
  14656. properties: {
  14657. type: [ 'text', 'tel' ]
  14658. }
  14659. }
  14660. },
  14661. status: {
  14662. type: 'widget',
  14663. attributes: {
  14664. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14665. },
  14666. owned: null,
  14667. nameFrom: [ 'author' ],
  14668. context: null,
  14669. implicit: [ 'output' ],
  14670. unsupported: false,
  14671. allowedElements: [ 'section' ]
  14672. },
  14673. structure: {
  14674. type: 'abstract',
  14675. unsupported: false
  14676. },
  14677. switch: {
  14678. type: 'widget',
  14679. attributes: {
  14680. allowed: [ 'aria-errormessage' ],
  14681. required: [ 'aria-checked' ]
  14682. },
  14683. owned: null,
  14684. nameFrom: [ 'author', 'contents' ],
  14685. context: null,
  14686. unsupported: false,
  14687. allowedElements: [ 'button', {
  14688. nodeName: 'input',
  14689. properties: {
  14690. type: [ 'checkbox', 'image', 'button' ]
  14691. }
  14692. }, {
  14693. nodeName: 'a',
  14694. attributes: {
  14695. href: isNotNull
  14696. }
  14697. } ]
  14698. },
  14699. tab: {
  14700. type: 'widget',
  14701. attributes: {
  14702. allowed: [ 'aria-selected', 'aria-expanded', 'aria-setsize', 'aria-posinset', 'aria-errormessage' ]
  14703. },
  14704. owned: null,
  14705. nameFrom: [ 'author', 'contents' ],
  14706. context: [ 'tablist' ],
  14707. unsupported: false,
  14708. allowedElements: [ {
  14709. nodeName: [ 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'li' ]
  14710. }, {
  14711. nodeName: 'input',
  14712. properties: {
  14713. type: 'button'
  14714. }
  14715. }, {
  14716. nodeName: 'a',
  14717. attributes: {
  14718. href: isNotNull
  14719. }
  14720. } ]
  14721. },
  14722. table: {
  14723. type: 'structure',
  14724. attributes: {
  14725. allowed: [ 'aria-colcount', 'aria-rowcount', 'aria-errormessage' ]
  14726. },
  14727. owned: {
  14728. one: [ 'rowgroup', 'row' ]
  14729. },
  14730. nameFrom: [ 'author', 'contents' ],
  14731. context: null,
  14732. implicit: [ 'table' ],
  14733. unsupported: false
  14734. },
  14735. tablist: {
  14736. type: 'composite',
  14737. attributes: {
  14738. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-orientation', 'aria-errormessage' ]
  14739. },
  14740. owned: {
  14741. all: [ 'tab' ]
  14742. },
  14743. nameFrom: [ 'author' ],
  14744. context: null,
  14745. unsupported: false,
  14746. allowedElements: [ 'ol', 'ul' ]
  14747. },
  14748. tabpanel: {
  14749. type: 'widget',
  14750. attributes: {
  14751. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14752. },
  14753. owned: null,
  14754. nameFrom: [ 'author' ],
  14755. context: null,
  14756. unsupported: false,
  14757. allowedElements: [ 'section' ]
  14758. },
  14759. term: {
  14760. type: 'structure',
  14761. attributes: {
  14762. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14763. },
  14764. owned: null,
  14765. nameFrom: [ 'author', 'contents' ],
  14766. context: null,
  14767. implicit: [ 'dt' ],
  14768. unsupported: false
  14769. },
  14770. textbox: {
  14771. type: 'widget',
  14772. attributes: {
  14773. allowed: [ 'aria-activedescendant', 'aria-autocomplete', 'aria-multiline', 'aria-readonly', 'aria-required', 'aria-placeholder', 'aria-errormessage' ]
  14774. },
  14775. owned: null,
  14776. nameFrom: [ 'author' ],
  14777. context: null,
  14778. implicit: [ 'input[type="text"]', 'input[type="email"]', 'input[type="password"]', 'input[type="tel"]', 'input[type="url"]', 'input:not([type])', 'textarea' ],
  14779. unsupported: false
  14780. },
  14781. timer: {
  14782. type: 'widget',
  14783. attributes: {
  14784. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14785. },
  14786. owned: null,
  14787. nameFrom: [ 'author' ],
  14788. context: null,
  14789. unsupported: false
  14790. },
  14791. toolbar: {
  14792. type: 'structure',
  14793. attributes: {
  14794. allowed: [ 'aria-activedescendant', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  14795. },
  14796. owned: null,
  14797. nameFrom: [ 'author' ],
  14798. context: null,
  14799. implicit: [ 'menu[type="toolbar"]' ],
  14800. unsupported: false,
  14801. allowedElements: [ 'ol', 'ul' ]
  14802. },
  14803. tooltip: {
  14804. type: 'structure',
  14805. attributes: {
  14806. allowed: [ 'aria-expanded', 'aria-errormessage' ]
  14807. },
  14808. owned: null,
  14809. nameFrom: [ 'author', 'contents' ],
  14810. context: null,
  14811. unsupported: false
  14812. },
  14813. tree: {
  14814. type: 'composite',
  14815. attributes: {
  14816. allowed: [ 'aria-activedescendant', 'aria-multiselectable', 'aria-required', 'aria-expanded', 'aria-orientation', 'aria-errormessage' ]
  14817. },
  14818. owned: {
  14819. all: [ 'treeitem' ]
  14820. },
  14821. nameFrom: [ 'author' ],
  14822. context: null,
  14823. unsupported: false,
  14824. allowedElements: [ 'ol', 'ul' ]
  14825. },
  14826. treegrid: {
  14827. type: 'composite',
  14828. attributes: {
  14829. allowed: [ 'aria-activedescendant', 'aria-colcount', 'aria-expanded', 'aria-level', 'aria-multiselectable', 'aria-readonly', 'aria-required', 'aria-rowcount', 'aria-orientation', 'aria-errormessage' ]
  14830. },
  14831. owned: {
  14832. one: [ 'rowgroup', 'row' ]
  14833. },
  14834. nameFrom: [ 'author' ],
  14835. context: null,
  14836. unsupported: false
  14837. },
  14838. treeitem: {
  14839. type: 'widget',
  14840. attributes: {
  14841. allowed: [ 'aria-checked', 'aria-selected', 'aria-expanded', 'aria-level', 'aria-posinset', 'aria-setsize', 'aria-errormessage' ]
  14842. },
  14843. owned: null,
  14844. nameFrom: [ 'author', 'contents' ],
  14845. context: [ 'group', 'tree' ],
  14846. unsupported: false,
  14847. allowedElements: [ 'li', {
  14848. nodeName: 'a',
  14849. attributes: {
  14850. href: isNotNull
  14851. }
  14852. } ]
  14853. },
  14854. widget: {
  14855. type: 'abstract',
  14856. unsupported: false
  14857. },
  14858. window: {
  14859. nameFrom: [ 'author' ],
  14860. type: 'abstract',
  14861. unsupported: false
  14862. }
  14863. };
  14864. lookupTable.implicitHtmlRole = implicit_html_roles_default;
  14865. lookupTable.elementsAllowedNoRole = [ {
  14866. nodeName: [ 'base', 'body', 'caption', 'col', 'colgroup', 'datalist', 'dd', 'details', 'dt', 'head', 'html', 'keygen', 'label', 'legend', 'main', 'map', 'math', 'meta', 'meter', 'noscript', 'optgroup', 'param', 'picture', 'progress', 'script', 'source', 'style', 'template', 'textarea', 'title', 'track' ]
  14867. }, {
  14868. nodeName: 'area',
  14869. attributes: {
  14870. href: isNotNull
  14871. }
  14872. }, {
  14873. nodeName: 'input',
  14874. properties: {
  14875. type: [ 'color', 'data', 'datatime', 'file', 'hidden', 'month', 'number', 'password', 'range', 'reset', 'submit', 'time', 'week' ]
  14876. }
  14877. }, {
  14878. nodeName: 'link',
  14879. attributes: {
  14880. href: isNotNull
  14881. }
  14882. }, {
  14883. nodeName: 'menu',
  14884. attributes: {
  14885. type: 'context'
  14886. }
  14887. }, {
  14888. nodeName: 'menuitem',
  14889. attributes: {
  14890. type: [ 'command', 'checkbox', 'radio' ]
  14891. }
  14892. }, {
  14893. nodeName: 'select',
  14894. condition: function condition(vNode) {
  14895. if (!(vNode instanceof axe.AbstractVirtualNode)) {
  14896. vNode = axe.utils.getNodeFromTree(vNode);
  14897. }
  14898. return Number(vNode.attr('size')) > 1;
  14899. },
  14900. properties: {
  14901. multiple: true
  14902. }
  14903. }, {
  14904. nodeName: [ 'clippath', 'cursor', 'defs', 'desc', 'feblend', 'fecolormatrix', 'fecomponenttransfer', 'fecomposite', 'feconvolvematrix', 'fediffuselighting', 'fedisplacementmap', 'fedistantlight', 'fedropshadow', 'feflood', 'fefunca', 'fefuncb', 'fefuncg', 'fefuncr', 'fegaussianblur', 'feimage', 'femerge', 'femergenode', 'femorphology', 'feoffset', 'fepointlight', 'fespecularlighting', 'fespotlight', 'fetile', 'feturbulence', 'filter', 'hatch', 'hatchpath', 'lineargradient', 'marker', 'mask', 'meshgradient', 'meshpatch', 'meshrow', 'metadata', 'mpath', 'pattern', 'radialgradient', 'solidcolor', 'stop', 'switch', 'view' ]
  14905. } ];
  14906. lookupTable.elementsAllowedAnyRole = [ {
  14907. nodeName: 'a',
  14908. attributes: {
  14909. href: isNull
  14910. }
  14911. }, {
  14912. nodeName: 'img',
  14913. attributes: {
  14914. alt: isNull
  14915. }
  14916. }, {
  14917. nodeName: [ 'abbr', 'address', 'canvas', 'div', 'p', 'pre', 'blockquote', 'ins', 'del', 'output', 'span', 'table', 'tbody', 'thead', 'tfoot', 'td', 'em', 'strong', 'small', 's', 'cite', 'q', 'dfn', 'abbr', 'time', 'code', 'var', 'samp', 'kbd', 'sub', 'sup', 'i', 'b', 'u', 'mark', 'ruby', 'rt', 'rp', 'bdi', 'bdo', 'br', 'wbr', 'th', 'tr' ]
  14918. } ];
  14919. lookupTable.evaluateRoleForElement = {
  14920. A: function A(_ref39) {
  14921. var node = _ref39.node, out = _ref39.out;
  14922. if (node.namespaceURI === 'http://www.w3.org/2000/svg') {
  14923. return true;
  14924. }
  14925. if (node.href.length) {
  14926. return out;
  14927. }
  14928. return true;
  14929. },
  14930. AREA: function AREA(_ref40) {
  14931. var node = _ref40.node;
  14932. return !node.href;
  14933. },
  14934. BUTTON: function BUTTON(_ref41) {
  14935. var node = _ref41.node, role = _ref41.role, out = _ref41.out;
  14936. if (node.getAttribute('type') === 'menu') {
  14937. return role === 'menuitem';
  14938. }
  14939. return out;
  14940. },
  14941. IMG: function IMG(_ref42) {
  14942. var node = _ref42.node, role = _ref42.role, out = _ref42.out;
  14943. switch (node.alt) {
  14944. case null:
  14945. return out;
  14946. case '':
  14947. return role === 'presentation' || role === 'none';
  14948. default:
  14949. return role !== 'presentation' && role !== 'none';
  14950. }
  14951. },
  14952. INPUT: function INPUT(_ref43) {
  14953. var node = _ref43.node, role = _ref43.role, out = _ref43.out;
  14954. switch (node.type) {
  14955. case 'button':
  14956. case 'image':
  14957. return out;
  14958. case 'checkbox':
  14959. if (role === 'button' && node.hasAttribute('aria-pressed')) {
  14960. return true;
  14961. }
  14962. return out;
  14963. case 'radio':
  14964. return role === 'menuitemradio';
  14965. case 'text':
  14966. return role === 'combobox' || role === 'searchbox' || role === 'spinbutton';
  14967. case 'tel':
  14968. return role === 'combobox' || role === 'spinbutton';
  14969. case 'url':
  14970. case 'search':
  14971. case 'email':
  14972. return role === 'combobox';
  14973. default:
  14974. return false;
  14975. }
  14976. },
  14977. LI: function LI(_ref44) {
  14978. var node = _ref44.node, out = _ref44.out;
  14979. var hasImplicitListitemRole = axe.utils.matchesSelector(node, 'ol li, ul li');
  14980. if (hasImplicitListitemRole) {
  14981. return out;
  14982. }
  14983. return true;
  14984. },
  14985. MENU: function MENU(_ref45) {
  14986. var node = _ref45.node;
  14987. if (node.getAttribute('type') === 'context') {
  14988. return false;
  14989. }
  14990. return true;
  14991. },
  14992. OPTION: function OPTION(_ref46) {
  14993. var node = _ref46.node;
  14994. var withinOptionList = axe.utils.matchesSelector(node, 'select > option, datalist > option, optgroup > option');
  14995. return !withinOptionList;
  14996. },
  14997. SELECT: function SELECT(_ref47) {
  14998. var node = _ref47.node, role = _ref47.role;
  14999. return !node.multiple && node.size <= 1 && role === 'menu';
  15000. },
  15001. SVG: function SVG(_ref48) {
  15002. var node = _ref48.node, out = _ref48.out;
  15003. if (node.parentNode && node.parentNode.namespaceURI === 'http://www.w3.org/2000/svg') {
  15004. return true;
  15005. }
  15006. return out;
  15007. }
  15008. };
  15009. lookupTable.rolesOfType = {
  15010. widget: [ 'button', 'checkbox', 'dialog', 'gridcell', 'link', 'log', 'marquee', 'menuitem', 'menuitemcheckbox', 'menuitemradio', 'option', 'progressbar', 'radio', 'scrollbar', 'searchbox', 'slider', 'spinbutton', 'status', 'switch', 'tab', 'tabpanel', 'textbox', 'timer', 'tooltip', 'tree', 'treeitem' ]
  15011. };
  15012. var lookup_table_default = lookupTable;
  15013. function implicitNodes(role) {
  15014. var implicit = null;
  15015. var roles = lookup_table_default.role[role];
  15016. if (roles && roles.implicit) {
  15017. implicit = clone_default(roles.implicit);
  15018. }
  15019. return implicit;
  15020. }
  15021. var implicit_nodes_default = implicitNodes;
  15022. function isAccessibleRef(node) {
  15023. return !!get_accessible_refs_default(node).length;
  15024. }
  15025. var is_accessible_ref_default = isAccessibleRef;
  15026. function label3(node) {
  15027. node = get_node_from_tree_default(node);
  15028. return label_virtual_default(node);
  15029. }
  15030. var label_default2 = label3;
  15031. function requiredAttr(role) {
  15032. var roleDef = standards_default.ariaRoles[role];
  15033. if (!roleDef || !Array.isArray(roleDef.requiredAttrs)) {
  15034. return [];
  15035. }
  15036. return _toConsumableArray(roleDef.requiredAttrs);
  15037. }
  15038. var required_attr_default = requiredAttr;
  15039. function requiredContext(role) {
  15040. var roleDef = standards_default.ariaRoles[role];
  15041. if (!roleDef || !Array.isArray(roleDef.requiredContext)) {
  15042. return null;
  15043. }
  15044. return _toConsumableArray(roleDef.requiredContext);
  15045. }
  15046. var required_context_default = requiredContext;
  15047. function requiredOwned(role) {
  15048. var roleDef = standards_default.ariaRoles[role];
  15049. if (!roleDef || !Array.isArray(roleDef.requiredOwned)) {
  15050. return null;
  15051. }
  15052. return _toConsumableArray(roleDef.requiredOwned);
  15053. }
  15054. var required_owned_default = requiredOwned;
  15055. function validateAttrValue(node, attr) {
  15056. var matches13;
  15057. var list;
  15058. var value = node.getAttribute(attr);
  15059. var attrInfo = standards_default.ariaAttrs[attr];
  15060. var doc = get_root_node_default2(node);
  15061. if (!attrInfo) {
  15062. return true;
  15063. }
  15064. if (attrInfo.allowEmpty && (!value || value.trim() === '')) {
  15065. return true;
  15066. }
  15067. switch (attrInfo.type) {
  15068. case 'boolean':
  15069. return [ 'true', 'false' ].includes(value.toLowerCase());
  15070. case 'nmtoken':
  15071. return typeof value === 'string' && attrInfo.values.includes(value.toLowerCase());
  15072. case 'nmtokens':
  15073. list = token_list_default(value);
  15074. return list.reduce(function(result, token) {
  15075. return result && attrInfo.values.includes(token);
  15076. }, list.length !== 0);
  15077. case 'idref':
  15078. return !!(value && doc.getElementById(value));
  15079. case 'idrefs':
  15080. list = token_list_default(value);
  15081. return list.some(function(token) {
  15082. return doc.getElementById(token);
  15083. });
  15084. case 'string':
  15085. return value.trim() !== '';
  15086. case 'decimal':
  15087. matches13 = value.match(/^[-+]?([0-9]*)\.?([0-9]*)$/);
  15088. return !!(matches13 && (matches13[1] || matches13[2]));
  15089. case 'int':
  15090. return /^[-+]?[0-9]+$/.test(value);
  15091. }
  15092. }
  15093. var validate_attr_value_default = validateAttrValue;
  15094. function validateAttr(att) {
  15095. var attrDefinition = standards_default.ariaAttrs[att];
  15096. return !!attrDefinition;
  15097. }
  15098. var validate_attr_default = validateAttr;
  15099. function abstractroleEvaluate(node, options, virtualNode) {
  15100. var abstractRoles = token_list_default(virtualNode.attr('role')).filter(function(role) {
  15101. return get_role_type_default(role) === 'abstract';
  15102. });
  15103. if (abstractRoles.length > 0) {
  15104. this.data(abstractRoles);
  15105. return true;
  15106. }
  15107. return false;
  15108. }
  15109. var abstractrole_evaluate_default = abstractroleEvaluate;
  15110. function ariaAllowedAttrEvaluate(node, options) {
  15111. var invalid = [];
  15112. var role = get_role_default(node);
  15113. var attrs = get_node_attributes_default(node);
  15114. var allowed = allowed_attr_default(role);
  15115. if (Array.isArray(options[role])) {
  15116. allowed = unique_array_default(options[role].concat(allowed));
  15117. }
  15118. if (role && allowed) {
  15119. for (var _i13 = 0; _i13 < attrs.length; _i13++) {
  15120. var attr = attrs[_i13];
  15121. var attrName = attr.name;
  15122. if (validate_attr_default(attrName) && !allowed.includes(attrName)) {
  15123. invalid.push(attrName + '="' + attr.nodeValue + '"');
  15124. }
  15125. }
  15126. }
  15127. if (invalid.length) {
  15128. this.data(invalid);
  15129. return false;
  15130. }
  15131. return true;
  15132. }
  15133. var aria_allowed_attr_evaluate_default = ariaAllowedAttrEvaluate;
  15134. function ariaAllowedRoledEvaluate(node) {
  15135. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15136. var _options$allowImplici = options.allowImplicit, allowImplicit = _options$allowImplici === void 0 ? true : _options$allowImplici, _options$ignoredTags = options.ignoredTags, ignoredTags = _options$ignoredTags === void 0 ? [] : _options$ignoredTags;
  15137. var tagName = node.nodeName.toUpperCase();
  15138. if (ignoredTags.map(function(t) {
  15139. return t.toUpperCase();
  15140. }).includes(tagName)) {
  15141. return true;
  15142. }
  15143. var unallowedRoles = get_element_unallowed_roles_default(node, allowImplicit);
  15144. if (unallowedRoles.length) {
  15145. this.data(unallowedRoles);
  15146. if (!is_visible_default(node, true)) {
  15147. return void 0;
  15148. }
  15149. return false;
  15150. }
  15151. return true;
  15152. }
  15153. var aria_allowed_role_evaluate_default = ariaAllowedRoledEvaluate;
  15154. function ariaErrormessageEvaluate(node, options) {
  15155. options = Array.isArray(options) ? options : [];
  15156. var attr = node.getAttribute('aria-errormessage');
  15157. var hasAttr = node.hasAttribute('aria-errormessage');
  15158. var doc = get_root_node_default2(node);
  15159. function validateAttrValue2(attr2) {
  15160. if (attr2.trim() === '') {
  15161. return standards_default.ariaAttrs['aria-errormessage'].allowEmpty;
  15162. }
  15163. var idref = attr2 && doc.getElementById(attr2);
  15164. if (idref) {
  15165. return idref.getAttribute('role') === 'alert' || idref.getAttribute('aria-live') === 'assertive' || idref.getAttribute('aria-live') === 'polite' || token_list_default(node.getAttribute('aria-describedby')).indexOf(attr2) > -1;
  15166. }
  15167. return;
  15168. }
  15169. if (options.indexOf(attr) === -1 && hasAttr) {
  15170. this.data(token_list_default(attr));
  15171. return validateAttrValue2(attr);
  15172. }
  15173. return true;
  15174. }
  15175. var aria_errormessage_evaluate_default = ariaErrormessageEvaluate;
  15176. function ariaHiddenBodyEvaluate(node, options, virtualNode) {
  15177. return virtualNode.attr('aria-hidden') !== 'true';
  15178. }
  15179. var aria_hidden_body_evaluate_default = ariaHiddenBodyEvaluate;
  15180. var standards_exports = {};
  15181. __export(standards_exports, {
  15182. getAriaRolesByType: function getAriaRolesByType() {
  15183. return get_aria_roles_by_type_default;
  15184. },
  15185. getAriaRolesSupportingNameFromContent: function getAriaRolesSupportingNameFromContent() {
  15186. return get_aria_roles_supporting_name_from_content_default;
  15187. },
  15188. getElementSpec: function getElementSpec() {
  15189. return get_element_spec_default;
  15190. },
  15191. getElementsByContentType: function getElementsByContentType() {
  15192. return get_elements_by_content_type_default;
  15193. },
  15194. getGlobalAriaAttrs: function getGlobalAriaAttrs() {
  15195. return get_global_aria_attrs_default;
  15196. },
  15197. implicitHtmlRoles: function implicitHtmlRoles() {
  15198. return implicit_html_roles_default;
  15199. }
  15200. });
  15201. function ariaRequiredAttrEvaluate(node) {
  15202. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15203. var vNode = get_node_from_tree_default(node);
  15204. var missing = [];
  15205. if (node.hasAttributes()) {
  15206. var role = node.getAttribute('role');
  15207. var required = required_attr_default(role);
  15208. var elmSpec = get_element_spec_default(vNode);
  15209. if (Array.isArray(options[role])) {
  15210. required = unique_array_default(options[role], required);
  15211. }
  15212. if (role && required) {
  15213. for (var _i14 = 0, l = required.length; _i14 < l; _i14++) {
  15214. var attr = required[_i14];
  15215. if (!node.getAttribute(attr) && !(elmSpec.implicitAttrs && typeof elmSpec.implicitAttrs[attr] !== 'undefined')) {
  15216. missing.push(attr);
  15217. }
  15218. }
  15219. }
  15220. }
  15221. if (missing.length) {
  15222. this.data(missing);
  15223. return false;
  15224. }
  15225. return true;
  15226. }
  15227. var aria_required_attr_evaluate_default = ariaRequiredAttrEvaluate;
  15228. function getOwnedRoles(virtualNode) {
  15229. var ownedRoles = [];
  15230. var ownedElements = get_owned_virtual_default(virtualNode);
  15231. for (var _i15 = 0; _i15 < ownedElements.length; _i15++) {
  15232. var ownedElement = ownedElements[_i15];
  15233. var role = get_role_default(ownedElement);
  15234. if ([ 'presentation', 'none', null ].includes(role)) {
  15235. ownedElements.push.apply(ownedElements, _toConsumableArray(ownedElement.children));
  15236. } else if (role) {
  15237. ownedRoles.push(role);
  15238. }
  15239. }
  15240. return ownedRoles;
  15241. }
  15242. function missingRequiredChildren(virtualNode, role, required, ownedRoles) {
  15243. var isCombobox = role === 'combobox';
  15244. if (isCombobox) {
  15245. var textTypeInputs = [ 'text', 'search', 'email', 'url', 'tel' ];
  15246. if (virtualNode.props.nodeName === 'input' && textTypeInputs.includes(virtualNode.props.type) || ownedRoles.includes('searchbox')) {
  15247. required = required.filter(function(requiredRole) {
  15248. return requiredRole !== 'textbox';
  15249. });
  15250. }
  15251. var expandedChildRoles = [ 'listbox', 'tree', 'grid', 'dialog' ];
  15252. var expandedValue = virtualNode.attr('aria-expanded');
  15253. var expanded = expandedValue && expandedValue.toLowerCase() !== 'false';
  15254. var popupRole = (virtualNode.attr('aria-haspopup') || 'listbox').toLowerCase();
  15255. required = required.filter(function(requiredRole) {
  15256. return !expandedChildRoles.includes(requiredRole) || expanded && requiredRole === popupRole;
  15257. });
  15258. }
  15259. for (var _i16 = 0; _i16 < ownedRoles.length; _i16++) {
  15260. var ownedRole = ownedRoles[_i16];
  15261. if (required.includes(ownedRole)) {
  15262. required = required.filter(function(requiredRole) {
  15263. return requiredRole !== ownedRole;
  15264. });
  15265. if (!isCombobox) {
  15266. return null;
  15267. }
  15268. }
  15269. }
  15270. if (required.length) {
  15271. return required;
  15272. }
  15273. return null;
  15274. }
  15275. function ariaRequiredChildrenEvaluate(node, options, virtualNode) {
  15276. var reviewEmpty = options && Array.isArray(options.reviewEmpty) ? options.reviewEmpty : [];
  15277. var role = get_explicit_role_default(virtualNode, {
  15278. dpub: true
  15279. });
  15280. var required = required_owned_default(role);
  15281. if (!required) {
  15282. return true;
  15283. }
  15284. var ownedRoles = getOwnedRoles(virtualNode);
  15285. var missing = missingRequiredChildren(virtualNode, role, required, ownedRoles);
  15286. if (!missing) {
  15287. return true;
  15288. }
  15289. this.data(missing);
  15290. if (reviewEmpty.includes(role) && !has_content_virtual_default(virtualNode, false, true) && !ownedRoles.length && (!virtualNode.hasAttr('aria-owns') || !idrefs_default(node, 'aria-owns').length)) {
  15291. return void 0;
  15292. }
  15293. return false;
  15294. }
  15295. var aria_required_children_evaluate_default = ariaRequiredChildrenEvaluate;
  15296. function getMissingContext(virtualNode, reqContext, includeElement) {
  15297. var explicitRole2 = get_explicit_role_default(virtualNode);
  15298. if (!reqContext) {
  15299. reqContext = required_context_default(explicitRole2);
  15300. }
  15301. if (!reqContext) {
  15302. return null;
  15303. }
  15304. var vNode = includeElement ? virtualNode : virtualNode.parent;
  15305. while (vNode) {
  15306. var parentRole = get_role_default(vNode);
  15307. if (reqContext.includes(parentRole)) {
  15308. return null;
  15309. } else if (parentRole && ![ 'presentation', 'none' ].includes(parentRole)) {
  15310. return reqContext;
  15311. }
  15312. vNode = vNode.parent;
  15313. }
  15314. return reqContext;
  15315. }
  15316. function getAriaOwners(element) {
  15317. var owners = [], o = null;
  15318. while (element) {
  15319. if (element.getAttribute('id')) {
  15320. var id = escape_selector_default(element.getAttribute('id'));
  15321. var doc = get_root_node_default2(element);
  15322. o = doc.querySelector('[aria-owns~='.concat(id, ']'));
  15323. if (o) {
  15324. owners.push(o);
  15325. }
  15326. }
  15327. element = element.parentElement;
  15328. }
  15329. return owners.length ? owners : null;
  15330. }
  15331. function ariaRequiredParentEvaluate(node, options, virtualNode) {
  15332. var missingParents = getMissingContext(virtualNode);
  15333. if (!missingParents) {
  15334. return true;
  15335. }
  15336. var owners = getAriaOwners(node);
  15337. if (owners) {
  15338. for (var i = 0, l = owners.length; i < l; i++) {
  15339. missingParents = getMissingContext(get_node_from_tree_default(owners[i]), missingParents, true);
  15340. if (!missingParents) {
  15341. return true;
  15342. }
  15343. }
  15344. }
  15345. this.data(missingParents);
  15346. return false;
  15347. }
  15348. var aria_required_parent_evaluate_default = ariaRequiredParentEvaluate;
  15349. function ariaRoledescriptionEvaluate(node) {
  15350. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  15351. var role = get_role_default(node);
  15352. var supportedRoles = options.supportedRoles || [];
  15353. if (supportedRoles.includes(role)) {
  15354. return true;
  15355. }
  15356. if (role && role !== 'presentation' && role !== 'none') {
  15357. return void 0;
  15358. }
  15359. return false;
  15360. }
  15361. var aria_roledescription_evaluate_default = ariaRoledescriptionEvaluate;
  15362. function ariaUnsupportedAttrEvaluate(node) {
  15363. var unsupportedAttrs = Array.from(get_node_attributes_default(node)).filter(function(_ref49) {
  15364. var name = _ref49.name;
  15365. var attribute = standards_default.ariaAttrs[name];
  15366. if (!validate_attr_default(name)) {
  15367. return false;
  15368. }
  15369. var unsupported4 = attribute.unsupported;
  15370. if (_typeof(unsupported4) !== 'object') {
  15371. return !!unsupported4;
  15372. }
  15373. return !matches_default3(node, unsupported4.exceptions);
  15374. }).map(function(candidate) {
  15375. return candidate.name.toString();
  15376. });
  15377. if (unsupportedAttrs.length) {
  15378. this.data(unsupportedAttrs);
  15379. return true;
  15380. }
  15381. return false;
  15382. }
  15383. var aria_unsupported_attr_evaluate_default = ariaUnsupportedAttrEvaluate;
  15384. function ariaValidAttrEvaluate(node, options) {
  15385. options = Array.isArray(options.value) ? options.value : [];
  15386. var invalid = [], aria38 = /^aria-/;
  15387. var attr, attrs = get_node_attributes_default(node);
  15388. for (var i = 0, l = attrs.length; i < l; i++) {
  15389. attr = attrs[i].name;
  15390. if (options.indexOf(attr) === -1 && aria38.test(attr) && !validate_attr_default(attr)) {
  15391. invalid.push(attr);
  15392. }
  15393. }
  15394. if (invalid.length) {
  15395. this.data(invalid);
  15396. return false;
  15397. }
  15398. return true;
  15399. }
  15400. var aria_valid_attr_evaluate_default = ariaValidAttrEvaluate;
  15401. function ariaValidAttrValueEvaluate(node, options) {
  15402. options = Array.isArray(options.value) ? options.value : [];
  15403. var needsReview = '';
  15404. var messageKey = '';
  15405. var invalid = [];
  15406. var aria38 = /^aria-/;
  15407. var attrs = get_node_attributes_default(node);
  15408. var skipAttrs = [ 'aria-errormessage' ];
  15409. var preChecks = {
  15410. 'aria-controls': function ariaControls() {
  15411. return node.getAttribute('aria-expanded') !== 'false' && node.getAttribute('aria-selected') !== 'false';
  15412. },
  15413. 'aria-current': function ariaCurrent() {
  15414. if (!validate_attr_value_default(node, 'aria-current')) {
  15415. needsReview = 'aria-current="'.concat(node.getAttribute('aria-current'), '"');
  15416. messageKey = 'ariaCurrent';
  15417. }
  15418. return;
  15419. },
  15420. 'aria-owns': function ariaOwns() {
  15421. return node.getAttribute('aria-expanded') !== 'false';
  15422. },
  15423. 'aria-describedby': function ariaDescribedby() {
  15424. if (!validate_attr_value_default(node, 'aria-describedby')) {
  15425. needsReview = 'aria-describedby="'.concat(node.getAttribute('aria-describedby'), '"');
  15426. messageKey = 'noId';
  15427. }
  15428. return;
  15429. }
  15430. };
  15431. for (var _i17 = 0, l = attrs.length; _i17 < l; _i17++) {
  15432. var attr = attrs[_i17];
  15433. var attrName = attr.name;
  15434. if (!skipAttrs.includes(attrName) && options.indexOf(attrName) === -1 && aria38.test(attrName) && (preChecks[attrName] ? preChecks[attrName]() : true) && !validate_attr_value_default(node, attrName)) {
  15435. invalid.push(''.concat(attrName, '="').concat(attr.nodeValue, '"'));
  15436. }
  15437. }
  15438. if (needsReview) {
  15439. this.data({
  15440. messageKey: messageKey,
  15441. needsReview: needsReview
  15442. });
  15443. return void 0;
  15444. }
  15445. if (invalid.length) {
  15446. this.data(invalid);
  15447. return false;
  15448. }
  15449. return true;
  15450. }
  15451. var aria_valid_attr_value_evaluate_default = ariaValidAttrValueEvaluate;
  15452. function fallbackroleEvaluate(node, options, virtualNode) {
  15453. return token_list_default(virtualNode.attr('role')).length > 1;
  15454. }
  15455. var fallbackrole_evaluate_default = fallbackroleEvaluate;
  15456. function hasGlobalAriaAttributeEvaluate(node, options, virtualNode) {
  15457. var globalAttrs = get_global_aria_attrs_default().filter(function(attr) {
  15458. return virtualNode.hasAttr(attr);
  15459. });
  15460. this.data(globalAttrs);
  15461. return globalAttrs.length > 0;
  15462. }
  15463. var has_global_aria_attribute_evaluate_default = hasGlobalAriaAttributeEvaluate;
  15464. function hasWidgetRoleEvaluate(node) {
  15465. var role = node.getAttribute('role');
  15466. if (role === null) {
  15467. return false;
  15468. }
  15469. var roleType = get_role_type_default(role);
  15470. return roleType === 'widget' || roleType === 'composite';
  15471. }
  15472. var has_widget_role_evaluate_default = hasWidgetRoleEvaluate;
  15473. function invalidroleEvaluate(node, options, virtualNode) {
  15474. var allRoles = token_list_default(virtualNode.attr('role'));
  15475. var allInvalid = allRoles.every(function(role) {
  15476. return !is_valid_role_default(role, {
  15477. allowAbstract: true
  15478. });
  15479. });
  15480. if (allInvalid) {
  15481. this.data(allRoles);
  15482. return true;
  15483. }
  15484. return false;
  15485. }
  15486. var invalidrole_evaluate_default = invalidroleEvaluate;
  15487. function isElementFocusableEvaluate(node, options, virtualNode) {
  15488. return is_focusable_default(virtualNode);
  15489. }
  15490. var is_element_focusable_evaluate_default = isElementFocusableEvaluate;
  15491. function noImplicitExplicitLabelEvaluate(node, options, virtualNode) {
  15492. var role = get_role_default(virtualNode, {
  15493. noImplicit: true
  15494. });
  15495. this.data(role);
  15496. try {
  15497. var label5 = sanitize_default(label_text_default(virtualNode)).toLowerCase();
  15498. var accText = sanitize_default(accessible_text_virtual_default(virtualNode)).toLowerCase();
  15499. if (!accText && !label5) {
  15500. return false;
  15501. }
  15502. if (!accText && label5) {
  15503. return void 0;
  15504. }
  15505. if (!accText.includes(label5)) {
  15506. return void 0;
  15507. }
  15508. return false;
  15509. } catch (e) {
  15510. return void 0;
  15511. }
  15512. }
  15513. var no_implicit_explicit_label_evaluate_default = noImplicitExplicitLabelEvaluate;
  15514. function unsupportedroleEvaluate(node) {
  15515. return is_unsupported_role_default(get_role_default(node));
  15516. }
  15517. var unsupportedrole_evaluate_default = unsupportedroleEvaluate;
  15518. var VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS = {
  15519. ARTICLE: true,
  15520. ASIDE: true,
  15521. NAV: true,
  15522. SECTION: true
  15523. };
  15524. var VALID_ROLES_FOR_SCROLLABLE_REGIONS = {
  15525. application: true,
  15526. banner: false,
  15527. complementary: true,
  15528. contentinfo: true,
  15529. form: true,
  15530. main: true,
  15531. navigation: true,
  15532. region: true,
  15533. search: false
  15534. };
  15535. function validScrollableTagName(node) {
  15536. var nodeName2 = node.nodeName.toUpperCase();
  15537. return VALID_TAG_NAMES_FOR_SCROLLABLE_REGIONS[nodeName2] || false;
  15538. }
  15539. function validScrollableRole(node) {
  15540. var role = node.getAttribute('role');
  15541. if (!role) {
  15542. return false;
  15543. }
  15544. return VALID_ROLES_FOR_SCROLLABLE_REGIONS[role.toLowerCase()] || false;
  15545. }
  15546. function validScrollableSemanticsEvaluate(node) {
  15547. return validScrollableRole(node) || validScrollableTagName(node);
  15548. }
  15549. var valid_scrollable_semantics_evaluate_default = validScrollableSemanticsEvaluate;
  15550. var table_exports = {};
  15551. __export(table_exports, {
  15552. getAllCells: function getAllCells() {
  15553. return get_all_cells_default;
  15554. },
  15555. getCellPosition: function getCellPosition() {
  15556. return get_cell_position_default;
  15557. },
  15558. getHeaders: function getHeaders() {
  15559. return get_headers_default;
  15560. },
  15561. getScope: function getScope() {
  15562. return get_scope_default;
  15563. },
  15564. isColumnHeader: function isColumnHeader() {
  15565. return is_column_header_default;
  15566. },
  15567. isDataCell: function isDataCell() {
  15568. return is_data_cell_default;
  15569. },
  15570. isDataTable: function isDataTable() {
  15571. return is_data_table_default;
  15572. },
  15573. isHeader: function isHeader() {
  15574. return is_header_default;
  15575. },
  15576. isRowHeader: function isRowHeader() {
  15577. return is_row_header_default;
  15578. },
  15579. toArray: function toArray() {
  15580. return to_grid_default;
  15581. },
  15582. toGrid: function toGrid() {
  15583. return to_grid_default;
  15584. },
  15585. traverse: function traverse() {
  15586. return traverse_default;
  15587. }
  15588. });
  15589. function getAllCells(tableElm) {
  15590. var rowIndex, cellIndex, rowLength, cellLength;
  15591. var cells = [];
  15592. for (rowIndex = 0, rowLength = tableElm.rows.length; rowIndex < rowLength; rowIndex++) {
  15593. for (cellIndex = 0, cellLength = tableElm.rows[rowIndex].cells.length; cellIndex < cellLength; cellIndex++) {
  15594. cells.push(tableElm.rows[rowIndex].cells[cellIndex]);
  15595. }
  15596. }
  15597. return cells;
  15598. }
  15599. var get_all_cells_default = getAllCells;
  15600. function traverseForHeaders(headerType, position, tableGrid) {
  15601. var property = headerType === 'row' ? '_rowHeaders' : '_colHeaders';
  15602. var predicate = headerType === 'row' ? is_row_header_default : is_column_header_default;
  15603. var startCell = tableGrid[position.y][position.x];
  15604. var colspan = startCell.colSpan - 1;
  15605. var rowspan = startCell.rowSpan - 1;
  15606. var rowStart = position.y + rowspan;
  15607. var colStart = position.x + colspan;
  15608. var rowEnd = headerType === 'row' ? position.y : 0;
  15609. var colEnd = headerType === 'row' ? 0 : position.x;
  15610. var headers;
  15611. var cells = [];
  15612. for (var row = rowStart; row >= rowEnd && !headers; row--) {
  15613. for (var col = colStart; col >= colEnd; col--) {
  15614. var cell = tableGrid[row] ? tableGrid[row][col] : void 0;
  15615. if (!cell) {
  15616. continue;
  15617. }
  15618. var vNode = axe.utils.getNodeFromTree(cell);
  15619. if (vNode[property]) {
  15620. headers = vNode[property];
  15621. break;
  15622. }
  15623. cells.push(cell);
  15624. }
  15625. }
  15626. headers = (headers || []).concat(cells.filter(predicate));
  15627. cells.forEach(function(tableCell) {
  15628. var vNode = axe.utils.getNodeFromTree(tableCell);
  15629. vNode[property] = headers;
  15630. });
  15631. return headers;
  15632. }
  15633. function getHeaders(cell, tableGrid) {
  15634. if (cell.getAttribute('headers')) {
  15635. var headers = idrefs_default(cell, 'headers');
  15636. if (headers.filter(function(header) {
  15637. return header;
  15638. }).length) {
  15639. return headers;
  15640. }
  15641. }
  15642. if (!tableGrid) {
  15643. tableGrid = to_grid_default(find_up_default(cell, 'table'));
  15644. }
  15645. var position = get_cell_position_default(cell, tableGrid);
  15646. var rowHeaders = traverseForHeaders('row', position, tableGrid);
  15647. var colHeaders = traverseForHeaders('col', position, tableGrid);
  15648. return [].concat(rowHeaders, colHeaders).reverse();
  15649. }
  15650. var get_headers_default = getHeaders;
  15651. function isDataCell(cell) {
  15652. if (!cell.children.length && !cell.textContent.trim()) {
  15653. return false;
  15654. }
  15655. var role = cell.getAttribute('role');
  15656. if (is_valid_role_default(role)) {
  15657. return [ 'cell', 'gridcell' ].includes(role);
  15658. } else {
  15659. return cell.nodeName.toUpperCase() === 'TD';
  15660. }
  15661. }
  15662. var is_data_cell_default = isDataCell;
  15663. function isDataTable(node) {
  15664. var role = (node.getAttribute('role') || '').toLowerCase();
  15665. if ((role === 'presentation' || role === 'none') && !is_focusable_default(node)) {
  15666. return false;
  15667. }
  15668. if (node.getAttribute('contenteditable') === 'true' || find_up_default(node, '[contenteditable="true"]')) {
  15669. return true;
  15670. }
  15671. if (role === 'grid' || role === 'treegrid' || role === 'table') {
  15672. return true;
  15673. }
  15674. if (get_role_type_default(role) === 'landmark') {
  15675. return true;
  15676. }
  15677. if (node.getAttribute('datatable') === '0') {
  15678. return false;
  15679. }
  15680. if (node.getAttribute('summary')) {
  15681. return true;
  15682. }
  15683. if (node.tHead || node.tFoot || node.caption) {
  15684. return true;
  15685. }
  15686. for (var childIndex = 0, childLength = node.children.length; childIndex < childLength; childIndex++) {
  15687. if (node.children[childIndex].nodeName.toUpperCase() === 'COLGROUP') {
  15688. return true;
  15689. }
  15690. }
  15691. var cells = 0;
  15692. var rowLength = node.rows.length;
  15693. var row, cell;
  15694. var hasBorder = false;
  15695. for (var rowIndex = 0; rowIndex < rowLength; rowIndex++) {
  15696. row = node.rows[rowIndex];
  15697. for (var cellIndex = 0, cellLength = row.cells.length; cellIndex < cellLength; cellIndex++) {
  15698. cell = row.cells[cellIndex];
  15699. if (cell.nodeName.toUpperCase() === 'TH') {
  15700. return true;
  15701. }
  15702. if (!hasBorder && (cell.offsetWidth !== cell.clientWidth || cell.offsetHeight !== cell.clientHeight)) {
  15703. hasBorder = true;
  15704. }
  15705. if (cell.getAttribute('scope') || cell.getAttribute('headers') || cell.getAttribute('abbr')) {
  15706. return true;
  15707. }
  15708. if ([ 'columnheader', 'rowheader' ].includes((cell.getAttribute('role') || '').toLowerCase())) {
  15709. return true;
  15710. }
  15711. if (cell.children.length === 1 && cell.children[0].nodeName.toUpperCase() === 'ABBR') {
  15712. return true;
  15713. }
  15714. cells++;
  15715. }
  15716. }
  15717. if (node.getElementsByTagName('table').length) {
  15718. return false;
  15719. }
  15720. if (rowLength < 2) {
  15721. return false;
  15722. }
  15723. var sampleRow = node.rows[Math.ceil(rowLength / 2)];
  15724. if (sampleRow.cells.length === 1 && sampleRow.cells[0].colSpan === 1) {
  15725. return false;
  15726. }
  15727. if (sampleRow.cells.length >= 5) {
  15728. return true;
  15729. }
  15730. if (hasBorder) {
  15731. return true;
  15732. }
  15733. var bgColor, bgImage;
  15734. for (rowIndex = 0; rowIndex < rowLength; rowIndex++) {
  15735. row = node.rows[rowIndex];
  15736. if (bgColor && bgColor !== window.getComputedStyle(row).getPropertyValue('background-color')) {
  15737. return true;
  15738. } else {
  15739. bgColor = window.getComputedStyle(row).getPropertyValue('background-color');
  15740. }
  15741. if (bgImage && bgImage !== window.getComputedStyle(row).getPropertyValue('background-image')) {
  15742. return true;
  15743. } else {
  15744. bgImage = window.getComputedStyle(row).getPropertyValue('background-image');
  15745. }
  15746. }
  15747. if (rowLength >= 20) {
  15748. return true;
  15749. }
  15750. if (get_element_coordinates_default(node).width > get_viewport_size_default(window).width * .95) {
  15751. return false;
  15752. }
  15753. if (cells < 10) {
  15754. return false;
  15755. }
  15756. if (node.querySelector('object, embed, iframe, applet')) {
  15757. return false;
  15758. }
  15759. return true;
  15760. }
  15761. var is_data_table_default = isDataTable;
  15762. function isHeader(cell) {
  15763. if (is_column_header_default(cell) || is_row_header_default(cell)) {
  15764. return true;
  15765. }
  15766. if (cell.getAttribute('id')) {
  15767. var id = escape_selector_default(cell.getAttribute('id'));
  15768. return !!document.querySelector('[headers~="'.concat(id, '"]'));
  15769. }
  15770. return false;
  15771. }
  15772. var is_header_default = isHeader;
  15773. function traverseTable(dir, position, tableGrid, callback) {
  15774. var result;
  15775. var cell = tableGrid[position.y] ? tableGrid[position.y][position.x] : void 0;
  15776. if (!cell) {
  15777. return [];
  15778. }
  15779. if (typeof callback === 'function') {
  15780. result = callback(cell, position, tableGrid);
  15781. if (result === true) {
  15782. return [ cell ];
  15783. }
  15784. }
  15785. result = traverseTable(dir, {
  15786. x: position.x + dir.x,
  15787. y: position.y + dir.y
  15788. }, tableGrid, callback);
  15789. result.unshift(cell);
  15790. return result;
  15791. }
  15792. function traverse(dir, startPos, tableGrid, callback) {
  15793. if (Array.isArray(startPos)) {
  15794. callback = tableGrid;
  15795. tableGrid = startPos;
  15796. startPos = {
  15797. x: 0,
  15798. y: 0
  15799. };
  15800. }
  15801. if (typeof dir === 'string') {
  15802. switch (dir) {
  15803. case 'left':
  15804. dir = {
  15805. x: -1,
  15806. y: 0
  15807. };
  15808. break;
  15809. case 'up':
  15810. dir = {
  15811. x: 0,
  15812. y: -1
  15813. };
  15814. break;
  15815. case 'right':
  15816. dir = {
  15817. x: 1,
  15818. y: 0
  15819. };
  15820. break;
  15821. case 'down':
  15822. dir = {
  15823. x: 0,
  15824. y: 1
  15825. };
  15826. break;
  15827. }
  15828. }
  15829. return traverseTable(dir, {
  15830. x: startPos.x + dir.x,
  15831. y: startPos.y + dir.y
  15832. }, tableGrid, callback);
  15833. }
  15834. var traverse_default = traverse;
  15835. function captionFakedEvaluate(node) {
  15836. var table5 = to_grid_default(node);
  15837. var firstRow = table5[0];
  15838. if (table5.length <= 1 || firstRow.length <= 1 || node.rows.length <= 1) {
  15839. return true;
  15840. }
  15841. return firstRow.reduce(function(out, curr, i) {
  15842. return out || curr !== firstRow[i + 1] && firstRow[i + 1] !== void 0;
  15843. }, false);
  15844. }
  15845. var caption_faked_evaluate_default = captionFakedEvaluate;
  15846. function html5ScopeEvaluate(node) {
  15847. if (!is_html5_default(document)) {
  15848. return true;
  15849. }
  15850. return node.nodeName.toUpperCase() === 'TH';
  15851. }
  15852. var html5_scope_evaluate_default = html5ScopeEvaluate;
  15853. function sameCaptionSummaryEvaluate(node) {
  15854. return !!(node.summary && node.caption) && node.summary.toLowerCase() === accessible_text_default(node.caption).toLowerCase();
  15855. }
  15856. var same_caption_summary_evaluate_default = sameCaptionSummaryEvaluate;
  15857. function scopeValueEvaluate(node, options) {
  15858. var value = node.getAttribute('scope').toLowerCase();
  15859. return options.values.indexOf(value) !== -1;
  15860. }
  15861. var scope_value_evaluate_default = scopeValueEvaluate;
  15862. function tdHasHeaderEvaluate(node) {
  15863. var badCells = [];
  15864. var cells = get_all_cells_default(node);
  15865. var tableGrid = to_grid_default(node);
  15866. cells.forEach(function(cell) {
  15867. if (has_content_default(cell) && is_data_cell_default(cell) && !label_default2(cell)) {
  15868. var hasHeaders = get_headers_default(cell, tableGrid).some(function(header) {
  15869. return header !== null && !!has_content_default(header);
  15870. });
  15871. if (!hasHeaders) {
  15872. badCells.push(cell);
  15873. }
  15874. }
  15875. });
  15876. if (badCells.length) {
  15877. this.relatedNodes(badCells);
  15878. return false;
  15879. }
  15880. return true;
  15881. }
  15882. var td_has_header_evaluate_default = tdHasHeaderEvaluate;
  15883. function tdHeadersAttrEvaluate(node) {
  15884. var cells = [];
  15885. var reviewCells = [];
  15886. var badCells = [];
  15887. for (var rowIndex = 0; rowIndex < node.rows.length; rowIndex++) {
  15888. var row = node.rows[rowIndex];
  15889. for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
  15890. cells.push(row.cells[cellIndex]);
  15891. }
  15892. }
  15893. var ids = cells.reduce(function(ids2, cell) {
  15894. if (cell.getAttribute('id')) {
  15895. ids2.push(cell.getAttribute('id'));
  15896. }
  15897. return ids2;
  15898. }, []);
  15899. cells.forEach(function(cell) {
  15900. var isSelf = false;
  15901. var notOfTable = false;
  15902. if (!cell.hasAttribute('headers')) {
  15903. return;
  15904. }
  15905. var headersAttr = cell.getAttribute('headers').trim();
  15906. if (!headersAttr) {
  15907. return reviewCells.push(cell);
  15908. }
  15909. var headers = token_list_default(headersAttr);
  15910. if (headers.length !== 0) {
  15911. if (cell.getAttribute('id')) {
  15912. isSelf = headers.indexOf(cell.getAttribute('id').trim()) !== -1;
  15913. }
  15914. notOfTable = headers.some(function(header) {
  15915. return !ids.includes(header);
  15916. });
  15917. if (isSelf || notOfTable) {
  15918. badCells.push(cell);
  15919. }
  15920. }
  15921. });
  15922. if (badCells.length > 0) {
  15923. this.relatedNodes(badCells);
  15924. return false;
  15925. }
  15926. if (reviewCells.length) {
  15927. this.relatedNodes(reviewCells);
  15928. return void 0;
  15929. }
  15930. return true;
  15931. }
  15932. var td_headers_attr_evaluate_default = tdHeadersAttrEvaluate;
  15933. function thHasDataCellsEvaluate(node) {
  15934. var cells = get_all_cells_default(node);
  15935. var checkResult = this;
  15936. var reffedHeaders = [];
  15937. cells.forEach(function(cell) {
  15938. var headers2 = cell.getAttribute('headers');
  15939. if (headers2) {
  15940. reffedHeaders = reffedHeaders.concat(headers2.split(/\s+/));
  15941. }
  15942. var ariaLabel = cell.getAttribute('aria-labelledby');
  15943. if (ariaLabel) {
  15944. reffedHeaders = reffedHeaders.concat(ariaLabel.split(/\s+/));
  15945. }
  15946. });
  15947. var headers = cells.filter(function(cell) {
  15948. if (sanitize_default(cell.textContent) === '') {
  15949. return false;
  15950. }
  15951. return cell.nodeName.toUpperCase() === 'TH' || [ 'rowheader', 'columnheader' ].indexOf(cell.getAttribute('role')) !== -1;
  15952. });
  15953. var tableGrid = to_grid_default(node);
  15954. var out = true;
  15955. headers.forEach(function(header) {
  15956. if (header.getAttribute('id') && reffedHeaders.includes(header.getAttribute('id'))) {
  15957. return;
  15958. }
  15959. var pos = get_cell_position_default(header, tableGrid);
  15960. var hasCell = false;
  15961. if (is_column_header_default(header)) {
  15962. hasCell = traverse_default('down', pos, tableGrid).find(function(cell) {
  15963. return !is_column_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  15964. });
  15965. }
  15966. if (!hasCell && is_row_header_default(header)) {
  15967. hasCell = traverse_default('right', pos, tableGrid).find(function(cell) {
  15968. return !is_row_header_default(cell) && get_headers_default(cell, tableGrid).includes(header);
  15969. });
  15970. }
  15971. if (!hasCell) {
  15972. checkResult.relatedNodes(header);
  15973. }
  15974. out = out && hasCell;
  15975. });
  15976. return out ? true : void 0;
  15977. }
  15978. var th_has_data_cells_evaluate_default = thHasDataCellsEvaluate;
  15979. function hiddenContentEvaluate(node, options, virtualNode) {
  15980. var whitelist = [ 'SCRIPT', 'HEAD', 'TITLE', 'NOSCRIPT', 'STYLE', 'TEMPLATE' ];
  15981. if (!whitelist.includes(node.nodeName.toUpperCase()) && has_content_virtual_default(virtualNode)) {
  15982. var styles = window.getComputedStyle(node);
  15983. if (styles.getPropertyValue('display') === 'none') {
  15984. return void 0;
  15985. } else if (styles.getPropertyValue('visibility') === 'hidden') {
  15986. var parent = get_composed_parent_default(node);
  15987. var parentStyle = parent && window.getComputedStyle(parent);
  15988. if (!parentStyle || parentStyle.getPropertyValue('visibility') !== 'hidden') {
  15989. return void 0;
  15990. }
  15991. }
  15992. }
  15993. return true;
  15994. }
  15995. var hidden_content_evaluate_default = hiddenContentEvaluate;
  15996. var color_exports = {};
  15997. __export(color_exports, {
  15998. Color: function Color() {
  15999. return color_default;
  16000. },
  16001. centerPointOfRect: function centerPointOfRect() {
  16002. return center_point_of_rect_default;
  16003. },
  16004. elementHasImage: function elementHasImage() {
  16005. return element_has_image_default;
  16006. },
  16007. elementIsDistinct: function elementIsDistinct() {
  16008. return element_is_distinct_default;
  16009. },
  16010. filteredRectStack: function filteredRectStack() {
  16011. return filtered_rect_stack_default;
  16012. },
  16013. flattenColors: function flattenColors() {
  16014. return flatten_colors_default;
  16015. },
  16016. getBackgroundColor: function getBackgroundColor() {
  16017. return get_background_color_default;
  16018. },
  16019. getBackgroundStack: function getBackgroundStack() {
  16020. return get_background_stack_default;
  16021. },
  16022. getContrast: function getContrast() {
  16023. return get_contrast_default;
  16024. },
  16025. getForegroundColor: function getForegroundColor() {
  16026. return get_foreground_color_default;
  16027. },
  16028. getOwnBackgroundColor: function getOwnBackgroundColor() {
  16029. return get_own_background_color_default;
  16030. },
  16031. getRectStack: function getRectStack() {
  16032. return get_rect_stack_default;
  16033. },
  16034. getTextShadowColors: function getTextShadowColors() {
  16035. return get_text_shadow_colors_default;
  16036. },
  16037. hasValidContrastRatio: function hasValidContrastRatio() {
  16038. return has_valid_contrast_ratio_default;
  16039. },
  16040. incompleteData: function incompleteData() {
  16041. return incomplete_data_default;
  16042. }
  16043. });
  16044. function centerPointOfRect(rect) {
  16045. if (rect.left > window.innerWidth) {
  16046. return void 0;
  16047. }
  16048. if (rect.top > window.innerHeight) {
  16049. return void 0;
  16050. }
  16051. var x = Math.min(Math.ceil(rect.left + rect.width / 2), window.innerWidth - 1);
  16052. var y = Math.min(Math.ceil(rect.top + rect.height / 2), window.innerHeight - 1);
  16053. return {
  16054. x: x,
  16055. y: y
  16056. };
  16057. }
  16058. var center_point_of_rect_default = centerPointOfRect;
  16059. function _getFonts(style) {
  16060. return style.getPropertyValue('font-family').split(/[,;]/g).map(function(font) {
  16061. return font.trim().toLowerCase();
  16062. });
  16063. }
  16064. function elementIsDistinct(node, ancestorNode) {
  16065. var nodeStyle = window.getComputedStyle(node);
  16066. if (nodeStyle.getPropertyValue('background-image') !== 'none') {
  16067. return true;
  16068. }
  16069. var hasBorder = [ 'border-bottom', 'border-top', 'outline' ].reduce(function(result, edge) {
  16070. var borderClr = new color_default();
  16071. borderClr.parseString(nodeStyle.getPropertyValue(edge + '-color'));
  16072. return result || nodeStyle.getPropertyValue(edge + '-style') !== 'none' && parseFloat(nodeStyle.getPropertyValue(edge + '-width')) > 0 && borderClr.alpha !== 0;
  16073. }, false);
  16074. if (hasBorder) {
  16075. return true;
  16076. }
  16077. var parentStyle = window.getComputedStyle(ancestorNode);
  16078. if (_getFonts(nodeStyle)[0] !== _getFonts(parentStyle)[0]) {
  16079. return true;
  16080. }
  16081. var hasStyle = [ 'text-decoration-line', 'text-decoration-style', 'font-weight', 'font-style', 'font-size' ].reduce(function(result, cssProp) {
  16082. return result || nodeStyle.getPropertyValue(cssProp) !== parentStyle.getPropertyValue(cssProp);
  16083. }, false);
  16084. var tDec = nodeStyle.getPropertyValue('text-decoration');
  16085. if (tDec.split(' ').length < 3) {
  16086. hasStyle = hasStyle || tDec !== parentStyle.getPropertyValue('text-decoration');
  16087. }
  16088. return hasStyle;
  16089. }
  16090. var element_is_distinct_default = elementIsDistinct;
  16091. function getRectStack2(elm) {
  16092. var boundingStack = get_element_stack_default(elm);
  16093. var filteredArr = get_text_element_stack_default(elm);
  16094. if (!filteredArr || filteredArr.length <= 1) {
  16095. return [ boundingStack ];
  16096. }
  16097. if (filteredArr.some(function(stack) {
  16098. return stack === void 0;
  16099. })) {
  16100. return null;
  16101. }
  16102. filteredArr.splice(0, 0, boundingStack);
  16103. return filteredArr;
  16104. }
  16105. var get_rect_stack_default = getRectStack2;
  16106. function filteredRectStack(elm) {
  16107. var rectStack = get_rect_stack_default(elm);
  16108. if (rectStack && rectStack.length === 1) {
  16109. return rectStack[0];
  16110. }
  16111. if (rectStack && rectStack.length > 1) {
  16112. var boundingStack = rectStack.shift();
  16113. var isSame;
  16114. rectStack.forEach(function(rectList, index) {
  16115. if (index === 0) {
  16116. return;
  16117. }
  16118. var rectA = rectStack[index - 1], rectB = rectStack[index];
  16119. isSame = rectA.every(function(element, elementIndex) {
  16120. return element === rectB[elementIndex];
  16121. }) || boundingStack.includes(elm);
  16122. });
  16123. if (!isSame) {
  16124. incomplete_data_default.set('bgColor', 'elmPartiallyObscuring');
  16125. return null;
  16126. }
  16127. return rectStack[0];
  16128. }
  16129. incomplete_data_default.set('bgColor', 'outsideViewport');
  16130. return null;
  16131. }
  16132. var filtered_rect_stack_default = filteredRectStack;
  16133. function flattenColors(fgColor, bgColor) {
  16134. var alpha = fgColor.alpha;
  16135. var r = (1 - alpha) * bgColor.red + alpha * fgColor.red;
  16136. var g = (1 - alpha) * bgColor.green + alpha * fgColor.green;
  16137. var b = (1 - alpha) * bgColor.blue + alpha * fgColor.blue;
  16138. var a = fgColor.alpha + bgColor.alpha * (1 - fgColor.alpha);
  16139. return new color_default(r, g, b, a);
  16140. }
  16141. var flatten_colors_default = flattenColors;
  16142. function contentOverlapping(targetElement, bgNode) {
  16143. var targetRect = targetElement.getClientRects()[0];
  16144. var obscuringElements = shadow_elements_from_point_default(targetRect.left, targetRect.top);
  16145. if (obscuringElements) {
  16146. for (var i = 0; i < obscuringElements.length; i++) {
  16147. if (obscuringElements[i] !== targetElement && obscuringElements[i] === bgNode) {
  16148. return true;
  16149. }
  16150. }
  16151. }
  16152. return false;
  16153. }
  16154. function calculateObscuringElement(elmIndex, elmStack, originalElm) {
  16155. if (elmIndex > 0) {
  16156. for (var i = elmIndex - 1; i >= 0; i--) {
  16157. var bgElm = elmStack[i];
  16158. if (contentOverlapping(originalElm, bgElm)) {
  16159. return true;
  16160. } else {
  16161. elmStack.splice(i, 1);
  16162. }
  16163. }
  16164. }
  16165. return false;
  16166. }
  16167. function sortPageBackground(elmStack) {
  16168. var bodyIndex = elmStack.indexOf(document.body);
  16169. var bgNodes = elmStack;
  16170. var sortBodyElement = bodyIndex > 1 || bodyIndex === -1;
  16171. if (sortBodyElement && !element_has_image_default(document.documentElement) && get_own_background_color_default(window.getComputedStyle(document.documentElement)).alpha === 0) {
  16172. if (bodyIndex > 1) {
  16173. bgNodes.splice(bodyIndex, 1);
  16174. }
  16175. bgNodes.splice(elmStack.indexOf(document.documentElement), 1);
  16176. bgNodes.push(document.body);
  16177. }
  16178. return bgNodes;
  16179. }
  16180. function getBackgroundStack(elm) {
  16181. var elmStack = filtered_rect_stack_default(elm);
  16182. if (elmStack === null) {
  16183. return null;
  16184. }
  16185. elmStack = reduce_to_elements_below_floating_default(elmStack, elm);
  16186. elmStack = sortPageBackground(elmStack);
  16187. var elmIndex = elmStack.indexOf(elm);
  16188. if (calculateObscuringElement(elmIndex, elmStack, elm)) {
  16189. incomplete_data_default.set('bgColor', 'bgOverlap');
  16190. return null;
  16191. }
  16192. return elmIndex !== -1 ? elmStack : null;
  16193. }
  16194. var get_background_stack_default = getBackgroundStack;
  16195. function getTextShadowColors(node) {
  16196. var _ref50 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, minRatio = _ref50.minRatio, maxRatio = _ref50.maxRatio;
  16197. var style = window.getComputedStyle(node);
  16198. var textShadow = style.getPropertyValue('text-shadow');
  16199. if (textShadow === 'none') {
  16200. return [];
  16201. }
  16202. var fontSizeStr = style.getPropertyValue('font-size');
  16203. var fontSize = parseInt(fontSizeStr);
  16204. assert_default(isNaN(fontSize) === false, 'Unable to determine font-size value '.concat(fontSizeStr));
  16205. var shadowColors = [];
  16206. var shadows = parseTextShadows(textShadow);
  16207. shadows.forEach(function(_ref51) {
  16208. var colorStr = _ref51.colorStr, pixels = _ref51.pixels;
  16209. colorStr = colorStr || style.getPropertyValue('color');
  16210. var _pixels = _slicedToArray(pixels, 3), offsetY = _pixels[0], offsetX = _pixels[1], _pixels$ = _pixels[2], blurRadius = _pixels$ === void 0 ? 0 : _pixels$;
  16211. if ((!minRatio || blurRadius >= fontSize * minRatio) && (!maxRatio || blurRadius < fontSize * maxRatio)) {
  16212. var color10 = textShadowColor({
  16213. colorStr: colorStr,
  16214. offsetY: offsetY,
  16215. offsetX: offsetX,
  16216. blurRadius: blurRadius,
  16217. fontSize: fontSize
  16218. });
  16219. shadowColors.push(color10);
  16220. }
  16221. });
  16222. return shadowColors;
  16223. }
  16224. function parseTextShadows(textShadow) {
  16225. var current = {
  16226. pixels: []
  16227. };
  16228. var str = textShadow.trim();
  16229. var shadows = [ current ];
  16230. if (!str) {
  16231. return [];
  16232. }
  16233. while (str) {
  16234. var colorMatch = str.match(/^rgba?\([0-9,.\s]+\)/i) || str.match(/^[a-z]+/i) || str.match(/^#[0-9a-f]+/i);
  16235. var pixelMatch = str.match(/^([0-9.-]+)px/i) || str.match(/^(0)/);
  16236. if (colorMatch) {
  16237. assert_default(!current.colorStr, 'Multiple colors identified in text-shadow: '.concat(textShadow));
  16238. str = str.replace(colorMatch[0], '').trim();
  16239. current.colorStr = colorMatch[0];
  16240. } else if (pixelMatch) {
  16241. assert_default(current.pixels.length < 3, 'Too many pixel units in text-shadow: '.concat(textShadow));
  16242. str = str.replace(pixelMatch[0], '').trim();
  16243. var pixelUnit = parseFloat((pixelMatch[1][0] === '.' ? '0' : '') + pixelMatch[1]);
  16244. current.pixels.push(pixelUnit);
  16245. } else if (str[0] === ',') {
  16246. assert_default(current.pixels.length >= 2, 'Missing pixel value in text-shadow: '.concat(textShadow));
  16247. current = {
  16248. pixels: []
  16249. };
  16250. shadows.push(current);
  16251. str = str.substr(1).trim();
  16252. } else {
  16253. throw new Error('Unable to process text-shadows: '.concat(textShadow));
  16254. }
  16255. }
  16256. return shadows;
  16257. }
  16258. function textShadowColor(_ref52) {
  16259. var colorStr = _ref52.colorStr, offsetX = _ref52.offsetX, offsetY = _ref52.offsetY, blurRadius = _ref52.blurRadius, fontSize = _ref52.fontSize;
  16260. if (offsetX > blurRadius || offsetY > blurRadius) {
  16261. return new color_default(0, 0, 0, 0);
  16262. }
  16263. var shadowColor = new color_default();
  16264. shadowColor.parseString(colorStr);
  16265. shadowColor.alpha *= blurRadiusToAlpha(blurRadius, fontSize);
  16266. return shadowColor;
  16267. }
  16268. function blurRadiusToAlpha(blurRadius, fontSize) {
  16269. var relativeBlur = blurRadius / fontSize;
  16270. return .185 / (relativeBlur + .4);
  16271. }
  16272. var get_text_shadow_colors_default = getTextShadowColors;
  16273. function elmPartiallyObscured(elm, bgElm, bgColor) {
  16274. var obscured = elm !== bgElm && !visually_contains_default(elm, bgElm) && bgColor.alpha !== 0;
  16275. if (obscured) {
  16276. incomplete_data_default.set('bgColor', 'elmPartiallyObscured');
  16277. }
  16278. return obscured;
  16279. }
  16280. function getBackgroundColor(elm) {
  16281. var bgElms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  16282. var shadowOutlineEmMax = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .1;
  16283. var bgColors = get_text_shadow_colors_default(elm, {
  16284. minRatio: shadowOutlineEmMax
  16285. });
  16286. var elmStack = get_background_stack_default(elm);
  16287. (elmStack || []).some(function(bgElm) {
  16288. var bgElmStyle = window.getComputedStyle(bgElm);
  16289. var bgColor = get_own_background_color_default(bgElmStyle);
  16290. if (elmPartiallyObscured(elm, bgElm, bgColor) || element_has_image_default(bgElm, bgElmStyle)) {
  16291. bgColors = null;
  16292. bgElms.push(bgElm);
  16293. return true;
  16294. }
  16295. if (bgColor.alpha !== 0) {
  16296. bgElms.push(bgElm);
  16297. bgColors.push(bgColor);
  16298. return bgColor.alpha === 1;
  16299. } else {
  16300. return false;
  16301. }
  16302. });
  16303. if (bgColors === null || elmStack === null) {
  16304. return null;
  16305. }
  16306. bgColors.push(new color_default(255, 255, 255, 1));
  16307. var colors = bgColors.reduce(flatten_colors_default);
  16308. return colors;
  16309. }
  16310. var get_background_color_default = getBackgroundColor;
  16311. function getContrast(bgColor, fgColor) {
  16312. if (!fgColor || !bgColor) {
  16313. return null;
  16314. }
  16315. if (fgColor.alpha < 1) {
  16316. fgColor = flatten_colors_default(fgColor, bgColor);
  16317. }
  16318. var bL = bgColor.getRelativeLuminance();
  16319. var fL = fgColor.getRelativeLuminance();
  16320. return (Math.max(fL, bL) + .05) / (Math.min(fL, bL) + .05);
  16321. }
  16322. var get_contrast_default = getContrast;
  16323. function getOpacity(node) {
  16324. if (!node) {
  16325. return 1;
  16326. }
  16327. var vNode = get_node_from_tree_default(node);
  16328. if (vNode && vNode._opacity !== void 0 && vNode._opacity !== null) {
  16329. return vNode._opacity;
  16330. }
  16331. var nodeStyle = window.getComputedStyle(node);
  16332. var opacity = nodeStyle.getPropertyValue('opacity');
  16333. var finalOpacity = opacity * getOpacity(node.parentElement);
  16334. if (vNode) {
  16335. vNode._opacity = finalOpacity;
  16336. }
  16337. return finalOpacity;
  16338. }
  16339. function getForegroundColor(node, _, bgColor) {
  16340. var nodeStyle = window.getComputedStyle(node);
  16341. var fgColor = new color_default();
  16342. fgColor.parseString(nodeStyle.getPropertyValue('color'));
  16343. var opacity = getOpacity(node);
  16344. fgColor.alpha = fgColor.alpha * opacity;
  16345. if (fgColor.alpha === 1) {
  16346. return fgColor;
  16347. }
  16348. if (!bgColor) {
  16349. bgColor = get_background_color_default(node, []);
  16350. }
  16351. if (bgColor === null) {
  16352. var reason = incomplete_data_default.get('bgColor');
  16353. incomplete_data_default.set('fgColor', reason);
  16354. return null;
  16355. }
  16356. return flatten_colors_default(fgColor, bgColor);
  16357. }
  16358. var get_foreground_color_default = getForegroundColor;
  16359. function hasValidContrastRatio(bg, fg, fontSize, isBold) {
  16360. var contrast = get_contrast_default(bg, fg);
  16361. var isSmallFont = isBold && Math.ceil(fontSize * 72) / 96 < 14 || !isBold && Math.ceil(fontSize * 72) / 96 < 18;
  16362. var expectedContrastRatio = isSmallFont ? 4.5 : 3;
  16363. return {
  16364. isValid: contrast > expectedContrastRatio,
  16365. contrastRatio: contrast,
  16366. expectedContrastRatio: expectedContrastRatio
  16367. };
  16368. }
  16369. var has_valid_contrast_ratio_default = hasValidContrastRatio;
  16370. var hasPsuedoElement = memoize_default(function hasPsuedoElement2(node, pseudo) {
  16371. var style = window.getComputedStyle(node, pseudo);
  16372. var backgroundColor = get_own_background_color_default(style);
  16373. return style.getPropertyValue('content') !== 'none' && style.getPropertyValue('position') === 'absolute' && parseInt(style.getPropertyValue('width')) !== 0 && parseInt(style.getPropertyValue('height')) !== 0 && (backgroundColor.alpha !== 0 || style.getPropertyValue('background-image') !== 'none');
  16374. });
  16375. function colorContrastEvaluate(node, options, virtualNode) {
  16376. if (!is_visible_default(node, false)) {
  16377. return true;
  16378. }
  16379. var ignoreUnicode = options.ignoreUnicode, ignoreLength = options.ignoreLength, boldValue = options.boldValue, boldTextPt = options.boldTextPt, largeTextPt = options.largeTextPt, contrastRatio = options.contrastRatio, shadowOutlineEmMax = options.shadowOutlineEmMax;
  16380. var visibleText = visible_virtual_default(virtualNode, false, true);
  16381. var textContainsOnlyUnicode = has_unicode_default(visibleText, {
  16382. nonBmp: true
  16383. }) && sanitize_default(remove_unicode_default(visibleText, {
  16384. nonBmp: true
  16385. })) === '';
  16386. if (textContainsOnlyUnicode && ignoreUnicode) {
  16387. this.data({
  16388. messageKey: 'nonBmp'
  16389. });
  16390. return void 0;
  16391. }
  16392. var bgNodes = [];
  16393. var bgColor = get_background_color_default(node, bgNodes, shadowOutlineEmMax);
  16394. var fgColor = get_foreground_color_default(node, false, bgColor);
  16395. var shadowColors = get_text_shadow_colors_default(node, {
  16396. maxRatio: shadowOutlineEmMax
  16397. });
  16398. var nodeStyle = window.getComputedStyle(node);
  16399. var fontSize = parseFloat(nodeStyle.getPropertyValue('font-size'));
  16400. var fontWeight = nodeStyle.getPropertyValue('font-weight');
  16401. var bold = parseFloat(fontWeight) >= boldValue || fontWeight === 'bold';
  16402. var contrast = null;
  16403. if (shadowColors.length === 0) {
  16404. contrast = get_contrast_default(bgColor, fgColor);
  16405. } else if (fgColor && bgColor) {
  16406. var shadowColor = [].concat(_toConsumableArray(shadowColors), [ bgColor ]).reduce(flatten_colors_default);
  16407. var bgContrast = get_contrast_default(bgColor, shadowColor);
  16408. var fgContrast = get_contrast_default(shadowColor, fgColor);
  16409. contrast = Math.max(bgContrast, fgContrast);
  16410. }
  16411. var ptSize = Math.ceil(fontSize * 72) / 96;
  16412. var isSmallFont = bold && ptSize < boldTextPt || !bold && ptSize < largeTextPt;
  16413. var _ref53 = isSmallFont ? contrastRatio.normal : contrastRatio.large, expected = _ref53.expected, minThreshold = _ref53.minThreshold, maxThreshold = _ref53.maxThreshold;
  16414. var isValid = contrast > expected;
  16415. var parentNode = node.parentElement;
  16416. while (parentNode) {
  16417. if (hasPsuedoElement(parentNode, ':before') || hasPsuedoElement(parentNode, ':after')) {
  16418. this.data({
  16419. messageKey: 'pseudoContent'
  16420. });
  16421. this.relatedNodes(parentNode);
  16422. return void 0;
  16423. }
  16424. parentNode = parentNode.parentElement;
  16425. }
  16426. if (typeof minThreshold === 'number' && contrast < minThreshold || typeof maxThreshold === 'number' && contrast > maxThreshold) {
  16427. return true;
  16428. }
  16429. var truncatedResult = Math.floor(contrast * 100) / 100;
  16430. var missing;
  16431. if (bgColor === null) {
  16432. missing = incomplete_data_default.get('bgColor');
  16433. }
  16434. var equalRatio = truncatedResult === 1;
  16435. var shortTextContent = visibleText.length === 1;
  16436. if (equalRatio) {
  16437. missing = incomplete_data_default.set('bgColor', 'equalRatio');
  16438. } else if (shortTextContent && !ignoreLength) {
  16439. missing = 'shortTextContent';
  16440. }
  16441. var data2 = {
  16442. fgColor: fgColor ? fgColor.toHexString() : void 0,
  16443. bgColor: bgColor ? bgColor.toHexString() : void 0,
  16444. contrastRatio: truncatedResult,
  16445. fontSize: ''.concat((fontSize * 72 / 96).toFixed(1), 'pt (').concat(fontSize, 'px)'),
  16446. fontWeight: bold ? 'bold' : 'normal',
  16447. messageKey: missing,
  16448. expectedContrastRatio: expected + ':1'
  16449. };
  16450. this.data(data2);
  16451. if (fgColor === null || bgColor === null || equalRatio || shortTextContent && !ignoreLength && !isValid) {
  16452. missing = null;
  16453. incomplete_data_default.clear();
  16454. this.relatedNodes(bgNodes);
  16455. return void 0;
  16456. }
  16457. if (!isValid) {
  16458. this.relatedNodes(bgNodes);
  16459. }
  16460. return isValid;
  16461. }
  16462. var color_contrast_evaluate_default = colorContrastEvaluate;
  16463. function getContrast2(color1, color22) {
  16464. var c1lum = color1.getRelativeLuminance();
  16465. var c2lum = color22.getRelativeLuminance();
  16466. return (Math.max(c1lum, c2lum) + .05) / (Math.min(c1lum, c2lum) + .05);
  16467. }
  16468. var blockLike2 = [ 'block', 'list-item', 'table', 'flex', 'grid', 'inline-block' ];
  16469. function isBlock2(elm) {
  16470. var display = window.getComputedStyle(elm).getPropertyValue('display');
  16471. return blockLike2.indexOf(display) !== -1 || display.substr(0, 6) === 'table-';
  16472. }
  16473. function linkInTextBlockEvaluate(node) {
  16474. if (isBlock2(node)) {
  16475. return false;
  16476. }
  16477. var parentBlock = get_composed_parent_default(node);
  16478. while (parentBlock.nodeType === 1 && !isBlock2(parentBlock)) {
  16479. parentBlock = get_composed_parent_default(parentBlock);
  16480. }
  16481. this.relatedNodes([ parentBlock ]);
  16482. if (element_is_distinct_default(node, parentBlock)) {
  16483. return true;
  16484. } else {
  16485. var nodeColor, parentColor;
  16486. nodeColor = get_foreground_color_default(node);
  16487. parentColor = get_foreground_color_default(parentBlock);
  16488. if (!nodeColor || !parentColor) {
  16489. return void 0;
  16490. }
  16491. var contrast = getContrast2(nodeColor, parentColor);
  16492. if (contrast === 1) {
  16493. return true;
  16494. } else if (contrast >= 3) {
  16495. incomplete_data_default.set('fgColor', 'bgContrast');
  16496. this.data({
  16497. messageKey: incomplete_data_default.get('fgColor')
  16498. });
  16499. incomplete_data_default.clear();
  16500. return void 0;
  16501. }
  16502. nodeColor = get_background_color_default(node);
  16503. parentColor = get_background_color_default(parentBlock);
  16504. if (!nodeColor || !parentColor || getContrast2(nodeColor, parentColor) >= 3) {
  16505. var reason;
  16506. if (!nodeColor || !parentColor) {
  16507. reason = incomplete_data_default.get('bgColor');
  16508. } else {
  16509. reason = 'bgContrast';
  16510. }
  16511. incomplete_data_default.set('fgColor', reason);
  16512. this.data({
  16513. messageKey: incomplete_data_default.get('fgColor')
  16514. });
  16515. incomplete_data_default.clear();
  16516. return void 0;
  16517. }
  16518. }
  16519. return false;
  16520. }
  16521. var link_in_text_block_evaluate_default = linkInTextBlockEvaluate;
  16522. function autocompleteAppropriateEvaluate(node, options, virtualNode) {
  16523. if (virtualNode.props.nodeName !== 'input') {
  16524. return true;
  16525. }
  16526. var number = [ 'text', 'search', 'number', 'tel' ];
  16527. var url = [ 'text', 'search', 'url' ];
  16528. var allowedTypesMap = {
  16529. bday: [ 'text', 'search', 'date' ],
  16530. email: [ 'text', 'search', 'email' ],
  16531. 'street-address': [ 'text' ],
  16532. tel: [ 'text', 'search', 'tel' ],
  16533. 'tel-country-code': [ 'text', 'search', 'tel' ],
  16534. 'tel-national': [ 'text', 'search', 'tel' ],
  16535. 'tel-area-code': [ 'text', 'search', 'tel' ],
  16536. 'tel-local': [ 'text', 'search', 'tel' ],
  16537. 'tel-local-prefix': [ 'text', 'search', 'tel' ],
  16538. 'tel-local-suffix': [ 'text', 'search', 'tel' ],
  16539. 'tel-extension': [ 'text', 'search', 'tel' ],
  16540. 'cc-number': number,
  16541. 'cc-exp': [ 'text', 'search', 'month', 'tel' ],
  16542. 'cc-exp-month': number,
  16543. 'cc-exp-year': number,
  16544. 'cc-csc': number,
  16545. 'transaction-amount': number,
  16546. 'bday-day': number,
  16547. 'bday-month': number,
  16548. 'bday-year': number,
  16549. 'new-password': [ 'text', 'search', 'password' ],
  16550. 'current-password': [ 'text', 'search', 'password' ],
  16551. url: url,
  16552. photo: url,
  16553. impp: url
  16554. };
  16555. if (_typeof(options) === 'object') {
  16556. Object.keys(options).forEach(function(key) {
  16557. if (!allowedTypesMap[key]) {
  16558. allowedTypesMap[key] = [];
  16559. }
  16560. allowedTypesMap[key] = allowedTypesMap[key].concat(options[key]);
  16561. });
  16562. }
  16563. var autocompleteAttr = virtualNode.attr('autocomplete');
  16564. var autocompleteTerms = autocompleteAttr.split(/\s+/g).map(function(term) {
  16565. return term.toLowerCase();
  16566. });
  16567. var purposeTerm = autocompleteTerms[autocompleteTerms.length - 1];
  16568. if (_autocomplete.stateTerms.includes(purposeTerm)) {
  16569. return true;
  16570. }
  16571. var allowedTypes = allowedTypesMap[purposeTerm];
  16572. var type = virtualNode.hasAttr('type') ? sanitize_default(virtualNode.attr('type')).toLowerCase() : 'text';
  16573. type = valid_input_type_default().includes(type) ? type : 'text';
  16574. if (typeof allowedTypes === 'undefined') {
  16575. return type === 'text';
  16576. }
  16577. return allowedTypes.includes(type);
  16578. }
  16579. var autocomplete_appropriate_evaluate_default = autocompleteAppropriateEvaluate;
  16580. function autocompleteValidEvaluate(node, options, virtualNode) {
  16581. var autocomplete2 = virtualNode.attr('autocomplete') || '';
  16582. return is_valid_autocomplete_default(autocomplete2, options);
  16583. }
  16584. var autocomplete_valid_evaluate_default = autocompleteValidEvaluate;
  16585. function attrNonSpaceContentEvaluate(node) {
  16586. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  16587. var vNode = arguments.length > 2 ? arguments[2] : undefined;
  16588. if (!options.attribute || typeof options.attribute !== 'string') {
  16589. throw new TypeError('attr-non-space-content requires options.attribute to be a string');
  16590. }
  16591. if (!vNode.hasAttr(options.attribute)) {
  16592. this.data({
  16593. messageKey: 'noAttr'
  16594. });
  16595. return false;
  16596. }
  16597. var attribute = vNode.attr(options.attribute);
  16598. var attributeIsEmpty = !sanitize_default(attribute);
  16599. if (attributeIsEmpty) {
  16600. this.data({
  16601. messageKey: 'emptyAttr'
  16602. });
  16603. return false;
  16604. }
  16605. return true;
  16606. }
  16607. var attr_non_space_content_evaluate_default = attrNonSpaceContentEvaluate;
  16608. function pageHasElmAfter(results) {
  16609. var elmUsedAnywhere = results.some(function(frameResult) {
  16610. return frameResult.result === true;
  16611. });
  16612. if (elmUsedAnywhere) {
  16613. results.forEach(function(result) {
  16614. result.result = true;
  16615. });
  16616. }
  16617. return results;
  16618. }
  16619. var has_descendant_after_default = pageHasElmAfter;
  16620. function hasDescendant(node, options, virtualNode) {
  16621. if (!options || !options.selector || typeof options.selector !== 'string') {
  16622. throw new TypeError('has-descendant requires options.selector to be a string');
  16623. }
  16624. var matchingElms = query_selector_all_filter_default(virtualNode, options.selector, function(vNode) {
  16625. return is_visible_default(vNode.actualNode, true);
  16626. });
  16627. this.relatedNodes(matchingElms.map(function(vNode) {
  16628. return vNode.actualNode;
  16629. }));
  16630. return matchingElms.length > 0;
  16631. }
  16632. var has_descendant_evaluate_default = hasDescendant;
  16633. function hasTextContentEvaluate(node, options, virtualNode) {
  16634. try {
  16635. return sanitize_default(subtree_text_default(virtualNode)) !== '';
  16636. } catch (e) {
  16637. return void 0;
  16638. }
  16639. }
  16640. var has_text_content_evaluate_default = hasTextContentEvaluate;
  16641. function matchesDefinitionEvaluate(_, options, virtualNode) {
  16642. return matches_default3(virtualNode, options.matcher);
  16643. }
  16644. var matches_definition_evaluate_default = matchesDefinitionEvaluate;
  16645. function pageNoDuplicateAfter(results) {
  16646. return results.filter(function(checkResult) {
  16647. return checkResult.data !== 'ignored';
  16648. });
  16649. }
  16650. var page_no_duplicate_after_default = pageNoDuplicateAfter;
  16651. function pageNoDuplicateEvaluate(node, options, virtualNode) {
  16652. if (!options || !options.selector || typeof options.selector !== 'string') {
  16653. throw new TypeError('page-no-duplicate requires options.selector to be a string');
  16654. }
  16655. var key = 'page-no-duplicate;' + options.selector;
  16656. if (cache_default.get(key)) {
  16657. this.data('ignored');
  16658. return;
  16659. }
  16660. cache_default.set(key, true);
  16661. var elms = query_selector_all_filter_default(axe._tree[0], options.selector, function(elm) {
  16662. return is_visible_default(elm.actualNode);
  16663. });
  16664. if (typeof options.nativeScopeFilter === 'string') {
  16665. elms = elms.filter(function(elm) {
  16666. return elm.actualNode.hasAttribute('role') || !find_up_virtual_default(elm, options.nativeScopeFilter);
  16667. });
  16668. }
  16669. this.relatedNodes(elms.filter(function(elm) {
  16670. return elm !== virtualNode;
  16671. }).map(function(elm) {
  16672. return elm.actualNode;
  16673. }));
  16674. return elms.length <= 1;
  16675. }
  16676. var page_no_duplicate_evaluate_default = pageNoDuplicateEvaluate;
  16677. function headingOrderAfter(results) {
  16678. if (results.length < 2) {
  16679. return results;
  16680. }
  16681. var prevLevel = results[0].data;
  16682. for (var i = 1; i < results.length; i++) {
  16683. if (results[i].result && results[i].data > prevLevel + 1) {
  16684. results[i].result = false;
  16685. }
  16686. prevLevel = results[i].data;
  16687. }
  16688. return results;
  16689. }
  16690. var heading_order_after_default = headingOrderAfter;
  16691. function headingOrderEvaluate(node, options, virtualNode) {
  16692. var ariaHeadingLevel = virtualNode.attr('aria-level');
  16693. var nodeName2 = virtualNode.props.nodeName;
  16694. if (ariaHeadingLevel !== null) {
  16695. this.data(parseInt(ariaHeadingLevel, 10));
  16696. return true;
  16697. }
  16698. var headingLevel = nodeName2.toUpperCase().match(/H(\d)/);
  16699. if (headingLevel) {
  16700. this.data(parseInt(headingLevel[1], 10));
  16701. return true;
  16702. }
  16703. return true;
  16704. }
  16705. var heading_order_evaluate_default = headingOrderEvaluate;
  16706. function isIdenticalObject(a, b) {
  16707. if (!a || !b) {
  16708. return false;
  16709. }
  16710. var aProps = Object.getOwnPropertyNames(a);
  16711. var bProps = Object.getOwnPropertyNames(b);
  16712. if (aProps.length !== bProps.length) {
  16713. return false;
  16714. }
  16715. var result = aProps.every(function(propName) {
  16716. var aValue = a[propName];
  16717. var bValue = b[propName];
  16718. if (_typeof(aValue) !== _typeof(bValue)) {
  16719. return false;
  16720. }
  16721. if (typeof aValue === 'object' || typeof bValue === 'object') {
  16722. return isIdenticalObject(aValue, bValue);
  16723. }
  16724. return aValue === bValue;
  16725. });
  16726. return result;
  16727. }
  16728. function identicalLinksSamePurposeAfter(results) {
  16729. if (results.length < 2) {
  16730. return results;
  16731. }
  16732. var incompleteResults = results.filter(function(_ref54) {
  16733. var result = _ref54.result;
  16734. return result !== void 0;
  16735. });
  16736. var uniqueResults = [];
  16737. var nameMap = {};
  16738. var _loop4 = function _loop4(index) {
  16739. var _currentResult$relate;
  16740. var currentResult = incompleteResults[index];
  16741. var _currentResult$data = currentResult.data, name = _currentResult$data.name, urlProps = _currentResult$data.urlProps;
  16742. if (nameMap[name]) {
  16743. return 'continue';
  16744. }
  16745. var sameNameResults = incompleteResults.filter(function(_ref55, resultNum) {
  16746. var data2 = _ref55.data;
  16747. return data2.name === name && resultNum !== index;
  16748. });
  16749. var isSameUrl = sameNameResults.every(function(_ref56) {
  16750. var data2 = _ref56.data;
  16751. return isIdenticalObject(data2.urlProps, urlProps);
  16752. });
  16753. if (sameNameResults.length && !isSameUrl) {
  16754. currentResult.result = void 0;
  16755. }
  16756. currentResult.relatedNodes = [];
  16757. (_currentResult$relate = currentResult.relatedNodes).push.apply(_currentResult$relate, _toConsumableArray(sameNameResults.map(function(node) {
  16758. return node.relatedNodes[0];
  16759. })));
  16760. nameMap[name] = sameNameResults;
  16761. uniqueResults.push(currentResult);
  16762. };
  16763. for (var index = 0; index < incompleteResults.length; index++) {
  16764. var _ret2 = _loop4(index);
  16765. if (_ret2 === 'continue') {
  16766. continue;
  16767. }
  16768. }
  16769. return uniqueResults;
  16770. }
  16771. var identical_links_same_purpose_after_default = identicalLinksSamePurposeAfter;
  16772. var commons_exports = {};
  16773. __export(commons_exports, {
  16774. aria: function aria() {
  16775. return aria_exports;
  16776. },
  16777. color: function color() {
  16778. return color_exports;
  16779. },
  16780. dom: function dom() {
  16781. return dom_exports;
  16782. },
  16783. forms: function forms() {
  16784. return forms_exports;
  16785. },
  16786. matches: function matches() {
  16787. return matches_default3;
  16788. },
  16789. standards: function standards() {
  16790. return standards_exports;
  16791. },
  16792. table: function table() {
  16793. return table_exports;
  16794. },
  16795. text: function text() {
  16796. return text_exports;
  16797. },
  16798. utils: function utils() {
  16799. return utils_exports;
  16800. }
  16801. });
  16802. var forms_exports = {};
  16803. __export(forms_exports, {
  16804. isAriaCombobox: function isAriaCombobox() {
  16805. return is_aria_combobox_default;
  16806. },
  16807. isAriaListbox: function isAriaListbox() {
  16808. return is_aria_listbox_default;
  16809. },
  16810. isAriaRange: function isAriaRange() {
  16811. return is_aria_range_default;
  16812. },
  16813. isAriaTextbox: function isAriaTextbox() {
  16814. return is_aria_textbox_default;
  16815. },
  16816. isDisabled: function isDisabled() {
  16817. return is_disabled_default;
  16818. },
  16819. isNativeSelect: function isNativeSelect() {
  16820. return is_native_select_default;
  16821. },
  16822. isNativeTextbox: function isNativeTextbox() {
  16823. return is_native_textbox_default;
  16824. }
  16825. });
  16826. var disabledNodeNames = [ 'fieldset', 'button', 'select', 'input', 'textarea' ];
  16827. function isDisabled(virtualNode) {
  16828. var disabledState = virtualNode._isDisabled;
  16829. if (typeof disabledState === 'boolean') {
  16830. return disabledState;
  16831. }
  16832. var nodeName2 = virtualNode.props.nodeName;
  16833. var ariaDisabled = virtualNode.attr('aria-disabled');
  16834. if (disabledNodeNames.includes(nodeName2) && virtualNode.hasAttr('disabled')) {
  16835. disabledState = true;
  16836. } else if (ariaDisabled) {
  16837. disabledState = ariaDisabled.toLowerCase() === 'true';
  16838. } else if (virtualNode.parent) {
  16839. disabledState = isDisabled(virtualNode.parent);
  16840. } else {
  16841. disabledState = false;
  16842. }
  16843. virtualNode._isDisabled = disabledState;
  16844. return disabledState;
  16845. }
  16846. var is_disabled_default = isDisabled;
  16847. var commons = {
  16848. aria: aria_exports,
  16849. color: color_exports,
  16850. dom: dom_exports,
  16851. forms: forms_exports,
  16852. matches: matches_default3,
  16853. standards: standards_exports,
  16854. table: table_exports,
  16855. text: text_exports,
  16856. utils: utils_exports
  16857. };
  16858. function identicalLinksSamePurposeEvaluate(node, options, virtualNode) {
  16859. var accText = text_exports.accessibleTextVirtual(virtualNode);
  16860. var name = text_exports.sanitize(text_exports.removeUnicode(accText, {
  16861. emoji: true,
  16862. nonBmp: true,
  16863. punctuations: true
  16864. })).toLowerCase();
  16865. if (!name) {
  16866. return void 0;
  16867. }
  16868. var afterData = {
  16869. name: name,
  16870. urlProps: dom_exports.urlPropsFromAttribute(node, 'href')
  16871. };
  16872. this.data(afterData);
  16873. this.relatedNodes([ node ]);
  16874. return true;
  16875. }
  16876. var identical_links_same_purpose_evaluate_default = identicalLinksSamePurposeEvaluate;
  16877. function internalLinkPresentEvaluate(node, options, virtualNode) {
  16878. var links = query_selector_all_default(virtualNode, 'a[href]');
  16879. return links.some(function(vLink) {
  16880. return /^#[^/!]/.test(vLink.actualNode.getAttribute('href'));
  16881. });
  16882. }
  16883. var internal_link_present_evaluate_default = internalLinkPresentEvaluate;
  16884. function metaRefreshEvaluate(node, options, virtualNode) {
  16885. var content = virtualNode.attr('content') || '', parsedParams = content.split(/[;,]/);
  16886. return content === '' || parsedParams[0] === '0';
  16887. }
  16888. var meta_refresh_evaluate_default = metaRefreshEvaluate;
  16889. function normalizeFontWeight(weight) {
  16890. switch (weight) {
  16891. case 'lighter':
  16892. return 100;
  16893. case 'normal':
  16894. return 400;
  16895. case 'bold':
  16896. return 700;
  16897. case 'bolder':
  16898. return 900;
  16899. }
  16900. weight = parseInt(weight);
  16901. return !isNaN(weight) ? weight : 400;
  16902. }
  16903. function getTextContainer(elm) {
  16904. var nextNode = elm;
  16905. var outerText = elm.textContent.trim();
  16906. var innerText = outerText;
  16907. while (innerText === outerText && nextNode !== void 0) {
  16908. var _i18 = -1;
  16909. elm = nextNode;
  16910. if (elm.children.length === 0) {
  16911. return elm;
  16912. }
  16913. do {
  16914. _i18++;
  16915. innerText = elm.children[_i18].textContent.trim();
  16916. } while (innerText === '' && _i18 + 1 < elm.children.length);
  16917. nextNode = elm.children[_i18];
  16918. }
  16919. return elm;
  16920. }
  16921. function getStyleValues(node) {
  16922. var style = window.getComputedStyle(getTextContainer(node));
  16923. return {
  16924. fontWeight: normalizeFontWeight(style.getPropertyValue('font-weight')),
  16925. fontSize: parseInt(style.getPropertyValue('font-size')),
  16926. isItalic: style.getPropertyValue('font-style') === 'italic'
  16927. };
  16928. }
  16929. function isHeaderStyle(styleA, styleB, margins) {
  16930. return margins.reduce(function(out, margin) {
  16931. return out || (!margin.size || styleA.fontSize / margin.size > styleB.fontSize) && (!margin.weight || styleA.fontWeight - margin.weight > styleB.fontWeight) && (!margin.italic || styleA.isItalic && !styleB.isItalic);
  16932. }, false);
  16933. }
  16934. function pAsHeadingEvaluate(node, options, virtualNode) {
  16935. var siblings = Array.from(node.parentNode.children);
  16936. var currentIndex = siblings.indexOf(node);
  16937. options = options || {};
  16938. var margins = options.margins || [];
  16939. var nextSibling = siblings.slice(currentIndex + 1).find(function(elm) {
  16940. return elm.nodeName.toUpperCase() === 'P';
  16941. });
  16942. var prevSibling = siblings.slice(0, currentIndex).reverse().find(function(elm) {
  16943. return elm.nodeName.toUpperCase() === 'P';
  16944. });
  16945. var currStyle = getStyleValues(node);
  16946. var nextStyle = nextSibling ? getStyleValues(nextSibling) : null;
  16947. var prevStyle = prevSibling ? getStyleValues(prevSibling) : null;
  16948. if (!nextStyle || !isHeaderStyle(currStyle, nextStyle, margins)) {
  16949. return true;
  16950. }
  16951. var blockquote = find_up_virtual_default(virtualNode, 'blockquote');
  16952. if (blockquote && blockquote.nodeName.toUpperCase() === 'BLOCKQUOTE') {
  16953. return void 0;
  16954. }
  16955. if (prevStyle && !isHeaderStyle(currStyle, prevStyle, margins)) {
  16956. return void 0;
  16957. }
  16958. return false;
  16959. }
  16960. var p_as_heading_evaluate_default = pAsHeadingEvaluate;
  16961. var landmarkRoles = get_aria_roles_by_type_default('landmark');
  16962. var implicitAriaLiveRoles = [ 'alert', 'log', 'status' ];
  16963. function isRegion(virtualNode, options) {
  16964. var node = virtualNode.actualNode;
  16965. var role = get_role_default(virtualNode);
  16966. var ariaLive = (node.getAttribute('aria-live') || '').toLowerCase().trim();
  16967. if ([ 'assertive', 'polite' ].includes(ariaLive) || implicitAriaLiveRoles.includes(role)) {
  16968. return true;
  16969. }
  16970. if (landmarkRoles.includes(role)) {
  16971. return true;
  16972. }
  16973. if (options.regionMatcher && matches_default3(virtualNode, options.regionMatcher)) {
  16974. return true;
  16975. }
  16976. return false;
  16977. }
  16978. function findRegionlessElms(virtualNode, options) {
  16979. var node = virtualNode.actualNode;
  16980. if (isRegion(virtualNode, options) || is_skip_link_default(virtualNode.actualNode) && get_element_by_reference_default(virtualNode.actualNode, 'href') || !is_visible_default(node, true)) {
  16981. var vNode = virtualNode;
  16982. while (vNode) {
  16983. vNode._hasRegionDescendant = true;
  16984. vNode = vNode.parent;
  16985. }
  16986. return [];
  16987. } else if (node !== document.body && has_content_default(node, true)) {
  16988. return [ virtualNode ];
  16989. } else {
  16990. return virtualNode.children.filter(function(_ref57) {
  16991. var actualNode = _ref57.actualNode;
  16992. return actualNode.nodeType === 1;
  16993. }).map(function(vNode) {
  16994. return findRegionlessElms(vNode, options);
  16995. }).reduce(function(a, b) {
  16996. return a.concat(b);
  16997. }, []);
  16998. }
  16999. }
  17000. function regionEvaluate(node, options, virtualNode) {
  17001. var regionlessNodes = cache_default.get('regionlessNodes');
  17002. if (regionlessNodes) {
  17003. return !regionlessNodes.includes(virtualNode);
  17004. }
  17005. var tree = axe._tree;
  17006. regionlessNodes = findRegionlessElms(tree[0], options).map(function(vNode) {
  17007. while (vNode.parent && !vNode.parent._hasRegionDescendant && vNode.parent.actualNode !== document.body) {
  17008. vNode = vNode.parent;
  17009. }
  17010. return vNode;
  17011. }).filter(function(vNode, index, array) {
  17012. return array.indexOf(vNode) === index;
  17013. });
  17014. cache_default.set('regionlessNodes', regionlessNodes);
  17015. return !regionlessNodes.includes(virtualNode);
  17016. }
  17017. var region_evaluate_default = regionEvaluate;
  17018. function skipLinkEvaluate(node) {
  17019. var target = get_element_by_reference_default(node, 'href');
  17020. if (target) {
  17021. return is_visible_default(target, true) || void 0;
  17022. }
  17023. return false;
  17024. }
  17025. var skip_link_evaluate_default = skipLinkEvaluate;
  17026. function uniqueFrameTitleAfter(results) {
  17027. var titles = {};
  17028. results.forEach(function(r) {
  17029. titles[r.data] = titles[r.data] !== void 0 ? ++titles[r.data] : 0;
  17030. });
  17031. results.forEach(function(r) {
  17032. r.result = !!titles[r.data];
  17033. });
  17034. return results;
  17035. }
  17036. var unique_frame_title_after_default = uniqueFrameTitleAfter;
  17037. function uniqueFrameTitleEvaluate(node, options, vNode) {
  17038. var title = sanitize_default(vNode.attr('title')).toLowerCase();
  17039. this.data(title);
  17040. return true;
  17041. }
  17042. var unique_frame_title_evaluate_default = uniqueFrameTitleEvaluate;
  17043. function ariaLabelEvaluate(node, options, virtualNode) {
  17044. return !!sanitize_default(arialabel_text_default(virtualNode));
  17045. }
  17046. var aria_label_evaluate_default = ariaLabelEvaluate;
  17047. function ariaLabelledbyEvaluate(node, options, virtualNode) {
  17048. try {
  17049. return !!sanitize_default(arialabelledby_text_default(virtualNode));
  17050. } catch (e) {
  17051. return void 0;
  17052. }
  17053. }
  17054. var aria_labelledby_evaluate_default = ariaLabelledbyEvaluate;
  17055. function avoidInlineSpacingEvaluate(node, options) {
  17056. var overriddenProperties = options.cssProperties.filter(function(property) {
  17057. if (node.style.getPropertyPriority(property) === 'important') {
  17058. return property;
  17059. }
  17060. });
  17061. if (overriddenProperties.length > 0) {
  17062. this.data(overriddenProperties);
  17063. return false;
  17064. }
  17065. return true;
  17066. }
  17067. var avoid_inline_spacing_evaluate_default = avoidInlineSpacingEvaluate;
  17068. function docHasTitleEvaluate() {
  17069. var title = document.title;
  17070. return !!sanitize_default(title);
  17071. }
  17072. var doc_has_title_evaluate_default = docHasTitleEvaluate;
  17073. function existsEvaluate() {
  17074. return void 0;
  17075. }
  17076. var exists_evaluate_default = existsEvaluate;
  17077. function hasAltEvaluate(node, options, virtualNode) {
  17078. var nodeName2 = virtualNode.props.nodeName;
  17079. if (![ 'img', 'input', 'area' ].includes(nodeName2)) {
  17080. return false;
  17081. }
  17082. return virtualNode.hasAttr('alt');
  17083. }
  17084. var has_alt_evaluate_default = hasAltEvaluate;
  17085. function isOnScreenEvaluate(node) {
  17086. return is_visible_default(node, false) && !is_offscreen_default(node);
  17087. }
  17088. var is_on_screen_evaluate_default = isOnScreenEvaluate;
  17089. function nonEmptyIfPresentEvaluate(node, options, virtualNode) {
  17090. var nodeName2 = virtualNode.props.nodeName;
  17091. var type = (virtualNode.attr('type') || '').toLowerCase();
  17092. var label5 = virtualNode.attr('value');
  17093. if (label5) {
  17094. this.data({
  17095. messageKey: 'has-label'
  17096. });
  17097. }
  17098. if (nodeName2 === 'input' && [ 'submit', 'reset' ].includes(type)) {
  17099. return label5 === null;
  17100. }
  17101. return false;
  17102. }
  17103. var non_empty_if_present_evaluate_default = nonEmptyIfPresentEvaluate;
  17104. function presentationalRoleEvaluate(node, options, virtualNode) {
  17105. var role = get_role_default(virtualNode);
  17106. var explicitRole2 = get_explicit_role_default(virtualNode);
  17107. if ([ 'presentation', 'none' ].includes(role)) {
  17108. this.data({
  17109. role: role
  17110. });
  17111. return true;
  17112. }
  17113. if (![ 'presentation', 'none' ].includes(explicitRole2)) {
  17114. return false;
  17115. }
  17116. var hasGlobalAria = get_global_aria_attrs_default().some(function(attr) {
  17117. return virtualNode.hasAttr(attr);
  17118. });
  17119. var focusable = is_focusable_default(virtualNode);
  17120. var messageKey;
  17121. if (hasGlobalAria && !focusable) {
  17122. messageKey = 'globalAria';
  17123. } else if (!hasGlobalAria && focusable) {
  17124. messageKey = 'focusable';
  17125. } else {
  17126. messageKey = 'both';
  17127. }
  17128. this.data({
  17129. messageKey: messageKey,
  17130. role: role
  17131. });
  17132. return false;
  17133. }
  17134. var presentational_role_evaluate_default = presentationalRoleEvaluate;
  17135. function svgNonEmptyTitleEvaluate(node, options, virtualNode) {
  17136. try {
  17137. var titleNode = virtualNode.children.find(function(_ref58) {
  17138. var props = _ref58.props;
  17139. return props.nodeName === 'title';
  17140. });
  17141. if (!titleNode) {
  17142. this.data({
  17143. messageKey: 'noTitle'
  17144. });
  17145. return false;
  17146. }
  17147. if (visible_virtual_default(titleNode) === '') {
  17148. this.data({
  17149. messageKey: 'emptyTitle'
  17150. });
  17151. return false;
  17152. }
  17153. return true;
  17154. } catch (e) {
  17155. return void 0;
  17156. }
  17157. }
  17158. var svg_non_empty_title_evaluate_default = svgNonEmptyTitleEvaluate;
  17159. function cssOrientationLockEvaluate(node, options, virtualNode, context3) {
  17160. var _ref59 = context3 || {}, _ref59$cssom = _ref59.cssom, cssom = _ref59$cssom === void 0 ? void 0 : _ref59$cssom;
  17161. var _ref60 = options || {}, _ref60$degreeThreshol = _ref60.degreeThreshold, degreeThreshold = _ref60$degreeThreshol === void 0 ? 0 : _ref60$degreeThreshol;
  17162. if (!cssom || !cssom.length) {
  17163. return void 0;
  17164. }
  17165. var isLocked = false;
  17166. var relatedElements = [];
  17167. var rulesGroupByDocumentFragment = groupCssomByDocument(cssom);
  17168. var _loop5 = function _loop5() {
  17169. var key = _Object$keys2[_i19];
  17170. var _rulesGroupByDocument = rulesGroupByDocumentFragment[key], root = _rulesGroupByDocument.root, rules = _rulesGroupByDocument.rules;
  17171. var orientationRules = rules.filter(isMediaRuleWithOrientation);
  17172. if (!orientationRules.length) {
  17173. return 'continue';
  17174. }
  17175. orientationRules.forEach(function(_ref61) {
  17176. var cssRules = _ref61.cssRules;
  17177. Array.from(cssRules).forEach(function(cssRule) {
  17178. var locked = getIsOrientationLocked(cssRule);
  17179. if (locked && cssRule.selectorText.toUpperCase() !== 'HTML') {
  17180. var elms = Array.from(root.querySelectorAll(cssRule.selectorText)) || [];
  17181. relatedElements = relatedElements.concat(elms);
  17182. }
  17183. isLocked = isLocked || locked;
  17184. });
  17185. });
  17186. };
  17187. for (var _i19 = 0, _Object$keys2 = Object.keys(rulesGroupByDocumentFragment); _i19 < _Object$keys2.length; _i19++) {
  17188. var _ret3 = _loop5();
  17189. if (_ret3 === 'continue') {
  17190. continue;
  17191. }
  17192. }
  17193. if (!isLocked) {
  17194. return true;
  17195. }
  17196. if (relatedElements.length) {
  17197. this.relatedNodes(relatedElements);
  17198. }
  17199. return false;
  17200. function groupCssomByDocument(cssObjectModel) {
  17201. return cssObjectModel.reduce(function(out, _ref62) {
  17202. var sheet = _ref62.sheet, root = _ref62.root, shadowId = _ref62.shadowId;
  17203. var key = shadowId ? shadowId : 'topDocument';
  17204. if (!out[key]) {
  17205. out[key] = {
  17206. root: root,
  17207. rules: []
  17208. };
  17209. }
  17210. if (!sheet || !sheet.cssRules) {
  17211. return out;
  17212. }
  17213. var rules = Array.from(sheet.cssRules);
  17214. out[key].rules = out[key].rules.concat(rules);
  17215. return out;
  17216. }, {});
  17217. }
  17218. function isMediaRuleWithOrientation(_ref63) {
  17219. var type = _ref63.type, cssText = _ref63.cssText;
  17220. if (type !== 4) {
  17221. return false;
  17222. }
  17223. return /orientation:\s*landscape/i.test(cssText) || /orientation:\s*portrait/i.test(cssText);
  17224. }
  17225. function getIsOrientationLocked(_ref64) {
  17226. var selectorText = _ref64.selectorText, style = _ref64.style;
  17227. if (!selectorText || style.length <= 0) {
  17228. return false;
  17229. }
  17230. var transformStyle = style.transform || style.webkitTransform || style.msTransform || false;
  17231. if (!transformStyle) {
  17232. return false;
  17233. }
  17234. var matches13 = transformStyle.match(/(rotate|rotateZ|rotate3d|matrix|matrix3d)\(([^)]+)\)(?!.*(rotate|rotateZ|rotate3d|matrix|matrix3d))/);
  17235. if (!matches13) {
  17236. return false;
  17237. }
  17238. var _matches = _slicedToArray(matches13, 3), transformFn = _matches[1], transformFnValue = _matches[2];
  17239. var degrees = getRotationInDegrees(transformFn, transformFnValue);
  17240. if (!degrees) {
  17241. return false;
  17242. }
  17243. degrees = Math.abs(degrees);
  17244. if (Math.abs(degrees - 180) % 180 <= degreeThreshold) {
  17245. return false;
  17246. }
  17247. return Math.abs(degrees - 90) % 90 <= degreeThreshold;
  17248. }
  17249. function getRotationInDegrees(transformFunction, transformFnValue) {
  17250. switch (transformFunction) {
  17251. case 'rotate':
  17252. case 'rotateZ':
  17253. return getAngleInDegrees(transformFnValue);
  17254. case 'rotate3d':
  17255. var _transformFnValue$spl = transformFnValue.split(',').map(function(value) {
  17256. return value.trim();
  17257. }), _transformFnValue$spl2 = _slicedToArray(_transformFnValue$spl, 4), z = _transformFnValue$spl2[2], angleWithUnit = _transformFnValue$spl2[3];
  17258. if (parseInt(z) === 0) {
  17259. return;
  17260. }
  17261. return getAngleInDegrees(angleWithUnit);
  17262. case 'matrix':
  17263. case 'matrix3d':
  17264. return getAngleInDegreesFromMatrixTransform(transformFnValue);
  17265. default:
  17266. return;
  17267. }
  17268. }
  17269. function getAngleInDegrees(angleWithUnit) {
  17270. var _ref65 = angleWithUnit.match(/(deg|grad|rad|turn)/) || [], _ref66 = _slicedToArray(_ref65, 1), unit = _ref66[0];
  17271. if (!unit) {
  17272. return;
  17273. }
  17274. var angle = parseFloat(angleWithUnit.replace(unit, ''));
  17275. switch (unit) {
  17276. case 'rad':
  17277. return convertRadToDeg(angle);
  17278. case 'grad':
  17279. return convertGradToDeg(angle);
  17280. case 'turn':
  17281. return convertTurnToDeg(angle);
  17282. case 'deg':
  17283. default:
  17284. return parseInt(angle);
  17285. }
  17286. }
  17287. function getAngleInDegreesFromMatrixTransform(transformFnValue) {
  17288. var values = transformFnValue.split(',');
  17289. if (values.length <= 6) {
  17290. var _values = _slicedToArray(values, 2), a = _values[0], b2 = _values[1];
  17291. var radians = Math.atan2(parseFloat(b2), parseFloat(a));
  17292. return convertRadToDeg(radians);
  17293. }
  17294. var sinB = parseFloat(values[8]);
  17295. var b = Math.asin(sinB);
  17296. var cosB = Math.cos(b);
  17297. var rotateZRadians = Math.acos(parseFloat(values[0]) / cosB);
  17298. return convertRadToDeg(rotateZRadians);
  17299. }
  17300. function convertRadToDeg(radians) {
  17301. return Math.round(radians * (180 / Math.PI));
  17302. }
  17303. function convertGradToDeg(grad) {
  17304. grad = grad % 400;
  17305. if (grad < 0) {
  17306. grad += 400;
  17307. }
  17308. return Math.round(grad / 400 * 360);
  17309. }
  17310. function convertTurnToDeg(turn) {
  17311. return Math.round(360 / (1 / turn));
  17312. }
  17313. }
  17314. var css_orientation_lock_evaluate_default = cssOrientationLockEvaluate;
  17315. function metaViewportScaleEvaluate(node, options) {
  17316. var _ref67 = options || {}, _ref67$scaleMinimum = _ref67.scaleMinimum, scaleMinimum = _ref67$scaleMinimum === void 0 ? 2 : _ref67$scaleMinimum, _ref67$lowerBound = _ref67.lowerBound, lowerBound = _ref67$lowerBound === void 0 ? false : _ref67$lowerBound;
  17317. var content = node.getAttribute('content') || '';
  17318. if (!content) {
  17319. return true;
  17320. }
  17321. var result = content.split(/[;,]/).reduce(function(out, item) {
  17322. var contentValue = item.trim();
  17323. if (!contentValue) {
  17324. return out;
  17325. }
  17326. var _contentValue$split = contentValue.split('='), _contentValue$split2 = _slicedToArray(_contentValue$split, 2), key = _contentValue$split2[0], value = _contentValue$split2[1];
  17327. if (!key || !value) {
  17328. return out;
  17329. }
  17330. var curatedKey = key.toLowerCase().trim();
  17331. var curatedValue = value.toLowerCase().trim();
  17332. if (curatedKey === 'maximum-scale' && curatedValue === 'yes') {
  17333. curatedValue = 1;
  17334. }
  17335. if (curatedKey === 'maximum-scale' && parseFloat(curatedValue) < 0) {
  17336. return out;
  17337. }
  17338. out[curatedKey] = curatedValue;
  17339. return out;
  17340. }, {});
  17341. if (lowerBound && result['maximum-scale'] && parseFloat(result['maximum-scale']) < lowerBound) {
  17342. return true;
  17343. }
  17344. if (!lowerBound && result['user-scalable'] === 'no') {
  17345. this.data('user-scalable=no');
  17346. return false;
  17347. }
  17348. if (result['maximum-scale'] && parseFloat(result['maximum-scale']) < scaleMinimum) {
  17349. this.data('maximum-scale');
  17350. return false;
  17351. }
  17352. return true;
  17353. }
  17354. var meta_viewport_scale_evaluate_default = metaViewportScaleEvaluate;
  17355. function duplicateIdAfter(results) {
  17356. var uniqueIds = [];
  17357. return results.filter(function(r) {
  17358. if (uniqueIds.indexOf(r.data) === -1) {
  17359. uniqueIds.push(r.data);
  17360. return true;
  17361. }
  17362. return false;
  17363. });
  17364. }
  17365. var duplicate_id_after_default = duplicateIdAfter;
  17366. function duplicateIdEvaluate(node) {
  17367. var id = node.getAttribute('id').trim();
  17368. if (!id) {
  17369. return true;
  17370. }
  17371. var root = get_root_node_default2(node);
  17372. var matchingNodes = Array.from(root.querySelectorAll('[id="'.concat(escape_selector_default(id), '"]'))).filter(function(foundNode) {
  17373. return foundNode !== node;
  17374. });
  17375. if (matchingNodes.length) {
  17376. this.relatedNodes(matchingNodes);
  17377. }
  17378. this.data(id);
  17379. return matchingNodes.length === 0;
  17380. }
  17381. var duplicate_id_evaluate_default = duplicateIdEvaluate;
  17382. function accesskeysAfter(results) {
  17383. var seen = {};
  17384. return results.filter(function(r) {
  17385. if (!r.data) {
  17386. return false;
  17387. }
  17388. var key = r.data.toUpperCase();
  17389. if (!seen[key]) {
  17390. seen[key] = r;
  17391. r.relatedNodes = [];
  17392. return true;
  17393. }
  17394. seen[key].relatedNodes.push(r.relatedNodes[0]);
  17395. return false;
  17396. }).map(function(r) {
  17397. r.result = !!r.relatedNodes.length;
  17398. return r;
  17399. });
  17400. }
  17401. var accesskeys_after_default = accesskeysAfter;
  17402. function accesskeysEvaluate(node) {
  17403. if (is_visible_default(node, false)) {
  17404. this.data(node.getAttribute('accesskey'));
  17405. this.relatedNodes([ node ]);
  17406. }
  17407. return true;
  17408. }
  17409. var accesskeys_evaluate_default = accesskeysEvaluate;
  17410. function focusableContentEvaluate(node, options, virtualNode) {
  17411. var tabbableElements = virtualNode.tabbableElements;
  17412. if (!tabbableElements) {
  17413. return false;
  17414. }
  17415. var tabbableContentElements = tabbableElements.filter(function(el) {
  17416. return el !== virtualNode;
  17417. });
  17418. return tabbableContentElements.length > 0;
  17419. }
  17420. var focusable_content_evaluate_default = focusableContentEvaluate;
  17421. function focusableDisabledEvaluate(node, options, virtualNode) {
  17422. var elementsThatCanBeDisabled = [ 'BUTTON', 'FIELDSET', 'INPUT', 'SELECT', 'TEXTAREA' ];
  17423. var tabbableElements = virtualNode.tabbableElements;
  17424. if (!tabbableElements || !tabbableElements.length) {
  17425. return true;
  17426. }
  17427. var relatedNodes = tabbableElements.reduce(function(out, _ref68) {
  17428. var el = _ref68.actualNode;
  17429. var nodeName2 = el.nodeName.toUpperCase();
  17430. if (elementsThatCanBeDisabled.includes(nodeName2)) {
  17431. out.push(el);
  17432. }
  17433. return out;
  17434. }, []);
  17435. this.relatedNodes(relatedNodes);
  17436. if (relatedNodes.length && is_modal_open_default()) {
  17437. return true;
  17438. }
  17439. return relatedNodes.length === 0;
  17440. }
  17441. var focusable_disabled_evaluate_default = focusableDisabledEvaluate;
  17442. function focusableElementEvaluate(node, options, virtualNode) {
  17443. if (virtualNode.hasAttr('contenteditable') && isContenteditable(virtualNode)) {
  17444. return true;
  17445. }
  17446. var isFocusable2 = virtualNode.isFocusable;
  17447. var tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
  17448. tabIndex = !isNaN(tabIndex) ? tabIndex : null;
  17449. return tabIndex ? isFocusable2 && tabIndex >= 0 : isFocusable2;
  17450. function isContenteditable(vNode) {
  17451. var contenteditable = vNode.attr('contenteditable');
  17452. if (contenteditable === 'true' || contenteditable === '') {
  17453. return true;
  17454. }
  17455. if (contenteditable === 'false') {
  17456. return false;
  17457. }
  17458. var ancestor = closest_default(virtualNode.parent, '[contenteditable]');
  17459. if (!ancestor) {
  17460. return false;
  17461. }
  17462. return isContenteditable(ancestor);
  17463. }
  17464. }
  17465. var focusable_element_evaluate_default = focusableElementEvaluate;
  17466. function focusableModalOpenEvaluate(node, options, virtualNode) {
  17467. var tabbableElements = virtualNode.tabbableElements.map(function(_ref69) {
  17468. var actualNode = _ref69.actualNode;
  17469. return actualNode;
  17470. });
  17471. if (!tabbableElements || !tabbableElements.length) {
  17472. return true;
  17473. }
  17474. if (is_modal_open_default()) {
  17475. this.relatedNodes(tabbableElements);
  17476. return void 0;
  17477. }
  17478. return true;
  17479. }
  17480. var focusable_modal_open_evaluate_default = focusableModalOpenEvaluate;
  17481. function focusableNoNameEvaluate(node, options, virtualNode) {
  17482. var tabIndex = virtualNode.attr('tabindex');
  17483. var inFocusOrder = is_focusable_default(virtualNode) && tabIndex > -1;
  17484. if (!inFocusOrder) {
  17485. return false;
  17486. }
  17487. try {
  17488. return !accessible_text_virtual_default(virtualNode);
  17489. } catch (e) {
  17490. return void 0;
  17491. }
  17492. }
  17493. var focusable_no_name_evaluate_default = focusableNoNameEvaluate;
  17494. function focusableNotTabbableEvaluate(node, options, virtualNode) {
  17495. var elementsThatCanBeDisabled = [ 'BUTTON', 'FIELDSET', 'INPUT', 'SELECT', 'TEXTAREA' ];
  17496. var tabbableElements = virtualNode.tabbableElements;
  17497. if (!tabbableElements || !tabbableElements.length) {
  17498. return true;
  17499. }
  17500. var relatedNodes = tabbableElements.reduce(function(out, _ref70) {
  17501. var el = _ref70.actualNode;
  17502. var nodeName2 = el.nodeName.toUpperCase();
  17503. if (!elementsThatCanBeDisabled.includes(nodeName2)) {
  17504. out.push(el);
  17505. }
  17506. return out;
  17507. }, []);
  17508. this.relatedNodes(relatedNodes);
  17509. if (relatedNodes.length > 0 && is_modal_open_default()) {
  17510. return true;
  17511. }
  17512. return relatedNodes.length === 0;
  17513. }
  17514. var focusable_not_tabbable_evaluate_default = focusableNotTabbableEvaluate;
  17515. function landmarkIsTopLevelEvaluate(node) {
  17516. var landmarks = get_aria_roles_by_type_default('landmark');
  17517. var parent = get_composed_parent_default(node);
  17518. this.data({
  17519. role: node.getAttribute('role') || implicit_role_default(node)
  17520. });
  17521. while (parent) {
  17522. var role = parent.getAttribute('role');
  17523. if (!role && parent.nodeName.toUpperCase() !== 'FORM') {
  17524. role = implicit_role_default(parent);
  17525. }
  17526. if (role && landmarks.includes(role)) {
  17527. return false;
  17528. }
  17529. parent = get_composed_parent_default(parent);
  17530. }
  17531. return true;
  17532. }
  17533. var landmark_is_top_level_evaluate_default = landmarkIsTopLevelEvaluate;
  17534. function tabindexEvaluate(node, options, virtualNode) {
  17535. var tabIndex = parseInt(virtualNode.attr('tabindex'), 10);
  17536. return isNaN(tabIndex) ? true : tabIndex <= 0;
  17537. }
  17538. var tabindex_evaluate_default = tabindexEvaluate;
  17539. function altSpaceValueEvaluate(node, options, virtualNode) {
  17540. var alt = virtualNode.attr('alt');
  17541. var isOnlySpace = /^\s+$/;
  17542. return typeof alt === 'string' && isOnlySpace.test(alt);
  17543. }
  17544. var alt_space_value_evaluate_default = altSpaceValueEvaluate;
  17545. function duplicateImgLabelEvaluate(node, options, virtualNode) {
  17546. if ([ 'none', 'presentation' ].includes(get_role_default(virtualNode))) {
  17547. return false;
  17548. }
  17549. var parentVNode = closest_default(virtualNode, options.parentSelector);
  17550. if (!parentVNode) {
  17551. return false;
  17552. }
  17553. var visibleText = visible_virtual_default(parentVNode, true).toLowerCase();
  17554. if (visibleText === '') {
  17555. return false;
  17556. }
  17557. return visibleText === accessible_text_virtual_default(virtualNode).toLowerCase();
  17558. }
  17559. var duplicate_img_label_evaluate_default = duplicateImgLabelEvaluate;
  17560. function explicitEvaluate(node, options, virtualNode) {
  17561. try {
  17562. if (virtualNode.attr('id')) {
  17563. var root = get_root_node_default2(virtualNode.actualNode);
  17564. var id = escape_selector_default(virtualNode.attr('id'));
  17565. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  17566. if (labels.length) {
  17567. return labels.some(function(label5) {
  17568. if (!is_visible_default(label5)) {
  17569. return true;
  17570. } else {
  17571. return !!accessible_text_default(label5);
  17572. }
  17573. });
  17574. }
  17575. }
  17576. return false;
  17577. } catch (e) {
  17578. return void 0;
  17579. }
  17580. }
  17581. var explicit_evaluate_default = explicitEvaluate;
  17582. function helpSameAsLabelEvaluate(node, options, virtualNode) {
  17583. var labelText2 = label_virtual_default2(virtualNode), check4 = node.getAttribute('title');
  17584. if (!labelText2) {
  17585. return false;
  17586. }
  17587. if (!check4) {
  17588. check4 = '';
  17589. if (node.getAttribute('aria-describedby')) {
  17590. var ref = idrefs_default(node, 'aria-describedby');
  17591. check4 = ref.map(function(thing) {
  17592. return thing ? accessible_text_default(thing) : '';
  17593. }).join('');
  17594. }
  17595. }
  17596. return sanitize_default(check4) === sanitize_default(labelText2);
  17597. }
  17598. var help_same_as_label_evaluate_default = helpSameAsLabelEvaluate;
  17599. function hiddenExplicitLabelEvaluate(node, options, virtualNode) {
  17600. try {
  17601. if (virtualNode.hasAttr('id')) {
  17602. var root = get_root_node_default2(node);
  17603. var id = escape_selector_default(node.getAttribute('id'));
  17604. var label5 = root.querySelector('label[for="'.concat(id, '"]'));
  17605. if (label5 && !is_visible_default(label5, true)) {
  17606. var name = accessible_text_virtual_default(virtualNode).trim();
  17607. var isNameEmpty = name === '';
  17608. return isNameEmpty;
  17609. }
  17610. }
  17611. return false;
  17612. } catch (e) {
  17613. return void 0;
  17614. }
  17615. }
  17616. var hidden_explicit_label_evaluate_default = hiddenExplicitLabelEvaluate;
  17617. function implicitEvaluate(node, options, virtualNode) {
  17618. try {
  17619. var label5 = closest_default(virtualNode, 'label');
  17620. if (label5) {
  17621. return !!accessible_text_virtual_default(label5, {
  17622. inControlContext: true
  17623. });
  17624. }
  17625. return false;
  17626. } catch (e) {
  17627. return void 0;
  17628. }
  17629. }
  17630. var implicit_evaluate_default = implicitEvaluate;
  17631. function isStringContained(compare, compareWith) {
  17632. var curatedCompareWith = curateString(compareWith);
  17633. var curatedCompare = curateString(compare);
  17634. if (!curatedCompareWith || !curatedCompare) {
  17635. return false;
  17636. }
  17637. return curatedCompareWith.includes(curatedCompare);
  17638. }
  17639. function curateString(str) {
  17640. var noUnicodeStr = remove_unicode_default(str, {
  17641. emoji: true,
  17642. nonBmp: true,
  17643. punctuations: true
  17644. });
  17645. return sanitize_default(noUnicodeStr);
  17646. }
  17647. function labelContentNameMismatchEvaluate(node, options, virtualNode) {
  17648. var _ref71 = options || {}, pixelThreshold = _ref71.pixelThreshold, occuranceThreshold = _ref71.occuranceThreshold;
  17649. var accText = accessible_text_default(node).toLowerCase();
  17650. if (is_human_interpretable_default(accText) < 1) {
  17651. return void 0;
  17652. }
  17653. var textVNodes = visible_text_nodes_default(virtualNode);
  17654. var nonLigatureText = textVNodes.filter(function(textVNode) {
  17655. return !is_icon_ligature_default(textVNode, pixelThreshold, occuranceThreshold);
  17656. }).map(function(textVNode) {
  17657. return textVNode.actualNode.nodeValue;
  17658. }).join('');
  17659. var visibleText = sanitize_default(nonLigatureText).toLowerCase();
  17660. if (!visibleText) {
  17661. return true;
  17662. }
  17663. if (is_human_interpretable_default(visibleText) < 1) {
  17664. if (isStringContained(visibleText, accText)) {
  17665. return true;
  17666. }
  17667. return void 0;
  17668. }
  17669. return isStringContained(visibleText, accText);
  17670. }
  17671. var label_content_name_mismatch_evaluate_default = labelContentNameMismatchEvaluate;
  17672. function multipleLabelEvaluate(node) {
  17673. var id = escape_selector_default(node.getAttribute('id'));
  17674. var parent = node.parentNode;
  17675. var root = get_root_node_default2(node);
  17676. root = root.documentElement || root;
  17677. var labels = Array.from(root.querySelectorAll('label[for="'.concat(id, '"]')));
  17678. if (labels.length) {
  17679. labels = labels.filter(function(label5) {
  17680. return is_visible_default(label5);
  17681. });
  17682. }
  17683. while (parent) {
  17684. if (parent.nodeName.toUpperCase() === 'LABEL' && labels.indexOf(parent) === -1) {
  17685. labels.push(parent);
  17686. }
  17687. parent = parent.parentNode;
  17688. }
  17689. this.relatedNodes(labels);
  17690. if (labels.length > 1) {
  17691. var ATVisibleLabels = labels.filter(function(label5) {
  17692. return is_visible_default(label5, true);
  17693. });
  17694. if (ATVisibleLabels.length > 1) {
  17695. return void 0;
  17696. }
  17697. var labelledby = idrefs_default(node, 'aria-labelledby');
  17698. return !labelledby.includes(ATVisibleLabels[0]) ? void 0 : false;
  17699. }
  17700. return false;
  17701. }
  17702. var multiple_label_evaluate_default = multipleLabelEvaluate;
  17703. function titleOnlyEvaluate(node, options, virtualNode) {
  17704. var labelText2 = label_virtual_default2(virtualNode);
  17705. var title = title_text_default(virtualNode);
  17706. var ariaDescribedBy = virtualNode.attr('aria-describedby');
  17707. return !labelText2 && !!(title || ariaDescribedBy);
  17708. }
  17709. var title_only_evaluate_default = titleOnlyEvaluate;
  17710. function landmarkIsUniqueAfter(results) {
  17711. var uniqueLandmarks = [];
  17712. return results.filter(function(currentResult) {
  17713. var findMatch = function findMatch(someResult) {
  17714. return currentResult.data.role === someResult.data.role && currentResult.data.accessibleText === someResult.data.accessibleText;
  17715. };
  17716. var matchedResult = uniqueLandmarks.find(findMatch);
  17717. if (matchedResult) {
  17718. matchedResult.result = false;
  17719. matchedResult.relatedNodes.push(currentResult.relatedNodes[0]);
  17720. return false;
  17721. }
  17722. uniqueLandmarks.push(currentResult);
  17723. currentResult.relatedNodes = [];
  17724. return true;
  17725. });
  17726. }
  17727. var landmark_is_unique_after_default = landmarkIsUniqueAfter;
  17728. function landmarkIsUniqueEvaluate(node, options, virtualNode) {
  17729. var role = get_role_default(node);
  17730. var accessibleText2 = accessible_text_virtual_default(virtualNode);
  17731. accessibleText2 = accessibleText2 ? accessibleText2.toLowerCase() : null;
  17732. this.data({
  17733. role: role,
  17734. accessibleText: accessibleText2
  17735. });
  17736. this.relatedNodes([ node ]);
  17737. return true;
  17738. }
  17739. var landmark_is_unique_evaluate_default = landmarkIsUniqueEvaluate;
  17740. function hasValue(value) {
  17741. return (value || '').trim() !== '';
  17742. }
  17743. function hasLangEvaluate(node, options, virtualNode) {
  17744. if (options.attributes.includes('xml:lang') && options.attributes.includes('lang') && hasValue(virtualNode.attr('xml:lang')) && !hasValue(virtualNode.attr('lang')) && !is_xhtml_default(document)) {
  17745. this.data({
  17746. messageKey: 'noXHTML'
  17747. });
  17748. return false;
  17749. }
  17750. var hasLang = options.attributes.some(function(name) {
  17751. return hasValue(virtualNode.attr(name));
  17752. });
  17753. if (!hasLang) {
  17754. this.data({
  17755. messageKey: 'noLang'
  17756. });
  17757. return false;
  17758. }
  17759. return true;
  17760. }
  17761. var has_lang_evaluate_default = hasLangEvaluate;
  17762. function validLangEvaluate(node, options, virtualNode) {
  17763. var invalid = [];
  17764. options.attributes.forEach(function(langAttr) {
  17765. var langVal = virtualNode.attr(langAttr);
  17766. if (typeof langVal !== 'string') {
  17767. return;
  17768. }
  17769. var baselangVal = get_base_lang_default(langVal);
  17770. var invalidLang = options.value ? !options.value.map(get_base_lang_default).includes(baselangVal) : !valid_langs_default(baselangVal);
  17771. if (baselangVal !== '' && invalidLang || langVal !== '' && !sanitize_default(langVal)) {
  17772. invalid.push(langAttr + '="' + virtualNode.attr(langAttr) + '"');
  17773. }
  17774. });
  17775. if (invalid.length) {
  17776. this.data(invalid);
  17777. return true;
  17778. }
  17779. return false;
  17780. }
  17781. var valid_lang_evaluate_default = validLangEvaluate;
  17782. function xmlLangMismatchEvaluate(node, options, vNode) {
  17783. var primaryLangValue = get_base_lang_default(vNode.attr('lang'));
  17784. var primaryXmlLangValue = get_base_lang_default(vNode.attr('xml:lang'));
  17785. return primaryLangValue === primaryXmlLangValue;
  17786. }
  17787. var xml_lang_mismatch_evaluate_default = xmlLangMismatchEvaluate;
  17788. function dlitemEvaluate(node) {
  17789. var parent = get_composed_parent_default(node);
  17790. var parentTagName = parent.nodeName.toUpperCase();
  17791. var parentRole = get_explicit_role_default(parent);
  17792. if (parentTagName === 'DIV' && [ 'presentation', 'none', null ].includes(parentRole)) {
  17793. parent = get_composed_parent_default(parent);
  17794. parentTagName = parent.nodeName.toUpperCase();
  17795. parentRole = get_explicit_role_default(parent);
  17796. }
  17797. if (parentTagName !== 'DL') {
  17798. return false;
  17799. }
  17800. if (!parentRole || [ 'presentation', 'none', 'list' ].includes(parentRole)) {
  17801. return true;
  17802. }
  17803. return false;
  17804. }
  17805. var dlitem_evaluate_default = dlitemEvaluate;
  17806. function listitemEvaluate(node) {
  17807. var parent = get_composed_parent_default(node);
  17808. if (!parent) {
  17809. return void 0;
  17810. }
  17811. var parentTagName = parent.nodeName.toUpperCase();
  17812. var parentRole = (parent.getAttribute('role') || '').toLowerCase();
  17813. if ([ 'presentation', 'none', 'list' ].includes(parentRole)) {
  17814. return true;
  17815. }
  17816. if (parentRole && is_valid_role_default(parentRole)) {
  17817. this.data({
  17818. messageKey: 'roleNotValid'
  17819. });
  17820. return false;
  17821. }
  17822. return [ 'UL', 'OL' ].includes(parentTagName);
  17823. }
  17824. var listitem_evaluate_default = listitemEvaluate;
  17825. function onlyDlitemsEvaluate(node, options, virtualNode) {
  17826. var ALLOWED_ROLES = [ 'definition', 'term', 'list' ];
  17827. var base = {
  17828. badNodes: [],
  17829. hasNonEmptyTextNode: false
  17830. };
  17831. var content = virtualNode.children.reduce(function(content2, child) {
  17832. var actualNode = child.actualNode;
  17833. if (actualNode.nodeName.toUpperCase() === 'DIV' && get_role_default(actualNode) === null) {
  17834. return content2.concat(child.children);
  17835. }
  17836. return content2.concat(child);
  17837. }, []);
  17838. var result = content.reduce(function(out, childNode) {
  17839. var actualNode = childNode.actualNode;
  17840. var tagName = actualNode.nodeName.toUpperCase();
  17841. if (actualNode.nodeType === 1 && is_visible_default(actualNode, true, false)) {
  17842. var explicitRole2 = get_explicit_role_default(actualNode);
  17843. if (tagName !== 'DT' && tagName !== 'DD' || explicitRole2) {
  17844. if (!ALLOWED_ROLES.includes(explicitRole2)) {
  17845. out.badNodes.push(actualNode);
  17846. }
  17847. }
  17848. } else if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  17849. out.hasNonEmptyTextNode = true;
  17850. }
  17851. return out;
  17852. }, base);
  17853. if (result.badNodes.length) {
  17854. this.relatedNodes(result.badNodes);
  17855. }
  17856. return !!result.badNodes.length || result.hasNonEmptyTextNode;
  17857. }
  17858. var only_dlitems_evaluate_default = onlyDlitemsEvaluate;
  17859. function onlyListitemsEvaluate(node, options, virtualNode) {
  17860. var hasNonEmptyTextNode = false;
  17861. var atLeastOneListitem = false;
  17862. var isEmpty = true;
  17863. var badNodes = [];
  17864. var badRoleNodes = [];
  17865. var badRoles = [];
  17866. virtualNode.children.forEach(function(vNode) {
  17867. var actualNode = vNode.actualNode;
  17868. if (actualNode.nodeType === 3 && actualNode.nodeValue.trim() !== '') {
  17869. hasNonEmptyTextNode = true;
  17870. return;
  17871. }
  17872. if (actualNode.nodeType !== 1 || !is_visible_default(actualNode, true, false)) {
  17873. return;
  17874. }
  17875. isEmpty = false;
  17876. var isLi = actualNode.nodeName.toUpperCase() === 'LI';
  17877. var role = get_role_default(vNode);
  17878. var isListItemRole = role === 'listitem';
  17879. if (!isLi && !isListItemRole) {
  17880. badNodes.push(actualNode);
  17881. }
  17882. if (isLi && !isListItemRole) {
  17883. badRoleNodes.push(actualNode);
  17884. if (!badRoles.includes(role)) {
  17885. badRoles.push(role);
  17886. }
  17887. }
  17888. if (isListItemRole) {
  17889. atLeastOneListitem = true;
  17890. }
  17891. });
  17892. if (hasNonEmptyTextNode || badNodes.length) {
  17893. this.relatedNodes(badNodes);
  17894. return true;
  17895. }
  17896. if (isEmpty || atLeastOneListitem) {
  17897. return false;
  17898. }
  17899. this.relatedNodes(badRoleNodes);
  17900. this.data({
  17901. messageKey: 'roleNotValid',
  17902. roles: badRoles.join(', ')
  17903. });
  17904. return true;
  17905. }
  17906. var only_listitems_evaluate_default = onlyListitemsEvaluate;
  17907. function structuredDlitemsEvaluate(node, options, virtualNode) {
  17908. var children = virtualNode.children;
  17909. if (!children || !children.length) {
  17910. return false;
  17911. }
  17912. var hasDt = false, hasDd = false, nodeName2;
  17913. for (var i = 0; i < children.length; i++) {
  17914. nodeName2 = children[i].props.nodeName.toUpperCase();
  17915. if (nodeName2 === 'DT') {
  17916. hasDt = true;
  17917. }
  17918. if (hasDt && nodeName2 === 'DD') {
  17919. return false;
  17920. }
  17921. if (nodeName2 === 'DD') {
  17922. hasDd = true;
  17923. }
  17924. }
  17925. return hasDt || hasDd;
  17926. }
  17927. var structured_dlitems_evaluate_default = structuredDlitemsEvaluate;
  17928. function captionEvaluate(node, options, virtualNode) {
  17929. var tracks = query_selector_all_default(virtualNode, 'track');
  17930. var hasCaptions = tracks.some(function(vNode) {
  17931. return (vNode.attr('kind') || '').toLowerCase() === 'captions';
  17932. });
  17933. return hasCaptions ? false : void 0;
  17934. }
  17935. var caption_evaluate_default = captionEvaluate;
  17936. function frameTestedEvaluate(node, options) {
  17937. var resolve = this.async();
  17938. var _Object$assign = Object.assign({
  17939. isViolation: false,
  17940. timeout: 500
  17941. }, options), isViolation = _Object$assign.isViolation, timeout = _Object$assign.timeout;
  17942. var timer = setTimeout(function() {
  17943. timer = setTimeout(function() {
  17944. timer = null;
  17945. resolve(isViolation ? false : void 0);
  17946. }, 0);
  17947. }, timeout);
  17948. _respondable(node.contentWindow, 'axe.ping', null, void 0, function() {
  17949. if (timer !== null) {
  17950. clearTimeout(timer);
  17951. resolve(true);
  17952. }
  17953. });
  17954. }
  17955. var frame_tested_evaluate_default = frameTestedEvaluate;
  17956. function noAutoplayAudioEvaluate(node, options) {
  17957. if (!node.duration) {
  17958. console.warn('axe.utils.preloadMedia did not load metadata');
  17959. return void 0;
  17960. }
  17961. var _options$allowedDurat = options.allowedDuration, allowedDuration = _options$allowedDurat === void 0 ? 3 : _options$allowedDurat;
  17962. var playableDuration = getPlayableDuration(node);
  17963. if (playableDuration <= allowedDuration && !node.hasAttribute('loop')) {
  17964. return true;
  17965. }
  17966. if (!node.hasAttribute('controls')) {
  17967. return false;
  17968. }
  17969. return true;
  17970. function getPlayableDuration(elm) {
  17971. if (!elm.currentSrc) {
  17972. return 0;
  17973. }
  17974. var playbackRange = getPlaybackRange(elm.currentSrc);
  17975. if (!playbackRange) {
  17976. return Math.abs(elm.duration - (elm.currentTime || 0));
  17977. }
  17978. if (playbackRange.length === 1) {
  17979. return Math.abs(elm.duration - playbackRange[0]);
  17980. }
  17981. return Math.abs(playbackRange[1] - playbackRange[0]);
  17982. }
  17983. function getPlaybackRange(src) {
  17984. var match = src.match(/#t=(.*)/);
  17985. if (!match) {
  17986. return;
  17987. }
  17988. var _match = _slicedToArray(match, 2), value = _match[1];
  17989. var ranges = value.split(',');
  17990. return ranges.map(function(range) {
  17991. if (/:/.test(range)) {
  17992. return convertHourMinSecToSeconds(range);
  17993. }
  17994. return parseFloat(range);
  17995. });
  17996. }
  17997. function convertHourMinSecToSeconds(hhMmSs) {
  17998. var parts = hhMmSs.split(':');
  17999. var secs = 0;
  18000. var mins = 1;
  18001. while (parts.length > 0) {
  18002. secs += mins * parseInt(parts.pop(), 10);
  18003. mins *= 60;
  18004. }
  18005. return parseFloat(secs);
  18006. }
  18007. }
  18008. var no_autoplay_audio_evaluate_default = noAutoplayAudioEvaluate;
  18009. function ariaAllowedAttrMatches(node) {
  18010. var aria38 = /^aria-/;
  18011. if (node.hasAttributes()) {
  18012. var attrs = get_node_attributes_default(node);
  18013. for (var _i20 = 0, l = attrs.length; _i20 < l; _i20++) {
  18014. if (aria38.test(attrs[_i20].name)) {
  18015. return true;
  18016. }
  18017. }
  18018. }
  18019. return false;
  18020. }
  18021. var aria_allowed_attr_matches_default = ariaAllowedAttrMatches;
  18022. function ariaAllowedRoleMatches(node) {
  18023. return get_explicit_role_default(node, {
  18024. dpub: true,
  18025. fallback: true
  18026. }) !== null;
  18027. }
  18028. var aria_allowed_role_matches_default = ariaAllowedRoleMatches;
  18029. function ariaHasAttrMatches(node) {
  18030. var aria38 = /^aria-/;
  18031. if (node.hasAttributes()) {
  18032. var attrs = get_node_attributes_default(node);
  18033. for (var i = 0, l = attrs.length; i < l; i++) {
  18034. if (aria38.test(attrs[i].name)) {
  18035. return true;
  18036. }
  18037. }
  18038. }
  18039. return false;
  18040. }
  18041. var aria_has_attr_matches_default = ariaHasAttrMatches;
  18042. function shouldMatchElement(el) {
  18043. if (!el) {
  18044. return true;
  18045. }
  18046. if (el.getAttribute('aria-hidden') === 'true') {
  18047. return false;
  18048. }
  18049. return shouldMatchElement(get_composed_parent_default(el));
  18050. }
  18051. function ariaHiddenFocusMatches(node) {
  18052. return shouldMatchElement(get_composed_parent_default(node));
  18053. }
  18054. var aria_hidden_focus_matches_default = ariaHiddenFocusMatches;
  18055. function autocompleteMatches(node, virtualNode) {
  18056. var autocomplete2 = virtualNode.attr('autocomplete');
  18057. if (!autocomplete2 || sanitize_default(autocomplete2) === '') {
  18058. return false;
  18059. }
  18060. var nodeName2 = virtualNode.props.nodeName;
  18061. if ([ 'textarea', 'input', 'select' ].includes(nodeName2) === false) {
  18062. return false;
  18063. }
  18064. var excludedInputTypes = [ 'submit', 'reset', 'button', 'hidden' ];
  18065. if (nodeName2 === 'input' && excludedInputTypes.includes(virtualNode.props.type)) {
  18066. return false;
  18067. }
  18068. var ariaDisabled = virtualNode.attr('aria-disabled') || 'false';
  18069. if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') {
  18070. return false;
  18071. }
  18072. var role = virtualNode.attr('role');
  18073. var tabIndex = virtualNode.attr('tabindex');
  18074. if (tabIndex === '-1' && role) {
  18075. var roleDef = standards_default.ariaRoles[role];
  18076. if (roleDef === void 0 || roleDef.type !== 'widget') {
  18077. return false;
  18078. }
  18079. }
  18080. if (tabIndex === '-1' && virtualNode.actualNode && !is_visible_default(virtualNode.actualNode, false) && !is_visible_default(virtualNode.actualNode, true)) {
  18081. return false;
  18082. }
  18083. return true;
  18084. }
  18085. var autocomplete_matches_default = autocompleteMatches;
  18086. function isInitiatorMatches(node, virtualNode, context3) {
  18087. return context3.initiator;
  18088. }
  18089. var is_initiator_matches_default = isInitiatorMatches;
  18090. function bypassMatches(node, virtualNode, context3) {
  18091. if (is_initiator_matches_default(node, virtualNode, context3)) {
  18092. return !!node.querySelector('a[href]');
  18093. }
  18094. return true;
  18095. }
  18096. var bypass_matches_default = bypassMatches;
  18097. function colorContrastMatches(node, virtualNode) {
  18098. var _virtualNode$props = virtualNode.props, nodeName2 = _virtualNode$props.nodeName, inputType = _virtualNode$props.type;
  18099. if (nodeName2 === 'option') {
  18100. return false;
  18101. }
  18102. if (nodeName2 === 'select' && !node.options.length) {
  18103. return false;
  18104. }
  18105. var nonTextInput = [ 'hidden', 'range', 'color', 'checkbox', 'radio', 'image' ];
  18106. if (nodeName2 === 'input' && nonTextInput.includes(inputType)) {
  18107. return false;
  18108. }
  18109. if (is_disabled_default(virtualNode)) {
  18110. return false;
  18111. }
  18112. var formElements = [ 'input', 'select', 'textarea' ];
  18113. if (formElements.includes(nodeName2)) {
  18114. var style = window.getComputedStyle(node);
  18115. var textIndent = parseInt(style.getPropertyValue('text-indent'), 10);
  18116. if (textIndent) {
  18117. var rect = node.getBoundingClientRect();
  18118. rect = {
  18119. top: rect.top,
  18120. bottom: rect.bottom,
  18121. left: rect.left + textIndent,
  18122. right: rect.right + textIndent
  18123. };
  18124. if (!visually_overlaps_default(rect, node)) {
  18125. return false;
  18126. }
  18127. }
  18128. return true;
  18129. }
  18130. var nodeParentLabel = find_up_virtual_default(virtualNode, 'label');
  18131. if (nodeName2 === 'label' || nodeParentLabel) {
  18132. var labelNode = nodeParentLabel || node;
  18133. var labelVirtual3 = nodeParentLabel ? get_node_from_tree_default(nodeParentLabel) : virtualNode;
  18134. var doc = get_root_node_default2(labelNode);
  18135. var explicitControl = doc.getElementById(labelNode.htmlFor || '');
  18136. var explicitControlVirtual = explicitControl && get_node_from_tree_default(explicitControl);
  18137. if (explicitControlVirtual && is_disabled_default(explicitControlVirtual)) {
  18138. return false;
  18139. }
  18140. var query = 'input:not([type="hidden"]):not([type="image"]):not([type="button"]):not([type="submit"]):not([type="reset"]), select, textarea';
  18141. var implicitControl = query_selector_all_default(labelVirtual3, query)[0];
  18142. if (implicitControl && is_disabled_default(implicitControl)) {
  18143. return false;
  18144. }
  18145. }
  18146. var ariaLabelledbyControls = [];
  18147. var ancestorNode = virtualNode;
  18148. while (ancestorNode) {
  18149. if (ancestorNode.props.id) {
  18150. var virtualControls = get_accessible_refs_default(ancestorNode).filter(function(control) {
  18151. return token_list_default(control.getAttribute('aria-labelledby') || '').includes(ancestorNode.props.id);
  18152. }).map(function(control) {
  18153. return get_node_from_tree_default(control);
  18154. });
  18155. ariaLabelledbyControls.push.apply(ariaLabelledbyControls, _toConsumableArray(virtualControls));
  18156. }
  18157. ancestorNode = ancestorNode.parent;
  18158. }
  18159. if (ariaLabelledbyControls.length > 0 && ariaLabelledbyControls.every(is_disabled_default)) {
  18160. return false;
  18161. }
  18162. var visibleText = visible_virtual_default(virtualNode, false, true);
  18163. var removeUnicodeOptions = {
  18164. emoji: true,
  18165. nonBmp: false,
  18166. punctuations: true
  18167. };
  18168. if (!visibleText || !remove_unicode_default(visibleText, removeUnicodeOptions)) {
  18169. return false;
  18170. }
  18171. var range = document.createRange();
  18172. var childNodes = virtualNode.children;
  18173. for (var index = 0; index < childNodes.length; index++) {
  18174. var child = childNodes[index];
  18175. if (child.actualNode.nodeType === 3 && sanitize_default(child.actualNode.nodeValue) !== '') {
  18176. range.selectNodeContents(child.actualNode);
  18177. }
  18178. }
  18179. var rects = range.getClientRects();
  18180. for (var _index = 0; _index < rects.length; _index++) {
  18181. if (visually_overlaps_default(rects[_index], node)) {
  18182. return true;
  18183. }
  18184. }
  18185. return false;
  18186. }
  18187. var color_contrast_matches_default = colorContrastMatches;
  18188. function dataTableLargeMatches(node) {
  18189. if (is_data_table_default(node)) {
  18190. var tableArray = to_grid_default(node);
  18191. return tableArray.length >= 3 && tableArray[0].length >= 3 && tableArray[1].length >= 3 && tableArray[2].length >= 3;
  18192. }
  18193. return false;
  18194. }
  18195. var data_table_large_matches_default = dataTableLargeMatches;
  18196. function dataTableMatches(node) {
  18197. return is_data_table_default(node);
  18198. }
  18199. var data_table_matches_default = dataTableMatches;
  18200. function duplicateIdActiveMatches(node) {
  18201. var id = node.getAttribute('id').trim();
  18202. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  18203. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  18204. return !is_accessible_ref_default(node) && idMatchingElms.some(is_focusable_default);
  18205. }
  18206. var duplicate_id_active_matches_default = duplicateIdActiveMatches;
  18207. function duplicateIdAriaMatches(node) {
  18208. return is_accessible_ref_default(node);
  18209. }
  18210. var duplicate_id_aria_matches_default = duplicateIdAriaMatches;
  18211. function duplicateIdMiscMatches(node) {
  18212. var id = node.getAttribute('id').trim();
  18213. var idSelector = '*[id="'.concat(escape_selector_default(id), '"]');
  18214. var idMatchingElms = Array.from(get_root_node_default2(node).querySelectorAll(idSelector));
  18215. return !is_accessible_ref_default(node) && idMatchingElms.every(function(elm) {
  18216. return !is_focusable_default(elm);
  18217. });
  18218. }
  18219. var duplicate_id_misc_matches_default = duplicateIdMiscMatches;
  18220. function frameTitleHasTextMatches(node) {
  18221. var title = node.getAttribute('title');
  18222. return !!sanitize_default(title);
  18223. }
  18224. var frame_title_has_text_matches_default = frameTitleHasTextMatches;
  18225. function headingMatches(node) {
  18226. var explicitRoles;
  18227. if (node.hasAttribute('role')) {
  18228. explicitRoles = node.getAttribute('role').split(/\s+/i).filter(axe.commons.aria.isValidRole);
  18229. }
  18230. if (explicitRoles && explicitRoles.length > 0) {
  18231. return explicitRoles.includes('heading');
  18232. } else {
  18233. return axe.commons.aria.implicitRole(node) === 'heading';
  18234. }
  18235. }
  18236. var heading_matches_default = headingMatches;
  18237. function svgNamespaceMatches(node, virtualNode) {
  18238. try {
  18239. var nodeName2 = virtualNode.props.nodeName;
  18240. if (nodeName2 === 'svg') {
  18241. return true;
  18242. }
  18243. return !!closest_default(virtualNode, 'svg');
  18244. } catch (e) {
  18245. return false;
  18246. }
  18247. }
  18248. var svg_namespace_matches_default = svgNamespaceMatches;
  18249. function htmlNamespaceMatches(node, virtualNode) {
  18250. return !svg_namespace_matches_default(node, virtualNode);
  18251. }
  18252. var html_namespace_matches_default = htmlNamespaceMatches;
  18253. function identicalLinksSamePurposeMatches(node, virtualNode) {
  18254. var hasAccName = !!accessible_text_virtual_default(virtualNode);
  18255. if (!hasAccName) {
  18256. return false;
  18257. }
  18258. var role = get_role_default(node);
  18259. if (role && role !== 'link') {
  18260. return false;
  18261. }
  18262. return true;
  18263. }
  18264. var identical_links_same_purpose_matches_default = identicalLinksSamePurposeMatches;
  18265. function insertedIntoFocusOrderMatches(node) {
  18266. return inserted_into_focus_order_default(node);
  18267. }
  18268. var inserted_into_focus_order_matches_default = insertedIntoFocusOrderMatches;
  18269. function labelContentNameMismatchMatches(node, virtualNode) {
  18270. var role = get_role_default(node);
  18271. if (!role) {
  18272. return false;
  18273. }
  18274. var widgetRoles = get_aria_roles_by_type_default('widget');
  18275. var isWidgetType = widgetRoles.includes(role);
  18276. if (!isWidgetType) {
  18277. return false;
  18278. }
  18279. var rolesWithNameFromContents = get_aria_roles_supporting_name_from_content_default();
  18280. if (!rolesWithNameFromContents.includes(role)) {
  18281. return false;
  18282. }
  18283. if (!sanitize_default(arialabel_text_default(virtualNode)) && !sanitize_default(arialabelledby_text_default(node))) {
  18284. return false;
  18285. }
  18286. if (!sanitize_default(visible_virtual_default(virtualNode))) {
  18287. return false;
  18288. }
  18289. return true;
  18290. }
  18291. var label_content_name_mismatch_matches_default = labelContentNameMismatchMatches;
  18292. function labelMatches(node, virtualNode) {
  18293. if (virtualNode.props.nodeName !== 'input' || virtualNode.hasAttr('type') === false) {
  18294. return true;
  18295. }
  18296. var type = virtualNode.attr('type').toLowerCase();
  18297. return [ 'hidden', 'image', 'button', 'submit', 'reset' ].includes(type) === false;
  18298. }
  18299. var label_matches_default = labelMatches;
  18300. function landmarkHasBodyContextMatches(node, virtualNode) {
  18301. var nativeScopeFilter = 'article, aside, main, nav, section';
  18302. return node.hasAttribute('role') || !find_up_virtual_default(virtualNode, nativeScopeFilter);
  18303. }
  18304. var landmark_has_body_context_matches_default = landmarkHasBodyContextMatches;
  18305. function landmarkUniqueMatches(node, virtualNode) {
  18306. var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(',');
  18307. function isHeaderFooterLandmark(headerFooterElement) {
  18308. return !find_up_virtual_default(headerFooterElement, excludedParentsForHeaderFooterLandmarks);
  18309. }
  18310. function isLandmarkVirtual(virtualNode2) {
  18311. var actualNode = virtualNode2.actualNode;
  18312. var landmarkRoles2 = get_aria_roles_by_type_default('landmark');
  18313. var role = get_role_default(actualNode);
  18314. if (!role) {
  18315. return false;
  18316. }
  18317. var nodeName2 = actualNode.nodeName.toUpperCase();
  18318. if (nodeName2 === 'HEADER' || nodeName2 === 'FOOTER') {
  18319. return isHeaderFooterLandmark(virtualNode2);
  18320. }
  18321. if (nodeName2 === 'SECTION' || nodeName2 === 'FORM') {
  18322. var accessibleText2 = accessible_text_virtual_default(virtualNode2);
  18323. return !!accessibleText2;
  18324. }
  18325. return landmarkRoles2.indexOf(role) >= 0 || role === 'region';
  18326. }
  18327. return isLandmarkVirtual(virtualNode) && is_visible_default(node, true);
  18328. }
  18329. var landmark_unique_matches_default = landmarkUniqueMatches;
  18330. function dataTableMatches2(node) {
  18331. return !is_data_table_default(node) && !is_focusable_default(node);
  18332. }
  18333. var layout_table_matches_default = dataTableMatches2;
  18334. function linkInTextBlockMatches(node) {
  18335. var text31 = sanitize_default(node.textContent);
  18336. var role = node.getAttribute('role');
  18337. if (role && role !== 'link') {
  18338. return false;
  18339. }
  18340. if (!text31) {
  18341. return false;
  18342. }
  18343. if (!is_visible_default(node, false)) {
  18344. return false;
  18345. }
  18346. return is_in_text_block_default(node);
  18347. }
  18348. var link_in_text_block_matches_default = linkInTextBlockMatches;
  18349. function noAutoplayAudioMatches(node) {
  18350. if (!node.currentSrc) {
  18351. return false;
  18352. }
  18353. if (node.hasAttribute('paused') || node.hasAttribute('muted')) {
  18354. return false;
  18355. }
  18356. return true;
  18357. }
  18358. var no_autoplay_audio_matches_default = noAutoplayAudioMatches;
  18359. function noEmptyRoleMatches(node, virtualNode) {
  18360. if (!virtualNode.hasAttr('role')) {
  18361. return false;
  18362. }
  18363. if (!virtualNode.attr('role').trim()) {
  18364. return false;
  18365. }
  18366. return true;
  18367. }
  18368. var no_empty_role_matches_default = noEmptyRoleMatches;
  18369. function noExplicitNameRequired(node, virtualNode) {
  18370. var role = get_explicit_role_default(virtualNode);
  18371. if (!role || [ 'none', 'presentation' ].includes(role)) {
  18372. return true;
  18373. }
  18374. var _ref72 = aria_roles_default[role] || {}, accessibleNameRequired = _ref72.accessibleNameRequired;
  18375. if (accessibleNameRequired || is_focusable_default(virtualNode)) {
  18376. return true;
  18377. }
  18378. return false;
  18379. }
  18380. var no_explicit_name_required_matches_default = noExplicitNameRequired;
  18381. function noNamingMethodMatches(node, virtualNode) {
  18382. var _get_element_spec_def = get_element_spec_default(virtualNode), namingMethods = _get_element_spec_def.namingMethods;
  18383. if (namingMethods && namingMethods.length !== 0) {
  18384. return false;
  18385. }
  18386. if (get_explicit_role_default(virtualNode) === 'combobox' && query_selector_all_default(virtualNode, 'input:not([type="hidden"])').length) {
  18387. return false;
  18388. }
  18389. return true;
  18390. }
  18391. var no_naming_method_matches_default = noNamingMethodMatches;
  18392. function noRoleMatches(node) {
  18393. return !node.getAttribute('role');
  18394. }
  18395. var no_role_matches_default = noRoleMatches;
  18396. function notHtmlMatches(node) {
  18397. return node.nodeName.toLowerCase() !== 'html';
  18398. }
  18399. var not_html_matches_default = notHtmlMatches;
  18400. function pAsHeadingMatches(node) {
  18401. var children = Array.from(node.parentNode.childNodes);
  18402. var nodeText = node.textContent.trim();
  18403. var isSentence = /[.!?:;](?![.!?:;])/g;
  18404. if (nodeText.length === 0 || (nodeText.match(isSentence) || []).length >= 2) {
  18405. return false;
  18406. }
  18407. var siblingsAfter = children.slice(children.indexOf(node) + 1).filter(function(elm) {
  18408. return elm.nodeName.toUpperCase() === 'P' && elm.textContent.trim() !== '';
  18409. });
  18410. return siblingsAfter.length !== 0;
  18411. }
  18412. var p_as_heading_matches_default = pAsHeadingMatches;
  18413. function scrollableRegionFocusableMatches(node, virtualNode) {
  18414. if (!!get_scroll_default(node, 13) === false) {
  18415. return false;
  18416. }
  18417. var role = get_explicit_role_default(virtualNode);
  18418. if (standards_default.ariaRoles.combobox.requiredOwned.includes(role)) {
  18419. if (closest_default(virtualNode, '[role~="combobox"]')) {
  18420. return false;
  18421. }
  18422. var id = virtualNode.attr('id');
  18423. if (id) {
  18424. var doc = get_root_node_default(node);
  18425. var owned = Array.from(doc.querySelectorAll('[aria-owns~="'.concat(id, '"], [aria-controls~="').concat(id, '"]')));
  18426. var comboboxOwned = owned.some(function(el) {
  18427. var roles = token_list_default(el.getAttribute('role'));
  18428. return roles.includes('combobox');
  18429. });
  18430. if (comboboxOwned) {
  18431. return false;
  18432. }
  18433. }
  18434. }
  18435. var nodeAndDescendents = query_selector_all_default(virtualNode, '*');
  18436. var hasVisibleChildren = nodeAndDescendents.some(function(elm) {
  18437. return has_content_virtual_default(elm, true, true);
  18438. });
  18439. if (!hasVisibleChildren) {
  18440. return false;
  18441. }
  18442. return true;
  18443. }
  18444. var scrollable_region_focusable_matches_default = scrollableRegionFocusableMatches;
  18445. function skipLinkMatches(node) {
  18446. return is_skip_link_default(node) && is_offscreen_default(node);
  18447. }
  18448. var skip_link_matches_default = skipLinkMatches;
  18449. function windowIsTopMatches(node) {
  18450. return node.ownerDocument.defaultView.self === node.ownerDocument.defaultView.top;
  18451. }
  18452. var window_is_top_matches_default = windowIsTopMatches;
  18453. function xmlLangMismatchMatches(node) {
  18454. var primaryLangValue = get_base_lang_default(node.getAttribute('lang'));
  18455. var primaryXmlLangValue = get_base_lang_default(node.getAttribute('xml:lang'));
  18456. return valid_langs_default(primaryLangValue) && valid_langs_default(primaryXmlLangValue);
  18457. }
  18458. var xml_lang_mismatch_matches_default = xmlLangMismatchMatches;
  18459. var metadataFunctionMap = {
  18460. 'abstractrole-evaluate': abstractrole_evaluate_default,
  18461. 'aria-allowed-attr-evaluate': aria_allowed_attr_evaluate_default,
  18462. 'aria-allowed-role-evaluate': aria_allowed_role_evaluate_default,
  18463. 'aria-errormessage-evaluate': aria_errormessage_evaluate_default,
  18464. 'aria-hidden-body-evaluate': aria_hidden_body_evaluate_default,
  18465. 'aria-required-attr-evaluate': aria_required_attr_evaluate_default,
  18466. 'aria-required-children-evaluate': aria_required_children_evaluate_default,
  18467. 'aria-required-parent-evaluate': aria_required_parent_evaluate_default,
  18468. 'aria-roledescription-evaluate': aria_roledescription_evaluate_default,
  18469. 'aria-unsupported-attr-evaluate': aria_unsupported_attr_evaluate_default,
  18470. 'aria-valid-attr-evaluate': aria_valid_attr_evaluate_default,
  18471. 'aria-valid-attr-value-evaluate': aria_valid_attr_value_evaluate_default,
  18472. 'fallbackrole-evaluate': fallbackrole_evaluate_default,
  18473. 'has-global-aria-attribute-evaluate': has_global_aria_attribute_evaluate_default,
  18474. 'has-widget-role-evaluate': has_widget_role_evaluate_default,
  18475. 'invalidrole-evaluate': invalidrole_evaluate_default,
  18476. 'is-element-focusable-evaluate': is_element_focusable_evaluate_default,
  18477. 'no-implicit-explicit-label-evaluate': no_implicit_explicit_label_evaluate_default,
  18478. 'unsupportedrole-evaluate': unsupportedrole_evaluate_default,
  18479. 'valid-scrollable-semantics-evaluate': valid_scrollable_semantics_evaluate_default,
  18480. 'caption-faked-evaluate': caption_faked_evaluate_default,
  18481. 'html5-scope-evaluate': html5_scope_evaluate_default,
  18482. 'same-caption-summary-evaluate': same_caption_summary_evaluate_default,
  18483. 'scope-value-evaluate': scope_value_evaluate_default,
  18484. 'td-has-header-evaluate': td_has_header_evaluate_default,
  18485. 'td-headers-attr-evaluate': td_headers_attr_evaluate_default,
  18486. 'th-has-data-cells-evaluate': th_has_data_cells_evaluate_default,
  18487. 'hidden-content-evaluate': hidden_content_evaluate_default,
  18488. 'color-contrast-evaluate': color_contrast_evaluate_default,
  18489. 'link-in-text-block-evaluate': link_in_text_block_evaluate_default,
  18490. 'autocomplete-appropriate-evaluate': autocomplete_appropriate_evaluate_default,
  18491. 'autocomplete-valid-evaluate': autocomplete_valid_evaluate_default,
  18492. 'attr-non-space-content-evaluate': attr_non_space_content_evaluate_default,
  18493. 'has-descendant-after': has_descendant_after_default,
  18494. 'has-descendant-evaluate': has_descendant_evaluate_default,
  18495. 'has-text-content-evaluate': has_text_content_evaluate_default,
  18496. 'matches-definition-evaluate': matches_definition_evaluate_default,
  18497. 'page-no-duplicate-after': page_no_duplicate_after_default,
  18498. 'page-no-duplicate-evaluate': page_no_duplicate_evaluate_default,
  18499. 'heading-order-after': heading_order_after_default,
  18500. 'heading-order-evaluate': heading_order_evaluate_default,
  18501. 'identical-links-same-purpose-after': identical_links_same_purpose_after_default,
  18502. 'identical-links-same-purpose-evaluate': identical_links_same_purpose_evaluate_default,
  18503. 'internal-link-present-evaluate': internal_link_present_evaluate_default,
  18504. 'meta-refresh-evaluate': meta_refresh_evaluate_default,
  18505. 'p-as-heading-evaluate': p_as_heading_evaluate_default,
  18506. 'region-evaluate': region_evaluate_default,
  18507. 'skip-link-evaluate': skip_link_evaluate_default,
  18508. 'unique-frame-title-after': unique_frame_title_after_default,
  18509. 'unique-frame-title-evaluate': unique_frame_title_evaluate_default,
  18510. 'aria-label-evaluate': aria_label_evaluate_default,
  18511. 'aria-labelledby-evaluate': aria_labelledby_evaluate_default,
  18512. 'avoid-inline-spacing-evaluate': avoid_inline_spacing_evaluate_default,
  18513. 'doc-has-title-evaluate': doc_has_title_evaluate_default,
  18514. 'exists-evaluate': exists_evaluate_default,
  18515. 'has-alt-evaluate': has_alt_evaluate_default,
  18516. 'is-on-screen-evaluate': is_on_screen_evaluate_default,
  18517. 'non-empty-if-present-evaluate': non_empty_if_present_evaluate_default,
  18518. 'presentational-role-evaluate': presentational_role_evaluate_default,
  18519. 'svg-non-empty-title-evaluate': svg_non_empty_title_evaluate_default,
  18520. 'css-orientation-lock-evaluate': css_orientation_lock_evaluate_default,
  18521. 'meta-viewport-scale-evaluate': meta_viewport_scale_evaluate_default,
  18522. 'duplicate-id-after': duplicate_id_after_default,
  18523. 'duplicate-id-evaluate': duplicate_id_evaluate_default,
  18524. 'accesskeys-after': accesskeys_after_default,
  18525. 'accesskeys-evaluate': accesskeys_evaluate_default,
  18526. 'focusable-content-evaluate': focusable_content_evaluate_default,
  18527. 'focusable-disabled-evaluate': focusable_disabled_evaluate_default,
  18528. 'focusable-element-evaluate': focusable_element_evaluate_default,
  18529. 'focusable-modal-open-evaluate': focusable_modal_open_evaluate_default,
  18530. 'focusable-no-name-evaluate': focusable_no_name_evaluate_default,
  18531. 'focusable-not-tabbable-evaluate': focusable_not_tabbable_evaluate_default,
  18532. 'landmark-is-top-level-evaluate': landmark_is_top_level_evaluate_default,
  18533. 'tabindex-evaluate': tabindex_evaluate_default,
  18534. 'alt-space-value-evaluate': alt_space_value_evaluate_default,
  18535. 'duplicate-img-label-evaluate': duplicate_img_label_evaluate_default,
  18536. 'explicit-evaluate': explicit_evaluate_default,
  18537. 'help-same-as-label-evaluate': help_same_as_label_evaluate_default,
  18538. 'hidden-explicit-label-evaluate': hidden_explicit_label_evaluate_default,
  18539. 'implicit-evaluate': implicit_evaluate_default,
  18540. 'label-content-name-mismatch-evaluate': label_content_name_mismatch_evaluate_default,
  18541. 'multiple-label-evaluate': multiple_label_evaluate_default,
  18542. 'title-only-evaluate': title_only_evaluate_default,
  18543. 'landmark-is-unique-after': landmark_is_unique_after_default,
  18544. 'landmark-is-unique-evaluate': landmark_is_unique_evaluate_default,
  18545. 'has-lang-evaluate': has_lang_evaluate_default,
  18546. 'valid-lang-evaluate': valid_lang_evaluate_default,
  18547. 'xml-lang-mismatch-evaluate': xml_lang_mismatch_evaluate_default,
  18548. 'dlitem-evaluate': dlitem_evaluate_default,
  18549. 'listitem-evaluate': listitem_evaluate_default,
  18550. 'only-dlitems-evaluate': only_dlitems_evaluate_default,
  18551. 'only-listitems-evaluate': only_listitems_evaluate_default,
  18552. 'structured-dlitems-evaluate': structured_dlitems_evaluate_default,
  18553. 'caption-evaluate': caption_evaluate_default,
  18554. 'frame-tested-evaluate': frame_tested_evaluate_default,
  18555. 'no-autoplay-audio-evaluate': no_autoplay_audio_evaluate_default,
  18556. 'aria-allowed-attr-matches': aria_allowed_attr_matches_default,
  18557. 'aria-allowed-role-matches': aria_allowed_role_matches_default,
  18558. 'aria-form-field-name-matches': no_naming_method_matches_default,
  18559. 'aria-has-attr-matches': aria_has_attr_matches_default,
  18560. 'aria-hidden-focus-matches': aria_hidden_focus_matches_default,
  18561. 'autocomplete-matches': autocomplete_matches_default,
  18562. 'bypass-matches': bypass_matches_default,
  18563. 'color-contrast-matches': color_contrast_matches_default,
  18564. 'data-table-large-matches': data_table_large_matches_default,
  18565. 'data-table-matches': data_table_matches_default,
  18566. 'duplicate-id-active-matches': duplicate_id_active_matches_default,
  18567. 'duplicate-id-aria-matches': duplicate_id_aria_matches_default,
  18568. 'duplicate-id-misc-matches': duplicate_id_misc_matches_default,
  18569. 'frame-title-has-text-matches': frame_title_has_text_matches_default,
  18570. 'heading-matches': heading_matches_default,
  18571. 'html-namespace-matches': html_namespace_matches_default,
  18572. 'identical-links-same-purpose-matches': identical_links_same_purpose_matches_default,
  18573. 'inserted-into-focus-order-matches': inserted_into_focus_order_matches_default,
  18574. 'is-initiator-matches': is_initiator_matches_default,
  18575. 'label-content-name-mismatch-matches': label_content_name_mismatch_matches_default,
  18576. 'label-matches': label_matches_default,
  18577. 'landmark-has-body-context-matches': landmark_has_body_context_matches_default,
  18578. 'landmark-unique-matches': landmark_unique_matches_default,
  18579. 'layout-table-matches': layout_table_matches_default,
  18580. 'link-in-text-block-matches': link_in_text_block_matches_default,
  18581. 'no-autoplay-audio-matches': no_autoplay_audio_matches_default,
  18582. 'no-empty-role-matches': no_empty_role_matches_default,
  18583. 'no-explicit-name-required-matches': no_explicit_name_required_matches_default,
  18584. 'no-naming-method-matches': no_naming_method_matches_default,
  18585. 'no-role-matches': no_role_matches_default,
  18586. 'not-html-matches': not_html_matches_default,
  18587. 'p-as-heading-matches': p_as_heading_matches_default,
  18588. 'scrollable-region-focusable-matches': scrollable_region_focusable_matches_default,
  18589. 'skip-link-matches': skip_link_matches_default,
  18590. 'svg-namespace-matches': svg_namespace_matches_default,
  18591. 'window-is-top-matches': window_is_top_matches_default,
  18592. 'xml-lang-mismatch-matches': xml_lang_mismatch_matches_default
  18593. };
  18594. var metadata_function_map_default = metadataFunctionMap;
  18595. function CheckResult(check4) {
  18596. this.id = check4.id;
  18597. this.data = null;
  18598. this.relatedNodes = [];
  18599. this.result = null;
  18600. }
  18601. var check_result_default = CheckResult;
  18602. function createExecutionContext(spec) {
  18603. if (typeof spec === 'string') {
  18604. if (metadata_function_map_default[spec]) {
  18605. return metadata_function_map_default[spec];
  18606. }
  18607. if (/^\s*function[\s\w]*\(/.test(spec)) {
  18608. return new Function('return ' + spec + ';')();
  18609. }
  18610. throw new ReferenceError('Function ID does not exist in the metadata-function-map: '.concat(spec));
  18611. }
  18612. return spec;
  18613. }
  18614. function normalizeOptions() {
  18615. var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  18616. if (Array.isArray(options) || _typeof(options) !== 'object') {
  18617. options = {
  18618. value: options
  18619. };
  18620. }
  18621. return options;
  18622. }
  18623. function Check(spec) {
  18624. if (spec) {
  18625. this.id = spec.id;
  18626. this.configure(spec);
  18627. }
  18628. }
  18629. Check.prototype.enabled = true;
  18630. Check.prototype.run = function(node, options, context3, resolve, reject) {
  18631. options = options || {};
  18632. var enabled = options.hasOwnProperty('enabled') ? options.enabled : this.enabled;
  18633. var checkOptions = this.getOptions(options.options);
  18634. if (enabled) {
  18635. var checkResult = new check_result_default(this);
  18636. var helper = check_helper_default(checkResult, options, resolve, reject);
  18637. var result;
  18638. try {
  18639. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context3);
  18640. } catch (e) {
  18641. if (node && node.actualNode) {
  18642. e.errorNode = new dq_element_default(node.actualNode).toJSON();
  18643. }
  18644. reject(e);
  18645. return;
  18646. }
  18647. if (!helper.isAsync) {
  18648. checkResult.result = result;
  18649. resolve(checkResult);
  18650. }
  18651. } else {
  18652. resolve(null);
  18653. }
  18654. };
  18655. Check.prototype.runSync = function(node, options, context3) {
  18656. options = options || {};
  18657. var _options = options, _options$enabled = _options.enabled, enabled = _options$enabled === void 0 ? this.enabled : _options$enabled;
  18658. if (!enabled) {
  18659. return null;
  18660. }
  18661. var checkOptions = this.getOptions(options.options);
  18662. var checkResult = new check_result_default(this);
  18663. var helper = check_helper_default(checkResult, options);
  18664. helper.async = function() {
  18665. throw new Error('Cannot run async check while in a synchronous run');
  18666. };
  18667. var result;
  18668. try {
  18669. result = this.evaluate.call(helper, node.actualNode, checkOptions, node, context3);
  18670. } catch (e) {
  18671. if (node && node.actualNode) {
  18672. e.errorNode = new dq_element_default(node.actualNode).toJSON();
  18673. }
  18674. throw e;
  18675. }
  18676. checkResult.result = result;
  18677. return checkResult;
  18678. };
  18679. Check.prototype.configure = function(spec) {
  18680. var _this3 = this;
  18681. if (!spec.evaluate || metadata_function_map_default[spec.evaluate]) {
  18682. this._internalCheck = true;
  18683. }
  18684. if (spec.hasOwnProperty('enabled')) {
  18685. this.enabled = spec.enabled;
  18686. }
  18687. if (spec.hasOwnProperty('options')) {
  18688. if (this._internalCheck) {
  18689. this.options = normalizeOptions(spec.options);
  18690. } else {
  18691. this.options = spec.options;
  18692. }
  18693. }
  18694. [ 'evaluate', 'after' ].filter(function(prop) {
  18695. return spec.hasOwnProperty(prop);
  18696. }).forEach(function(prop) {
  18697. return _this3[prop] = createExecutionContext(spec[prop]);
  18698. });
  18699. };
  18700. Check.prototype.getOptions = function getOptions(options) {
  18701. if (this._internalCheck) {
  18702. return deep_merge_default(this.options, normalizeOptions(options || {}));
  18703. } else {
  18704. return options || this.options;
  18705. }
  18706. };
  18707. var check_default = Check;
  18708. function RuleResult(rule3) {
  18709. this.id = rule3.id;
  18710. this.result = constants_default.NA;
  18711. this.pageLevel = rule3.pageLevel;
  18712. this.impact = null;
  18713. this.nodes = [];
  18714. }
  18715. var rule_result_default = RuleResult;
  18716. function Rule(spec, parentAudit) {
  18717. this._audit = parentAudit;
  18718. this.id = spec.id;
  18719. this.selector = spec.selector || '*';
  18720. if (spec.impact) {
  18721. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  18722. this.impact = spec.impact;
  18723. }
  18724. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  18725. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  18726. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  18727. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  18728. this.any = spec.any || [];
  18729. this.all = spec.all || [];
  18730. this.none = spec.none || [];
  18731. this.tags = spec.tags || [];
  18732. this.preload = spec.preload ? true : false;
  18733. if (spec.matches) {
  18734. this.matches = createExecutionContext(spec.matches);
  18735. }
  18736. }
  18737. Rule.prototype.matches = function() {
  18738. return true;
  18739. };
  18740. Rule.prototype.gather = function(context3) {
  18741. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18742. var markStart = 'mark_gather_start_' + this.id;
  18743. var markEnd = 'mark_gather_end_' + this.id;
  18744. var markHiddenStart = 'mark_isHidden_start_' + this.id;
  18745. var markHiddenEnd = 'mark_isHidden_end_' + this.id;
  18746. if (options.performanceTimer) {
  18747. performance_timer_default.mark(markStart);
  18748. }
  18749. var elements = select_default(this.selector, context3);
  18750. if (this.excludeHidden) {
  18751. if (options.performanceTimer) {
  18752. performance_timer_default.mark(markHiddenStart);
  18753. }
  18754. elements = elements.filter(function(element) {
  18755. return !is_hidden_default(element.actualNode);
  18756. });
  18757. if (options.performanceTimer) {
  18758. performance_timer_default.mark(markHiddenEnd);
  18759. performance_timer_default.measure('rule_' + this.id + '#gather_axe.utils.isHidden', markHiddenStart, markHiddenEnd);
  18760. }
  18761. }
  18762. if (options.performanceTimer) {
  18763. performance_timer_default.mark(markEnd);
  18764. performance_timer_default.measure('rule_' + this.id + '#gather', markStart, markEnd);
  18765. }
  18766. return elements;
  18767. };
  18768. Rule.prototype.runChecks = function(type, node, options, context3, resolve, reject) {
  18769. var self2 = this;
  18770. var checkQueue = queue_default();
  18771. this[type].forEach(function(c) {
  18772. var check4 = self2._audit.checks[c.id || c];
  18773. var option = get_check_option_default(check4, self2.id, options);
  18774. checkQueue.defer(function(res, rej) {
  18775. check4.run(node, option, context3, res, rej);
  18776. });
  18777. });
  18778. checkQueue.then(function(results) {
  18779. results = results.filter(function(check4) {
  18780. return check4;
  18781. });
  18782. resolve({
  18783. type: type,
  18784. results: results
  18785. });
  18786. })['catch'](reject);
  18787. };
  18788. Rule.prototype.runChecksSync = function(type, node, options, context3) {
  18789. var self2 = this;
  18790. var results = [];
  18791. this[type].forEach(function(c) {
  18792. var check4 = self2._audit.checks[c.id || c];
  18793. var option = get_check_option_default(check4, self2.id, options);
  18794. results.push(check4.runSync(node, option, context3));
  18795. });
  18796. results = results.filter(function(check4) {
  18797. return check4;
  18798. });
  18799. return {
  18800. type: type,
  18801. results: results
  18802. };
  18803. };
  18804. Rule.prototype.run = function(context3) {
  18805. var _this4 = this;
  18806. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18807. var resolve = arguments.length > 2 ? arguments[2] : undefined;
  18808. var reject = arguments.length > 3 ? arguments[3] : undefined;
  18809. if (options.performanceTimer) {
  18810. this._trackPerformance();
  18811. }
  18812. var q = queue_default();
  18813. var ruleResult = new rule_result_default(this);
  18814. var nodes;
  18815. try {
  18816. nodes = this.gatherAndMatchNodes(context3, options);
  18817. } catch (error) {
  18818. reject(new SupportError({
  18819. cause: error,
  18820. ruleId: this.id
  18821. }));
  18822. return;
  18823. }
  18824. if (options.performanceTimer) {
  18825. this._logGatherPerformance(nodes);
  18826. }
  18827. nodes.forEach(function(node) {
  18828. q.defer(function(resolveNode, rejectNode) {
  18829. var checkQueue = queue_default();
  18830. [ 'any', 'all', 'none' ].forEach(function(type) {
  18831. checkQueue.defer(function(res, rej) {
  18832. _this4.runChecks(type, node, options, context3, res, rej);
  18833. });
  18834. });
  18835. checkQueue.then(function(results) {
  18836. var result = getResult(results);
  18837. if (result) {
  18838. result.node = new dq_element_default(node.actualNode, options);
  18839. ruleResult.nodes.push(result);
  18840. if (_this4.reviewOnFail) {
  18841. [ 'any', 'all' ].forEach(function(type) {
  18842. result[type].forEach(function(checkResult) {
  18843. if (checkResult.result === false) {
  18844. checkResult.result = void 0;
  18845. }
  18846. });
  18847. });
  18848. result.none.forEach(function(checkResult) {
  18849. if (checkResult.result === true) {
  18850. checkResult.result = void 0;
  18851. }
  18852. });
  18853. }
  18854. }
  18855. resolveNode();
  18856. })['catch'](function(err2) {
  18857. return rejectNode(err2);
  18858. });
  18859. });
  18860. });
  18861. q.defer(function(resolve2) {
  18862. return setTimeout(resolve2, 0);
  18863. });
  18864. if (options.performanceTimer) {
  18865. this._logRulePerformance();
  18866. }
  18867. q.then(function() {
  18868. return resolve(ruleResult);
  18869. })['catch'](function(error) {
  18870. return reject(error);
  18871. });
  18872. };
  18873. Rule.prototype.runSync = function(context3) {
  18874. var _this5 = this;
  18875. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  18876. if (options.performanceTimer) {
  18877. this._trackPerformance();
  18878. }
  18879. var ruleResult = new rule_result_default(this);
  18880. var nodes;
  18881. try {
  18882. nodes = this.gatherAndMatchNodes(context3, options);
  18883. } catch (error) {
  18884. throw new SupportError({
  18885. cause: error,
  18886. ruleId: this.id
  18887. });
  18888. }
  18889. if (options.performanceTimer) {
  18890. this._logGatherPerformance(nodes);
  18891. }
  18892. nodes.forEach(function(node) {
  18893. var results = [];
  18894. [ 'any', 'all', 'none' ].forEach(function(type) {
  18895. results.push(_this5.runChecksSync(type, node, options, context3));
  18896. });
  18897. var result = getResult(results);
  18898. if (result) {
  18899. result.node = node.actualNode ? new dq_element_default(node.actualNode, options) : null;
  18900. ruleResult.nodes.push(result);
  18901. if (_this5.reviewOnFail) {
  18902. [ 'any', 'all' ].forEach(function(type) {
  18903. result[type].forEach(function(checkResult) {
  18904. if (checkResult.result === false) {
  18905. checkResult.result = void 0;
  18906. }
  18907. });
  18908. });
  18909. result.none.forEach(function(checkResult) {
  18910. if (checkResult.result === true) {
  18911. checkResult.result = void 0;
  18912. }
  18913. });
  18914. }
  18915. }
  18916. });
  18917. if (options.performanceTimer) {
  18918. this._logRulePerformance();
  18919. }
  18920. return ruleResult;
  18921. };
  18922. Rule.prototype._trackPerformance = function() {
  18923. this._markStart = 'mark_rule_start_' + this.id;
  18924. this._markEnd = 'mark_rule_end_' + this.id;
  18925. this._markChecksStart = 'mark_runchecks_start_' + this.id;
  18926. this._markChecksEnd = 'mark_runchecks_end_' + this.id;
  18927. };
  18928. Rule.prototype._logGatherPerformance = function(nodes) {
  18929. log_default('gather (', nodes.length, '):', performance_timer_default.timeElapsed() + 'ms');
  18930. performance_timer_default.mark(this._markChecksStart);
  18931. };
  18932. Rule.prototype._logRulePerformance = function() {
  18933. performance_timer_default.mark(this._markChecksEnd);
  18934. performance_timer_default.mark(this._markEnd);
  18935. performance_timer_default.measure('runchecks_' + this.id, this._markChecksStart, this._markChecksEnd);
  18936. performance_timer_default.measure('rule_' + this.id, this._markStart, this._markEnd);
  18937. };
  18938. function getResult(results) {
  18939. if (results.length) {
  18940. var hasResults = false, result = {};
  18941. results.forEach(function(r) {
  18942. var res = r.results.filter(function(result2) {
  18943. return result2;
  18944. });
  18945. result[r.type] = res;
  18946. if (res.length) {
  18947. hasResults = true;
  18948. }
  18949. });
  18950. if (hasResults) {
  18951. return result;
  18952. }
  18953. return null;
  18954. }
  18955. }
  18956. Rule.prototype.gatherAndMatchNodes = function(context3, options) {
  18957. var _this6 = this;
  18958. var markMatchesStart = 'mark_matches_start_' + this.id;
  18959. var markMatchesEnd = 'mark_matches_end_' + this.id;
  18960. var nodes = this.gather(context3, options);
  18961. if (options.performanceTimer) {
  18962. performance_timer_default.mark(markMatchesStart);
  18963. }
  18964. nodes = nodes.filter(function(node) {
  18965. return _this6.matches(node.actualNode, node, context3);
  18966. });
  18967. if (options.performanceTimer) {
  18968. performance_timer_default.mark(markMatchesEnd);
  18969. performance_timer_default.measure('rule_' + this.id + '#matches', markMatchesStart, markMatchesEnd);
  18970. }
  18971. return nodes;
  18972. };
  18973. function findAfterChecks(rule3) {
  18974. return get_all_checks_default(rule3).map(function(c) {
  18975. var check4 = rule3._audit.checks[c.id || c];
  18976. return check4 && typeof check4.after === 'function' ? check4 : null;
  18977. }).filter(Boolean);
  18978. }
  18979. function findCheckResults(nodes, checkID) {
  18980. var checkResults = [];
  18981. nodes.forEach(function(nodeResult) {
  18982. var checks = get_all_checks_default(nodeResult);
  18983. checks.forEach(function(checkResult) {
  18984. if (checkResult.id === checkID) {
  18985. checkResult.node = nodeResult.node;
  18986. checkResults.push(checkResult);
  18987. }
  18988. });
  18989. });
  18990. return checkResults;
  18991. }
  18992. function filterChecks(checks) {
  18993. return checks.filter(function(check4) {
  18994. return check4.filtered !== true;
  18995. });
  18996. }
  18997. function sanitizeNodes(result) {
  18998. var checkTypes2 = [ 'any', 'all', 'none' ];
  18999. var nodes = result.nodes.filter(function(detail) {
  19000. var length = 0;
  19001. checkTypes2.forEach(function(type) {
  19002. detail[type] = filterChecks(detail[type]);
  19003. length += detail[type].length;
  19004. });
  19005. return length > 0;
  19006. });
  19007. if (result.pageLevel && nodes.length) {
  19008. nodes = [ nodes.reduce(function(a, b) {
  19009. if (a) {
  19010. checkTypes2.forEach(function(type) {
  19011. a[type].push.apply(a[type], b[type]);
  19012. });
  19013. return a;
  19014. }
  19015. }) ];
  19016. }
  19017. return nodes;
  19018. }
  19019. Rule.prototype.after = function(result, options) {
  19020. var afterChecks = findAfterChecks(this);
  19021. var ruleID = this.id;
  19022. afterChecks.forEach(function(check4) {
  19023. var beforeResults = findCheckResults(result.nodes, check4.id);
  19024. var option = get_check_option_default(check4, ruleID, options);
  19025. var afterResults = check4.after(beforeResults, option);
  19026. beforeResults.forEach(function(item) {
  19027. delete item.node;
  19028. if (afterResults.indexOf(item) === -1) {
  19029. item.filtered = true;
  19030. }
  19031. });
  19032. });
  19033. result.nodes = sanitizeNodes(result);
  19034. return result;
  19035. };
  19036. Rule.prototype.configure = function(spec) {
  19037. if (spec.hasOwnProperty('selector')) {
  19038. this.selector = spec.selector;
  19039. }
  19040. if (spec.hasOwnProperty('excludeHidden')) {
  19041. this.excludeHidden = typeof spec.excludeHidden === 'boolean' ? spec.excludeHidden : true;
  19042. }
  19043. if (spec.hasOwnProperty('enabled')) {
  19044. this.enabled = typeof spec.enabled === 'boolean' ? spec.enabled : true;
  19045. }
  19046. if (spec.hasOwnProperty('pageLevel')) {
  19047. this.pageLevel = typeof spec.pageLevel === 'boolean' ? spec.pageLevel : false;
  19048. }
  19049. if (spec.hasOwnProperty('reviewOnFail')) {
  19050. this.reviewOnFail = typeof spec.reviewOnFail === 'boolean' ? spec.reviewOnFail : false;
  19051. }
  19052. if (spec.hasOwnProperty('any')) {
  19053. this.any = spec.any;
  19054. }
  19055. if (spec.hasOwnProperty('all')) {
  19056. this.all = spec.all;
  19057. }
  19058. if (spec.hasOwnProperty('none')) {
  19059. this.none = spec.none;
  19060. }
  19061. if (spec.hasOwnProperty('tags')) {
  19062. this.tags = spec.tags;
  19063. }
  19064. if (spec.hasOwnProperty('matches')) {
  19065. this.matches = createExecutionContext(spec.matches);
  19066. }
  19067. if (spec.impact) {
  19068. assert_default(constants_default.impact.includes(spec.impact), 'Impact '.concat(spec.impact, ' is not a valid impact'));
  19069. this.impact = spec.impact;
  19070. }
  19071. };
  19072. var rule_default = Rule;
  19073. var dot = __toModule(require_doT());
  19074. var dotRegex = /\{\{.+?\}\}/g;
  19075. function getDefaultConfiguration(audit3) {
  19076. var config;
  19077. if (audit3) {
  19078. config = clone_default(audit3);
  19079. config.commons = audit3.commons;
  19080. } else {
  19081. config = {};
  19082. }
  19083. config.reporter = config.reporter || null;
  19084. config.noHtml = config.noHtml || false;
  19085. config.rules = config.rules || [];
  19086. config.checks = config.checks || [];
  19087. config.data = _extends({
  19088. checks: {},
  19089. rules: {}
  19090. }, config.data);
  19091. return config;
  19092. }
  19093. function unpackToObject(collection, audit3, method) {
  19094. var i, l;
  19095. for (i = 0, l = collection.length; i < l; i++) {
  19096. audit3[method](collection[i]);
  19097. }
  19098. }
  19099. var mergeCheckLocale = function mergeCheckLocale(a, b) {
  19100. var pass = b.pass, fail = b.fail;
  19101. if (typeof pass === 'string' && dotRegex.test(pass)) {
  19102. pass = dot['default'].compile(pass);
  19103. }
  19104. if (typeof fail === 'string' && dotRegex.test(fail)) {
  19105. fail = dot['default'].compile(fail);
  19106. }
  19107. return _extends({}, a, {
  19108. messages: {
  19109. pass: pass || a.messages.pass,
  19110. fail: fail || a.messages.fail,
  19111. incomplete: _typeof(a.messages.incomplete) === 'object' ? _extends({}, a.messages.incomplete, b.incomplete) : b.incomplete
  19112. }
  19113. });
  19114. };
  19115. var mergeRuleLocale = function mergeRuleLocale(a, b) {
  19116. var help = b.help, description = b.description;
  19117. if (typeof help === 'string' && dotRegex.test(help)) {
  19118. help = dot['default'].compile(help);
  19119. }
  19120. if (typeof description === 'string' && dotRegex.test(description)) {
  19121. description = dot['default'].compile(description);
  19122. }
  19123. return _extends({}, a, {
  19124. help: help || a.help,
  19125. description: description || a.description
  19126. });
  19127. };
  19128. var mergeFailureMessage = function mergeFailureMessage(a, b) {
  19129. var failureMessage = b.failureMessage;
  19130. if (typeof failureMessage === 'string' && dotRegex.test(failureMessage)) {
  19131. failureMessage = dot['default'].compile(failureMessage);
  19132. }
  19133. return _extends({}, a, {
  19134. failureMessage: failureMessage || a.failureMessage
  19135. });
  19136. };
  19137. var mergeFallbackMessage = function mergeFallbackMessage(a, b) {
  19138. if (typeof b === 'string' && dotRegex.test(b)) {
  19139. b = dot['default'].compile(b);
  19140. }
  19141. return b || a;
  19142. };
  19143. var Audit = function() {
  19144. function Audit(audit3) {
  19145. _classCallCheck(this, Audit);
  19146. this.lang = 'en';
  19147. this.defaultConfig = audit3;
  19148. this.standards = standards_default;
  19149. this._init();
  19150. this._defaultLocale = null;
  19151. }
  19152. _createClass(Audit, [ {
  19153. key: '_setDefaultLocale',
  19154. value: function _setDefaultLocale() {
  19155. if (this._defaultLocale) {
  19156. return;
  19157. }
  19158. var locale = {
  19159. checks: {},
  19160. rules: {},
  19161. failureSummaries: {},
  19162. incompleteFallbackMessage: '',
  19163. lang: this.lang
  19164. };
  19165. var checkIDs = Object.keys(this.data.checks);
  19166. for (var _i21 = 0; _i21 < checkIDs.length; _i21++) {
  19167. var id = checkIDs[_i21];
  19168. var check4 = this.data.checks[id];
  19169. var _check4$messages = check4.messages, pass = _check4$messages.pass, fail = _check4$messages.fail, incomplete = _check4$messages.incomplete;
  19170. locale.checks[id] = {
  19171. pass: pass,
  19172. fail: fail,
  19173. incomplete: incomplete
  19174. };
  19175. }
  19176. var ruleIDs = Object.keys(this.data.rules);
  19177. for (var _i22 = 0; _i22 < ruleIDs.length; _i22++) {
  19178. var _id = ruleIDs[_i22];
  19179. var rule3 = this.data.rules[_id];
  19180. var description = rule3.description, help = rule3.help;
  19181. locale.rules[_id] = {
  19182. description: description,
  19183. help: help
  19184. };
  19185. }
  19186. var failureSummaries = Object.keys(this.data.failureSummaries);
  19187. for (var _i23 = 0; _i23 < failureSummaries.length; _i23++) {
  19188. var type = failureSummaries[_i23];
  19189. var failureSummary2 = this.data.failureSummaries[type];
  19190. var failureMessage = failureSummary2.failureMessage;
  19191. locale.failureSummaries[type] = {
  19192. failureMessage: failureMessage
  19193. };
  19194. }
  19195. locale.incompleteFallbackMessage = this.data.incompleteFallbackMessage;
  19196. this._defaultLocale = locale;
  19197. }
  19198. }, {
  19199. key: '_resetLocale',
  19200. value: function _resetLocale() {
  19201. var defaultLocale = this._defaultLocale;
  19202. if (!defaultLocale) {
  19203. return;
  19204. }
  19205. this.applyLocale(defaultLocale);
  19206. }
  19207. }, {
  19208. key: '_applyCheckLocale',
  19209. value: function _applyCheckLocale(checks) {
  19210. var keys = Object.keys(checks);
  19211. for (var _i24 = 0; _i24 < keys.length; _i24++) {
  19212. var id = keys[_i24];
  19213. if (!this.data.checks[id]) {
  19214. throw new Error('Locale provided for unknown check: "'.concat(id, '"'));
  19215. }
  19216. this.data.checks[id] = mergeCheckLocale(this.data.checks[id], checks[id]);
  19217. }
  19218. }
  19219. }, {
  19220. key: '_applyRuleLocale',
  19221. value: function _applyRuleLocale(rules) {
  19222. var keys = Object.keys(rules);
  19223. for (var _i25 = 0; _i25 < keys.length; _i25++) {
  19224. var id = keys[_i25];
  19225. if (!this.data.rules[id]) {
  19226. throw new Error('Locale provided for unknown rule: "'.concat(id, '"'));
  19227. }
  19228. this.data.rules[id] = mergeRuleLocale(this.data.rules[id], rules[id]);
  19229. }
  19230. }
  19231. }, {
  19232. key: '_applyFailureSummaries',
  19233. value: function _applyFailureSummaries(messages) {
  19234. var keys = Object.keys(messages);
  19235. for (var _i26 = 0; _i26 < keys.length; _i26++) {
  19236. var key = keys[_i26];
  19237. if (!this.data.failureSummaries[key]) {
  19238. throw new Error('Locale provided for unknown failureMessage: "'.concat(key, '"'));
  19239. }
  19240. this.data.failureSummaries[key] = mergeFailureMessage(this.data.failureSummaries[key], messages[key]);
  19241. }
  19242. }
  19243. }, {
  19244. key: 'applyLocale',
  19245. value: function applyLocale(locale) {
  19246. this._setDefaultLocale();
  19247. if (locale.checks) {
  19248. this._applyCheckLocale(locale.checks);
  19249. }
  19250. if (locale.rules) {
  19251. this._applyRuleLocale(locale.rules);
  19252. }
  19253. if (locale.failureSummaries) {
  19254. this._applyFailureSummaries(locale.failureSummaries, 'failureSummaries');
  19255. }
  19256. if (locale.incompleteFallbackMessage) {
  19257. this.data.incompleteFallbackMessage = mergeFallbackMessage(this.data.incompleteFallbackMessage, locale.incompleteFallbackMessage);
  19258. }
  19259. if (locale.lang) {
  19260. this.lang = locale.lang;
  19261. }
  19262. }
  19263. }, {
  19264. key: '_init',
  19265. value: function _init() {
  19266. var audit3 = getDefaultConfiguration(this.defaultConfig);
  19267. this.lang = audit3.lang || 'en';
  19268. this.reporter = audit3.reporter;
  19269. this.commands = {};
  19270. this.rules = [];
  19271. this.checks = {};
  19272. this.brand = 'axe';
  19273. this.application = 'axeAPI';
  19274. this.tagExclude = [ 'experimental' ];
  19275. this.noHtml = audit3.noHtml;
  19276. unpackToObject(audit3.rules, this, 'addRule');
  19277. unpackToObject(audit3.checks, this, 'addCheck');
  19278. this.data = {};
  19279. this.data.checks = audit3.data && audit3.data.checks || {};
  19280. this.data.rules = audit3.data && audit3.data.rules || {};
  19281. this.data.failureSummaries = audit3.data && audit3.data.failureSummaries || {};
  19282. this.data.incompleteFallbackMessage = audit3.data && audit3.data.incompleteFallbackMessage || '';
  19283. this._constructHelpUrls();
  19284. }
  19285. }, {
  19286. key: 'registerCommand',
  19287. value: function registerCommand(command) {
  19288. this.commands[command.id] = command.callback;
  19289. }
  19290. }, {
  19291. key: 'addRule',
  19292. value: function addRule(spec) {
  19293. if (spec.metadata) {
  19294. this.data.rules[spec.id] = spec.metadata;
  19295. }
  19296. var rule3 = this.getRule(spec.id);
  19297. if (rule3) {
  19298. rule3.configure(spec);
  19299. } else {
  19300. this.rules.push(new rule_default(spec, this));
  19301. }
  19302. }
  19303. }, {
  19304. key: 'addCheck',
  19305. value: function addCheck(spec) {
  19306. var metadata = spec.metadata;
  19307. if (_typeof(metadata) === 'object') {
  19308. this.data.checks[spec.id] = metadata;
  19309. if (_typeof(metadata.messages) === 'object') {
  19310. Object.keys(metadata.messages).filter(function(prop) {
  19311. return metadata.messages.hasOwnProperty(prop) && typeof metadata.messages[prop] === 'string';
  19312. }).forEach(function(prop) {
  19313. if (metadata.messages[prop].indexOf('function') === 0) {
  19314. metadata.messages[prop] = new Function('return ' + metadata.messages[prop] + ';')();
  19315. }
  19316. });
  19317. }
  19318. }
  19319. if (this.checks[spec.id]) {
  19320. this.checks[spec.id].configure(spec);
  19321. } else {
  19322. this.checks[spec.id] = new check_default(spec);
  19323. }
  19324. }
  19325. }, {
  19326. key: 'run',
  19327. value: function run(context3, options, resolve, reject) {
  19328. this.normalizeOptions(options);
  19329. axe._selectCache = [];
  19330. var allRulesToRun = getRulesToRun(this.rules, context3, options);
  19331. var runNowRules = allRulesToRun.now;
  19332. var runLaterRules = allRulesToRun.later;
  19333. var nowRulesQueue = queue_default();
  19334. runNowRules.forEach(function(rule3) {
  19335. nowRulesQueue.defer(getDefferedRule(rule3, context3, options));
  19336. });
  19337. var preloaderQueue = queue_default();
  19338. if (runLaterRules.length) {
  19339. preloaderQueue.defer(function(resolve2) {
  19340. preload_default(options).then(function(assets) {
  19341. return resolve2(assets);
  19342. })['catch'](function(err2) {
  19343. console.warn('Couldn\'t load preload assets: ', err2);
  19344. resolve2(void 0);
  19345. });
  19346. });
  19347. }
  19348. var queueForNowRulesAndPreloader = queue_default();
  19349. queueForNowRulesAndPreloader.defer(nowRulesQueue);
  19350. queueForNowRulesAndPreloader.defer(preloaderQueue);
  19351. queueForNowRulesAndPreloader.then(function(nowRulesAndPreloaderResults) {
  19352. var assetsFromQueue = nowRulesAndPreloaderResults.pop();
  19353. if (assetsFromQueue && assetsFromQueue.length) {
  19354. var assets = assetsFromQueue[0];
  19355. if (assets) {
  19356. context3 = _extends({}, context3, assets);
  19357. }
  19358. }
  19359. var nowRulesResults = nowRulesAndPreloaderResults[0];
  19360. if (!runLaterRules.length) {
  19361. axe._selectCache = void 0;
  19362. resolve(nowRulesResults.filter(function(result) {
  19363. return !!result;
  19364. }));
  19365. return;
  19366. }
  19367. var laterRulesQueue = queue_default();
  19368. runLaterRules.forEach(function(rule3) {
  19369. var deferredRule = getDefferedRule(rule3, context3, options);
  19370. laterRulesQueue.defer(deferredRule);
  19371. });
  19372. laterRulesQueue.then(function(laterRuleResults) {
  19373. axe._selectCache = void 0;
  19374. resolve(nowRulesResults.concat(laterRuleResults).filter(function(result) {
  19375. return !!result;
  19376. }));
  19377. })['catch'](reject);
  19378. })['catch'](reject);
  19379. }
  19380. }, {
  19381. key: 'after',
  19382. value: function after(results, options) {
  19383. var rules = this.rules;
  19384. return results.map(function(ruleResult) {
  19385. var rule3 = find_by_default(rules, 'id', ruleResult.id);
  19386. if (!rule3) {
  19387. throw new Error('Result for unknown rule. You may be running mismatch axe-core versions');
  19388. }
  19389. return rule3.after(ruleResult, options);
  19390. });
  19391. }
  19392. }, {
  19393. key: 'getRule',
  19394. value: function getRule(ruleId) {
  19395. return this.rules.find(function(rule3) {
  19396. return rule3.id === ruleId;
  19397. });
  19398. }
  19399. }, {
  19400. key: 'normalizeOptions',
  19401. value: function normalizeOptions(options) {
  19402. var audit3 = this;
  19403. var tags = [];
  19404. var ruleIds = [];
  19405. audit3.rules.forEach(function(rule3) {
  19406. ruleIds.push(rule3.id);
  19407. rule3.tags.forEach(function(tag) {
  19408. if (!tags.includes(tag)) {
  19409. tags.push(tag);
  19410. }
  19411. });
  19412. });
  19413. if (_typeof(options.runOnly) === 'object') {
  19414. if (Array.isArray(options.runOnly)) {
  19415. var hasTag = options.runOnly.find(function(value) {
  19416. return tags.includes(value);
  19417. });
  19418. var hasRule = options.runOnly.find(function(value) {
  19419. return ruleIds.includes(value);
  19420. });
  19421. if (hasTag && hasRule) {
  19422. throw new Error('runOnly cannot be both rules and tags');
  19423. }
  19424. if (hasRule) {
  19425. options.runOnly = {
  19426. type: 'rule',
  19427. values: options.runOnly
  19428. };
  19429. } else {
  19430. options.runOnly = {
  19431. type: 'tag',
  19432. values: options.runOnly
  19433. };
  19434. }
  19435. }
  19436. var only = options.runOnly;
  19437. if (only.value && !only.values) {
  19438. only.values = only.value;
  19439. delete only.value;
  19440. }
  19441. if (!Array.isArray(only.values) || only.values.length === 0) {
  19442. throw new Error('runOnly.values must be a non-empty array');
  19443. }
  19444. if ([ 'rule', 'rules' ].includes(only.type)) {
  19445. only.type = 'rule';
  19446. only.values.forEach(function(ruleId) {
  19447. if (!ruleIds.includes(ruleId)) {
  19448. throw new Error('unknown rule `' + ruleId + '` in options.runOnly');
  19449. }
  19450. });
  19451. } else if ([ 'tag', 'tags', void 0 ].includes(only.type)) {
  19452. only.type = 'tag';
  19453. var unmatchedTags = only.values.filter(function(tag) {
  19454. return !tags.includes(tag);
  19455. });
  19456. if (unmatchedTags.length !== 0) {
  19457. log_default('Could not find tags `' + unmatchedTags.join('`, `') + '`');
  19458. }
  19459. } else {
  19460. throw new Error('Unknown runOnly type \''.concat(only.type, '\''));
  19461. }
  19462. }
  19463. if (_typeof(options.rules) === 'object') {
  19464. Object.keys(options.rules).forEach(function(ruleId) {
  19465. if (!ruleIds.includes(ruleId)) {
  19466. throw new Error('unknown rule `' + ruleId + '` in options.rules');
  19467. }
  19468. });
  19469. }
  19470. return options;
  19471. }
  19472. }, {
  19473. key: 'setBranding',
  19474. value: function setBranding(branding) {
  19475. var previous = {
  19476. brand: this.brand,
  19477. application: this.application
  19478. };
  19479. if (branding && branding.hasOwnProperty('brand') && branding.brand && typeof branding.brand === 'string') {
  19480. this.brand = branding.brand;
  19481. }
  19482. if (branding && branding.hasOwnProperty('application') && branding.application && typeof branding.application === 'string') {
  19483. this.application = branding.application;
  19484. }
  19485. this._constructHelpUrls(previous);
  19486. }
  19487. }, {
  19488. key: '_constructHelpUrls',
  19489. value: function _constructHelpUrls() {
  19490. var _this7 = this;
  19491. var previous = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  19492. var version = (axe.version.match(/^[1-9][0-9]*\.[0-9]+/) || [ 'x.y' ])[0];
  19493. this.rules.forEach(function(rule3) {
  19494. if (!_this7.data.rules[rule3.id]) {
  19495. _this7.data.rules[rule3.id] = {};
  19496. }
  19497. var metaData = _this7.data.rules[rule3.id];
  19498. if (typeof metaData.helpUrl !== 'string' || previous && metaData.helpUrl === getHelpUrl(previous, rule3.id, version)) {
  19499. metaData.helpUrl = getHelpUrl(_this7, rule3.id, version);
  19500. }
  19501. });
  19502. }
  19503. }, {
  19504. key: 'resetRulesAndChecks',
  19505. value: function resetRulesAndChecks() {
  19506. this._init();
  19507. this._resetLocale();
  19508. }
  19509. } ]);
  19510. return Audit;
  19511. }();
  19512. function getRulesToRun(rules, context3, options) {
  19513. var base = {
  19514. now: [],
  19515. later: []
  19516. };
  19517. var splitRules = rules.reduce(function(out, rule3) {
  19518. if (!rule_should_run_default(rule3, context3, options)) {
  19519. return out;
  19520. }
  19521. if (rule3.preload) {
  19522. out.later.push(rule3);
  19523. return out;
  19524. }
  19525. out.now.push(rule3);
  19526. return out;
  19527. }, base);
  19528. return splitRules;
  19529. }
  19530. function getDefferedRule(rule3, context3, options) {
  19531. if (options.performanceTimer) {
  19532. performance_timer_default.mark('mark_rule_start_' + rule3.id);
  19533. }
  19534. return function(resolve, reject) {
  19535. rule3.run(context3, options, function(ruleResult) {
  19536. resolve(ruleResult);
  19537. }, function(err2) {
  19538. if (!options.debug) {
  19539. var errResult = Object.assign(new rule_result_default(rule3), {
  19540. result: constants_default.CANTTELL,
  19541. description: 'An error occured while running this rule',
  19542. message: err2.message,
  19543. stack: err2.stack,
  19544. error: err2,
  19545. errorNode: err2.errorNode
  19546. });
  19547. resolve(errResult);
  19548. } else {
  19549. reject(err2);
  19550. }
  19551. });
  19552. };
  19553. }
  19554. function getHelpUrl(_ref73, ruleId, version) {
  19555. var brand = _ref73.brand, application = _ref73.application, lang = _ref73.lang;
  19556. return constants_default.helpUrlBase + brand + '/' + (version || axe.version.substring(0, axe.version.lastIndexOf('.'))) + '/' + ruleId + '?application=' + encodeURIComponent(application) + (lang && lang !== 'en' ? '&lang=' + encodeURIComponent(lang) : '');
  19557. }
  19558. var audit_default = Audit;
  19559. function pushUniqueFrame(collection, frame) {
  19560. if (is_hidden_default(frame)) {
  19561. return;
  19562. }
  19563. var fr = find_by_default(collection, 'node', frame);
  19564. if (!fr) {
  19565. collection.push({
  19566. node: frame,
  19567. include: [],
  19568. exclude: []
  19569. });
  19570. }
  19571. }
  19572. function pushUniqueFrameSelector(context3, type, selectorArray) {
  19573. context3.frames = context3.frames || [];
  19574. var result, frame;
  19575. var frames = document.querySelectorAll(selectorArray.shift());
  19576. frameloop: for (var i = 0, l = frames.length; i < l; i++) {
  19577. frame = frames[i];
  19578. for (var j = 0, l2 = context3.frames.length; j < l2; j++) {
  19579. if (context3.frames[j].node === frame) {
  19580. context3.frames[j][type].push(selectorArray);
  19581. break frameloop;
  19582. }
  19583. }
  19584. result = {
  19585. node: frame,
  19586. include: [],
  19587. exclude: []
  19588. };
  19589. if (selectorArray) {
  19590. result[type].push(selectorArray);
  19591. }
  19592. context3.frames.push(result);
  19593. }
  19594. }
  19595. function normalizeContext(context3) {
  19596. if (context3 && _typeof(context3) === 'object' || context3 instanceof window.NodeList) {
  19597. if (context3 instanceof window.Node) {
  19598. return {
  19599. include: [ context3 ],
  19600. exclude: []
  19601. };
  19602. }
  19603. if (context3.hasOwnProperty('include') || context3.hasOwnProperty('exclude')) {
  19604. return {
  19605. include: context3.include && +context3.include.length ? context3.include : [ document ],
  19606. exclude: context3.exclude || []
  19607. };
  19608. }
  19609. if (context3.length === +context3.length) {
  19610. return {
  19611. include: context3,
  19612. exclude: []
  19613. };
  19614. }
  19615. }
  19616. if (typeof context3 === 'string') {
  19617. return {
  19618. include: [ context3 ],
  19619. exclude: []
  19620. };
  19621. }
  19622. return {
  19623. include: [ document ],
  19624. exclude: []
  19625. };
  19626. }
  19627. function parseSelectorArray(context3, type) {
  19628. var item, result = [], nodeList;
  19629. for (var i = 0, l = context3[type].length; i < l; i++) {
  19630. item = context3[type][i];
  19631. if (typeof item === 'string') {
  19632. nodeList = Array.from(document.querySelectorAll(item));
  19633. result = result.concat(nodeList.map(function(node) {
  19634. return get_node_from_tree_default(node);
  19635. }));
  19636. break;
  19637. } else if (item && item.length && !(item instanceof window.Node)) {
  19638. if (item.length > 1) {
  19639. pushUniqueFrameSelector(context3, type, item);
  19640. } else {
  19641. nodeList = Array.from(document.querySelectorAll(item[0]));
  19642. result = result.concat(nodeList.map(function(node) {
  19643. return get_node_from_tree_default(node);
  19644. }));
  19645. }
  19646. } else if (item instanceof window.Node) {
  19647. if (item.documentElement instanceof window.Node) {
  19648. result.push(context3.flatTree[0]);
  19649. } else {
  19650. result.push(get_node_from_tree_default(item));
  19651. }
  19652. }
  19653. }
  19654. return result.filter(function(r) {
  19655. return r;
  19656. });
  19657. }
  19658. function validateContext(context3) {
  19659. if (context3.include.length === 0) {
  19660. if (context3.frames.length === 0) {
  19661. var env = _respondable.isInFrame() ? 'frame' : 'page';
  19662. return new Error('No elements found for include in ' + env + ' Context');
  19663. }
  19664. context3.frames.forEach(function(frame, i) {
  19665. if (frame.include.length === 0) {
  19666. return new Error('No elements found for include in Context of frame ' + i);
  19667. }
  19668. });
  19669. }
  19670. }
  19671. function getRootNode2(_ref74) {
  19672. var include = _ref74.include, exclude = _ref74.exclude;
  19673. var selectors = Array.from(include).concat(Array.from(exclude));
  19674. for (var i = 0; i < selectors.length; ++i) {
  19675. var item = selectors[i];
  19676. if (item instanceof window.Element) {
  19677. return item.ownerDocument.documentElement;
  19678. }
  19679. if (item instanceof window.Document) {
  19680. return item.documentElement;
  19681. }
  19682. }
  19683. return document.documentElement;
  19684. }
  19685. function Context(spec) {
  19686. var _this8 = this;
  19687. this.frames = [];
  19688. this.initiator = spec && typeof spec.initiator === 'boolean' ? spec.initiator : true;
  19689. this.page = false;
  19690. spec = normalizeContext(spec);
  19691. this.flatTree = get_flattened_tree_default(getRootNode2(spec));
  19692. this.exclude = spec.exclude;
  19693. this.include = spec.include;
  19694. this.include = parseSelectorArray(this, 'include');
  19695. this.exclude = parseSelectorArray(this, 'exclude');
  19696. select_default('frame, iframe', this).forEach(function(frame) {
  19697. if (is_node_in_context_default(frame, _this8)) {
  19698. pushUniqueFrame(_this8.frames, frame.actualNode);
  19699. }
  19700. });
  19701. if (this.include.length === 1 && this.include[0].actualNode === document.documentElement) {
  19702. this.page = true;
  19703. }
  19704. var err2 = validateContext(this);
  19705. if (err2 instanceof Error) {
  19706. throw err2;
  19707. }
  19708. if (!Array.isArray(this.include)) {
  19709. this.include = Array.from(this.include);
  19710. }
  19711. this.include.sort(node_sorter_default);
  19712. }
  19713. var context_default = Context;
  19714. var imports_exports = {};
  19715. __export(imports_exports, {
  19716. CssSelectorParser: function CssSelectorParser() {
  19717. return css_selector_parser2.CssSelectorParser;
  19718. },
  19719. doT: function doT() {
  19720. return dot2['default'];
  19721. },
  19722. emojiRegexText: function emojiRegexText() {
  19723. return emoji_regex3['default'];
  19724. },
  19725. memoize: function memoize() {
  19726. return memoizee2['default'];
  19727. }
  19728. });
  19729. var css_selector_parser2 = __toModule(require_lib());
  19730. var dot2 = __toModule(require_doT());
  19731. var emoji_regex3 = __toModule(require_emoji_regex());
  19732. var memoizee2 = __toModule(require_memoizee());
  19733. var es6_promise = __toModule(require_es6_promise());
  19734. var typedarray = __toModule(require_typedarray());
  19735. var weakmap_polyfill = __toModule(require_weakmap_polyfill());
  19736. if (!('Promise' in window)) {
  19737. es6_promise['default'].polyfill();
  19738. }
  19739. if (!('Uint32Array' in window)) {
  19740. window.Uint32Array = typedarray.Uint32Array;
  19741. }
  19742. if (window.Uint32Array) {
  19743. if (!('some' in window.Uint32Array.prototype)) {
  19744. Object.defineProperty(window.Uint32Array.prototype, 'some', {
  19745. value: Array.prototype.some
  19746. });
  19747. }
  19748. if (!('reduce' in window.Uint32Array.prototype)) {
  19749. Object.defineProperty(window.Uint32Array.prototype, 'reduce', {
  19750. value: Array.prototype.reduce
  19751. });
  19752. }
  19753. }
  19754. function cleanup(resolve, reject) {
  19755. resolve = resolve || function() {};
  19756. reject = reject || axe.log;
  19757. if (!axe._audit) {
  19758. throw new Error('No audit configured');
  19759. }
  19760. var q = axe.utils.queue();
  19761. var cleanupErrors = [];
  19762. Object.keys(axe.plugins).forEach(function(key) {
  19763. q.defer(function(res) {
  19764. var rej = function rej(err2) {
  19765. cleanupErrors.push(err2);
  19766. res();
  19767. };
  19768. try {
  19769. axe.plugins[key].cleanup(res, rej);
  19770. } catch (err2) {
  19771. rej(err2);
  19772. }
  19773. });
  19774. });
  19775. var flattenedTree = axe.utils.getFlattenedTree(document.body);
  19776. axe.utils.querySelectorAll(flattenedTree, 'iframe, frame').forEach(function(node) {
  19777. q.defer(function(res, rej) {
  19778. return axe.utils.sendCommandToFrame(node.actualNode, {
  19779. command: 'cleanup-plugin'
  19780. }, res, rej);
  19781. });
  19782. });
  19783. q.then(function(results) {
  19784. if (cleanupErrors.length === 0) {
  19785. resolve(results);
  19786. } else {
  19787. reject(cleanupErrors);
  19788. }
  19789. })['catch'](reject);
  19790. }
  19791. var cleanup_default = cleanup;
  19792. var reporters = {};
  19793. var defaultReporter;
  19794. function hasReporter(reporterName) {
  19795. return reporters.hasOwnProperty(reporterName);
  19796. }
  19797. function getReporter(reporter4) {
  19798. if (typeof reporter4 === 'string' && reporters[reporter4]) {
  19799. return reporters[reporter4];
  19800. }
  19801. if (typeof reporter4 === 'function') {
  19802. return reporter4;
  19803. }
  19804. return defaultReporter;
  19805. }
  19806. function addReporter(name, cb, isDefault) {
  19807. reporters[name] = cb;
  19808. if (isDefault) {
  19809. defaultReporter = cb;
  19810. }
  19811. }
  19812. function configure(spec) {
  19813. var audit3;
  19814. audit3 = axe._audit;
  19815. if (!audit3) {
  19816. throw new Error('No audit configured');
  19817. }
  19818. if (spec.axeVersion || spec.ver) {
  19819. var specVersion = spec.axeVersion || spec.ver;
  19820. if (!/^\d+\.\d+\.\d+(-canary)?/.test(specVersion)) {
  19821. throw new Error('Invalid configured version '.concat(specVersion));
  19822. }
  19823. var _specVersion$split = specVersion.split('-'), _specVersion$split2 = _slicedToArray(_specVersion$split, 2), version = _specVersion$split2[0], canary = _specVersion$split2[1];
  19824. var _version$split$map = version.split('.').map(Number), _version$split$map2 = _slicedToArray(_version$split$map, 3), major = _version$split$map2[0], minor = _version$split$map2[1], patch = _version$split$map2[2];
  19825. var _axe$version$split = axe.version.split('-'), _axe$version$split2 = _slicedToArray(_axe$version$split, 2), axeVersion = _axe$version$split2[0], axeCanary = _axe$version$split2[1];
  19826. var _axeVersion$split$map = axeVersion.split('.').map(Number), _axeVersion$split$map2 = _slicedToArray(_axeVersion$split$map, 3), axeMajor = _axeVersion$split$map2[0], axeMinor = _axeVersion$split$map2[1], axePatch = _axeVersion$split$map2[2];
  19827. if (major !== axeMajor || axeMinor < minor || axeMinor === minor && axePatch < patch || major === axeMajor && minor === axeMinor && patch === axePatch && canary && canary !== axeCanary) {
  19828. throw new Error('Configured version '.concat(specVersion, ' is not compatible with current axe version ').concat(axe.version));
  19829. }
  19830. }
  19831. if (spec.reporter && (typeof spec.reporter === 'function' || hasReporter(spec.reporter))) {
  19832. audit3.reporter = spec.reporter;
  19833. }
  19834. if (spec.checks) {
  19835. if (!Array.isArray(spec.checks)) {
  19836. throw new TypeError('Checks property must be an array');
  19837. }
  19838. spec.checks.forEach(function(check4) {
  19839. if (!check4.id) {
  19840. throw new TypeError('Configured check '.concat(JSON.stringify(check4), ' is invalid. Checks must be an object with at least an id property'));
  19841. }
  19842. audit3.addCheck(check4);
  19843. });
  19844. }
  19845. var modifiedRules = [];
  19846. if (spec.rules) {
  19847. if (!Array.isArray(spec.rules)) {
  19848. throw new TypeError('Rules property must be an array');
  19849. }
  19850. spec.rules.forEach(function(rule3) {
  19851. if (!rule3.id) {
  19852. throw new TypeError('Configured rule '.concat(JSON.stringify(rule3), ' is invalid. Rules must be an object with at least an id property'));
  19853. }
  19854. modifiedRules.push(rule3.id);
  19855. audit3.addRule(rule3);
  19856. });
  19857. }
  19858. if (spec.disableOtherRules) {
  19859. audit3.rules.forEach(function(rule3) {
  19860. if (modifiedRules.includes(rule3.id) === false) {
  19861. rule3.enabled = false;
  19862. }
  19863. });
  19864. }
  19865. if (typeof spec.branding !== 'undefined') {
  19866. audit3.setBranding(spec.branding);
  19867. } else {
  19868. audit3._constructHelpUrls();
  19869. }
  19870. if (spec.tagExclude) {
  19871. audit3.tagExclude = spec.tagExclude;
  19872. }
  19873. if (spec.locale) {
  19874. audit3.applyLocale(spec.locale);
  19875. }
  19876. if (spec.standards) {
  19877. configureStandards(spec.standards);
  19878. }
  19879. if (spec.noHtml) {
  19880. audit3.noHtml = true;
  19881. }
  19882. }
  19883. var configure_default = configure;
  19884. function getRules(tags) {
  19885. tags = tags || [];
  19886. var matchingRules = !tags.length ? axe._audit.rules : axe._audit.rules.filter(function(item) {
  19887. return !!tags.filter(function(tag) {
  19888. return item.tags.indexOf(tag) !== -1;
  19889. }).length;
  19890. });
  19891. var ruleData = axe._audit.data.rules || {};
  19892. return matchingRules.map(function(matchingRule) {
  19893. var rd = ruleData[matchingRule.id] || {};
  19894. return {
  19895. ruleId: matchingRule.id,
  19896. description: rd.description,
  19897. help: rd.help,
  19898. helpUrl: rd.helpUrl,
  19899. tags: matchingRule.tags
  19900. };
  19901. });
  19902. }
  19903. var get_rules_default = getRules;
  19904. function cleanup2() {
  19905. if (cache_default.get('globalDocumentSet')) {
  19906. document = null;
  19907. }
  19908. if (cache_default.get('globalWindowSet')) {
  19909. window = null;
  19910. }
  19911. axe._memoizedFns.forEach(function(fn) {
  19912. return fn.clear();
  19913. });
  19914. cache_default.clear();
  19915. axe._tree = void 0;
  19916. axe._selectorData = void 0;
  19917. }
  19918. function runRules(context3, options, resolve, reject) {
  19919. try {
  19920. context3 = new context_default(context3);
  19921. axe._tree = context3.flatTree;
  19922. axe._selectorData = _getSelectorData(context3.flatTree);
  19923. } catch (e) {
  19924. cleanup2();
  19925. return reject(e);
  19926. }
  19927. var q = queue_default();
  19928. var audit3 = axe._audit;
  19929. if (options.performanceTimer) {
  19930. performance_timer_default.auditStart();
  19931. }
  19932. if (context3.frames.length && options.iframes !== false) {
  19933. q.defer(function(res, rej) {
  19934. collect_results_from_frames_default(context3, options, 'rules', null, res, rej);
  19935. });
  19936. }
  19937. q.defer(function(res, rej) {
  19938. audit3.run(context3, options, res, rej);
  19939. });
  19940. q.then(function(data2) {
  19941. try {
  19942. if (options.performanceTimer) {
  19943. performance_timer_default.auditEnd();
  19944. }
  19945. var results = merge_results_default(data2.map(function(results2) {
  19946. return {
  19947. results: results2
  19948. };
  19949. }));
  19950. if (context3.initiator) {
  19951. results = audit3.after(results, options);
  19952. results.forEach(publish_metadata_default);
  19953. results = results.map(finalize_result_default);
  19954. }
  19955. try {
  19956. resolve(results, cleanup2);
  19957. } catch (e) {
  19958. cleanup2();
  19959. log_default(e);
  19960. }
  19961. } catch (e) {
  19962. cleanup2();
  19963. reject(e);
  19964. }
  19965. })['catch'](function(e) {
  19966. cleanup2();
  19967. reject(e);
  19968. });
  19969. }
  19970. var run_rules_default = runRules;
  19971. function runCommand(data2, keepalive, callback) {
  19972. var resolve = callback;
  19973. var reject = function reject(err2) {
  19974. if (err2 instanceof Error === false) {
  19975. err2 = new Error(err2);
  19976. }
  19977. callback(err2);
  19978. };
  19979. var context3 = data2 && data2.context || {};
  19980. if (context3.hasOwnProperty('include') && !context3.include.length) {
  19981. context3.include = [ document ];
  19982. }
  19983. var options = data2 && data2.options || {};
  19984. switch (data2.command) {
  19985. case 'rules':
  19986. return run_rules_default(context3, options, function(results, cleanup5) {
  19987. resolve(results);
  19988. cleanup5();
  19989. }, reject);
  19990. case 'cleanup-plugin':
  19991. return cleanup_default(resolve, reject);
  19992. default:
  19993. if (axe._audit && axe._audit.commands && axe._audit.commands[data2.command]) {
  19994. return axe._audit.commands[data2.command](data2, callback);
  19995. }
  19996. }
  19997. }
  19998. if (window.top !== window) {
  19999. _respondable.subscribe('axe.start', runCommand);
  20000. _respondable.subscribe('axe.ping', function(data2, keepalive, respond) {
  20001. respond({
  20002. axe: true
  20003. });
  20004. });
  20005. }
  20006. function load(audit3) {
  20007. axe._audit = new audit_default(audit3);
  20008. }
  20009. var load_default = load;
  20010. function Plugin(spec) {
  20011. this._run = spec.run;
  20012. this._collect = spec.collect;
  20013. this._registry = {};
  20014. spec.commands.forEach(function(command) {
  20015. axe._audit.registerCommand(command);
  20016. });
  20017. }
  20018. Plugin.prototype.run = function() {
  20019. return this._run.apply(this, arguments);
  20020. };
  20021. Plugin.prototype.collect = function() {
  20022. return this._collect.apply(this, arguments);
  20023. };
  20024. Plugin.prototype.cleanup = function(done) {
  20025. var q = axe.utils.queue();
  20026. var that = this;
  20027. Object.keys(this._registry).forEach(function(key) {
  20028. q.defer(function(done2) {
  20029. that._registry[key].cleanup(done2);
  20030. });
  20031. });
  20032. q.then(function() {
  20033. done();
  20034. });
  20035. };
  20036. Plugin.prototype.add = function(impl) {
  20037. this._registry[impl.id] = impl;
  20038. };
  20039. function registerPlugin(plugin) {
  20040. axe.plugins[plugin.id] = new Plugin(plugin);
  20041. }
  20042. var plugins_default = registerPlugin;
  20043. function reset() {
  20044. var audit3 = axe._audit;
  20045. if (!audit3) {
  20046. throw new Error('No audit configured');
  20047. }
  20048. audit3.resetRulesAndChecks();
  20049. resetStandards();
  20050. }
  20051. var reset_default = reset;
  20052. function runVirtualRule(ruleId, vNode) {
  20053. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  20054. options.reporter = options.reporter || axe._audit.reporter || 'v1';
  20055. axe._selectorData = {};
  20056. if (!(vNode instanceof abstract_virtual_node_default)) {
  20057. vNode = new serial_virtual_node_default(vNode);
  20058. }
  20059. var rule3 = axe._audit.rules.find(function(rule4) {
  20060. return rule4.id === ruleId;
  20061. });
  20062. if (!rule3) {
  20063. throw new Error('unknown rule `' + ruleId + '`');
  20064. }
  20065. rule3 = Object.create(rule3, {
  20066. excludeHidden: {
  20067. value: false
  20068. }
  20069. });
  20070. var context3 = {
  20071. include: [ vNode ]
  20072. };
  20073. var rawResults = rule3.runSync(context3, options);
  20074. publish_metadata_default(rawResults);
  20075. finalize_result_default(rawResults);
  20076. var results = aggregate_result_default([ rawResults ]);
  20077. results.violations.forEach(function(result) {
  20078. return result.nodes.forEach(function(nodeResult) {
  20079. nodeResult.failureSummary = failure_summary_default(nodeResult);
  20080. });
  20081. });
  20082. return _extends({}, get_environment_data_default(), results, {
  20083. toolOptions: options
  20084. });
  20085. }
  20086. var run_virtual_rule_default = runVirtualRule;
  20087. function isContext(potential) {
  20088. switch (true) {
  20089. case typeof potential === 'string':
  20090. case Array.isArray(potential):
  20091. case window.Node && potential instanceof window.Node:
  20092. case window.NodeList && potential instanceof window.NodeList:
  20093. return true;
  20094. case _typeof(potential) !== 'object':
  20095. return false;
  20096. case potential.include !== void 0:
  20097. case potential.exclude !== void 0:
  20098. case typeof potential.length === 'number':
  20099. return true;
  20100. default:
  20101. return false;
  20102. }
  20103. }
  20104. var noop2 = function noop2() {};
  20105. function normalizeRunParams(context3, options, callback) {
  20106. var typeErr = new TypeError('axe.run arguments are invalid');
  20107. if (!isContext(context3)) {
  20108. if (callback !== void 0) {
  20109. throw typeErr;
  20110. }
  20111. callback = options;
  20112. options = context3;
  20113. context3 = document;
  20114. }
  20115. if (_typeof(options) !== 'object') {
  20116. if (callback !== void 0) {
  20117. throw typeErr;
  20118. }
  20119. callback = options;
  20120. options = {};
  20121. }
  20122. if (typeof callback !== 'function' && callback !== void 0) {
  20123. throw typeErr;
  20124. }
  20125. return {
  20126. context: context3,
  20127. options: options,
  20128. callback: callback || noop2
  20129. };
  20130. }
  20131. function run(context3, options, callback) {
  20132. if (!axe._audit) {
  20133. throw new Error('No audit configured');
  20134. }
  20135. var hasWindow = window && 'Node' in window && 'NodeList' in window;
  20136. var hasDoc = !!document;
  20137. if (!hasWindow || !hasDoc) {
  20138. if (!context3 || !context3.ownerDocument) {
  20139. throw new Error('Required "window" or "document" globals not defined and cannot be deduced from the context. Either set the globals before running or pass in a valid Element.');
  20140. }
  20141. if (!hasDoc) {
  20142. cache_default.set('globalDocumentSet', true);
  20143. document = context3.ownerDocument;
  20144. }
  20145. if (!hasWindow) {
  20146. cache_default.set('globalWindowSet', true);
  20147. window = document.defaultView;
  20148. }
  20149. }
  20150. var args = normalizeRunParams(context3, options, callback);
  20151. context3 = args.context;
  20152. options = args.options;
  20153. callback = args.callback;
  20154. options.reporter = options.reporter || axe._audit.reporter || 'v1';
  20155. if (options.performanceTimer) {
  20156. axe.utils.performanceTimer.start();
  20157. }
  20158. var p;
  20159. var reject = noop2;
  20160. var resolve = noop2;
  20161. if (typeof Promise === 'function' && callback === noop2) {
  20162. p = new Promise(function(_resolve, _reject) {
  20163. reject = _reject;
  20164. resolve = _resolve;
  20165. });
  20166. }
  20167. if (axe._running) {
  20168. var err2 = 'Axe is already running. Use `await axe.run()` to wait for the previous run to finish before starting a new run.';
  20169. callback(err2);
  20170. reject(err2);
  20171. return p;
  20172. }
  20173. axe._running = true;
  20174. axe._runRules(context3, options, function(rawResults, cleanup5) {
  20175. var respond = function respond(results) {
  20176. axe._running = false;
  20177. cleanup5();
  20178. try {
  20179. callback(null, results);
  20180. } catch (e) {
  20181. axe.log(e);
  20182. }
  20183. resolve(results);
  20184. };
  20185. if (options.performanceTimer) {
  20186. axe.utils.performanceTimer.end();
  20187. }
  20188. try {
  20189. var reporter4 = getReporter(options.reporter);
  20190. var results = reporter4(rawResults, options, respond);
  20191. if (results !== void 0) {
  20192. respond(results);
  20193. }
  20194. } catch (err2) {
  20195. axe._running = false;
  20196. cleanup5();
  20197. callback(err2);
  20198. reject(err2);
  20199. }
  20200. }, function(err2) {
  20201. axe._running = false;
  20202. callback(err2);
  20203. reject(err2);
  20204. });
  20205. return p;
  20206. }
  20207. var run_default = run;
  20208. var naReporter = function naReporter(results, options, callback) {
  20209. console.warn('"na" reporter will be deprecated in axe v4.0. Use the "v2" reporter instead.');
  20210. if (typeof options === 'function') {
  20211. callback = options;
  20212. options = {};
  20213. }
  20214. var out = process_aggregate_default(results, options);
  20215. callback(_extends({}, get_environment_data_default(), {
  20216. toolOptions: options,
  20217. violations: out.violations,
  20218. passes: out.passes,
  20219. incomplete: out.incomplete,
  20220. inapplicable: out.inapplicable
  20221. }));
  20222. };
  20223. var na_default = naReporter;
  20224. var noPassesReporter = function noPassesReporter(results, options, callback) {
  20225. if (typeof options === 'function') {
  20226. callback = options;
  20227. options = {};
  20228. }
  20229. options.resultTypes = [ 'violations' ];
  20230. var out = process_aggregate_default(results, options);
  20231. callback(_extends({}, get_environment_data_default(), {
  20232. toolOptions: options,
  20233. violations: out.violations
  20234. }));
  20235. };
  20236. var no_passes_default = noPassesReporter;
  20237. var rawReporter = function rawReporter(results, options, callback) {
  20238. if (typeof options === 'function') {
  20239. callback = options;
  20240. options = {};
  20241. }
  20242. if (!results || !Array.isArray(results)) {
  20243. return callback(results);
  20244. }
  20245. var transformedResults = results.map(function(result) {
  20246. var transformedResult = _extends({}, result);
  20247. var types = [ 'passes', 'violations', 'incomplete', 'inapplicable' ];
  20248. for (var _i27 = 0, _types = types; _i27 < _types.length; _i27++) {
  20249. var type = _types[_i27];
  20250. if (transformedResult[type] && Array.isArray(transformedResult[type])) {
  20251. transformedResult[type] = transformedResult[type].map(function(typeResult) {
  20252. return _extends({}, typeResult, {
  20253. node: typeResult.node.toJSON()
  20254. });
  20255. });
  20256. }
  20257. }
  20258. return transformedResult;
  20259. });
  20260. callback(transformedResults);
  20261. };
  20262. var raw_default = rawReporter;
  20263. var rawEnvReporter = function rawEnvReporter(results, options, callback) {
  20264. if (typeof options === 'function') {
  20265. callback = options;
  20266. options = {};
  20267. }
  20268. function rawCallback(raw3) {
  20269. var env = get_environment_data_default();
  20270. callback({
  20271. raw: raw3,
  20272. env: env
  20273. });
  20274. }
  20275. raw_default(results, options, rawCallback);
  20276. };
  20277. var raw_env_default = rawEnvReporter;
  20278. var v1Reporter = function v1Reporter(results, options, callback) {
  20279. if (typeof options === 'function') {
  20280. callback = options;
  20281. options = {};
  20282. }
  20283. var out = process_aggregate_default(results, options);
  20284. var addFailureSummaries = function addFailureSummaries(result) {
  20285. result.nodes.forEach(function(nodeResult) {
  20286. nodeResult.failureSummary = failure_summary_default(nodeResult);
  20287. });
  20288. };
  20289. out.incomplete.forEach(addFailureSummaries);
  20290. out.violations.forEach(addFailureSummaries);
  20291. callback(_extends({}, get_environment_data_default(), {
  20292. toolOptions: options,
  20293. violations: out.violations,
  20294. passes: out.passes,
  20295. incomplete: out.incomplete,
  20296. inapplicable: out.inapplicable
  20297. }));
  20298. };
  20299. var v1_default = v1Reporter;
  20300. var v2Reporter = function v2Reporter(results, options, callback) {
  20301. if (typeof options === 'function') {
  20302. callback = options;
  20303. options = {};
  20304. }
  20305. var out = process_aggregate_default(results, options);
  20306. callback(_extends({}, get_environment_data_default(), {
  20307. toolOptions: options,
  20308. violations: out.violations,
  20309. passes: out.passes,
  20310. incomplete: out.incomplete,
  20311. inapplicable: out.inapplicable
  20312. }));
  20313. };
  20314. var v2_default = v2Reporter;
  20315. axe.constants = constants_default;
  20316. axe.log = log_default;
  20317. axe.AbstractVirtualNode = abstract_virtual_node_default;
  20318. axe.SerialVirtualNode = serial_virtual_node_default;
  20319. axe.VirtualNode = virtual_node_default;
  20320. axe._cache = cache_default;
  20321. axe._thisWillBeDeletedDoNotUse = axe._thisWillBeDeletedDoNotUse || {};
  20322. axe._thisWillBeDeletedDoNotUse.base = {
  20323. Audit: audit_default,
  20324. CheckResult: check_result_default,
  20325. Check: check_default,
  20326. Context: context_default,
  20327. RuleResult: rule_result_default,
  20328. Rule: rule_default,
  20329. metadataFunctionMap: metadata_function_map_default
  20330. };
  20331. axe.imports = imports_exports;
  20332. axe.cleanup = cleanup_default;
  20333. axe.configure = configure_default;
  20334. axe.getRules = get_rules_default;
  20335. axe._load = load_default;
  20336. axe.plugins = {};
  20337. axe.registerPlugin = plugins_default;
  20338. axe.hasReporter = hasReporter;
  20339. axe.getReporter = getReporter;
  20340. axe.addReporter = addReporter;
  20341. axe.reset = reset_default;
  20342. axe._runRules = run_rules_default;
  20343. axe.runVirtualRule = run_virtual_rule_default;
  20344. axe.run = run_default;
  20345. axe.commons = commons_exports;
  20346. axe.utils = utils_exports;
  20347. axe.addReporter('na', na_default);
  20348. axe.addReporter('no-passes', no_passes_default);
  20349. axe.addReporter('rawEnv', raw_env_default);
  20350. axe.addReporter('raw', raw_default);
  20351. axe.addReporter('v1', v1_default);
  20352. axe.addReporter('v2', v2_default, true);
  20353. })();
  20354. 'use strict';
  20355. axe._load({
  20356. lang: 'en',
  20357. data: {
  20358. rules: {
  20359. accesskeys: {
  20360. description: 'Ensures every accesskey attribute value is unique',
  20361. help: 'accesskey attribute value must be unique'
  20362. },
  20363. 'area-alt': {
  20364. description: 'Ensures <area> elements of image maps have alternate text',
  20365. help: 'Active <area> elements must have alternate text'
  20366. },
  20367. 'aria-allowed-attr': {
  20368. description: 'Ensures ARIA attributes are allowed for an element\'s role',
  20369. help: 'Elements must only use allowed ARIA attributes'
  20370. },
  20371. 'aria-allowed-role': {
  20372. description: 'Ensures role attribute has an appropriate value for the element',
  20373. help: 'ARIA role must be appropriate for the element'
  20374. },
  20375. 'aria-command-name': {
  20376. description: 'Ensures every ARIA button, link and menuitem has an accessible name',
  20377. help: 'ARIA commands must have an accessible name'
  20378. },
  20379. 'aria-dialog-name': {
  20380. description: 'Ensures every ARIA dialog and alertdialog node has an accessible name',
  20381. help: 'ARIA dialog and alertdialog nodes must have an accessible name'
  20382. },
  20383. 'aria-hidden-body': {
  20384. description: 'Ensures aria-hidden=\'true\' is not present on the document body.',
  20385. help: 'aria-hidden=\'true\' must not be present on the document body'
  20386. },
  20387. 'aria-hidden-focus': {
  20388. description: 'Ensures aria-hidden elements do not contain focusable elements',
  20389. help: 'ARIA hidden element must not contain focusable elements'
  20390. },
  20391. 'aria-input-field-name': {
  20392. description: 'Ensures every ARIA input field has an accessible name',
  20393. help: 'ARIA input fields must have an accessible name'
  20394. },
  20395. 'aria-meter-name': {
  20396. description: 'Ensures every ARIA meter node has an accessible name',
  20397. help: 'ARIA meter nodes must have an accessible name'
  20398. },
  20399. 'aria-progressbar-name': {
  20400. description: 'Ensures every ARIA progressbar node has an accessible name',
  20401. help: 'ARIA progressbar nodes must have an accessible name'
  20402. },
  20403. 'aria-required-attr': {
  20404. description: 'Ensures elements with ARIA roles have all required ARIA attributes',
  20405. help: 'Required ARIA attributes must be provided'
  20406. },
  20407. 'aria-required-children': {
  20408. description: 'Ensures elements with an ARIA role that require child roles contain them',
  20409. help: 'Certain ARIA roles must contain particular children'
  20410. },
  20411. 'aria-required-parent': {
  20412. description: 'Ensures elements with an ARIA role that require parent roles are contained by them',
  20413. help: 'Certain ARIA roles must be contained by particular parents'
  20414. },
  20415. 'aria-roledescription': {
  20416. description: 'Ensure aria-roledescription is only used on elements with an implicit or explicit role',
  20417. help: 'Use aria-roledescription on elements with a semantic role'
  20418. },
  20419. 'aria-roles': {
  20420. description: 'Ensures all elements with a role attribute use a valid value',
  20421. help: 'ARIA roles used must conform to valid values'
  20422. },
  20423. 'aria-toggle-field-name': {
  20424. description: 'Ensures every ARIA toggle field has an accessible name',
  20425. help: 'ARIA toggle fields have an accessible name'
  20426. },
  20427. 'aria-tooltip-name': {
  20428. description: 'Ensures every ARIA tooltip node has an accessible name',
  20429. help: 'ARIA tooltip nodes must have an accessible name'
  20430. },
  20431. 'aria-treeitem-name': {
  20432. description: 'Ensures every ARIA treeitem node has an accessible name',
  20433. help: 'ARIA treeitem nodes must have an accessible name'
  20434. },
  20435. 'aria-valid-attr-value': {
  20436. description: 'Ensures all ARIA attributes have valid values',
  20437. help: 'ARIA attributes must conform to valid values'
  20438. },
  20439. 'aria-valid-attr': {
  20440. description: 'Ensures attributes that begin with aria- are valid ARIA attributes',
  20441. help: 'ARIA attributes must conform to valid names'
  20442. },
  20443. 'audio-caption': {
  20444. description: 'Ensures <audio> elements have captions',
  20445. help: '<audio> elements must have a captions track'
  20446. },
  20447. 'autocomplete-valid': {
  20448. description: 'Ensure the autocomplete attribute is correct and suitable for the form field',
  20449. help: 'autocomplete attribute must be used correctly'
  20450. },
  20451. 'avoid-inline-spacing': {
  20452. description: 'Ensure that text spacing set through style attributes can be adjusted with custom stylesheets',
  20453. help: 'Inline text spacing must be adjustable with custom stylesheets'
  20454. },
  20455. blink: {
  20456. description: 'Ensures <blink> elements are not used',
  20457. help: '<blink> elements are deprecated and must not be used'
  20458. },
  20459. 'button-name': {
  20460. description: 'Ensures buttons have discernible text',
  20461. help: 'Buttons must have discernible text'
  20462. },
  20463. bypass: {
  20464. description: 'Ensures each page has at least one mechanism for a user to bypass navigation and jump straight to the content',
  20465. help: 'Page must have means to bypass repeated blocks'
  20466. },
  20467. 'color-contrast': {
  20468. description: 'Ensures the contrast between foreground and background colors meets WCAG 2 AA contrast ratio thresholds',
  20469. help: 'Elements must have sufficient color contrast'
  20470. },
  20471. 'css-orientation-lock': {
  20472. description: 'Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations',
  20473. help: 'CSS Media queries are not used to lock display orientation'
  20474. },
  20475. 'definition-list': {
  20476. description: 'Ensures <dl> elements are structured correctly',
  20477. help: '<dl> elements must only directly contain properly-ordered <dt> and <dd> groups, <script>, <template> or <div> elements'
  20478. },
  20479. dlitem: {
  20480. description: 'Ensures <dt> and <dd> elements are contained by a <dl>',
  20481. help: '<dt> and <dd> elements must be contained by a <dl>'
  20482. },
  20483. 'document-title': {
  20484. description: 'Ensures each HTML document contains a non-empty <title> element',
  20485. help: 'Documents must have <title> element to aid in navigation'
  20486. },
  20487. 'duplicate-id-active': {
  20488. description: 'Ensures every id attribute value of active elements is unique',
  20489. help: 'IDs of active elements must be unique'
  20490. },
  20491. 'duplicate-id-aria': {
  20492. description: 'Ensures every id attribute value used in ARIA and in labels is unique',
  20493. help: 'IDs used in ARIA and labels must be unique'
  20494. },
  20495. 'duplicate-id': {
  20496. description: 'Ensures every id attribute value is unique',
  20497. help: 'id attribute value must be unique'
  20498. },
  20499. 'empty-heading': {
  20500. description: 'Ensures headings have discernible text',
  20501. help: 'Headings must not be empty'
  20502. },
  20503. 'focus-order-semantics': {
  20504. description: 'Ensures elements in the focus order have an appropriate role',
  20505. help: 'Elements in the focus order need a role appropriate for interactive content'
  20506. },
  20507. 'form-field-multiple-labels': {
  20508. description: 'Ensures form field does not have multiple label elements',
  20509. help: 'Form field should not have multiple label elements'
  20510. },
  20511. 'frame-tested': {
  20512. description: 'Ensures <iframe> and <frame> elements contain the axe-core script',
  20513. help: 'Frames must be tested with axe-core'
  20514. },
  20515. 'frame-title-unique': {
  20516. description: 'Ensures <iframe> and <frame> elements contain a unique title attribute',
  20517. help: 'Frames must have a unique title attribute'
  20518. },
  20519. 'frame-title': {
  20520. description: 'Ensures <iframe> and <frame> elements contain a non-empty title attribute',
  20521. help: 'Frames must have title attribute'
  20522. },
  20523. 'heading-order': {
  20524. description: 'Ensures the order of headings is semantically correct',
  20525. help: 'Heading levels should only increase by one'
  20526. },
  20527. 'hidden-content': {
  20528. description: 'Informs users about hidden content.',
  20529. help: 'Hidden content on the page cannot be analyzed'
  20530. },
  20531. 'html-has-lang': {
  20532. description: 'Ensures every HTML document has a lang attribute',
  20533. help: '<html> element must have a lang attribute'
  20534. },
  20535. 'html-lang-valid': {
  20536. description: 'Ensures the lang attribute of the <html> element has a valid value',
  20537. help: '<html> element must have a valid value for the lang attribute'
  20538. },
  20539. 'html-xml-lang-mismatch': {
  20540. description: 'Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page',
  20541. help: 'HTML elements with lang and xml:lang must have the same base language'
  20542. },
  20543. 'identical-links-same-purpose': {
  20544. description: 'Ensure that links with the same accessible name serve a similar purpose',
  20545. help: 'Links with the same name have a similar purpose'
  20546. },
  20547. 'image-alt': {
  20548. description: 'Ensures <img> elements have alternate text or a role of none or presentation',
  20549. help: 'Images must have alternate text'
  20550. },
  20551. 'image-redundant-alt': {
  20552. description: 'Ensure image alternative is not repeated as text',
  20553. help: 'Alternative text of images should not be repeated as text'
  20554. },
  20555. 'input-button-name': {
  20556. description: 'Ensures input buttons have discernible text',
  20557. help: 'Input buttons must have discernible text'
  20558. },
  20559. 'input-image-alt': {
  20560. description: 'Ensures <input type="image"> elements have alternate text',
  20561. help: 'Image buttons must have alternate text'
  20562. },
  20563. 'label-content-name-mismatch': {
  20564. description: 'Ensures that elements labelled through their content must have their visible text as part of their accessible name',
  20565. help: 'Elements must have their visible text as part of their accessible name'
  20566. },
  20567. 'label-title-only': {
  20568. description: 'Ensures that every form element is not solely labeled using the title or aria-describedby attributes',
  20569. help: 'Form elements should have a visible label'
  20570. },
  20571. label: {
  20572. description: 'Ensures every form element has a label',
  20573. help: 'Form elements must have labels'
  20574. },
  20575. 'landmark-banner-is-top-level': {
  20576. description: 'Ensures the banner landmark is at top level',
  20577. help: 'Banner landmark must not be contained in another landmark'
  20578. },
  20579. 'landmark-complementary-is-top-level': {
  20580. description: 'Ensures the complementary landmark or aside is at top level',
  20581. help: 'Aside must not be contained in another landmark'
  20582. },
  20583. 'landmark-contentinfo-is-top-level': {
  20584. description: 'Ensures the contentinfo landmark is at top level',
  20585. help: 'Contentinfo landmark must not be contained in another landmark'
  20586. },
  20587. 'landmark-main-is-top-level': {
  20588. description: 'Ensures the main landmark is at top level',
  20589. help: 'Main landmark must not be contained in another landmark'
  20590. },
  20591. 'landmark-no-duplicate-banner': {
  20592. description: 'Ensures the document has at most one banner landmark',
  20593. help: 'Document must not have more than one banner landmark'
  20594. },
  20595. 'landmark-no-duplicate-contentinfo': {
  20596. description: 'Ensures the document has at most one contentinfo landmark',
  20597. help: 'Document must not have more than one contentinfo landmark'
  20598. },
  20599. 'landmark-no-duplicate-main': {
  20600. description: 'Ensures the document has at most one main landmark',
  20601. help: 'Document must not have more than one main landmark'
  20602. },
  20603. 'landmark-one-main': {
  20604. description: 'Ensures the document has a main landmark',
  20605. help: 'Document must have one main landmark'
  20606. },
  20607. 'landmark-unique': {
  20608. help: 'Ensures landmarks are unique',
  20609. description: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination'
  20610. },
  20611. 'link-in-text-block': {
  20612. description: 'Links can be distinguished without relying on color',
  20613. help: 'Links must be distinguished from surrounding text in a way that does not rely on color'
  20614. },
  20615. 'link-name': {
  20616. description: 'Ensures links have discernible text',
  20617. help: 'Links must have discernible text'
  20618. },
  20619. list: {
  20620. description: 'Ensures that lists are structured correctly',
  20621. help: '<ul> and <ol> must only directly contain <li>, <script> or <template> elements'
  20622. },
  20623. listitem: {
  20624. description: 'Ensures <li> elements are used semantically',
  20625. help: '<li> elements must be contained in a <ul> or <ol>'
  20626. },
  20627. marquee: {
  20628. description: 'Ensures <marquee> elements are not used',
  20629. help: '<marquee> elements are deprecated and must not be used'
  20630. },
  20631. 'meta-refresh': {
  20632. description: 'Ensures <meta http-equiv="refresh"> is not used',
  20633. help: 'Timed refresh must not exist'
  20634. },
  20635. 'meta-viewport-large': {
  20636. description: 'Ensures <meta name="viewport"> can scale a significant amount',
  20637. help: 'Users should be able to zoom and scale the text up to 500%'
  20638. },
  20639. 'meta-viewport': {
  20640. description: 'Ensures <meta name="viewport"> does not disable text scaling and zooming',
  20641. help: 'Zooming and scaling must not be disabled'
  20642. },
  20643. 'no-autoplay-audio': {
  20644. description: 'Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio',
  20645. help: '<video> or <audio> elements do not autoplay audio'
  20646. },
  20647. 'object-alt': {
  20648. description: 'Ensures <object> elements have alternate text',
  20649. help: '<object> elements must have alternate text'
  20650. },
  20651. 'p-as-heading': {
  20652. description: 'Ensure p elements are not used to style headings',
  20653. help: 'Bold, italic text and font-size are not used to style p elements as a heading'
  20654. },
  20655. 'page-has-heading-one': {
  20656. description: 'Ensure that the page, or at least one of its frames contains a level-one heading',
  20657. help: 'Page must contain a level-one heading'
  20658. },
  20659. 'presentation-role-conflict': {
  20660. description: 'Flags elements whose role is none or presentation and which cause the role conflict resolution to trigger.',
  20661. help: 'Elements of role none or presentation should be flagged'
  20662. },
  20663. region: {
  20664. description: 'Ensures all page content is contained by landmarks',
  20665. help: 'All page content must be contained by landmarks'
  20666. },
  20667. 'role-img-alt': {
  20668. description: 'Ensures [role=\'img\'] elements have alternate text',
  20669. help: '[role=\'img\'] elements have an alternative text'
  20670. },
  20671. 'scope-attr-valid': {
  20672. description: 'Ensures the scope attribute is used correctly on tables',
  20673. help: 'scope attribute should be used correctly'
  20674. },
  20675. 'scrollable-region-focusable': {
  20676. description: 'Elements that have scrollable content should be accessible by keyboard',
  20677. help: 'Ensure that scrollable region has keyboard access'
  20678. },
  20679. 'select-name': {
  20680. description: 'Ensures select element has an accessible name',
  20681. help: 'Select element must have and accessible name'
  20682. },
  20683. 'server-side-image-map': {
  20684. description: 'Ensures that server-side image maps are not used',
  20685. help: 'Server-side image maps must not be used'
  20686. },
  20687. 'skip-link': {
  20688. description: 'Ensure all skip links have a focusable target',
  20689. help: 'The skip-link target should exist and be focusable'
  20690. },
  20691. 'svg-img-alt': {
  20692. description: 'Ensures svg elements with an img, graphics-document or graphics-symbol role have an accessible text',
  20693. help: 'svg elements with an img role have an alternative text'
  20694. },
  20695. tabindex: {
  20696. description: 'Ensures tabindex attribute values are not greater than 0',
  20697. help: 'Elements should not have tabindex greater than zero'
  20698. },
  20699. 'table-duplicate-name': {
  20700. description: 'Ensure that tables do not have the same summary and caption',
  20701. help: 'The <caption> element should not contain the same text as the summary attribute'
  20702. },
  20703. 'table-fake-caption': {
  20704. description: 'Ensure that tables with a caption use the <caption> element.',
  20705. help: 'Data or header cells should not be used to give caption to a data table.'
  20706. },
  20707. 'td-has-header': {
  20708. description: 'Ensure that each non-empty data cell in a large table has one or more table headers',
  20709. help: 'All non-empty td element in table larger than 3 by 3 must have an associated table header'
  20710. },
  20711. 'td-headers-attr': {
  20712. description: 'Ensure that each cell in a table using the headers refers to another cell in that table',
  20713. help: 'All cells in a table element that use the headers attribute must only refer to other cells of that same table'
  20714. },
  20715. 'th-has-data-cells': {
  20716. description: 'Ensure that each table header in a data table refers to data cells',
  20717. help: 'All th elements and elements with role=columnheader/rowheader must have data cells they describe'
  20718. },
  20719. 'valid-lang': {
  20720. description: 'Ensures lang attributes have valid values',
  20721. help: 'lang attribute must have a valid value'
  20722. },
  20723. 'video-caption': {
  20724. description: 'Ensures <video> elements have captions',
  20725. help: '<video> elements must have captions'
  20726. }
  20727. },
  20728. checks: {
  20729. abstractrole: {
  20730. impact: 'serious',
  20731. messages: {
  20732. pass: 'Abstract roles are not used',
  20733. fail: {
  20734. singular: 'Abstract role cannot be directly used: ${data.values}',
  20735. plural: 'Abstract roles cannot be directly used: ${data.values}'
  20736. }
  20737. }
  20738. },
  20739. 'aria-allowed-attr': {
  20740. impact: 'critical',
  20741. messages: {
  20742. pass: 'ARIA attributes are used correctly for the defined role',
  20743. fail: {
  20744. singular: 'ARIA attribute is not allowed: ${data.values}',
  20745. plural: 'ARIA attributes are not allowed: ${data.values}'
  20746. }
  20747. }
  20748. },
  20749. 'aria-allowed-role': {
  20750. impact: 'minor',
  20751. messages: {
  20752. pass: 'ARIA role is allowed for given element',
  20753. fail: {
  20754. singular: 'ARIA role ${data.values} is not allowed for given element',
  20755. plural: 'ARIA roles ${data.values} are not allowed for given element'
  20756. },
  20757. incomplete: {
  20758. singular: 'ARIA role ${data.values} must be removed when the element is made visible, as it is not allowed for the element',
  20759. plural: 'ARIA roles ${data.values} must be removed when the element is made visible, as they are not allowed for the element'
  20760. }
  20761. }
  20762. },
  20763. 'aria-errormessage': {
  20764. impact: 'critical',
  20765. messages: {
  20766. pass: 'aria-errormessage exists and references elements visible to screen readers that use a supported aria-errormessage technique',
  20767. fail: {
  20768. singular: 'aria-errormessage value `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)',
  20769. plural: 'aria-errormessage values `${data.values}` must use a technique to announce the message (e.g., aria-live, aria-describedby, role=alert, etc.)'
  20770. },
  20771. incomplete: {
  20772. singular: 'ensure aria-errormessage value `${data.values}` references an existing element',
  20773. plural: 'ensure aria-errormessage values `${data.values}` reference existing elements'
  20774. }
  20775. }
  20776. },
  20777. 'aria-hidden-body': {
  20778. impact: 'critical',
  20779. messages: {
  20780. pass: 'No aria-hidden attribute is present on document body',
  20781. fail: 'aria-hidden=true should not be present on the document body'
  20782. }
  20783. },
  20784. 'aria-required-attr': {
  20785. impact: 'critical',
  20786. messages: {
  20787. pass: 'All required ARIA attributes are present',
  20788. fail: {
  20789. singular: 'Required ARIA attribute not present: ${data.values}',
  20790. plural: 'Required ARIA attributes not present: ${data.values}'
  20791. }
  20792. }
  20793. },
  20794. 'aria-required-children': {
  20795. impact: 'critical',
  20796. messages: {
  20797. pass: 'Required ARIA children are present',
  20798. fail: {
  20799. singular: 'Required ARIA child role not present: ${data.values}',
  20800. plural: 'Required ARIA children role not present: ${data.values}'
  20801. },
  20802. incomplete: {
  20803. singular: 'Expecting ARIA child role to be added: ${data.values}',
  20804. plural: 'Expecting ARIA children role to be added: ${data.values}'
  20805. }
  20806. }
  20807. },
  20808. 'aria-required-parent': {
  20809. impact: 'critical',
  20810. messages: {
  20811. pass: 'Required ARIA parent role present',
  20812. fail: {
  20813. singular: 'Required ARIA parent role not present: ${data.values}',
  20814. plural: 'Required ARIA parents role not present: ${data.values}'
  20815. }
  20816. }
  20817. },
  20818. 'aria-roledescription': {
  20819. impact: 'serious',
  20820. messages: {
  20821. pass: 'aria-roledescription used on a supported semantic role',
  20822. incomplete: 'Check that the aria-roledescription is announced by supported screen readers',
  20823. fail: 'Give the element a role that supports aria-roledescription'
  20824. }
  20825. },
  20826. 'aria-unsupported-attr': {
  20827. impact: 'critical',
  20828. messages: {
  20829. pass: 'ARIA attribute is supported',
  20830. fail: 'ARIA attribute is not widely supported in screen readers and assistive technologies: ${data.values}'
  20831. }
  20832. },
  20833. 'aria-valid-attr-value': {
  20834. impact: 'critical',
  20835. messages: {
  20836. pass: 'ARIA attribute values are valid',
  20837. fail: {
  20838. singular: 'Invalid ARIA attribute value: ${data.values}',
  20839. plural: 'Invalid ARIA attribute values: ${data.values}'
  20840. },
  20841. incomplete: {
  20842. noId: 'ARIA attribute element ID does not exist on the page: ${data.needsReview}',
  20843. ariaCurrent: 'ARIA attribute value is invalid and will be treated as "aria-current=true": ${data.needsReview}'
  20844. }
  20845. }
  20846. },
  20847. 'aria-valid-attr': {
  20848. impact: 'critical',
  20849. messages: {
  20850. pass: 'ARIA attribute name is valid',
  20851. fail: {
  20852. singular: 'Invalid ARIA attribute name: ${data.values}',
  20853. plural: 'Invalid ARIA attribute names: ${data.values}'
  20854. }
  20855. }
  20856. },
  20857. fallbackrole: {
  20858. impact: 'serious',
  20859. messages: {
  20860. pass: 'Only one role value used',
  20861. fail: 'Use only one role value, since fallback roles are not supported in older browsers'
  20862. }
  20863. },
  20864. 'has-global-aria-attribute': {
  20865. impact: 'minor',
  20866. messages: {
  20867. pass: {
  20868. singular: 'Element has global ARIA attribute: ${data.values}',
  20869. plural: 'Element has global ARIA attributes: ${data.values}'
  20870. },
  20871. fail: 'Element does not have global ARIA attribute'
  20872. }
  20873. },
  20874. 'has-widget-role': {
  20875. impact: 'minor',
  20876. messages: {
  20877. pass: 'Element has a widget role.',
  20878. fail: 'Element does not have a widget role.'
  20879. }
  20880. },
  20881. invalidrole: {
  20882. impact: 'critical',
  20883. messages: {
  20884. pass: 'ARIA role is valid',
  20885. fail: {
  20886. singular: 'Role must be one of the valid ARIA roles: ${data.values}',
  20887. plural: 'Roles must be one of the valid ARIA roles: ${data.values}'
  20888. }
  20889. }
  20890. },
  20891. 'is-element-focusable': {
  20892. impact: 'minor',
  20893. messages: {
  20894. pass: 'Element is focusable.',
  20895. fail: 'Element is not focusable.'
  20896. }
  20897. },
  20898. 'no-implicit-explicit-label': {
  20899. impact: 'moderate',
  20900. messages: {
  20901. pass: 'There is no mismatch between a <label> and accessible name',
  20902. incomplete: 'Check that the <label> does not need be part of the ARIA ${data} field\'s name'
  20903. }
  20904. },
  20905. unsupportedrole: {
  20906. impact: 'critical',
  20907. messages: {
  20908. pass: 'ARIA role is supported',
  20909. fail: 'The role used is not widely supported in screen readers and assistive technologies: ${data.values}'
  20910. }
  20911. },
  20912. 'valid-scrollable-semantics': {
  20913. impact: 'minor',
  20914. messages: {
  20915. pass: 'Element has valid semantics for an element in the focus order.',
  20916. fail: 'Element has invalid semantics for an element in the focus order.'
  20917. }
  20918. },
  20919. 'color-contrast': {
  20920. impact: 'serious',
  20921. messages: {
  20922. pass: 'Element has sufficient color contrast of ${data.contrastRatio}',
  20923. fail: 'Element has insufficient color contrast of ${data.contrastRatio} (foreground color: ${data.fgColor}, background color: ${data.bgColor}, font size: ${data.fontSize}, font weight: ${data.fontWeight}). Expected contrast ratio of ${data.expectedContrastRatio}',
  20924. incomplete: {
  20925. default: 'Unable to determine contrast ratio',
  20926. bgImage: 'Element\'s background color could not be determined due to a background image',
  20927. bgGradient: 'Element\'s background color could not be determined due to a background gradient',
  20928. imgNode: 'Element\'s background color could not be determined because element contains an image node',
  20929. bgOverlap: 'Element\'s background color could not be determined because it is overlapped by another element',
  20930. fgAlpha: 'Element\'s foreground color could not be determined because of alpha transparency',
  20931. elmPartiallyObscured: 'Element\'s background color could not be determined because it\'s partially obscured by another element',
  20932. elmPartiallyObscuring: 'Element\'s background color could not be determined because it partially overlaps other elements',
  20933. outsideViewport: 'Element\'s background color could not be determined because it\'s outside the viewport',
  20934. equalRatio: 'Element has a 1:1 contrast ratio with the background',
  20935. shortTextContent: 'Element content is too short to determine if it is actual text content',
  20936. nonBmp: 'Element content contains only non-text characters',
  20937. pseudoContent: 'Element\'s background color could not be determined due to a pseudo element'
  20938. }
  20939. }
  20940. },
  20941. 'link-in-text-block': {
  20942. impact: 'serious',
  20943. messages: {
  20944. pass: 'Links can be distinguished from surrounding text in some way other than by color',
  20945. fail: 'Links need to be distinguished from surrounding text in some way other than by color',
  20946. incomplete: {
  20947. default: 'Unable to determine contrast ratio',
  20948. bgContrast: 'Element\'s contrast ratio could not be determined. Check for a distinct hover/focus style',
  20949. bgImage: 'Element\'s contrast ratio could not be determined due to a background image',
  20950. bgGradient: 'Element\'s contrast ratio could not be determined due to a background gradient',
  20951. imgNode: 'Element\'s contrast ratio could not be determined because element contains an image node',
  20952. bgOverlap: 'Element\'s contrast ratio could not be determined because of element overlap'
  20953. }
  20954. }
  20955. },
  20956. 'autocomplete-appropriate': {
  20957. impact: 'serious',
  20958. messages: {
  20959. pass: 'the autocomplete value is on an appropriate element',
  20960. fail: 'the autocomplete value is inappropriate for this type of input'
  20961. }
  20962. },
  20963. 'autocomplete-valid': {
  20964. impact: 'serious',
  20965. messages: {
  20966. pass: 'the autocomplete attribute is correctly formatted',
  20967. fail: 'the autocomplete attribute is incorrectly formatted'
  20968. }
  20969. },
  20970. accesskeys: {
  20971. impact: 'serious',
  20972. messages: {
  20973. pass: 'Accesskey attribute value is unique',
  20974. fail: 'Document has multiple elements with the same accesskey'
  20975. }
  20976. },
  20977. 'focusable-content': {
  20978. impact: 'moderate',
  20979. messages: {
  20980. pass: 'Element contains focusable elements',
  20981. fail: 'Element should have focusable content'
  20982. }
  20983. },
  20984. 'focusable-disabled': {
  20985. impact: 'serious',
  20986. messages: {
  20987. pass: 'No focusable elements contained within element',
  20988. fail: 'Focusable content should be disabled or be removed from the DOM'
  20989. }
  20990. },
  20991. 'focusable-element': {
  20992. impact: 'moderate',
  20993. messages: {
  20994. pass: 'Element is focusable',
  20995. fail: 'Element should be focusable'
  20996. }
  20997. },
  20998. 'focusable-modal-open': {
  20999. impact: 'serious',
  21000. messages: {
  21001. pass: 'No focusable elements while a modal is open',
  21002. incomplete: 'Check that focusable elements are not tabbable in the current state'
  21003. }
  21004. },
  21005. 'focusable-no-name': {
  21006. impact: 'serious',
  21007. messages: {
  21008. pass: 'Element is not in tab order or has accessible text',
  21009. fail: 'Element is in tab order and does not have accessible text',
  21010. incomplete: 'Unable to determine if element has an accessible name'
  21011. }
  21012. },
  21013. 'focusable-not-tabbable': {
  21014. impact: 'serious',
  21015. messages: {
  21016. pass: 'No focusable elements contained within element',
  21017. fail: 'Focusable content should have tabindex=\'-1\' or be removed from the DOM'
  21018. }
  21019. },
  21020. 'landmark-is-top-level': {
  21021. impact: 'moderate',
  21022. messages: {
  21023. pass: 'The ${data.role} landmark is at the top level.',
  21024. fail: 'The ${data.role} landmark is contained in another landmark.'
  21025. }
  21026. },
  21027. 'page-has-heading-one': {
  21028. impact: 'moderate',
  21029. messages: {
  21030. pass: 'Page has at least one level-one heading',
  21031. fail: 'Page must have a level-one heading'
  21032. }
  21033. },
  21034. 'page-has-main': {
  21035. impact: 'moderate',
  21036. messages: {
  21037. pass: 'Document has at least one main landmark',
  21038. fail: 'Document does not have a main landmark'
  21039. }
  21040. },
  21041. 'page-no-duplicate-banner': {
  21042. impact: 'moderate',
  21043. messages: {
  21044. pass: 'Document does not have more than one banner landmark',
  21045. fail: 'Document has more than one banner landmark'
  21046. }
  21047. },
  21048. 'page-no-duplicate-contentinfo': {
  21049. impact: 'moderate',
  21050. messages: {
  21051. pass: 'Document does not have more than one contentinfo landmark',
  21052. fail: 'Document has more than one contentinfo landmark'
  21053. }
  21054. },
  21055. 'page-no-duplicate-main': {
  21056. impact: 'moderate',
  21057. messages: {
  21058. pass: 'Document does not have more than one main landmark',
  21059. fail: 'Document has more than one main landmark'
  21060. }
  21061. },
  21062. tabindex: {
  21063. impact: 'serious',
  21064. messages: {
  21065. pass: 'Element does not have a tabindex greater than 0',
  21066. fail: 'Element has a tabindex greater than 0'
  21067. }
  21068. },
  21069. 'alt-space-value': {
  21070. impact: 'critical',
  21071. messages: {
  21072. pass: 'Element has a valid alt attribute value',
  21073. fail: 'Element has an alt attribute containing only a space character, which is not ignored by all screen readers'
  21074. }
  21075. },
  21076. 'duplicate-img-label': {
  21077. impact: 'minor',
  21078. messages: {
  21079. pass: 'Element does not duplicate existing text in <img> alt text',
  21080. fail: 'Element contains <img> element with alt text that duplicates existing text'
  21081. }
  21082. },
  21083. 'explicit-label': {
  21084. impact: 'critical',
  21085. messages: {
  21086. pass: 'Form element has an explicit <label>',
  21087. fail: 'Form element does not have an explicit <label>',
  21088. incomplete: 'Unable to determine if form element has an explicit <label>'
  21089. }
  21090. },
  21091. 'help-same-as-label': {
  21092. impact: 'minor',
  21093. messages: {
  21094. pass: 'Help text (title or aria-describedby) does not duplicate label text',
  21095. fail: 'Help text (title or aria-describedby) text is the same as the label text'
  21096. }
  21097. },
  21098. 'hidden-explicit-label': {
  21099. impact: 'critical',
  21100. messages: {
  21101. pass: 'Form element has a visible explicit <label>',
  21102. fail: 'Form element has explicit <label> that is hidden',
  21103. incomplete: 'Unable to determine if form element has explicit <label> that is hidden'
  21104. }
  21105. },
  21106. 'implicit-label': {
  21107. impact: 'critical',
  21108. messages: {
  21109. pass: 'Form element has an implicit (wrapped) <label>',
  21110. fail: 'Form element does not have an implicit (wrapped) <label>',
  21111. incomplete: 'Unable to determine if form element has an implicit (wrapped} <label>'
  21112. }
  21113. },
  21114. 'label-content-name-mismatch': {
  21115. impact: 'serious',
  21116. messages: {
  21117. pass: 'Element contains visible text as part of it\'s accessible name',
  21118. fail: 'Text inside the element is not included in the accessible name'
  21119. }
  21120. },
  21121. 'multiple-label': {
  21122. impact: 'moderate',
  21123. messages: {
  21124. pass: 'Form field does not have multiple label elements',
  21125. incomplete: 'Multiple label elements is not widely supported in assistive technologies. Ensure the first label contains all necessary information.'
  21126. }
  21127. },
  21128. 'title-only': {
  21129. impact: 'serious',
  21130. messages: {
  21131. pass: 'Form element does not solely use title attribute for its label',
  21132. fail: 'Only title used to generate label for form element'
  21133. }
  21134. },
  21135. 'landmark-is-unique': {
  21136. impact: 'moderate',
  21137. messages: {
  21138. pass: 'Landmarks must have a unique role or role/label/title (i.e. accessible name) combination',
  21139. fail: 'The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable'
  21140. }
  21141. },
  21142. 'has-lang': {
  21143. impact: 'serious',
  21144. messages: {
  21145. pass: 'The <html> element has a lang attribute',
  21146. fail: {
  21147. noXHTML: 'The xml:lang attribute is not valid on HTML pages, use the lang attribute.',
  21148. noLang: 'The <html> element does not have a lang attribute'
  21149. }
  21150. }
  21151. },
  21152. 'valid-lang': {
  21153. impact: 'serious',
  21154. messages: {
  21155. pass: 'Value of lang attribute is included in the list of valid languages',
  21156. fail: 'Value of lang attribute not included in the list of valid languages'
  21157. }
  21158. },
  21159. 'xml-lang-mismatch': {
  21160. impact: 'moderate',
  21161. messages: {
  21162. pass: 'Lang and xml:lang attributes have the same base language',
  21163. fail: 'Lang and xml:lang attributes do not have the same base language'
  21164. }
  21165. },
  21166. dlitem: {
  21167. impact: 'serious',
  21168. messages: {
  21169. pass: 'Description list item has a <dl> parent element',
  21170. fail: 'Description list item does not have a <dl> parent element'
  21171. }
  21172. },
  21173. listitem: {
  21174. impact: 'serious',
  21175. messages: {
  21176. pass: 'List item has a <ul>, <ol> or role="list" parent element',
  21177. fail: {
  21178. default: 'List item does not have a <ul>, <ol> parent element',
  21179. roleNotValid: 'List item does not have a <ul>, <ol> parent element without a role, or a role="list"'
  21180. }
  21181. }
  21182. },
  21183. 'only-dlitems': {
  21184. impact: 'serious',
  21185. messages: {
  21186. pass: 'List element only has direct children that are allowed inside <dt> or <dd> elements',
  21187. fail: 'List element has direct children that are not allowed inside <dt> or <dd> elements'
  21188. }
  21189. },
  21190. 'only-listitems': {
  21191. impact: 'serious',
  21192. messages: {
  21193. pass: 'List element only has direct children that are allowed inside <li> elements',
  21194. fail: {
  21195. default: 'List element has direct children that are not allowed inside <li> elements',
  21196. roleNotValid: 'List element has direct children with a role that is not allowed: ${data.roles}'
  21197. }
  21198. }
  21199. },
  21200. 'structured-dlitems': {
  21201. impact: 'serious',
  21202. messages: {
  21203. pass: 'When not empty, element has both <dt> and <dd> elements',
  21204. fail: 'When not empty, element does not have at least one <dt> element followed by at least one <dd> element'
  21205. }
  21206. },
  21207. caption: {
  21208. impact: 'critical',
  21209. messages: {
  21210. pass: 'The multimedia element has a captions track',
  21211. incomplete: 'Check that captions is available for the element'
  21212. }
  21213. },
  21214. 'frame-tested': {
  21215. impact: 'critical',
  21216. messages: {
  21217. pass: 'The iframe was tested with axe-core',
  21218. fail: 'The iframe could not be tested with axe-core',
  21219. incomplete: 'The iframe still has to be tested with axe-core'
  21220. }
  21221. },
  21222. 'no-autoplay-audio': {
  21223. impact: 'moderate',
  21224. messages: {
  21225. pass: '<video> or <audio> does not output audio for more than allowed duration or has controls mechanism',
  21226. fail: '<video> or <audio> outputs audio for more than allowed duration and does not have a controls mechanism',
  21227. incomplete: 'Check that the <video> or <audio> does not output audio for more than allowed duration or provides a controls mechanism'
  21228. }
  21229. },
  21230. 'css-orientation-lock': {
  21231. impact: 'serious',
  21232. messages: {
  21233. pass: 'Display is operable, and orientation lock does not exist',
  21234. fail: 'CSS Orientation lock is applied, and makes display inoperable',
  21235. incomplete: 'CSS Orientation lock cannot be determined'
  21236. }
  21237. },
  21238. 'meta-viewport-large': {
  21239. impact: 'minor',
  21240. messages: {
  21241. pass: '<meta> tag does not prevent significant zooming on mobile devices',
  21242. fail: '<meta> tag limits zooming on mobile devices'
  21243. }
  21244. },
  21245. 'meta-viewport': {
  21246. impact: 'critical',
  21247. messages: {
  21248. pass: '<meta> tag does not disable zooming on mobile devices',
  21249. fail: '${data} on <meta> tag disables zooming on mobile devices'
  21250. }
  21251. },
  21252. 'header-present': {
  21253. impact: 'serious',
  21254. messages: {
  21255. pass: 'Page has a heading',
  21256. fail: 'Page does not have a heading'
  21257. }
  21258. },
  21259. 'heading-order': {
  21260. impact: 'moderate',
  21261. messages: {
  21262. pass: 'Heading order valid',
  21263. fail: 'Heading order invalid'
  21264. }
  21265. },
  21266. 'identical-links-same-purpose': {
  21267. impact: 'minor',
  21268. messages: {
  21269. pass: 'There are no other links with the same name, that go to a different URL',
  21270. incomplete: 'Check that links have the same purpose, or are intentionally ambiguous.'
  21271. }
  21272. },
  21273. 'internal-link-present': {
  21274. impact: 'serious',
  21275. messages: {
  21276. pass: 'Valid skip link found',
  21277. fail: 'No valid skip link found'
  21278. }
  21279. },
  21280. landmark: {
  21281. impact: 'serious',
  21282. messages: {
  21283. pass: 'Page has a landmark region',
  21284. fail: 'Page does not have a landmark region'
  21285. }
  21286. },
  21287. 'meta-refresh': {
  21288. impact: 'critical',
  21289. messages: {
  21290. pass: '<meta> tag does not immediately refresh the page',
  21291. fail: '<meta> tag forces timed refresh of page'
  21292. }
  21293. },
  21294. 'p-as-heading': {
  21295. impact: 'serious',
  21296. messages: {
  21297. pass: '<p> elements are not styled as headings',
  21298. fail: 'Heading elements should be used instead of styled p elements'
  21299. }
  21300. },
  21301. region: {
  21302. impact: 'moderate',
  21303. messages: {
  21304. pass: 'All page content is contained by landmarks',
  21305. fail: 'Some page content is not contained by landmarks'
  21306. }
  21307. },
  21308. 'skip-link': {
  21309. impact: 'moderate',
  21310. messages: {
  21311. pass: 'Skip link target exists',
  21312. incomplete: 'Skip link target should become visible on activation',
  21313. fail: 'No skip link target'
  21314. }
  21315. },
  21316. 'unique-frame-title': {
  21317. impact: 'serious',
  21318. messages: {
  21319. pass: 'Element\'s title attribute is unique',
  21320. fail: 'Element\'s title attribute is not unique'
  21321. }
  21322. },
  21323. 'duplicate-id-active': {
  21324. impact: 'serious',
  21325. messages: {
  21326. pass: 'Document has no active elements that share the same id attribute',
  21327. fail: 'Document has active elements with the same id attribute: ${data}'
  21328. }
  21329. },
  21330. 'duplicate-id-aria': {
  21331. impact: 'critical',
  21332. messages: {
  21333. pass: 'Document has no elements referenced with ARIA or labels that share the same id attribute',
  21334. fail: 'Document has multiple elements referenced with ARIA with the same id attribute: ${data}'
  21335. }
  21336. },
  21337. 'duplicate-id': {
  21338. impact: 'minor',
  21339. messages: {
  21340. pass: 'Document has no static elements that share the same id attribute',
  21341. fail: 'Document has multiple static elements with the same id attribute: ${data}'
  21342. }
  21343. },
  21344. 'aria-label': {
  21345. impact: 'serious',
  21346. messages: {
  21347. pass: 'aria-label attribute exists and is not empty',
  21348. fail: 'aria-label attribute does not exist or is empty'
  21349. }
  21350. },
  21351. 'aria-labelledby': {
  21352. impact: 'serious',
  21353. messages: {
  21354. pass: 'aria-labelledby attribute exists and references elements that are visible to screen readers',
  21355. fail: 'aria-labelledby attribute does not exist, references elements that do not exist or references elements that are empty',
  21356. incomplete: 'ensure aria-labelledby references an existing element'
  21357. }
  21358. },
  21359. 'avoid-inline-spacing': {
  21360. impact: 'serious',
  21361. messages: {
  21362. pass: 'No inline styles with \'!important\' that affect text spacing has been specified',
  21363. fail: {
  21364. singular: 'Remove \'!important\' from inline style ${data.values}, as overriding this is not supported by most browsers',
  21365. plural: 'Remove \'!important\' from inline styles ${data.values}, as overriding this is not supported by most browsers'
  21366. }
  21367. }
  21368. },
  21369. 'button-has-visible-text': {
  21370. impact: 'critical',
  21371. messages: {
  21372. pass: 'Element has inner text that is visible to screen readers',
  21373. fail: 'Element does not have inner text that is visible to screen readers',
  21374. incomplete: 'Unable to determine if element has children'
  21375. }
  21376. },
  21377. 'doc-has-title': {
  21378. impact: 'serious',
  21379. messages: {
  21380. pass: 'Document has a non-empty <title> element',
  21381. fail: 'Document does not have a non-empty <title> element'
  21382. }
  21383. },
  21384. exists: {
  21385. impact: 'minor',
  21386. messages: {
  21387. pass: 'Element does not exist',
  21388. incomplete: 'Element exists'
  21389. }
  21390. },
  21391. 'has-alt': {
  21392. impact: 'critical',
  21393. messages: {
  21394. pass: 'Element has an alt attribute',
  21395. fail: 'Element does not have an alt attribute'
  21396. }
  21397. },
  21398. 'has-visible-text': {
  21399. impact: 'minor',
  21400. messages: {
  21401. pass: 'Element has text that is visible to screen readers',
  21402. fail: 'Element does not have text that is visible to screen readers',
  21403. incomplete: 'Unable to determine if element has children'
  21404. }
  21405. },
  21406. 'is-on-screen': {
  21407. impact: 'serious',
  21408. messages: {
  21409. pass: 'Element is not visible',
  21410. fail: 'Element is visible'
  21411. }
  21412. },
  21413. 'non-empty-alt': {
  21414. impact: 'critical',
  21415. messages: {
  21416. pass: 'Element has a non-empty alt attribute',
  21417. fail: {
  21418. noAttr: 'Element has no alt attribute',
  21419. emptyAttr: 'Element has an empty alt attribute'
  21420. }
  21421. }
  21422. },
  21423. 'non-empty-if-present': {
  21424. impact: 'critical',
  21425. messages: {
  21426. pass: {
  21427. default: 'Element does not have a value attribute',
  21428. 'has-label': 'Element has a non-empty value attribute'
  21429. },
  21430. fail: 'Element has a value attribute and the value attribute is empty'
  21431. }
  21432. },
  21433. 'non-empty-placeholder': {
  21434. impact: 'serious',
  21435. messages: {
  21436. pass: 'Element has a placeholder attribute',
  21437. fail: {
  21438. noAttr: 'Element has no placeholder attribute',
  21439. emptyAttr: 'Element has an empty placeholder attribute'
  21440. }
  21441. }
  21442. },
  21443. 'non-empty-title': {
  21444. impact: 'serious',
  21445. messages: {
  21446. pass: 'Element has a title attribute',
  21447. fail: {
  21448. noAttr: 'Element has no title attribute',
  21449. emptyAttr: 'Element has an empty title attribute'
  21450. }
  21451. }
  21452. },
  21453. 'non-empty-value': {
  21454. impact: 'critical',
  21455. messages: {
  21456. pass: 'Element has a non-empty value attribute',
  21457. fail: {
  21458. noAttr: 'Element has no value attribute',
  21459. emptyAttr: 'Element has an empty value attribute'
  21460. }
  21461. }
  21462. },
  21463. 'presentational-role': {
  21464. impact: 'minor',
  21465. messages: {
  21466. pass: 'Element\'s default semantics were overriden with role="${data.role}"',
  21467. fail: {
  21468. default: 'Element\'s default semantics were not overridden with role="none" or role="presentation"',
  21469. globalAria: 'Element\'s role is not presentational because it has a global ARIA attribute',
  21470. focusable: 'Element\'s role is not presentational because it is focusable',
  21471. both: 'Element\'s role is not presentational because it has a global ARIA attribute and is focusable'
  21472. }
  21473. }
  21474. },
  21475. 'role-none': {
  21476. impact: 'minor',
  21477. messages: {
  21478. pass: 'Element\'s default semantics were overriden with role="none"',
  21479. fail: 'Element\'s default semantics were not overridden with role="none"'
  21480. }
  21481. },
  21482. 'role-presentation': {
  21483. impact: 'minor',
  21484. messages: {
  21485. pass: 'Element\'s default semantics were overriden with role="presentation"',
  21486. fail: 'Element\'s default semantics were not overridden with role="presentation"'
  21487. }
  21488. },
  21489. 'svg-non-empty-title': {
  21490. impact: 'serious',
  21491. messages: {
  21492. pass: 'Element has a child that is a title',
  21493. fail: {
  21494. noTitle: 'Element has no child that is a title',
  21495. emptyTitle: 'Element child title is empty'
  21496. },
  21497. incomplete: 'Unable to determine element has a child that is a title'
  21498. }
  21499. },
  21500. 'caption-faked': {
  21501. impact: 'serious',
  21502. messages: {
  21503. pass: 'The first row of a table is not used as a caption',
  21504. fail: 'The first child of the table should be a caption instead of a table cell'
  21505. }
  21506. },
  21507. 'html5-scope': {
  21508. impact: 'moderate',
  21509. messages: {
  21510. pass: 'Scope attribute is only used on table header elements (<th>)',
  21511. fail: 'In HTML 5, scope attributes may only be used on table header elements (<th>)'
  21512. }
  21513. },
  21514. 'same-caption-summary': {
  21515. impact: 'minor',
  21516. messages: {
  21517. pass: 'Content of summary attribute and <caption> are not duplicated',
  21518. fail: 'Content of summary attribute and <caption> element are identical'
  21519. }
  21520. },
  21521. 'scope-value': {
  21522. impact: 'critical',
  21523. messages: {
  21524. pass: 'Scope attribute is used correctly',
  21525. fail: 'The value of the scope attribute may only be \'row\' or \'col\''
  21526. }
  21527. },
  21528. 'td-has-header': {
  21529. impact: 'critical',
  21530. messages: {
  21531. pass: 'All non-empty data cells have table headers',
  21532. fail: 'Some non-empty data cells do not have table headers'
  21533. }
  21534. },
  21535. 'td-headers-attr': {
  21536. impact: 'serious',
  21537. messages: {
  21538. pass: 'The headers attribute is exclusively used to refer to other cells in the table',
  21539. incomplete: 'The headers attribute is empty',
  21540. fail: 'The headers attribute is not exclusively used to refer to other cells in the table'
  21541. }
  21542. },
  21543. 'th-has-data-cells': {
  21544. impact: 'serious',
  21545. messages: {
  21546. pass: 'All table header cells refer to data cells',
  21547. fail: 'Not all table header cells refer to data cells',
  21548. incomplete: 'Table data cells are missing or empty'
  21549. }
  21550. },
  21551. 'hidden-content': {
  21552. impact: 'minor',
  21553. messages: {
  21554. pass: 'All content on the page has been analyzed.',
  21555. fail: 'There were problems analyzing the content on this page.',
  21556. incomplete: 'There is hidden content on the page that was not analyzed. You will need to trigger the display of this content in order to analyze it.'
  21557. }
  21558. }
  21559. },
  21560. failureSummaries: {
  21561. any: {
  21562. failureMessage: function anonymous(it) {
  21563. var out = 'Fix any of the following:';
  21564. var arr1 = it;
  21565. if (arr1) {
  21566. var value, i1 = -1, l1 = arr1.length - 1;
  21567. while (i1 < l1) {
  21568. value = arr1[i1 += 1];
  21569. out += '\n ' + value.split('\n').join('\n ');
  21570. }
  21571. }
  21572. return out;
  21573. }
  21574. },
  21575. none: {
  21576. failureMessage: function anonymous(it) {
  21577. var out = 'Fix all of the following:';
  21578. var arr1 = it;
  21579. if (arr1) {
  21580. var value, i1 = -1, l1 = arr1.length - 1;
  21581. while (i1 < l1) {
  21582. value = arr1[i1 += 1];
  21583. out += '\n ' + value.split('\n').join('\n ');
  21584. }
  21585. }
  21586. return out;
  21587. }
  21588. }
  21589. },
  21590. incompleteFallbackMessage: {}
  21591. },
  21592. rules: [ {
  21593. id: 'accesskeys',
  21594. selector: '[accesskey]',
  21595. excludeHidden: false,
  21596. tags: [ 'cat.keyboard', 'best-practice' ],
  21597. all: [],
  21598. any: [],
  21599. none: [ 'accesskeys' ]
  21600. }, {
  21601. id: 'area-alt',
  21602. selector: 'map area[href]',
  21603. excludeHidden: false,
  21604. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'wcag244', 'wcag412', 'section508', 'section508.22.a', 'ACT' ],
  21605. all: [],
  21606. any: [ {
  21607. options: {
  21608. attribute: 'alt'
  21609. },
  21610. id: 'non-empty-alt'
  21611. }, {
  21612. options: {
  21613. attribute: 'title'
  21614. },
  21615. id: 'non-empty-title'
  21616. }, 'aria-label', 'aria-labelledby' ],
  21617. none: []
  21618. }, {
  21619. id: 'aria-allowed-attr',
  21620. matches: 'aria-allowed-attr-matches',
  21621. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21622. all: [],
  21623. any: [ 'aria-allowed-attr' ],
  21624. none: [ 'aria-unsupported-attr' ]
  21625. }, {
  21626. id: 'aria-allowed-role',
  21627. excludeHidden: false,
  21628. selector: '[role]',
  21629. matches: 'aria-allowed-role-matches',
  21630. tags: [ 'cat.aria', 'best-practice' ],
  21631. all: [],
  21632. any: [ {
  21633. options: {
  21634. allowImplicit: true,
  21635. ignoredTags: []
  21636. },
  21637. id: 'aria-allowed-role'
  21638. } ],
  21639. none: []
  21640. }, {
  21641. id: 'aria-command-name',
  21642. selector: '[role="link"], [role="button"], [role="menuitem"]',
  21643. matches: 'no-naming-method-matches',
  21644. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21645. all: [],
  21646. any: [ 'aria-label', 'aria-labelledby', {
  21647. options: {
  21648. attribute: 'title'
  21649. },
  21650. id: 'non-empty-title'
  21651. }, 'has-visible-text' ],
  21652. none: []
  21653. }, {
  21654. id: 'aria-dialog-name',
  21655. selector: '[role="dialog"], [role="alertdialog"]',
  21656. matches: 'no-naming-method-matches',
  21657. tags: [ 'cat.aria', 'best-practice' ],
  21658. all: [],
  21659. any: [ 'aria-label', 'aria-labelledby', {
  21660. options: {
  21661. attribute: 'title'
  21662. },
  21663. id: 'non-empty-title'
  21664. } ],
  21665. none: []
  21666. }, {
  21667. id: 'aria-hidden-body',
  21668. selector: 'body',
  21669. excludeHidden: false,
  21670. matches: 'is-initiator-matches',
  21671. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21672. all: [],
  21673. any: [ 'aria-hidden-body' ],
  21674. none: []
  21675. }, {
  21676. id: 'aria-hidden-focus',
  21677. selector: '[aria-hidden="true"]',
  21678. matches: 'aria-hidden-focus-matches',
  21679. excludeHidden: false,
  21680. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'wcag131' ],
  21681. all: [ 'focusable-modal-open', 'focusable-disabled', 'focusable-not-tabbable' ],
  21682. any: [],
  21683. none: []
  21684. }, {
  21685. id: 'aria-input-field-name',
  21686. selector: '[role="combobox"], [role="listbox"], [role="searchbox"], [role="slider"], [role="spinbutton"], [role="textbox"]',
  21687. matches: 'no-naming-method-matches',
  21688. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT' ],
  21689. all: [],
  21690. any: [ 'aria-label', 'aria-labelledby', {
  21691. options: {
  21692. attribute: 'title'
  21693. },
  21694. id: 'non-empty-title'
  21695. } ],
  21696. none: [ 'no-implicit-explicit-label' ]
  21697. }, {
  21698. id: 'aria-meter-name',
  21699. selector: '[role="meter"]',
  21700. matches: 'no-naming-method-matches',
  21701. tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
  21702. all: [],
  21703. any: [ 'aria-label', 'aria-labelledby', {
  21704. options: {
  21705. attribute: 'title'
  21706. },
  21707. id: 'non-empty-title'
  21708. } ],
  21709. none: []
  21710. }, {
  21711. id: 'aria-progressbar-name',
  21712. selector: '[role="progressbar"]',
  21713. matches: 'no-naming-method-matches',
  21714. tags: [ 'cat.aria', 'wcag2a', 'wcag111' ],
  21715. all: [],
  21716. any: [ 'aria-label', 'aria-labelledby', {
  21717. options: {
  21718. attribute: 'title'
  21719. },
  21720. id: 'non-empty-title'
  21721. } ],
  21722. none: []
  21723. }, {
  21724. id: 'aria-required-attr',
  21725. selector: '[role]',
  21726. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21727. all: [],
  21728. any: [ 'aria-required-attr' ],
  21729. none: []
  21730. }, {
  21731. id: 'aria-required-children',
  21732. selector: '[role]',
  21733. tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
  21734. all: [],
  21735. any: [ {
  21736. options: {
  21737. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  21738. },
  21739. id: 'aria-required-children'
  21740. } ],
  21741. none: []
  21742. }, {
  21743. id: 'aria-required-parent',
  21744. selector: '[role]',
  21745. tags: [ 'cat.aria', 'wcag2a', 'wcag131' ],
  21746. all: [],
  21747. any: [ 'aria-required-parent' ],
  21748. none: []
  21749. }, {
  21750. id: 'aria-roledescription',
  21751. selector: '[aria-roledescription]',
  21752. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21753. all: [],
  21754. any: [ {
  21755. options: {
  21756. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  21757. },
  21758. id: 'aria-roledescription'
  21759. } ],
  21760. none: []
  21761. }, {
  21762. id: 'aria-roles',
  21763. selector: '[role]',
  21764. matches: 'no-empty-role-matches',
  21765. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21766. all: [],
  21767. any: [],
  21768. none: [ 'fallbackrole', 'invalidrole', 'abstractrole', 'unsupportedrole' ]
  21769. }, {
  21770. id: 'aria-toggle-field-name',
  21771. selector: '[role="checkbox"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="radio"], [role="switch"], [role="option"]',
  21772. matches: 'no-naming-method-matches',
  21773. tags: [ 'cat.aria', 'wcag2a', 'wcag412', 'ACT' ],
  21774. all: [],
  21775. any: [ 'aria-label', 'aria-labelledby', {
  21776. options: {
  21777. attribute: 'title'
  21778. },
  21779. id: 'non-empty-title'
  21780. }, 'has-visible-text' ],
  21781. none: [ 'no-implicit-explicit-label' ]
  21782. }, {
  21783. id: 'aria-tooltip-name',
  21784. selector: '[role="tooltip"]',
  21785. matches: 'no-naming-method-matches',
  21786. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21787. all: [],
  21788. any: [ 'aria-label', 'aria-labelledby', {
  21789. options: {
  21790. attribute: 'title'
  21791. },
  21792. id: 'non-empty-title'
  21793. }, 'has-visible-text' ],
  21794. none: []
  21795. }, {
  21796. id: 'aria-treeitem-name',
  21797. selector: '[role="treeitem"]',
  21798. matches: 'no-naming-method-matches',
  21799. tags: [ 'cat.aria', 'best-practice' ],
  21800. all: [],
  21801. any: [ 'has-visible-text', 'aria-labelledby', 'aria-label', {
  21802. options: {
  21803. attribute: 'title'
  21804. },
  21805. id: 'non-empty-title'
  21806. } ],
  21807. none: []
  21808. }, {
  21809. id: 'aria-valid-attr-value',
  21810. matches: 'aria-has-attr-matches',
  21811. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21812. all: [ {
  21813. options: [],
  21814. id: 'aria-valid-attr-value'
  21815. }, 'aria-errormessage' ],
  21816. any: [],
  21817. none: []
  21818. }, {
  21819. id: 'aria-valid-attr',
  21820. matches: 'aria-has-attr-matches',
  21821. tags: [ 'cat.aria', 'wcag2a', 'wcag412' ],
  21822. all: [],
  21823. any: [ {
  21824. options: [],
  21825. id: 'aria-valid-attr'
  21826. } ],
  21827. none: []
  21828. }, {
  21829. id: 'audio-caption',
  21830. selector: 'audio',
  21831. enabled: false,
  21832. excludeHidden: false,
  21833. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag121', 'section508', 'section508.22.a' ],
  21834. all: [],
  21835. any: [],
  21836. none: [ 'caption' ]
  21837. }, {
  21838. id: 'autocomplete-valid',
  21839. matches: 'autocomplete-matches',
  21840. tags: [ 'cat.forms', 'wcag21aa', 'wcag135' ],
  21841. all: [ 'autocomplete-valid', 'autocomplete-appropriate' ],
  21842. any: [],
  21843. none: []
  21844. }, {
  21845. id: 'avoid-inline-spacing',
  21846. selector: '[style]',
  21847. tags: [ 'cat.structure', 'wcag21aa', 'wcag1412' ],
  21848. all: [ {
  21849. options: {
  21850. cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
  21851. },
  21852. id: 'avoid-inline-spacing'
  21853. } ],
  21854. any: [],
  21855. none: []
  21856. }, {
  21857. id: 'blink',
  21858. selector: 'blink',
  21859. excludeHidden: false,
  21860. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag222', 'section508', 'section508.22.j' ],
  21861. all: [],
  21862. any: [],
  21863. none: [ 'is-on-screen' ]
  21864. }, {
  21865. id: 'button-name',
  21866. selector: 'button',
  21867. matches: 'no-explicit-name-required-matches',
  21868. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a', 'ACT' ],
  21869. all: [],
  21870. any: [ 'button-has-visible-text', 'aria-label', 'aria-labelledby', 'presentational-role', {
  21871. options: {
  21872. attribute: 'title'
  21873. },
  21874. id: 'non-empty-title'
  21875. } ],
  21876. none: []
  21877. }, {
  21878. id: 'bypass',
  21879. selector: 'html',
  21880. pageLevel: true,
  21881. matches: 'bypass-matches',
  21882. tags: [ 'cat.keyboard', 'wcag2a', 'wcag241', 'section508', 'section508.22.o' ],
  21883. all: [],
  21884. any: [ 'internal-link-present', {
  21885. options: {
  21886. selector: 'h1:not([role]), h2:not([role]), h3:not([role]), h4:not([role]), h5:not([role]), h6:not([role]), [role=heading]'
  21887. },
  21888. id: 'header-present'
  21889. }, {
  21890. options: {
  21891. selector: 'main, [role=main]'
  21892. },
  21893. id: 'landmark'
  21894. } ],
  21895. none: []
  21896. }, {
  21897. id: 'color-contrast',
  21898. matches: 'color-contrast-matches',
  21899. excludeHidden: false,
  21900. tags: [ 'cat.color', 'wcag2aa', 'wcag143' ],
  21901. all: [],
  21902. any: [ {
  21903. options: {
  21904. ignoreUnicode: true,
  21905. ignoreLength: false,
  21906. boldValue: 700,
  21907. boldTextPt: 14,
  21908. largeTextPt: 18,
  21909. contrastRatio: {
  21910. normal: {
  21911. expected: 4.5
  21912. },
  21913. large: {
  21914. expected: 3
  21915. }
  21916. },
  21917. shadowOutlineEmMax: .1
  21918. },
  21919. id: 'color-contrast'
  21920. } ],
  21921. none: []
  21922. }, {
  21923. id: 'css-orientation-lock',
  21924. selector: 'html',
  21925. tags: [ 'cat.structure', 'wcag134', 'wcag21aa', 'experimental' ],
  21926. all: [ {
  21927. options: {
  21928. degreeThreshold: 2
  21929. },
  21930. id: 'css-orientation-lock'
  21931. } ],
  21932. any: [],
  21933. none: [],
  21934. preload: true
  21935. }, {
  21936. id: 'definition-list',
  21937. selector: 'dl',
  21938. matches: 'no-role-matches',
  21939. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  21940. all: [],
  21941. any: [],
  21942. none: [ 'structured-dlitems', 'only-dlitems' ]
  21943. }, {
  21944. id: 'dlitem',
  21945. selector: 'dd, dt',
  21946. matches: 'no-role-matches',
  21947. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  21948. all: [],
  21949. any: [ 'dlitem' ],
  21950. none: []
  21951. }, {
  21952. id: 'document-title',
  21953. selector: 'html',
  21954. matches: 'is-initiator-matches',
  21955. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag242', 'ACT' ],
  21956. all: [],
  21957. any: [ 'doc-has-title' ],
  21958. none: []
  21959. }, {
  21960. id: 'duplicate-id-active',
  21961. selector: '[id]',
  21962. matches: 'duplicate-id-active-matches',
  21963. excludeHidden: false,
  21964. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  21965. all: [],
  21966. any: [ 'duplicate-id-active' ],
  21967. none: []
  21968. }, {
  21969. id: 'duplicate-id-aria',
  21970. selector: '[id]',
  21971. matches: 'duplicate-id-aria-matches',
  21972. excludeHidden: false,
  21973. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  21974. all: [],
  21975. any: [ 'duplicate-id-aria' ],
  21976. none: []
  21977. }, {
  21978. id: 'duplicate-id',
  21979. selector: '[id]',
  21980. matches: 'duplicate-id-misc-matches',
  21981. excludeHidden: false,
  21982. tags: [ 'cat.parsing', 'wcag2a', 'wcag411' ],
  21983. all: [],
  21984. any: [ 'duplicate-id' ],
  21985. none: []
  21986. }, {
  21987. id: 'empty-heading',
  21988. selector: 'h1, h2, h3, h4, h5, h6, [role="heading"]',
  21989. matches: 'heading-matches',
  21990. tags: [ 'cat.name-role-value', 'best-practice' ],
  21991. impact: 'minor',
  21992. all: [],
  21993. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  21994. options: {
  21995. attribute: 'title'
  21996. },
  21997. id: 'non-empty-title'
  21998. } ],
  21999. none: []
  22000. }, {
  22001. id: 'focus-order-semantics',
  22002. selector: 'div, h1, h2, h3, h4, h5, h6, [role=heading], p, span',
  22003. matches: 'inserted-into-focus-order-matches',
  22004. tags: [ 'cat.keyboard', 'best-practice', 'experimental' ],
  22005. all: [],
  22006. any: [ {
  22007. options: [],
  22008. id: 'has-widget-role'
  22009. }, {
  22010. options: [],
  22011. id: 'valid-scrollable-semantics'
  22012. } ],
  22013. none: []
  22014. }, {
  22015. id: 'form-field-multiple-labels',
  22016. selector: 'input, select, textarea',
  22017. matches: 'label-matches',
  22018. tags: [ 'cat.forms', 'wcag2a', 'wcag332' ],
  22019. all: [],
  22020. any: [],
  22021. none: [ 'multiple-label' ]
  22022. }, {
  22023. id: 'frame-tested',
  22024. selector: 'frame, iframe',
  22025. tags: [ 'cat.structure', 'review-item', 'best-practice' ],
  22026. all: [ {
  22027. options: {
  22028. isViolation: false
  22029. },
  22030. id: 'frame-tested'
  22031. } ],
  22032. any: [],
  22033. none: []
  22034. }, {
  22035. id: 'frame-title-unique',
  22036. selector: 'frame[title], iframe[title]',
  22037. matches: 'frame-title-has-text-matches',
  22038. tags: [ 'cat.text-alternatives', 'best-practice' ],
  22039. all: [],
  22040. any: [],
  22041. none: [ 'unique-frame-title' ]
  22042. }, {
  22043. id: 'frame-title',
  22044. selector: 'frame, iframe',
  22045. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag241', 'wcag412', 'section508', 'section508.22.i' ],
  22046. all: [],
  22047. any: [ 'aria-label', 'aria-labelledby', {
  22048. options: {
  22049. attribute: 'title'
  22050. },
  22051. id: 'non-empty-title'
  22052. }, 'presentational-role' ],
  22053. none: []
  22054. }, {
  22055. id: 'heading-order',
  22056. selector: 'h1, h2, h3, h4, h5, h6, [role=heading]',
  22057. matches: 'heading-matches',
  22058. tags: [ 'cat.semantics', 'best-practice' ],
  22059. all: [],
  22060. any: [ 'heading-order' ],
  22061. none: []
  22062. }, {
  22063. id: 'hidden-content',
  22064. selector: '*',
  22065. excludeHidden: false,
  22066. tags: [ 'cat.structure', 'experimental', 'review-item', 'best-practice' ],
  22067. all: [],
  22068. any: [ 'hidden-content' ],
  22069. none: []
  22070. }, {
  22071. id: 'html-has-lang',
  22072. selector: 'html',
  22073. matches: 'is-initiator-matches',
  22074. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT' ],
  22075. all: [],
  22076. any: [ {
  22077. options: {
  22078. attributes: [ 'lang', 'xml:lang' ]
  22079. },
  22080. id: 'has-lang'
  22081. } ],
  22082. none: []
  22083. }, {
  22084. id: 'html-lang-valid',
  22085. selector: 'html[lang], html[xml\\:lang]',
  22086. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT' ],
  22087. all: [],
  22088. any: [],
  22089. none: [ {
  22090. options: {
  22091. attributes: [ 'lang', 'xml:lang' ]
  22092. },
  22093. id: 'valid-lang'
  22094. } ]
  22095. }, {
  22096. id: 'html-xml-lang-mismatch',
  22097. selector: 'html[lang][xml\\:lang]',
  22098. matches: 'xml-lang-mismatch-matches',
  22099. tags: [ 'cat.language', 'wcag2a', 'wcag311', 'ACT' ],
  22100. all: [ 'xml-lang-mismatch' ],
  22101. any: [],
  22102. none: []
  22103. }, {
  22104. id: 'identical-links-same-purpose',
  22105. selector: 'a[href], area[href], [role="link"]',
  22106. excludeHidden: false,
  22107. matches: 'identical-links-same-purpose-matches',
  22108. tags: [ 'cat.semantics', 'wcag2aaa', 'wcag249', 'best-practice' ],
  22109. all: [ 'identical-links-same-purpose' ],
  22110. any: [],
  22111. none: []
  22112. }, {
  22113. id: 'image-alt',
  22114. selector: 'img',
  22115. matches: 'no-explicit-name-required-matches',
  22116. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT' ],
  22117. all: [],
  22118. any: [ 'has-alt', 'aria-label', 'aria-labelledby', {
  22119. options: {
  22120. attribute: 'title'
  22121. },
  22122. id: 'non-empty-title'
  22123. }, 'presentational-role' ],
  22124. none: [ 'alt-space-value' ]
  22125. }, {
  22126. id: 'image-redundant-alt',
  22127. selector: 'img',
  22128. tags: [ 'cat.text-alternatives', 'best-practice' ],
  22129. all: [],
  22130. any: [],
  22131. none: [ {
  22132. options: {
  22133. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  22134. },
  22135. id: 'duplicate-img-label'
  22136. } ]
  22137. }, {
  22138. id: 'input-button-name',
  22139. selector: 'input[type="button"], input[type="submit"], input[type="reset"]',
  22140. matches: 'no-explicit-name-required-matches',
  22141. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'section508', 'section508.22.a' ],
  22142. all: [],
  22143. any: [ 'non-empty-if-present', {
  22144. options: {
  22145. attribute: 'value'
  22146. },
  22147. id: 'non-empty-value'
  22148. }, 'aria-label', 'aria-labelledby', 'presentational-role', {
  22149. options: {
  22150. attribute: 'title'
  22151. },
  22152. id: 'non-empty-title'
  22153. } ],
  22154. none: []
  22155. }, {
  22156. id: 'input-image-alt',
  22157. selector: 'input[type="image"]',
  22158. matches: 'no-explicit-name-required-matches',
  22159. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT' ],
  22160. all: [],
  22161. any: [ {
  22162. options: {
  22163. attribute: 'alt'
  22164. },
  22165. id: 'non-empty-alt'
  22166. }, 'aria-label', 'aria-labelledby', {
  22167. options: {
  22168. attribute: 'title'
  22169. },
  22170. id: 'non-empty-title'
  22171. } ],
  22172. none: []
  22173. }, {
  22174. id: 'label-content-name-mismatch',
  22175. matches: 'label-content-name-mismatch-matches',
  22176. tags: [ 'cat.semantics', 'wcag21a', 'wcag253', 'experimental' ],
  22177. all: [],
  22178. any: [ {
  22179. options: {
  22180. pixelThreshold: .1,
  22181. occuranceThreshold: 3
  22182. },
  22183. id: 'label-content-name-mismatch'
  22184. } ],
  22185. none: []
  22186. }, {
  22187. id: 'label-title-only',
  22188. selector: 'input, select, textarea',
  22189. matches: 'label-matches',
  22190. tags: [ 'cat.forms', 'best-practice' ],
  22191. all: [],
  22192. any: [],
  22193. none: [ 'title-only' ]
  22194. }, {
  22195. id: 'label',
  22196. selector: 'input, textarea',
  22197. matches: 'label-matches',
  22198. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'wcag131', 'section508', 'section508.22.n', 'ACT' ],
  22199. all: [],
  22200. any: [ 'aria-label', 'aria-labelledby', 'implicit-label', 'explicit-label', {
  22201. options: {
  22202. attribute: 'title'
  22203. },
  22204. id: 'non-empty-title'
  22205. }, {
  22206. options: {
  22207. attribute: 'placeholder'
  22208. },
  22209. id: 'non-empty-placeholder'
  22210. }, 'presentational-role' ],
  22211. none: [ 'help-same-as-label', 'hidden-explicit-label' ]
  22212. }, {
  22213. id: 'landmark-banner-is-top-level',
  22214. selector: 'header:not([role]), [role=banner]',
  22215. matches: 'landmark-has-body-context-matches',
  22216. tags: [ 'cat.semantics', 'best-practice' ],
  22217. all: [],
  22218. any: [ 'landmark-is-top-level' ],
  22219. none: []
  22220. }, {
  22221. id: 'landmark-complementary-is-top-level',
  22222. selector: 'aside:not([role]), [role=complementary]',
  22223. tags: [ 'cat.semantics', 'best-practice' ],
  22224. all: [],
  22225. any: [ 'landmark-is-top-level' ],
  22226. none: []
  22227. }, {
  22228. id: 'landmark-contentinfo-is-top-level',
  22229. selector: 'footer:not([role]), [role=contentinfo]',
  22230. matches: 'landmark-has-body-context-matches',
  22231. tags: [ 'cat.semantics', 'best-practice' ],
  22232. all: [],
  22233. any: [ 'landmark-is-top-level' ],
  22234. none: []
  22235. }, {
  22236. id: 'landmark-main-is-top-level',
  22237. selector: 'main:not([role]), [role=main]',
  22238. tags: [ 'cat.semantics', 'best-practice' ],
  22239. all: [],
  22240. any: [ 'landmark-is-top-level' ],
  22241. none: []
  22242. }, {
  22243. id: 'landmark-no-duplicate-banner',
  22244. selector: 'header:not([role]), [role=banner]',
  22245. tags: [ 'cat.semantics', 'best-practice' ],
  22246. all: [],
  22247. any: [ {
  22248. options: {
  22249. selector: 'header:not([role]), [role=banner]',
  22250. nativeScopeFilter: 'article, aside, main, nav, section'
  22251. },
  22252. id: 'page-no-duplicate-banner'
  22253. } ],
  22254. none: []
  22255. }, {
  22256. id: 'landmark-no-duplicate-contentinfo',
  22257. selector: 'footer:not([role]), [role=contentinfo]',
  22258. tags: [ 'cat.semantics', 'best-practice' ],
  22259. all: [],
  22260. any: [ {
  22261. options: {
  22262. selector: 'footer:not([role]), [role=contentinfo]',
  22263. nativeScopeFilter: 'article, aside, main, nav, section'
  22264. },
  22265. id: 'page-no-duplicate-contentinfo'
  22266. } ],
  22267. none: []
  22268. }, {
  22269. id: 'landmark-no-duplicate-main',
  22270. selector: 'main:not([role]), [role=main]',
  22271. tags: [ 'cat.semantics', 'best-practice' ],
  22272. all: [],
  22273. any: [ {
  22274. options: {
  22275. selector: 'main:not([role]), [role=\'main\']'
  22276. },
  22277. id: 'page-no-duplicate-main'
  22278. } ],
  22279. none: []
  22280. }, {
  22281. id: 'landmark-one-main',
  22282. selector: 'html',
  22283. tags: [ 'cat.semantics', 'best-practice' ],
  22284. all: [ {
  22285. options: {
  22286. selector: 'main:not([role]), [role=\'main\']'
  22287. },
  22288. id: 'page-has-main'
  22289. } ],
  22290. any: [],
  22291. none: []
  22292. }, {
  22293. id: 'landmark-unique',
  22294. selector: '[role=banner], [role=complementary], [role=contentinfo], [role=main], [role=navigation], [role=region], [role=search], [role=form], form, footer, header, aside, main, nav, section',
  22295. tags: [ 'cat.semantics', 'best-practice' ],
  22296. matches: 'landmark-unique-matches',
  22297. all: [],
  22298. any: [ 'landmark-is-unique' ],
  22299. none: []
  22300. }, {
  22301. id: 'link-in-text-block',
  22302. selector: 'a[href], [role=link]',
  22303. matches: 'link-in-text-block-matches',
  22304. excludeHidden: false,
  22305. tags: [ 'cat.color', 'experimental', 'wcag2a', 'wcag141' ],
  22306. all: [ 'link-in-text-block' ],
  22307. any: [],
  22308. none: []
  22309. }, {
  22310. id: 'link-name',
  22311. selector: 'a[href]',
  22312. tags: [ 'cat.name-role-value', 'wcag2a', 'wcag412', 'wcag244', 'section508', 'section508.22.a', 'ACT' ],
  22313. all: [],
  22314. any: [ 'has-visible-text', 'aria-label', 'aria-labelledby', {
  22315. options: {
  22316. attribute: 'title'
  22317. },
  22318. id: 'non-empty-title'
  22319. } ],
  22320. none: [ 'focusable-no-name' ]
  22321. }, {
  22322. id: 'list',
  22323. selector: 'ul, ol',
  22324. matches: 'no-role-matches',
  22325. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  22326. all: [],
  22327. any: [],
  22328. none: [ 'only-listitems' ]
  22329. }, {
  22330. id: 'listitem',
  22331. selector: 'li',
  22332. matches: 'no-role-matches',
  22333. tags: [ 'cat.structure', 'wcag2a', 'wcag131' ],
  22334. all: [],
  22335. any: [ 'listitem' ],
  22336. none: []
  22337. }, {
  22338. id: 'marquee',
  22339. selector: 'marquee',
  22340. excludeHidden: false,
  22341. tags: [ 'cat.parsing', 'wcag2a', 'wcag222' ],
  22342. all: [],
  22343. any: [],
  22344. none: [ 'is-on-screen' ]
  22345. }, {
  22346. id: 'meta-refresh',
  22347. selector: 'meta[http-equiv="refresh"]',
  22348. excludeHidden: false,
  22349. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag2aaa', 'wcag221', 'wcag224', 'wcag325' ],
  22350. all: [],
  22351. any: [ 'meta-refresh' ],
  22352. none: []
  22353. }, {
  22354. id: 'meta-viewport-large',
  22355. selector: 'meta[name="viewport"]',
  22356. excludeHidden: false,
  22357. tags: [ 'cat.sensory-and-visual-cues', 'best-practice' ],
  22358. all: [],
  22359. any: [ {
  22360. options: {
  22361. scaleMinimum: 5,
  22362. lowerBound: 2
  22363. },
  22364. id: 'meta-viewport-large'
  22365. } ],
  22366. none: []
  22367. }, {
  22368. id: 'meta-viewport',
  22369. selector: 'meta[name="viewport"]',
  22370. excludeHidden: false,
  22371. tags: [ 'cat.sensory-and-visual-cues', 'best-practice', 'ACT' ],
  22372. all: [],
  22373. any: [ {
  22374. options: {
  22375. scaleMinimum: 2
  22376. },
  22377. id: 'meta-viewport'
  22378. } ],
  22379. none: []
  22380. }, {
  22381. id: 'no-autoplay-audio',
  22382. excludeHidden: false,
  22383. selector: 'audio[autoplay], video[autoplay]',
  22384. matches: 'no-autoplay-audio-matches',
  22385. tags: [ 'cat.time-and-media', 'wcag2a', 'wcag142', 'experimental' ],
  22386. preload: true,
  22387. all: [ {
  22388. options: {
  22389. allowedDuration: 3
  22390. },
  22391. id: 'no-autoplay-audio'
  22392. } ],
  22393. any: [],
  22394. none: []
  22395. }, {
  22396. id: 'object-alt',
  22397. selector: 'object',
  22398. matches: 'no-explicit-name-required-matches',
  22399. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a' ],
  22400. all: [],
  22401. any: [ 'aria-label', 'aria-labelledby', {
  22402. options: {
  22403. attribute: 'title'
  22404. },
  22405. id: 'non-empty-title'
  22406. }, 'presentational-role' ],
  22407. none: []
  22408. }, {
  22409. id: 'p-as-heading',
  22410. selector: 'p',
  22411. matches: 'p-as-heading-matches',
  22412. tags: [ 'cat.semantics', 'wcag2a', 'wcag131', 'experimental' ],
  22413. all: [ {
  22414. options: {
  22415. margins: [ {
  22416. weight: 150,
  22417. italic: true
  22418. }, {
  22419. weight: 150,
  22420. size: 1.15
  22421. }, {
  22422. italic: true,
  22423. size: 1.15
  22424. }, {
  22425. size: 1.4
  22426. } ]
  22427. },
  22428. id: 'p-as-heading'
  22429. } ],
  22430. any: [],
  22431. none: []
  22432. }, {
  22433. id: 'page-has-heading-one',
  22434. selector: 'html',
  22435. tags: [ 'cat.semantics', 'best-practice' ],
  22436. all: [ {
  22437. options: {
  22438. selector: 'h1:not([role]):not([aria-level]), h1:not([role])[aria-level=1], h2:not([role])[aria-level=1], h3:not([role])[aria-level=1], h4:not([role])[aria-level=1], h5:not([role])[aria-level=1], h6:not([role])[aria-level=1], [role=heading][aria-level=1]'
  22439. },
  22440. id: 'page-has-heading-one'
  22441. } ],
  22442. any: [],
  22443. none: []
  22444. }, {
  22445. id: 'presentation-role-conflict',
  22446. selector: '[role="none"], [role="presentation"]',
  22447. tags: [ 'cat.aria', 'best-practice' ],
  22448. all: [],
  22449. any: [],
  22450. none: [ 'is-element-focusable', 'has-global-aria-attribute' ]
  22451. }, {
  22452. id: 'region',
  22453. selector: 'body *',
  22454. tags: [ 'cat.keyboard', 'best-practice' ],
  22455. all: [],
  22456. any: [ {
  22457. options: {
  22458. regionMatcher: 'dialog, [role=dialog], svg, iframe'
  22459. },
  22460. id: 'region'
  22461. } ],
  22462. none: []
  22463. }, {
  22464. id: 'role-img-alt',
  22465. selector: '[role=\'img\']:not(img):not(area):not(input):not(object)',
  22466. matches: 'html-namespace-matches',
  22467. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT' ],
  22468. all: [],
  22469. any: [ 'aria-label', 'aria-labelledby', {
  22470. options: {
  22471. attribute: 'title'
  22472. },
  22473. id: 'non-empty-title'
  22474. } ],
  22475. none: []
  22476. }, {
  22477. id: 'scope-attr-valid',
  22478. selector: 'td[scope], th[scope]',
  22479. tags: [ 'cat.tables', 'best-practice' ],
  22480. all: [ 'html5-scope', {
  22481. options: {
  22482. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  22483. },
  22484. id: 'scope-value'
  22485. } ],
  22486. any: [],
  22487. none: []
  22488. }, {
  22489. id: 'scrollable-region-focusable',
  22490. matches: 'scrollable-region-focusable-matches',
  22491. tags: [ 'cat.keyboard', 'wcag2a', 'wcag211' ],
  22492. all: [],
  22493. any: [ 'focusable-content', 'focusable-element' ],
  22494. none: []
  22495. }, {
  22496. id: 'select-name',
  22497. selector: 'select',
  22498. tags: [ 'cat.forms', 'wcag2a', 'wcag412', 'wcag131', 'section508', 'section508.22.n', 'ACT' ],
  22499. all: [],
  22500. any: [ 'aria-label', 'aria-labelledby', 'implicit-label', 'explicit-label', {
  22501. options: {
  22502. attribute: 'title'
  22503. },
  22504. id: 'non-empty-title'
  22505. }, 'presentational-role' ],
  22506. none: [ 'help-same-as-label', 'hidden-explicit-label' ]
  22507. }, {
  22508. id: 'server-side-image-map',
  22509. selector: 'img[ismap]',
  22510. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag211', 'section508', 'section508.22.f' ],
  22511. all: [],
  22512. any: [],
  22513. none: [ 'exists' ]
  22514. }, {
  22515. id: 'skip-link',
  22516. selector: 'a[href^="#"], a[href^="/#"]',
  22517. matches: 'skip-link-matches',
  22518. tags: [ 'cat.keyboard', 'best-practice' ],
  22519. all: [],
  22520. any: [ 'skip-link' ],
  22521. none: []
  22522. }, {
  22523. id: 'svg-img-alt',
  22524. selector: '[role="img"], [role="graphics-symbol"], svg[role="graphics-document"]',
  22525. matches: 'svg-namespace-matches',
  22526. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag111', 'section508', 'section508.22.a', 'ACT' ],
  22527. all: [],
  22528. any: [ 'svg-non-empty-title', 'aria-label', 'aria-labelledby', {
  22529. options: {
  22530. attribute: 'title'
  22531. },
  22532. id: 'non-empty-title'
  22533. } ],
  22534. none: []
  22535. }, {
  22536. id: 'tabindex',
  22537. selector: '[tabindex]',
  22538. tags: [ 'cat.keyboard', 'best-practice' ],
  22539. all: [],
  22540. any: [ 'tabindex' ],
  22541. none: []
  22542. }, {
  22543. id: 'table-duplicate-name',
  22544. selector: 'table',
  22545. tags: [ 'cat.tables', 'best-practice' ],
  22546. all: [],
  22547. any: [],
  22548. none: [ 'same-caption-summary' ]
  22549. }, {
  22550. id: 'table-fake-caption',
  22551. selector: 'table',
  22552. matches: 'data-table-matches',
  22553. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  22554. all: [ 'caption-faked' ],
  22555. any: [],
  22556. none: []
  22557. }, {
  22558. id: 'td-has-header',
  22559. selector: 'table',
  22560. matches: 'data-table-large-matches',
  22561. tags: [ 'cat.tables', 'experimental', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  22562. all: [ 'td-has-header' ],
  22563. any: [],
  22564. none: []
  22565. }, {
  22566. id: 'td-headers-attr',
  22567. selector: 'table',
  22568. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  22569. all: [ 'td-headers-attr' ],
  22570. any: [],
  22571. none: []
  22572. }, {
  22573. id: 'th-has-data-cells',
  22574. selector: 'table',
  22575. matches: 'data-table-matches',
  22576. tags: [ 'cat.tables', 'wcag2a', 'wcag131', 'section508', 'section508.22.g' ],
  22577. all: [ 'th-has-data-cells' ],
  22578. any: [],
  22579. none: []
  22580. }, {
  22581. id: 'valid-lang',
  22582. selector: '[lang], [xml\\:lang]',
  22583. matches: 'not-html-matches',
  22584. tags: [ 'cat.language', 'wcag2aa', 'wcag312' ],
  22585. all: [],
  22586. any: [],
  22587. none: [ {
  22588. options: {
  22589. attributes: [ 'lang', 'xml:lang' ]
  22590. },
  22591. id: 'valid-lang'
  22592. } ]
  22593. }, {
  22594. id: 'video-caption',
  22595. selector: 'video',
  22596. excludeHidden: false,
  22597. tags: [ 'cat.text-alternatives', 'wcag2a', 'wcag122', 'section508', 'section508.22.a' ],
  22598. all: [],
  22599. any: [],
  22600. none: [ 'caption' ]
  22601. } ],
  22602. checks: [ {
  22603. id: 'abstractrole',
  22604. evaluate: 'abstractrole-evaluate'
  22605. }, {
  22606. id: 'aria-allowed-attr',
  22607. evaluate: 'aria-allowed-attr-evaluate'
  22608. }, {
  22609. id: 'aria-allowed-role',
  22610. evaluate: 'aria-allowed-role-evaluate',
  22611. options: {
  22612. allowImplicit: true,
  22613. ignoredTags: []
  22614. }
  22615. }, {
  22616. id: 'aria-errormessage',
  22617. evaluate: 'aria-errormessage-evaluate'
  22618. }, {
  22619. id: 'aria-hidden-body',
  22620. evaluate: 'aria-hidden-body-evaluate'
  22621. }, {
  22622. id: 'aria-required-attr',
  22623. evaluate: 'aria-required-attr-evaluate'
  22624. }, {
  22625. id: 'aria-required-children',
  22626. evaluate: 'aria-required-children-evaluate',
  22627. options: {
  22628. reviewEmpty: [ 'doc-bibliography', 'doc-endnotes', 'grid', 'list', 'listbox', 'table', 'tablist', 'tree', 'treegrid', 'rowgroup' ]
  22629. }
  22630. }, {
  22631. id: 'aria-required-parent',
  22632. evaluate: 'aria-required-parent-evaluate'
  22633. }, {
  22634. id: 'aria-roledescription',
  22635. evaluate: 'aria-roledescription-evaluate',
  22636. options: {
  22637. supportedRoles: [ 'button', 'img', 'checkbox', 'radio', 'combobox', 'menuitemcheckbox', 'menuitemradio' ]
  22638. }
  22639. }, {
  22640. id: 'aria-unsupported-attr',
  22641. evaluate: 'aria-unsupported-attr-evaluate'
  22642. }, {
  22643. id: 'aria-valid-attr-value',
  22644. evaluate: 'aria-valid-attr-value-evaluate',
  22645. options: []
  22646. }, {
  22647. id: 'aria-valid-attr',
  22648. evaluate: 'aria-valid-attr-evaluate',
  22649. options: []
  22650. }, {
  22651. id: 'fallbackrole',
  22652. evaluate: 'fallbackrole-evaluate'
  22653. }, {
  22654. id: 'has-global-aria-attribute',
  22655. evaluate: 'has-global-aria-attribute-evaluate'
  22656. }, {
  22657. id: 'has-widget-role',
  22658. evaluate: 'has-widget-role-evaluate',
  22659. options: []
  22660. }, {
  22661. id: 'invalidrole',
  22662. evaluate: 'invalidrole-evaluate'
  22663. }, {
  22664. id: 'is-element-focusable',
  22665. evaluate: 'is-element-focusable-evaluate'
  22666. }, {
  22667. id: 'no-implicit-explicit-label',
  22668. evaluate: 'no-implicit-explicit-label-evaluate'
  22669. }, {
  22670. id: 'unsupportedrole',
  22671. evaluate: 'unsupportedrole-evaluate'
  22672. }, {
  22673. id: 'valid-scrollable-semantics',
  22674. evaluate: 'valid-scrollable-semantics-evaluate',
  22675. options: []
  22676. }, {
  22677. id: 'color-contrast',
  22678. evaluate: 'color-contrast-evaluate',
  22679. options: {
  22680. ignoreUnicode: true,
  22681. ignoreLength: false,
  22682. boldValue: 700,
  22683. boldTextPt: 14,
  22684. largeTextPt: 18,
  22685. contrastRatio: {
  22686. normal: {
  22687. expected: 4.5
  22688. },
  22689. large: {
  22690. expected: 3
  22691. }
  22692. },
  22693. shadowOutlineEmMax: .1
  22694. }
  22695. }, {
  22696. id: 'link-in-text-block',
  22697. evaluate: 'link-in-text-block-evaluate'
  22698. }, {
  22699. id: 'autocomplete-appropriate',
  22700. evaluate: 'autocomplete-appropriate-evaluate'
  22701. }, {
  22702. id: 'autocomplete-valid',
  22703. evaluate: 'autocomplete-valid-evaluate'
  22704. }, {
  22705. id: 'accesskeys',
  22706. evaluate: 'accesskeys-evaluate',
  22707. after: 'accesskeys-after'
  22708. }, {
  22709. id: 'focusable-content',
  22710. evaluate: 'focusable-content-evaluate'
  22711. }, {
  22712. id: 'focusable-disabled',
  22713. evaluate: 'focusable-disabled-evaluate'
  22714. }, {
  22715. id: 'focusable-element',
  22716. evaluate: 'focusable-element-evaluate'
  22717. }, {
  22718. id: 'focusable-modal-open',
  22719. evaluate: 'focusable-modal-open-evaluate'
  22720. }, {
  22721. id: 'focusable-no-name',
  22722. evaluate: 'focusable-no-name-evaluate'
  22723. }, {
  22724. id: 'focusable-not-tabbable',
  22725. evaluate: 'focusable-not-tabbable-evaluate'
  22726. }, {
  22727. id: 'landmark-is-top-level',
  22728. evaluate: 'landmark-is-top-level-evaluate'
  22729. }, {
  22730. id: 'page-has-heading-one',
  22731. evaluate: 'has-descendant-evaluate',
  22732. after: 'has-descendant-after',
  22733. options: {
  22734. selector: 'h1:not([role]):not([aria-level]), h1:not([role])[aria-level=1], h2:not([role])[aria-level=1], h3:not([role])[aria-level=1], h4:not([role])[aria-level=1], h5:not([role])[aria-level=1], h6:not([role])[aria-level=1], [role=heading][aria-level=1]'
  22735. }
  22736. }, {
  22737. id: 'page-has-main',
  22738. evaluate: 'has-descendant-evaluate',
  22739. after: 'has-descendant-after',
  22740. options: {
  22741. selector: 'main:not([role]), [role=\'main\']'
  22742. }
  22743. }, {
  22744. id: 'page-no-duplicate-banner',
  22745. evaluate: 'page-no-duplicate-evaluate',
  22746. after: 'page-no-duplicate-after',
  22747. options: {
  22748. selector: 'header:not([role]), [role=banner]',
  22749. nativeScopeFilter: 'article, aside, main, nav, section'
  22750. }
  22751. }, {
  22752. id: 'page-no-duplicate-contentinfo',
  22753. evaluate: 'page-no-duplicate-evaluate',
  22754. after: 'page-no-duplicate-after',
  22755. options: {
  22756. selector: 'footer:not([role]), [role=contentinfo]',
  22757. nativeScopeFilter: 'article, aside, main, nav, section'
  22758. }
  22759. }, {
  22760. id: 'page-no-duplicate-main',
  22761. evaluate: 'page-no-duplicate-evaluate',
  22762. after: 'page-no-duplicate-after',
  22763. options: {
  22764. selector: 'main:not([role]), [role=\'main\']'
  22765. }
  22766. }, {
  22767. id: 'tabindex',
  22768. evaluate: 'tabindex-evaluate'
  22769. }, {
  22770. id: 'alt-space-value',
  22771. evaluate: 'alt-space-value-evaluate'
  22772. }, {
  22773. id: 'duplicate-img-label',
  22774. evaluate: 'duplicate-img-label-evaluate',
  22775. options: {
  22776. parentSelector: 'button, [role=button], a[href], p, li, td, th'
  22777. }
  22778. }, {
  22779. id: 'explicit-label',
  22780. evaluate: 'explicit-evaluate'
  22781. }, {
  22782. id: 'help-same-as-label',
  22783. evaluate: 'help-same-as-label-evaluate',
  22784. enabled: false
  22785. }, {
  22786. id: 'hidden-explicit-label',
  22787. evaluate: 'hidden-explicit-label-evaluate'
  22788. }, {
  22789. id: 'implicit-label',
  22790. evaluate: 'implicit-evaluate'
  22791. }, {
  22792. id: 'label-content-name-mismatch',
  22793. evaluate: 'label-content-name-mismatch-evaluate',
  22794. options: {
  22795. pixelThreshold: .1,
  22796. occuranceThreshold: 3
  22797. }
  22798. }, {
  22799. id: 'multiple-label',
  22800. evaluate: 'multiple-label-evaluate'
  22801. }, {
  22802. id: 'title-only',
  22803. evaluate: 'title-only-evaluate'
  22804. }, {
  22805. id: 'landmark-is-unique',
  22806. evaluate: 'landmark-is-unique-evaluate',
  22807. after: 'landmark-is-unique-after'
  22808. }, {
  22809. id: 'has-lang',
  22810. evaluate: 'has-lang-evaluate',
  22811. options: {
  22812. attributes: [ 'lang', 'xml:lang' ]
  22813. }
  22814. }, {
  22815. id: 'valid-lang',
  22816. evaluate: 'valid-lang-evaluate',
  22817. options: {
  22818. attributes: [ 'lang', 'xml:lang' ]
  22819. }
  22820. }, {
  22821. id: 'xml-lang-mismatch',
  22822. evaluate: 'xml-lang-mismatch-evaluate'
  22823. }, {
  22824. id: 'dlitem',
  22825. evaluate: 'dlitem-evaluate'
  22826. }, {
  22827. id: 'listitem',
  22828. evaluate: 'listitem-evaluate'
  22829. }, {
  22830. id: 'only-dlitems',
  22831. evaluate: 'only-dlitems-evaluate'
  22832. }, {
  22833. id: 'only-listitems',
  22834. evaluate: 'only-listitems-evaluate'
  22835. }, {
  22836. id: 'structured-dlitems',
  22837. evaluate: 'structured-dlitems-evaluate'
  22838. }, {
  22839. id: 'caption',
  22840. evaluate: 'caption-evaluate'
  22841. }, {
  22842. id: 'frame-tested',
  22843. evaluate: 'frame-tested-evaluate',
  22844. options: {
  22845. isViolation: false
  22846. }
  22847. }, {
  22848. id: 'no-autoplay-audio',
  22849. evaluate: 'no-autoplay-audio-evaluate',
  22850. options: {
  22851. allowedDuration: 3
  22852. }
  22853. }, {
  22854. id: 'css-orientation-lock',
  22855. evaluate: 'css-orientation-lock-evaluate',
  22856. options: {
  22857. degreeThreshold: 2
  22858. }
  22859. }, {
  22860. id: 'meta-viewport-large',
  22861. evaluate: 'meta-viewport-scale-evaluate',
  22862. options: {
  22863. scaleMinimum: 5,
  22864. lowerBound: 2
  22865. }
  22866. }, {
  22867. id: 'meta-viewport',
  22868. evaluate: 'meta-viewport-scale-evaluate',
  22869. options: {
  22870. scaleMinimum: 2
  22871. }
  22872. }, {
  22873. id: 'header-present',
  22874. evaluate: 'has-descendant-evaluate',
  22875. after: 'has-descendant-after',
  22876. options: {
  22877. selector: 'h1:not([role]), h2:not([role]), h3:not([role]), h4:not([role]), h5:not([role]), h6:not([role]), [role=heading]'
  22878. }
  22879. }, {
  22880. id: 'heading-order',
  22881. evaluate: 'heading-order-evaluate',
  22882. after: 'heading-order-after'
  22883. }, {
  22884. id: 'identical-links-same-purpose',
  22885. evaluate: 'identical-links-same-purpose-evaluate',
  22886. after: 'identical-links-same-purpose-after'
  22887. }, {
  22888. id: 'internal-link-present',
  22889. evaluate: 'internal-link-present-evaluate'
  22890. }, {
  22891. id: 'landmark',
  22892. evaluate: 'has-descendant-evaluate',
  22893. options: {
  22894. selector: 'main, [role=main]'
  22895. }
  22896. }, {
  22897. id: 'meta-refresh',
  22898. evaluate: 'meta-refresh-evaluate'
  22899. }, {
  22900. id: 'p-as-heading',
  22901. evaluate: 'p-as-heading-evaluate',
  22902. options: {
  22903. margins: [ {
  22904. weight: 150,
  22905. italic: true
  22906. }, {
  22907. weight: 150,
  22908. size: 1.15
  22909. }, {
  22910. italic: true,
  22911. size: 1.15
  22912. }, {
  22913. size: 1.4
  22914. } ]
  22915. }
  22916. }, {
  22917. id: 'region',
  22918. evaluate: 'region-evaluate',
  22919. options: {
  22920. regionMatcher: 'dialog, [role=dialog], svg, iframe'
  22921. }
  22922. }, {
  22923. id: 'skip-link',
  22924. evaluate: 'skip-link-evaluate'
  22925. }, {
  22926. id: 'unique-frame-title',
  22927. evaluate: 'unique-frame-title-evaluate',
  22928. after: 'unique-frame-title-after'
  22929. }, {
  22930. id: 'duplicate-id-active',
  22931. evaluate: 'duplicate-id-evaluate',
  22932. after: 'duplicate-id-after'
  22933. }, {
  22934. id: 'duplicate-id-aria',
  22935. evaluate: 'duplicate-id-evaluate',
  22936. after: 'duplicate-id-after'
  22937. }, {
  22938. id: 'duplicate-id',
  22939. evaluate: 'duplicate-id-evaluate',
  22940. after: 'duplicate-id-after'
  22941. }, {
  22942. id: 'aria-label',
  22943. evaluate: 'aria-label-evaluate'
  22944. }, {
  22945. id: 'aria-labelledby',
  22946. evaluate: 'aria-labelledby-evaluate'
  22947. }, {
  22948. id: 'avoid-inline-spacing',
  22949. evaluate: 'avoid-inline-spacing-evaluate',
  22950. options: {
  22951. cssProperties: [ 'line-height', 'letter-spacing', 'word-spacing' ]
  22952. }
  22953. }, {
  22954. id: 'button-has-visible-text',
  22955. evaluate: 'has-text-content-evaluate'
  22956. }, {
  22957. id: 'doc-has-title',
  22958. evaluate: 'doc-has-title-evaluate'
  22959. }, {
  22960. id: 'exists',
  22961. evaluate: 'exists-evaluate'
  22962. }, {
  22963. id: 'has-alt',
  22964. evaluate: 'has-alt-evaluate'
  22965. }, {
  22966. id: 'has-visible-text',
  22967. evaluate: 'has-text-content-evaluate'
  22968. }, {
  22969. id: 'is-on-screen',
  22970. evaluate: 'is-on-screen-evaluate'
  22971. }, {
  22972. id: 'non-empty-alt',
  22973. evaluate: 'attr-non-space-content-evaluate',
  22974. options: {
  22975. attribute: 'alt'
  22976. }
  22977. }, {
  22978. id: 'non-empty-if-present',
  22979. evaluate: 'non-empty-if-present-evaluate'
  22980. }, {
  22981. id: 'non-empty-placeholder',
  22982. evaluate: 'attr-non-space-content-evaluate',
  22983. options: {
  22984. attribute: 'placeholder'
  22985. }
  22986. }, {
  22987. id: 'non-empty-title',
  22988. evaluate: 'attr-non-space-content-evaluate',
  22989. options: {
  22990. attribute: 'title'
  22991. }
  22992. }, {
  22993. id: 'non-empty-value',
  22994. evaluate: 'attr-non-space-content-evaluate',
  22995. options: {
  22996. attribute: 'value'
  22997. }
  22998. }, {
  22999. id: 'presentational-role',
  23000. evaluate: 'presentational-role-evaluate'
  23001. }, {
  23002. id: 'role-none',
  23003. evaluate: 'matches-definition-evaluate',
  23004. deprecated: true,
  23005. options: {
  23006. matcher: {
  23007. attributes: {
  23008. role: 'none'
  23009. }
  23010. }
  23011. }
  23012. }, {
  23013. id: 'role-presentation',
  23014. evaluate: 'matches-definition-evaluate',
  23015. deprecated: true,
  23016. options: {
  23017. matcher: {
  23018. attributes: {
  23019. role: 'presentation'
  23020. }
  23021. }
  23022. }
  23023. }, {
  23024. id: 'svg-non-empty-title',
  23025. evaluate: 'svg-non-empty-title-evaluate'
  23026. }, {
  23027. id: 'caption-faked',
  23028. evaluate: 'caption-faked-evaluate'
  23029. }, {
  23030. id: 'html5-scope',
  23031. evaluate: 'html5-scope-evaluate'
  23032. }, {
  23033. id: 'same-caption-summary',
  23034. evaluate: 'same-caption-summary-evaluate'
  23035. }, {
  23036. id: 'scope-value',
  23037. evaluate: 'scope-value-evaluate',
  23038. options: {
  23039. values: [ 'row', 'col', 'rowgroup', 'colgroup' ]
  23040. }
  23041. }, {
  23042. id: 'td-has-header',
  23043. evaluate: 'td-has-header-evaluate'
  23044. }, {
  23045. id: 'td-headers-attr',
  23046. evaluate: 'td-headers-attr-evaluate'
  23047. }, {
  23048. id: 'th-has-data-cells',
  23049. evaluate: 'th-has-data-cells-evaluate'
  23050. }, {
  23051. id: 'hidden-content',
  23052. evaluate: 'hidden-content-evaluate'
  23053. } ]
  23054. });
  23055. })(typeof window === 'object' ? window : this);