@unotest/web 0.5.0

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.
@@ -0,0 +1,356 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const BrowserSchema: z.ZodEnum<["chromium", "firefox", "webkit"]>;
4
+ type Browser = z.infer<typeof BrowserSchema>;
5
+ /** Playwright channel — tells the driver which browser binary to launch
6
+ * when `browser` is `'chromium'`. `'chrome'` / `'msedge'` use the
7
+ * system-installed Chrome / Edge (zero download). `null` (or omitting
8
+ * the field) falls back to Playwright's bundled Chromium — requires
9
+ * `npx @unotest/web install-chromium` to download the ~150 MB binary.
10
+ * Ignored for firefox / webkit browsers (Playwright has no system
11
+ * channel for those). Chosen at init time via the browser prompt;
12
+ * user can flip later in unotest.config.{mjs,js,ts}. */
13
+ declare const BrowserChannelSchema: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"chrome">, z.ZodLiteral<"msedge">, z.ZodLiteral<"chrome-beta">, z.ZodNull]>>;
14
+ type BrowserChannel = z.infer<typeof BrowserChannelSchema>;
15
+ declare const ViewportSchema: z.ZodObject<{
16
+ width: z.ZodNumber;
17
+ height: z.ZodNumber;
18
+ }, "strip", z.ZodTypeAny, {
19
+ width: number;
20
+ height: number;
21
+ }, {
22
+ width: number;
23
+ height: number;
24
+ }>;
25
+ type Viewport = z.infer<typeof ViewportSchema>;
26
+ declare const RetryReasonSchema: z.ZodEnum<["transient", "network", "crash"]>;
27
+ type RetryReason = z.infer<typeof RetryReasonSchema>;
28
+ declare const RetryConfigSchema: z.ZodObject<{
29
+ count: z.ZodNumber;
30
+ on: z.ZodArray<z.ZodEnum<["transient", "network", "crash"]>, "many">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ count: number;
33
+ on: ("transient" | "network" | "crash")[];
34
+ }, {
35
+ count: number;
36
+ on: ("transient" | "network" | "crash")[];
37
+ }>;
38
+ type RetryConfig = z.infer<typeof RetryConfigSchema>;
39
+ declare const FailureBundleConfigSchema: z.ZodObject<{
40
+ /** Tier 1 is always on by D-16. Schema lock — not user-toggleable. */
41
+ tier1: z.ZodDefault<z.ZodLiteral<true>>;
42
+ /** Tier 2 — viewport + element-focused screenshots. */
43
+ tier2: z.ZodBoolean;
44
+ tier3: z.ZodObject<{
45
+ network: z.ZodBoolean;
46
+ video: z.ZodBoolean;
47
+ }, "strip", z.ZodTypeAny, {
48
+ network: boolean;
49
+ video: boolean;
50
+ }, {
51
+ network: boolean;
52
+ video: boolean;
53
+ }>;
54
+ retention: z.ZodObject<{
55
+ runs: z.ZodNumber;
56
+ days: z.ZodNumber;
57
+ }, "strip", z.ZodTypeAny, {
58
+ runs: number;
59
+ days: number;
60
+ }, {
61
+ runs: number;
62
+ days: number;
63
+ }>;
64
+ storageDir: z.ZodString;
65
+ }, "strip", z.ZodTypeAny, {
66
+ tier1: true;
67
+ tier2: boolean;
68
+ tier3: {
69
+ network: boolean;
70
+ video: boolean;
71
+ };
72
+ retention: {
73
+ runs: number;
74
+ days: number;
75
+ };
76
+ storageDir: string;
77
+ }, {
78
+ tier2: boolean;
79
+ tier3: {
80
+ network: boolean;
81
+ video: boolean;
82
+ };
83
+ retention: {
84
+ runs: number;
85
+ days: number;
86
+ };
87
+ storageDir: string;
88
+ tier1?: true | undefined;
89
+ }>;
90
+ type FailureBundleConfig = z.infer<typeof FailureBundleConfigSchema>;
91
+ declare const DialogPolicySchema: z.ZodEnum<["accept", "dismiss", "manual"]>;
92
+ type DialogPolicy = z.infer<typeof DialogPolicySchema>;
93
+ declare const LinterRuleIdSchema: z.ZodEnum<["lint:deep-css", "lint:xpath", "lint:obfuscated-class", "lint:pause-explicit", "lint:disambig-by-index", "lint:evaluate-discouraged", "validator:unknown-function", "validator:dsl"]>;
94
+ type LinterRuleId = z.infer<typeof LinterRuleIdSchema>;
95
+ declare const LinterSeveritySchema: z.ZodEnum<["off", "warn", "error"]>;
96
+ type LinterSeverity = z.infer<typeof LinterSeveritySchema>;
97
+ declare const LinterConfigSchema: z.ZodObject<{
98
+ enabled: z.ZodBoolean;
99
+ rules: z.ZodRecord<z.ZodEnum<["lint:deep-css", "lint:xpath", "lint:obfuscated-class", "lint:pause-explicit", "lint:disambig-by-index", "lint:evaluate-discouraged", "validator:unknown-function", "validator:dsl"]>, z.ZodEnum<["off", "warn", "error"]>>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ enabled: boolean;
102
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
103
+ }, {
104
+ enabled: boolean;
105
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
106
+ }>;
107
+ type LinterConfig = z.infer<typeof LinterConfigSchema>;
108
+ declare const McpConfigSchema: z.ZodObject<{
109
+ transport: z.ZodLiteral<"stdio">;
110
+ }, "strip", z.ZodTypeAny, {
111
+ transport: "stdio";
112
+ }, {
113
+ transport: "stdio";
114
+ }>;
115
+ type McpConfig = z.infer<typeof McpConfigSchema>;
116
+ declare const SandboxConfigSchema: z.ZodObject<{
117
+ /** Default cwd for `shell(cmd, ...args)`. Defaults to `process.cwd()`. */
118
+ shellCwd: z.ZodOptional<z.ZodString>;
119
+ /** Database connection string consumed by `dbQuery` / `dbExec`. URL form
120
+ * picks the dialect: `postgres://`, `mysql://`, `sqlite:`. */
121
+ database: z.ZodOptional<z.ZodString>;
122
+ /** Base URL for `apiCall(method, path, body?, headers?)`. The path
123
+ * passed to `apiCall` MUST be relative (starts with `/`); absolute
124
+ * URLs are rejected at runtime. */
125
+ apiBaseUrl: z.ZodOptional<z.ZodString>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ shellCwd?: string | undefined;
128
+ database?: string | undefined;
129
+ apiBaseUrl?: string | undefined;
130
+ }, {
131
+ shellCwd?: string | undefined;
132
+ database?: string | undefined;
133
+ apiBaseUrl?: string | undefined;
134
+ }>;
135
+ type SandboxConfig = z.infer<typeof SandboxConfigSchema>;
136
+ declare const UnotestConfigSchema: z.ZodObject<{
137
+ baseUrl: z.ZodOptional<z.ZodString>;
138
+ browsers: z.ZodArray<z.ZodEnum<["chromium", "firefox", "webkit"]>, "many">;
139
+ channel: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"chrome">, z.ZodLiteral<"msedge">, z.ZodLiteral<"chrome-beta">, z.ZodNull]>>;
140
+ viewport: z.ZodObject<{
141
+ width: z.ZodNumber;
142
+ height: z.ZodNumber;
143
+ }, "strip", z.ZodTypeAny, {
144
+ width: number;
145
+ height: number;
146
+ }, {
147
+ width: number;
148
+ height: number;
149
+ }>;
150
+ retry: z.ZodObject<{
151
+ count: z.ZodNumber;
152
+ on: z.ZodArray<z.ZodEnum<["transient", "network", "crash"]>, "many">;
153
+ }, "strip", z.ZodTypeAny, {
154
+ count: number;
155
+ on: ("transient" | "network" | "crash")[];
156
+ }, {
157
+ count: number;
158
+ on: ("transient" | "network" | "crash")[];
159
+ }>;
160
+ failureBundle: z.ZodObject<{
161
+ /** Tier 1 is always on by D-16. Schema lock — not user-toggleable. */
162
+ tier1: z.ZodDefault<z.ZodLiteral<true>>;
163
+ /** Tier 2 — viewport + element-focused screenshots. */
164
+ tier2: z.ZodBoolean;
165
+ tier3: z.ZodObject<{
166
+ network: z.ZodBoolean;
167
+ video: z.ZodBoolean;
168
+ }, "strip", z.ZodTypeAny, {
169
+ network: boolean;
170
+ video: boolean;
171
+ }, {
172
+ network: boolean;
173
+ video: boolean;
174
+ }>;
175
+ retention: z.ZodObject<{
176
+ runs: z.ZodNumber;
177
+ days: z.ZodNumber;
178
+ }, "strip", z.ZodTypeAny, {
179
+ runs: number;
180
+ days: number;
181
+ }, {
182
+ runs: number;
183
+ days: number;
184
+ }>;
185
+ storageDir: z.ZodString;
186
+ }, "strip", z.ZodTypeAny, {
187
+ tier1: true;
188
+ tier2: boolean;
189
+ tier3: {
190
+ network: boolean;
191
+ video: boolean;
192
+ };
193
+ retention: {
194
+ runs: number;
195
+ days: number;
196
+ };
197
+ storageDir: string;
198
+ }, {
199
+ tier2: boolean;
200
+ tier3: {
201
+ network: boolean;
202
+ video: boolean;
203
+ };
204
+ retention: {
205
+ runs: number;
206
+ days: number;
207
+ };
208
+ storageDir: string;
209
+ tier1?: true | undefined;
210
+ }>;
211
+ dialogPolicy: z.ZodEnum<["accept", "dismiss", "manual"]>;
212
+ /** Path to storageState JSON for cached login. Undefined = fresh login each
213
+ * test (D-23 default). */
214
+ storageState: z.ZodOptional<z.ZodString>;
215
+ testDir: z.ZodString;
216
+ helpersDir: z.ZodString;
217
+ /** Default timeout for actions (click / fill / waitFor / locator
218
+ * resolution). Playwright stock is 30000ms — too long for interactive
219
+ * agents stranded on a missing locator. 3000ms is our default; raise
220
+ * per-action via the action's own `timeout` option, or globally via
221
+ * `UNOTEST_DEFAULT_TIMEOUT_MS`. */
222
+ defaultTimeoutMs: z.ZodNumber;
223
+ /** Default timeout for navigation (goto / reload / waitForUrl) AND
224
+ * for click/doubleClick's post-action navigation wait. Real web
225
+ * pages routinely take 5–10s to fire `load`; 15000ms is the sweet
226
+ * spot between reliability and time-to-failure on a misclick.
227
+ * Override via `UNOTEST_DEFAULT_NAVIGATION_TIMEOUT_MS`. */
228
+ defaultNavigationTimeoutMs: z.ZodNumber;
229
+ linter: z.ZodObject<{
230
+ enabled: z.ZodBoolean;
231
+ rules: z.ZodRecord<z.ZodEnum<["lint:deep-css", "lint:xpath", "lint:obfuscated-class", "lint:pause-explicit", "lint:disambig-by-index", "lint:evaluate-discouraged", "validator:unknown-function", "validator:dsl"]>, z.ZodEnum<["off", "warn", "error"]>>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ enabled: boolean;
234
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
235
+ }, {
236
+ enabled: boolean;
237
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
238
+ }>;
239
+ mcp: z.ZodObject<{
240
+ transport: z.ZodLiteral<"stdio">;
241
+ }, "strip", z.ZodTypeAny, {
242
+ transport: "stdio";
243
+ }, {
244
+ transport: "stdio";
245
+ }>;
246
+ sandbox: z.ZodObject<{
247
+ /** Default cwd for `shell(cmd, ...args)`. Defaults to `process.cwd()`. */
248
+ shellCwd: z.ZodOptional<z.ZodString>;
249
+ /** Database connection string consumed by `dbQuery` / `dbExec`. URL form
250
+ * picks the dialect: `postgres://`, `mysql://`, `sqlite:`. */
251
+ database: z.ZodOptional<z.ZodString>;
252
+ /** Base URL for `apiCall(method, path, body?, headers?)`. The path
253
+ * passed to `apiCall` MUST be relative (starts with `/`); absolute
254
+ * URLs are rejected at runtime. */
255
+ apiBaseUrl: z.ZodOptional<z.ZodString>;
256
+ }, "strip", z.ZodTypeAny, {
257
+ shellCwd?: string | undefined;
258
+ database?: string | undefined;
259
+ apiBaseUrl?: string | undefined;
260
+ }, {
261
+ shellCwd?: string | undefined;
262
+ database?: string | undefined;
263
+ apiBaseUrl?: string | undefined;
264
+ }>;
265
+ }, "strip", z.ZodTypeAny, {
266
+ browsers: ("chromium" | "firefox" | "webkit")[];
267
+ viewport: {
268
+ width: number;
269
+ height: number;
270
+ };
271
+ retry: {
272
+ count: number;
273
+ on: ("transient" | "network" | "crash")[];
274
+ };
275
+ failureBundle: {
276
+ tier1: true;
277
+ tier2: boolean;
278
+ tier3: {
279
+ network: boolean;
280
+ video: boolean;
281
+ };
282
+ retention: {
283
+ runs: number;
284
+ days: number;
285
+ };
286
+ storageDir: string;
287
+ };
288
+ dialogPolicy: "accept" | "dismiss" | "manual";
289
+ testDir: string;
290
+ helpersDir: string;
291
+ defaultTimeoutMs: number;
292
+ defaultNavigationTimeoutMs: number;
293
+ linter: {
294
+ enabled: boolean;
295
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
296
+ };
297
+ mcp: {
298
+ transport: "stdio";
299
+ };
300
+ sandbox: {
301
+ shellCwd?: string | undefined;
302
+ database?: string | undefined;
303
+ apiBaseUrl?: string | undefined;
304
+ };
305
+ baseUrl?: string | undefined;
306
+ channel?: "chrome" | "msedge" | "chrome-beta" | null | undefined;
307
+ storageState?: string | undefined;
308
+ }, {
309
+ browsers: ("chromium" | "firefox" | "webkit")[];
310
+ viewport: {
311
+ width: number;
312
+ height: number;
313
+ };
314
+ retry: {
315
+ count: number;
316
+ on: ("transient" | "network" | "crash")[];
317
+ };
318
+ failureBundle: {
319
+ tier2: boolean;
320
+ tier3: {
321
+ network: boolean;
322
+ video: boolean;
323
+ };
324
+ retention: {
325
+ runs: number;
326
+ days: number;
327
+ };
328
+ storageDir: string;
329
+ tier1?: true | undefined;
330
+ };
331
+ dialogPolicy: "accept" | "dismiss" | "manual";
332
+ testDir: string;
333
+ helpersDir: string;
334
+ defaultTimeoutMs: number;
335
+ defaultNavigationTimeoutMs: number;
336
+ linter: {
337
+ enabled: boolean;
338
+ rules: Partial<Record<"lint:deep-css" | "lint:xpath" | "lint:obfuscated-class" | "lint:pause-explicit" | "lint:disambig-by-index" | "lint:evaluate-discouraged" | "validator:unknown-function" | "validator:dsl", "off" | "warn" | "error">>;
339
+ };
340
+ mcp: {
341
+ transport: "stdio";
342
+ };
343
+ sandbox: {
344
+ shellCwd?: string | undefined;
345
+ database?: string | undefined;
346
+ apiBaseUrl?: string | undefined;
347
+ };
348
+ baseUrl?: string | undefined;
349
+ channel?: "chrome" | "msedge" | "chrome-beta" | null | undefined;
350
+ storageState?: string | undefined;
351
+ }>;
352
+ type UnotestConfig = z.infer<typeof UnotestConfigSchema>;
353
+ type UnotestConfigInput = z.input<typeof UnotestConfigSchema>;
354
+ declare const DEFAULT_CONFIG: UnotestConfig;
355
+
356
+ export { type Browser, type BrowserChannel, BrowserChannelSchema, BrowserSchema, DEFAULT_CONFIG, type DialogPolicy, DialogPolicySchema, type FailureBundleConfig, FailureBundleConfigSchema, type LinterConfig, LinterConfigSchema, type LinterRuleId, LinterRuleIdSchema, type LinterSeverity, LinterSeveritySchema, type McpConfig, McpConfigSchema, type RetryConfig, RetryConfigSchema, type RetryReason, RetryReasonSchema, type SandboxConfig, SandboxConfigSchema, type UnotestConfig, type UnotestConfigInput, UnotestConfigSchema, type Viewport, ViewportSchema };
@@ -0,0 +1 @@
1
+ var _0x13b842=_0x5c89;function _0xdd09(){var _0x5e35ee=['mte0mdu3m1D1qvHbvG','C3rYAw5N','Dw5VDgvZDc9LmMu','DxjS','mtiWnte3mgXgtwTPsq','CMvJB3jK','B2jQzwn0','og51D0rnAq','y3jHC2G','zxjYB3i','zgLZBwLZCW','Bwf4','D2vIA2L0','yM9VBgvHBG','DMfSAwrHDg9YoMrZBa','BNvTyMvY','BgLUDdP4Cgf0Aa','C3rKAw8','nda2ota3mwPkrfvnza','D2fYBG','y2HYB21LlwjLDge','y2HYB21L','B3b0Aw9UywW','BwLU','yxjYyxK','mtGZndnut05hBwm','BNvSBa','mti4mtu3r2L4B1rK','BgLUDdPKAxnHBwjPzY1IEs1PBMrLEa','Aw50','BxnLzgDL','Dw5VDgvZDc9LmMuVx2HLBhbLCNm','odCYmty5mhn6tKX6qW','DhjHBNnPzw50','BgL0zxjHBa','Cg9ZAxrPDMu','Dw5PB24','mti2odaZmtbvvxP6Exe','zw51Bq','y2HYB21PDw0','BgLUDdPVyMz1C2nHDgvKlwnSyxnZ','ywnJzxb0','zMLYzwzVEa','B2zM','zgvMyxvSDa','mJj1CwzxvLG','lNvUB3rLC3qVzMfPBhvYzxm','BMv0D29YAW','mtqWv2jAt3zn'];_0xdd09=function(){return _0x5e35ee;};return _0xdd09();}(function(_0x21391e,_0x290be0){var _0x3fe06b={_0x580772:0x1ee},_0x2523e1=_0x5c89,_0x24948d=_0x21391e();while(!![]){try{var _0x13f503=-parseInt(_0x2523e1(0x1f5))/0x1*(-parseInt(_0x2523e1(0x209))/0x2)+-parseInt(_0x2523e1(0x1f7))/0x3*(parseInt(_0x2523e1(0x20c))/0x4)+-parseInt(_0x2523e1(0x211))/0x5+parseInt(_0x2523e1(0x1fc))/0x6+parseInt(_0x2523e1(0x20d))/0x7+parseInt(_0x2523e1(0x214))/0x8*(-parseInt(_0x2523e1(_0x3fe06b._0x580772))/0x9)+parseInt(_0x2523e1(0x201))/0xa;if(_0x13f503===_0x290be0)break;else _0x24948d['push'](_0x24948d['shift']());}catch(_0x579fa0){_0x24948d['push'](_0x24948d['shift']());}}}(_0xdd09,0xdb3f8));import{z}from'zod';function _0x5c89(_0x13dc6a,_0x2e4bdd){_0x13dc6a=_0x13dc6a-0x1ea;var _0xdd09ee=_0xdd09();var _0x5c8924=_0xdd09ee[_0x13dc6a];if(_0x5c89['gBJOUl']===undefined){var _0x154e3c=function(_0x59b266){var _0x217219='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x54907f='',_0x350b77='';for(var _0x7ff67b=0x0,_0x294a3c,_0x5646bb,_0x34038e=0x0;_0x5646bb=_0x59b266['charAt'](_0x34038e++);~_0x5646bb&&(_0x294a3c=_0x7ff67b%0x4?_0x294a3c*0x40+_0x5646bb:_0x5646bb,_0x7ff67b++%0x4)?_0x54907f+=String['fromCharCode'](0xff&_0x294a3c>>(-0x2*_0x7ff67b&0x6)):0x0){_0x5646bb=_0x217219['indexOf'](_0x5646bb);}for(var _0x23afbd=0x0,_0x3f5513=_0x54907f['length'];_0x23afbd<_0x3f5513;_0x23afbd++){_0x350b77+='%'+('00'+_0x54907f['charCodeAt'](_0x23afbd)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x350b77);};_0x5c89['yWsZuA']=_0x154e3c,_0x5c89['dCxQZg']={},_0x5c89['gBJOUl']=!![];}var _0x3c3e52=_0xdd09ee[0x0],_0x1f40d4=_0x13dc6a+_0x3c3e52,_0x504fd8=_0x5c89['dCxQZg'][_0x1f40d4];return!_0x504fd8?(_0x5c8924=_0x5c89['yWsZuA'](_0x5c8924),_0x5c89['dCxQZg'][_0x1f40d4]=_0x5c8924):_0x5c8924=_0x504fd8,_0x5c8924;}var BrowserSchema=z[_0x13b842(0x202)]([_0x13b842(0x203),_0x13b842(0x206),_0x13b842(0x219)]),BrowserChannelSchema=z[_0x13b842(0x200)]([z[_0x13b842(0x1fe)](_0x13b842(0x1f1)),z[_0x13b842(0x1fe)](_0x13b842(0x1fa)),z[_0x13b842(0x1fe)](_0x13b842(0x1f0)),z[_0x13b842(0x1f6)]()])['optional'](),ViewportSchema=z[_0x13b842(0x213)]({'width':z['number']()[_0x13b842(0x1f9)]()[_0x13b842(0x1ff)](),'height':z['number']()[_0x13b842(0x1f9)]()[_0x13b842(0x1ff)]()}),RetryReasonSchema=z['enum']([_0x13b842(0x1fd),_0x13b842(0x20b),_0x13b842(0x215)]),RetryConfigSchema=z['object']({'count':z[_0x13b842(0x1eb)]()[_0x13b842(0x1f9)]()[_0x13b842(0x1f3)](0x0)[_0x13b842(0x218)](0xa),'on':z[_0x13b842(0x1f4)](RetryReasonSchema)}),FailureBundleConfigSchema=z[_0x13b842(0x213)]({'tier1':z[_0x13b842(0x1fe)](!![])[_0x13b842(0x208)](!![]),'tier2':z[_0x13b842(0x21a)](),'tier3':z['object']({'network':z[_0x13b842(0x21a)](),'video':z[_0x13b842(0x21a)]()}),'retention':z['object']({'runs':z[_0x13b842(0x1eb)]()[_0x13b842(0x1f9)]()[_0x13b842(0x1ff)](),'days':z[_0x13b842(0x1eb)]()[_0x13b842(0x1f9)]()[_0x13b842(0x1ff)]()}),'storageDir':z[_0x13b842(0x20e)]()['min'](0x1)}),DialogPolicySchema=z['enum']([_0x13b842(0x205),_0x13b842(0x217),'manual']),LinterRuleIdSchema=z['enum'](['lint:deep-css',_0x13b842(0x1ec),_0x13b842(0x204),'lint:pause-explicit',_0x13b842(0x1f8),'lint:evaluate-discouraged','validator:unknown-function',_0x13b842(0x1ea)]),LinterSeveritySchema=z[_0x13b842(0x202)]([_0x13b842(0x207),'warn',_0x13b842(0x216)]),LinterConfigSchema=z[_0x13b842(0x213)]({'enabled':z[_0x13b842(0x21a)](),'rules':z[_0x13b842(0x212)](LinterRuleIdSchema,LinterSeveritySchema)}),McpConfigSchema=z[_0x13b842(0x213)]({'transport':z[_0x13b842(0x1fe)](_0x13b842(0x1ed))}),SandboxConfigSchema=z[_0x13b842(0x213)]({'shellCwd':z[_0x13b842(0x20e)]()['optional'](),'database':z[_0x13b842(0x20e)]()[_0x13b842(0x1f2)](),'apiBaseUrl':z[_0x13b842(0x20e)]()[_0x13b842(0x210)]()[_0x13b842(0x1f2)]()}),UnotestConfigSchema=z[_0x13b842(0x213)]({'baseUrl':z[_0x13b842(0x20e)]()[_0x13b842(0x210)]()['optional'](),'browsers':z[_0x13b842(0x1f4)](BrowserSchema)['min'](0x1),'channel':BrowserChannelSchema,'viewport':ViewportSchema,'retry':RetryConfigSchema,'failureBundle':FailureBundleConfigSchema,'dialogPolicy':DialogPolicySchema,'storageState':z['string']()[_0x13b842(0x1f2)](),'testDir':z['string']()['min'](0x1),'helpersDir':z[_0x13b842(0x20e)]()[_0x13b842(0x1f3)](0x1),'defaultTimeoutMs':z[_0x13b842(0x1eb)]()['int']()[_0x13b842(0x1ff)](),'defaultNavigationTimeoutMs':z['number']()['int']()[_0x13b842(0x1ff)](),'linter':LinterConfigSchema,'mcp':McpConfigSchema,'sandbox':SandboxConfigSchema}),DEFAULT_CONFIG={'browsers':[_0x13b842(0x203)],'viewport':{'width':0x500,'height':0x2d0},'retry':{'count':0x0,'on':[_0x13b842(0x1fd)]},'failureBundle':{'tier1':!![],'tier2':!![],'tier3':{'network':![],'video':![]},'retention':{'runs':0x14,'days':0x7},'storageDir':_0x13b842(0x20a)},'dialogPolicy':_0x13b842(0x205),'testDir':_0x13b842(0x20f),'helpersDir':_0x13b842(0x1fb),'defaultTimeoutMs':0xbb8,'defaultNavigationTimeoutMs':0x3a98,'linter':{'enabled':!![],'rules':{'lint:deep-css':'warn','lint:xpath':'warn','lint:obfuscated-class':_0x13b842(0x1ef),'lint:pause-explicit':_0x13b842(0x1ef),'lint:disambig-by-index':_0x13b842(0x207),'lint:evaluate-discouraged':_0x13b842(0x1ef),'validator:unknown-function':_0x13b842(0x216),'validator:dsl':_0x13b842(0x216)}},'mcp':{'transport':'stdio'},'sandbox':{}};export{BrowserChannelSchema,BrowserSchema,DEFAULT_CONFIG,DialogPolicySchema,FailureBundleConfigSchema,LinterConfigSchema,LinterRuleIdSchema,LinterSeveritySchema,McpConfigSchema,RetryConfigSchema,RetryReasonSchema,SandboxConfigSchema,UnotestConfigSchema,ViewportSchema};
@@ -0,0 +1,74 @@
1
+ import { E as ElementHint, W as WebDriver, L as LaunchOptions, C as ContextOptions, D as DriverContext } from '../interfaces-iTfjd1zT.js';
2
+ export { A as ActionTimeout, a as CheckOptions, b as ClickOptions, c as CookieOptions, d as DriverPage, F as FillOptions, G as GotoOptions, H as HoverOptions, N as NavigationOptions, P as PressOptions, R as ReloadOptions, S as ScreenshotOptions, e as SelectOptions, V as Viewport, f as WaitOptions, g as WaitState } from '../interfaces-iTfjd1zT.js';
3
+ import '@unotest/protocol';
4
+ import '../config/schema.js';
5
+ import 'zod';
6
+
7
+ interface RecordedCall {
8
+ /** Where it happened: 'driver', 'context', or 'page<N>'. */
9
+ scope: string;
10
+ /** Method name, e.g. 'click', 'goto'. */
11
+ method: string;
12
+ /** Positional args, JSON-stringified for inspection. */
13
+ args: ReadonlyArray<unknown>;
14
+ /** Monotonic ordering across the whole driver tree. */
15
+ seq: number;
16
+ }
17
+ /**
18
+ * Programmable behavior for query methods (count/textContent/isVisible/etc.)
19
+ * and side-effecting hooks. Pass overrides to FakeWebDriver constructor.
20
+ */
21
+ interface FakeBehavior {
22
+ /** Default count() response. Override per-test before the call. Default: 1. */
23
+ countByDefault?: number;
24
+ /** Default textContent() response. Default: ''. */
25
+ textContentByDefault?: string;
26
+ /** Default inputValue() response. Default: ''. */
27
+ inputValueByDefault?: string;
28
+ /** Default isVisible() response. Default: true. */
29
+ isVisibleByDefault?: boolean;
30
+ /** Default URL after newContext. Default: 'about:blank'. */
31
+ initialUrl?: string;
32
+ /** If set, every action throws this error on next call (then clears). */
33
+ errorOnNextAction?: Error;
34
+ /** Per-key localStorage seed. */
35
+ localStorage?: Record<string, string>;
36
+ /** Per-name cookie seed. */
37
+ cookies?: Record<string, string>;
38
+ /** Per-attribute default response for getAttribute(loc, name). */
39
+ attributesByDefault?: Record<string, string | null>;
40
+ /** Programmable response for inspectElement(loc). Keys are
41
+ * `data-unotest-ref` values; map value is the ElementHint to return.
42
+ * Anything not in the map → null (StaleRef). */
43
+ elementHintByRef?: Record<string, ElementHint>;
44
+ /** Programmable response for outerHTML(loc). Keys are `data-unotest-ref`
45
+ * values; anything not in the map → a synthetic `<div data-ref>` string. */
46
+ outerHtmlByRef?: Record<string, string>;
47
+ /** Seed console entries that consoleEntries() returns. */
48
+ consoleEntries?: ReadonlyArray<{
49
+ level: "log" | "info" | "warn" | "error" | "debug";
50
+ text: string;
51
+ timestamp: string;
52
+ }>;
53
+ /** When set, every `click(loc)` opens a popup at this URL by calling
54
+ * the owning context's `emitFakePopup`. Used by popup-watcher
55
+ * integration tests so the FakeContext's `click` becomes a tab
56
+ * opener without touching production drivers. */
57
+ popupOnClick?: string;
58
+ }
59
+ declare class FakeWebDriver implements WebDriver {
60
+ private readonly behavior;
61
+ private launched;
62
+ private readonly recorder;
63
+ private readonly contexts;
64
+ constructor(behavior?: FakeBehavior);
65
+ launch(opts: LaunchOptions): Promise<void>;
66
+ newContext(opts?: ContextOptions): Promise<DriverContext>;
67
+ close(): Promise<void>;
68
+ /** Test helper — full recorded call log. */
69
+ calls(): ReadonlyArray<RecordedCall>;
70
+ /** Test helper — calls matching a method name. */
71
+ callsFor(method: string): ReadonlyArray<RecordedCall>;
72
+ }
73
+
74
+ export { ContextOptions, DriverContext, type FakeBehavior, FakeWebDriver, LaunchOptions, type RecordedCall, WebDriver };
@@ -0,0 +1 @@
1
+ const _0x4a869d=_0x1849;(function(_0x2ec872,_0x7c990){const _0x44fa64={_0x5b50c1:0x18a,_0x128e3d:0x14d,_0x2b03c4:0x174,_0x5d538f:0x17e},_0x59b464=_0x1849,_0x24c9a5=_0x2ec872();while(!![]){try{const _0x39e305=parseInt(_0x59b464(_0x44fa64._0x5b50c1))/0x1*(-parseInt(_0x59b464(0x1a0))/0x2)+parseInt(_0x59b464(_0x44fa64._0x128e3d))/0x3+parseInt(_0x59b464(0x161))/0x4*(-parseInt(_0x59b464(_0x44fa64._0x2b03c4))/0x5)+parseInt(_0x59b464(0x16f))/0x6*(parseInt(_0x59b464(0x175))/0x7)+-parseInt(_0x59b464(0x1a6))/0x8*(-parseInt(_0x59b464(0x176))/0x9)+parseInt(_0x59b464(0x1b5))/0xa*(-parseInt(_0x59b464(0x1bb))/0xb)+-parseInt(_0x59b464(0x199))/0xc*(-parseInt(_0x59b464(_0x44fa64._0x5d538f))/0xd);if(_0x39e305===_0x7c990)break;else _0x24c9a5['push'](_0x24c9a5['shift']());}catch(_0x3a02fd){_0x24c9a5['push'](_0x24c9a5['shift']());}}}(_0x2396,0x422bf));var __defProp=Object[_0x4a869d(0x169)],__name=(_0x5aabeb,_0x498db2)=>__defProp(_0x5aabeb,_0x4a869d(0x196),{'value':_0x498db2,'configurable':!![]}),UnotestError=class extends Error{static{__name(this,_0x4a869d(0x16e));}[_0x4a869d(0x193)];constructor(_0x401f95,_0x566d17={}){const _0x32d4f6={_0xb5bb28:0x196},_0xa6d0b8=_0x4a869d;super(_0x401f95),this[_0xa6d0b8(_0x32d4f6._0xb5bb28)]=new.target.name,this['context']=Object['freeze']({..._0x566d17}),typeof Error[_0xa6d0b8(0x153)]===_0xa6d0b8(0x165)&&Error['captureStackTrace'](this,new.target);}},DriverError=class extends UnotestError{static{__name(this,_0x4a869d(0x172));}},LocatorError=class extends UnotestError{static{__name(this,_0x4a869d(0x16d));}};function createRecorder(){const _0x14b1aa={_0x97ebfe:0x15a},_0x34a5ea=_0x4a869d,_0x3acd30=[];let _0x6a761a=0x0;return{'push':__name(_0x27a0a5=>_0x3acd30['push']({..._0x27a0a5,'seq':_0x6a761a++}),_0x34a5ea(0x1b1)),'calls':__name(()=>_0x3acd30,_0x34a5ea(_0x14b1aa._0x97ebfe))};}__name(createRecorder,_0x4a869d(0x1a7));function _0x2396(){const _0x131871=['y2HLy2S','B25bzNrLCKnSAwnR','mZGXq1LozejJ','z29cywnR','y291BNq','C2f2zvn0B3jHz2vtDgf0zq','z29gB3j3yxjK','CMvJB3jKzxi','ywn0AxzLugfNzq','Bg9JywXtDg9YywDLu3rHDgu','z2v0q29VA2LL','y29UDgv4Da','zhjPDMvY','yMvOyxzPB3i','BMfTzq','zg91yMXLq2XPy2S','C2v0qwn0AxzLugfNzq','mZyWue9YwhDg','zxHPDezYyw1L','y3vYCMvUDfvYBa','BgvUz3rO','rMfRzvbHz2u','yxr0CMLIDxrLC0j5rgvMyxvSDa','CgfNzuXPC3q','mJiXogPWAerWqq','rMfRzvDLyKrYAxzLCG','Aw5PDgLHBfvYBa','DxbSB2fKrMLSzq','Aw5WDxrwywX1zuj5rgvMyxvSDa','CgfNzxm','mta3ndm3nK9Yy3PvEa','y3jLyxrLuMvJB3jKzxi','zxjYB3jpBK5LEhrby3rPB24','Ag92zxi','Bwv0Ag9K','ywjVDxq6yMXHBMS','Dw5JAgvJAW','rMfRzunVBNrLEhq','Aw5WDxrwywX1zq','zNjHBwvtDgfJAW','ywrK','ChvZAa','AxnwAxnPyMXLqNLezwzHDwX0','zgvSzxrL','z2v0qxr0CMLIDxrL','ndmWnJKWBMrhEhzr','D2fPDezVCLvYBa','zNjHBwvezxb0Aa','CMvM','Cg9WDxbpBKnSAwnR','D2fPDezVCLrLEhq','ndrXrKLJqLi','C2nYB2XSsw50B1zPzxC','y2XVC2u','nZi4mdC5sgHcuwT4','Bg9JywXtDg9YywDL','zxzHBhvHDgu','zw1PDezHA2vqB3b1Ca','ywn0AxzLswr4','CMvJB3jK','y2fWDhvYzvn0ywnRvhjHy2u','z2v0tg9JywXtDg9YywDL','DgL0Bgu','zMLSBa','B3v0zxjiDg1SqNLszwy','y29VA2LLu3rHDgu','AxnwAxnPyMXL','y2fSBhm','zMfRzs1WBMC','y29UC29SzuvUDhjPzxm','BMv3ugfNzuXPC3rLBMvYCW','BMv3q29UDgv4DcbJywXSzwqGyMvMB3jLigXHDw5JAcGP','lNbHz2uW','pgrPDIbKyxrHlxvUB3rLC3qTCMvMpsi','ota1mZa4svrZA0zh','Bgf1BMnOzwq','D2fPDezVCG','C3rLChm','zNvUy3rPB24','zw50zxjgCMfTzsbJywXSzwqGD2L0AcbLBxb0EsbSB2nHDg9Y','CMvSB2fK','Bgf1BMnO','zgvMAw5LuhjVCgvYDhK','z290BW','C2v0q29VA2LL','B3v0zxjive1m','tg9JyxrVCKvYCM9Y','vw5VDgvZDevYCM9Y','mtK4ode0mM1uyuvtuW','y29VA2LLCW','y2XPy2S','rhjPDMvYrxjYB3i','Bwf5yMvuAhjVDW','nvPfvujLCW','n05Tt3HHuq','mJDHAfDuBwS','Dgv4DenVBNrLBNq','D2fPDezVCK5HDMLNyxrPB24','Aw5ZCgvJDevSzw1LBNq','zhjHz0fUzerYB3a','C2nVCgu','BMv3q29UDgv4Da','C2v0tg9JywXtDg9YywDL','ndK5mZnvq0nbreG','zxHPDezYyw1LignHBgXLzcb3AxrOig5VigzYyw1Lig9UihrOzsbZDgfJAW','BM8Gywn0AxzLihbHz2uGAw4Gy29UDgv4Da','y291BNrcEurLzMf1Bhq','ChjLC3m','CgfNzsbPBMrLEcbVDxqGB2yGCMfUz2u','C2nYzwvUC2HVDa','y29UDgv4Dhm','Dgv4DenVBNrLBNrcEurLzMf1Bhq','A2LUza'];_0x2396=function(){return _0x131871;};return _0x2396();}function _0x1849(_0x7aeb19,_0xf1fe3f){_0x7aeb19=_0x7aeb19-0x14b;const _0x239656=_0x2396();let _0x1849f6=_0x239656[_0x7aeb19];if(_0x1849['swzEsR']===undefined){var _0x109bf8=function(_0x3a1cac){const _0x41d51a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5aabeb='',_0x498db2='';for(let _0x401f95=0x0,_0x566d17,_0x3acd30,_0x6a761a=0x0;_0x3acd30=_0x3a1cac['charAt'](_0x6a761a++);~_0x3acd30&&(_0x566d17=_0x401f95%0x4?_0x566d17*0x40+_0x3acd30:_0x3acd30,_0x401f95++%0x4)?_0x5aabeb+=String['fromCharCode'](0xff&_0x566d17>>(-0x2*_0x401f95&0x6)):0x0){_0x3acd30=_0x41d51a['indexOf'](_0x3acd30);}for(let _0x27a0a5=0x0,_0x8fc89=_0x5aabeb['length'];_0x27a0a5<_0x8fc89;_0x27a0a5++){_0x498db2+='%'+('00'+_0x5aabeb['charCodeAt'](_0x27a0a5)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x498db2);};_0x1849['usbhXU']=_0x109bf8,_0x1849['HyYyyB']={},_0x1849['swzEsR']=!![];}const _0x57126a=_0x239656[0x0],_0x4b26ba=_0x7aeb19+_0x57126a,_0x4463b8=_0x1849['HyYyyB'][_0x4b26ba];return!_0x4463b8?(_0x1849f6=_0x1849['usbhXU'](_0x1849f6),_0x1849['HyYyyB'][_0x4b26ba]=_0x1849f6):_0x1849f6=_0x4463b8,_0x1849f6;}var FakePage=class{constructor(_0x8fc89,_0xe0f5ff,_0x1fe8c2,_0x178297){const _0x53bc9d=_0x4a869d;this[_0x53bc9d(0x18f)]=_0x8fc89,this['behavior']=_0xe0f5ff,this[_0x53bc9d(0x17b)]=_0x1fe8c2,this['currentUrl']=_0x178297;}['recorder'];[_0x4a869d(0x195)];['scope'];static{__name(this,_0x4a869d(0x19d));}['currentUrl'];[_0x4a869d(0x189)];[_0x4a869d(0x152)](_0x34201b,_0x57624d){const _0x366003=_0x4a869d;this['recorder']['push']({'scope':this[_0x366003(0x17b)],'method':_0x34201b,'args':_0x57624d});}[_0x4a869d(0x173)](){const _0x158a51={_0x4c5c25:0x195},_0x381121=_0x4a869d;if(this[_0x381121(_0x158a51._0x4c5c25)]['errorOnNextAction']){const _0xef1419=this[_0x381121(0x195)]['errorOnNextAction'];this[_0x381121(0x195)][_0x381121(0x1a8)]=void 0x0;throw _0xef1419;}}['url'](){const _0x20ae33=_0x4a869d;return this[_0x20ae33(0x19b)];}async[_0x4a869d(0x155)](){const _0x55d067=_0x4a869d;return this[_0x55d067(0x152)](_0x55d067(0x155),[]),'fake\x20title';}async[_0x4a869d(0x171)](_0x3e616e,_0x1eead9){const _0x30d5f0={_0x593a12:0x152,_0x1f3e93:0x173},_0x378d41=_0x4a869d;this[_0x378d41(_0x30d5f0._0x593a12)](_0x378d41(0x171),[_0x3e616e,_0x1eead9]),this[_0x378d41(_0x30d5f0._0x1f3e93)](),this[_0x378d41(0x189)]?.();}async[_0x4a869d(0x197)](_0x4262f6,_0x199ec3){const _0x5d9328=_0x4a869d;this[_0x5d9328(0x152)](_0x5d9328(0x197),[_0x4262f6,_0x199ec3]),this['maybeThrow']();}async[_0x4a869d(0x156)](_0x45aa88,_0x5c2ce2,_0x4ce986){const _0x156ac6={_0x562473:0x156,_0x3047ee:0x173},_0x380c8a=_0x4a869d;this[_0x380c8a(0x152)](_0x380c8a(_0x156ac6._0x562473),[_0x45aa88,_0x5c2ce2,_0x4ce986]),this[_0x380c8a(_0x156ac6._0x3047ee)]();}async[_0x4a869d(0x182)](_0x4dc11c,_0x21ca02,_0xc5b8e3){const _0x217ef1={_0x1b5116:0x152,_0x47c756:0x182,_0x3a3eeb:0x173},_0x1d5f0c=_0x4a869d;this[_0x1d5f0c(_0x217ef1._0x1b5116)](_0x1d5f0c(_0x217ef1._0x47c756),[_0x4dc11c,_0x21ca02,_0xc5b8e3]),this[_0x1d5f0c(_0x217ef1._0x3a3eeb)]();}async[_0x4a869d(0x188)](_0x4530a8,_0x149c0d){const _0x499898={_0x1bdc63:0x188,_0x30e934:0x173},_0x1bae68=_0x4a869d;this[_0x1bae68(0x152)](_0x1bae68(_0x499898._0x1bdc63),[_0x4530a8,_0x149c0d]),this[_0x1bae68(_0x499898._0x30e934)]();}async[_0x4a869d(0x1ac)](_0x2aa561,_0x51ef47){const _0x25f770=_0x4a869d;this[_0x25f770(0x152)]('uncheck',[_0x2aa561,_0x51ef47]),this[_0x25f770(0x173)]();}async['selectOption'](_0x39e353,_0x10713f,_0x4b1039){const _0x4e9b40={_0x8efbd6:0x173},_0x39e794=_0x4a869d;this[_0x39e794(0x152)]('selectOption',[_0x39e353,_0x10713f,_0x4b1039]),this[_0x39e794(_0x4e9b40._0x8efbd6)]();}async[_0x4a869d(0x1a9)](_0x5ed490,_0x4a73e4){const _0x45814e={_0x42e454:0x1a9,_0x3294e4:0x173},_0x334d4f=_0x4a869d;this[_0x334d4f(0x152)](_0x334d4f(_0x45814e._0x42e454),[_0x5ed490,_0x4a73e4]),this[_0x334d4f(_0x45814e._0x3294e4)]();}async[_0x4a869d(0x14b)](_0x5cf9c1){const _0x4155a9={_0x368e33:0x152,_0x1362db:0x173},_0x27440c=_0x4a869d;this[_0x27440c(_0x4155a9._0x368e33)](_0x27440c(0x14b),[_0x5cf9c1]),this[_0x27440c(_0x4155a9._0x1362db)]();}async[_0x4a869d(0x17a)](_0x1d08ca,_0x28c85e,_0x1cbc68){const _0x34d46e=_0x4a869d;this['record'](_0x34d46e(0x17a),[_0x1d08ca,_0x28c85e,_0x1cbc68]),this['maybeThrow']();}async[_0x4a869d(0x1a3)](_0x2af61c,_0x580dfb){const _0x2a8f33={_0x5aa9c6:0x152},_0x52a543=_0x4a869d;this[_0x52a543(_0x2a8f33._0x5aa9c6)](_0x52a543(0x1a3),[_0x2af61c,_0x580dfb]),this['maybeThrow']();}async['clipboardPaste'](_0x481c82,_0x4ec792){const _0x5b7127={_0x1e9ec7:0x173},_0x526b6a=_0x4a869d;this[_0x526b6a(0x152)]('clipboardPaste',[_0x481c82,_0x4ec792]),this[_0x526b6a(_0x5b7127._0x1e9ec7)]();}async[_0x4a869d(0x18c)](_0x132d76){const _0xaf85a1={_0x1ff5ec:0x18c,_0x57bde1:0x181},_0x433960=_0x4a869d;return this[_0x433960(0x152)](_0x433960(_0xaf85a1._0x1ff5ec),[_0x132d76]),this[_0x433960(0x195)][_0x433960(_0xaf85a1._0x57bde1)]??0x1;}async[_0x4a869d(0x177)](_0xf78a67){const _0x277ec3=_0x4a869d;return this['record'](_0x277ec3(0x177),[_0xf78a67]),this['behavior'][_0x277ec3(0x186)]??'';}async[_0x4a869d(0x1ae)](_0x192c1c){const _0xe72aad=_0x4a869d;return this[_0xe72aad(0x152)](_0xe72aad(0x1ae),[_0x192c1c]),this[_0xe72aad(0x195)][_0xe72aad(0x1a4)]??'';}async['isVisible'](_0x38a764){const _0x5ca15f={_0x1acc53:0x152},_0x4cd16a=_0x4a869d;return this[_0x4cd16a(_0x5ca15f._0x1acc53)](_0x4cd16a(0x159),[_0x38a764]),this[_0x4cd16a(0x195)][_0x4cd16a(0x1b2)]??!![];}async[_0x4a869d(0x1b4)](_0x4fa1c4,_0x5ee643){const _0x456ed4={_0x3715a0:0x195},_0x5d3cf7=_0x4a869d;return this['record']('getAttribute',[_0x4fa1c4,_0x5ee643]),this[_0x5d3cf7(_0x456ed4._0x3715a0)][_0x5d3cf7(0x19e)]?.[_0x5ee643]??null;}async[_0x4a869d(0x163)](_0x18b069,_0x24bf1b){const _0x374e03=_0x4a869d;this['record'](_0x374e03(0x163),[_0x18b069,_0x24bf1b]);}async[_0x4a869d(0x1b6)](_0x59a135,_0x5f2597){this['record']('waitForUrl',[_0x59a135,_0x5f2597]);}async[_0x4a869d(0x1ba)](_0x2620ed,_0x467e31){const _0xeb96ae={_0x266a7a:0x152},_0x23d055=_0x4a869d;this[_0x23d055(_0xeb96ae._0x266a7a)]('waitForText',[_0x2620ed,_0x467e31]);}async[_0x4a869d(0x178)](_0x4d156f){const _0x389016={_0x50657a:0x178},_0x2290ed=_0x4a869d;this['record'](_0x2290ed(_0x389016._0x50657a),[_0x4d156f]);}async[_0x4a869d(0x16a)](_0x1d5838,_0x989e3c){const _0x312b3d={_0x531045:0x152,_0x1d9918:0x19b},_0x322995=_0x4a869d;this[_0x322995(_0x312b3d._0x531045)](_0x322995(0x16a),[_0x1d5838,_0x989e3c]),this[_0x322995(_0x312b3d._0x1d9918)]=_0x1d5838;}async[_0x4a869d(0x167)](_0x1eb4d8){const _0x408f5d={_0x2b2476:0x152,_0x3416d6:0x167},_0x52abe8=_0x4a869d;this[_0x52abe8(_0x408f5d._0x2b2476)](_0x52abe8(_0x408f5d._0x3416d6),[_0x1eb4d8]);}async[_0x4a869d(0x18b)](_0x2fd3a6){const _0x321369=_0x4a869d;this['record'](_0x321369(0x18b),[_0x2fd3a6]);}async['goForward'](_0x4b1eef){const _0x2ee767={_0xb1425c:0x152},_0x168776=_0x4a869d;this[_0x168776(_0x2ee767._0xb1425c)](_0x168776(0x18e),[_0x4b1eef]);}async[_0x4a869d(0x14f)](_0x1eb53d){const _0x42632f={_0x390b3e:0x152,_0x226da5:0x14f},_0x517b19=_0x4a869d;return this[_0x517b19(_0x42632f._0x390b3e)](_0x517b19(_0x42632f._0x226da5),[_0x1eb53d]),void 0x0;}async['evaluateOnLocator'](_0x30cd0b,_0x4c4879){const _0x2fe89c=_0x4a869d;return this[_0x2fe89c(0x152)]('evaluateOnLocator',[_0x30cd0b,_0x4c4879]),void 0x0;}async[_0x4a869d(0x179)](_0x7571b4){const _0xa5a469={_0x56c691:0x152,_0x259af6:0x1b8,_0x524820:0x195},_0x477eb4=_0x4a869d;this[_0x477eb4(_0xa5a469._0x56c691)]('inspectElement',[_0x7571b4]);if(_0x7571b4[_0x477eb4(0x164)]['length']!==0x1||_0x7571b4[_0x477eb4(0x164)][0x0][_0x477eb4(0x187)]!==_0x477eb4(_0xa5a469._0x259af6))return null;const _0x6ed100=_0x7571b4[_0x477eb4(0x164)][0x0][_0x477eb4(_0xa5a469._0x259af6)],_0x1fe540=this[_0x477eb4(_0xa5a469._0x524820)]['elementHintByRef']?.[_0x6ed100];return _0x1fe540??null;}async[_0x4a869d(0x184)](_0x41b579){const _0x125df5={_0x40d5e2:0x15b},_0x2cfeed=_0x4a869d;return this[_0x2cfeed(0x152)](_0x2cfeed(0x184),[_0x41b579]),Buffer['from'](_0x2cfeed(_0x125df5._0x40d5e2));}async[_0x4a869d(0x16c)](_0x25cf89){const _0x1a8fc9={_0x46da18:0x152,_0x173398:0x157},_0x359f51=_0x4a869d;this[_0x359f51(_0x1a8fc9._0x46da18)](_0x359f51(0x16c),[_0x25cf89]);if(_0x25cf89[_0x359f51(0x164)]['length']===0x1&&_0x25cf89[_0x359f51(0x164)][0x0][_0x359f51(0x187)]===_0x359f51(0x1b8)){const _0x4e7e93=_0x25cf89[_0x359f51(0x164)][0x0][_0x359f51(0x1b8)];return this['behavior'][_0x359f51(_0x1a8fc9._0x173398)]?.[_0x4e7e93]??_0x359f51(0x160)+_0x4e7e93+'\x22></div>';}return'<div></div>';}},FakeContext=class{constructor(_0x4cb42a,_0x5616af,_0x43e542){const _0x206720={_0x123ae2:0x17b,_0x301482:0x1a2,_0x4b7d18:0x19f,_0x3e4677:0x191},_0x650591={_0x378692:0x1b9},_0x1b4ffd=_0x4a869d;this[_0x1b4ffd(0x18f)]=_0x4cb42a,this['behavior']=_0x5616af,this[_0x1b4ffd(_0x206720._0x123ae2)]=_0x43e542;const _0x5653e3=new FakePage(_0x4cb42a,_0x5616af,_0x43e542+_0x1b4ffd(0x15f),_0x5616af[_0x1b4ffd(_0x206720._0x301482)]??_0x1b4ffd(0x1ab));_0x5616af[_0x1b4ffd(0x1b9)]&&(_0x5653e3[_0x1b4ffd(0x189)]=()=>{const _0x19561d=_0x1b4ffd;this[_0x19561d(0x150)](_0x5616af[_0x19561d(_0x650591._0x378692)]);}),this[_0x1b4ffd(_0x206720._0x4b7d18)]=[_0x5653e3],this[_0x1b4ffd(_0x206720._0x3e4677)]={..._0x5616af[_0x1b4ffd(0x14e)]??{}},this['cookieState']={..._0x5616af[_0x1b4ffd(0x170)]??{}};}[_0x4a869d(0x18f)];['behavior'];[_0x4a869d(0x17b)];static{__name(this,_0x4a869d(0x1ad));}['pageList'];['activeIdx']=0x0;['frameStack']=[];[_0x4a869d(0x191)];[_0x4a869d(0x158)];['newPageListeners']=new Set();[_0x4a869d(0x152)](_0x3089e0,_0x365cc4){const _0x145bb7={_0x35b46f:0x18f,_0x4cfc08:0x1b1},_0x22bcd4=_0x4a869d;this[_0x22bcd4(_0x145bb7._0x35b46f)][_0x22bcd4(_0x145bb7._0x4cfc08)]({'scope':this[_0x22bcd4(0x17b)],'method':_0x3089e0,'args':_0x365cc4});}[_0x4a869d(0x1a5)](){const _0x18cd1b=_0x4a869d;return this[_0x18cd1b(0x19f)];}[_0x4a869d(0x190)](){const _0x3f1fe2={_0x325362:0x180},_0x1401de=_0x4a869d,_0x1144ec=this[_0x1401de(0x19f)][this['activeIdx']];if(!_0x1144ec)throw new DriverError(_0x1401de(_0x3f1fe2._0x325362),{'activeIdx':this[_0x1401de(0x151)]});return _0x1144ec;}['consoleEntries'](){const _0x363867={_0xb68e54:0x195,_0x4e631d:0x15c},_0x347dd6=_0x4a869d;return this[_0x347dd6(_0x363867._0xb68e54)][_0x347dd6(_0x363867._0x4e631d)]??[];}async[_0x4a869d(0x198)](_0x3885e2){const _0x15908f={_0x42f0e3:0x152,_0x3febca:0x198,_0x1a8d7b:0x19f,_0x1f7229:0x19c},_0x4cacd8=_0x4a869d;this[_0x4cacd8(_0x15908f._0x42f0e3)](_0x4cacd8(_0x15908f._0x3febca),[_0x3885e2]);if(_0x3885e2<0x0||_0x3885e2>=this[_0x4cacd8(_0x15908f._0x1a8d7b)][_0x4cacd8(0x19c)])throw new DriverError(_0x4cacd8(0x183),{'index':_0x3885e2,'available':this['pageList'][_0x4cacd8(0x19c)]});this[_0x4cacd8(0x151)]=_0x3885e2,this['frameStack'][_0x4cacd8(_0x15908f._0x1f7229)]=0x0;}['onNewPage'](_0x4ed811){const _0x194f23={_0x4f5411:0x1b0},_0x2ad4e7={_0x5aa6ab:0x15d},_0xba1db7=_0x4a869d;return this[_0xba1db7(0x15d)][_0xba1db7(_0x194f23._0x4f5411)](_0x4ed811),()=>{const _0x17147c=_0xba1db7;this[_0x17147c(_0x2ad4e7._0x5aa6ab)][_0x17147c(0x1b3)](_0x4ed811);};}['emitFakePopup'](_0x3378b3){const _0x2ea93f={_0x2dd852:0x195,_0xa900fe:0x19f},_0x31aa08=_0x4a869d,_0x190b51=this[_0x31aa08(0x17b)]+'.page'+this['pageList'][_0x31aa08(0x19c)],_0x2aaa8d=new FakePage(this[_0x31aa08(0x18f)],this[_0x31aa08(_0x2ea93f._0x2dd852)],_0x190b51,_0x3378b3);this['pageList']['push'](_0x2aaa8d);const _0x1be337=this[_0x31aa08(_0x2ea93f._0xa900fe)]['length']-0x1;for(const _0x548127 of this[_0x31aa08(0x15d)]){try{_0x548127({'index':_0x1be337,'url':_0x3378b3});}catch{}}return _0x1be337;}async['enterFrame'](_0xdad943){const _0x1a52bf={_0x48c368:0x152,_0x3c4b79:0x166,_0x1a09d9:0x1b1},_0x3d5f26=_0x4a869d;this[_0x3d5f26(_0x1a52bf._0x48c368)]('enterFrame',[_0xdad943]);if(!_0xdad943[_0x3d5f26(0x164)]['length'])throw new LocatorError(_0x3d5f26(_0x1a52bf._0x3c4b79),{'locator':_0xdad943});this[_0x3d5f26(0x1af)][_0x3d5f26(_0x1a52bf._0x1a09d9)](_0xdad943);}async[_0x4a869d(0x19a)](){const _0x4d8ff3={_0x323c5c:0x19c},_0xf6146b=_0x4a869d;this['record']('exitFrame',[]);if(this['frameStack'][_0xf6146b(_0x4d8ff3._0x323c5c)]===0x0)throw new DriverError(_0xf6146b(0x17f),{});this[_0xf6146b(0x1af)]['pop']();}async[_0x4a869d(0x17d)](_0x427c68,_0x4035cf){const _0x4e8a1f=_0x4a869d;this[_0x4e8a1f(0x152)](_0x4e8a1f(0x17d),[_0x427c68,_0x4035cf]),this[_0x4e8a1f(0x191)][_0x427c68]=_0x4035cf;}async[_0x4a869d(0x154)](_0x2ab06d){const _0x4b75c6={_0x478a3d:0x154,_0x7c1ad3:0x191},_0x28948b=_0x4a869d;return this[_0x28948b(0x152)](_0x28948b(_0x4b75c6._0x478a3d),[_0x2ab06d]),this[_0x28948b(_0x4b75c6._0x7c1ad3)][_0x2ab06d]??null;}async[_0x4a869d(0x16b)](_0x1061af,_0x3a22d7,_0x13ed29){const _0x2a2734={_0x192c9e:0x16b,_0x428feb:0x158},_0x20c2cf=_0x4a869d;this['record'](_0x20c2cf(_0x2a2734._0x192c9e),[_0x1061af,_0x3a22d7,_0x13ed29]),this[_0x20c2cf(_0x2a2734._0x428feb)][_0x1061af]=_0x3a22d7;}async[_0x4a869d(0x192)](_0x57443c){const _0x115cf9={_0x4132ca:0x152,_0x40e839:0x158},_0x18f794=_0x4a869d;return this[_0x18f794(_0x115cf9._0x4132ca)](_0x18f794(0x192),[_0x57443c]),this[_0x18f794(_0x115cf9._0x40e839)][_0x57443c]??null;}async['saveStorageState'](_0x4f87ad){const _0x3031f7={_0x4f3fa9:0x152,_0x363e23:0x18d},_0x8fc42b=_0x4a869d;this[_0x8fc42b(_0x3031f7._0x4f3fa9)](_0x8fc42b(_0x3031f7._0x363e23),[_0x4f87ad]);}async[_0x4a869d(0x14f)](_0x1c8192){const _0x48f45e={_0x29c44c:0x152,_0x82bde8:0x14f},_0x176dd8=_0x4a869d;return this[_0x176dd8(_0x48f45e._0x29c44c)](_0x176dd8(_0x48f45e._0x82bde8),[_0x1c8192]),void 0x0;}async[_0x4a869d(0x14c)](){const _0x2cc963={_0x229544:0x152,_0x122612:0x14c},_0x1a5586=_0x4a869d;this[_0x1a5586(_0x2cc963._0x229544)](_0x1a5586(_0x2cc963._0x122612),[]);}[_0x4a869d(0x1b7)](){const _0x3b161f={_0x28ff8b:0x19c},_0x50404f=_0x4a869d;return this['frameStack'][_0x50404f(_0x3b161f._0x28ff8b)];}},FakeWebDriver=class{constructor(_0x212e17={}){const _0x2dc1cd={_0x152538:0x18f},_0x1879a4=_0x4a869d;this[_0x1879a4(0x195)]=_0x212e17,this[_0x1879a4(_0x2dc1cd._0x152538)]=createRecorder();}[_0x4a869d(0x195)];static{__name(this,_0x4a869d(0x1a1));}['launched']=![];[_0x4a869d(0x18f)];['contexts']=[];async[_0x4a869d(0x168)](_0x1bc443){const _0x1985ba={_0x5cfec3:0x18f,_0x3f1cef:0x1b1,_0x151601:0x194},_0x325ef4=_0x4a869d;this[_0x325ef4(_0x1985ba._0x5cfec3)][_0x325ef4(_0x1985ba._0x3f1cef)]({'scope':_0x325ef4(_0x1985ba._0x151601),'method':_0x325ef4(0x168),'args':[_0x1bc443]}),this[_0x325ef4(0x162)]=!![];}async[_0x4a869d(0x17c)](_0x394dea){const _0x4dd9d3={_0x142c85:0x18f,_0x1cb40d:0x162},_0x1cb90e=_0x4a869d;this[_0x1cb90e(_0x4dd9d3._0x142c85)][_0x1cb90e(0x1b1)]({'scope':'driver','method':'newContext','args':[_0x394dea]});if(!this[_0x1cb90e(_0x4dd9d3._0x1cb40d)])throw new DriverError(_0x1cb90e(0x15e),{});const _0x5bae8c=new FakeContext(this[_0x1cb90e(0x18f)],this[_0x1cb90e(0x195)],'ctx'+this[_0x1cb90e(0x185)][_0x1cb90e(0x19c)]);return this['contexts'][_0x1cb90e(0x1b1)](_0x5bae8c),_0x5bae8c;}async[_0x4a869d(0x14c)](){const _0xdb03c7=_0x4a869d;this['recorder']['push']({'scope':_0xdb03c7(0x194),'method':_0xdb03c7(0x14c),'args':[]}),this[_0xdb03c7(0x162)]=![];}['calls'](){return this['recorder']['calls']();}['callsFor'](_0x3159bf){const _0x5b1ff3={_0x432ab5:0x18f},_0x2e4324=_0x4a869d;return this[_0x2e4324(_0x5b1ff3._0x432ab5)][_0x2e4324(0x15a)]()['filter'](_0xb62e31=>_0xb62e31[_0x2e4324(0x1aa)]===_0x3159bf);}};export{FakeWebDriver};