{"version":3,"file":"index.cjs","names":["getErrorMessage","locatorUtil.overrideLocatorRelativePosition","locatorUtil.append","locatorUtil.toCssSelector","locatorUtil.append","listHelper.getListItemByIndex","listHelper.getListItemIterator","listHelper.getListItemCount","getErrorMessage"],"sources":["../src/errors/ErrorBase.ts","../src/errors/MissingPartError.ts","../src/errors/PostconditionNotMetError.ts","../src/utils/getLocatorInfoForErrorLog.ts","../src/errors/InteractorErrorBase.ts","../src/errors/LocatorResolutionError.ts","../src/locators/CssLocator.ts","../src/locators/AccessibleRoleLocator.ts","../src/utils/escapeUtil.ts","../src/locators/byAttribute.ts","../src/locators/byDataTestId.ts","../src/locators/LinkedCssLocator.ts","../src/utils/locatorUtil.ts","../src/drivers/driverUtil.ts","../src/drivers/WaitForOption.ts","../src/drivers/ComponentDriver.ts","../src/TestEngine.ts","../src/errors/ListEnumerationMismatchError.ts","../src/locators/byAriaLabel.ts","../src/locators/byChecked.ts","../src/locators/byCssClass.ts","../src/locators/byCssSelector.ts","../src/locators/byInputType.ts","../src/locators/byLinkedElement.ts","../src/locators/byName.ts","../src/locators/byRole.ts","../src/locators/byTagName.ts","../src/locators/byValue.ts","../src/locators/findByRole.ts","../src/drivers/listHelper.ts","../src/drivers/ListComponentDriver.ts","../src/drivers/childListHelper.ts","../src/errors/ElementNotFoundError.ts","../src/errors/ItemNotFoundError.ts","../src/errors/WaitForFailureError.ts","../src/interactor/MouseOption.ts","../src/utils/collectionUtil.ts","../src/utils/dateUtil.ts","../src/utils/timingUtil.ts","../src/utils/interactorUtil.ts","../src/utils/visibilityUtil.ts","../src/utils/elementStateUtil.ts"],"sourcesContent":["/**\n * Base class for errors raised from a component driver.\n *\n * Carries only a **serializable** snapshot of where the error occurred —\n * `driverName` — rather than a live `ComponentDriver` reference. This keeps the\n * frozen, catchable error contract decoupled from the evolving driver type (and\n * free of the `any` a `ComponentDriver<any>` field would leak), and stops callers\n * reaching driver/DOM internals through a caught error. The constructor accepts\n * anything name-bearing (a driver satisfies `{ driverName: string }`) and stores\n * only the name. See ADR-010.\n */\nexport class ErrorBase extends Error {\n  readonly driverName: string;\n\n  constructor(message: string, driver: { driverName: string }) {\n    super(message);\n    this.driverName = driver.driverName;\n  }\n}\n","import { ScenePart } from '../partTypes';\nimport { ErrorBase } from './ErrorBase';\n\nexport const MissingPartErrorId = 'MissingPartError';\n\n/**\n * Thrown when one or more of a driver's declared `ScenePart` parts are not\n * found to exist — e.g. `enforcePartExistence` guards a method that requires\n * an optional part to be present before acting on it. Existence means presence\n * in the DOM, regardless of visibility.\n *\n * Carries the offending {@link missingPartName} (a single part name or, for a\n * multi-part check, the array of every name that was missing) alongside the\n * ADR-010 serializable `driverName` snapshot inherited from {@link ErrorBase}.\n */\nexport class MissingPartError<T extends ScenePart> extends ErrorBase {\n  constructor(\n    public readonly missingPartName: keyof T | ReadonlyArray<keyof T>,\n    driver: { driverName: string }\n  ) {\n    const partNames = Array.isArray(missingPartName) ? missingPartName : [missingPartName];\n    const partNameString = partNames.map(name => `${String(name)}`).join(', ');\n    super(`The part \"${partNameString}\" is missing`, driver);\n    this.name = MissingPartErrorId;\n  }\n}\n","import { ErrorBase } from './ErrorBase';\n\nexport const PostconditionNotMetErrorId = 'PostconditionNotMetError';\n\n/**\n * Thrown when a driver action's own postcondition did not hold within its\n * timeout — see {@link ComponentDriver.awaitPostcondition}.\n *\n * This error exists to make an unmet postcondition **loud at its cause**. The\n * alternative — letting the action resolve anyway — surfaces later as a\n * baffling read result (`Expected: \"Banana\" / Received: null`) attributed to\n * the assertion rather than to the action that never finished, which is exactly\n * the diagnosis cost this class removes.\n *\n * Per ADR-010 it retains only the serializable `driverName` inherited from\n * {@link ErrorBase} plus the human-readable {@link postcondition} description —\n * never a live driver, locator, or probe.\n *\n * @param driver Anything name-bearing (a driver satisfies `{ driverName }`);\n *   only its `driverName` is retained.\n * @param postcondition Human-readable description of what was awaited, phrased\n *   as the state that failed to arrive (e.g. `\"selectByLabel('Banana'): the\n *   dropdown to close with the selection committed\"`).\n * @param timeoutMs How long it was awaited before giving up.\n */\nexport class PostconditionNotMetError extends ErrorBase {\n  readonly postcondition: string;\n\n  constructor(driver: { driverName: string }, postcondition: string, timeoutMs: number) {\n    super(`Postcondition not met after ${timeoutMs}ms — waited for ${postcondition}`, driver);\n    this.postcondition = postcondition;\n    this.name = PostconditionNotMetErrorId;\n  }\n}\n","import { PartLocator } from '../locators/PartLocator';\n\n/**\n * Display a rough description of the locators for error logging\n * this is an estimate, not a precise description with the absence of interactor\n * locators such as LinkedCssLocator would not be interpreted correctly\n *\n * Lives in its own leaf module (imports only the locator model, never the error\n * hierarchy) so the interactor errors that build their `locatorDescription` from\n * it can depend on it without pulling in `locatorUtil` — which throws\n * {@link LocatorResolutionError} and would otherwise close a `locatorUtil ↔\n * error` import cycle.\n *\n * @param locator\n * @returns\n */\nexport function getLocatorInfoForErrorLog(locator: PartLocator): string {\n  return locator.map(loc => loc.selector).join(', ');\n}\n","/**\n * Base class for errors thrown at the interactor level, where no\n * `ComponentDriver` is available — only the locator that was being resolved.\n *\n * Carries a **serializable** `locatorDescription` string rather than a live\n * `PartLocator`, so the frozen, catchable error contract stays decoupled from the\n * locator model and callers cannot reach locator internals through a caught\n * error. Subclasses compute the description from the locator via\n * `getLocatorInfoForErrorLog`. See ADR-010.\n */\nexport class InteractorErrorBase extends Error {\n  constructor(\n    message: string,\n    public readonly locatorDescription: string\n  ) {\n    super(message);\n  }\n}\n","import { PartLocator } from '../locators';\nimport { getLocatorInfoForErrorLog } from '../utils/getLocatorInfoForErrorLog';\nimport { InteractorErrorBase } from './InteractorErrorBase';\n\nexport const LocatorResolutionErrorId = 'LocatorResolutionError';\n\nfunction getErrorMessage(locator: PartLocator, reason: string): string {\n  const selector = getLocatorInfoForErrorLog(locator);\n  return `Cannot resolve locator: ${reason}. Locator: ${selector}`;\n}\n\n/**\n * Error thrown when a {@link PartLocator} cannot be reduced to a CSS selector —\n * e.g. a {@link LinkedCssLocator} whose match target is absent, or a\n * `valueExtract` method the resolver does not implement.\n *\n * Lives in the interactor-level error hierarchy (ADR-010): it carries only a\n * serializable {@link locatorDescription} derived via\n * {@link getLocatorInfoForErrorLog}, so consumers that catch on\n * `InteractorErrorBase` see it alongside {@link ElementNotFoundError} rather than\n * a bare `Error` escaping the frozen contract (#1051).\n */\nexport class LocatorResolutionError extends InteractorErrorBase {\n  constructor(locator: PartLocator, reason: string) {\n    super(getErrorMessage(locator, reason), getLocatorInfoForErrorLog(locator));\n    this.name = LocatorResolutionErrorId;\n  }\n}\n","import { CssLocatorSource } from './CssLocatorSource';\nimport { LocatorComplexity } from './LocatorComplexity';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\n\nexport interface CssLocatorInitializer {\n  relative: LocatorRelativePosition;\n  source: CssLocatorSource;\n}\n\n/**\n * The primitive `PartLocator` element: a single CSS selector, optionally\n * carrying its {@link LocatorRelativePosition} (how it composes with an\n * ancestor locator) and descriptive {@link CssLocatorSource}. Every `by*`\n * locator builder (`byDataTestId`, `byRole`, `byCssSelector`, ...) produces one\n * of these; a `PartLocator` chain is an array of them.\n */\nexport class CssLocator {\n  private _relativePosition: LocatorRelativePosition = 'Descendant';\n  private _source?: CssLocatorSource;\n\n  constructor(\n    public readonly selector: string,\n    initializeValue?: Partial<CssLocatorInitializer>\n  ) {\n    if (initializeValue) {\n      this._relativePosition = initializeValue.relative || this.relative;\n      this._source = initializeValue.source;\n    }\n  }\n\n  get relative(): LocatorRelativePosition {\n    return this._relativePosition;\n  }\n\n  public get complexity(): LocatorComplexity {\n    return 'primitive';\n  }\n\n  clone(override?: Partial<CssLocatorInitializer>): CssLocator {\n    return new CssLocator(this.selector, {\n      relative: override?.relative ?? this._relativePosition,\n      source: override?.source ?? this._source,\n    });\n  }\n}\n","import { CssLocator, CssLocatorInitializer } from './CssLocator';\nimport { LocatorComplexity } from './LocatorComplexity';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\n\n/**\n * The only two {@link LocatorRelativePosition} values `AccessibleRoleLocator`\n * resolution actually honors — `'Root'` escapes to the document root,\n * anything else (the `'Descendant'` default) scopes to the preceding chain\n * (or the interactor's own root when there is none). `'Same'`/`'Child'` have\n * no accname-search equivalent (`'Same'` means \"compound onto the same\n * element,\" which conflicts with \"search for a new element by name\"; `'Child'`\n * would need result filtering `queryAllByRole`/`getByRole` don't offer) — this\n * narrower type makes passing them a compile error instead of a silent\n * fallback to `'Descendant'` behavior.\n */\nexport type AccessibleRoleLocatorRelativePosition = Extract<LocatorRelativePosition, 'Root' | 'Descendant'>;\n\nexport interface AccessibleRoleLocatorInitializer {\n  name?: string;\n  relative?: AccessibleRoleLocatorRelativePosition;\n}\n\n/**\n * A locator that resolves by ARIA role plus the COMPUTED accessible name (the\n * accname algorithm: `aria-labelledby` id-refs, an associated `<label>`,\n * wrapping/`title` text, and visible descendant text) — built by `findByRole`,\n * never directly.\n *\n * This is the one locator kind with NO CSS representation: the accessible name\n * is the output of a multi-node graph traversal that no CSS selector can\n * express (see [ADR-008](https://github.com/atomic-testing/atomic-testing/blob/main/agent-docs/adr/008-css-dom-only-locator-boundary.md)\n * and the design in [ADR 0001, Decision B](https://github.com/atomic-testing/atomic-testing/blob/main/docs/adr/0001-interactor-primitives-and-name-aware-role.md)).\n * `selector` (inherited from {@link CssLocator}) is therefore a\n * human-readable DIAGNOSTIC string only — e.g. `role=button name=\"Save\"` — for\n * error messages; it is never run as CSS. Resolution instead happens inside\n * each interactor, backed by an engine that already implements accname:\n * `@testing-library/dom`'s `queryAllByRole` in `DOMInteractor`, Playwright's\n * `Locator.getByRole`/`Page.getByRole` in `PlaywrightInteractor`.\n *\n * `name` matching is always exact and case-sensitive, in BOTH engines — a\n * deliberate simplification, not an oversight. `@testing-library/dom`'s\n * `getByRole` only supports exact string comparison for a string `name` (no\n * substring/fuzzy mode exists in its public API for that case); Playwright's\n * `getByRole` defaults to fuzzy substring matching instead. Rather than expose\n * an `exact` toggle that only ONE engine could honor — a correctness trap for\n * a library whose entire contract is \"the same suite runs identically in both\n * environments\" — `PlaywrightInteractor` always passes `exact: true`,\n * matching jsdom's only mode.\n *\n * Composition: an `AccessibleRoleLocator` MUST be the last (or only) segment\n * of a {@link PartLocator} chain — everything before it resolves normally (by\n * CSS) to a scope container the accname search runs within; nothing may\n * follow it (see `locatorUtil.splitAtAccessibleRoleLocator`). Its\n * `complexity` is `'accessibleRole'`, distinct from `'primitive'`, so\n * `locatorUtil.and()` — same-element CSS compounding — already rejects it via\n * the same \"primitive chains only\" guard that rejects a linked locator.\n *\n * @see findByRole\n */\nexport class AccessibleRoleLocator extends CssLocator {\n  private readonly _name?: string;\n\n  constructor(\n    public readonly role: string,\n    initializeValue: AccessibleRoleLocatorInitializer & Partial<CssLocatorInitializer>\n  ) {\n    const diagnosticSelector = `role=${role}${initializeValue.name != null ? ` name=${JSON.stringify(initializeValue.name)}` : ''}`;\n    super(diagnosticSelector, initializeValue);\n    this._name = initializeValue.name;\n  }\n\n  override get complexity(): LocatorComplexity {\n    return 'accessibleRole';\n  }\n\n  /**\n   * Narrows {@link CssLocator.relative}'s return type: the constructor only\n   * ever accepts {@link AccessibleRoleLocatorRelativePosition}, so every\n   * instance's underlying value is already within that narrower set — this\n   * cast just reflects that guarantee in the type, so `clone()` doesn't need\n   * one of its own.\n   */\n  override get relative(): AccessibleRoleLocatorRelativePosition {\n    return super.relative as AccessibleRoleLocatorRelativePosition;\n  }\n\n  get name(): string | undefined {\n    return this._name;\n  }\n\n  override clone(\n    override?: Partial<AccessibleRoleLocatorInitializer> & Partial<CssLocatorInitializer>\n  ): AccessibleRoleLocator {\n    return new AccessibleRoleLocator(this.role, {\n      relative: override?.relative ?? this.relative,\n      source: override?.source,\n      name: override?.name ?? this._name,\n    });\n  }\n}\n","const cssEscapes = new Map([\n  ['!', '\\\\!'],\n  ['\"', '\\\\\"'],\n  ['#', '\\\\#'],\n  ['$', '\\\\$'],\n  ['%', '\\\\%'],\n  ['&', '\\\\&'],\n  [\"'\", \"\\\\'\"],\n  ['(', '\\\\('],\n  [')', '\\\\)'],\n  ['*', '\\\\*'],\n  ['+', '\\\\+'],\n  [',', '\\\\,'],\n  ['.', '\\\\.'],\n  ['/', '\\\\/'],\n  [':', '\\\\:'],\n  [';', '\\\\;'],\n  ['<', '\\\\<'],\n  ['=', '\\\\='],\n  ['>', '\\\\>'],\n  ['?', '\\\\?'],\n  ['@', '\\\\@'],\n  ['[', '\\\\['],\n  ['\\\\', '\\\\\\\\'],\n  [']', '\\\\]'],\n  ['^', '\\\\^'],\n  ['`', '\\\\`'],\n  ['{', '\\\\{'],\n  ['|', '\\\\|'],\n  ['}', '\\\\}'],\n  ['~', '\\\\~'],\n  [' ', '\\\\ '],\n]);\n\nexport function escapeName(name: string): string {\n  return encodeURIComponent(name);\n}\n\nconst ESCAPE_CACHE_MAX_SIZE = 1000;\nconst escapeCache = new Map<string, string>();\n\n/**\n * Escaping based on the CSS spec: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n * @param value\n * @returns\n */\nexport function escapeValue(value: string): string {\n  // Backslashes, spaces, and non-identifier characters (e.g., ! \" # $ % & ' ( ) * + , . / : ; < = > ? @ [ ] ^ ` { | } ~) are escaped.\n  const cached = escapeCache.get(value);\n  if (cached !== undefined) {\n    // Move to end to mark as recently used (LRU behavior)\n    escapeCache.delete(value);\n    escapeCache.set(value, cached);\n    return cached;\n  }\n\n  let escapedValue = '';\n  for (const character of value) {\n    if (cssEscapes.has(character)) {\n      escapedValue += cssEscapes.get(character);\n      continue;\n    }\n    escapedValue += character;\n  }\n\n  // Evict oldest entry if cache is full\n  if (escapeCache.size >= ESCAPE_CACHE_MAX_SIZE) {\n    const oldestKey = escapeCache.keys().next().value;\n    escapeCache.delete(oldestKey!);\n  }\n\n  escapeCache.set(value, escapedValue);\n  return escapedValue;\n}\n\n/**\n * Escapes special characters in CSS class names.\n * This is necessary for class names containing characters like colons (Tailwind's `hover:bg-blue`),\n * dots, brackets, or other CSS selector metacharacters.\n * @param name - The CSS class name to escape\n * @returns The escaped class name safe for use in CSS selectors\n */\nexport function escapeCssClassName(name: string): string {\n  return escapeValue(name);\n}\n","import { escapeName, escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByAttributeSource = {\n  _id: 'byAttribute';\n  name: string;\n  value: string;\n  relativeTo: LocatorRelativePosition;\n};\n\n/**\n * Locate an element by a specific attribute and value.\n *\n * @param name - The attribute name.\n * @param value - The attribute value to match.\n * @param relativeTo - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const dialog = byAttribute('role', 'dialog');\n * ```\n */\nexport function byAttribute(\n  name: string,\n  value: string,\n  relativeTo: LocatorRelativePosition = 'Descendant'\n): PartLocator {\n  const selector = name === 'id' ? `#${escapeValue(value)}` : `[${escapeName(name)}=\"${escapeValue(value)}\"]`;\n  return [\n    new CssLocator(selector, {\n      relative: relativeTo,\n      source: {\n        _id: 'byAttribute',\n        name,\n        value,\n        relativeTo,\n      },\n    }),\n  ];\n}\n","import { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByDataTestIdSource = {\n  _id: 'byDataTestId';\n  id: string | string[];\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate an element by its `data-testid` attribute.\n *\n * When an array of ids is provided, they will be chained as descendant\n * selectors in the resulting locator.\n *\n * @param id - Single id or an array of ids to match against the\n * `data-testid` attribute.\n * @param relativeTo - How the locator is related to the current locator in a\n * locator chain. Defaults to `'Descendant'`.\n * @example\n * ```ts\n * const submitButton = byDataTestId('submit');\n * const itemLabel = byDataTestId(['list', 'item-label']);\n * ```\n */\nexport function byDataTestId(id: string | string[], relativeTo: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const ids = Array.isArray(id) ? id : [id];\n  const selector = ids.map(idVal => `[data-testid=\"${escapeValue(idVal)}\"]`).join(' ');\n  return [\n    new CssLocator(selector, {\n      relative: relativeTo,\n      source: {\n        _id: 'byDataTestId',\n        id,\n        relative: relativeTo,\n      },\n    }),\n  ];\n}\n","import { byDataTestId } from './byDataTestId';\nimport { CssLocator, CssLocatorInitializer } from './CssLocator';\nimport { LocatorComplexity } from './LocatorComplexity';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport { PartLocator } from './PartLocator';\n\nexport type LinkedCssLocatorValueExtractType = 'text' | 'attribute';\n\nexport interface LinkedCssLocatorAttributeValueExtract {\n  type: 'attribute';\n  attributeName: string;\n}\n\nexport type LinkedCssLocatorValueExtract = LinkedCssLocatorAttributeValueExtract;\n\nexport type LinkedCssLocatorSource = {\n  _id: 'byLinkedCssLocatorSource';\n  relative: LocatorRelativePosition;\n  valueExtract: LinkedCssLocatorValueExtract;\n\n  matchingTargetLocator: PartLocator;\n  matchingTargetValueExtract: LinkedCssLocatorValueExtract;\n};\n\nexport interface LinkedCssLocatorInitializer {\n  valueExtract: LinkedCssLocatorValueExtract;\n\n  matchingTargetLocator: PartLocator;\n  matchingTargetValueExtract: LinkedCssLocatorValueExtract;\n}\n\n/**\n * A {@link CssLocator} whose match must also satisfy a value comparison against\n * a second, independently-located target element — e.g. an `<option>` whose\n * value equals a `<select>`'s current value. `valueExtract` describes how to\n * read the value off this locator's own match; `matchingTargetLocator` /\n * `matchingTargetValueExtract` describe where to read the value to compare\n * against. Produced by {@link byLinkedElement} (experimental).\n */\nexport class LinkedCssLocator extends CssLocator {\n  private _valueExtract: LinkedCssLocatorValueExtract = {\n    type: 'attribute',\n    attributeName: 'value',\n  };\n\n  private _matchingTargetLocator: PartLocator = byDataTestId('not-set');\n  private _matchingTargetValueExtract: LinkedCssLocatorValueExtract = {\n    type: 'attribute',\n    attributeName: 'value',\n  };\n\n  constructor(selector: string, initializeValue: LinkedCssLocatorInitializer & Partial<CssLocatorInitializer>) {\n    super(selector, initializeValue);\n    this._valueExtract = initializeValue.valueExtract;\n    this._matchingTargetLocator = initializeValue.matchingTargetLocator;\n    this._matchingTargetValueExtract = initializeValue.matchingTargetValueExtract;\n  }\n\n  override get complexity(): LocatorComplexity {\n    return 'linked';\n  }\n\n  get valueExtract(): LinkedCssLocatorValueExtract {\n    return this._valueExtract;\n  }\n\n  get matchingTargetLocator(): PartLocator {\n    return this._matchingTargetLocator;\n  }\n\n  get matchingTargetValueExtract(): LinkedCssLocatorValueExtract {\n    return this._matchingTargetValueExtract;\n  }\n\n  clone(override?: Partial<LinkedCssLocatorInitializer> & Partial<CssLocatorInitializer>): LinkedCssLocator {\n    return new LinkedCssLocator(this.selector, {\n      relative: override?.relative ?? this.relative,\n      source: override?.source,\n      valueExtract: override?.valueExtract ?? this._valueExtract,\n      matchingTargetLocator: override?.matchingTargetLocator ?? this._matchingTargetLocator,\n      matchingTargetValueExtract: override?.matchingTargetValueExtract ?? this._matchingTargetValueExtract,\n    });\n  }\n}\n","import { Optional } from '../dataTypes';\nimport { LocatorResolutionError } from '../errors/LocatorResolutionError';\nimport { Interactor } from '../interactor/Interactor';\nimport { AccessibleRoleLocator } from '../locators/AccessibleRoleLocator';\nimport { byAttribute } from '../locators/byAttribute';\nimport { CssLocator } from '../locators/CssLocator';\nimport { LinkedCssLocator } from '../locators/LinkedCssLocator';\nimport type { LocatorRelativePosition } from '../locators/LocatorRelativePosition';\nimport { PartLocator } from '../locators/PartLocator';\n\n/**\n * The portable document-root selector an empty locator chain reduces to. `<html>`\n * in the DOM, matched by both `document.querySelector(':root')` (jsdom) and\n * `page.locator(':root')` (Chromium). Used so the engine-root locator (`[]`, in\n * the DOM/Playwright adapters) resolves to a real element instead of `''`, which\n * throws a CSS parse error in every engine. See #1048.\n */\nexport const documentRootSelector = ':root';\n\nexport function append(locatorBase: PartLocator, ...locatorsToAppend: PartLocator[]): PartLocator {\n  return locatorBase.concat(...locatorsToAppend);\n}\n\nfunction assertSamePrimitive(locator: PartLocator): CssLocator {\n  if (locator.length !== 1) {\n    throw new Error(`locatorUtil.and() composes single locators only; received a ${locator.length}-locator chain.`);\n  }\n  const [only] = locator;\n  if (only.complexity !== 'primitive') {\n    throw new Error(\n      'locatorUtil.and() composes same-element primitive matchers only; ' +\n        'linked locators resolve at runtime and cannot be folded into a static compound.'\n    );\n  }\n  return only;\n}\n\n/**\n * Compose additional matchers onto the SAME element, producing one compound\n * CSS selector — e.g. `[role=\"button\"]` and `[aria-label=\"Open\"]` together\n * become `[role=\"button\"][aria-label=\"Open\"]`.\n *\n * This is the ergonomic, footgun-free form of same-element composition: it\n * supersedes `append(byRole('button'), byAriaLabel('Open', 'Same'))` — there is\n * no `'Same'` argument to remember (the relationship no longer has to be stored\n * on the appended child) and no wrapper call. The result keeps `base`'s position\n * relative to its parent; the appended matchers contribute only their\n * attribute/selector fragment.\n *\n * Same-element, pure-CSS only:\n * - Put a tag-name matcher ({@link byTagName}) FIRST — a CSS type selector is\n *   only valid at the start of a compound (`input[type=\"text\"]`, never\n *   `[type=\"text\"]input`).\n * - Computed accessible names (`aria-labelledby` / `<label>` / text) are not\n *   CSS-expressible and stay out of scope (see #923); compose a verbatim\n *   `aria-label` via {@link byAriaLabel} instead.\n * - Linked locators ({@link byLinkedElement}) resolve at runtime and cannot be\n *   folded into a static compound; passing one as `base` or as a matcher throws.\n * - `base` and every matcher must each be a one-element, primitive chain — what\n *   a fresh `by*` call produces, and also what `and()` itself returns, so its\n *   result can be composed again. A multi-element chain (`append()`'s typical\n *   output) has no single element left to compound onto and is rejected.\n *\n * @param base - The locator to compound additional matchers onto.\n * @param locators - Additional same-element matchers to compound onto `base`.\n * @example\n * ```ts\n * const openButton = locatorUtil.and(byRole('button'), byAriaLabel('Open'));\n * const activeTab = locatorUtil.and(byRole('tab'), byAttribute('aria-selected', 'true'));\n * ```\n */\nexport function and(base: PartLocator, ...locators: PartLocator[]): PartLocator {\n  const parts = [base, ...locators].map(assertSamePrimitive);\n  const selector = parts.map(part => part.selector).join('');\n  return [new CssLocator(selector, { relative: parts[0].relative })];\n}\n\nfunction findRootLocatorIndex(locator: PartLocator): number {\n  const length = locator.length;\n  for (let i = length - 1; i >= 0; i--) {\n    const loc = locator[i];\n    if (loc.relative === 'Root') {\n      return i;\n    }\n  }\n\n  return -1;\n}\n\nasync function toPrimitiveLocators(locator: PartLocator, interactor: Interactor): Promise<CssLocator[]> {\n  let result: CssLocator[] = [];\n  for (let i = 0; i < locator.length; i++) {\n    const loc = locator[i];\n    if (loc instanceof LinkedCssLocator) {\n      const currentContext = locator.slice(0, i);\n      const resolved = await getLinkedCssLocator(loc, currentContext, interactor);\n      result = result.concat(resolved);\n    } else {\n      result.push(loc);\n    }\n  }\n\n  return result;\n}\n\nasync function getEffectiveLocator(locator: PartLocator, interactor: Interactor): Promise<CssLocator[]> {\n  const list = await toPrimitiveLocators(locator, interactor);\n  const rootLocatorIndex = findRootLocatorIndex(list);\n  // If the locator is linked, we should skip because it has matching locator\n  // would need the context\n  const shouldSkip = rootLocatorIndex === -1 || list[rootLocatorIndex].complexity === 'linked';\n  return shouldSkip ? list : list.slice(rootLocatorIndex);\n}\n\n/**\n * Split a locator chain at its {@link AccessibleRoleLocator} segment (built by\n * `findByRole`) — the second resolution channel that bypasses\n * {@link toCssSelector} entirely, resolving by computed accessible name\n * instead of CSS (see #923). Returns `undefined` when the chain has no such\n * segment — the common, CSS-only case every existing locator takes.\n *\n * The accessible-role segment must be the chain's LAST element: nothing can\n * be appended after a name-aware resolution result, since there is no CSS\n * expression for \"descendant of an accname match.\" `before` — everything\n * ahead of it — still resolves normally via {@link toCssSelector} and scopes\n * the accname search to that ancestor's subtree.\n *\n * @throws {LocatorResolutionError} If the segment is present but not the last\n * element of the chain (covers both \"something follows it\" and \"more than one\n * such segment\" — the first occurrence not being terminal implies either).\n */\nexport function splitAtAccessibleRoleLocator(\n  locator: PartLocator\n): Optional<{ before: PartLocator; roleLocator: AccessibleRoleLocator }> {\n  const index = locator.findIndex(loc => loc instanceof AccessibleRoleLocator);\n  if (index === -1) {\n    return undefined;\n  }\n  if (index !== locator.length - 1) {\n    throw new LocatorResolutionError(\n      locator,\n      'findByRole() must be the last locator in a chain — nothing can be composed after a computed-accessible-name match, and only one such segment is allowed per chain.'\n    );\n  }\n  return { before: locator.slice(0, index), roleLocator: locator[index] as AccessibleRoleLocator };\n}\n\n/**\n * Reduce a {@link PartLocator} to the single CSS selector the interactor runs\n * against the DOM. This is the one locator-resolution seam in the system, and it\n * is **CSS-only by design** for 1.0 — every locator must express itself as CSS\n * here (see [ADR-008](https://github.com/atomic-testing/atomic-testing/blob/main/agent-docs/adr/008-css-dom-only-locator-boundary.md)).\n *\n * An {@link AccessibleRoleLocator} segment (`findByRole`) has no CSS\n * representation at all — see {@link splitAtAccessibleRoleLocator}, which\n * every interactor consults BEFORE reaching this function. Calling this\n * directly with such a locator is a caller error, not a silent fallback.\n */\nexport async function toCssSelector(locator: PartLocator, interactor: Interactor): Promise<string> {\n  if (locator.some(loc => loc instanceof AccessibleRoleLocator)) {\n    throw new LocatorResolutionError(\n      locator,\n      'findByRole() locators have no CSS representation (a computed accessible name is not CSS-expressible — see #923); resolve through the interactor rather than locatorUtil.toCssSelector().'\n    );\n  }\n  const effectiveLocator = await getEffectiveLocator(locator, interactor);\n  const statements: string[] = [];\n  for (let i = 0; i < effectiveLocator.length; i++) {\n    const loc = effectiveLocator[i];\n    const statement = getLocatorStatement(loc);\n    // The first statement has no left operand, so it takes no leading combinator\n    // (a leading ' ' was always trimmed away; forcing '' here additionally keeps\n    // a `Child`-positioned head from emitting an invalid leading `>`).\n    const separator = i === 0 ? '' : getRelativeSeparator(loc.relative);\n    statements.push(separator + statement);\n  }\n\n  const selector = statements.join('').trim();\n  // An empty locator chain (the engine root, which the DOM/Playwright adapters\n  // mount at `[]`) reduces to `''`. Running `''` as a selector throws a\n  // SyntaxError, crashing every engine-level read/mutation, so fall back to the\n  // portable document-root selector. See #1048.\n  return Promise.resolve(selector === '' ? documentRootSelector : selector);\n}\n\nasync function getLinkedCssLocator(\n  locator: LinkedCssLocator,\n  context: PartLocator,\n  interactor: Interactor\n): Promise<PartLocator> {\n  const matchTargetValue = await getLinkedCssLocatorMatchingTargetValue(locator, context, interactor);\n\n  if (matchTargetValue == null) {\n    throw new LocatorResolutionError([locator], 'match target of LinkedCssLocator not found');\n  }\n\n  if (locator.valueExtract.type === 'attribute') {\n    return byAttribute(locator.valueExtract.attributeName, matchTargetValue, locator.relative);\n  }\n  throw new LocatorResolutionError([locator], `unsupported valueExtract type \"${locator.valueExtract.type}\"`);\n}\n\nexport async function getLinkedCssLocatorMatchingTargetValue(\n  locator: LinkedCssLocator,\n  context: PartLocator,\n  interactor: Interactor\n): Promise<Optional<string>> {\n  if (locator.matchingTargetValueExtract.type === 'attribute') {\n    const entireLocator = append(context, locator.matchingTargetLocator);\n    return await interactor.getAttribute(entireLocator, locator.matchingTargetValueExtract.attributeName);\n  }\n\n  throw new LocatorResolutionError(\n    [locator],\n    `unsupported matchingTargetValueExtract type \"${locator.matchingTargetValueExtract.type}\"`\n  );\n}\n\nfunction getLocatorStatement(locator: CssLocator): string {\n  return locator.selector;\n}\n\n/**\n * The CSS combinator that joins a statement to the one before it, per the\n * statement's {@link LocatorRelativePosition}:\n * - `'Same'` — no combinator, so the selectors compound onto one element.\n * - `'Child'` — the child combinator (` > `), matching only a direct child.\n * - everything else (`'Descendant'`/`'Root'`) — the descendant combinator (a\n *   single space).\n */\nfunction getRelativeSeparator(relative: LocatorRelativePosition): string {\n  switch (relative) {\n    case 'Same':\n      return '';\n    case 'Child':\n      return ' > ';\n    default:\n      return ' ';\n  }\n}\n\nexport interface OverrideLocatorRelativePositionOption {\n  shouldOverride: (locator: CssLocator, index: number) => boolean;\n}\n\nexport const defaultOverrideLocatorRelativePositionOption: Readonly<OverrideLocatorRelativePositionOption> =\n  Object.freeze({\n    shouldOverride: (_: CssLocator, index: number) => index === 0,\n  });\n\n/**\n * Override the supplied locator chain's relative position; by default only the\n * first locator in the chain is overridden.\n * @param locator\n * @param relative\n * @param option\n * @returns\n */\nexport function overrideLocatorRelativePosition(\n  locator: PartLocator,\n  relative: LocatorRelativePosition,\n  option: Partial<Readonly<OverrideLocatorRelativePositionOption>> = defaultOverrideLocatorRelativePositionOption\n): PartLocator {\n  const actualOption: Readonly<OverrideLocatorRelativePositionOption> = {\n    ...defaultOverrideLocatorRelativePositionOption,\n    ...option,\n  };\n  return locator.map((loc, index) => (actualOption.shouldOverride(loc, index) ? loc.clone({ relative }) : loc));\n}\n\n// Re-exported from a leaf module so the interactor errors can build their\n// `locatorDescription` from it without importing `locatorUtil` (which throws\n// LocatorResolutionError) — breaking a `locatorUtil ↔ error` import cycle while\n// keeping `locatorUtil.getLocatorInfoForErrorLog` on the public surface.\nexport { getLocatorInfoForErrorLog } from './getLocatorInfoForErrorLog';\n","import { Interactor } from '../interactor';\nimport { PartLocator } from '../locators/PartLocator';\nimport {\n  ComponentDriverCtor,\n  IComponentDriverOption,\n  ScenePart,\n  ScenePartDefinition,\n  ScenePartDriver,\n} from '../partTypes';\nimport * as locatorUtil from '../utils/locatorUtil';\nimport { ComponentDriver } from './ComponentDriver';\n\nexport function getPartFromDefinition<T extends ScenePart>(\n  partDefinition: T,\n  parentLocator: PartLocator,\n  interactor: Interactor,\n  option: Partial<IComponentDriverOption<T>>\n): ScenePartDriver<T> {\n  const result: Partial<ScenePartDriver<T>> = {};\n\n  const entries = Object.entries(partDefinition) as [keyof T, ScenePartDefinition][];\n\n  for (const [nestedComponentName, scenePart2] of entries) {\n    const { locator, driver, option: optionOverride } = scenePart2;\n\n    // A single, honest cast: `ComponentDriverCtor` is the type partTypes documents\n    // as unifying the construct signature AND the static portal hooks every driver\n    // class inherits, so this one binding serves both the static reads below and\n    // the `new` at the end — replacing the former three separate casts. The\n    // `unknown` bridge is unavoidable because a ScenePart's declared `driver` field\n    // is a bare construct signature that does not surface the inherited statics.\n    const driverCtor = driver as unknown as ComponentDriverCtor<ComponentDriver<ScenePart>>;\n\n    const componentOption: Partial<IComponentDriverOption<ScenePart>> = {\n      ...option,\n      ...(optionOverride as Partial<IComponentDriverOption<ScenePart>>),\n      parts: undefined,\n    };\n\n    // Portal hooks are static class metadata read off the constructor, never\n    // instance methods (they run before any instance exists) — but they do\n    // receive the fully-merged `componentOption` the constructor is about to be\n    // called with, so a driver can make its portal behavior conditional on how\n    // the scene configures it (see the hooks' TSDoc on ComponentDriver).\n    const relativePositionOverride = driverCtor.overrideLocatorRelativePosition(componentOption);\n    const locatorContext: PartLocator = driverCtor.overriddenParentLocator(componentOption) ?? parentLocator;\n    const actualLocator: PartLocator =\n      relativePositionOverride != null\n        ? locatorUtil.overrideLocatorRelativePosition(locator, relativePositionOverride)\n        : locator;\n\n    const componentLocator = locatorUtil.append(locatorContext, actualLocator);\n\n    // The per-key instance type is not statically knowable inside this dynamic\n    // loop (each key maps to a different concrete driver), so narrowing the\n    // constructed base `ComponentDriver<ScenePart>` to the mapped element type is\n    // the one irreducible cast here.\n    result[nestedComponentName] = new driverCtor(\n      componentLocator,\n      interactor,\n      componentOption\n    ) as ScenePartDriver<T>[typeof nestedComponentName];\n  }\n\n  return result as ScenePartDriver<T>;\n}\n","export type WaitForCondition = 'attached' | 'visible' | 'detached' | 'hidden';\n\nexport interface WaitForOption {\n  /**\n   * The condition to wait for the component to reach\n   * 'attached' - the component is attached to the DOM\n   * 'detached' - the component is not attached to the DOM\n   * 'visible' - the component is attached to the DOM and visible\n   * 'hidden' - the component is attached to the DOM but not visible\n   * @default 'attached'\n   */\n  condition: WaitForCondition;\n\n  /**\n   * The number of milliseconds to wait before timing out\n   * @default 30000\n   */\n  timeoutMs: number;\n\n  /**\n   * Whether to log debug information during the wait operation.\n   * When enabled, logs each probe's value and whether the condition was met.\n   * @default false\n   */\n  debug: boolean;\n}\n\nexport const defaultWaitForOption: Readonly<WaitForOption> = Object.freeze({\n  condition: 'attached',\n  timeoutMs: 30000,\n  debug: false,\n});\n","import { Optional } from '../dataTypes';\nimport { MissingPartError } from '../errors/MissingPartError';\nimport { PostconditionNotMetError } from '../errors/PostconditionNotMetError';\nimport { BoundingRect, Point } from '../geometry';\nimport {\n  ClickOption,\n  FocusOption,\n  HoverOption,\n  Interactor,\n  MouseDownOption,\n  MouseEnterOption,\n  MouseLeaveOption,\n  MouseMoveOption,\n  MouseOutOption,\n  MouseUpOption,\n  PressKeyOption,\n} from '../interactor';\nimport type { LocatorRelativePosition, PartLocator } from '../locators';\nimport {\n  CommutableComponentDriverOption,\n  IComponentDriver,\n  IComponentDriverOption,\n  PartName,\n  ScenePart,\n  ScenePartDriver,\n} from '../partTypes';\nimport * as locatorUtil from '../utils/locatorUtil';\nimport { WaitUntilOption } from '../utils/timingUtil';\nimport { getPartFromDefinition } from './driverUtil';\nimport { defaultWaitForOption, WaitForOption } from './WaitForOption';\n\n/**\n * Base class for all component drivers.  It provides the basic functionality to interact with the component\n */\nexport abstract class ComponentDriver<T extends ScenePart = {}> implements IComponentDriver<T> {\n  private _locator: PartLocator;\n  private readonly _parts: ScenePartDriver<T>;\n\n  /**\n   * The component-agnostic slice of the constructor option that is safe to share\n   * across the whole driver tree — everything the constructor received EXCEPT the\n   * component-specific `parts`, which each driver owns for itself. Parent drivers\n   * pass this straight to the constructors of children they create dynamically\n   * (see the list helpers). See {@link CommutableComponentDriverOption}.\n   */\n  public readonly commutableOption: CommutableComponentDriverOption;\n\n  /**\n   * @param locator Locator for the root of this component.\n   * @param interactor Environment adapter used for all interactions.\n   * @param option Driver option carrying the shared driver-tree context.\n   *\n   * Composite-driver authoring rule: a driver that declares non-empty `parts`\n   * must type this parameter as `Partial<IComponentDriverOption>` (i.e. the empty\n   * `<{}>` default) and hardcode its own `parts` in the body —\n   * `super(locator, interactor, { ...option, parts })`. The \"natural\"\n   * `Partial<IComponentDriverOption<typeof parts>>` signature does NOT satisfy\n   * `ScenePartDefinition['driver']` (constructor parameters are checked\n   * contravariantly), so a driver written that way could not be placed in a\n   * parent `ScenePart`. Lock a composite driver against this rule in one line with\n   * {@link AssertScenePlaceableDriver}; the rule itself is regression-tested\n   * centrally in `core/src/drivers/__type-tests__` and demonstrated in\n   * `@atomic-testing/component-driver-html`.\n   */\n  constructor(\n    locator: PartLocator,\n    public readonly interactor: Interactor,\n    option?: Partial<IComponentDriverOption<T>>\n  ) {\n    this._locator = locator;\n    this._parts = getPartFromDefinition<T>(option?.parts ?? ({} as T), this._locator, interactor, option ?? {});\n    // Strip the component-specific `parts` so the shared slice never leaks a\n    // parent's parts to its children — honestly, without the old `parts: {} as T`\n    // cast lie.\n    const { parts: _parts, ...commutable } = option ?? {};\n    this.commutableOption = commutable;\n  }\n\n  /**\n   * Portal hook: where to re-root this driver's locator when its component renders\n   * outside the parent's DOM (a modal, popup, drawer). Return the {@link PartLocator}\n   * that locates the component from the document root, or `undefined` (the default)\n   * for normal in-tree components whose locator chains from the parent.\n   *\n   * This is **static** because it is per-class metadata read off the constructor\n   * before any instance exists — which makes the \"no instance state\" constraint\n   * structural rather than a documented caution. Override with `static override`.\n   *\n   * `option` is the fully-merged constructor option the driver is about to receive\n   * (the same value passed to the driver's own constructor) — a purely static,\n   * per-invocation input, not instance state — so a driver whose portalling is\n   * conditional on how its scene configures it (e.g. an overlay that can render\n   * teleported OR in-tree, such as PrimeVue's `appendTo=\"self\"`) can branch on a\n   * flag there instead of always re-rooting. Ignore it to keep unconditional\n   * portal behavior.\n   */\n  static overriddenParentLocator(_option?: Partial<IComponentDriverOption<any>>): Optional<PartLocator> {\n    return undefined;\n  }\n\n  /**\n   * Portal hook: the locator relative position to apply when the component's real\n   * DOM is a sibling/elsewhere rather than a descendant (e.g. a MUI dialog rendered\n   * at the document root, located by a \"Same\"-level selector). Return `undefined`\n   * (the default) to keep the natural position declared by the ScenePart.\n   *\n   * Static for the same reason as {@link ComponentDriver.overriddenParentLocator}:\n   * it is class-level metadata read before construction. Override with `static override`.\n   *\n   * See {@link ComponentDriver.overriddenParentLocator} for what `option` carries\n   * and why accepting it does not reintroduce instance state.\n   */\n  static overrideLocatorRelativePosition(\n    _option?: Partial<IComponentDriverOption<any>>\n  ): Optional<LocatorRelativePosition> {\n    return undefined;\n  }\n\n  /**\n   * Return driver instance of all the named parts\n   */\n  get parts(): ScenePartDriver<T> {\n    return this._parts;\n  }\n\n  /**\n   * Return the locator of the component\n   */\n  get locator(): PartLocator {\n    return this._locator;\n  }\n\n  /**\n   * The element {@link ComponentDriver.within} resolves an interior scene against —\n   * \"inside this component\", as *this driver* defines inside. Defaults to\n   * {@link ComponentDriver.locator}, which is already correct wherever a driver's own\n   * locator resolves to the surface holding caller content (Radix/Reka anchor at\n   * `Dialog.Content`, Fluent at `DialogSurface`).\n   *\n   * Override it when the driver's locator resolves to a **wrapper** instead. MUI's\n   * Dialog, Drawer and Menu are the shipped cases: their locator is the portal-rendered\n   * Modal root, whose children are the backdrop, two focus-trap sentinels and a\n   * positioning container. Un-narrowed, an interior there reaches MUI's own chrome,\n   * and a `'Child'`-relative interior part resolves to `.MuiBackdrop-root` rather\n   * than to anything the scene wrote — silently, since a locator that matches the\n   * wrong element raises nothing.\n   *\n   * An override only helps where that chrome is **ancestral to** the caller's content.\n   * Where a design system interleaves chrome *beside* it — Fluent's focus-trap\n   * sentinels are siblings of the dialog body — no anchor separates the two, and the\n   * default stands (ADR-019's rollout-width audit).\n   *\n   * An override MUST resolve to an element containing **everything the caller\n   * supplied**. For a slotted component that means the surface, never one slot: MUI\n   * spreads caller content across `DialogTitle`/`DialogContent`/`DialogActions` as\n   * siblings, so narrowing to `.MuiDialogContent-root` would drop the action buttons\n   * scenes click. Over-narrowing fails the same silent way it fixes — the part just\n   * stops resolving (ADR-019).\n   */\n  protected get interiorLocator(): PartLocator {\n    return this._locator;\n  }\n\n  /**\n   * Driver instances for a caller-supplied interior scene, resolved against this\n   * component's {@link ComponentDriver.interiorLocator}.\n   *\n   * The call-time counterpart to {@link ComponentDriver.parts}: `parts` is the\n   * chrome the driver author hardcodes, this is the interior the *scene* author\n   * owns — a dialog's body, a popover's panel, a toast's action area. A\n   * {@link PartLocator} resolves lazily and queries nothing here, so this is\n   * synchronous and safe to call before the interior has mounted.\n   *\n   * This replaced an earlier `ContainerDriver` base whose `content` option\n   * required the same scene to be named twice — once as a type argument, once in\n   * the driver option — plus a laundering constructor in every subclass (ADR-019).\n   * Named `within` rather than `getContent` because leaf drivers already own that\n   * name for reading a component's own text (a badge's content, a tooltip's\n   * content), and a base-class member cannot collide with them.\n   *\n   * Interior children are constructed with an empty option, exactly as `content`\n   * parts always have been: an interior belongs to the scene, so it inherits no\n   * driver-specific configuration from its host. This differs deliberately from\n   * {@link ComponentDriver.parts}, whose children do inherit the host's option.\n   *\n   * @param parts The interior scene to resolve against this component's interior\n   * @returns One driver instance per named part\n   */\n  within<ContentT extends ScenePart>(parts: ContentT): ScenePartDriver<ContentT> {\n    return getPartFromDefinition<ContentT>(parts, this.interiorLocator, this.interactor, {});\n  }\n\n  /**\n   * Check the specified parts' existences, and throw MissingPartError if any of the part is found not existence.\n   * Existence is defined by the part's existence in the DOM regardless of its visibility on the screen\n   * @param partName Single or array of the names of the parts to be enforced\n   */\n  protected async enforcePartExistence(partName: PartName<T> | ReadonlyArray<PartName<T>>): Promise<void> {\n    const missingPartNames = await this.getMissingPartNames(partName);\n    if (missingPartNames.length > 0) {\n      throw new MissingPartError<T>(missingPartNames, this);\n    }\n  }\n\n  /**\n   * Get the names of parts not in the DOM\n   * @param partName Single or array of the names of the parts to be examined\n   * @returns\n   */\n  protected async getMissingPartNames(\n    partName: PartName<T> | ReadonlyArray<PartName<T>>\n  ): Promise<readonly PartName<T>[]> {\n    let partNames: ReadonlyArray<keyof T>;\n    if (partName == null) {\n      partNames = Object.keys(this._parts) as ReadonlyArray<keyof T>;\n    } else {\n      partNames = Array.isArray(partName) ? partName : [partName];\n    }\n\n    const missingParts: PartName<T>[] = [];\n    const promises = partNames.map(x => {\n      const fn = async () => {\n        const partExists = await this.interactor.exists(this._parts[x]!.locator);\n        if (!partExists) {\n          missingParts.push(x);\n        }\n      };\n      return fn();\n    });\n\n    await Promise.all(promises);\n    return missingParts;\n  }\n\n  /**\n   * Get the combined text content of the component\n   * @returns If the component exists and has content, it should return the text or otherwise undefined\n   */\n  getText(): Promise<Optional<string>> {\n    return this.interactor.getText(this.locator);\n  }\n\n  getAttribute(attributeName: string): Promise<Optional<string>> {\n    return this.interactor.getAttribute(this.locator, attributeName);\n  }\n\n  /**\n   * Whether the component exists/attached to the DOM\n   * @returns true if the component is attached to the DOM, false otherwise\n   */\n  exists(): Promise<boolean> {\n    return this.interactor.exists(this.locator);\n  }\n\n  async click(option?: Partial<ClickOption>): Promise<void> {\n    return this.interactor.click(this.locator, option);\n  }\n\n  async hover(option?: Partial<HoverOption>): Promise<void> {\n    return this.interactor.hover(this.locator, option);\n  }\n\n  // Low-level pointer/keyboard primitives below are `protected` for the 1.0\n  // freeze. They are inherited by every driver and by the engine root (where\n  // most are meaningless — see #1048), so exposing them publicly would freeze a\n  // large uniform surface that is breaking to narrow later but safe to widen\n  // (ADR-015). Concrete drivers compose them internally to build semantic\n  // actions; the raw gestures stay out of the public API. See #1045.\n\n  protected async mouseMove(option?: Partial<MouseMoveOption>): Promise<void> {\n    return this.interactor.mouseMove(this.locator, option);\n  }\n\n  protected async mouseDown(option?: Partial<MouseDownOption>): Promise<void> {\n    return this.interactor.mouseDown(this.locator, option);\n  }\n\n  protected async mouseUp(option?: Partial<MouseUpOption>): Promise<void> {\n    return this.interactor.mouseUp(this.locator, option);\n  }\n\n  protected async mouseOver(option?: Partial<HoverOption>): Promise<void> {\n    return this.interactor.mouseOver(this.locator, option);\n  }\n\n  protected async mouseOut(option?: Partial<MouseOutOption>): Promise<void> {\n    return this.interactor.mouseOut(this.locator, option);\n  }\n\n  protected async mouseEnter(option?: Partial<MouseEnterOption>): Promise<void> {\n    return this.interactor.mouseEnter(this.locator, option);\n  }\n\n  protected async mouseLeave(option?: Partial<MouseLeaveOption>): Promise<void> {\n    return this.interactor.mouseLeave(this.locator, option);\n  }\n\n  async focus(option?: Partial<FocusOption>): Promise<void> {\n    return this.interactor.focus(this.locator, option);\n  }\n\n  /**\n   * Dispatch a keyboard key press on the component. See {@link Interactor.pressKey}\n   * for the full contract, including modifier-key delivery via {@link PressKeyOption}.\n   * @param key A `KeyboardEvent.key` value, e.g. `'Escape'`, `'Backspace'`, `'Enter'`\n   * @param option Modifier flags and other per-press options — see {@link PressKeyOption}\n   */\n  async pressKey(key: string, option?: Partial<PressKeyOption>): Promise<void> {\n    return this.interactor.pressKey(this.locator, key, option);\n  }\n\n  /**\n   * Type text into the component as real per-character keystrokes, inserting at\n   * the current caret without clearing. See {@link Interactor.typeText}.\n   * @param text The literal text to type, one keystroke per character\n   */\n  async typeText(text: string): Promise<void> {\n    return this.interactor.typeText(this.locator, text);\n  }\n\n  /**\n   * Dispatch a right-click / `contextmenu` event on the component. See {@link Interactor.contextMenu}.\n   */\n  protected async contextMenu(): Promise<void> {\n    return this.interactor.contextMenu(this.locator);\n  }\n\n  /**\n   * Activate the component without relying on pointer geometry. See {@link Interactor.activate}.\n   */\n  protected async activate(): Promise<void> {\n    return this.interactor.activate(this.locator);\n  }\n\n  /**\n   * Scroll the component into the viewport. See {@link Interactor.scrollIntoView}.\n   *\n   * jsdom has no layout engine, so the scroll is a no-op there and behavioral\n   * assertions (visibility, offset) are E2E-only.\n   */\n  async scrollIntoView(): Promise<void> {\n    return this.interactor.scrollIntoView(this.locator);\n  }\n\n  /**\n   * Scroll the component by the given pixel delta. See {@link Interactor.scrollBy}.\n   *\n   * jsdom has no layout engine, so the scroll is a no-op there and behavioral\n   * assertions (resulting offset) are E2E-only.\n   *\n   * @param delta Pixel offset to scroll by\n   */\n  protected async scrollBy(delta: Point): Promise<void> {\n    return this.interactor.scrollBy(this.locator, delta);\n  }\n\n  /**\n   * Drag this component and drop it onto another component. See {@link Interactor.dragTo}.\n   *\n   * Prefer a keyboard-driven `setValue` over a true drag in real drivers — these\n   * drag primitives exist only for cases keyboard cannot express (e.g. panning a\n   * Lightbox, reordering a column). jsdom has no layout engine, so the positional\n   * outcome of the drag is E2E-only there.\n   *\n   * @param target Another driver whose root element is the drop target\n   */\n  protected async dragTo(target: ComponentDriver<any>): Promise<void> {\n    return this.interactor.dragTo(this.locator, target.locator);\n  }\n\n  /**\n   * Drag this component by the given pixel delta from its center. See {@link Interactor.drag}.\n   *\n   * Prefer a keyboard-driven `setValue` over a true drag in real drivers — these\n   * drag primitives exist only for cases keyboard cannot express (e.g. panning a\n   * Lightbox, reordering a column). jsdom has no layout engine, so the positional\n   * outcome of the drag is E2E-only there.\n   *\n   * @param delta Pixel offset to drag by\n   */\n  protected async drag(delta: Point): Promise<void> {\n    return this.interactor.drag(this.locator, delta);\n  }\n\n  /**\n   * Get this component's bounding rectangle. See {@link Interactor.getBoundingRect}.\n   *\n   * jsdom has no layout engine, so every coordinate and dimension is `0` there;\n   * real geometry is E2E-only.\n   */\n  protected getBoundingRect(): Promise<BoundingRect> {\n    return this.interactor.getBoundingRect(this.locator);\n  }\n\n  /**\n   * Whether the component is visible.  Visibility is defined\n   * that the component does not have the CSS property `display: none`,\n   * `visibility: hidden`, or `opacity: 0`.  However this does not\n   * check whether the component is within the viewport.\n   *\n   * @returns true if the component is visible, false otherwise\n   */\n  isVisible(): Promise<boolean> {\n    return this.interactor.isVisible(this.locator);\n  }\n\n  /**\n   * Wait until the component is attached and becomes visible to the DOM.\n   * @param timeoutMs The number of milliseconds to wait before timing out. Defaults\n   *   to {@link defaultWaitForOption}.timeoutMs so this wait shares a single\n   *   flake-tolerance source with {@link waitUntilComponentState} (#1057).\n   */\n  async waitUntilVisible(timeoutMs: number = defaultWaitForOption.timeoutMs): Promise<void> {\n    return this.waitUntilComponentState({\n      condition: 'visible',\n      timeoutMs,\n    });\n  }\n\n  /**\n   * Wait until the component is in the expected state such as\n   * the component's visibility or existence. If the component has\n   * not reached the expected state within the timeout, it will throw\n   * an error.\n   *\n   * By default it waits until the component is attached to the DOM\n   * within 30 seconds.\n   *\n   * @param option The option to configure the wait behavior\n   */\n  async waitUntilComponentState(option: Partial<Readonly<WaitForOption>> = defaultWaitForOption): Promise<void> {\n    return this.interactor.waitUntilComponentState(this.locator, option);\n  }\n\n  waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n    return this.interactor.waitUntil(option);\n  }\n\n  /**\n   * Hold an action open until its own postcondition holds, so the action does\n   * not resolve while the DOM it promised is still arriving.\n   *\n   * **Why actions, not reads or assertions.** An interactor settles the\n   * framework's scheduler after a write (React `act()`, Vue `nextTick()`,\n   * Angular `whenStable()`) and then treats the DOM as final. A component that\n   * defers its own DOM work onto a host timer — a `setTimeout` to re-register a\n   * select's options, to restore a picker's section spans — lands *after* that\n   * settle, so the next single-shot read observes a transient state that is\n   * neither the old value nor the new one. Making reads retry cannot fix this\n   * (a read does not know what it is waiting for, and negative reads must stay\n   * fast); making every mutation drain a fixed extra macrotask is a sleep at\n   * framework scale. The action is the only layer that knows what it promised,\n   * so the action is where the wait belongs.\n   *\n   * Probing uses {@link waitUntil}'s escalating intervals, so a postcondition\n   * that already holds costs one probe and no delay.\n   *\n   * @param postcondition Human-readable description of the awaited state, used\n   *   verbatim in {@link PostconditionNotMetError}. Phrase it as the state that\n   *   must arrive, not the action taken.\n   * @param probeFn Returns true once the postcondition holds. Keep it cheap —\n   *   it runs repeatedly.\n   * @param option.timeoutMs Defaults to {@link defaultWaitForOption}.timeoutMs so\n   *   every wait in the library shares one flake-tolerance source (#1057).\n   * @throws {PostconditionNotMetError} If the postcondition never holds. Failing\n   *   here is deliberate: an action that cannot keep its promise is a real\n   *   defect, and reporting it at the action gives a far better diagnostic than\n   *   the downstream assertion mismatch it would otherwise become.\n   */\n  protected async awaitPostcondition(\n    postcondition: string,\n    probeFn: () => Promise<boolean> | boolean,\n    option?: { readonly timeoutMs?: number }\n  ): Promise<void> {\n    const timeoutMs = option?.timeoutMs ?? defaultWaitForOption.timeoutMs;\n    const met = await this.interactor.waitUntil({\n      probeFn,\n      terminateCondition: true,\n      timeoutMs,\n    });\n    if (!met) {\n      throw new PostconditionNotMetError(this, postcondition, timeoutMs);\n    }\n  }\n\n  /**\n   * Get the inner HTML of the component\n   * @returns The inner HTML of the component\n   */\n  protected innerHTML(): Promise<string> {\n    return this.interactor.innerHTML(this.locator);\n  }\n\n  /**\n   * Get the runtime CSS selector of the component. This is useful for debugging and testing purposes.\n   *\n   * @returns The runtime CSS selector of the component\n   */\n  runtimeCssSelector(): Promise<string> {\n    return locatorUtil.toCssSelector(this.locator, this.interactor);\n  }\n\n  abstract get driverName(): string;\n}\n","import { ComponentDriver } from './drivers/ComponentDriver';\nimport { Interactor } from './interactor/Interactor';\nimport { PartLocator } from './locators/PartLocator';\nimport { IComponentDriverOption, ScenePart } from './partTypes';\n\n/**\n * Root driver used for driving a complete scene in a test.\n * It inherits all functionality from {@link ComponentDriver} and\n * adds a clean up hook so that tests can reliably dispose of resources.\n */\n\nexport class TestEngine<T extends ScenePart> extends ComponentDriver<T> {\n  private readonly _cleanUp: () => Promise<void>;\n\n  /**\n   * Construct a {@link TestEngine} instance.\n   *\n   * @param locator     Root locator for the scene.\n   * @param interactor  Low level interactor used by drivers.\n   * @param option      Optional driver configuration.\n   * @param cleanUp     Hook executed when {@link TestEngine.cleanUp | cleanUp} is called.\n   */\n  constructor(\n    locator: PartLocator,\n    public readonly interactor: Interactor,\n    option?: IComponentDriverOption<T>,\n    cleanUp?: () => Promise<void>\n  ) {\n    super(locator, interactor, option);\n    this._cleanUp = cleanUp ?? (() => Promise.resolve());\n  }\n\n  /**\n   * Run the clean up hook that was provided during construction.\n   */\n  async cleanUp(): Promise<void> {\n    await this._cleanUp();\n  }\n\n  /**\n   * Identifier for this driver. Used mainly by the debugging utilities.\n   */\n  get driverName(): string {\n    return 'TestEngine';\n  }\n}\n","import { PartLocator } from '../locators';\nimport { getLocatorInfoForErrorLog } from '../utils/getLocatorInfoForErrorLog';\nimport { ErrorBase } from './ErrorBase';\n\nexport const ListEnumerationMismatchErrorId = 'ListEnumerationMismatchError';\n\n/**\n * Thrown when a list's two reckonings of \"how many items\" disagree: positional\n * enumeration walked `:nth-of-type(i + 1)` and stopped, while the locator itself\n * matches a different number of elements. The walk is therefore a lower bound, and\n * the items missing from it are indistinguishable from items that do not exist.\n *\n * `:nth-of-type` counts by **tag**, among **one parent's** children. Any list whose\n * items do not sit as that uniform run of siblings breaks the correspondence, and\n * more than one shape does:\n *\n * - A non-item sibling sharing the items' tag — a header or separator `<li>`, an\n *   `<optgroup>` between `<option>`s — shifts the reckoning, and the walk stops at\n *   the first position the item selector no longer matches.\n * - Items nested under per-item wrappers, where each item is `:nth-of-type(1)` of\n *   its own parent, so the positional sequence never advances past the first.\n * - The list changing between the walk and the count — an async re-render or an\n *   in-flight animation — which no list SHAPE explains and no driver change fixes.\n *\n * For the two structural causes the fix is at the driver, not the call site: address\n * the list with `childListHelper`'s {@link iterateMatchingChildren} /\n * {@link countMatchingChildren}, whose `:nth-child` + child-selector filter skips\n * non-matching siblings without losing its place, and recurses into wrappers when\n * given a `groupSelector`. For the third, settle the list first — see\n * `interactorUtil.interactorWaitUtil`.\n *\n * Per ADR-010 only serializable state is retained — the locator's description, not\n * the live locator.\n */\nexport class ListEnumerationMismatchError extends ErrorBase {\n  readonly locatorDescription: string;\n  /** How many elements the item locator matches. */\n  readonly matchedCount: number;\n  /** How many items positional enumeration reached before it stopped. */\n  readonly enumeratedCount: number;\n\n  constructor(itemLocator: PartLocator, driver: { driverName: string }, matchedCount: number, enumeratedCount: number) {\n    const locatorDescription = getLocatorInfoForErrorLog(itemLocator);\n    super(\n      `List enumeration is incomplete: the item locator matches ${matchedCount} element(s) but ` +\n        `positional :nth-of-type addressing reached only ${enumeratedCount} before stopping, so ` +\n        `enumeration would otherwise have returned a silently short list. :nth-of-type counts by ` +\n        `tag among one parent's children, so this happens when the items are not a uniform run of ` +\n        `siblings: a non-item sharing their tag sits between them (a header or separator, an ` +\n        `<optgroup>); or each item is wrapped in its own parent, making every item ` +\n        `:nth-of-type(1); or the list changed between the walk and the count. For the first two, ` +\n        `address this list with childListHelper's iterateMatchingChildren/countMatchingChildren ` +\n        `instead; for the third, wait for the list to settle before enumerating. ` +\n        `Locator: ${locatorDescription}`,\n      driver\n    );\n    this.locatorDescription = locatorDescription;\n    this.matchedCount = matchedCount;\n    this.enumeratedCount = enumeratedCount;\n    this.name = ListEnumerationMismatchErrorId;\n  }\n}\n","import { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByAriaLabelSource = {\n  _id: 'byAriaLabel';\n  value: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements by the verbatim value of their `aria-label` attribute.\n *\n * This matches the literal `aria-label` attribute only — it does NOT resolve the\n * computed accessible name (from `aria-labelledby`, an associated `<label>`, or\n * text content), which is not CSS-expressible and is the job of the forthcoming\n * name-aware `findByRole` (deferred — see #923).\n *\n * Most commonly composed with {@link byRole} on the SAME element to tell two\n * same-role siblings apart without relying on unstable (e.g. StyleX-hashed) class\n * names. Use {@link locatorUtil.and} to compound the matchers onto one element:\n *\n * ```ts\n * import { byAriaLabel, byRole, locatorUtil } from '@atomic-testing/core';\n * const openButton = locatorUtil.and(byRole('button'), byAriaLabel('Open'));\n * const closeButton = locatorUtil.and(byRole('button'), byAriaLabel('Close'));\n * ```\n *\n * @param value - Verbatim `aria-label` to match.\n * @param relative - Relative position of the locator. Defaults to `'Descendant'`.\n * @example\n * ```ts\n * const close = byAriaLabel('Close');\n * ```\n */\nexport function byAriaLabel(value: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const sanitized = escapeValue(value);\n  return [\n    new CssLocator(`[aria-label=\"${sanitized}\"]`, {\n      relative,\n      source: {\n        _id: 'byAriaLabel',\n        value,\n        relative,\n      },\n    }),\n  ];\n}\n","import { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByCheckedSource = {\n  _id: 'byChecked';\n  checked: boolean;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate a checkbox or radio input based on its checked state.\n *\n * @param checked - Whether the element should be checked. Defaults to `true`.\n * @param relative - Relative position for the locator. Defaults to\n * `'Same'` so it can be chained with the checkbox locator itself.\n * @example\n * ```ts\n * const unchecked = byChecked(false);\n * ```\n */\nexport function byChecked(checked = true, relative: LocatorRelativePosition = 'Same'): PartLocator {\n  let selector = ':checked';\n  if (!checked) {\n    selector = `:not(${selector})`;\n  }\n  return [\n    new CssLocator(selector, {\n      relative,\n      source: {\n        _id: 'byChecked',\n        checked,\n        relative,\n      },\n    }),\n  ];\n}\n","import { escapeCssClassName } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByCssClassSource = {\n  _id: 'byCssClass';\n  className: string | string[];\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements using their CSS class name.\n *\n * Providing multiple class names will result in a selector that matches\n * elements containing all the classes.\n *\n * @param className - One or more class names to match.\n * @param relativeTo - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const icon = byCssClass('MuiIcon-root');\n * const menuItem = byCssClass(['MuiListItem-root', 'active']);\n * ```\n */\nexport function byCssClass(\n  className: string | string[],\n  relativeTo: LocatorRelativePosition = 'Descendant'\n): PartLocator {\n  const classNames = Array.isArray(className) ? className : [className];\n  const selector = classNames.map(cls => `.${escapeCssClassName(cls)}`).join('');\n  return [\n    new CssLocator(selector, {\n      relative: relativeTo,\n      source: {\n        _id: 'byCssClass',\n        className,\n        relative: relativeTo,\n      },\n    }),\n  ];\n}\n","import { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByCssSelectorSource = {\n  _id: 'byCssSelector';\n  selector: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements using a raw CSS selector string.\n *\n * This is a low level API and should be used when the other helper\n * locators cannot express the desired selector.\n *\n * @param selector - A CSS selector string.\n * @param relativeTo - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const activeItem = byCssSelector('.menu .item.active');\n * ```\n */\nexport function byCssSelector(selector: string, relativeTo: LocatorRelativePosition = 'Descendant'): PartLocator {\n  return [\n    new CssLocator(selector, {\n      relative: relativeTo,\n      source: {\n        _id: 'byCssSelector',\n        selector,\n        relative: relativeTo,\n      },\n    }),\n  ];\n}\n","// TODO: Use descriptive selector instead of css selector so the selector can be reintepreted\nimport { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByInputTypeSource = {\n  _id: 'byInputType';\n  type: string;\n  relative: LocatorRelativePosition;\n};\n\n// to implementation other than CSS selector\n/**\n * Locate an `<input>` element by its `type` attribute.\n *\n * @param type - The value of the `type` attribute such as `text`, `checkbox`\n * or `radio`.\n * @param relative - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const passwordField = byInputType('password');\n * ```\n */\nexport function byInputType(type: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const selector = `input[type=\"${escapeValue(type)}\"]`;\n  return [\n    new CssLocator(selector, {\n      relative,\n      source: {\n        _id: 'byInputType',\n        type,\n        relative,\n      },\n    }),\n  ];\n}\n","import { LinkedCssLocator, LinkedCssLocatorValueExtract } from './LinkedCssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport { PartLocator } from './PartLocator';\n\n/**\n * Experimental locator that matches an element by relating it to another\n * element on the page. It is useful when two elements share related\n * attributes.\n *\n * @param relative - Relative position for the resulting locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const label = byLinkedElement().onLinkedElement(byDataTestId('input'))\n *   .extractAttribute('for')\n *   .toMatchMyAttribute('id');\n * ```\n */\nexport function byLinkedElement(relative: LocatorRelativePosition = 'Descendant') {\n  return {\n    onLinkedElement: (locator: PartLocator) => {\n      return {\n        extractAttribute: (attributeName: string) => {\n          const matchExtract: LinkedCssLocatorValueExtract = {\n            type: 'attribute',\n            attributeName,\n          };\n          return {\n            toMatchMyAttribute: (myAttributeName: string): PartLocator => {\n              const valueExtract: LinkedCssLocatorValueExtract = {\n                type: 'attribute',\n                attributeName: myAttributeName,\n              };\n              return [\n                new LinkedCssLocator('byLinkedElement', {\n                  valueExtract,\n                  matchingTargetLocator: locator,\n                  matchingTargetValueExtract: matchExtract,\n                  relative,\n                }),\n              ];\n            },\n          };\n        },\n      };\n    },\n  };\n}\n","import { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByNameSource = {\n  _id: 'byName';\n  value: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements using the value of their `name` attribute.\n *\n * @param value - Value of the `name` attribute to match.\n * @param relative - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const searchBox = byName('search');\n * ```\n */\nexport function byName(value: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const sanitized = escapeValue(value);\n  return [\n    new CssLocator(`[name=\"${sanitized}\"]`, {\n      relative,\n      source: {\n        _id: 'byName',\n        value,\n        relative,\n      },\n    }),\n  ];\n}\n","import { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByRoleSource = {\n  _id: 'byRole';\n  value: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements by their ARIA `role` attribute.\n *\n * To additionally disambiguate two same-role elements by their accessible name,\n * compose with {@link byAriaLabel} (verbatim `aria-label`) on the SAME element\n * via {@link locatorUtil.and}:\n *\n * ```ts\n * import { byAriaLabel, byRole, locatorUtil } from '@atomic-testing/core';\n * const openButton = locatorUtil.and(byRole('button'), byAriaLabel('Open'));\n * ```\n *\n * Computed accessible names (`aria-labelledby` / `<label>` / text content) are\n * not CSS-expressible and are the job of the forthcoming name-aware `findByRole`\n * (deferred — see #923).\n *\n * @param value - The role value to match.\n * @param relative - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const dialog = byRole('dialog');\n * const root = byRole('presentation', 'Root');\n * ```\n */\nexport function byRole(value: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const sanitized = escapeValue(value);\n  return [\n    new CssLocator(`[role=\"${sanitized}\"]`, {\n      relative,\n      source: {\n        _id: 'byRole',\n        value,\n        relative,\n      },\n    }),\n  ];\n}\n","import { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByTagNameSource = {\n  _id: 'byTagName';\n  tagName: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements by their HTML tag name.\n *\n * This locator is generally discouraged in favour of more stable\n * attributes such as `data-testid`.\n *\n * @param tagName - The tag name to match.\n * @param relative - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const headings = byTagName('h1');\n * ```\n */\nexport function byTagName(tagName: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  return [\n    new CssLocator(tagName, {\n      relative,\n      source: {\n        _id: 'byTagName',\n        tagName,\n        relative,\n      },\n    }),\n  ];\n}\n","import { escapeValue } from '../utils/escapeUtil';\nimport { CssLocator } from './CssLocator';\nimport type { LocatorRelativePosition } from './LocatorRelativePosition';\nimport type { PartLocator } from './PartLocator';\n\nexport type ByValueSource = {\n  _id: 'byValue';\n  value: string;\n  relative: LocatorRelativePosition;\n};\n\n/**\n * Locate elements by the value of their `value` attribute.\n *\n * @param value - The value to match.\n * @param relative - Relative position of the locator. Defaults to\n * `'Descendant'`.\n * @example\n * ```ts\n * const option = byValue('option1');\n * ```\n */\nexport function byValue(value: string, relative: LocatorRelativePosition = 'Descendant'): PartLocator {\n  const sanitized = escapeValue(value);\n  return [\n    new CssLocator(`[value=\"${sanitized}\"]`, {\n      relative,\n      source: {\n        _id: 'byValue',\n        value,\n        relative,\n      },\n    }),\n  ];\n}\n","import { AccessibleRoleLocator, AccessibleRoleLocatorRelativePosition } from './AccessibleRoleLocator';\nimport type { PartLocator } from './PartLocator';\n\n/**\n * Locate an element by its ARIA `role` plus its COMPUTED accessible name — the\n * accname algorithm: `aria-labelledby` id-refs, an associated `<label>`,\n * wrapping/`title` text, and (unlike {@link byAriaLabel}) plain visible text\n * content. This is the common case for a design system that labels controls\n * with visible text rather than a literal `aria-label` attribute.\n *\n * Resolution is NOT CSS: the accessible name is computed by a multi-node graph\n * traversal no CSS selector can express (see\n * [ADR-008](https://github.com/atomic-testing/atomic-testing/blob/main/agent-docs/adr/008-css-dom-only-locator-boundary.md)).\n * Each interactor resolves it internally via an engine that already implements\n * accname — `@testing-library/dom`'s `getByRole` in jsdom, Playwright's\n * `Locator.getByRole`/`Page.getByRole` in the browser. `name` matching is\n * always exact and case-sensitive in both engines (see\n * {@link AccessibleRoleLocator} for why there is no `exact` option). Composing\n * this with a preceding locator scopes the search to that ancestor's subtree\n * (e.g. `locatorUtil.append(dialogLocator, findByRole('button', 'Save'))`\n * finds \"Save\" only within the dialog); it must be the LAST segment of a\n * chain — nothing can be appended after it.\n *\n * Use `findByRole` when the name comes from visible text/`<label>`/\n * `aria-labelledby`; use {@link byAriaLabel} (composed via {@link\n * locatorUtil.and}) when the name is a verbatim `aria-label` attribute — that\n * stays a pure-CSS match with no accname cost.\n *\n * @param role - The ARIA role value to match, e.g. `'button'`, `'link'`.\n * @param name - The computed accessible name to match, exact and\n * case-sensitive. Omit to match by role alone (equivalent to {@link byRole}\n * but accname-resolved).\n * @param relative - Relative position of the locator. Only `'Root'` (escape to\n * the document root) and `'Descendant'` (the default) are accepted: `'Same'`\n * (compound onto the same element) and `'Child'` (restrict to a direct child)\n * have no accname-search equivalent, so the type excludes them rather than\n * silently falling back to `'Descendant'` behavior — see\n * {@link AccessibleRoleLocatorRelativePosition}.\n * @example\n * ```ts\n * const saveButton = findByRole('button', 'Save');\n * const scopedSaveButton = locatorUtil.append(dialogLocator, findByRole('button', 'Save'));\n * ```\n */\nexport function findByRole(\n  role: string,\n  name?: string,\n  relative: AccessibleRoleLocatorRelativePosition = 'Descendant'\n): PartLocator {\n  return [new AccessibleRoleLocator(role, { name, relative })];\n}\n","import { Optional } from '../dataTypes';\nimport { ListEnumerationMismatchError } from '../errors/ListEnumerationMismatchError';\nimport { byCssSelector, type PartLocator } from '../locators';\nimport { ComponentDriverCtor, ScenePart } from '../partTypes';\nimport { append } from '../utils/locatorUtil';\nimport { ComponentDriver } from './ComponentDriver';\n\n/**\n * Get list item driver within host by index.  List item is an indefinite number of items under the same host\n * with similar characteristics defined by the itemLocatorBase.\n * @param host The component the list item is under\n * @param itemLocatorBase The locator of the list item without the index, the locator should already compound the host locator if needed\n * @param index The index of the list item\n * @param driverClass The driver class of the list item\n * @returns The item's driver, or `undefined` when the index is out of range.\n */\nexport async function getListItemByIndex<HostPartT extends ScenePart, ItemT extends ComponentDriver>(\n  host: ComponentDriver<HostPartT>,\n  itemLocatorBase: PartLocator,\n  index: number,\n  driverClass: ComponentDriverCtor<ItemT>\n): Promise<Optional<ItemT>> {\n  // Address the i-th item by tag position among siblings. `:nth-of-type` is the\n  // pseudo both jsdom and Playwright resolve identically here, but it counts by\n  // tag — so this addressing (and thus its agreement with getListItemCount)\n  // assumes the homogeneous-siblings requirement documented on getListItemCount:\n  // no same-tag non-item sibling shifting the reckoning. childListHelper's\n  // `:nth-child` + selector filter is the mixed-sibling alternative.\n  const nthLocator: PartLocator = byCssSelector(`:nth-of-type(${index + 1})`, 'Same');\n  const itemLocator = append(itemLocatorBase, nthLocator);\n  const exists = await host.interactor.exists(itemLocator);\n  if (exists) {\n    return new driverClass(itemLocator, host.interactor, host.commutableOption);\n  }\n  return undefined;\n}\n\n/**\n * Get an iterator of list item driver.\n * List item is an indefinite number of items under the same host\n *\n * Iteration stops at the first index that does not resolve. For the homogeneous\n * sibling set this addressing requires (see {@link getListItemCount}) that is the\n * end of the list — but any list whose items are not a uniform run of siblings can\n * halt it mid-list instead (a same-tag non-item shifting the reckoning, per-item\n * wrappers making every item `:nth-of-type(1)`; see\n * {@link ListEnumerationMismatchError} for the full set). So on running to\n * completion this cross-checks the number of items it reached against the number the\n * locator actually matches, and throws {@link ListEnumerationMismatchError} when\n * they disagree.\n *\n * Truncation used to be silent, which made it strictly worse than a failure: a\n * header `<li>` ahead of the items yielded an EMPTY list while `getListItemCount`\n * reported 3, and `getItemByLabel` reported \"no such item\" for an item plainly\n * present. Callers cannot detect this themselves — a short list and a genuinely\n * short list are identical at the call site — so the check belongs here, in the\n * primitive whose addressing creates the hazard, rather than in each of its\n * consumers.\n *\n * Costs one extra {@link Interactor.getElementCount} per completed enumeration,\n * against the n + 1 `exists()` round-trips the walk already spends. A consumer that\n * breaks out early (a label search that finds its match) never reaches the check\n * and never pays for it — and is not making a completeness claim to check.\n *\n * A walk with a non-zero `startIndex` is **not** checked; see the comment at the\n * check for why the two reckonings cannot be reconciled across a tag-position offset.\n *\n * @param host The component the list item is under\n * @param itemLocatorBase The locator of the list item without the index, the locator should already compound the host locator if needed\n * @param driverClass The driver class of the list item\n * @param startIndex The starting index of the list item iterator, default is 0\n * @throws {@link ListEnumerationMismatchError} when enumeration completes having\n * reached fewer items than `itemLocatorBase` matches.\n */\nexport async function* getListItemIterator<HostPartT extends ScenePart, ItemT extends ComponentDriver>(\n  host: ComponentDriver<HostPartT>,\n  itemLocatorBase: PartLocator,\n  driverClass: ComponentDriverCtor<ItemT>,\n  startIndex: number = 0\n): AsyncGenerator<ItemT, void, unknown> {\n  let index = startIndex;\n  let item: Optional<ItemT> = await getListItemByIndex(host, itemLocatorBase, index, driverClass);\n  while (item != null) {\n    yield item;\n    index++;\n    item = await getListItemByIndex(host, itemLocatorBase, index, driverClass);\n  }\n\n  // Only a walk from 0 can be checked. `startIndex` is an offset into TAG positions,\n  // not into matched elements, and the two are not convertible: MUI X's\n  // DataGridRowDriverBase passes startIndex 1 to skip a filler <div> that precedes the\n  // real cells, and that filler holds tag position 1 while matching none of the five\n  // `[role=columnheader]` elements the locator counts. Subtracting startIndex from the\n  // match count would therefore expect 4 where 5 is right — which is exactly the false\n  // positive this guard produced against the DataGrid suites before being scoped here.\n  // Establishing how many matched elements sit below startIndex would take extra\n  // queries to answer a question the caller has already opted out of by asking for an\n  // offset walk, so a partial walk stays unchecked.\n  if (startIndex !== 0) {\n    return;\n  }\n  const matchedCount = await getListItemCount(host, itemLocatorBase);\n  if (index !== matchedCount) {\n    throw new ListEnumerationMismatchError(itemLocatorBase, host, matchedCount, index);\n  }\n}\n\n/**\n * Count the items in a list in a single interactor round-trip, without\n * instantiating any item driver.\n *\n * Counts by locator match: {@link Interactor.getElementCount} asks the interactor\n * how many elements `itemLocatorBase` matches. This replaces the former\n * index-by-index `exists()` probing — O(n) round-trips, costly under Playwright\n * where `locator.count()` is one call — and simultaneously fixes the count-side\n * `:nth-of-type` miscount: counting by match (not by tag position) no longer\n * mis-sizes a list interleaved with a same-tag non-item (a header/divider `<li>`).\n *\n * **Homogeneous-siblings requirement.** {@link getListItemByIndex} still ADDRESSES\n * the i-th item by appending `:nth-of-type(i + 1)` to `itemLocatorBase`, so this\n * count and that index access agree only when the items are the homogeneous set\n * the base matches — i.e. no non-item sibling of the same tag shifts the\n * `:nth-of-type` reckoning. For lists that mix item tags or interleave same-tag\n * non-items, use childListHelper's {@link countMatchingChildren} /\n * {@link iterateMatchingChildren} instead, whose `:nth-child` + `childSelector`\n * filter tolerates mixed siblings.\n *\n * @param host The component the list items are under\n * @param itemLocatorBase The locator of the list items without the index; it must\n * match the homogeneous item set only (see the requirement above)\n * @returns The number of items in the list\n */\nexport async function getListItemCount<HostPartT extends ScenePart>(\n  host: ComponentDriver<HostPartT>,\n  itemLocatorBase: PartLocator\n): Promise<number> {\n  return host.interactor.getElementCount(itemLocatorBase);\n}\n\n/**\n * Collect the non-null visible labels of labelled list items, in DOM order.\n *\n * Shared by the list-family drivers whose item drivers expose `getLabel()`\n * (`ListComponentDriver` subclasses and `PositionalListDriver`), so the\n * \"map → filter the absent ones\" idiom lives in one place.\n */\nexport async function collectItemLabels(\n  items: ReadonlyArray<{ getLabel(): Promise<string | null | undefined> }>\n): Promise<string[]> {\n  const labels = await Promise.all(items.map(item => item.getLabel()));\n  return labels.filter((label): label is string => label != null);\n}\n","import { Optional } from '../dataTypes';\nimport { Interactor } from '../interactor';\nimport { PartLocator } from '../locators/PartLocator';\nimport { IComponentDriverOption, ComponentDriverCtor } from '../partTypes';\nimport * as locatorUtil from '../utils/locatorUtil';\nimport { ComponentDriver } from './ComponentDriver';\nimport * as listHelper from './listHelper';\n\nexport interface ListComponentDriverSpecificOption<ItemT extends ComponentDriver> {\n  itemClass: new (locator: PartLocator, interactor: Interactor, option?: Partial<IComponentDriverOption>) => ItemT;\n  itemLocator: PartLocator;\n}\n\nexport interface ListComponentDriverOption<ItemT extends ComponentDriver>\n  extends IComponentDriverOption, ListComponentDriverSpecificOption<ItemT> {}\n\nexport class ListComponentDriver<ItemT extends ComponentDriver> extends ComponentDriver {\n  private readonly _option: ListComponentDriverSpecificOption<ItemT> & Partial<ListComponentDriverOption<ItemT>>;\n  private _itemLocator: PartLocator;\n  constructor(locator: PartLocator, interactor: Interactor, option: ListComponentDriverSpecificOption<ItemT>) {\n    super(locator, interactor, {\n      ...option,\n      parts: {},\n    });\n\n    this._option = option;\n    const childLocator = option.itemLocator;\n    this._itemLocator = locatorUtil.append(locator, childLocator);\n  }\n\n  protected getItemLocator(): PartLocator {\n    return this._itemLocator;\n  }\n\n  protected getItemClass<ItemClass extends ComponentDriver = ItemT>(\n    itemDriverClass?: ComponentDriverCtor<ItemClass>\n  ): ComponentDriverCtor<ItemClass> {\n    return itemDriverClass ?? (this._option.itemClass as unknown as ComponentDriverCtor<ItemClass>);\n  }\n\n  /**\n   * Get the item's driver instance at the given index\n   * @param index\n   * @param itemDriverClass\n   * @returns The item's driver instance at the given index, or `undefined` when the\n   * index is out of range. Absence is `undefined` (never `null`) across every core\n   * read — see ADR-006 §7.\n   */\n  async getItemByIndex<ItemClass extends ComponentDriver = ItemT>(\n    index: number,\n    itemDriverClass?: ComponentDriverCtor<ItemClass>\n  ): Promise<Optional<ItemClass>> {\n    const driverClass = this.getItemClass<ItemClass>(itemDriverClass);\n    return listHelper.getListItemByIndex(this, this._itemLocator, index, driverClass);\n  }\n\n  /**\n   * Get the item's driver instance by the given text\n   * @param text\n   * @param itemDriverClass\n   * @returns The item's driver instance with the given text, or `undefined` when no\n   * item matches. Absence is `undefined` (never `null`) across every core read — see\n   * ADR-006 §7.\n   * @throws {@link ListEnumerationMismatchError} when it searched the whole list\n   * without a match but the list is not the homogeneous sibling set positional\n   * addressing requires — in that case \"no item matches\" cannot be distinguished\n   * from \"enumeration stopped before reaching it\", so it is not reported as absence.\n   */\n  async getItemByLabel<ItemClass extends ComponentDriver = ItemT>(\n    text: string,\n    itemDriverClass?: ComponentDriverCtor<ItemClass>\n  ): Promise<Optional<ItemClass>> {\n    const driverClass = this.getItemClass(itemDriverClass);\n\n    for await (const item of listHelper.getListItemIterator(this, this._itemLocator, driverClass)) {\n      const itemText = await item.getText();\n      if (itemText?.trim() === text) {\n        return item;\n      }\n    }\n    return undefined;\n  }\n\n  /**\n   * Get all the items' driver instances in the list, in DOM order.\n   * @param itemDriverClass\n   * @returns Every item in the list — never a partial set: see the `@throws` below.\n   * @throws {@link ListEnumerationMismatchError} when the list is not the\n   * homogeneous sibling set positional addressing requires, so enumeration would\n   * otherwise have returned a silently short array.\n   */\n  async getItems<ItemClass extends ComponentDriver = ItemT>(\n    itemDriverClass?: ComponentDriverCtor<ItemClass>\n  ): Promise<ItemClass[]> {\n    const driverClass = this.getItemClass(itemDriverClass);\n    const result: ItemClass[] = [];\n    for await (const item of listHelper.getListItemIterator(this, this._itemLocator, driverClass)) {\n      result.push(item);\n    }\n    return result;\n  }\n\n  /**\n   * Get the number of items in the list, in a single interactor round-trip and\n   * without instantiating an item driver — so prefer it to `getItems().length` when\n   * only the count is wanted.\n   *\n   * It is not merely a cheaper `getItems().length`, though: this counts the elements\n   * the item locator **matches**, while {@link getItems} walks `:nth-of-type`\n   * **positions**. The two agree exactly for the homogeneous sibling set this driver\n   * requires, and a list that breaks that requirement makes {@link getItems} throw\n   * {@link ListEnumerationMismatchError} rather than let the two answers diverge in\n   * silence.\n   *\n   * @returns The number of elements the item locator matches\n   */\n  async getItemCount(): Promise<number> {\n    return listHelper.getListItemCount(this, this._itemLocator);\n  }\n\n  override get driverName(): string {\n    return 'ListComponentDriver';\n  }\n}\n","import { Interactor } from '../interactor';\nimport { byCssSelector, type PartLocator } from '../locators';\nimport { ComponentDriverCtor } from '../partTypes';\nimport { append } from '../utils/locatorUtil';\nimport { ComponentDriver } from './ComponentDriver';\n\n/** Locator for the container's `position`-th element child (1-based), any element. */\nfunction anyChildAt(container: PartLocator, position: number): PartLocator {\n  return append(container, byCssSelector(`> *:nth-child(${position})`));\n}\n\n/** Locator for the container's `position`-th child, only if it matches `childSelector`. */\nfunction matchingChildAt(container: PartLocator, childSelector: string, position: number): PartLocator {\n  return append(container, byCssSelector(`> ${childSelector}:nth-child(${position})`));\n}\n\n/** Locator for every direct child of `container` matching `childSelector`. */\nfunction matchingChildren(container: PartLocator, childSelector: string): PartLocator {\n  return append(container, byCssSelector(`> ${childSelector}`));\n}\n\n/**\n * Yield a driver for each descendant of `container` that matches `childSelector`,\n * addressed positionally by `:nth-child`.\n *\n * `:nth-child` is the only element-position pseudo that both jsdom and Playwright\n * resolve identically, and — unlike the `:nth-of-type` used by {@link getListItemByIndex}\n * and friends — it counts across element types. This matters for lists whose items\n * either mix tags (e.g. `<a>`/`<div>` menu items) or are interspersed with\n * non-items (a `role=\"separator\"`, an overflow trigger) sharing a tag with the\n * items: each position is filtered through `childSelector`, so non-matching\n * siblings are skipped without throwing off the index.\n *\n * When `groupSelector` is supplied, a child that is not itself an item but matches\n * `groupSelector` is treated as a wrapper and recursed into — so items nested one\n * (or more) levels deep are still found. Pass a specific selector (e.g. a\n * `role=\"group\"` section) to descend only through those wrappers, or `'*'` to\n * descend through any layout container. Omit it for a flat (direct-children-only)\n * walk.\n *\n * Iteration walks positions until no child exists there, using only\n * {@link Interactor.exists} — portable across interactors (notably,\n * `getAttribute(..., true)` is NOT a reliable element count: Playwright drops\n * null entries, jsdom keeps them). `container` must resolve to a single element so\n * `:nth-child` is unambiguous.\n */\nexport async function* iterateMatchingChildren<ItemT extends ComponentDriver>(\n  host: ComponentDriver,\n  container: PartLocator,\n  childSelector: string,\n  driverClass: ComponentDriverCtor<ItemT>,\n  groupSelector?: string\n): AsyncGenerator<ItemT> {\n  for (let position = 1; await host.interactor.exists(anyChildAt(container, position)); position++) {\n    const itemLocator = matchingChildAt(container, childSelector, position);\n    if (await host.interactor.exists(itemLocator)) {\n      yield new driverClass(itemLocator, host.interactor, host.commutableOption);\n    } else if (groupSelector != null) {\n      const groupLocator = matchingChildAt(container, groupSelector, position);\n      if (await host.interactor.exists(groupLocator)) {\n        yield* iterateMatchingChildren(host, groupLocator, childSelector, driverClass, groupSelector);\n      }\n    }\n  }\n}\n\n/**\n * Count a container's descendants matching `childSelector` (see\n * {@link iterateMatchingChildren} for the `groupSelector` recursion that reaches\n * items nested inside wrappers).\n *\n * The flat case (no `groupSelector`) is a single {@link Interactor.getElementCount}\n * on `> childSelector` — one round-trip instead of the O(children) `exists()`\n * position-walk, and count-equivalent to it: the child-combinator + `childSelector`\n * filter counts exactly the direct children the walk would, still skipping\n * non-matching same-tag siblings. The recursive case must descend into\n * `groupSelector` wrappers, which no single query expresses, so it keeps walking\n * positions via {@link Interactor.exists} (see {@link iterateMatchingChildren} for\n * why a `getAttribute`-based count is not portable).\n */\nexport async function countMatchingChildren(\n  interactor: Interactor,\n  container: PartLocator,\n  childSelector: string,\n  groupSelector?: string\n): Promise<number> {\n  if (groupSelector == null) {\n    return interactor.getElementCount(matchingChildren(container, childSelector));\n  }\n\n  let count = 0;\n  for (let position = 1; await interactor.exists(anyChildAt(container, position)); position++) {\n    if (await interactor.exists(matchingChildAt(container, childSelector, position))) {\n      count++;\n    } else {\n      const groupLocator = matchingChildAt(container, groupSelector, position);\n      if (await interactor.exists(groupLocator)) {\n        count += await countMatchingChildren(interactor, groupLocator, childSelector, groupSelector);\n      }\n    }\n  }\n  return count;\n}\n\n/**\n * Collect a driver for every descendant of `container` matching `childSelector`\n * (see {@link iterateMatchingChildren} for the `groupSelector` recursion).\n */\nexport async function getMatchingChildren<ItemT extends ComponentDriver>(\n  host: ComponentDriver,\n  container: PartLocator,\n  childSelector: string,\n  driverClass: ComponentDriverCtor<ItemT>,\n  groupSelector?: string\n): Promise<ItemT[]> {\n  const items: ItemT[] = [];\n  for await (const item of iterateMatchingChildren(host, container, childSelector, driverClass, groupSelector)) {\n    items.push(item);\n  }\n  return items;\n}\n","import { PartLocator } from '../locators';\nimport { getLocatorInfoForErrorLog } from '../utils/getLocatorInfoForErrorLog';\nimport { InteractorErrorBase } from './InteractorErrorBase';\n\nexport const ElementNotFoundErrorId = 'ElementNotFoundError';\n\nfunction getErrorMessage(locator: PartLocator, action: string): string {\n  const selector = getLocatorInfoForErrorLog(locator);\n  return `Cannot ${action}: element not found. Locator: ${selector}`;\n}\n\n/**\n * Error thrown when an interactor method is called on an element that does not exist.\n * This error is thrown at the interactor level and does not require a ComponentDriver reference.\n */\nexport class ElementNotFoundError extends InteractorErrorBase {\n  constructor(\n    locator: PartLocator,\n    public readonly action: string\n  ) {\n    super(getErrorMessage(locator, action), getLocatorInfoForErrorLog(locator));\n    this.name = ElementNotFoundErrorId;\n  }\n}\n","import { PartLocator } from '../locators';\nimport { getLocatorInfoForErrorLog } from '../utils/getLocatorInfoForErrorLog';\nimport { ErrorBase } from './ErrorBase';\n\nexport const ItemNotFoundErrorId = 'ItemNotFoundError';\n\n/**\n * The canonical \"an item searched for in a collection was not found\" error.\n * Component-specific list-miss errors (e.g. a menu's `MenuItemNotFoundError`)\n * subclass this so callers can catch the family with one `instanceof` check.\n *\n * Per ADR-010 it retains only a serializable {@link locatorDescription} string —\n * never the live locator — keeping the frozen error contract decoupled from the\n * locator model.\n *\n * @param query What was searched for — a {@link PartLocator} or a human-readable\n *   description such as an item label.\n * @param driver Anything name-bearing (a driver satisfies `{ driverName }`); only\n *   its `driverName` is retained.\n * @param message Optional override for the generated message, used by subclasses\n *   that phrase the miss in their own terms.\n */\nexport class ItemNotFoundError extends ErrorBase {\n  readonly locatorDescription: string;\n\n  constructor(query: PartLocator | string, driver: { driverName: string }, message?: string) {\n    const locatorDescription = typeof query === 'string' ? query : getLocatorInfoForErrorLog(query);\n    super(message ?? `Item not found.  Locator: ${locatorDescription}`, driver);\n    this.locatorDescription = locatorDescription;\n    this.name = ItemNotFoundErrorId;\n  }\n}\n","import { WaitForOption } from '../drivers/WaitForOption';\nimport { PartLocator } from '../locators';\nimport { getLocatorInfoForErrorLog } from '../utils/getLocatorInfoForErrorLog';\nimport { InteractorErrorBase } from './InteractorErrorBase';\n\nexport const WaitForFailureErrorId = 'WaitForFailureError';\n\nfunction getErrorMessage(locator: PartLocator, option: WaitForOption): string {\n  const selector = getLocatorInfoForErrorLog(locator);\n  return `Wait for element to be ${option.condition} failed after ${option.timeoutMs}ms: ${selector}`;\n}\n\n/**\n * Thrown when `waitUntil`/`waitFor`-style polling (see `interactorUtil.interactorWaitUtil`)\n * times out before an element reaches the requested {@link WaitForOption.condition}\n * (`attached`, `detached`, `visible`, or `hidden`) — the element's actual state\n * never matched the expected one within `option.timeoutMs`.\n *\n * Per ADR-010 it carries only the serializable `locatorDescription` string\n * inherited from {@link InteractorErrorBase}, not the live locator.\n */\nexport class WaitForFailureError extends InteractorErrorBase {\n  constructor(locator: PartLocator, option: WaitForOption) {\n    super(getErrorMessage(locator, option), getLocatorInfoForErrorLog(locator));\n    this.name = WaitForFailureErrorId;\n  }\n}\n","import { Point } from '../geometry';\n\nexport interface MouseOption {\n  /**\n   * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of\n   * the element.\n   * Note that in end to end tests such as Playwright, mouse interaction location is not always pixel perfect.\n   */\n  position?: Point;\n}\n\nexport interface ClickOption extends MouseOption {\n  /**\n   * Number of clicks to dispatch as a single gesture, e.g. `2` for a\n   * double-click. Only `2` is currently implemented; omit for a single click.\n   * Two separate `click()` calls do not reliably register as a real\n   * double-click (actionability re-checks between calls can exceed the\n   * platform's double-click timing threshold), so a genuine double-click\n   * gesture needs this option rather than calling `click()` twice.\n   *\n   * Every `Interactor.click()` implementation validates this via\n   * {@link assertValidClickCount} and throws for anything other than `2`, so\n   * an unsupported value fails the same way in every environment instead of\n   * silently diverging (e.g. Playwright honoring a `3` while jsdom silently\n   * falls back to a single click).\n   */\n  clickCount?: number;\n}\n\n/**\n * Validate a {@link ClickOption.clickCount}. Shared by every `Interactor.click()`\n * implementation so an unsupported value throws identically everywhere,\n * rather than each environment interpreting it differently.\n * @throws {Error} If `clickCount` is set to anything other than `2`.\n */\nexport function assertValidClickCount(clickCount: number | undefined): void {\n  if (clickCount != null && clickCount !== 2) {\n    throw new Error(`click() 'clickCount' must be 2 (a double-click) when provided; received ${clickCount}.`);\n  }\n}\n\nexport interface MouseMoveOption extends MouseOption {}\n\nexport interface MouseDownOption extends MouseOption {}\n\nexport interface MouseUpOption extends MouseOption {}\n\nexport interface HoverOption extends MouseOption {}\n\nexport interface MouseOutOption {}\n\nexport interface MouseEnterOption {}\n\nexport interface MouseLeaveOption {}\n","export interface DifferenceResult<T> {\n  toAdd: ReadonlySet<T>;\n  toRemove: ReadonlySet<T>;\n}\n\nexport function getDifference<T>(from: Iterable<T>, to: Iterable<T>): DifferenceResult<T> {\n  const fromSet = new Set(from);\n  const toSet = new Set(to);\n\n  return {\n    toAdd: findNotIn(toSet, fromSet),\n    toRemove: findNotIn(fromSet, toSet),\n  };\n}\n\n/**\n * Find all the values in a that are not in b\n * @param a\n * @param b\n */\nfunction findNotIn<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): ReadonlySet<T> {\n  const result = new Set<T>();\n  for (const value of a) {\n    if (!b.has(value)) {\n      result.add(value);\n    }\n  }\n  return result;\n}\n\nexport function toArray<T>(item: T | readonly T[]): T[] {\n  return Array.isArray(item) ? item : ([item] as T[]);\n}\n","const dateRegex: RegExp = /^(19[0-9]{2}|2[0-9]{3})-(0[1-9]|1[012])-([123]0|[012][1-9]|31)$/;\nconst timeRegex: RegExp = /^([01][0-9]|2[0-3]):([0-5][0-9])$/;\n\nexport function isHtmlInputDateFormat(input: string): boolean {\n  if (!dateRegex.test(input)) {\n    return false;\n  }\n\n  // Parse the date to check if it is a valid date (considering leap years).\n  const [year, month, date] = input.split('-');\n  const parsed = new Date(parseInt(year), parseInt(month) - 1, parseInt(date));\n  const dateYear = parsed.getFullYear().toString().padStart(4, '0');\n  const dateMonth = (parsed.getMonth() + 1).toString().padStart(2, '0'); // Months are 0-based.\n  const dateDay = parsed.getDate().toString().padStart(2, '0');\n\n  // Reconstruct the date string and compare it to the input.\n  const isoDateString = `${dateYear}-${dateMonth}-${dateDay}`;\n  return input === isoDateString;\n}\n\nexport function isHtmlInputTimeFormat(input: string): boolean {\n  return timeRegex.test(input);\n}\n\n/**\n * Whether the input is in the format of an HTML input datetime-local.\n * @param input\n * @returns\n */\nexport function isHtmlInputDateTimeFormat(input: string): boolean {\n  const dateTimeParts = input.split('T');\n  if (dateTimeParts.length !== 2) {\n    return false;\n  }\n\n  return isHtmlInputDateFormat(dateTimeParts[0]) && isHtmlInputTimeFormat(dateTimeParts[1]);\n}\n\n/**\n * Supported html input date types.\n *\n * Deliberately un-annotated: a `readonly string[]` annotation would widen the\n * `as const` tuple back to `string`, and {@link HtmlInputDateType} — a frozen\n * public type — would degrade with it, making {@link isHtmlDateInputType} a\n * no-op guard and {@link dateValidationDescriptors} lose its exhaustiveness\n * check. Narrowing a public type is major-only once 1.0 tags.\n */\nexport const htmlInputDateTypes = ['date', 'datetime-local', 'time'] as const;\nexport type HtmlInputDateType = (typeof htmlInputDateTypes)[number];\nconst htmlInputDateSet: ReadonlySet<string> = new Set<string>(htmlInputDateTypes);\n\nexport interface IDateValidationDescriptor {\n  type: HtmlInputDateType;\n  validate: (input: string) => boolean;\n  format: string;\n  example: string;\n}\n\nconst dateValidationDescriptors: Record<HtmlInputDateType, IDateValidationDescriptor> = {\n  date: {\n    type: 'date',\n    validate: isHtmlInputDateFormat,\n    format: 'YYYY-MM-DD',\n    example: '2021-01-01',\n  },\n  'datetime-local': {\n    type: 'datetime-local',\n    validate: isHtmlInputDateTimeFormat,\n    format: 'YYYY-MM-DDThh:mm',\n    example: '2021-01-01T15:30',\n  },\n  time: {\n    type: 'time',\n    validate: isHtmlInputTimeFormat,\n    format: 'hh:mm',\n    example: '15:30',\n  },\n};\n\nexport interface DateValidationSuccessResult {\n  valid: true;\n}\n\nexport interface DateValidationFailureResult {\n  valid: false;\n  format: string;\n  example: string;\n}\n\nexport type DateValidationResult = DateValidationSuccessResult | DateValidationFailureResult;\n\nexport function isHtmlDateInputType(type: string): type is HtmlInputDateType {\n  return htmlInputDateSet.has(type);\n}\n\nexport function validateHtmlDateInput(type: string, input: string): DateValidationResult {\n  if (!isHtmlDateInputType(type)) {\n    throw new Error(`Unsupported date type: ${type}`);\n  }\n  const descriptor = dateValidationDescriptors[type];\n\n  if (descriptor.validate(input)) {\n    return { valid: true };\n  }\n\n  return {\n    valid: false,\n    format: descriptor.format,\n    example: descriptor.example,\n  };\n}\n\n/**\n * Guard the `enterText` path: throw a descriptive error when `value` is being\n * entered into a date/time/datetime-local input in the wrong format.\n *\n * WHY it lives here (#1053): this is environment-agnostic policy — the SAME rule\n * applies whether text is typed via `userEvent` (jsdom) or `fill` (Playwright).\n * Both `DOMInteractor.enterText` and `PlaywrightInteractor.enterText` used to\n * inline this validate-and-throw block, which had drifted: only the DOM leg\n * short-circuited the empty string, so `enterText('')` on a date input threw\n * \"Invalid date format\" in Playwright but cleared the field in jsdom. Hoisting\n * the policy here — including the empty-string carve-out — makes both adapters\n * behave identically on the same input.\n *\n * An empty `value` is a pure clear (there is nothing to validate) and a\n * non-date `type` is not our concern, so both are accepted as no-ops.\n *\n * @param type - The input's `type` attribute (e.g. `'date'`, `'text'`).\n * @param value - The text about to be entered.\n * @throws {Error} If `type` is a date input type and `value` is a non-empty,\n *   badly-formatted string.\n */\nexport function assertValidHtmlDateInputValue(type: string, value: string): void {\n  if (value === '' || !isHtmlDateInputType(type)) {\n    return;\n  }\n  const result = validateHtmlDateInput(type, value);\n  if (!result.valid) {\n    throw new Error(\n      `Invalid date format for type: ${type}, expected format: ${result.format}, example: ${result.example}`\n    );\n  }\n}\n","/**\n * Wait a number of milliseconds\n * @param ms A number of milliseconds to wait\n * @returns\n */\nexport function wait(ms: number): Promise<void> {\n  return new Promise(resolve => {\n    setTimeout(() => {\n      resolve();\n    }, ms);\n  });\n}\n\nexport interface WaitUntilOption<T> {\n  /**\n   * A function that returns a value or promised value to be checked against the terminate condition\n   */\n  probeFn: () => Promise<T> | T;\n  /**\n   * A value to check for equality or a function used for custom equality check\n   */\n  terminateCondition: T | ((currentValue: T) => boolean);\n  /**\n   * A number of milliseconds to wait before returning the last value\n   */\n  timeoutMs: number;\n  /**\n   * Probe on an even grid instead: `probeCount` probes spread across `timeoutMs`,\n   * plus a final probe on the timeout boundary. Supply this only when an even\n   * cadence is what you want — leaving it unset selects the escalating default\n   * described on {@link WaitUntilOption.probeIntervals}, which settles far sooner\n   * for the same timeout. Ignored when `probeIntervals` is provided.\n   */\n  probeCount?: number;\n  /**\n   * Escalating waits (in milliseconds) between probes; the last entry repeats until\n   * timeoutMs elapses. Suits \"settle a re-render\" waits where the condition usually\n   * flips within milliseconds but may occasionally take much longer — probe densely\n   * first, then back off. Takes precedence over probeCount, and applies by default\n   * when neither is supplied.\n   */\n  probeIntervals?: readonly number[];\n  /**\n   * Whether it should log the conditional checks while waiting\n   */\n  debug?: boolean;\n}\n\n// The waits this library performs settle within milliseconds or not at all, while\n// the timeouts guarding them are deliberately generous (30s for\n// `waitUntilComponentState`). An even grid across such a timeout would not look\n// again for 3 seconds, so probe densely first and back off. The last entry repeats,\n// which is what bounds how late a satisfied condition can be noticed.\nconst defaultProbeIntervals: readonly number[] = [0, 10, 25, 50, 100];\n\n/**\n * Keep running a probe function until it returns a value that matches the terminate condition or timeout\n */\nexport async function waitUntil<T>(option: WaitUntilOption<T>): Promise<T> {\n  const { probeFn, terminateCondition, timeoutMs, probeCount, probeIntervals, debug } = option;\n  // An explicit probeCount asks for the even grid; with neither knob supplied the\n  // escalating default applies.\n  const intervals = probeIntervals?.length ? probeIntervals : probeCount == null ? defaultProbeIntervals : undefined;\n  // Only consulted on the even-grid path, which is reachable only when probeCount\n  // was supplied; the fallback preserves the historic documented default.\n  const intervalMs = timeoutMs / (probeCount ?? 10);\n\n  const eqCheck: (currentValue: T) => boolean =\n    typeof terminateCondition === 'function'\n      ? (terminateCondition as (currentValue: T) => boolean)\n      : currentValue => terminateCondition === currentValue;\n\n  const startMs = Date.now();\n  let val: T;\n  let probeIndex = 0;\n\n  while (true) {\n    val = await probeFn();\n    const hasMetEqCheck = eqCheck(val);\n    if (debug) {\n      // eslint-disable-next-line no-console\n      console.log({ val, hasMetEqCheck });\n    }\n\n    if (hasMetEqCheck) {\n      break;\n    }\n\n    const currentTime = Date.now();\n    const elapsed = currentTime - startMs;\n\n    if (elapsed >= timeoutMs) {\n      break;\n    }\n\n    if (intervals !== undefined) {\n      const interval = intervals[Math.min(probeIndex, intervals.length - 1)];\n      probeIndex += 1;\n      await wait(Math.min(interval, timeoutMs - elapsed));\n    } else {\n      // The next grid point strictly AFTER `elapsed`, so the wait is always\n      // positive. `Math.round` landed in the PAST for the first half of every\n      // window, making `wait()` resolve next-tick and the loop spin hot — a\n      // timeoutMs of 1000 produced ~447 probes rather than 10. Deriving the slot\n      // from actual elapsed time rather than a probe counter means a slow probe\n      // skips ahead instead of firing a catch-up burst.\n      //\n      // Clamping to `timeoutMs` puts the final probe exactly on the boundary. The\n      // `nextStart >= timeoutMs` break this replaces returned without ever looking\n      // there, so the loop both ended early and had a dead zone at the end of its\n      // own window: a condition satisfied at 240ms of a stated 250ms timeout was\n      // reported as never satisfied.\n      const nextStart = (Math.floor(elapsed / intervalMs) + 1) * intervalMs;\n      await wait(Math.min(nextStart, timeoutMs) - elapsed);\n    }\n  }\n\n  return val;\n}\n","import { defaultWaitForOption, WaitForOption } from '../drivers/WaitForOption';\nimport { WaitForFailureError } from '../errors/WaitForFailureError';\nimport { Interactor } from '../interactor/Interactor';\nimport { PartLocator } from '../locators/PartLocator';\n\n/**\n * Wait until the element reaches the desired condition.  By default, it waits until the element is attached to the DOM.\n * @param locator The locator of the element to wait for\n * @param interactor The interactor to use to wait for the element\n * @param option Optional parameters to customize the wait behavior\n */\nexport async function interactorWaitUtil(\n  locator: PartLocator,\n  interactor: Interactor,\n  option: Partial<Readonly<WaitForOption>> = defaultWaitForOption\n): Promise<void> {\n  const actualOption = { ...defaultWaitForOption, ...option };\n  let probeFn: () => Promise<boolean>;\n  let expected: boolean;\n  switch (actualOption.condition) {\n    case 'hidden':\n      probeFn = () => interactor.isVisible(locator);\n      expected = false;\n      break;\n    case 'detached':\n      probeFn = () => interactor.exists(locator);\n      expected = false;\n      break;\n    case 'visible':\n      probeFn = () => interactor.isVisible(locator);\n      expected = true;\n      break;\n    default: // 'attached'\n      probeFn = () => interactor.exists(locator);\n      expected = true;\n      break;\n  }\n\n  const actual = await interactor.waitUntil({\n    probeFn,\n    terminateCondition: expected,\n    timeoutMs: actualOption.timeoutMs,\n    debug: actualOption.debug,\n  });\n  if (actual !== expected) {\n    throw new WaitForFailureError(locator, actualOption);\n  }\n}\n","/**\n * Environment-agnostic visibility policy shared by `DOMInteractor` and\n * `PlaywrightInteractor` so the two cannot drift (#1053). It is the single source\n * of truth for what \"visible\" means; each interactor supplies only the primitive\n * to read computed style, mirroring the `interactorUtil.interactorWaitUtil`\n * parameterized-by-primitive house pattern.\n *\n * WHY the three properties are treated differently:\n *\n * - `visibility` is an INHERITED property, so an element's own computed\n *   `visibility` already reflects an ancestor's `visibility: hidden` — while a\n *   descendant that overrides back to `visibility: visible` still reads as\n *   `visible`. Checking the element alone is therefore both sufficient and\n *   correct; walking ancestors would wrongly hide a deliberately re-shown\n *   descendant.\n * - `display: none` and `opacity: 0` are NOT inherited: an ancestor with either\n *   removes the whole subtree from view WITHOUT changing a descendant's own\n *   computed value. Inspecting only the target element (the pre-#1053 bug) let a\n *   child of a hidden ancestor report `true`. So these must be walked up the\n *   ancestor chain — element included — to (and including) the document root.\n *\n * The function is passed BY VALUE into Playwright's `page.evaluate`, which\n * serializes it to the browser. It must therefore stay self-contained: it may\n * reference only its parameters and DOM globals (`getComputedStyle`), never an\n * import, a module-scope helper, or a Node object. Keep it synchronous and\n * free of constructs that transpile to injected runtime helpers.\n *\n * @param element - The element whose visibility is being decided.\n * @param getStyle - Accessor returning an element's computed style. Defaults to\n *   the ambient `getComputedStyle` so the serialized function resolves the DOM\n *   global inside the browser; the DOM leg passes jsdom's `window.getComputedStyle`\n *   explicitly.\n * @returns `true` only when the element itself is not `visibility: hidden` and\n *   the element and every ancestor are displayed (`display !== 'none'`) and\n *   non-transparent (`opacity !== '0'`).\n */\nexport function isElementVisibleByStyle(\n  element: Element,\n  getStyle: (el: Element) => CSSStyleDeclaration = el => getComputedStyle(el)\n): boolean {\n  if (getStyle(element).visibility === 'hidden') {\n    return false;\n  }\n  let current: Element | null = element;\n  while (current !== null) {\n    const style = getStyle(current);\n    if (style.display === 'none' || style.opacity === '0') {\n      return false;\n    }\n    current = current.parentElement;\n  }\n  return true;\n}\n","/**\n * Environment-agnostic checked/disabled policy shared by `DOMInteractor` and\n * `PlaywrightInteractor` so the two cannot drift, the same way\n * `visibilityUtil.isElementVisibleByStyle` is shared (#1053).\n *\n * Before this existed the two engines answered differently and neither answer was\n * written down: the DOM leg read only native IDL properties, while the Playwright\n * leg delegated to Playwright's own primitives, which follow labels, consult\n * `aria-checked`, honour a disabled `<fieldset>`/`<optgroup>`, and walk ancestors\n * for `aria-disabled`. Any test asserting a design-system control's state got a\n * different answer per runner. Defining the predicate once and running it in both\n * places makes them agree by construction rather than by parallel maintenance.\n *\n * Both functions are passed BY VALUE into Playwright's `page.evaluate`, which\n * serializes them to the browser. They must therefore stay self-contained: they may\n * reference only their parameters and DOM globals, never an import, a module-scope\n * constant, or a Node object — which is why the role list below is inlined rather\n * than hoisted. Keep them synchronous and free of constructs that transpile to\n * injected runtime helpers.\n */\n\n/**\n * Whether the element is checked, via the native `checked` property of an\n * `<input type=\"checkbox\">`/`<input type=\"radio\">`, or `aria-checked=\"true\"` on an\n * element whose explicit `role` is a checkable one.\n *\n * `aria-checked=\"mixed\"` and a native `indeterminate` control both report `false`:\n * this contract is two-state, and \"partially checked\" is not \"checked\". An element\n * that cannot be checked at all reports `false` rather than throwing, so the read\n * stays total in both engines.\n *\n * @param element - The element whose checked state is being decided. It must be the\n *   control itself; a `<label>` pointing at one is not retargeted.\n */\nexport function isElementChecked(element: Element): boolean {\n  if (element.nodeName === 'INPUT') {\n    const input = element as HTMLInputElement;\n    const type = typeof input.type === 'string' ? input.type.toLowerCase() : '';\n    if (type === 'checkbox' || type === 'radio') {\n      return input.checked === true;\n    }\n  }\n  // Only an EXPLICIT role is consulted. Every implicit role that supports\n  // aria-checked belongs to a native control the branch above already answered, so\n  // computing implicit roles would add cost without changing a single answer.\n  const role = element.getAttribute('role');\n  const checkableRoles = ['checkbox', 'radio', 'menuitemcheckbox', 'menuitemradio', 'switch', 'treeitem'];\n  if (role !== null && checkableRoles.indexOf(role) !== -1) {\n    return element.getAttribute('aria-checked') === 'true';\n  }\n  return false;\n}\n\n/**\n * Whether the element is disabled, via the native disabled state — including the\n * `<fieldset disabled>` and `<optgroup disabled>` cascades the HTML spec defines —\n * or the nearest `aria-disabled` on the element or an ancestor being `\"true\"`.\n *\n * The nearest explicit `aria-disabled` wins, so a re-enabled descendant of a\n * disabled container reports `false`. An element with no disabled semantics at all\n * reports `false` rather than throwing, so the read stays total in both engines.\n *\n * @param element - The element whose disabled state is being decided. It must be the\n *   control itself; a `<label>` pointing at one is not retargeted.\n */\nexport function isElementDisabled(element: Element): boolean {\n  // `:disabled` is the spec's own definition of \"actually disabled\", so it covers\n  // the fieldset cascade and its `<legend>` carve-out for free. It is also narrower\n  // than the `'disabled' in element` test it replaces, which reported a\n  // `<link disabled>` stylesheet as a disabled control.\n  if (element.matches(':disabled')) {\n    return true;\n  }\n  const ariaHost = element.closest('[aria-disabled]');\n  return ariaHost !== null && ariaHost.getAttribute('aria-disabled') === 'true';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAa,YAAb,cAA+B,MAAM;CAGnC,YAAY,SAAiB,QAAgC;EAC3D,MAAM,OAAO;EACb,KAAK,aAAa,OAAO;CAC3B;AACF;;;ACfA,MAAa,qBAAqB;;;;;;;;;;;AAYlC,IAAa,mBAAb,cAA2D,UAAU;CACnE,YACE,iBACA,QACA;EAEA,MAAM,kBADY,MAAM,QAAQ,eAAe,IAAI,kBAAkB,CAAC,eAAe,EAAA,CACpD,KAAI,SAAQ,GAAG,OAAO,IAAI,GAAG,CAAC,CAAC,KAAK,IAAI;EACzE,MAAM,aAAa,eAAe,eAAe,MAAM;EALvC,KAAA,kBAAA;EAMhB,KAAK,OAAO;CACd;AACF;;;ACvBA,MAAa,6BAA6B;;;;;;;;;;;;;;;;;;;;;;AAuB1C,IAAa,2BAAb,cAA8C,UAAU;CAGtD,YAAY,QAAgC,eAAuB,WAAmB;EACpF,MAAM,+BAA+B,UAAU,kBAAkB,iBAAiB,MAAM;EACxF,KAAK,gBAAgB;EACrB,KAAK,OAAO;CACd;AACF;;;;;;;;;;;;;;;;;ACjBA,SAAgB,0BAA0B,SAA8B;CACtE,OAAO,QAAQ,KAAI,QAAO,IAAI,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