shiplightai 0.1.8 → 0.1.9
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.
- package/README.md +2 -2
- package/dist/agentHelpers-D7J2XAZP.js +3 -0
- package/dist/agentLogin-B2LX5FIY.js +3 -0
- package/dist/chunk-2N37B5MX.js +5 -0
- package/dist/{chunk-437WOFND.js → chunk-5P7PVDTU.js} +1 -1
- package/dist/chunk-7IODNB46.js +31 -0
- package/dist/chunk-A2VNNKWB.js +18 -0
- package/dist/chunk-BVOD5VWH.js +16 -0
- package/dist/chunk-CSINHOOD.js +3 -0
- package/dist/chunk-FBJSHHRD.js +3 -0
- package/dist/chunk-FL4TL6US.js +58 -0
- package/dist/chunk-FPNAM4ZH.js +3 -0
- package/dist/chunk-OPPQ2WGO.js +61 -0
- package/dist/chunk-PUJJ3P7V.js +183 -0
- package/dist/chunk-RZSEU5IV.js +230 -0
- package/dist/chunk-STSHJEMG.js +3 -0
- package/dist/chunk-SWUSVR2K.js +30 -0
- package/dist/chunk-WMT4NNJ7.js +3975 -0
- package/dist/chunk-Y2QWBQXE.js +8 -0
- package/dist/chunk-YU3XZJIJ.js +3 -0
- package/dist/cjs/fixture.cjs +4782 -7
- package/dist/cjs/index.cjs +4789 -14
- package/dist/cli.js +591 -580
- package/dist/dist-C4DHE5UP.js +3 -0
- package/dist/dist-DAIQ7AOS.js +14 -0
- package/dist/dist-XWQBGCVL.js +3 -0
- package/dist/fileFromPath-ROF7A3FH.js +3 -0
- package/dist/fixture.d.ts +1 -1
- package/dist/fixture.js +1 -1
- package/dist/handler-SATFK5LZ.js +3 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -6
- package/dist/multipart-parser-IEIT2KXO.js +4 -0
- package/dist/src-2RQUBO3W.js +5 -0
- package/dist/task-26SVPHLF.js +192 -0
- package/dist/token-HZZUEE35.js +3 -0
- package/dist/token-util-7HVAYCG2.js +3 -0
- package/package.json +18 -20
- package/dist/dist-QV5DG3DA.js +0 -3
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ AI-powered execution with self-healing locators means near-zero maintenance —
|
|
|
11
11
|
### 1. Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install -D shiplightai @
|
|
14
|
+
npm install -D shiplightai @playwright/test
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
### 2. Configure
|
|
@@ -319,7 +319,7 @@ This means you can use `shiplight.config.json` for local development and overrid
|
|
|
319
319
|
|
|
320
320
|
1. `shiplightConfig()` scans for `shiplight.config.json` files with credentials and generates `auth.setup.ts` next to each
|
|
321
321
|
2. Playwright runs the setup project before dependent projects
|
|
322
|
-
3. The AI agent logs in using
|
|
322
|
+
3. The AI agent logs in using `shiplightai`'s `WebAgent.loginPage()` — no fragile selectors
|
|
323
323
|
4. The resulting cookies/localStorage are saved to `<dir>/.auth/storage-state.json`
|
|
324
324
|
5. All tests in the dependent project load this storage state — every test starts already authenticated
|
|
325
325
|
6. Each directory is self-contained: its own credentials, its own auth state, its own setup
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import{d as t,e as o,f as r,g as p,h as i}from"./chunk-RZSEU5IV.js";import"./chunk-WMT4NNJ7.js";import"./chunk-2N37B5MX.js";import"./chunk-BVOD5VWH.js";import"./chunk-FBJSHHRD.js";import"./chunk-A2VNNKWB.js";import"./chunk-STSHJEMG.js";import"./chunk-YU3XZJIJ.js";import"./chunk-CSINHOOD.js";export{p as evaluateStatement,t as executeAction,r as executeStep,o as generateActionStep,i as runTask};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import{j as a,m as o,n as t,o as s,p as e,q as i,r}from"./chunk-OPPQ2WGO.js";import"./chunk-FL4TL6US.js";import"./chunk-BVOD5VWH.js";import"./chunk-FBJSHHRD.js";import"./chunk-CSINHOOD.js";export{a as LoginType,o as checkLocators,e as createUnsignedInContext,r as generateAndValidateLoginLocators,i as generateValidationLocators,s as validateLogin,t as validateLoginLocators};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "module";
|
|
2
|
+
const require = __createRequire(import.meta.url);
|
|
3
|
+
import{a as u,d as f,e as h}from"./chunk-FBJSHHRD.js";var $=class{getLevel(){return u.get("logLevel")}debug(...t){this.getLevel()<=0&&console.debug("[DEBUG]",...t)}info(...t){this.getLevel()<=1&&console.log("[INFO]",...t)}log(...t){this.info(...t)}warn(...t){this.getLevel()<=2&&console.warn("[WARN]",...t)}error(...t){this.getLevel()<=3&&console.error("[ERROR]",...t)}setLevel(t){u.set("logLevel",t)}},x=new $,i=x;var b={};h(b,{ACTION_TIMEOUT:()=>m,GOTO_TIMEOUT:()=>d,LOCATOR_TIMEOUT:()=>c,getLocator:()=>v,getMinimalActionEntity:()=>E,getPageLocatorExpression:()=>g,sanitizeForComment:()=>L});function L(t){return t.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").trim()}function v(t,e){let a=g(e);return a?new Function("page",`return ${a}`)(t):null}function E(t){let e={action_data:t.action_data};return t.locator&&(e.locator=t.locator),t.xpath&&(e.xpath=t.xpath),t.frame_path&&(e.frame_path=t.frame_path),e}function _(t){let e=t.frame_path;return!e||e.length===0?"page":`page.frameLocator('${e[0]}')`}function O(t){let e=t.xpath;return typeof e=="string"&&e.trim()?!e.startsWith("xpath=")&&!e.startsWith("/")&&!e.startsWith("//")?`xpath=//${e}`:e.startsWith("xpath=")?e:`xpath=${e}`:null}function g(t){let e=_(t),a=t.locator;if(typeof a=="string"&&a.trim())return a=a.trim(),a.endsWith("first()")?`${e}.${a}`:`${e}.${a}.first()`;let r=O(t);if(r){let n=JSON.stringify(r);return`${e}.locator(${n}).first()`}return null}var c,m,d,y=f(()=>{c=5e3,m=5e3,d=1e4});y();async function p(t,e,a=[]){try{let r=t;for(let o of a)r=r.frameLocator(o);let n=await r.locator(`xpath=${e}`).elementHandle({timeout:c});if(!n)return i.warn(`Could not find element with xpath: ${e}`),null;let l=await t.evaluate(o=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(o):null,n);return await n.dispose(),l?(i.debug(`Generated locator for ${e}: ${l}`),l):(i.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(r){return i.error(`Error in pickBestLocator: ${r}`),null}}async function C(t,e){try{let a=await t.evaluate(r=>typeof playwright<"u"&&playwright.generateLocator?playwright.generateLocator(r):null,e);return await e.dispose(),a?(i.debug(`Generated locator: ${a}`),a):(i.debug("playwright.generateLocator is not available (PWDEBUG=console not set), using xpath fallback"),null)}catch(a){return i.error(`Error in pickBestLocator: ${a}`),null}}async function R(t,e){let a=new Map;return await Promise.all(e.map(async r=>{let n=await p(t,r);a.set(r,n)})),a}async function z(t,e){if(e<0)return;let{page:a,domService:r}=t;return(t.domState||await r.getClickableElements(a)).selectorMap.get(e)}function T(t){let e=t.split("/").filter(n=>n);if(e.length===0)return"*";let a=e[e.length-1],r=a.match(/^(\w+)(?:\[(\d+)\])?$/);if(r){let[,n,l]=r;return l?`${n}:nth-of-type(${l})`:n}return a}function W(t,e=!0){try{let a=T(t.xpath);if(t.attributes.class&&e){let n=/^[a-zA-Z_][a-zA-Z0-9_-]*$/,l=t.attributes.class.split(/\s+/);for(let o of l)o.trim()&&n.test(o)&&(a+=`.${o}`)}let r=new Set(["id","name","type","placeholder","aria-label","aria-labelledby","aria-describedby","role","for","autocomplete","required","readonly","alt","title","target"]);e&&["data-id","data-qa","data-cy","data-testid","data-handlepos"].forEach(n=>r.add(n));for(let[n,l]of Object.entries(t.attributes)){if(n==="class"||!n.trim()||!r.has(n))continue;let o=n.replace(/:/g,"\\:");if(l==="")a+=`[${o}]`;else if(/["'<>`\n\r\t]/.test(l)){let s=l;l.includes(`
|
|
4
|
+
`)&&(s=l.split(`
|
|
5
|
+
`)[0]),s=s.replace(/\s+/g," ").trim();let w=s.replace(/"/g,'\\"');a+=`[${o}*="${w}"]`}else a+=`[${o}="${l}"]`}return a}catch{return`${t.tagName||"*"}[highlight_index='${t.highlightIndex}']`}}function A(t){let e=[],a=t;for(;a&&a.parent!==null;){let l=a.parent;e.push(l),a=l}e.reverse();let r=[],n=e.filter(l=>l.tagName==="iframe");for(let l of n){let o=W(l,!0);r.push(o)}return r}async function D(t,e){let a=null,r=A(e);return e.xpath&&(a=await p(t,e.xpath)),{locator:a||void 0,xpath:e.xpath,frame_path:r}}export{i as a,b,v as c,g as d,m as e,d as f,y as g,p as h,C as i,R as j,z as k,A as l,D as m};
|
|
@@ -14,4 +14,4 @@ await page.waitForTimeout(2000);
|
|
|
14
14
|
`,e+=` // Goal:
|
|
15
15
|
`;let r=i.trim().split(`
|
|
16
16
|
`);for(let o of r)e+=` // ${o}
|
|
17
|
-
`;return e}generatePostlude(){return""}};var Le=[/iphone/i,/ipad/i,/android/i,/pixel/i,/galaxy/i,/mobile/i,/nexus/i,/blackberry/i,/kindle/i];function xe(e){if(!e)return"desktop";for(let i of Le)if(i.test(e))return"mobile";return"desktop"}function Ie(e,i){if(!e||typeof e!="string")return e;let t=i instanceof Map?Object.fromEntries(i):i,r=n=>{let s=n.startsWith("$")?n.slice(1):n,l=t[s]??t[`$${s}`];return l!=null?String(l):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(n,s)=>{let l=r(s.trim());return l!==void 0?l:n}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(n,s)=>{let l=r(s);return l!==void 0?l:n}),o=o.replace(/\$\{([^}]+)\}/g,(n,s)=>{let l=r(s.trim());return l!==void 0?l:n}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(n,s)=>{let l=r(s);return l!==void 0?l:n}),o}var S="android:",M="ios:";function De(e){return e?e.startsWith(S)?"android":e.startsWith(M)?"ios":"web":"web"}function We(e){return e?e.startsWith(S)||e.startsWith(M):!1}function Ce(e){return!!e&&e.startsWith(S)}function Ke(e){return!!e&&e.startsWith(M)}function Ge(e){return e.startsWith(S)?e.slice(S.length):e.startsWith(M)?e.slice(M.length):e}function Be(e){return`${S}${e}`}function Fe(e){return`${M}${e}`}function F(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function He(e){return e?!F(e):!1}function U(e){return e?F(e)?["web"]:["android","ios"]:["web","android","ios"]}function Ne(e,i){if(!i)return!0;let t=U(i);return e==="desktop"||e==="mobile"?t.includes("web"):t.includes(e)}function ze(e){return e.startsWith(M)?e:`${M}${e}`}function Re(e){let i=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${i} - Simulator`:`${e.name}${i}`}function Ve(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var X="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",H=112,$=1920,Y=1080,J=1920,j=1080-H,Z=1280,q=720,Q=500,ee=500,x="Desktop Chrome",ie=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(ie||{}),G={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}},te=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(te||{}),re={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},C=(e,i=!1)=>{let t=["chromium"];return i&&t.push("webkit"),re[e].map(r=>G[r]).filter(r=>r.defaultBrowserType&&t.includes(r.defaultBrowserType))},Ue=()=>Object.keys(G),B=e=>G[e],Xe={desktop:{label:"Desktop",type:"desktop",devices:C("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile")}},$e={desktop:{label:"Desktop",type:"desktop",devices:C("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile",!0)}},N=(e,i=!1)=>{let t={userAgent:X,viewport:{width:J,height:j},isMobile:!1,hasTouch:!1};if(!e||e===x)return t;let r=B(e);if(!r)return t;let{width:o,height:n}=r.viewport,s=Math.max(Q/o,1),l=Math.max(ee/n,1),c=Math.max(s,l),p={width:Math.round(o*c),height:Math.round(n*c)};return{userAgent:r.userAgent,viewport:i?p:r.viewport,isMobile:r.isMobile,hasTouch:r.hasTouch}},Ye=e=>{let i={width:$,height:Y};if(!e||e===x)return i;let t=N(e);return t.viewport?{width:t.viewport.width,height:t.viewport.height+H}:i},Je=e=>{let i={width:Z,height:q};if(!e||e===x)return i;let t=N(e);return t.viewport?{width:t.viewport.width,height:t.viewport.height}:i},je=e=>!e||e===x?void 0:B(e)?.channel,Ze=e=>!e||e===x?"chromium":B(e)?.defaultBrowserType??"chromium";var oe=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(oe||{}),ne=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(ne||{});import{z as a}from"zod";var ae=a.enum(["JS_CODE","AI_MODE"]),z=a.object({type:ae,expression:a.string()}),se=a.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),I=a.object({uid:a.string(),type:se}),le=a.object({action_data:a.object({action_name:a.string(),kwargs:a.record(a.any()).optional(),args:a.array(a.any()).optional()}),action_description:a.string().optional(),url:a.string().optional(),xpath:a.string().nullable().optional(),locator:a.string().nullable().optional(),css_selector:a.string().nullable().optional(),unique_selector:a.string().nullable().optional(),element_index:a.number().nullable().optional(),frame_path:a.array(a.any()).optional(),artifacts:a.record(a.any()).optional(),feedback:a.string().optional(),original_browser_use_action:a.any().optional()}).passthrough(),ce=I.extend({type:a.literal("DRAFT"),description:a.string()}),he=I.extend({type:a.literal("ACTION"),description:a.string(),action_entity:le.optional(),locator:a.string().optional(),use_pure_vision:a.boolean().optional()}),k=a.lazy(()=>a.union([ce,he,I.extend({type:a.literal("STEP"),description:a.string().optional().default(""),statements:a.array(k),reference_id:a.number().optional()}),I.extend({type:a.literal("IF_ELSE"),description:a.string().optional(),condition:z,then:a.array(k),else:a.array(k).optional()}),I.extend({type:a.literal("WHILE_LOOP"),description:a.string().optional(),condition:z,body:a.array(k),timeout_ms:a.number().optional()})])),R=a.object({version:a.string().optional(),goal:a.string(),url:a.string(),final_feedback:a.string().optional(),completed:a.boolean().optional(),success:a.boolean().optional(),statements:a.array(k),teardown:a.array(k).optional(),last_modified_at:a.string().optional()});import{stringify as qe,parse as de}from"yaml";import{v4 as v}from"uuid";function Qe(e,i){let t={...i?.test_case_id!==void 0?{test_case_id:i.test_case_id}:{},goal:e.goal,url:e.url,statements:e.statements.map(D)};return e.final_feedback&&(t.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(t.teardown=e.teardown.map(D)),qe(t,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"})}function D(e){switch(e.type){case"DRAFT":return ei(e);case"ACTION":return ii(e);case"STEP":return ri(e);case"IF_ELSE":return oi(e);case"WHILE_LOOP":return ni(e)}}function ei(e){return e.description}function ii(e){if((e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name)==="verify"){let n=(e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs)?.statement;if(typeof n=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return`VERIFY: ${n}`}if(!e.action_entity)return e.description;let t={description:e.description},r=ti(e.action_entity);return r&&(t.action_entity=r),e.locator&&(t.locator=e.locator),e.use_pure_vision&&(t.use_pure_vision=!0),t}function ti(e){let i={},t=!1,r=e.action_data??e.action;return r&&(i.action_data={action_name:r.action_name},r.kwargs&&Object.keys(r.kwargs).length>0&&(i.action_data.kwargs=r.kwargs),r.args&&r.args.length>0&&(i.action_data.args=r.args),t=!0),e.locator&&(i.locator=e.locator,t=!0),e.xpath&&(i.xpath=e.xpath,t=!0),t?i:void 0}function ri(e){let i={STEP:e.description,statements:e.statements.map(D)};return e.reference_id!==void 0&&(i.reference_id=e.reference_id),i}function oi(e){let i={IF:pe(e.condition),THEN:e.then.map(D)};return e.else&&e.else.length>0&&(i.ELSE=e.else.map(D)),i}function ni(e){let i={WHILE:pe(e.condition),DO:e.body.map(D)};return e.timeout_ms!==void 0&&(i.timeout_ms=e.timeout_ms),i}function pe(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function ai(e){try{let i=de(e);if(!i||typeof i!="object")return{};let t={};return typeof i.test_case_id=="number"&&Number.isFinite(i.test_case_id)&&(t.test_case_id=i.test_case_id),t}catch{return{}}}var ue=1024*1024;function si(e){if(e.length>ue)throw new Error(`YAML input too large (${e.length} bytes, max ${ue})`);let i=de(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let t={version:"1.2.0",goal:i.goal,url:i.url,statements:W(i.statements??[])};i.final_feedback&&(t.final_feedback=i.final_feedback),i.teardown&&Array.isArray(i.teardown)&&(t.teardown=W(i.teardown));let r=R.safeParse(t);if(!r.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(r.error.errors)}`);return r.data}function W(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(li)}function li(e){if(typeof e=="string")return ci(e);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected string or object, got ${typeof e}`);let i=e;if("IF"in i)return hi(i);if("WHILE"in i)return ui(i);if("STEP"in i)return di(i);if("action_entity"in i)return pi(i);if("description"in i&&typeof i.description=="string")return{uid:v(),type:"DRAFT",description:i.description};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(i)}`)}function ci(e){let i=e.match(/^VERIFY:\s*(.+)$/i);return i?{uid:v(),type:"ACTION",description:`Verify: ${i[1]}`,action_entity:{action_description:`Verify: ${i[1]}`,action_data:{action_name:"verify",kwargs:{statement:i[1]}}}}:{uid:v(),type:"DRAFT",description:e}}function fe(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function hi(e){let i=fe(e.IF),t=e.THEN;if(!Array.isArray(t))throw new Error("IF_ELSE requires a THEN array");let r={uid:v(),type:"IF_ELSE",condition:i,then:W(t)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(r.else=W(e.ELSE)),r}function ui(e){let i=fe(e.WHILE),t=e.DO;if(!Array.isArray(t))throw new Error("WHILE_LOOP requires a DO array");let r={uid:v(),type:"WHILE_LOOP",condition:i,body:W(t)};return typeof e.timeout_ms=="number"&&(r.timeout_ms=e.timeout_ms),r}function di(e){let i=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let t={uid:v(),type:"STEP",description:i,statements:W(e.statements)};return typeof e.reference_id=="number"&&(t.reference_id=e.reference_id),t}function pi(e){let i=typeof e.description=="string"?e.description:"",t=e.action_entity,r;t&&(r={action_description:i,...t});let o={uid:v(),type:"ACTION",description:i};return r&&(o.action_entity=r),typeof e.locator=="string"&&(o.locator=e.locator),typeof e.use_pure_vision=="boolean"&&(o.use_pure_vision=e.use_pure_vision),o}var b=e=>{let i=[];switch(e.type){case"STEP":e.statements&&i.push({key:"statements",statements:e.statements});break;case"IF_ELSE":e.then&&i.push({key:"then",statements:e.then}),e.else&&i.push({key:"else",statements:e.else});break;case"WHILE_LOOP":e.body&&i.push({key:"body",statements:e.body});break}return i},w=(e,i,t=void 0,r="root")=>{for(let o=0;o<e.length;o++){let n=e[o],s=n.uid;if(s===i)return{stableId:s,path:[o],statement:n,parent:t,containerKey:r,index:o};let l=b(n);for(let c of l){let p=w(c.statements,i,n,c.key);if(p)return{...p,path:[o,c.key,...p.path]}}}return null},E=(e,i,t)=>{let r=w(e,i);if(!r)return null;let{statement:o,parent:n,containerKey:s,index:l}=r,c=null;switch(o.type){case"DRAFT":case"ACTION":c=_(e,r)||O(e,r);break;case"STEP":if(o.statements&&o.statements.length>0)return o.statements[0];c=_(e,r)||O(e,r);break;case"IF_ELSE":if(t===!0&&o.then&&o.then.length>0)return o.then[0];if(t===!1&&o.else&&o.else.length>0)return o.else[0];c=_(e,r)||O(e,r);break;case"WHILE_LOOP":if(t===!0&&o.body&&o.body.length>0)return o.body[0];c=_(e,r)||O(e,r);break;default:c=_(e,r)||O(e,r);break}if(n&&n.type==="WHILE_LOOP"&&s==="body"){if(!c)return n;let p=w(e,c.uid);if(!p||p.parent!==n)return n}return c},_=(e,i)=>{if(!i.parent)return e[i.index+1]||null;let r=b(i.parent).find(o=>o.key===i.containerKey);return r&&i.index+1<r.statements.length?r.statements[i.index+1]:null},O=(e,i)=>{if(!i.parent)return null;let t=i.parent.uid,r=w(e,t);return r?_(e,r)||O(e,r):null},fi=e=>{let i=[],t=r=>{for(let o of r){i.push(o);let n=b(o);for(let s of n)t(s.statements)}};return t(e),i},mi=e=>{switch(e.type){case"DRAFT":case"ACTION":return!0;case"STEP":return!0;case"IF_ELSE":case"WHILE_LOOP":return!0;default:return!1}},wi=(e,i,t)=>{if(!w(e,i))return null;if(t===null){let l=[],c=i;for(;c!==null&&w(e,c);)if(l.push(c),c=E(e,c)?.uid||null,l.length>1e3)return null;return l}if(!w(e,t))return null;if(i===t)return[];let n=[],s=i;for(;s&&s!==t;){let l=w(e,s);if(!l)break;if(n.push(s),l.statement.type==="IF_ELSE"){let c=gi(l.statement,t);c?s=E(e,s,c==="then")?.uid||null:s=E(e,s)?.uid||null}else l.statement.type==="WHILE_LOOP"?Si(l.statement,t)?s=E(e,s,!0)?.uid||null:s=E(e,s,!1)?.uid||null:s=E(e,s)?.uid||null;if(n.length>1e3)return null}return s===t?n:null},gi=(e,i)=>{if(e.type!=="IF_ELSE")return null;let t=e;return t.then&&w(t.then,i)?"then":t.else&&w(t.else,i)?"else":null},Si=(e,i)=>{if(e.type!=="WHILE_LOOP")return!1;let t=e;return!!(t.body&&w(t.body,i))};function me(e){for(let i of e){if(i.type==="STEP"&&i.reference_id)return!0;let t=b(i);for(let r of t)if(me(r.statements))return!0}return!1}function Mi(e){let i=new Set;function t(r){for(let o of r){o.type==="STEP"&&o.reference_id&&i.add(o.reference_id);let n=b(o);for(let s of n)t(s.statements)}}return t(e),Array.from(i)}var Ti=e=>e.startsWith("ai_")?!0:["js_code","function","assert","verify","wait_for_download_complete","extract_activation_code","extract_email_content"].includes(e),Pi=e=>!["js_code","function","assert","ai_assert","verify","ai_extract","ai_wait_until","upload_file","login","extract_activation_code","extract_email_content","ai_step"].includes(e),L=(e,i,t)=>{e.forEach((r,o)=>{let n=`${i}.${o}`;r.type==="DRAFT"?t[n]={description:r.description||"Draft",action_entity:void 0}:r.type==="ACTION"?t[n]={description:r.description||"Action",action_entity:r.action_entity}:r.type==="STEP"&&r.statements?L(r.statements,n,t):r.type==="IF_ELSE"?(t[n]={description:"IF "+(r.condition?.expression||""),action_entity:void 0},r.then&&L(r.then,`${n}.then`,t),r.else&&L(r.else,`${n}.else`,t)):r.type==="WHILE_LOOP"&&(t[n]={description:"WHILE "+(r.condition?.expression||""),action_entity:void 0},r.body&&L(r.body,`${n}.body`,t))})};function bi(e){if(!e?.statements||!Array.isArray(e.statements))return{};let i={};return L(e.statements,"main",i),e.teardown&&Array.isArray(e.teardown)&&L(e.teardown,"teardown",i),i}function P(e,i,t){let r=e+".",o=i.filter(([h])=>h===e||h.startsWith(r));if(o.length===0)return[];let n=[],s=new Set;for(let[h]of o){let d=h===e?"":h.slice(r.length);if(!d)continue;let g=d.split(".")[0];s.has(g)||s.add(g)}let l=Array.from(s);l.sort((h,d)=>{let g=/^\d+$/.test(h)?parseInt(h,10):-1,y=/^\d+$/.test(d)?parseInt(d,10):-1;return g>=0&&y>=0?g-y:h==="then"&&d==="else"?-1:h==="else"&&d==="then"||h==="body"?1:d==="body"?-1:h.localeCompare(d)});function c(h){return t[h]}function p(h){let d=h.match(/^(IF|WHILE)\s+([\s\S]+)$/);return{type:"JS_CODE",expression:(d?d[2].trim():h)||"true"}}for(let h of l){let d=e?`${e}.${h}`:h,g=c(d),y=g?.description??"",Hi=d;if(h==="then"){let u=`${e}.then`,T=`${e}.else`,f=P(u,i,t),A=P(T,i,t),K=c(e),_e=K?p(K.description):{type:"JS_CODE",expression:"true"};n.push({uid:e,type:"IF_ELSE",condition:_e,then:f,...A.length>0?{else:A}:{}});continue}if(h==="else")continue;if(h==="body"){let u=`${e}.body`,T=P(u,i,t),f=c(e),A=f?p(f.description):{type:"JS_CODE",expression:"true"};n.push({uid:e,type:"WHILE_LOOP",condition:A,body:T});continue}let m=`${e}.${h}`,Ae=i.some(([u])=>u.startsWith(m+".then.")||u===m+".then"),ke=i.some(([u])=>u.startsWith(m+".else.")||u===m+".else"),ve=i.some(([u])=>u.startsWith(m+".body.")||u===m+".body"),Ee=i.filter(([u])=>{if(!u.startsWith(m+"."))return!1;let f=u.slice(m.length+1).split(".")[0];return/^\d+$/.test(f)&&f!=="then"&&f!=="else"&&f!=="body"});if(Ae||ke){let u=m+".then",T=m+".else",f=P(u,i,t),A=P(T,i,t),K=g?p(y):{type:"JS_CODE",expression:"true"};n.push({uid:d,type:"IF_ELSE",condition:K,then:f,...A.length>0?{else:A}:{}})}else if(ve){let u=m+".body",T=P(u,i,t),f=g?p(y):{type:"JS_CODE",expression:"true"};n.push({uid:d,type:"WHILE_LOOP",condition:f,body:T})}else if(Ee.length>0){let u=P(m,i,t);n.push({uid:d,type:"STEP",description:y||"Group",statements:u})}else n.push({uid:d,type:"ACTION",description:y||"Action",action_entity:g?.action_entity})}return n}function yi(e){let i=Object.entries(e),t=r=>{let o=r+".";return i.some(([s])=>s===r||s.startsWith(o))?P(r,i,e):[]};return{before:t("before"),main:t("main"),teardown:t("teardown"),after:t("after")}}function Ai(){return{version:"1.0",entries:{}}}function ki(e,i){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:i}}}function vi(e,i){let t=i?.entries[e.uid],r=t?.action_entity??e.action_entity;return e.locator&&r?{...r,locator:e.locator}:t?t.action_entity:e.action_entity?e.action_entity:null}function Ei(e,i,t,r){return e.entries[i]={action_entity:t,updated_at:new Date().toISOString(),updated_by:r},e}function _i(e,i){let t=e??{version:"1.0",entries:{}};for(let[r,o]of i)t.entries[r]=o;return t}function Oi(e){return e?Object.keys(e.entries).length===0:!0}function Li(e){return e?Object.keys(e.entries).length:0}function xi(e,i){if(!i||Object.keys(i.entries).length===0)return e;let t=V(e.statements,i),r=e.teardown?V(e.teardown,i):void 0;return{...e,statements:t,teardown:r}}function V(e,i){return e.map(t=>Ii(t,i))}function Ii(e,i){if(e.type==="ACTION"){let o=e,n=i.entries[o.uid];return n?{...o,action_entity:n.action_entity}:o}let t=b(e);if(t.length===0)return e;let r={};for(let o of t)r[o.key]=V(o.statements,i);return{...e,...r}}var we=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(we||{}),ge=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(ge||{}),Di=18e4;var Wi=class Se{data={};sensitive=new Set;get(i){return this.data[i]}set(i,t,r=!1){this.data[i]=t,r?this.sensitive.add(i):this.sensitive.has(i)&&this.sensitive.delete(i)}getAll(){return{...this.data}}isSensitive(i){return this.sensitive.has(i)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(i){return this.sensitive.delete(i),delete this.data[i]}clear(){this.data={},this.sensitive.clear()}has(i){return i in this.data}get size(){return Object.keys(this.data).length}merge(i){for(let[t,r]of Object.entries(i.getAll()))this.set(t,r,i.isSensitive(t))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(i){let t=new Se;if(i.data){let r=new Set(i.sensitiveKeys||[]);for(let[o,n]of Object.entries(i.data))t.set(o,n,r.has(o))}return t}};var Me="claude-sonnet-4-5",Te="gemini-2.5-pro",Pe="claude-haiku-4-5",be="gemini-2.5-pro";function Ci(e){return{copilot:e?.models?.copilot||Me,webagent:e?.models?.webagent||Te}}function Ki(e=process.env){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.ANTHROPIC_API_KEY)return Pe;if(e.GOOGLE_API_KEY)return be}var ye=(e=>(e.INITIALIZING="initializing",e.READY="ready",e.PROCESSING="processing",e.STOPPING="stopping",e.WAITING_USER="waiting_user",e.COMPLETED="completed",e.FAILED="failed",e))(ye||{});function Gi(e){let i=e.trim();if(!i||i.startsWith("List of devices"))return null;let t=i.split(/\s+/);if(t.length<2)return null;let r=t[0],o=t[1],n="usb";return r.startsWith("emulator-")?n="emulator":r.includes(":")&&(n="wifi"),{id:r,state:o,connectionType:n}}function Bi(e){return e.startsWith(S)?e:`${S}${e}`}function Fi(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}export{Oe as a,xe as b,Ie as c,S as d,M as e,De as f,We as g,Ce as h,Ke as i,Ge as j,Be as k,Fe as l,F as m,He as n,U as o,Ne as p,ze as q,Re as r,Ve as s,X as t,H as u,$ as v,Y as w,J as x,j as y,Z as z,q as A,Q as B,ee as C,x as D,ie as E,G as F,te as G,re as H,C as I,Ue as J,B as K,Xe as L,$e as M,N,Ye as O,Je as P,je as Q,Ze as R,oe as S,ne as T,ae as U,z as V,se as W,I as X,le as Y,ce as Z,he as _,k as $,R as aa,Qe as ba,ai as ca,si as da,b as ea,w as fa,E as ga,_ as ha,O as ia,fi as ja,mi as ka,wi as la,me as ma,Mi as na,Ti as oa,Pi as pa,L as qa,bi as ra,yi as sa,Ai as ta,ki as ua,vi as va,Ei as wa,_i as xa,Oi as ya,Li as za,xi as Aa,we as Ba,ge as Ca,Di as Da,Wi as Ea,Me as Fa,Te as Ga,Pe as Ha,be as Ia,Ci as Ja,Ki as Ka,ye as La,Gi as Ma,Bi as Na,Fi as Oa};
|
|
17
|
+
`;return e}generatePostlude(){return""}};var Le=[/iphone/i,/ipad/i,/android/i,/pixel/i,/galaxy/i,/mobile/i,/nexus/i,/blackberry/i,/kindle/i];function xe(e){if(!e)return"desktop";for(let i of Le)if(i.test(e))return"mobile";return"desktop"}function Ie(e,i){if(!e||typeof e!="string")return e;let t=i instanceof Map?Object.fromEntries(i):i,r=n=>{let s=n.startsWith("$")?n.slice(1):n,l=t[s]??t[`$${s}`];return l!=null?String(l):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(n,s)=>{let l=r(s.trim());return l!==void 0?l:n}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(n,s)=>{let l=r(s);return l!==void 0?l:n}),o=o.replace(/\$\{([^}]+)\}/g,(n,s)=>{let l=r(s.trim());return l!==void 0?l:n}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(n,s)=>{let l=r(s);return l!==void 0?l:n}),o}var S="android:",M="ios:";function De(e){return e?e.startsWith(S)?"android":e.startsWith(M)?"ios":"web":"web"}function We(e){return e?e.startsWith(S)||e.startsWith(M):!1}function Ce(e){return!!e&&e.startsWith(S)}function Ke(e){return!!e&&e.startsWith(M)}function Ge(e){return e.startsWith(S)?e.slice(S.length):e.startsWith(M)?e.slice(M.length):e}function Be(e){return`${S}${e}`}function Fe(e){return`${M}${e}`}function F(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function He(e){return e?!F(e):!1}function U(e){return e?F(e)?["web"]:["android","ios"]:["web","android","ios"]}function Ne(e,i){if(!i)return!0;let t=U(i);return e==="desktop"||e==="mobile"?t.includes("web"):t.includes(e)}function ze(e){return e.startsWith(M)?e:`${M}${e}`}function Re(e){let i=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${i} - Simulator`:`${e.name}${i}`}function Ve(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var X="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",H=112,$=1920,Y=1080,J=1920,j=1080-H,Z=1280,q=720,Q=500,ee=500,x="Desktop Chrome",ie=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(ie||{}),G={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}},te=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(te||{}),re={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},C=(e,i=!1)=>{let t=["chromium"];return i&&t.push("webkit"),re[e].map(r=>G[r]).filter(r=>r.defaultBrowserType&&t.includes(r.defaultBrowserType))},Ue=()=>Object.keys(G),B=e=>G[e],Xe={desktop:{label:"Desktop",type:"desktop",devices:C("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile")}},$e={desktop:{label:"Desktop",type:"desktop",devices:C("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile",!0)}},N=(e,i=!1)=>{let t={userAgent:X,viewport:{width:J,height:j},isMobile:!1,hasTouch:!1};if(!e||e===x)return t;let r=B(e);if(!r)return t;let{width:o,height:n}=r.viewport,s=Math.max(Q/o,1),l=Math.max(ee/n,1),c=Math.max(s,l),p={width:Math.round(o*c),height:Math.round(n*c)};return{userAgent:r.userAgent,viewport:i?p:r.viewport,isMobile:r.isMobile,hasTouch:r.hasTouch}},Ye=e=>{let i={width:$,height:Y};if(!e||e===x)return i;let t=N(e);return t.viewport?{width:t.viewport.width,height:t.viewport.height+H}:i},Je=e=>{let i={width:Z,height:q};if(!e||e===x)return i;let t=N(e);return t.viewport?{width:t.viewport.width,height:t.viewport.height}:i},je=e=>!e||e===x?void 0:B(e)?.channel,Ze=e=>!e||e===x?"chromium":B(e)?.defaultBrowserType??"chromium";var oe=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(oe||{}),ne=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(ne||{});import{z as a}from"zod";var ae=a.enum(["JS_CODE","AI_MODE"]),z=a.object({type:ae,expression:a.string()}),se=a.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),I=a.object({uid:a.string(),type:se}),le=a.object({action_data:a.object({action_name:a.string(),kwargs:a.record(a.any()).optional(),args:a.array(a.any()).optional()}),action_description:a.string().optional(),url:a.string().optional(),xpath:a.string().nullable().optional(),locator:a.string().nullable().optional(),css_selector:a.string().nullable().optional(),unique_selector:a.string().nullable().optional(),element_index:a.number().nullable().optional(),frame_path:a.array(a.any()).optional(),artifacts:a.record(a.any()).optional(),feedback:a.string().optional(),original_browser_use_action:a.any().optional()}).passthrough(),ce=I.extend({type:a.literal("DRAFT"),description:a.string()}),he=I.extend({type:a.literal("ACTION"),description:a.string(),action_entity:le.optional(),locator:a.string().optional(),use_pure_vision:a.boolean().optional()}),k=a.lazy(()=>a.union([ce,he,I.extend({type:a.literal("STEP"),description:a.string().optional().default(""),statements:a.array(k),reference_id:a.number().optional()}),I.extend({type:a.literal("IF_ELSE"),description:a.string().optional(),condition:z,then:a.array(k),else:a.array(k).optional()}),I.extend({type:a.literal("WHILE_LOOP"),description:a.string().optional(),condition:z,body:a.array(k),timeout_ms:a.number().optional()})])),R=a.object({version:a.string().optional(),goal:a.string(),url:a.string(),final_feedback:a.string().optional(),completed:a.boolean().optional(),success:a.boolean().optional(),statements:a.array(k),teardown:a.array(k).optional(),last_modified_at:a.string().optional()});import{stringify as qe,parse as de}from"yaml";import{v4 as v}from"uuid";function Qe(e,i){let t={...i?.test_case_id!==void 0?{test_case_id:i.test_case_id}:{},goal:e.goal,url:e.url,statements:e.statements.map(D)};return e.final_feedback&&(t.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(t.teardown=e.teardown.map(D)),qe(t,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"})}function D(e){switch(e.type){case"DRAFT":return ei(e);case"ACTION":return ii(e);case"STEP":return ri(e);case"IF_ELSE":return oi(e);case"WHILE_LOOP":return ni(e)}}function ei(e){return e.description}function ii(e){if((e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name)==="verify"){let n=(e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs)?.statement;if(typeof n=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return`VERIFY: ${n}`}if(!e.action_entity)return e.description;let t={description:e.description},r=ti(e.action_entity);return r&&(t.action_entity=r),e.locator&&(t.locator=e.locator),e.use_pure_vision&&(t.use_pure_vision=!0),t}function ti(e){let i={},t=!1,r=e.action_data??e.action;return r&&(i.action_data={action_name:r.action_name},r.kwargs&&Object.keys(r.kwargs).length>0&&(i.action_data.kwargs=r.kwargs),r.args&&r.args.length>0&&(i.action_data.args=r.args),t=!0),e.locator&&(i.locator=e.locator,t=!0),e.xpath&&(i.xpath=e.xpath,t=!0),t?i:void 0}function ri(e){let i={STEP:e.description,statements:e.statements.map(D)};return e.reference_id!==void 0&&(i.reference_id=e.reference_id),i}function oi(e){let i={IF:pe(e.condition),THEN:e.then.map(D)};return e.else&&e.else.length>0&&(i.ELSE=e.else.map(D)),i}function ni(e){let i={WHILE:pe(e.condition),DO:e.body.map(D)};return e.timeout_ms!==void 0&&(i.timeout_ms=e.timeout_ms),i}function pe(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function ai(e){try{let i=de(e);if(!i||typeof i!="object")return{};let t={};return typeof i.test_case_id=="number"&&Number.isFinite(i.test_case_id)&&(t.test_case_id=i.test_case_id),t}catch{return{}}}var ue=1024*1024;function si(e){if(e.length>ue)throw new Error(`YAML input too large (${e.length} bytes, max ${ue})`);let i=de(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let t={version:"1.2.0",goal:i.goal,url:i.url,statements:W(i.statements??[])};i.final_feedback&&(t.final_feedback=i.final_feedback),i.teardown&&Array.isArray(i.teardown)&&(t.teardown=W(i.teardown));let r=R.safeParse(t);if(!r.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(r.error.errors)}`);return r.data}function W(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(li)}function li(e){if(typeof e=="string")return ci(e);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected string or object, got ${typeof e}`);let i=e;if("IF"in i)return hi(i);if("WHILE"in i)return ui(i);if("STEP"in i)return di(i);if("action_entity"in i)return pi(i);if("description"in i&&typeof i.description=="string")return{uid:v(),type:"DRAFT",description:i.description};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(i)}`)}function ci(e){let i=e.match(/^VERIFY:\s*(.+)$/i);return i?{uid:v(),type:"ACTION",description:`Verify: ${i[1]}`,action_entity:{action_description:`Verify: ${i[1]}`,action_data:{action_name:"verify",kwargs:{statement:i[1]}}}}:{uid:v(),type:"DRAFT",description:e}}function fe(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function hi(e){let i=fe(e.IF),t=e.THEN;if(!Array.isArray(t))throw new Error("IF_ELSE requires a THEN array");let r={uid:v(),type:"IF_ELSE",condition:i,then:W(t)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(r.else=W(e.ELSE)),r}function ui(e){let i=fe(e.WHILE),t=e.DO;if(!Array.isArray(t))throw new Error("WHILE_LOOP requires a DO array");let r={uid:v(),type:"WHILE_LOOP",condition:i,body:W(t)};return typeof e.timeout_ms=="number"&&(r.timeout_ms=e.timeout_ms),r}function di(e){let i=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let t={uid:v(),type:"STEP",description:i,statements:W(e.statements)};return typeof e.reference_id=="number"&&(t.reference_id=e.reference_id),t}function pi(e){let i=typeof e.description=="string"?e.description:"",t=e.action_entity,r;t&&(r={action_description:i,...t});let o={uid:v(),type:"ACTION",description:i};return r&&(o.action_entity=r),typeof e.locator=="string"&&(o.locator=e.locator),typeof e.use_pure_vision=="boolean"&&(o.use_pure_vision=e.use_pure_vision),o}var b=e=>{let i=[];switch(e.type){case"STEP":e.statements&&i.push({key:"statements",statements:e.statements});break;case"IF_ELSE":e.then&&i.push({key:"then",statements:e.then}),e.else&&i.push({key:"else",statements:e.else});break;case"WHILE_LOOP":e.body&&i.push({key:"body",statements:e.body});break}return i},w=(e,i,t=void 0,r="root")=>{for(let o=0;o<e.length;o++){let n=e[o],s=n.uid;if(s===i)return{stableId:s,path:[o],statement:n,parent:t,containerKey:r,index:o};let l=b(n);for(let c of l){let p=w(c.statements,i,n,c.key);if(p)return{...p,path:[o,c.key,...p.path]}}}return null},E=(e,i,t)=>{let r=w(e,i);if(!r)return null;let{statement:o,parent:n,containerKey:s,index:l}=r,c=null;switch(o.type){case"DRAFT":case"ACTION":c=_(e,r)||O(e,r);break;case"STEP":if(o.statements&&o.statements.length>0)return o.statements[0];c=_(e,r)||O(e,r);break;case"IF_ELSE":if(t===!0&&o.then&&o.then.length>0)return o.then[0];if(t===!1&&o.else&&o.else.length>0)return o.else[0];c=_(e,r)||O(e,r);break;case"WHILE_LOOP":if(t===!0&&o.body&&o.body.length>0)return o.body[0];c=_(e,r)||O(e,r);break;default:c=_(e,r)||O(e,r);break}if(n&&n.type==="WHILE_LOOP"&&s==="body"){if(!c)return n;let p=w(e,c.uid);if(!p||p.parent!==n)return n}return c},_=(e,i)=>{if(!i.parent)return e[i.index+1]||null;let r=b(i.parent).find(o=>o.key===i.containerKey);return r&&i.index+1<r.statements.length?r.statements[i.index+1]:null},O=(e,i)=>{if(!i.parent)return null;let t=i.parent.uid,r=w(e,t);return r?_(e,r)||O(e,r):null},fi=e=>{let i=[],t=r=>{for(let o of r){i.push(o);let n=b(o);for(let s of n)t(s.statements)}};return t(e),i},mi=e=>{switch(e.type){case"DRAFT":case"ACTION":return!0;case"STEP":return!0;case"IF_ELSE":case"WHILE_LOOP":return!0;default:return!1}},wi=(e,i,t)=>{if(!w(e,i))return null;if(t===null){let l=[],c=i;for(;c!==null&&w(e,c);)if(l.push(c),c=E(e,c)?.uid||null,l.length>1e3)return null;return l}if(!w(e,t))return null;if(i===t)return[];let n=[],s=i;for(;s&&s!==t;){let l=w(e,s);if(!l)break;if(n.push(s),l.statement.type==="IF_ELSE"){let c=gi(l.statement,t);c?s=E(e,s,c==="then")?.uid||null:s=E(e,s)?.uid||null}else l.statement.type==="WHILE_LOOP"?Si(l.statement,t)?s=E(e,s,!0)?.uid||null:s=E(e,s,!1)?.uid||null:s=E(e,s)?.uid||null;if(n.length>1e3)return null}return s===t?n:null},gi=(e,i)=>{if(e.type!=="IF_ELSE")return null;let t=e;return t.then&&w(t.then,i)?"then":t.else&&w(t.else,i)?"else":null},Si=(e,i)=>{if(e.type!=="WHILE_LOOP")return!1;let t=e;return!!(t.body&&w(t.body,i))};function me(e){for(let i of e){if(i.type==="STEP"&&i.reference_id)return!0;let t=b(i);for(let r of t)if(me(r.statements))return!0}return!1}function Mi(e){let i=new Set;function t(r){for(let o of r){o.type==="STEP"&&o.reference_id&&i.add(o.reference_id);let n=b(o);for(let s of n)t(s.statements)}}return t(e),Array.from(i)}var Ti=e=>e.startsWith("ai_")?!0:["js_code","function","assert","verify","wait_for_download_complete","extract_activation_code","extract_email_content"].includes(e),Pi=e=>!["js_code","function","assert","ai_assert","verify","ai_extract","ai_wait_until","upload_file","login","extract_activation_code","extract_email_content","ai_step"].includes(e),L=(e,i,t)=>{e.forEach((r,o)=>{let n=`${i}.${o}`;r.type==="DRAFT"?t[n]={description:r.description||"Draft",action_entity:void 0}:r.type==="ACTION"?t[n]={description:r.description||"Action",action_entity:r.action_entity}:r.type==="STEP"&&r.statements?L(r.statements,n,t):r.type==="IF_ELSE"?(t[n]={description:"IF "+(r.condition?.expression||""),action_entity:void 0},r.then&&L(r.then,`${n}.then`,t),r.else&&L(r.else,`${n}.else`,t)):r.type==="WHILE_LOOP"&&(t[n]={description:"WHILE "+(r.condition?.expression||""),action_entity:void 0},r.body&&L(r.body,`${n}.body`,t))})};function bi(e){if(!e?.statements||!Array.isArray(e.statements))return{};let i={};return L(e.statements,"main",i),e.teardown&&Array.isArray(e.teardown)&&L(e.teardown,"teardown",i),i}function P(e,i,t){let r=e+".",o=i.filter(([h])=>h===e||h.startsWith(r));if(o.length===0)return[];let n=[],s=new Set;for(let[h]of o){let d=h===e?"":h.slice(r.length);if(!d)continue;let g=d.split(".")[0];s.has(g)||s.add(g)}let l=Array.from(s);l.sort((h,d)=>{let g=/^\d+$/.test(h)?parseInt(h,10):-1,y=/^\d+$/.test(d)?parseInt(d,10):-1;return g>=0&&y>=0?g-y:h==="then"&&d==="else"?-1:h==="else"&&d==="then"||h==="body"?1:d==="body"?-1:h.localeCompare(d)});function c(h){return t[h]}function p(h){let d=h.match(/^(IF|WHILE)\s+([\s\S]+)$/);return{type:"JS_CODE",expression:(d?d[2].trim():h)||"true"}}for(let h of l){let d=e?`${e}.${h}`:h,g=c(d),y=g?.description??"",Hi=d;if(h==="then"){let u=`${e}.then`,T=`${e}.else`,f=P(u,i,t),A=P(T,i,t),K=c(e),_e=K?p(K.description):{type:"JS_CODE",expression:"true"};n.push({uid:e,type:"IF_ELSE",condition:_e,then:f,...A.length>0?{else:A}:{}});continue}if(h==="else")continue;if(h==="body"){let u=`${e}.body`,T=P(u,i,t),f=c(e),A=f?p(f.description):{type:"JS_CODE",expression:"true"};n.push({uid:e,type:"WHILE_LOOP",condition:A,body:T});continue}let m=`${e}.${h}`,Ae=i.some(([u])=>u.startsWith(m+".then.")||u===m+".then"),ke=i.some(([u])=>u.startsWith(m+".else.")||u===m+".else"),ve=i.some(([u])=>u.startsWith(m+".body.")||u===m+".body"),Ee=i.filter(([u])=>{if(!u.startsWith(m+"."))return!1;let f=u.slice(m.length+1).split(".")[0];return/^\d+$/.test(f)&&f!=="then"&&f!=="else"&&f!=="body"});if(Ae||ke){let u=m+".then",T=m+".else",f=P(u,i,t),A=P(T,i,t),K=g?p(y):{type:"JS_CODE",expression:"true"};n.push({uid:d,type:"IF_ELSE",condition:K,then:f,...A.length>0?{else:A}:{}})}else if(ve){let u=m+".body",T=P(u,i,t),f=g?p(y):{type:"JS_CODE",expression:"true"};n.push({uid:d,type:"WHILE_LOOP",condition:f,body:T})}else if(Ee.length>0){let u=P(m,i,t);n.push({uid:d,type:"STEP",description:y||"Group",statements:u})}else n.push({uid:d,type:"ACTION",description:y||"Action",action_entity:g?.action_entity})}return n}function yi(e){let i=Object.entries(e),t=r=>{let o=r+".";return i.some(([s])=>s===r||s.startsWith(o))?P(r,i,e):[]};return{before:t("before"),main:t("main"),teardown:t("teardown"),after:t("after")}}function Ai(){return{version:"1.0",entries:{}}}function ki(e,i){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:i}}}function vi(e,i){let t=i?.entries[e.uid],r=t?.action_entity??e.action_entity;return e.locator&&r?{...r,locator:e.locator}:t?t.action_entity:e.action_entity?e.action_entity:null}function Ei(e,i,t,r){return e.entries[i]={action_entity:t,updated_at:new Date().toISOString(),updated_by:r},e}function _i(e,i){let t=e??{version:"1.0",entries:{}};for(let[r,o]of i)t.entries[r]=o;return t}function Oi(e){return e?Object.keys(e.entries).length===0:!0}function Li(e){return e?Object.keys(e.entries).length:0}function xi(e,i){if(!i||Object.keys(i.entries).length===0)return e;let t=V(e.statements,i),r=e.teardown?V(e.teardown,i):void 0;return{...e,statements:t,teardown:r}}function V(e,i){return e.map(t=>Ii(t,i))}function Ii(e,i){if(e.type==="ACTION"){let o=e,n=i.entries[o.uid];return n?{...o,action_entity:n.action_entity}:o}let t=b(e);if(t.length===0)return e;let r={};for(let o of t)r[o.key]=V(o.statements,i);return{...e,...r}}var we=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(we||{}),ge=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(ge||{}),Di=18e4;var Wi=class Se{data={};sensitive=new Set;get(i){return this.data[i]}set(i,t,r=!1){this.data[i]=t,r?this.sensitive.add(i):this.sensitive.has(i)&&this.sensitive.delete(i)}getAll(){return{...this.data}}isSensitive(i){return this.sensitive.has(i)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(i){return this.sensitive.delete(i),delete this.data[i]}clear(){this.data={},this.sensitive.clear()}has(i){return i in this.data}get size(){return Object.keys(this.data).length}merge(i){for(let[t,r]of Object.entries(i.getAll()))this.set(t,r,i.isSensitive(t))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(i){let t=new Se;if(i.data){let r=new Set(i.sensitiveKeys||[]);for(let[o,n]of Object.entries(i.data))t.set(o,n,r.has(o))}return t}};var Me="claude-sonnet-4-6",Te="gemini-2.5-pro",Pe="claude-haiku-4-5",be="gemini-2.5-pro";function Ci(e){return{copilot:e?.models?.copilot||Me,webagent:e?.models?.webagent||Te}}function Ki(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.ANTHROPIC_API_KEY)return Pe;if(e.GOOGLE_API_KEY)return be}}var ye=(e=>(e.INITIALIZING="initializing",e.READY="ready",e.PROCESSING="processing",e.STOPPING="stopping",e.WAITING_USER="waiting_user",e.COMPLETED="completed",e.FAILED="failed",e))(ye||{});function Gi(e){let i=e.trim();if(!i||i.startsWith("List of devices"))return null;let t=i.split(/\s+/);if(t.length<2)return null;let r=t[0],o=t[1],n="usb";return r.startsWith("emulator-")?n="emulator":r.includes(":")&&(n="wifi"),{id:r,state:o,connectionType:n}}function Bi(e){return e.startsWith(S)?e:`${S}${e}`}function Fi(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}export{Oe as a,xe as b,Ie as c,S as d,M as e,De as f,We as g,Ce as h,Ke as i,Ge as j,Be as k,Fe as l,F as m,He as n,U as o,Ne as p,ze as q,Re as r,Ve as s,X as t,H as u,$ as v,Y as w,J as x,j as y,Z as z,q as A,Q as B,ee as C,x as D,ie as E,G as F,te as G,re as H,C as I,Ue as J,B as K,Xe as L,$e as M,N,Ye as O,Je as P,je as Q,Ze as R,oe as S,ne as T,ae as U,z as V,se as W,I as X,le as Y,ce as Z,he as _,k as $,R as aa,Qe as ba,ai as ca,si as da,b as ea,w as fa,E as ga,_ as ha,O as ia,fi as ja,mi as ka,wi as la,me as ma,Mi as na,Ti as oa,Pi as pa,L as qa,bi as ra,yi as sa,Ai as ta,ki as ua,vi as va,Ei as wa,_i as xa,Oi as ya,Li as za,xi as Aa,we as Ba,ge as Ca,Di as Da,Wi as Ea,Me as Fa,Te as Ga,Pe as Ha,be as Ia,Ci as Ja,Ki as Ka,ye as La,Gi as Ma,Bi as Na,Fi as Oa};
|