@burdenoff/ui-engine 2026.1203.1 → 2026.1204.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +20 -2
  2. package/dist/analyze/analyze.d.ts +10 -0
  3. package/dist/analyze/context.d.ts +25 -9
  4. package/dist/analyze/index.d.ts +3 -2
  5. package/dist/analyze/messages.d.ts +2 -0
  6. package/dist/analyze/rules/run-command-from-variable.d.ts +2 -0
  7. package/dist/analyze/rules/single-method-image-target.d.ts +7 -0
  8. package/dist/analyze/sensitive.d.ts +2 -2
  9. package/dist/analyze/types.d.ts +6 -2
  10. package/dist/analyze.js +4 -2
  11. package/dist/desk.d.ts +13 -0
  12. package/dist/desk.js +29 -0
  13. package/dist/dom-runtime.iife.js +1 -1
  14. package/dist/dom-runtime.js +2 -2
  15. package/dist/drivers/desk-backend.d.ts +40 -0
  16. package/dist/drivers/desk-driver.d.ts +41 -0
  17. package/dist/drivers/desk-errors.d.ts +19 -0
  18. package/dist/drivers/desk-tree.d.ts +28 -0
  19. package/dist/drivers/desk-wire.d.ts +237 -0
  20. package/dist/drivers/index.d.ts +3 -1
  21. package/dist/drivers.js +13 -10
  22. package/dist/heal.js +5 -5
  23. package/dist/index-0ps53dhe.js +85 -0
  24. package/dist/{index-qm9nd548.js → index-2q0hh6we.js} +4 -4
  25. package/dist/index-552x2bnm.js +56 -0
  26. package/dist/index-6m0chbhq.js +64 -0
  27. package/dist/{index-xdtanv9b.js → index-7gfzv5n8.js} +97 -54
  28. package/dist/{index-gvavb597.js → index-93hfbk5c.js} +10 -0
  29. package/dist/index-a8s39bse.js +920 -0
  30. package/dist/{index-g7724awk.js → index-axph39g0.js} +22 -0
  31. package/dist/index-b5a306v7.js +43 -0
  32. package/dist/index-bx4bsvg0.js +458 -0
  33. package/dist/{index-6h7ah1dw.js → index-cc49ykn5.js} +4 -4
  34. package/dist/{index-3hsp44k5.js → index-e557vzdd.js} +221 -36
  35. package/dist/{index-vnv9tp11.js → index-e7pgqd60.js} +2 -2
  36. package/dist/index-hdq3y007.js +246 -0
  37. package/dist/{index-zagmp5ya.js → index-n3nfhjrj.js} +2 -2
  38. package/dist/{index-rs3yzt5q.js → index-nmsg2wze.js} +4 -4
  39. package/dist/{index-zhbwhdya.js → index-q2jbva7c.js} +5 -3
  40. package/dist/{index-n7ah1jn7.js → index-rbem2yms.js} +16 -243
  41. package/dist/{index-mhv6a02p.js → index-reef7e8m.js} +1 -1
  42. package/dist/{index-y4j6zep8.js → index-wdbn4xjc.js} +6 -6
  43. package/dist/{index-pfdm8evf.js → index-x8fc4r4h.js} +115 -9
  44. package/dist/{index-yc0jgph6.js → index-yhzykhdj.js} +6 -43
  45. package/dist/{index-t55wvhvh.js → index-z2v8prer.js} +1 -61
  46. package/dist/index-zj3zhbac.js +1123 -0
  47. package/dist/{index-hw5npwsv.js → index-zpxk3fzd.js} +1 -1
  48. package/dist/index.d.ts +1 -0
  49. package/dist/index.js +162 -20
  50. package/dist/interpret/driver.d.ts +109 -18
  51. package/dist/interpret/errors.d.ts +7 -1
  52. package/dist/interpret/events.d.ts +5 -2
  53. package/dist/interpret/index.d.ts +4 -3
  54. package/dist/interpret/run.d.ts +28 -1
  55. package/dist/interpret.js +16 -9
  56. package/dist/script/adapters/recording-desktop.d.ts +52 -0
  57. package/dist/script/describe.d.ts +7 -2
  58. package/dist/script/desk-roles.d.ts +33 -0
  59. package/dist/script/desktop-capabilities.d.ts +125 -0
  60. package/dist/script/desktop-schema.d.ts +281 -0
  61. package/dist/script/desktop-types.d.ts +265 -0
  62. package/dist/script/fingerprint.d.ts +10 -1
  63. package/dist/script/hash.d.ts +9 -0
  64. package/dist/script/index.d.ts +14 -4
  65. package/dist/script/json-schema.d.ts +8 -0
  66. package/dist/script/parse.d.ts +29 -0
  67. package/dist/script/schema.d.ts +2098 -1
  68. package/dist/script/walk.d.ts +18 -4
  69. package/dist/script.js +118 -8
  70. package/dist/target/types.d.ts +10 -4
  71. package/dist/target.js +20 -16
  72. package/dist/testing.js +5 -3
  73. package/package.json +9 -3
  74. package/schema/ui-script-desktop-v1.schema.json +12181 -0
  75. package/dist/index-68x61c7a.js +0 -743
package/README.md CHANGED
@@ -14,7 +14,7 @@ bun add @burdenoff/ui-engine zod
14
14
 
15
15
  ## Modules
16
16
 
17
- Each module is a subpath export. The root entry re-exports the data and planning modules (`recording` to `script`, `interpret`, `analyze` and `heal`); the DOM modules (`target`, `dom-runtime`, `drivers`, `testing`) are subpath-only, so a consumer without DOM types, such as a service, never loads them through the root.
17
+ Each module is a subpath export. The root entry re-exports the data and planning modules (`recording` to `script`, `interpret`, `analyze`, `heal` and `desk`); the DOM modules (`target`, `dom-runtime`, `drivers`, `testing`) are subpath-only, so a consumer without DOM types, such as a service, never loads them through the root.
18
18
 
19
19
  | Import | What it holds |
20
20
  |---|---|
@@ -28,9 +28,10 @@ Each module is a subpath export. The root entry re-exports the data and planning
28
28
  | `@burdenoff/ui-engine/dom-runtime` | The DOM runtime a desk injects into a page (`createDomRuntime`, `installDomRuntime`): resolve, act, highlight, snapshot |
29
29
  | `@burdenoff/ui-engine/dom-runtime.iife.js` | The same runtime as one self-contained script (at most 60 KB minified) that installs itself on `globalThis.__burdenoffUiRuntime` |
30
30
  | `@burdenoff/ui-engine/interpret` | The UI script interpreter (`runUiScript`), the compiler a worker runs before it parks a node (`compileUiScript`, `applyPins`, `inlineCalls`, `stripBreakpoints`), the expression evaluator, the desk driver interface and every run-time error code with its node error family (`UI_ERROR_CODES`) |
31
- | `@burdenoff/ui-engine/analyze` | The UI script analyzer: `analyzeUiScript`, the 11 rules of v1 and the 2 healing rules (`UI_ANALYZER_RULES`), problem message keys under `fluidgrids.builder.uiScript.problem.*` with English templates (`UI_SCRIPT_PROBLEM_MESSAGES`), and `stepNumber` (see below) |
31
+ | `@burdenoff/ui-engine/analyze` | The UI script analyzer: `analyzeUiScript` and `analyzeDesktopUiScript`, the 11 rules of v1, the 2 healing rules and the 2 desktop rules (`UI_ANALYZER_RULES`), problem message keys under `fluidgrids.builder.uiScript.problem.*` with English templates (`UI_SCRIPT_PROBLEM_MESSAGES`), and `stepNumber` (see below) |
32
32
  | `@burdenoff/ui-engine/heal` | UI step healing (plan P4-06a): the heal request and answer types, `buildHealQuestion`, `parseHealAnswer`, `verifyHealCandidate`, `classifyConsequence`, `targetFromSnapshotNode`, `maskSnapshot`, healing modes (`capHealMode`, `decideHeal`) and pop-up handlers (`parseUiPopupHandler`, `analyzeUiPopupHandler`, `matchesUrlPattern`). Needs no DOM (see below) |
