import { __exports as toHaveAccessibleName$1 } from "../../../../_virtual/to-have-accessible-name.js";
import require$$0 from "../../../../_virtual/index3.js";
import "./utils.js";
import { __exports as utils } from "../../../../_virtual/utils.js";
Object.defineProperty(toHaveAccessibleName$1, "__esModule", {
  value: true
});
toHaveAccessibleName$1.toHaveAccessibleName = toHaveAccessibleName;
var _domAccessibilityApi = require$$0;
var _utils = utils;
function toHaveAccessibleName(htmlElement, expectedAccessibleName) {
  (0, _utils.checkHtmlElement)(htmlElement, toHaveAccessibleName, this);
  const actualAccessibleName = (0, _domAccessibilityApi.computeAccessibleName)(htmlElement);
  const missingExpectedValue = arguments.length === 1;
  let pass = false;
  if (missingExpectedValue) {
    pass = actualAccessibleName !== "";
  } else {
    pass = expectedAccessibleName instanceof RegExp ? expectedAccessibleName.test(actualAccessibleName) : this.equals(actualAccessibleName, expectedAccessibleName);
  }
  return {
    pass,
    message: () => {
      const to = this.isNot ? "not to" : "to";
      return (0, _utils.getMessage)(this, this.utils.matcherHint(`${this.isNot ? ".not" : ""}.${toHaveAccessibleName.name}`, "element", ""), `Expected element ${to} have accessible name`, expectedAccessibleName, "Received", actualAccessibleName);
    }
  };
}
export {
  toHaveAccessibleName$1 as default
};
//# sourceMappingURL=to-have-accessible-name.js.map