33
33
  | `@burdenoff/ui-engine/drivers` | Desk drivers over a DOM: `createDomDriver` (the DOM runtime in the interpreter's own world) and `createSnapshotDriver` with `replayUiScriptOnSnapshot` (snapshot replay with no browser) |
34
+ | `@burdenoff/ui-engine/desk` | The desk driver for desktop scripts (plan P2-03b): `createDeskDriver` over a `DeskBackend`, `deskBackendFromAct`, the desk contract v3 wire types and the desk error mapping. No DOM (see "Desktop scripts and the desk driver") |
34
35
  | `@burdenoff/ui-engine/testing` | Copies of the RPA playground fixture pages (`RPA_FIXTURES`), `mountFixture` for test DOMs, and `createFakeWebDriver`, a fake web desk over them |
35
36
 
36
37
  ## UI script v1
@@ -164,6 +165,8 @@ A problem is `{ rule, group, severity, messageKey, vars, message, path?, stepId?
164
165
  | `inlineTarget` | maintainability | info | A step's first inline target, which could be an Element library element |
165
166
  | `healConsequential` | security | info | Only with `healing` options: a step whose control looks like a payment, delete, send-outside or security control (`healConsequential`), or matches a workspace always-ask phrase (`healAlwaysAskKeyword`). Healing never changes such a step's target without a person's approval. Steps listed in `alwaysAskStepIds` are not reported |
166
167
  | `popupHandlerLoop` | reliability | warning | Only with `popupHandler` (set by `analyzeUiPopupHandler`): a pop-up handler step that is a flow block (`popupHandlerFlow`), takes an action a handler may not take (`popupHandlerAction`), acts on a consequential control (`popupHandlerConsequential`), waits longer than 5,000 ms (`popupHandlerWait`), or a handler with no step that clicks, checks or presses a key (`popupHandlerNoAction`) |
168
+ | `runCommandFromVariable` | security | warning | Desktop scripts: a Run command step whose command reads a variable or an input, so a value from the screen, a file or another node could change what the command does |
169
+ | `singleMethodImageTarget` | reliability | warning | Desktop scripts: a target whose only enabled method is an image (reported instead of `singleMethodTarget`); a library element is reported once |
167
170
  | `unusedValue` | maintainability | info | A declared variable nothing reads (`unusedVariable`), and a `set` or `saveAs` value no step, output or later node reads (`unusedValue`). A `set` or `saveAs` value is a key of the node's results, so it is reported only when `externalReads` is given, except a `__` name, which never reaches the results |
168
171
 
169
172
  Options:
@@ -173,6 +176,21 @@ Options:
173
176
  - `healing`: `{ alwaysAskStepIds?, keywords? }`, the node's and workspace's healing settings, for `healConsequential`.
174
177
  - `popupHandler`: `{ match }`, set when the script is a pop-up handler's steps, for `popupHandlerLoop`.
175
178
 
179
+ `analyzeDesktopUiScript(script, options?)` does the same for a desktop script (call `parseDesktopUiScript` first). It takes `severity` and `externalReads`; the healing and pop-up handler rules are web only and never run on a desktop script. A web script gets exactly the problems it got before the desktop rules existed.
180
+
181
+ ## Desktop scripts and the desk driver
182
+
183
+ A desktop script (`surface: "desktop"`, `parseDesktopUiScript`, `DESKTOP_SCRIPT_SCHEMA_HASH`) runs next to the screen through a desk's `run` entry (desk contract v3 section 7). `checkDesktopScriptForDesk` decides before dispatch whether a desk can run it; the desk driver runs it.
184
+
185
+ - `runDesktopUiScript(script, createDeskDriver(backend, options?), runOptions?)` runs the script with the interpreter's waits, retries, verification, flow steps, clean-up, step ranges and events. Before any step it parses the script (compiled: elements carry their targets, calls are inlined) and checks it against the desk's capabilities: `INVALID_SCRIPT`, `UNSUPPORTED_ON_DESK`, or `SHELL_NOT_ALLOWED` when Run command or file-write steps meet `allowShell: false` on the request (`runOptions.allowShell`, the pool or grant) or on the machine. Repairs (healing, pop-up handlers, target overrides) are web only.
186
+ - `deskBackendFromAct({ capabilities, act })` wraps one guarded desk action, such as the plugin SDK's `DeskRunContext.act`; the driver never reaches a provider around the guard.
187
+ - **Targets.** A target's enabled methods are tried in order; the first that finds exactly one element in the state the step needs wins. `uia`, `ax` and `atspi` are selectors the desk resolves (`find`); `css` and `testId` are sent as `css` selectors with the role of the target's role method (without one they are skipped, and `checkDesktopScriptForDesk` does not count them); `image`, `text` and `ocr` are `find` with an image or text target; `role`, `fuzzy` and `anchor` are resolved by the engine on the desk's `desk-tree-v1` snapshot, with role names compared across interfaces (`button`, `Button`, `AXButton` and `push button` match). The element is then acted on as a `ref`. Several matches are `ELEMENT_AMBIGUOUS` (up to five candidates) and nothing is acted on; so is a single match on a capped answer (a `find` with `truncated`, or a tree snapshot over its node limit), because it does not prove the element is unique.
188
+ - **Input methods.** With `direct` input a click is `invoke` and typing that replaces a value is `set_value`; with `hardware` a click is `click`, and typing empties the field with `set_value`, then types with `type` (as the web clears a field before typing); `auto` prefers the pattern actions when the desk has them, and clicks with the pointer when the desk refuses `invoke` for a control without the pattern (`UNSUPPORTED_ON_DESK`). A pattern takes at most 10,000 characters: longer text is typed with hardware input, and refused (`ACTION_FAILED`) with `direct` or `auto`. Emptying a field needs `set_value`, also for hardware typing. `checkDesktopScriptForDesk` asks for these actions; a literal Wait for text or text check longer than 256 characters needs `snapshot`, because the driver looks for it in the screen text.
189
+ - **Reads.** A read of every match reads each element by its ref, as a single read does. The text, value and attributes of a password or code field (a secure text role, or an editable field whose name reads like a secret) are never read: `SENSITIVE_ELEMENT`, `null` in a read of every match, and left out of the screen text.
190
+ - **Errors.** Desk codes become engine codes with the desk code in `detail.deskCode`: `TARGET_NOT_FOUND` is `ELEMENT_NOT_FOUND` or `ELEMENT_AMBIGUOUS` (by `detail.matches`); a stale fence, a takeover, the kill switch, missing consent and an offline desk are `DESK_UNAVAILABLE`; `URL_BLOCKED` is `URL_NOT_ALLOWED`; `ORIGIN_MISMATCH` is `SECRET_UNAVAILABLE`; `TIMEOUT` is `APPLICATION_NOT_RESPONDING`; `OUTSIDE_WORKSPACE_FOLDER` is `ACTION_FAILED` with `detail.problem`. An application or window the desk cannot find is `WINDOW_NOT_FOUND`.
191
+ - **Files and secrets.** A file path or working folder that is absolute, has a `..` segment or a drive letter is refused before it reaches the desk (`ACTION_FAILED`, `OUTSIDE_WORKSPACE_FOLDER`). `fileCopy` reads and writes text (desk contract v3 has no copy action), and fails rather than write a partial copy of a file that fills the 10 MiB read limit; `fileList` and `fileDelete` are refused until it has actions for them (BOFF-18562). Type secret sends the run's one-time reference for the step (`options.secretRefFor`), never a value. Screenshots go to `options.storeScreenshot`.
192
+ - **Saved steps.** `fromRecordingForDesk(recording, { platform })` turns a Stewards recording into a desktop script: each target keeps its role method first and gains a one-node strict selector in the platform's role names when the recorded target is the first of its equal matches (a saved step does not record the path from the window). `fromRecording` and its goldens are unchanged.
193
+
176
194
  ## Healing
177
195
 
178
196
  Healing repairs a step whose own target is no longer found (spec 10 section 3, plan P4-06a, BOFF-17301). The engine supplies the pieces; the workflow service (P4-13) makes the model call, and the remote-browser worker (P4-15) and the extension (P4-16) run the interpreter with the hook. The UI script schema does not change (`UI_SCRIPT_SCHEMA_HASH` keeps its P1-02 value, D-P4-9). Everything in `./heal` is pure and needs no DOM, except `verifyHealCandidate`, which asks the desk driver.
@@ -7,6 +7,7 @@
7
7
  * browser (the builder) and on the server (the workflow service validator).
8
8
  * Problems are advice; none blocks a save.
9
9
  */
10
+ import type { DesktopUiScript } from '../script/desktop-types.js';
10
11
  import type { UiScript } from '../script/types.js';
11
12
  import { type UiAnalyzeOptions, type UiAnalyzerRuleId, type UiProblemSeverity, type UiScriptProblem } from './types.js';
12
13
  /** The default severity of every rule, by id. */
@@ -17,3 +18,12 @@ export declare const UI_ANALYZER_DEFAULT_SEVERITY: Readonly<Record<UiAnalyzerRul
17
18
  * within one place, in rule order. Pass the script `parseUiScript` returned.
18
19
  */
19
20
  export declare function analyzeUiScript(script: UiScript, options?: UiAnalyzeOptions): UiScriptProblem[];
21
+ /** Options of `analyzeDesktopUiScript`: healing and pop-up handlers are web only. */
22
+ export type UiDesktopAnalyzeOptions = Omit<UiAnalyzeOptions, 'healing' | 'popupHandler'>;
23
+ /**
24
+ * The problems of a desktop script (plan P2-03b), as `analyzeUiScript` lists
25
+ * them: every rule that applies to a desktop script, the desktop rules
26
+ * `runCommandFromVariable` and `singleMethodImageTarget` included. Pass the
27
+ * script `parseDesktopUiScript` returned.
28
+ */
29
+ export declare function analyzeDesktopUiScript(script: DesktopUiScript, options?: UiDesktopAnalyzeOptions): UiScriptProblem[];
@@ -1,8 +1,22 @@
1
+ import type { DesktopUiScript, DesktopUiScriptElement, DesktopUiStep, DesktopUiTarget, DesktopUiTargetRef } from '../script/desktop-types.js';
1
2
  import type { UiExpression, UiScript, UiScriptElement, UiStep, UiTarget, UiTargetRef } from '../script/types.js';
3
+ /** A web or a desktop script, and their parts: the analyzer reads both (desktop through `analyzeDesktopUiScript`). */
4
+ export type AnalyzedScript = UiScript | DesktopUiScript;
5
+ export type AnalyzedStep = UiStep | DesktopUiStep;
6
+ export type AnalyzedTargetRef = UiTargetRef | DesktopUiTargetRef;
2
7
  import type { UiAnalyzeOptions } from './types.js';
8
+ /**
9
+ * A step of a web script, for the web-only rules (`healConsequential`,
10
+ * `popupHandlerLoop`): they run only with web options (healing settings, a
11
+ * pop-up handler), which `analyzeDesktopUiScript` never takes, so the steps
12
+ * they see were parsed by `parseUiScript`.
13
+ */
14
+ export declare function webOnlyStep(step: AnalyzedStep): UiStep;
15
+ /** A target of a web script, for the web-only rules (see `webOnlyStep`). */
16
+ export declare function webOnlyTarget(target: DesktopUiTarget): UiTarget;
3
17
  /** A step that runs (not disabled, and not inside a disabled block), with where it sits. */
4
18
  export interface ActiveStep {
5
- step: UiStep;
19
+ step: AnalyzedStep;
6
20
  path: string;
7
21
  /** The step's number as an author reads it (`stepNumber`). */
8
22
  number: string;
@@ -10,17 +24,17 @@ export interface ActiveStep {
10
24
  order: number;
11
25
  }
12
26
  export interface AnalyzeContext {
13
- script: UiScript;
27
+ script: AnalyzedScript;
14
28
  options: UiAnalyzeOptions;
15
- elements: Readonly<Record<string, UiScriptElement>>;
29
+ elements: Readonly<Record<string, UiScriptElement | DesktopUiScriptElement>>;
16
30
  /** The steps that run, in document order: the main steps, then the clean-up block. */
17
31
  steps: readonly ActiveStep[];
18
32
  /** Every step, disabled ones included; outputs sort after the last. */
19
33
  totalSteps: number;
20
34
  /** The target a reference stands for: the inline target, or the pinned element's target when the script carries it. */
21
- targetOf(ref: UiTargetRef): UiTarget | undefined;
35
+ targetOf(ref: AnalyzedTargetRef): DesktopUiTarget | undefined;
22
36
  /** A quoted, short description of a target, for messages. */
23
- describeTarget(ref: UiTargetRef): string;
37
+ describeTarget(ref: AnalyzedTargetRef): string;
24
38
  }
25
39
  /**
26
40
  * The number of a step as an author reads it: positions count from 1, the
@@ -29,12 +43,14 @@ export interface AnalyzeContext {
29
43
  * `"5.else.0"` is `"6.else.1"` and `"cleanup.0"` is `"cleanup.1"`.
30
44
  */
31
45
  export declare function stepNumber(path: string): string;
32
- export declare function createContext(script: UiScript, options: UiAnalyzeOptions): AnalyzeContext;
46
+ export declare function createContext(script: AnalyzedScript, options: UiAnalyzeOptions): AnalyzeContext;
33
47
  /** The names of the variables an expression reads. */
34
48
  export declare function variablesRead(expression: UiExpression): string[];
49
+ /** The names of the script inputs an expression reads. */
50
+ export declare function inputsRead(expression: UiExpression): string[];
35
51
  /** The variables a step reads through its own expressions (its nested blocks excluded). */
36
- export declare function stepVariablesRead(step: UiStep): string[];
52
+ export declare function stepVariablesRead(step: AnalyzedStep): string[];
37
53
  /** The variable names a step sets: its `saveAs`, a `set` name, and a for-each item and index. */
38
- export declare function stepVariablesSet(step: UiStep): string[];
54
+ export declare function stepVariablesSet(step: AnalyzedStep): string[];
39
55
  /** True for a step that signs in: a sign-in step or a secret typed into a field. */
40
- export declare function signsIn(step: UiStep): boolean;
56
+ export declare function signsIn(step: AnalyzedStep): boolean;
@@ -1,9 +1,10 @@
1
1
  /**
2
- * The UI script analyzer (plan P1-02b): `analyzeUiScript`, the rules of v1,
2
+ * The UI script analyzer (plan P1-02b): `analyzeUiScript` and, for desktop
3
+ * scripts (plan P2-03b), `analyzeDesktopUiScript`, the rules,
3
4
  * their message keys under `fluidgrids.builder.uiScript.problem.*` and the
4
5
  * English templates.
5
6
  */
6
- export { UI_ANALYZER_DEFAULT_SEVERITY, analyzeUiScript } from './analyze.js';
7
+ export { UI_ANALYZER_DEFAULT_SEVERITY, type UiDesktopAnalyzeOptions, analyzeDesktopUiScript, analyzeUiScript, } from './analyze.js';
7
8
  export { UI_ANALYZER_RULE_GROUPS, UI_ANALYZER_RULE_IDS, UI_PROBLEM_SEVERITIES, type UiAnalyzeOptions, type UiAnalyzerRuleGroup, type UiAnalyzerRuleId, type UiProblemSeverity, type UiProblemSeveritySetting, type UiRuleFinding, type UiScriptProblem, } from './types.js';
8
9
  export { UI_SCRIPT_PROBLEM_KEY_PREFIX, UI_SCRIPT_PROBLEM_MESSAGES, type UiScriptProblemMessageKey, type UiScriptProblemMessageName, problemMessage, problemMessageKey, } from './messages.js';
9
10
  export { UI_ANALYZER_RULES, type UiAnalyzerRule } from './rules/index.js';
@@ -37,6 +37,8 @@ export declare const UI_SCRIPT_PROBLEM_MESSAGES: {
37
37
  readonly popupHandlerConsequential: "Pop-up handler step {{step}} acts on {{target}}, which looks like a {{consequence}} control. A handler never acts on such a control.";
38
38
  readonly popupHandlerWait: "Pop-up handler step {{step}} waits {{milliseconds}} ms. A handler step waits at most 5,000 ms, so a pop-up never holds up a run.";
39
39
  readonly popupHandlerNoAction: "The pop-up handler has no step that clicks, checks or presses a key, so it cannot clear the pop-up.";
40
+ readonly runCommandFromVariable: "Step {{step}} runs a command built from {{name}}. A value read from the screen, a file or another node could change what the command does. Use a fixed command, or check the value in an earlier step.";
41
+ readonly singleMethodImageTarget: "Step {{step}} finds {{target}} by an image only. An image match breaks when the theme, the display scale or the resolution changes. Add a selector or a text method.";
40
42
  };
41
43
  export type UiScriptProblemMessageName = keyof typeof UI_SCRIPT_PROBLEM_MESSAGES;
42
44
  export type UiScriptProblemMessageKey = `fluidgrids.builder.uiScript.problem.${UiScriptProblemMessageName}`;
@@ -0,0 +1,2 @@
1
+ import type { UiAnalyzerRule } from './rule.js';
2
+ export declare const runCommandFromVariableRule: UiAnalyzerRule;
@@ -0,0 +1,7 @@
1
+ import type { UiAnalyzerRule } from './rule.js';
2
+ export declare const singleMethodImageTargetRule: UiAnalyzerRule;
3
+ /** True when the only enabled method is an image. */
4
+ export declare function isImageOnly(methods: ReadonlyArray<{
5
+ kind: string;
6
+ enabled?: boolean;
7
+ }>): boolean;
@@ -7,8 +7,8 @@
7
7
  * reads whole selectors and labels, where they also occur inside other words
8
8
  * ("footprint", "hotpot", "secretary").
9
9
  */
10
- import type { UiTarget } from '../script/types.js';
10
+ import type { DesktopUiTarget } from '../script/desktop-types.js';
11
11
  /** True when a name, label or selector reads like a secret field. */
12
12
  export declare function readsLikeSecret(text: string): boolean;
13
13
  /** True when a target, or the library element's name, reads like a password or code field. */
14
- export declare function looksLikeSecretField(target: UiTarget | undefined, elementName?: string): boolean;
14
+ export declare function looksLikeSecretField(target: DesktopUiTarget | undefined, elementName?: string): boolean;
@@ -16,8 +16,12 @@ export type UiProblemSeveritySetting = UiProblemSeverity | 'off';
16
16
  /** The rule groups of spec 14 section 3 that v1 covers. */
17
17
  export declare const UI_ANALYZER_RULE_GROUPS: readonly ["reliability", "security", "maintainability"];
18
18
  export type UiAnalyzerRuleGroup = (typeof UI_ANALYZER_RULE_GROUPS)[number];
19
- /** The rules of analyzer v1, in the order their problems are listed within one step. */
20
- export declare const UI_ANALYZER_RULE_IDS: readonly ["fixedWait", "singleMethodTarget", "hardwareInput", "unknownVariable", "maskedValue", "noCleanup", "plainTextSecret", "secretOrigin", "sensitiveScreenshot", "inlineTarget", "unusedValue", "healConsequential", "popupHandlerLoop"];
19
+ /**
20
+ * The analyzer's rules, in the order their problems are listed within one
21
+ * step: the 11 of v1, the two healing rules (P4-06a) and the two desktop
22
+ * rules (P2-03b), which report nothing on a web script.
23
+ */
24
+ export declare const UI_ANALYZER_RULE_IDS: readonly ["fixedWait", "singleMethodTarget", "hardwareInput", "unknownVariable", "maskedValue", "noCleanup", "plainTextSecret", "secretOrigin", "sensitiveScreenshot", "inlineTarget", "unusedValue", "healConsequential", "popupHandlerLoop", "runCommandFromVariable", "singleMethodImageTarget"];
21
25
  export type UiAnalyzerRuleId = (typeof UI_ANALYZER_RULE_IDS)[number];
22
26
  /** One problem the analyzer found. */
23
27
  export interface UiScriptProblem {
package/dist/analyze.js CHANGED
@@ -9,8 +9,9 @@ import {
9
9
  UI_ANALYZER_RULE_GROUPS2,
10
10
  UI_ANALYZER_RULE_IDS2,
11
11
  UI_ANALYZER_DEFAULT_SEVERITY2,
12
- analyzeUiScript2
13
- } from "./index-xdtanv9b.js";
12
+ analyzeUiScript2,
13
+ analyzeDesktopUiScript2
14
+ } from "./index-7gfzv5n8.js";
14
15
  export {
15
16
  UI_ANALYZER_DEFAULT_SEVERITY2 as UI_ANALYZER_DEFAULT_SEVERITY,
16
17
  UI_ANALYZER_RULES2 as UI_ANALYZER_RULES,
@@ -19,6 +20,7 @@ export {
19
20
  UI_PROBLEM_SEVERITIES2 as UI_PROBLEM_SEVERITIES,
20
21
  UI_SCRIPT_PROBLEM_KEY_PREFIX2 as UI_SCRIPT_PROBLEM_KEY_PREFIX,
21
22
  UI_SCRIPT_PROBLEM_MESSAGES2 as UI_SCRIPT_PROBLEM_MESSAGES,
23
+ analyzeDesktopUiScript2 as analyzeDesktopUiScript,
22
24
  analyzeUiScript2 as analyzeUiScript,
23
25
  problemMessage2 as problemMessage,
24
26
  problemMessageKey2 as problemMessageKey,
package/dist/desk.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `@burdenoff/ui-engine/desk`: the desk driver (RPA plan package P2-03b).
3
+ * `createDeskDriver` runs a desktop script's steps on a desk through desk
4
+ * contract v3 actions, over a `DeskBackend` (`deskBackendFromAct` wraps the
5
+ * desk's guarded per-action `act`); `runDesktopUiScript` (`./interpret`) is
6
+ * the run entry. No DOM dependency: the desk meta plugin, a service and a
7
+ * test load it without the DOM runtime.
8
+ */
9
+ export { type CreateDeskDriverOptions, DEFAULT_DESK_SNAPSHOT_NODES, DESK_FIND_ALL_MAX, DESK_FIND_MAX, createDeskDriver, deskTargetOfMethod, } from './drivers/desk-driver.js';
10
+ export { type DeskBackend, type DeskBackendFromActOptions, type DeskCallContext, deskBackendFromAct, } from './drivers/desk-backend.js';
11
+ export { engineCodeOfDeskError, engineDetailOfDeskError } from './drivers/desk-errors.js';
12
+ export { type DeskTreeMethod, type DeskTreePick, deskNodeInState, matchDeskTreeMethod } from './drivers/desk-tree.js';
13
+ export { type DeskWireAction, type DeskWireActionType, type DeskWireBounds, type DeskWireError, type DeskWireGetValue, type DeskWireGetWhat, type DeskWireMatch, type DeskWireResult, type DeskWireSelectorNode, type DeskWireSelectorTarget, type DeskWireSnapshotOptions, type DeskWireTarget, type DeskWireTreeNode, type DeskWireTreeSnapshot, type DeskWireWindow, isDeskWireTreeSnapshot, } from './drivers/desk-wire.js';
package/dist/desk.js ADDED
@@ -0,0 +1,29 @@
1
+ import {
2
+ engineCodeOfDeskError2,
3
+ engineDetailOfDeskError2,
4
+ deskNodeInState2,
5
+ matchDeskTreeMethod2,
6
+ isDeskWireTreeSnapshot2,
7
+ DESK_FIND_MAX2,
8
+ DESK_FIND_ALL_MAX2,
9
+ DEFAULT_DESK_SNAPSHOT_NODES2,
10
+ deskTargetOfMethod2,
11
+ createDeskDriver2,
12
+ deskBackendFromAct2
13
+ } from "./index-a8s39bse.js";
14
+ import"./index-bx4bsvg0.js";
15
+ import"./index-zj3zhbac.js";
16
+ import"./index-dcs2pe49.js";
17
+ export {
18
+ DEFAULT_DESK_SNAPSHOT_NODES2 as DEFAULT_DESK_SNAPSHOT_NODES,
19
+ DESK_FIND_ALL_MAX2 as DESK_FIND_ALL_MAX,
20
+ DESK_FIND_MAX2 as DESK_FIND_MAX,
21
+ createDeskDriver2 as createDeskDriver,
22
+ deskBackendFromAct2 as deskBackendFromAct,
23
+ deskNodeInState2 as deskNodeInState,
24
+ deskTargetOfMethod2 as deskTargetOfMethod,
25
+ engineCodeOfDeskError2 as engineCodeOfDeskError,
26
+ engineDetailOfDeskError2 as engineDetailOfDeskError,
27
+ isDeskWireTreeSnapshot2 as isDeskWireTreeSnapshot,
28
+ matchDeskTreeMethod2 as matchDeskTreeMethod
29
+ };
@@ -1 +1 @@
1
- (()=>{var H=["data-fg-sensitive","data-sensitive","data-private"];function Q(e){return H.some((t)=>e.hasAttribute(t))}function I(e){let t=e.assignedSlot;if(t!==void 0)return t;let n=e.parentElement?.shadowRoot;if(!n)return null;for(let o of Array.from(n.querySelectorAll("slot")))if((typeof o.assignedNodes==="function"?o.assignedNodes():[]).includes(e))return o;return null}function x(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();if(n&&"host"in n)return n.host;try{return e.ownerDocument.defaultView?.frameElement??null}catch{return null}}function k(e){for(let t=e;t;t=x(t))if(Q(t))return!0;return!1}var ge={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",email:"textbox",tel:"textbox",text:"textbox",url:"textbox",password:"textbox",date:"textbox","datetime-local":"textbox",month:"textbox",time:"textbox",week:"textbox",color:"textbox",file:"button"},Te={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",hr:"separator",li:"listitem",main:"main",menu:"list",meter:"meter",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",p:"paragraph",progress:"progressbar",summary:"button",table:"table",tbody:"rowgroup",td:"cell",textarea:"textbox",tfoot:"rowgroup",thead:"rowgroup",tr:"row",ul:"list"},xe=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"]);var ee=256;function T(e){return(e??"").normalize("NFKC").replace(/\s+/g," ").trim().toLowerCase()}function V(e,t){return T(e)===T(t)}function Ae(e,t){let n=T(t);return n.length>0&&T(e).includes(n)}function rt(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=Array.from({length:t.length+1},(o,r)=>r);for(let o=1;o<=e.length;o+=1){let r=[o];for(let i=1;i<=t.length;i+=1){let s=e[o-1]===t[i-1]?0:1;r[i]=Math.min((n[i]??0)+1,(r[i-1]??0)+1,(n[i-1]??0)+s)}n=r}return n[t.length]??0}function ye(e,t){let n=T(e).slice(0,256),o=T(t).slice(0,256),r=Math.max(n.length,o.length);if(r===0)return 0;return 1-rt(n,o)/r}function v(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}var ne=512,it=65536,st=new Set(["button","input","meter","output","progress","select","textarea"]),at=new Set(["script","style","noscript","template","head","title","meta","link"]);function M(e){return e.localName.toLowerCase()}function Se(e){return e.parentElement?.closest("article, aside, main, nav, section")!=null}function lt(e){let t=M(e);switch(t){case"a":case"area":return e.hasAttribute("href")?"link":"";case"input":{let n=(e.getAttribute("type")??"text").toLowerCase();if(n==="hidden")return"";if(e.hasAttribute("list")&&["text","search","email","tel","url"].includes(n))return"combobox";return ge[n]??"textbox"}case"select":{let n=Number(e.getAttribute("size")??"0");return e.hasAttribute("multiple")||n>1?"listbox":"combobox"}case"img":return e.getAttribute("alt")===""?"presentation":"img";case"th":return e.getAttribute("scope")==="row"?"rowheader":"columnheader";case"header":return Se(e)?"":"banner";case"footer":return Se(e)?"":"contentinfo";case"section":case"form":return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?t==="form"?"form":"region":"";default:return Te[t]??""}}function A(e){let t=e.getAttribute("role")?.trim().split(/\s+/)[0];return t?t.toLowerCase():lt(e)}function ut(e,t){let n=e.getRootNode();return typeof n.getElementById==="function"?n.getElementById(t):null}function ct(e){return e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true"}function dt(e){let t=e.ownerDocument.defaultView;if(!t)return"none";let n=t.getComputedStyle(e);if(n.display==="none")return"subtree";return n.visibility==="hidden"||n.visibility==="collapse"?"self":"none"}function W(e){let t=e.getAttribute("contenteditable");if(t===null)return!1;let n=t.trim().toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function ft(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);if(M(e)==="slot"){let t=e,n=typeof t.assignedNodes==="function"?t.assignedNodes({flatten:!0}):[];if(n.length>0)return n}return Array.from(e.childNodes)}var mt=/^(div|p|li|tr|td|th|br|h[1-6]|section|article|header|footer)$/;function L(e,t){if(e.remaining<=0||t.length===0)return;let n=t.slice(0,e.remaining);e.parts.push(n),e.remaining-=n.length}function Me(e,t,n,o,r,i=!1){if(t>32||n.remaining<=0)return;if(e.nodeType===3){if(!i)L(n,e.textContent??"");return}if(e.nodeType!==1)return;let s=e,a=M(s);if(at.has(a)||Q(s))return;if(!r&&ct(s))return;let l=!1;if(t>0&&!r){let d=o?.isVisible?.(s);if(d===!1)l=!0;else if(d===void 0){let c=dt(s);if(c==="subtree")return;l=c==="self"}}let u=s.getAttribute("aria-label")?.trim();if(u&&t>0&&!l){L(n,` ${u} `);return}if(a==="img"||a==="input"&&s.getAttribute("type")==="image"){if(!l)L(n,` ${s.getAttribute("alt")??""} `);return}if(a==="input"||a==="textarea"||a==="select")return;if(t>0&&W(s))return;let f=t>0&&mt.test(a);if(f)L(n," ");for(let d of ft(s))Me(d,t+1,n,o,r,l);if(f)L(n," ")}function F(e){if(M(e)==="textarea"||W(e))return!0;for(let n=x(e);n;n=x(n))if(M(n)==="textarea"||W(n))return!0;return!1}function Re(e){for(let t=x(e);t;t=x(t)){let n=M(t);if(n==="textarea"||n==="select"||W(t))return!0}return!1}function B(e,t,n=!1){let o=M(e);if(o==="textarea"||o==="select"||W(e)||Re(e)||k(e))return"";return E(e.getAttribute("aria-label")??"")||X(e,t,ne,n)}function X(e,t,n=ne,o=!1){if(e.nodeType===1&&k(e))return"";let r={parts:[],remaining:n*2+64};return Me(e,0,r,t,o),E(r.parts.join(""),n)}function E(e,t=ne){return e.replace(/\s+/g," ").trim().slice(0,t)}function pt(e,t){let n=[],o=e.getAttribute("id");if(o){let i=e.getRootNode();for(let s of Array.from(i.querySelectorAll("label")))if(s.getAttribute("for")===o)n.push(B(s,t,!0))}let r=e.closest("label");if(r&&!r.hasAttribute("for"))n.push(B(r,t,!0));return E(n.join(" "))}function te(e,t,n){let o=Array.from(e.children).find((r)=>M(r)===t);return o?B(o,n):""}function R(e,t){return Ne(e,t,!0)}function ke(e,t){return Ne(e,t,!1)}function ht(e,t){let n=Array.from(e.children).find((o)=>M(o)==="title");if(!n||k(n)||Re(n))return"";return E(Array.from(n.childNodes).map((o)=>X(o,t)).join(" "))}function Ne(e,t,n){let o=e.getAttribute("aria-labelledby");if(o){let l=o.split(/\s+/).filter(Boolean).map((u)=>ut(e,u)).filter((u)=>u!==null).map((u)=>B(u,t,!0)).join(" ");if(E(l))return E(l)}let r=e.getAttribute("aria-label");if(r&&E(r))return E(r);let i=M(e);if(st.has(i)){let l=pt(e,t);if(l)return l}if(i==="input"){let l=(e.getAttribute("type")??"text").toLowerCase();if(l==="button"||l==="submit"||l==="reset"){let u=e.getAttribute("value");if(u!==null)return E(u);return l==="submit"?"Submit":l==="reset"?"Reset":""}if(l==="image")return E(e.getAttribute("alt")??"")}if(i==="img"||i==="area"){let l=e.getAttribute("alt");if(l)return E(l)}if(i==="svg"){let l=ht(e,t);if(l)return l}if(i==="fieldset"){let l=te(e,"legend",t);if(l)return l}if(i==="table"){let l=te(e,"caption",t);if(l)return l}if(i==="option"){let l=E(e.getAttribute("label")??"");if(l)return l}if(i==="figure"){let l=te(e,"figcaption",t);if(l)return l}if(n&&xe.has(A(e))){let l=X(e,t);if(l)return l}let s=e.getAttribute("title");if(s&&E(s))return E(s);let a=e.getAttribute("placeholder");if(a&&E(a))return E(a);return""}function O(e,t){if(M(e)==="input"){let o=(e.getAttribute("type")??"text").toLowerCase();return o==="button"||o==="submit"||o==="reset"?R(e,t):""}return X(e,t,it)}function oe(e,t,n,o){return A(e)===t.trim().toLowerCase()&&T(R(e,o))===T(n)}function bt(e){return e.ownerDocument.defaultView}function z(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n&&"host"in n?n.host:null}function N(e,t){let n=t?.isVisible?.(e);if(n!==void 0)return n;if(!e.isConnected)return!1;let o=bt(e),r=e;while(r){if(r.hasAttribute("hidden"))return!1;if(r.localName==="input"&&r.getAttribute("type")?.toLowerCase()==="hidden")return!1;if(o&&o.getComputedStyle(r).display==="none")return!1;r=z(r)}if(o){let s=o.getComputedStyle(e);if(s.visibility==="hidden"||s.visibility==="collapse")return!1;if(s.display==="contents")return!0}let i=e.checkVisibility;return typeof i==="function"?i.call(e):!0}function C(e){for(let n=e;n;n=x(n))if(n.getAttribute("aria-disabled")==="true"||n.hasAttribute("inert"))return!1;if(!Et.has(e.localName)){let n=e.parentElement?.closest("button, select, option, optgroup, textarea");return n?C(n):!0}if(e.hasAttribute("disabled"))return!1;let t=e.parentElement?.closest("fieldset[disabled]");if(t){if(!Array.from(t.children).find((o)=>o.localName==="legend")?.contains(e))return!1}try{return!e.matches(":disabled")}catch{return!0}}var Et=new Set(["button","input","select","textarea","optgroup","option","fieldset"]);function D(e,t,n){let r=t?.rectOf?.(e)??e.getBoundingClientRect();return{x:Math.round(r.x+(n?.x??0)),y:Math.round(r.y+(n?.y??0)),width:Math.round(r.width),height:Math.round(r.height)}}function w(e){let t=Array.from(e.querySelectorAll("*"));return e.nodeType===1?[e,...t]:t}var gt=/password|passcode|passwd|\bpin\b|otp|one[\s-]?time|verification|security code|auth(?:entication)? code|\bcvv\b|\bcvc\b|card number|secret|token|recovery/i,Tt=/password|one-time-code|^cc-/i;function xt(e){return gt.test(e)}function y(e){if(k(e))return!0;if(Ce(e))return!0;for(let t=x(e);t;t=x(t))if(Ce(t))return!0;return!1}function Ce(e){let t=e.localName,n=e.getAttribute("contenteditable"),o=n!==null&&n.trim().toLowerCase()!=="false";if(t!=="input"&&t!=="textarea"&&t!=="select"&&!o)return!1;if(e.getAttribute("type")?.toLowerCase()==="password")return!0;if((e.getAttribute("autocomplete")??"").trim().split(/\s+/).filter(Boolean).some((i)=>Tt.test(i)))return!0;return At(e).some((i)=>i.length>0&&xt(i.replace(/[-_]/g," ")))}function At(e){let t=(a)=>(a??"").slice(0,512),n=[R(e),t(e.getAttribute("aria-label")),t(e.getAttribute("placeholder")),t(e.getAttribute("title")),t(e.getAttribute("name")),t(e.getAttribute("id"))],o=e.getRootNode(),r=(a)=>typeof o.getElementById==="function"?o.getElementById(a):null;for(let a of(e.getAttribute("aria-labelledby")??"").split(/\s+/).filter(Boolean)){let l=r(a);if(l)n.push(t(l.getAttribute("aria-label")),t(l.textContent))}let i=e.getAttribute("id"),s=Array.from(o.querySelectorAll("label")).filter((a)=>i!==null&&a.getAttribute("for")===i||!a.hasAttribute("for")&&a.contains(e));for(let a of s)n.push(t(a.getAttribute("aria-label")),t(a.textContent));return n}var yt=0.8,St=0.05,Mt=4,we=1000,K=2,Rt=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]),kt=/^[A-Za-z_][\w:.-]{0,127}$/;function Nt(e){return e.nodeType===9?e:e.ownerDocument}function Ct(e,t){return{kind:"list",elements:w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)),...e.nth!==void 0?{nth:e.nth}:{}}}function wt(e,t){try{return{kind:"list",elements:Array.from(t.root.querySelectorAll(e))}}catch{return{kind:"invalid"}}}function _t(e,t){let n=e.attribute??"data-testid";if(!kt.test(n))return{kind:"invalid"};return{kind:"list",elements:w(t.root).filter((r)=>r.getAttribute(n)===e.value)}}function vt(e,t){if(e.nodeType===9)return t.ownerDocument===e&&t.getRootNode()===e;return e===t||e.contains(t)}function Ot(e,t){let n=Nt(t.root);if(typeof n.evaluate!=="function")return{kind:"unsupported"};let o;try{o=n.evaluate(e.xpath,t.root,null,7,null)}catch{return{kind:"invalid"}}let r=[],i=Math.min(o.snapshotLength,we);for(let s=0;s<i;s+=1){let a=o.snapshotItem(s);if(a&&a.nodeType===1&&vt(t.root,a))r.push(a)}return{kind:"list",elements:r,...o.snapshotLength>we?{overflow:!0}:{}}}function Dt(e,t,n){let o=Math.min(T(e).length,ee),r=Math.max(o,t);return r>0&&Math.abs(o-t)<=(1-n)*r}function It(e,t){let n=Math.min(1,Math.max(0.5,e.threshold??yt)),o=e.role?.trim().toLowerCase(),r=Math.min(T(e.name).length,ee),i=[];for(let s of w(t.root)){let a=A(s);if(o?a!==o:a==="")continue;let l=R(s,t.probe);if(!Dt(l,r,n))continue;let u=ye(l,e.name);if(u>=n)i.push({element:s,score:u})}return{kind:"ranked",scored:i,margin:St}}function Oe(e,t){let n=w(e.root).filter((i)=>t(O(i,e.probe))),o=e.keep??(()=>!0),r=n.filter(o);return n.filter((i)=>!r.some((s)=>s!==i&&i.contains(s)))}function Lt(e,t){let n=e.exact?(o)=>V(o,e.text):(o)=>Ae(o,e.text);if(T(e.text).length===0)return{kind:"list",elements:[]};return{kind:"list",elements:Oe(t,n),...e.nth!==void 0?{nth:e.nth}:{}}}function re(e){return T(e).replace(/[\s:*]+$/u,"")}function Wt(e,t){return(e.kind==="role"?w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)):Oe(t,(o)=>re(o)===re(e.text)&&re(o)!=="")).filter((o)=>N(o,t.probe))}function De(e,t,n){let o=e.role?.trim().toLowerCase();return w(t.root).filter((r)=>{let i=A(r);if(o?i!==o:!Rt.has(i))return!1;return!n.some((s)=>s===r||r.contains(s))})}var Ut=new Set(["h1","h2","h3","h4","h5","h6","legend","caption","figcaption","summary","dt"]);function ie(e){return Ut.has(e.localName)||A(e)==="heading"}function Pt(e){for(let t=e;t;t=t.parentElement)if(ie(t))return t;return null}function Ht(e,t,n){let o=De(e,t,n),r=new Set;for(let i of n){let a=Pt(i)?.parentElement??i;for(let l of o)if(a.contains(l))r.add(l)}return{kind:"list",elements:o.filter((i)=>r.has(i))}}function _e(e,t,n,o){return e<o&&n<t}function Vt(e,t,n){let o=t.x+t.width,r=t.y+t.height,i=n.x+n.width,s=n.y+n.height,a=_e(t.y,r,n.y,s),l=_e(t.x,o,n.x,i);switch(e){case"rightOf":return a&&n.x>=o-K?Math.max(0,n.x-o):null;case"leftOf":return a&&i<=t.x+K?Math.max(0,t.x-i):null;case"below":return l&&n.y>=r-K?Math.max(0,n.y-r):null;case"above":return l&&s<=t.y+K?Math.max(0,t.y-s):null;case"sameRow":return a?Math.abs(n.x+n.width/2-(t.x+t.width/2)):null;default:return null}}function ve(e){return e.width>0&&e.height>0}function Bt(e,t){let n=Wt(e.anchor,t);if(n.length===0)return{kind:"list",elements:[]};if(e.relation==="inside")return Ht(e,t,n);let o=n.map((i)=>D(i,t.probe)).filter(ve);if(o.length===0)return{kind:"unsupported"};let r=[];for(let i of De(e,t,n)){let s=D(i,t.probe);if(!ve(s))continue;let a=null;for(let l of o){let u=Vt(e.relation,l,s);if(u!==null&&(a===null||u<a))a=u}if(a!==null)r.push({element:i,score:-a})}return{kind:"ranked",scored:r,margin:Mt}}function j(e,t){switch(e.kind){case"role":return Ct(e,t);case"css":return wt(e.selector,t);case"testId":return _t(e,t);case"xpath":return Ot(e,t);case"fuzzy":return It(e,t);case"anchor":return Bt(e,t);case"text":return Lt(e,t);default:return{kind:"unsupported"}}}var Ie=5,G=200;var Ft=12,Xt=3,zt=8,Kt=25,jt=5000,Gt=new Set(["alertdialog","article","banner","complementary","contentinfo","dialog","figure","form","grid","group","list","listitem","main","menu","menubar","navigation","radiogroup","region","row","search","tablist","table","tabpanel","toolbar","tree","treegrid"]);function $t(){return typeof performance>"u"?Date.now():performance.now()}function se(e=$t){return{answers:new Map,checksLeft:zt,now:e,deadline:e()+Kt}}function qt(e){return e.replace(/\s+/g," ").trim()}function Zt(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127&&n<=159)return!0}return!1}function Le(e){let t=qt(e);return t.length>0&&t.length<=G&&!Zt(t)?t:void 0}function We(e){return y(e)||F(e)}function Yt(e,t){for(let n of Array.from(e.children))if(ie(n)&&!We(n)&&N(n,t))return n;return}function*Jt(e,t){if(We(e))return;let n=A(e),o=Gt.has(n)?Le(R(e,t)):void 0;if(o)yield{anchor:{kind:"role",role:n,name:o},role:n};let r=Yt(e,t);if(!r)return;let i=A(r)==="heading",s=Le(i?R(r,t):O(r,t));if(!s)return;yield{anchor:i?{kind:"role",role:"heading",name:s}:{kind:"text",text:s},role:n}}function Qt(e,t){return JSON.stringify([e,t])}function en(e,t,n,o,r){let s=j({kind:"anchor",anchor:e,relation:"inside",role:t},{root:n,keep:o,...r?{probe:r}:{}});return s.kind==="list"?s.elements.filter(o):[]}function tn(e,t){return e.nodeType!==1||e===t||e.contains(t)}function Ue(e,t,n,o,r=se()){let i=A(e);if(i===""||y(e))return;let s=0,a=0;for(let l=e.parentElement;l&&a<Ft&&tn(t,l);l=l.parentElement){a+=1;for(let u of Jt(l,o)){let f=Qt(u.anchor,i),d=r.answers.get(f);if(!d){if(r.now()>=r.deadline)return;if(s>=Xt||r.checksLeft<=0)continue;s+=1,r.checksLeft-=1,d=en(u.anchor,i,t,n,o),r.answers.set(f,d)}if(d.length===1&&d[0]===e)return u}}return}function Pe(e){return e.querySelectorAll("*").length<=jt}var nn={x:0,y:0,width:0,height:0};function on(e,t,n){let o={root:e,offset:nn,hidden:!1,disabled:!1};for(let[r,i]of(t??[]).entries()){let s;try{s=Array.from(o.root.querySelectorAll(i))}catch{return{index:r,reason:"invalid"}}if(s.length===0)return{index:r,reason:"notFound"};if(s.length>1)return{index:r,reason:"ambiguous"};let a=s[0],l=a.localName;if(l==="iframe"||l==="frame"){let u=a,f=null;try{f=u.contentDocument}catch{f=null}if(!f)return{index:r,reason:"inaccessible"};let d=D(a,n,o.offset);o={root:f,offset:{x:d.x+u.clientLeft,y:d.y+u.clientTop,width:0,height:0},hidden:o.hidden||!N(a,n),disabled:o.disabled||!C(a)}}else if(a.shadowRoot)o={root:a.shadowRoot,offset:o.offset,hidden:o.hidden,disabled:o.disabled};else return{index:r,reason:"notAFrame"}}return o}function He(e,t,n,o){if(t==="attached")return!0;if(n.hidden||!N(e,o))return!1;return t==="visible"||!n.disabled&&C(e)}function Ve(e,t,n,o,r){return{role:A(e),name:y(e)?"":v(F(e)?ke(e,r):R(e,r),G),bounds:D(e,r,o),method:t.kind,methodIndex:n}}function rn(e,t,n,o=!1){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e,matches:0}:{outcome:"none",elements:[],matches:0};if(o)return{outcome:"ambiguous",elements:t,matches:t.length};if(n!==void 0){let r=t[n];return r?{outcome:"found",element:r,matches:t.length}:{outcome:"none",elements:[],matches:t.length}}return t.length===1?{outcome:"found",element:t[0],matches:1}:{outcome:"ambiguous",elements:t,matches:t.length}}function sn(e,t,n){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e.map((a)=>a.element),matches:0}:{outcome:"none",elements:[],matches:0};let o=[...t].sort((a,l)=>l.score-a.score),r=o[0],i=o[1];if(!i||r.score-i.score>=n)return{outcome:"found",element:r.element,matches:t.length};let s=o.filter((a)=>r.score-a.score<n).map((a)=>a.element);return{outcome:"ambiguous",elements:s,matches:s.length}}function an(e,t){switch(e.kind){case"invalid":case"unsupported":return e.kind;case"list":return rn(e.elements,e.elements.filter(t),e.nth,e.overflow);case"ranked":return sn(e.scored,e.scored.filter((n)=>t(n.element)),e.margin)}}function U(e,t,n=[],o=0,r){return{status:"failed",code:e,candidates:n,candidateCount:o,attempts:t,...r?{frame:r}:{}}}function Be(e,t,n={}){let o=n.state??"interactable",r=on(e,t.frame,n);if(!("root"in r)){let d=t.methods.map((c,p)=>({index:p,method:c.kind,outcome:"notTried",matches:0}));return U("ELEMENT_NOT_FOUND",d,[],0,r)}let i=[],s=t.methods.findIndex((d)=>d.enabled!==!1),a,l,u;for(let[d,c]of t.methods.entries()){if(u){i.push({index:d,method:c.kind,outcome:"notTried",matches:0});continue}if(c.enabled===!1){i.push({index:d,method:c.kind,outcome:"disabled",matches:0});continue}let p=(h)=>He(h,o,r,n),m=an(j(c,{root:r.root,probe:n,keep:p}),p);if(m==="invalid"||m==="unsupported"){i.push({index:d,method:c.kind,outcome:m,matches:0});continue}if(i.push({index:d,method:c.kind,outcome:m.outcome,matches:m.matches}),m.outcome==="found")u={element:m.element,method:c,index:d};else if(m.outcome==="ambiguous"&&!a)a={elements:m.elements,method:c,index:d,count:m.matches};else if(m.outcome==="notInteractable"&&!l)l={elements:m.elements,method:c,index:d}}if(u)return{status:"found",element:u.element,method:u.method.kind,methodIndex:u.index,fallback:u.index!==s,candidate:Ve(u.element,u.method,u.index,r.offset,n),attempts:i};let f=(d)=>d.elements.slice(0,Ie).map((c)=>Ve(c,d.method,d.index,r.offset,n));if(a){let d=(b)=>He(b,o,r,n),c=f(a);if(!Pe(r.root))return U("ELEMENT_AMBIGUOUS",i,c,a.count);let p=se(),{elements:m}=a,h=c.map((b,g)=>{let _=m[g],S=Ue(_,r.root,d,n,p);return S?{...b,container:S}:b});return U("ELEMENT_AMBIGUOUS",i,h,a.count)}if(l)return U("ELEMENT_NOT_INTERACTABLE",i,f(l),l.elements.length);return U("ELEMENT_NOT_FOUND",i)}var ae="[REDACTED]",ln=[/\b(?:Bearer|Basic)\s+[^\s"'`,;)\]}]+/gi,/\b(?:sk|pk|rk|xai)-[^\s"'`,;)\]}]+/gi,/\b(?:gsk|hf|ghp|gho|ghs|ghu|glpat)_[^\s"'`,;)\]}]+/gi,/\bAIza[\w-]{10,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{12,}/g],un=/([\s"'`,;:=()[\]{}]+)/,cn=/^(?:api[_-]?key|access[_-]?key|secret|secret[_-]?key|client[_-]?secret|token|password)$/i;function dn(e){let t=e.indexOf("…");return e.includes("***")||t!==-1&&t<e.length-1}function fn(e){let t=e.split(un);for(let n=0;n<t.length;n+=2){let o=t[n]??"";if(o&&o!=="[REDACTED]"&&dn(o))t[n]="[REDACTED]";let r=t[n+1]??"";if(t[n+2]&&cn.test(o)&&/[:=]/.test(r))t[n+2]="[REDACTED]"}return t.join("")}function le(e){if(!e)return e;let t=e;for(let n of ln)t=t.replace(n,"[REDACTED]");return t=fn(t),t.replace(/(?:\[REDACTED\]){2,}/g,"[REDACTED]")}var Fe="";function q(e){if(!e)return!1;let t=e.replaceAll("[REDACTED]",Fe);return le(t).replaceAll(Fe,"[REDACTED]")!==e}function ue(e){try{return decodeURIComponent(e.replaceAll("+"," "))}catch{return e}}function Xe(e){return q(ue(e).replace(/[/?&#]/g," "))}var mn=500,ze=/reset|recover|verify|verification|magic|confirm|activate|invite|unsubscribe/i;function pn(e){let t=e;for(let n=0;n<3;n+=1){let o=ue(t);if(o===t)break;t=o}return t}function hn(e){let t=e.split(/[/?#;]/),n=t.findIndex((r)=>ze.test(r));return t.slice(0,n+1).map((r)=>q(r)?ae:r).join("/")}function ce(e){let t=e.trim();if(t==="")return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//"),o="",r;if(n){let f;try{f=new URL(t.startsWith("//")?`https:${t}`:t)}catch{return null}if(f.protocol!=="http:"&&f.protocol!=="https:")return null;o=t.startsWith("//")?`//${f.host}`:f.origin,r=f.pathname}else r=t.split(/[?#]/)[0]??"";let i=r.split("/"),s=i.map(pn),a=s.findIndex((f)=>ze.test(f)),u=(a>=0?i.slice(0,a+1):i).map((f,d)=>{let c=s[d]??f;if(d===a)return hn(c);return q(c)||Xe(f)?ae:f}).join("/");return v(`${o}${u}`,mn)}var bn=1,En=5000,gn=64,Tn=500,xn=new Set(["script","style","noscript","template","link","meta","base","head","object","embed"]),An=new Set(["textarea"]),yn=new Set(["id","class","role","name","type","for","title","alt","placeholder","label","autocomplete","tabindex","disabled","readonly","hidden","inert","contenteditable","list","multiple","size","scope","slot","part","lang","dir","data-testid","data-test","data-test-id","data-qa","data-cy","data-automation-id",...H]),Sn=new Set(["aria-valuenow","aria-valuetext","aria-checked","aria-selected","aria-pressed"]),Mn=new Set(["button","submit","reset"]),Rn=/^[a-z][a-z0-9-]{0,63}$/;var kn=/^[a-z][a-z0-9_:.-]{0,127}$/;function je(e){let t=e.getAttribute("contenteditable");return t!==null&&t.trim().toLowerCase()!=="false"}function Ge(e){for(let t=x(e);t;t=x(t))if(t.localName==="textarea"||je(t))return!0;return!1}function Nn(e){if(!e.parentElement?.shadowRoot)return!1;let t=I(e);return t!==null&&(y(t)||Ge(t))}function Z(e){return v(le(e),Tn)}var Cn=new Set(["alt","label","title","placeholder","value","aria-label","aria-description","aria-roledescription","aria-placeholder"]),wn=new Set(["aria-hidden","aria-disabled","aria-expanded","aria-haspopup","aria-controls","aria-owns","aria-labelledby","aria-describedby","aria-level","aria-current","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-readonly","aria-required","aria-invalid","aria-busy","aria-live","aria-atomic","aria-posinset","aria-setsize","aria-colcount","aria-colindex","aria-colspan","aria-rowcount","aria-rowindex","aria-rowspan","aria-sort"]);function _n(e,t){let n={},o=e.localName;for(let r of Array.from(e.attributes)){let i=r.name.toLowerCase();if(i.startsWith("on")||!kn.test(i))continue;if(t&&(Cn.has(i)||i==="href"||i.startsWith("aria-")&&!wn.has(i)))continue;if(yn.has(i)||i.startsWith("aria-")&&!Sn.has(i))n[i]=Z(r.value);else if(i==="href"&&(o==="a"||o==="area")){let s=ce(r.value);if(s!==null)n[i]=s}else if(i==="value"&&o==="input"&&Mn.has((e.getAttribute("type")??"").toLowerCase()))n[i]=Z(r.value)}return Object.keys(n).length>0?n:void 0}function vn(e,t){let n=t?.rectOf?.(e)??e.getBoundingClientRect(),o=[Math.round(n.x),Math.round(n.y),Math.round(n.width),Math.round(n.height)];return o[2]>0||o[3]>0?o:void 0}function Ke(e,t,n,o,r){let i=[];for(let s of Array.from(e.childNodes)){if(t.count>=t.max){t.truncated=!0;break}if(s.nodeType===3){if(!o||Nn(s))continue;let a=s.textContent??"";if(a.length===0)continue;let l=a.trim()===""?" ":Z(a);t.count+=1,i.push(l)}else if(s.nodeType===1){let a=Y(s,t,n+1,o,r);if(a)i.push(a)}}return i}function Y(e,t,n,o,r){let i=e.localName.toLowerCase();if(xn.has(i)||!Rn.test(i))return null;if(n>gn)return t.truncated=!0,null;t.count+=1;let s={t:i},a=Ge(e),l=r||a||k(e),u=_n(e,l);if(u)s.a=u;if(N(e,t.probe)){let h=vn(e,t.probe);if(h)s.r=h}else s.h=1;let f=y(e),d=o&&!a&&!f&&!An.has(i)&&!je(e),c=l||!d;if(i==="svg"){let h=Array.from(e.children).find((g)=>g.localName==="title"),b=h?Y(h,t,n+1,d,c):null;if(b)s.c=[b];return s}if(i==="iframe"||i==="frame"){let h=null;try{h=e.contentDocument}catch{h=null}let b=h?.documentElement;if(b){let g=Y(b,t,n+1,d,c);if(g)s.f=g}return s}let p=Ke(e,t,n,d,c);if(p.length>0)s.c=p;let m=e.shadowRoot;if(m){let h=Ke(m,t,n,d,c);if(h.length>0)s.s=h}return s}function On(e){let t=e.querySelector("title");if(t&&k(t))return"";return Z(e.title??"")}function $e(e,t={}){let n={count:0,max:Math.max(1,t.maxNodes??En),truncated:!1,probe:t},o=Y(e.documentElement,n,0,!0,!1)??{t:"html"},r=e.defaultView;return{snapshotVersion:bn,url:ce(e.URL)??"",title:On(e),viewport:{width:Math.round(r?.innerWidth??0),height:Math.round(r?.innerHeight??0)},root:o,nodeCount:n.count,truncated:n.truncated}}var de=65536,Dn=65536,Ze=new Set(["getText","getValue","getAttribute","exists"]),Ye=new Set(["click","doubleClick","hover","check"]);function In(e){return e.ownerDocument.defaultView}var Ln={left:0,middle:1,right:2},Wn={left:1,middle:4,right:2};function fe(e,t,n){let o=e.getBoundingClientRect();return{bubbles:!0,cancelable:!0,composed:!0,view:t,button:Ln[n],buttons:0,clientX:o.x+o.width/2,clientY:o.y+o.height/2,pointerId:1,pointerType:"mouse",isPrimary:!0}}function Je(e,t,n){let o=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,r=[];for(let s=e;s;s=z(s))r.unshift(s);let i={...n,bubbles:!1};e.dispatchEvent(new o("pointerover",n));for(let s of r)s.dispatchEvent(new o("pointerenter",i));e.dispatchEvent(new t.MouseEvent("mouseover",n));for(let s of r)s.dispatchEvent(new t.MouseEvent("mouseenter",i))}var Un='a[href], area[href], button, input, select, textarea, iframe, summary, [tabindex], [contenteditable]:not([contenteditable="false"])';function Pn(e,t){for(let o=e;o;o=z(o))if(o.matches(Un)&&C(o)&&o instanceof t.HTMLElement){o.focus();return}let n=e.ownerDocument.activeElement;if(n instanceof t.HTMLElement&&n!==e.ownerDocument.body)n.blur()}function Hn(e,t,n,o,r){let i=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,s={...n,buttons:Wn[o],detail:r},a={...n,detail:r};Je(e,t,n);let l=e.dispatchEvent(new i("pointerdown",s));if(l&&e.dispatchEvent(new t.MouseEvent("mousedown",s)))Pn(e,t);if(e.dispatchEvent(new i("pointerup",a)),l)e.dispatchEvent(new t.MouseEvent("mouseup",a))}function P(e,t,n,o=1){let r=fe(e,t,n);Hn(e,t,r,n,o);let i=n==="left"?"click":n==="right"?"contextmenu":"auxclick";e.dispatchEvent(new t.MouseEvent(i,{...r,detail:o}))}function Qe(e,t){if(e instanceof t.HTMLTextAreaElement)return!0;if(!(e instanceof t.HTMLInputElement))return!1;return!["button","submit","reset","image","checkbox","radio","file","range","color","hidden"].includes(e.type)}function Vn(e,t,n){let o=e instanceof t.HTMLTextAreaElement?t.HTMLTextAreaElement.prototype:t.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(o,"value")?.set;if(r)r.call(e,n);else e.value=n;e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0}))}function Bn(e,t){if(!(e instanceof t.HTMLElement))return!1;if(e.isContentEditable)return!0;let n=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function qe(e,t,n,o){if(n.length>Dn)return{ok:!1,problem:"INVALID_ACTION"};if(Qe(e,t)){if(e.readOnly)return{ok:!1,problem:"NOT_EDITABLE"};return e.focus(),Vn(e,t,o?`${e.value}${n}`:n),{ok:!0}}if(Bn(e,t))return e.focus(),e.textContent=o?`${e.textContent??""}${n}`:n,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),{ok:!0};return{ok:!1,problem:"NOT_EDITABLE"}}function Fn(e){let t=e.getAttribute("label");return t!==null&&t.trim()!==""?t:e.textContent??""}function Xn(e,t,n){if(!(e instanceof t.HTMLSelectElement))return{ok:!1,problem:"NOT_SELECTABLE"};let o=Array.from(e.options),r=n.value!==void 0?o.find((i)=>i.value===n.value):n.label!==void 0?o.find((i)=>V(Fn(i),n.label)):n.index!==void 0?o[n.index]:void 0;if(!r||r.disabled||r.closest("optgroup")?.hasAttribute("disabled"))return{ok:!1,problem:"OPTION_NOT_FOUND"};return e.focus(),r.selected=!0,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0})),{ok:!0}}function zn(e,t,n){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio")){if(e.checked!==n){if(e.type==="radio"&&!n)return{ok:!1,problem:"NOT_CHECKABLE"};P(e,t,"left")}return e.checked===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}let o=e.getAttribute("role");if(o==="checkbox"||o==="switch"||o==="radio"||o==="menuitemcheckbox"){let r=()=>e.getAttribute("aria-checked")==="true";if(r()!==n)P(e,t,"left");return r()===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}return{ok:!1,problem:"NOT_CHECKABLE"}}var Kn=/^(?:[\s\S]|[A-Z][A-Za-z0-9]{1,23})$/u;function jn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image"].includes(e.type);let n=e.localName;return n==="a"&&e.hasAttribute("href")||n==="summary"}function Gn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image","checkbox","radio"].includes(e.type);return e.localName==="summary"}function me(e,t){e.dispatchEvent(new t.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0,view:t,detail:0}))}function $n(e,t,n){if(!Kn.test(n))return{ok:!1,problem:"INVALID_ACTION"};let o=n==="Space"?" ":n;if(e instanceof t.HTMLElement)e.focus();let r={key:o,bubbles:!0,cancelable:!0,composed:!0},i=e.dispatchEvent(new t.KeyboardEvent("keydown",r));if(o==="Enter"&&i){if(jn(e,t))me(e,t);else if(e instanceof t.HTMLInputElement&&Qe(e,t)&&e.form)Yn(e.form,t)}let s=e.dispatchEvent(new t.KeyboardEvent("keyup",r));if(o===" "&&i&&s&&Gn(e,t))me(e,t);return{ok:!0}}var qn=new Set(["submit","image"]),Zn=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]);function Yn(e,t){let n=Array.from(e.elements),o=e.getRootNode(),r=Array.from(o.querySelectorAll("button, input")).find((s)=>(s instanceof t.HTMLButtonElement&&s.type==="submit"||s instanceof t.HTMLInputElement&&qn.has(s.type))&&s.form===e);if(r){if(C(r))me(r,t);return}if(n.filter((s)=>s instanceof t.HTMLInputElement&&Zn.has(s.type)).length===1)e.requestSubmit()}function Jn(e,t){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"))return e.checked;if(e instanceof t.HTMLInputElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLSelectElement)return e.value.slice(0,de);let n=e.getAttribute("aria-checked");if(n==="true"||n==="false")return n==="true";return e.getAttribute("aria-valuenow")??e.getAttribute("aria-valuetext")}var Qn=/^[A-Za-z_][\w:.-]{0,127}$/;function et(e,t){let n=In(e);if(!n)return{ok:!1,problem:"INVALID_ACTION"};switch(t.kind){case"click":return P(e,n,t.button??"left"),{ok:!0};case"doubleClick":return P(e,n,"left",1),P(e,n,"left",2),e.dispatchEvent(new n.MouseEvent("dblclick",{...fe(e,n,"left"),detail:2})),{ok:!0};case"hover":{let o=fe(e,n,"left"),r=typeof n.PointerEvent==="function"?n.PointerEvent:n.MouseEvent;return Je(e,n,o),e.dispatchEvent(new r("pointermove",o)),e.dispatchEvent(new n.MouseEvent("mousemove",o)),{ok:!0}}case"focus":if(e instanceof n.HTMLElement)e.focus();return{ok:!0};case"type":return typeof t.text==="string"?qe(e,n,t.text,t.append===!0):{ok:!1,problem:"INVALID_ACTION"};case"clear":return qe(e,n,"",!1);case"select":return Xn(e,n,t);case"check":return zn(e,n,t.checked===!0);case"pressKey":return typeof t.key==="string"?$n(e,n,t.key):{ok:!1,problem:"INVALID_ACTION"};case"scroll":return e.scrollBy?.({left:Number(t.dx??0)||0,top:Number(t.dy??0)||0}),{ok:!0};case"scrollIntoView":return e.scrollIntoView?.({block:"center",inline:"nearest"}),{ok:!0};case"getText":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:O(e).slice(0,de)};case"getValue":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:Jn(e,n)};case"getAttribute":{if(typeof t.name!=="string"||!Qn.test(t.name))return{ok:!1,problem:"INVALID_ACTION"};let o=t.name.toLowerCase();if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:e.getAttribute(o)?.slice(0,de)??null}}case"exists":return{ok:!0,value:!0};default:return{ok:!1,problem:"INVALID_ACTION"}}}var nt=1,tt="__burdenoffUiRuntime",eo=60000,to="fg-ui-highlight",no=new Set(["role","css","testId","xpath","fuzzy","anchor","text"]);function pe(e){if(!e||typeof e!=="object")return!1;let t=e;if(!Array.isArray(t.methods)||t.methods.length===0||t.methods.length>8)return!1;if(t.frame!==void 0&&!(Array.isArray(t.frame)&&t.frame.every((n)=>typeof n==="string")))return!1;return t.methods.every((n)=>!!n&&typeof n==="object"&&no.has(String(n.kind)))}function he(){return{status:"failed",code:"ELEMENT_NOT_FOUND",candidates:[],candidateCount:0,attempts:[]}}function be(e){return{status:e.status,method:e.method,methodIndex:e.methodIndex,fallback:e.fallback,candidate:e.candidate,attempts:e.attempts}}function oo(e){try{return e.defaultView?.frameElement??null}catch{return null}}function ro(e,t,n,o){let r=e.getRootNode();if(typeof r.elementFromPoint!=="function")return null;let i=r.elementFromPoint(t,n);if(!i)return"offscreen";if(i===e||e.contains(i))return null;return o.some((s)=>s.contains(i))?null:"covered"}function io(e,t){let n=t.x+t.width/2,o=t.y+t.height/2,r=Array.from(e.labels??[]),i=e;for(let s=0;s<32;s+=1){let a=ro(i,n,o,s===0?r:[]);if(a)return a;let l=i.getRootNode();if(l&&"host"in l){i=l.host;continue}let u=oo(i.ownerDocument);if(!u)return null;let f=u.getBoundingClientRect();n+=f.x+u.clientLeft,o+=f.y+u.clientTop,i=u}return null}function so(e,t){let n=e.ownerDocument.defaultView;if(!n)return!1;let o=t.x+t.width/2,r=t.y+t.height/2;return o<0||r<0||o>=n.innerWidth||r>=n.innerHeight}function ao(e){let t=e.ownerDocument.defaultView;if(t&&t.getComputedStyle(e).pointerEvents==="none")return"noPointerEvents";let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;if(so(e,n)&&typeof e.scrollIntoView==="function")e.scrollIntoView({block:"center",inline:"center"}),n=e.getBoundingClientRect();return io(e,n)}function lo(e,t={}){let n=t.root??e,o={...t.rectOf?{rectOf:t.rectOf}:{},...t.isVisible?{isVisible:t.isVisible}:{}},r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null;r?.remove(),r=null},a=(c,p)=>(s(),Be(n,c,{...o,...p?{state:p}:{}})),l=(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state);return m.status==="found"?be(m):m},u=(c,p,m={})=>{if(!p||typeof p!=="object"||typeof p.kind!=="string")return{ok:!1,code:"INVALID_ACTION"};if(!pe(c))return{ok:!1,code:"ELEMENT_NOT_FOUND",resolution:he()};let h=m.state??(Ze.has(p.kind)?"visible":"interactable"),b=a(c,h);if(b.status!=="found"){if(p.kind==="exists"&&b.code==="ELEMENT_NOT_FOUND")return{ok:!0,value:!1,resolution:b};return{ok:!1,code:b.code,resolution:b}}let g=be(b),_=Ye.has(p.kind)?ao(b.element):null;if(_)return{ok:!1,code:"ELEMENT_NOT_INTERACTABLE",reason:_,resolution:{status:"failed",code:"ELEMENT_NOT_INTERACTABLE",candidates:[b.candidate],candidateCount:1,attempts:b.attempts}};let S=et(b.element,p);if(!S.ok)return{ok:!1,code:S.problem,resolution:g};return S.value===void 0?{ok:!0,resolution:g}:{ok:!0,resolution:g,value:S.value}},f=(c,p,m)=>{let h=e.createElement(to);h.setAttribute("aria-hidden","true"),h.setAttribute("style","all: initial; position: fixed; inset: 0; pointer-events: none; z-index: 2147483647;");let b=h.attachShadow({mode:"closed"});c.forEach((g,_)=>{let S=e.createElement("div");S.setAttribute("style",`position: fixed; left: ${g.bounds.x-3}px; top: ${g.bounds.y-3}px; width: ${g.bounds.width+6}px; height: ${g.bounds.height+6}px; outline: 3px solid Highlight; border-radius: 4px; box-sizing: border-box;`);let Ee=m?`${_+1}${p?` ${p}`:""}`:p;if(Ee){let J=e.createElement("span");J.textContent=Ee.slice(0,120),J.setAttribute("style","position: absolute; left: 0; top: 100%; margin-top: 4px; padding: 2px 6px; font: 600 11px system-ui, sans-serif; background: Highlight; color: HighlightText; border-radius: 3px; white-space: nowrap;"),S.appendChild(J)}b.appendChild(S)}),e.documentElement.appendChild(h),r=h};return{version:nt,resolve:l,act:u,highlight:(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state??"visible");if(m.status==="found")f([m.candidate],p.label,!1);else if(m.candidates.length>0)f(m.candidates,p.label,!0);let h=Math.min(eo,Math.max(0,Number(p.durationMs??0)||0));if(r&&h>0)i=setTimeout(s,h);return m.status==="found"?be(m):m},clearHighlight:s,snapshot:(c={})=>(s(),$e(e,{...o,...c.maxNodes?{maxNodes:c.maxNodes}:{}}))}}function ot(e,t){let n=Reflect.get(e,tt);if(n&&typeof n==="object"&&typeof n.version==="number"&&n.version>=nt)return n;let o=Object.freeze(lo(t));return Object.defineProperty(e,tt,{value:o,configurable:!0,enumerable:!1,writable:!1}),o}ot(globalThis,globalThis.document);})();
1
+ (()=>{var H=["data-fg-sensitive","data-sensitive","data-private"];function Q(e){return H.some((t)=>e.hasAttribute(t))}function I(e){let t=e.assignedSlot;if(t!==void 0)return t;let n=e.parentElement?.shadowRoot;if(!n)return null;for(let o of Array.from(n.querySelectorAll("slot")))if((typeof o.assignedNodes==="function"?o.assignedNodes():[]).includes(e))return o;return null}function x(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();if(n&&"host"in n)return n.host;try{return e.ownerDocument.defaultView?.frameElement??null}catch{return null}}function k(e){for(let t=e;t;t=x(t))if(Q(t))return!0;return!1}var ge={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",number:"spinbutton",search:"searchbox",email:"textbox",tel:"textbox",text:"textbox",url:"textbox",password:"textbox",date:"textbox","datetime-local":"textbox",month:"textbox",time:"textbox",week:"textbox",color:"textbox",file:"button"},Te={article:"article",aside:"complementary",button:"button",datalist:"listbox",dd:"definition",details:"group",dialog:"dialog",dt:"term",fieldset:"group",figure:"figure",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",hr:"separator",li:"listitem",main:"main",menu:"list",meter:"meter",nav:"navigation",ol:"list",optgroup:"group",option:"option",output:"status",p:"paragraph",progress:"progressbar",summary:"button",table:"table",tbody:"rowgroup",td:"cell",textarea:"textbox",tfoot:"rowgroup",thead:"rowgroup",tr:"row",ul:"list"},xe=new Set(["button","cell","checkbox","columnheader","gridcell","heading","link","menuitem","menuitemcheckbox","menuitemradio","option","radio","row","rowheader","switch","tab","tooltip","treeitem"]);var ee=256;function T(e){return(e??"").normalize("NFKC").replace(/\s+/g," ").trim().toLowerCase()}function V(e,t){return T(e)===T(t)}function Ae(e,t){let n=T(t);return n.length>0&&T(e).includes(n)}function rt(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let n=Array.from({length:t.length+1},(o,r)=>r);for(let o=1;o<=e.length;o+=1){let r=[o];for(let i=1;i<=t.length;i+=1){let s=e[o-1]===t[i-1]?0:1;r[i]=Math.min((n[i]??0)+1,(r[i-1]??0)+1,(n[i-1]??0)+s)}n=r}return n[t.length]??0}function ye(e,t){let n=T(e).slice(0,256),o=T(t).slice(0,256),r=Math.max(n.length,o.length);if(r===0)return 0;return 1-rt(n,o)/r}function v(e,t){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}var ne=512,it=65536,st=new Set(["button","input","meter","output","progress","select","textarea"]),at=new Set(["script","style","noscript","template","head","title","meta","link"]);function M(e){return e.localName.toLowerCase()}function Se(e){return e.parentElement?.closest("article, aside, main, nav, section")!=null}function lt(e){let t=M(e);switch(t){case"a":case"area":return e.hasAttribute("href")?"link":"";case"input":{let n=(e.getAttribute("type")??"text").toLowerCase();if(n==="hidden")return"";if(e.hasAttribute("list")&&["text","search","email","tel","url"].includes(n))return"combobox";return ge[n]??"textbox"}case"select":{let n=Number(e.getAttribute("size")??"0");return e.hasAttribute("multiple")||n>1?"listbox":"combobox"}case"img":return e.getAttribute("alt")===""?"presentation":"img";case"th":return e.getAttribute("scope")==="row"?"rowheader":"columnheader";case"header":return Se(e)?"":"banner";case"footer":return Se(e)?"":"contentinfo";case"section":case"form":return e.hasAttribute("aria-label")||e.hasAttribute("aria-labelledby")?t==="form"?"form":"region":"";default:return Te[t]??""}}function A(e){let t=e.getAttribute("role")?.trim().split(/\s+/)[0];return t?t.toLowerCase():lt(e)}function ut(e,t){let n=e.getRootNode();return typeof n.getElementById==="function"?n.getElementById(t):null}function ct(e){return e.hasAttribute("hidden")||e.getAttribute("aria-hidden")==="true"}function dt(e){let t=e.ownerDocument.defaultView;if(!t)return"none";let n=t.getComputedStyle(e);if(n.display==="none")return"subtree";return n.visibility==="hidden"||n.visibility==="collapse"?"self":"none"}function W(e){let t=e.getAttribute("contenteditable");if(t===null)return!1;let n=t.trim().toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function ft(e){if(e.shadowRoot)return Array.from(e.shadowRoot.childNodes);if(M(e)==="slot"){let t=e,n=typeof t.assignedNodes==="function"?t.assignedNodes({flatten:!0}):[];if(n.length>0)return n}return Array.from(e.childNodes)}var mt=/^(div|p|li|tr|td|th|br|h[1-6]|section|article|header|footer)$/;function L(e,t){if(e.remaining<=0||t.length===0)return;let n=t.slice(0,e.remaining);e.parts.push(n),e.remaining-=n.length}function Me(e,t,n,o,r,i=!1){if(t>32||n.remaining<=0)return;if(e.nodeType===3){if(!i)L(n,e.textContent??"");return}if(e.nodeType!==1)return;let s=e,a=M(s);if(at.has(a)||Q(s))return;if(!r&&ct(s))return;let l=!1;if(t>0&&!r){let d=o?.isVisible?.(s);if(d===!1)l=!0;else if(d===void 0){let c=dt(s);if(c==="subtree")return;l=c==="self"}}let u=s.getAttribute("aria-label")?.trim();if(u&&t>0&&!l){L(n,` ${u} `);return}if(a==="img"||a==="input"&&s.getAttribute("type")==="image"){if(!l)L(n,` ${s.getAttribute("alt")??""} `);return}if(a==="input"||a==="textarea"||a==="select")return;if(t>0&&W(s))return;let f=t>0&&mt.test(a);if(f)L(n," ");for(let d of ft(s))Me(d,t+1,n,o,r,l);if(f)L(n," ")}function F(e){if(M(e)==="textarea"||W(e))return!0;for(let n=x(e);n;n=x(n))if(M(n)==="textarea"||W(n))return!0;return!1}function Re(e){for(let t=x(e);t;t=x(t)){let n=M(t);if(n==="textarea"||n==="select"||W(t))return!0}return!1}function B(e,t,n=!1){let o=M(e);if(o==="textarea"||o==="select"||W(e)||Re(e)||k(e))return"";return E(e.getAttribute("aria-label")??"")||X(e,t,ne,n)}function X(e,t,n=ne,o=!1){if(e.nodeType===1&&k(e))return"";let r={parts:[],remaining:n*2+64};return Me(e,0,r,t,o),E(r.parts.join(""),n)}function E(e,t=ne){return e.replace(/\s+/g," ").trim().slice(0,t)}function pt(e,t){let n=[],o=e.getAttribute("id");if(o){let i=e.getRootNode();for(let s of Array.from(i.querySelectorAll("label")))if(s.getAttribute("for")===o)n.push(B(s,t,!0))}let r=e.closest("label");if(r&&!r.hasAttribute("for"))n.push(B(r,t,!0));return E(n.join(" "))}function te(e,t,n){let o=Array.from(e.children).find((r)=>M(r)===t);return o?B(o,n):""}function R(e,t){return Ne(e,t,!0)}function ke(e,t){return Ne(e,t,!1)}function ht(e,t){let n=Array.from(e.children).find((o)=>M(o)==="title");if(!n||k(n)||Re(n))return"";return E(Array.from(n.childNodes).map((o)=>X(o,t)).join(" "))}function Ne(e,t,n){let o=e.getAttribute("aria-labelledby");if(o){let l=o.split(/\s+/).filter(Boolean).map((u)=>ut(e,u)).filter((u)=>u!==null).map((u)=>B(u,t,!0)).join(" ");if(E(l))return E(l)}let r=e.getAttribute("aria-label");if(r&&E(r))return E(r);let i=M(e);if(st.has(i)){let l=pt(e,t);if(l)return l}if(i==="input"){let l=(e.getAttribute("type")??"text").toLowerCase();if(l==="button"||l==="submit"||l==="reset"){let u=e.getAttribute("value");if(u!==null)return E(u);return l==="submit"?"Submit":l==="reset"?"Reset":""}if(l==="image")return E(e.getAttribute("alt")??"")}if(i==="img"||i==="area"){let l=e.getAttribute("alt");if(l)return E(l)}if(i==="svg"){let l=ht(e,t);if(l)return l}if(i==="fieldset"){let l=te(e,"legend",t);if(l)return l}if(i==="table"){let l=te(e,"caption",t);if(l)return l}if(i==="option"){let l=E(e.getAttribute("label")??"");if(l)return l}if(i==="figure"){let l=te(e,"figcaption",t);if(l)return l}if(n&&xe.has(A(e))){let l=X(e,t);if(l)return l}let s=e.getAttribute("title");if(s&&E(s))return E(s);let a=e.getAttribute("placeholder");if(a&&E(a))return E(a);return""}function D(e,t){if(M(e)==="input"){let o=(e.getAttribute("type")??"text").toLowerCase();return o==="button"||o==="submit"||o==="reset"?R(e,t):""}return X(e,t,it)}function oe(e,t,n,o){return A(e)===t.trim().toLowerCase()&&T(R(e,o))===T(n)}function bt(e){return e.ownerDocument.defaultView}function K(e){let t=I(e);if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n&&"host"in n?n.host:null}function N(e,t){let n=t?.isVisible?.(e);if(n!==void 0)return n;if(!e.isConnected)return!1;let o=bt(e),r=e;while(r){if(r.hasAttribute("hidden"))return!1;if(r.localName==="input"&&r.getAttribute("type")?.toLowerCase()==="hidden")return!1;if(o&&o.getComputedStyle(r).display==="none")return!1;r=K(r)}if(o){let s=o.getComputedStyle(e);if(s.visibility==="hidden"||s.visibility==="collapse")return!1;if(s.display==="contents")return!0}let i=e.checkVisibility;return typeof i==="function"?i.call(e):!0}function C(e){for(let n=e;n;n=x(n))if(n.getAttribute("aria-disabled")==="true"||n.hasAttribute("inert"))return!1;if(!Et.has(e.localName)){let n=e.parentElement?.closest("button, select, option, optgroup, textarea");return n?C(n):!0}if(e.hasAttribute("disabled"))return!1;let t=e.parentElement?.closest("fieldset[disabled]");if(t){if(!Array.from(t.children).find((o)=>o.localName==="legend")?.contains(e))return!1}try{return!e.matches(":disabled")}catch{return!0}}var Et=new Set(["button","input","select","textarea","optgroup","option","fieldset"]);function O(e,t,n){let r=t?.rectOf?.(e)??e.getBoundingClientRect();return{x:Math.round(r.x+(n?.x??0)),y:Math.round(r.y+(n?.y??0)),width:Math.round(r.width),height:Math.round(r.height)}}function w(e){let t=Array.from(e.querySelectorAll("*"));return e.nodeType===1?[e,...t]:t}var gt=/password|passcode|passwd|\bpin\b|otp|one[\s-]?time|verification|security code|auth(?:entication)? code|\bcvv\b|\bcvc\b|card number|secret|token|recovery/i,Tt=/password|one-time-code|^cc-/i;function xt(e){return gt.test(e)}function y(e){if(k(e))return!0;if(Ce(e))return!0;for(let t=x(e);t;t=x(t))if(Ce(t))return!0;return!1}function Ce(e){let t=e.localName,n=e.getAttribute("contenteditable"),o=n!==null&&n.trim().toLowerCase()!=="false";if(t!=="input"&&t!=="textarea"&&t!=="select"&&!o)return!1;if(e.getAttribute("type")?.toLowerCase()==="password")return!0;if((e.getAttribute("autocomplete")??"").trim().split(/\s+/).filter(Boolean).some((i)=>Tt.test(i)))return!0;return At(e).some((i)=>i.length>0&&xt(i.replace(/[-_]/g," ")))}function At(e){let t=(a)=>(a??"").slice(0,512),n=[R(e),t(e.getAttribute("aria-label")),t(e.getAttribute("placeholder")),t(e.getAttribute("title")),t(e.getAttribute("name")),t(e.getAttribute("id"))],o=e.getRootNode(),r=(a)=>typeof o.getElementById==="function"?o.getElementById(a):null;for(let a of(e.getAttribute("aria-labelledby")??"").split(/\s+/).filter(Boolean)){let l=r(a);if(l)n.push(t(l.getAttribute("aria-label")),t(l.textContent))}let i=e.getAttribute("id"),s=Array.from(o.querySelectorAll("label")).filter((a)=>i!==null&&a.getAttribute("for")===i||!a.hasAttribute("for")&&a.contains(e));for(let a of s)n.push(t(a.getAttribute("aria-label")),t(a.textContent));return n}var yt=0.8,St=0.05,Mt=4,we=1000,z=2,Rt=new Set(["button","checkbox","combobox","link","listbox","menuitem","menuitemcheckbox","menuitemradio","option","radio","searchbox","slider","spinbutton","switch","tab","textbox","treeitem"]),kt=/^[A-Za-z_][\w:.-]{0,127}$/;function Nt(e){return e.nodeType===9?e:e.ownerDocument}function Ct(e,t){return{kind:"list",elements:w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)),...e.nth!==void 0?{nth:e.nth}:{}}}function wt(e,t){try{return{kind:"list",elements:Array.from(t.root.querySelectorAll(e))}}catch{return{kind:"invalid"}}}function _t(e,t){let n=e.attribute??"data-testid";if(!kt.test(n))return{kind:"invalid"};return{kind:"list",elements:w(t.root).filter((r)=>r.getAttribute(n)===e.value)}}function vt(e,t){if(e.nodeType===9)return t.ownerDocument===e&&t.getRootNode()===e;return e===t||e.contains(t)}function Dt(e,t){let n=Nt(t.root);if(typeof n.evaluate!=="function")return{kind:"unsupported"};let o;try{o=n.evaluate(e.xpath,t.root,null,7,null)}catch{return{kind:"invalid"}}let r=[],i=Math.min(o.snapshotLength,we);for(let s=0;s<i;s+=1){let a=o.snapshotItem(s);if(a&&a.nodeType===1&&vt(t.root,a))r.push(a)}return{kind:"list",elements:r,...o.snapshotLength>we?{overflow:!0}:{}}}function Ot(e,t,n){let o=Math.min(T(e).length,ee),r=Math.max(o,t);return r>0&&Math.abs(o-t)<=(1-n)*r}function It(e,t){let n=Math.min(1,Math.max(0.5,e.threshold??yt)),o=e.role?.trim().toLowerCase(),r=Math.min(T(e.name).length,ee),i=[];for(let s of w(t.root)){let a=A(s);if(o?a!==o:a==="")continue;let l=R(s,t.probe);if(!Ot(l,r,n))continue;let u=ye(l,e.name);if(u>=n)i.push({element:s,score:u})}return{kind:"ranked",scored:i,margin:St}}function De(e,t){let n=w(e.root).filter((i)=>t(D(i,e.probe))),o=e.keep??(()=>!0),r=n.filter(o);return n.filter((i)=>!r.some((s)=>s!==i&&i.contains(s)))}function Lt(e,t){let n=e.exact?(o)=>V(o,e.text):(o)=>Ae(o,e.text);if(T(e.text).length===0)return{kind:"list",elements:[]};return{kind:"list",elements:De(t,n),...e.nth!==void 0?{nth:e.nth}:{}}}function re(e){return T(e).replace(/[\s:*]+$/u,"")}function Wt(e,t){return(e.kind==="role"?w(t.root).filter((o)=>oe(o,e.role,e.name,t.probe)):De(t,(o)=>re(o)===re(e.text)&&re(o)!=="")).filter((o)=>N(o,t.probe))}function Oe(e,t,n){let o=e.role?.trim().toLowerCase();return w(t.root).filter((r)=>{let i=A(r);if(o?i!==o:!Rt.has(i))return!1;return!n.some((s)=>s===r||r.contains(s))})}var Ut=new Set(["h1","h2","h3","h4","h5","h6","legend","caption","figcaption","summary","dt"]);function ie(e){return Ut.has(e.localName)||A(e)==="heading"}function Pt(e){for(let t=e;t;t=t.parentElement)if(ie(t))return t;return null}function Ht(e,t,n){let o=Oe(e,t,n),r=new Set;for(let i of n){let a=Pt(i)?.parentElement??i;for(let l of o)if(a.contains(l))r.add(l)}return{kind:"list",elements:o.filter((i)=>r.has(i))}}function _e(e,t,n,o){return e<o&&n<t}function Vt(e,t,n){let o=t.x+t.width,r=t.y+t.height,i=n.x+n.width,s=n.y+n.height,a=_e(t.y,r,n.y,s),l=_e(t.x,o,n.x,i);switch(e){case"rightOf":return a&&n.x>=o-z?Math.max(0,n.x-o):null;case"leftOf":return a&&i<=t.x+z?Math.max(0,t.x-i):null;case"below":return l&&n.y>=r-z?Math.max(0,n.y-r):null;case"above":return l&&s<=t.y+z?Math.max(0,t.y-s):null;case"sameRow":return a?Math.abs(n.x+n.width/2-(t.x+t.width/2)):null;default:return null}}function ve(e){return e.width>0&&e.height>0}function Bt(e,t){let n=Wt(e.anchor,t);if(n.length===0)return{kind:"list",elements:[]};if(e.relation==="inside")return Ht(e,t,n);let o=n.map((i)=>O(i,t.probe)).filter(ve);if(o.length===0)return{kind:"unsupported"};let r=[];for(let i of Oe(e,t,n)){let s=O(i,t.probe);if(!ve(s))continue;let a=null;for(let l of o){let u=Vt(e.relation,l,s);if(u!==null&&(a===null||u<a))a=u}if(a!==null)r.push({element:i,score:-a})}return{kind:"ranked",scored:r,margin:Mt}}function j(e,t){switch(e.kind){case"role":return Ct(e,t);case"css":return wt(e.selector,t);case"testId":return _t(e,t);case"xpath":return Dt(e,t);case"fuzzy":return It(e,t);case"anchor":return Bt(e,t);case"text":return Lt(e,t);default:return{kind:"unsupported"}}}var Ie=5,G=200;var Ft=12,Xt=3,Kt=8,zt=25,jt=5000,Gt=new Set(["alertdialog","article","banner","complementary","contentinfo","dialog","figure","form","grid","group","list","listitem","main","menu","menubar","navigation","radiogroup","region","row","search","tablist","table","tabpanel","toolbar","tree","treegrid"]);function $t(){return typeof performance>"u"?Date.now():performance.now()}function se(e=$t){return{answers:new Map,checksLeft:Kt,now:e,deadline:e()+zt}}function qt(e){return e.replace(/\s+/g," ").trim()}function Zt(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n<32||n>=127&&n<=159)return!0}return!1}function Le(e){let t=qt(e);return t.length>0&&t.length<=G&&!Zt(t)?t:void 0}function We(e){return y(e)||F(e)}function Yt(e,t){for(let n of Array.from(e.children))if(ie(n)&&!We(n)&&N(n,t))return n;return}function*Jt(e,t){if(We(e))return;let n=A(e),o=Gt.has(n)?Le(R(e,t)):void 0;if(o)yield{anchor:{kind:"role",role:n,name:o},role:n};let r=Yt(e,t);if(!r)return;let i=A(r)==="heading",s=Le(i?R(r,t):D(r,t));if(!s)return;yield{anchor:i?{kind:"role",role:"heading",name:s}:{kind:"text",text:s},role:n}}function Qt(e,t){return JSON.stringify([e,t])}function en(e,t,n,o,r){let s=j({kind:"anchor",anchor:e,relation:"inside",role:t},{root:n,keep:o,...r?{probe:r}:{}});return s.kind==="list"?s.elements.filter(o):[]}function tn(e,t){return e.nodeType!==1||e===t||e.contains(t)}function Ue(e,t,n,o,r=se()){let i=A(e);if(i===""||y(e))return;let s=0,a=0;for(let l=e.parentElement;l&&a<Ft&&tn(t,l);l=l.parentElement){a+=1;for(let u of Jt(l,o)){let f=Qt(u.anchor,i),d=r.answers.get(f);if(!d){if(r.now()>=r.deadline)return;if(s>=Xt||r.checksLeft<=0)continue;s+=1,r.checksLeft-=1,d=en(u.anchor,i,t,n,o),r.answers.set(f,d)}if(d.length===1&&d[0]===e)return u}}return}function Pe(e){return e.querySelectorAll("*").length<=jt}var nn={x:0,y:0,width:0,height:0};function on(e,t,n){let o={root:e,offset:nn,hidden:!1,disabled:!1};for(let[r,i]of(t??[]).entries()){let s;try{s=Array.from(o.root.querySelectorAll(i))}catch{return{index:r,reason:"invalid"}}if(s.length===0)return{index:r,reason:"notFound"};if(s.length>1)return{index:r,reason:"ambiguous"};let a=s[0],l=a.localName;if(l==="iframe"||l==="frame"){let u=a,f=null;try{f=u.contentDocument}catch{f=null}if(!f)return{index:r,reason:"inaccessible"};let d=O(a,n,o.offset);o={root:f,offset:{x:d.x+u.clientLeft,y:d.y+u.clientTop,width:0,height:0},hidden:o.hidden||!N(a,n),disabled:o.disabled||!C(a)}}else if(a.shadowRoot)o={root:a.shadowRoot,offset:o.offset,hidden:o.hidden,disabled:o.disabled};else return{index:r,reason:"notAFrame"}}return o}function He(e,t,n,o){if(t==="attached")return!0;if(n.hidden||!N(e,o))return!1;return t==="visible"||!n.disabled&&C(e)}function Ve(e,t,n,o,r){return{role:A(e),name:y(e)?"":v(F(e)?ke(e,r):R(e,r),G),bounds:O(e,r,o),method:t.kind,methodIndex:n}}function rn(e,t,n,o=!1){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e,matches:0}:{outcome:"none",elements:[],matches:0};if(o)return{outcome:"ambiguous",elements:t,matches:t.length};if(n!==void 0){let r=t[n];return r?{outcome:"found",element:r,matches:t.length}:{outcome:"none",elements:[],matches:t.length}}return t.length===1?{outcome:"found",element:t[0],matches:1}:{outcome:"ambiguous",elements:t,matches:t.length}}function sn(e,t,n){if(t.length===0)return e.length>0?{outcome:"notInteractable",elements:e.map((a)=>a.element),matches:0}:{outcome:"none",elements:[],matches:0};let o=[...t].sort((a,l)=>l.score-a.score),r=o[0],i=o[1];if(!i||r.score-i.score>=n)return{outcome:"found",element:r.element,matches:t.length};let s=o.filter((a)=>r.score-a.score<n).map((a)=>a.element);return{outcome:"ambiguous",elements:s,matches:s.length}}function an(e,t){switch(e.kind){case"invalid":case"unsupported":return e.kind;case"list":return rn(e.elements,e.elements.filter(t),e.nth,e.overflow);case"ranked":return sn(e.scored,e.scored.filter((n)=>t(n.element)),e.margin)}}function U(e,t,n=[],o=0,r){return{status:"failed",code:e,candidates:n,candidateCount:o,attempts:t,...r?{frame:r}:{}}}function Be(e,t,n={}){let o=n.state??"interactable",r=on(e,t.frame,n);if(!("root"in r)){let d=t.methods.map((c,p)=>({index:p,method:c.kind,outcome:"notTried",matches:0}));return U("ELEMENT_NOT_FOUND",d,[],0,r)}let i=[],s=t.methods.findIndex((d)=>d.enabled!==!1),a,l,u;for(let[d,c]of t.methods.entries()){if(u){i.push({index:d,method:c.kind,outcome:"notTried",matches:0});continue}if(c.enabled===!1){i.push({index:d,method:c.kind,outcome:"disabled",matches:0});continue}let p=(h)=>He(h,o,r,n),m=an(j(c,{root:r.root,probe:n,keep:p}),p);if(m==="invalid"||m==="unsupported"){i.push({index:d,method:c.kind,outcome:m,matches:0});continue}if(i.push({index:d,method:c.kind,outcome:m.outcome,matches:m.matches}),m.outcome==="found")u={element:m.element,method:c,index:d};else if(m.outcome==="ambiguous"&&!a)a={elements:m.elements,method:c,index:d,count:m.matches};else if(m.outcome==="notInteractable"&&!l)l={elements:m.elements,method:c,index:d}}if(u)return{status:"found",element:u.element,method:u.method.kind,methodIndex:u.index,fallback:u.index!==s,candidate:Ve(u.element,u.method,u.index,r.offset,n),attempts:i};let f=(d)=>d.elements.slice(0,Ie).map((c)=>Ve(c,d.method,d.index,r.offset,n));if(a){let d=(b)=>He(b,o,r,n),c=f(a);if(!Pe(r.root))return U("ELEMENT_AMBIGUOUS",i,c,a.count);let p=se(),{elements:m}=a,h=c.map((b,g)=>{let _=m[g],S=Ue(_,r.root,d,n,p);return S?{...b,container:S}:b});return U("ELEMENT_AMBIGUOUS",i,h,a.count)}if(l)return U("ELEMENT_NOT_INTERACTABLE",i,f(l),l.elements.length);return U("ELEMENT_NOT_FOUND",i)}var ae="[REDACTED]",ln=[/\b(?:Bearer|Basic)\s+[^\s"'`,;)\]}]+/gi,/\b(?:sk|pk|rk|xai)-[^\s"'`,;)\]}]+/gi,/\b(?:gsk|hf|ghp|gho|ghs|ghu|glpat)_[^\s"'`,;)\]}]+/gi,/\bAIza[\w-]{10,}/g,/\b(?:AKIA|ASIA)[0-9A-Z]{12,}/g],un=/([\s"'`,;:=()[\]{}]+)/,cn=/^(?:api[_-]?key|access[_-]?key|secret|secret[_-]?key|client[_-]?secret|token|password)$/i;function dn(e){let t=e.indexOf("…");return e.includes("***")||t!==-1&&t<e.length-1}function fn(e){let t=e.split(un);for(let n=0;n<t.length;n+=2){let o=t[n]??"";if(o&&o!=="[REDACTED]"&&dn(o))t[n]="[REDACTED]";let r=t[n+1]??"";if(t[n+2]&&cn.test(o)&&/[:=]/.test(r))t[n+2]="[REDACTED]"}return t.join("")}function le(e){if(!e)return e;let t=e;for(let n of ln)t=t.replace(n,"[REDACTED]");return t=fn(t),t.replace(/(?:\[REDACTED\]){2,}/g,"[REDACTED]")}var Fe="";function q(e){if(!e)return!1;let t=e.replaceAll("[REDACTED]",Fe);return le(t).replaceAll(Fe,"[REDACTED]")!==e}function ue(e){try{return decodeURIComponent(e.replaceAll("+"," "))}catch{return e}}function Xe(e){return q(ue(e).replace(/[/?&#]/g," "))}var mn=500,Ke=/reset|recover|verify|verification|magic|confirm|activate|invite|unsubscribe/i;function pn(e){let t=e;for(let n=0;n<3;n+=1){let o=ue(t);if(o===t)break;t=o}return t}function hn(e){let t=e.split(/[/?#;]/),n=t.findIndex((r)=>Ke.test(r));return t.slice(0,n+1).map((r)=>q(r)?ae:r).join("/")}function ce(e){let t=e.trim();if(t==="")return null;let n=/^[a-z][a-z0-9+.-]*:/i.test(t)||t.startsWith("//"),o="",r;if(n){let f;try{f=new URL(t.startsWith("//")?`https:${t}`:t)}catch{return null}if(f.protocol!=="http:"&&f.protocol!=="https:")return null;o=t.startsWith("//")?`//${f.host}`:f.origin,r=f.pathname}else r=t.split(/[?#]/)[0]??"";let i=r.split("/"),s=i.map(pn),a=s.findIndex((f)=>Ke.test(f)),u=(a>=0?i.slice(0,a+1):i).map((f,d)=>{let c=s[d]??f;if(d===a)return hn(c);return q(c)||Xe(f)?ae:f}).join("/");return v(`${o}${u}`,mn)}var bn=1,En=5000,gn=64,Tn=500,xn=new Set(["script","style","noscript","template","link","meta","base","head","object","embed"]),An=new Set(["textarea"]),yn=new Set(["id","class","role","name","type","for","title","alt","placeholder","label","autocomplete","tabindex","disabled","readonly","hidden","inert","contenteditable","list","multiple","size","scope","slot","part","lang","dir","data-testid","data-test","data-test-id","data-qa","data-cy","data-automation-id",...H]),Sn=new Set(["aria-valuenow","aria-valuetext","aria-checked","aria-selected","aria-pressed"]),Mn=new Set(["button","submit","reset"]),Rn=/^[a-z][a-z0-9-]{0,63}$/;var kn=/^[a-z][a-z0-9_:.-]{0,127}$/;function je(e){let t=e.getAttribute("contenteditable");return t!==null&&t.trim().toLowerCase()!=="false"}function Ge(e){for(let t=x(e);t;t=x(t))if(t.localName==="textarea"||je(t))return!0;return!1}function Nn(e){if(!e.parentElement?.shadowRoot)return!1;let t=I(e);return t!==null&&(y(t)||Ge(t))}function Z(e){return v(le(e),Tn)}var Cn=new Set(["alt","label","title","placeholder","value","aria-label","aria-description","aria-roledescription","aria-placeholder"]),wn=new Set(["aria-hidden","aria-disabled","aria-expanded","aria-haspopup","aria-controls","aria-owns","aria-labelledby","aria-describedby","aria-level","aria-current","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-readonly","aria-required","aria-invalid","aria-busy","aria-live","aria-atomic","aria-posinset","aria-setsize","aria-colcount","aria-colindex","aria-colspan","aria-rowcount","aria-rowindex","aria-rowspan","aria-sort"]);function _n(e,t){let n={},o=e.localName;for(let r of Array.from(e.attributes)){let i=r.name.toLowerCase();if(i.startsWith("on")||!kn.test(i))continue;if(t&&(Cn.has(i)||i==="href"||i.startsWith("aria-")&&!wn.has(i)))continue;if(yn.has(i)||i.startsWith("aria-")&&!Sn.has(i))n[i]=Z(r.value);else if(i==="href"&&(o==="a"||o==="area")){let s=ce(r.value);if(s!==null)n[i]=s}else if(i==="value"&&o==="input"&&Mn.has((e.getAttribute("type")??"").toLowerCase()))n[i]=Z(r.value)}return Object.keys(n).length>0?n:void 0}function vn(e,t){let n=t?.rectOf?.(e)??e.getBoundingClientRect(),o=[Math.round(n.x),Math.round(n.y),Math.round(n.width),Math.round(n.height)];return o[2]>0||o[3]>0?o:void 0}function ze(e,t,n,o,r){let i=[];for(let s of Array.from(e.childNodes)){if(t.count>=t.max){t.truncated=!0;break}if(s.nodeType===3){if(!o||Nn(s))continue;let a=s.textContent??"";if(a.length===0)continue;let l=a.trim()===""?" ":Z(a);t.count+=1,i.push(l)}else if(s.nodeType===1){let a=Y(s,t,n+1,o,r);if(a)i.push(a)}}return i}function Y(e,t,n,o,r){let i=e.localName.toLowerCase();if(xn.has(i)||!Rn.test(i))return null;if(n>gn)return t.truncated=!0,null;t.count+=1;let s={t:i},a=Ge(e),l=r||a||k(e),u=_n(e,l);if(u)s.a=u;if(N(e,t.probe)){let h=vn(e,t.probe);if(h)s.r=h}else s.h=1;let f=y(e),d=o&&!a&&!f&&!An.has(i)&&!je(e),c=l||!d;if(i==="svg"){let h=Array.from(e.children).find((g)=>g.localName==="title"),b=h?Y(h,t,n+1,d,c):null;if(b)s.c=[b];return s}if(i==="iframe"||i==="frame"){let h=null;try{h=e.contentDocument}catch{h=null}let b=h?.documentElement;if(b){let g=Y(b,t,n+1,d,c);if(g)s.f=g}return s}let p=ze(e,t,n,d,c);if(p.length>0)s.c=p;let m=e.shadowRoot;if(m){let h=ze(m,t,n,d,c);if(h.length>0)s.s=h}return s}function Dn(e){let t=e.querySelector("title");if(t&&k(t))return"";return Z(e.title??"")}function $e(e,t={}){let n={count:0,max:Math.max(1,t.maxNodes??En),truncated:!1,probe:t},o=Y(e.documentElement,n,0,!0,!1)??{t:"html"},r=e.defaultView;return{snapshotVersion:bn,url:ce(e.URL)??"",title:Dn(e),viewport:{width:Math.round(r?.innerWidth??0),height:Math.round(r?.innerHeight??0)},root:o,nodeCount:n.count,truncated:n.truncated}}var de=65536,On=65536,Ze=new Set(["getText","getValue","getAttribute","exists"]),Ye=new Set(["click","doubleClick","hover","check"]);function In(e){return e.ownerDocument.defaultView}var Ln={left:0,middle:1,right:2},Wn={left:1,middle:4,right:2};function fe(e,t,n){let o=e.getBoundingClientRect();return{bubbles:!0,cancelable:!0,composed:!0,view:t,button:Ln[n],buttons:0,clientX:o.x+o.width/2,clientY:o.y+o.height/2,pointerId:1,pointerType:"mouse",isPrimary:!0}}function Je(e,t,n){let o=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,r=[];for(let s=e;s;s=K(s))r.unshift(s);let i={...n,bubbles:!1};e.dispatchEvent(new o("pointerover",n));for(let s of r)s.dispatchEvent(new o("pointerenter",i));e.dispatchEvent(new t.MouseEvent("mouseover",n));for(let s of r)s.dispatchEvent(new t.MouseEvent("mouseenter",i))}var Un='a[href], area[href], button, input, select, textarea, iframe, summary, [tabindex], [contenteditable]:not([contenteditable="false"])';function Pn(e,t){for(let o=e;o;o=K(o))if(o.matches(Un)&&C(o)&&o instanceof t.HTMLElement){o.focus();return}let n=e.ownerDocument.activeElement;if(n instanceof t.HTMLElement&&n!==e.ownerDocument.body)n.blur()}function Hn(e,t,n,o,r){let i=typeof t.PointerEvent==="function"?t.PointerEvent:t.MouseEvent,s={...n,buttons:Wn[o],detail:r},a={...n,detail:r};Je(e,t,n);let l=e.dispatchEvent(new i("pointerdown",s));if(l&&e.dispatchEvent(new t.MouseEvent("mousedown",s)))Pn(e,t);if(e.dispatchEvent(new i("pointerup",a)),l)e.dispatchEvent(new t.MouseEvent("mouseup",a))}function P(e,t,n,o=1){let r=fe(e,t,n);Hn(e,t,r,n,o);let i=n==="left"?"click":n==="right"?"contextmenu":"auxclick";e.dispatchEvent(new t.MouseEvent(i,{...r,detail:o}))}function Qe(e,t){if(e instanceof t.HTMLTextAreaElement)return!0;if(!(e instanceof t.HTMLInputElement))return!1;return!["button","submit","reset","image","checkbox","radio","file","range","color","hidden"].includes(e.type)}function Vn(e,t,n){let o=e instanceof t.HTMLTextAreaElement?t.HTMLTextAreaElement.prototype:t.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(o,"value")?.set;if(r)r.call(e,n);else e.value=n;e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0}))}function Bn(e,t){if(!(e instanceof t.HTMLElement))return!1;if(e.isContentEditable)return!0;let n=e.closest("[contenteditable]")?.getAttribute("contenteditable")?.toLowerCase();return n===""||n==="true"||n==="plaintext-only"}function qe(e,t,n,o){if(n.length>On)return{ok:!1,problem:"INVALID_ACTION"};if(Qe(e,t)){if(e.readOnly)return{ok:!1,problem:"NOT_EDITABLE"};return e.focus(),Vn(e,t,o?`${e.value}${n}`:n),{ok:!0}}if(Bn(e,t))return e.focus(),e.textContent=o?`${e.textContent??""}${n}`:n,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),{ok:!0};return{ok:!1,problem:"NOT_EDITABLE"}}function Fn(e){let t=e.getAttribute("label");return t!==null&&t.trim()!==""?t:e.textContent??""}function Xn(e,t,n){if(!(e instanceof t.HTMLSelectElement))return{ok:!1,problem:"NOT_SELECTABLE"};let o=Array.from(e.options),r=n.value!==void 0?o.find((i)=>i.value===n.value):n.label!==void 0?o.find((i)=>V(Fn(i),n.label)):n.index!==void 0?o[n.index]:void 0;if(!r||r.disabled||r.closest("optgroup")?.hasAttribute("disabled"))return{ok:!1,problem:"OPTION_NOT_FOUND"};return e.focus(),r.selected=!0,e.dispatchEvent(new t.Event("input",{bubbles:!0,composed:!0})),e.dispatchEvent(new t.Event("change",{bubbles:!0})),{ok:!0}}function Kn(e,t,n){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio")){if(e.checked!==n){if(e.type==="radio"&&!n)return{ok:!1,problem:"NOT_CHECKABLE"};P(e,t,"left")}return e.checked===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}let o=e.getAttribute("role");if(o==="checkbox"||o==="switch"||o==="radio"||o==="menuitemcheckbox"){let r=()=>e.getAttribute("aria-checked")==="true";if(r()!==n)P(e,t,"left");return r()===n?{ok:!0}:{ok:!1,problem:"STATE_NOT_CHANGED"}}return{ok:!1,problem:"NOT_CHECKABLE"}}var zn=/^(?:[\s\S]|[A-Z][A-Za-z0-9]{1,23})$/u;function jn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image"].includes(e.type);let n=e.localName;return n==="a"&&e.hasAttribute("href")||n==="summary"}function Gn(e,t){if(e instanceof t.HTMLButtonElement)return!0;if(e instanceof t.HTMLInputElement)return["submit","button","reset","image","checkbox","radio"].includes(e.type);return e.localName==="summary"}function me(e,t){e.dispatchEvent(new t.MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0,view:t,detail:0}))}function $n(e,t,n){if(!zn.test(n))return{ok:!1,problem:"INVALID_ACTION"};let o=n==="Space"?" ":n;if(e instanceof t.HTMLElement)e.focus();let r={key:o,bubbles:!0,cancelable:!0,composed:!0},i=e.dispatchEvent(new t.KeyboardEvent("keydown",r));if(o==="Enter"&&i){if(jn(e,t))me(e,t);else if(e instanceof t.HTMLInputElement&&Qe(e,t)&&e.form)Yn(e.form,t)}let s=e.dispatchEvent(new t.KeyboardEvent("keyup",r));if(o===" "&&i&&s&&Gn(e,t))me(e,t);return{ok:!0}}var qn=new Set(["submit","image"]),Zn=new Set(["text","search","url","tel","email","password","date","month","week","time","datetime-local","number"]);function Yn(e,t){let n=Array.from(e.elements),o=e.getRootNode(),r=Array.from(o.querySelectorAll("button, input")).find((s)=>(s instanceof t.HTMLButtonElement&&s.type==="submit"||s instanceof t.HTMLInputElement&&qn.has(s.type))&&s.form===e);if(r){if(C(r))me(r,t);return}if(n.filter((s)=>s instanceof t.HTMLInputElement&&Zn.has(s.type)).length===1)e.requestSubmit()}function Jn(e,t){if(e instanceof t.HTMLInputElement&&(e.type==="checkbox"||e.type==="radio"))return e.checked;if(e instanceof t.HTMLInputElement||e instanceof t.HTMLTextAreaElement||e instanceof t.HTMLSelectElement)return e.value.slice(0,de);let n=e.getAttribute("aria-checked");if(n==="true"||n==="false")return n==="true";return e.getAttribute("aria-valuenow")??e.getAttribute("aria-valuetext")}var Qn=/^[A-Za-z_][\w:.-]{0,127}$/;function et(e,t){let n=In(e);if(!n)return{ok:!1,problem:"INVALID_ACTION"};switch(t.kind){case"click":return P(e,n,t.button??"left"),{ok:!0};case"doubleClick":return P(e,n,"left",1),P(e,n,"left",2),e.dispatchEvent(new n.MouseEvent("dblclick",{...fe(e,n,"left"),detail:2})),{ok:!0};case"hover":{let o=fe(e,n,"left"),r=typeof n.PointerEvent==="function"?n.PointerEvent:n.MouseEvent;return Je(e,n,o),e.dispatchEvent(new r("pointermove",o)),e.dispatchEvent(new n.MouseEvent("mousemove",o)),{ok:!0}}case"focus":if(e instanceof n.HTMLElement)e.focus();return{ok:!0};case"type":return typeof t.text==="string"?qe(e,n,t.text,t.append===!0):{ok:!1,problem:"INVALID_ACTION"};case"clear":return qe(e,n,"",!1);case"select":return Xn(e,n,t);case"check":return Kn(e,n,t.checked===!0);case"pressKey":return typeof t.key==="string"?$n(e,n,t.key):{ok:!1,problem:"INVALID_ACTION"};case"scroll":return e.scrollBy?.({left:Number(t.dx??0)||0,top:Number(t.dy??0)||0}),{ok:!0};case"scrollIntoView":return e.scrollIntoView?.({block:"center",inline:"nearest"}),{ok:!0};case"getText":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:D(e).slice(0,de)};case"getValue":if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:Jn(e,n)};case"getAttribute":{if(typeof t.name!=="string"||!Qn.test(t.name))return{ok:!1,problem:"INVALID_ACTION"};let o=t.name.toLowerCase();if(y(e))return{ok:!1,problem:"SENSITIVE_ELEMENT"};return{ok:!0,value:e.getAttribute(o)?.slice(0,de)??null}}case"exists":return{ok:!0,value:!0};default:return{ok:!1,problem:"INVALID_ACTION"}}}var nt=1,tt="__burdenoffUiRuntime",eo=60000,to="fg-ui-highlight",no=new Set(["role","css","testId","xpath","fuzzy","anchor","text"]);function pe(e){if(!e||typeof e!=="object")return!1;let t=e;if(!Array.isArray(t.methods)||t.methods.length===0||t.methods.length>8)return!1;if(t.frame!==void 0&&!(Array.isArray(t.frame)&&t.frame.every((n)=>typeof n==="string")))return!1;return t.methods.every((n)=>!!n&&typeof n==="object"&&no.has(String(n.kind)))}function he(){return{status:"failed",code:"ELEMENT_NOT_FOUND",candidates:[],candidateCount:0,attempts:[]}}function be(e){return{status:e.status,method:e.method,methodIndex:e.methodIndex,fallback:e.fallback,candidate:e.candidate,attempts:e.attempts}}function oo(e){try{return e.defaultView?.frameElement??null}catch{return null}}function ro(e,t,n,o){let r=e.getRootNode();if(typeof r.elementFromPoint!=="function")return null;let i=r.elementFromPoint(t,n);if(!i)return"offscreen";if(i===e||e.contains(i))return null;return o.some((s)=>s.contains(i))?null:"covered"}function io(e,t){let n=t.x+t.width/2,o=t.y+t.height/2,r=Array.from(e.labels??[]),i=e;for(let s=0;s<32;s+=1){let a=ro(i,n,o,s===0?r:[]);if(a)return a;let l=i.getRootNode();if(l&&"host"in l){i=l.host;continue}let u=oo(i.ownerDocument);if(!u)return null;let f=u.getBoundingClientRect();n+=f.x+u.clientLeft,o+=f.y+u.clientTop,i=u}return null}function so(e,t){let n=e.ownerDocument.defaultView;if(!n)return!1;let o=t.x+t.width/2,r=t.y+t.height/2;return o<0||r<0||o>=n.innerWidth||r>=n.innerHeight}function ao(e){let t=e.ownerDocument.defaultView;if(t&&t.getComputedStyle(e).pointerEvents==="none")return"noPointerEvents";let n=e.getBoundingClientRect();if(n.width<=0||n.height<=0)return null;if(so(e,n)&&typeof e.scrollIntoView==="function")e.scrollIntoView({block:"center",inline:"center"}),n=e.getBoundingClientRect();return io(e,n)}function lo(e,t={}){let n=t.root??e,o={...t.rectOf?{rectOf:t.rectOf}:{},...t.isVisible?{isVisible:t.isVisible}:{}},r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null;r?.remove(),r=null},a=(c,p)=>(s(),Be(n,c,{...o,...p?{state:p}:{}})),l=(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state);return m.status==="found"?be(m):m},u=(c,p,m={})=>{if(!p||typeof p!=="object"||typeof p.kind!=="string")return{ok:!1,code:"INVALID_ACTION"};if(!pe(c))return{ok:!1,code:"ELEMENT_NOT_FOUND",resolution:he()};let h=m.state??(Ze.has(p.kind)?"visible":"interactable"),b=a(c,h);if(b.status!=="found"){if(p.kind==="exists"&&b.code==="ELEMENT_NOT_FOUND")return{ok:!0,value:!1,resolution:b};return{ok:!1,code:b.code,resolution:b}}let g=be(b),_=Ye.has(p.kind)?ao(b.element):null;if(_)return{ok:!1,code:"ELEMENT_NOT_INTERACTABLE",reason:_,resolution:{status:"failed",code:"ELEMENT_NOT_INTERACTABLE",candidates:[b.candidate],candidateCount:1,attempts:b.attempts}};let S=et(b.element,p);if(!S.ok)return{ok:!1,code:S.problem,resolution:g};return S.value===void 0?{ok:!0,resolution:g}:{ok:!0,resolution:g,value:S.value}},f=(c,p,m)=>{let h=e.createElement(to);h.setAttribute("aria-hidden","true"),h.setAttribute("style","all: initial; position: fixed; inset: 0; pointer-events: none; z-index: 2147483647;");let b=h.attachShadow({mode:"closed"});c.forEach((g,_)=>{let S=e.createElement("div");S.setAttribute("style",`position: fixed; left: ${g.bounds.x-3}px; top: ${g.bounds.y-3}px; width: ${g.bounds.width+6}px; height: ${g.bounds.height+6}px; outline: 3px solid Highlight; border-radius: 4px; box-sizing: border-box;`);let Ee=m?`${_+1}${p?` ${p}`:""}`:p;if(Ee){let J=e.createElement("span");J.textContent=Ee.slice(0,120),J.setAttribute("style","position: absolute; left: 0; top: 100%; margin-top: 4px; padding: 2px 6px; font: 600 11px system-ui, sans-serif; background: Highlight; color: HighlightText; border-radius: 3px; white-space: nowrap;"),S.appendChild(J)}b.appendChild(S)}),e.documentElement.appendChild(h),r=h};return{version:nt,resolve:l,act:u,highlight:(c,p={})=>{if(!pe(c))return he();let m=a(c,p.state??"visible");if(m.status==="found")f([m.candidate],p.label,!1);else if(m.candidates.length>0)f(m.candidates,p.label,!0);let h=Math.min(eo,Math.max(0,Number(p.durationMs??0)||0));if(r&&h>0)i=setTimeout(s,h);return m.status==="found"?be(m):m},clearHighlight:s,snapshot:(c={})=>(s(),$e(e,{...o,...c.maxNodes?{maxNodes:c.maxNodes}:{}}))}}function ot(e,t){let n=Reflect.get(e,tt);if(n&&typeof n==="object"&&typeof n.version==="number"&&n.version>=nt)return n;let o=Object.freeze(lo(t));return Object.defineProperty(e,tt,{value:o,configurable:!0,enumerable:!1,writable:!1}),o}ot(globalThis,globalThis.document);})();
@@ -6,14 +6,14 @@ import {
6
6
  isRuntimeTarget2,
7
7
  createDomRuntime2,
8
8
  installDomRuntime2
9
- } from "./index-zagmp5ya.js";
9
+ } from "./index-n3nfhjrj.js";
10
10
  import {
11
11
  MAX_READ_TEXT2,
12
12
  MAX_TYPED_TEXT2,
13
13
  READ_ACTIONS2,
14
14
  POINTER_ACTIONS2,
15
15
  performDomAction2
16
- } from "./index-vnv9tp11.js";
16
+ } from "./index-e7pgqd60.js";
17
17
  export {
18
18
  DOM_RUNTIME_GLOBAL2 as DOM_RUNTIME_GLOBAL,
19
19
  DOM_RUNTIME_VERSION2 as DOM_RUNTIME_VERSION,
@@ -0,0 +1,40 @@
1
+ /**
2
+ * What the desk driver runs on: a desk that takes desk contract v3 actions
3
+ * (RPA plan package P2-03b; desk contract v3 sections 5 to 7).
4
+ *
5
+ * Inside the desk meta plugin's `run` entry (P2-04a) every action of a script
6
+ * goes through the SDK's per-action guard (`DeskRunContext.act`: fence, kill
7
+ * switch, consent, shell rule, timeout). `deskBackendFromAct` wraps exactly
8
+ * that one function, so the driver never reaches a provider around the guard.
9
+ */
10
+ import type { DeskCapabilitiesLike } from '../script/desktop-capabilities.js';
11
+ import type { DeskWireAction, DeskWireGetWhat, DeskWireResult, DeskWireSnapshotOptions, DeskWireTarget } from './desk-wire.js';
12
+ /** Where a desk call comes from: the script step, and the run's cancel signal. */
13
+ export interface DeskCallContext {
14
+ /** The script step the action belongs to (the guard reports it, and secret references are bound to it). */
15
+ stepId: string;
16
+ /** Aborted when the run is cancelled. */
17
+ signal?: AbortSignal;
18
+ /** The action's own timeout, when the step sets one. */
19
+ timeoutMs?: number;
20
+ }
21
+ /** A desk as the desk driver uses it. */
22
+ export interface DeskBackend {
23
+ /** The desk's capabilities: actions, target kinds, selector platforms, schema hashes, `allowShell`. */
24
+ capabilities(): DeskCapabilitiesLike;
25
+ /** Run one action. Refusals come back as `{ ok: false, error }`, never as a throw. */
26
+ act(action: DeskWireAction, context: DeskCallContext): Promise<DeskWireResult>;
27
+ /** `find`: every element a target matches, up to `max` (1 to 50). Never acts. */
28
+ find(target: DeskWireTarget, context: DeskCallContext, max?: number): Promise<DeskWireResult>;
29
+ /** `snapshot` with options: the `desk-tree-v1` tree. */
30
+ snapshot(options: DeskWireSnapshotOptions, context: DeskCallContext): Promise<DeskWireResult>;
31
+ /** `get`: read one element's text, value, name, state, bounds or attributes. */
32
+ get(target: DeskWireTarget, what: DeskWireGetWhat, context: DeskCallContext, attributes?: readonly string[]): Promise<DeskWireResult>;
33
+ }
34
+ export interface DeskBackendFromActOptions {
35
+ capabilities: () => DeskCapabilitiesLike;
36
+ /** One guarded desk action, such as the SDK's `DeskRunContext.act` with the step id and timeout. */
37
+ act: (action: DeskWireAction, context: DeskCallContext) => Promise<DeskWireResult>;
38
+ }
39
+ /** A backend whose `find`, `snapshot` and `get` are built on its one `act`. */
40
+ export declare function deskBackendFromAct(options: DeskBackendFromActOptions): DeskBackend;
@@ -0,0 +1,41 @@
1
+ import { type UiClock, type UiDeskDriver, type UiStepContext } from '../interpret/driver.js';
2
+ import type { DesktopUiTarget, DesktopUiTargetMethod } from '../script/desktop-types.js';
3
+ import type { DeskBackend } from './desk-backend.js';
4
+ import { type DeskWireMatch, type DeskWireTarget } from './desk-wire.js';
5
+ /** Elements one `find` asks for: enough to list `MAX_CANDIDATES` and prove there are more than one. */
6
+ export declare const DESK_FIND_MAX = 10;
7
+ /** Elements a read of every match takes (`find` returns at most 50). */
8
+ export declare const DESK_FIND_ALL_MAX = 50;
9
+ /** Tree nodes a snapshot for the engine's own methods asks for (the contract default). */
10
+ export declare const DEFAULT_DESK_SNAPSHOT_NODES = 2000;
11
+ export interface CreateDeskDriverOptions {
12
+ /** Absent means real time. */
13
+ clock?: UiClock;
14
+ /**
15
+ * Stores a screenshot the desk took (already masked on the machine) and
16
+ * returns a reference for the step event, or null. Absent: screenshot steps
17
+ * return null and failure screenshots are not taken.
18
+ */
19
+ storeScreenshot?: (png: Uint8Array, context: UiStepContext) => Promise<string | null>;
20
+ /**
21
+ * The one-time secret reference for a step's `typeSecret` (desk contract v3
22
+ * section 7.4: `DeskRunContext.secretRef`). Absent: the step's own
23
+ * `secretRef` is sent. A step it has no reference for fails with
24
+ * `SECRET_UNAVAILABLE`.
25
+ */
26
+ secretRefFor?: (stepId: string) => string | undefined;
27
+ /** Tree nodes asked for when the engine resolves a role, fuzzy or anchor method (default 2,000). */
28
+ maxSnapshotNodes?: number;
29
+ }
30
+ /** The desk target one method becomes, or undefined when the desk does not resolve it. */
31
+ export declare function deskTargetOfMethod(method: DesktopUiTargetMethod, target: DesktopUiTarget): DeskWireTarget | undefined;
32
+ /**
33
+ * Whether a desk element is a password or code field whose text, value or
34
+ * attributes the engine never reads (the web runtime's `SENSITIVE_ELEMENT`
35
+ * rule). Desks already never return a password field's value (desk contract
36
+ * v3 section 5.1); this is the engine's own check on top: a secure text role,
37
+ * or an editable field whose name reads like a secret.
38
+ */
39
+ export declare function isSensitiveDeskMatch(match: Pick<DeskWireMatch, 'role' | 'name'>): boolean;
40
+ /** Create a desk driver over a backend. */
41
+ export declare function createDeskDriver(backend: DeskBackend, options?: CreateDeskDriverOptions): UiDeskDriver;