shiplightai 0.1.91 → 0.1.92

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.
@@ -4097,7 +4097,7 @@ Based on the above information, please determine if the statement is true.
4097
4097
  return (async () => {
4098
4098
  ${o}
4099
4099
  })();
4100
- `)(e,a)}transpile(e){let t=this.generateFunctionCallCode(e.action_data?.kwargs||{});return t?[t.endsWith(";")?t:`${t};`]:["// Skipping function: missing functionName"]}generateFunctionCallCode(e){let t=e.functionName;if(!t)return null;let i;if(Array.isArray(e.args))i=e.args.map(String);else if(Array.isArray(e.parameterNames)){let r=e.parameterValues||[];i=e.parameterNames.map((s,l)=>l<r.length?String(r[l]):"undefined")}else return`await ${t}()`;if(i.length===0)return`await ${t}()`;let n=["page","testContext","request","agent"],o=["undefined","null","true","false"],a=i.map(r=>n.includes(r)||o.includes(r)||/^-?\d+(\.\d+)?$/.test(r)?r:r.startsWith("$")?`agent.agentServices.readVariable('${r.substring(1)}')`:`"${r}"`);return`await ${t}(${a.join(", ")})`}}});var zn,Pl,Vn=f(()=>{"use strict";Mt();zn=require("crypto"),Pl=class{static convertDomElementToHistoryElement(e){let t=this.getParentBranchPath(e),i=this.generateCssSelector(e);return{tagName:e.tagName,xpath:e.xpath,highlightIndex:e.highlightIndex,entireParentBranchPath:t,attributes:e.attributes,shadowRoot:e.shadowRoot,cssSelector:i,pageCoordinates:e.pageCoordinates,viewportCoordinates:e.viewportCoordinates,viewportInfo:e.viewportInfo}}static findHistoryElementInTree(e,t){let i=this.hashDomHistoryElement(e),n=o=>{if(o.highlightIndex!==null){let a=this.hashDomElement(o);if(this.compareHashes(a,i))return o}for(let a of o.children)if(a instanceof Ce){let r=n(a);if(r!==null)return r}return null};return n(t)}static compareHistoryElementAndDomElement(e,t){let i=this.hashDomHistoryElement(e),n=this.hashDomElement(t);return this.compareHashes(i,n)}static hashDomHistoryElement(e){let t=this.parentBranchPathHash(e.entireParentBranchPath),i=this.attributesHash(e.attributes),n=this.xpathHash(e.xpath);return{branchPathHash:t,attributesHash:i,xpathHash:n}}static hashDomElement(e){let t=this.getParentBranchPath(e),i=this.parentBranchPathHash(t),n=this.attributesHash(e.attributes),o=this.xpathHash(e.xpath);return{branchPathHash:i,attributesHash:n,xpathHash:o}}static getParentBranchPath(e){let t=[],i=e;for(;i!==null&&i.parent!==null;)t.push(i),i=i.parent;return t.reverse(),t.map(n=>n.tagName)}static parentBranchPathHash(e){let t=e.join("/");return(0,zn.createHash)("sha256").update(t).digest("hex")}static attributesHash(e){let t=Object.entries(e).map(([i,n])=>`${i}=${n}`).join("");return(0,zn.createHash)("sha256").update(t).digest("hex")}static xpathHash(e){return(0,zn.createHash)("sha256").update(e).digest("hex")}static compareHashes(e,t){return e.branchPathHash===t.branchPathHash&&e.attributesHash===t.attributesHash&&e.xpathHash===t.xpathHash}static generateCssSelector(e){let t=e.attributes.id;if(t)return`#${t}`;let i=e.attributes.class;if(i){let n=i.split(/\s+/).filter(o=>o.trim());if(n.length>0)return`${e.tagName}.${n.join(".")}`}return e.tagName}}});var Ta,$t=f(()=>{"use strict";Ta=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(Ta||{})});var Pt={};tt(Pt,{evaluateStatement:()=>rt,executeAction:()=>fi,executeStep:()=>at,generateActionStep:()=>Lt,runTask:()=>st});var Ot=f(()=>{"use strict";wi();Ln();Pn();St();_n();Sn();kn();bt();Mn();Ke();Cn();si();ri();Fe();ai();Vn();ot();di();Mt();ui();hi();gi();de();Tt();Ie();ti();xt();ii();je();yt();Q();it();z();oe();$t();V();Ee()});var Aa,Ol,Ry,Xn=f(()=>{"use strict";Aa=require("zod"),Ol=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.statement;if(!o)throw new Error("Missing statement for ai_step");let{runTask:a}=await Promise.resolve().then(()=>(Ot(),Pt)),r=await a(o,e,i);if(r.status!=="success")throw new Error(r.error||"Task execution failed")}transpile(e,t){let i=e.action_data?.kwargs?.statement;return i?[`await agent.run(page, ${JSON.stringify(i)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]}},Ry=Aa.z.object({statement:Aa.z.string().describe('The complete step to execute (e.g., "fill in the login form and submit")')})});var Ll,Yn=f(()=>{"use strict";V();P();Ll=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");if(typeof n.kwargs.relative_x=="number"&&typeof n.kwargs.relative_y=="number"){let o=H(e,t);if(o){await o.waitFor({state:"attached",timeout:N(i,t.action_data?.kwargs?.timeout_ms)});let a=await o.boundingBox();if(a){let r=a.x+n.kwargs.relative_x+a.width/2,s=a.y+n.kwargs.relative_y+a.height/2;await e.mouse.move(r,s),await e.waitForTimeout(200),await e.mouse.click(r,s),await e.waitForTimeout(500)}}else throw new Error("Element-anchored coordinates provided but no locator found")}else if(typeof n.kwargs.x=="number"&&typeof n.kwargs.y=="number")await e.mouse.move(n.kwargs.x,n.kwargs.y),await e.waitForTimeout(200),await e.mouse.click(n.kwargs.x,n.kwargs.y),await e.waitForTimeout(500);else throw new Error("Missing or invalid coordinates")}transpile(e){let t=e.action_data?.kwargs||{},i=[];return typeof t.relative_x=="number"&&typeof t.relative_y=="number"?(i.push(`action_data: { kwargs: { relative_x: ${t.relative_x}, relative_y: ${t.relative_y} } }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`)):typeof t.x=="number"&&typeof t.y=="number"&&i.push(`action_data: { kwargs: { x: ${t.x}, y: ${t.y} } }`),['await agent.execAction("click_by_coordinates", page, {',...i.map(n=>` ${n},`),"});"]}}});var Ma,Dl,By,Jn=f(()=>{"use strict";Ma=require("zod"),Dl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.statement;if(!o)throw new Error("Missing statement for ai_action");let a=n.kwargs.use_pure_vision,{executeStep:r}=await Promise.resolve().then(()=>(Ot(),Pt)),s=await r(o,e,i,{usePureVision:a});if(s.status!=="success")throw new Error(s.error||"Action execution failed")}transpile(e,t){let i=e.action_data?.kwargs?.statement;if(!i)return["// Skipping ai_action: missing statement"];let n=JSON.stringify(i),o=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${n}, '${t||""}', ${o});`]}},By=Ma.z.object({statement:Ma.z.string().describe('The action to perform (e.g., "click the submit button")')})});function Rl(e,t){e.register({name:"switch_tab",description:"Switch to a different browser tab by index (0-based).",schema:Zm,async execute(i,n){let o=i.tab_index,{page:a,agentServices:r,actionDescription:s}=n;try{let l={action_description:s||`Switch to tab ${o}`,action_data:{action_name:"switch_tab",kwargs:{page_id:o}}};return await t.execute(a,l,r),{success:!0,actionEntity:l,message:`Switched to tab ${o}`}}catch(l){return{success:!1,error:l.message,actionEntity:{action_description:(s||`Switch to tab ${o}`)+" (failed)",action_data:{action_name:"switch_tab",kwargs:{page_id:o}},feedback:l.message}}}}})}var Ia,Nl,Zm,bi=f(()=>{"use strict";Ia=require("zod"),Nl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.page_id??n.kwargs.tab_index??0;if(typeof o=="number"){let a=e.context().pages(),r=o===-1?a.length-1:o;if(i){let s=await i.switchTab(r);await s.waitForLoadState("load",{timeout:15e3}).catch(()=>{}),await s.waitForTimeout(500)}}else throw new Error("Missing page_id for switch_tab action")}transpile(e){return['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??e.action_data?.kwargs?.tab_index??0} } },`,"});"]}},Zm=Ia.z.object({tab_index:Ia.z.number().int().nonnegative().describe("Index of the tab to switch to (0-based). Use 0 for first tab, 1 for second, etc.")})});async function Wl(e,t,i,n,o,a){let r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("No file paths provided for upload");let s=r.map(c=>{if(c.startsWith("/")||c.match(/^[A-Za-z]:\\/))return c;let u=n.testDataDir||process.cwd();return Hl.default.join(u,c)});h.info(`Uploading files: ${s.join(", ")}`);let l=i.timeout||2e4,d={useFileInput:i.useFileInput||!1,timeout:l};if(i.selector&&typeof i.selector!="string"){let c=i.selector;await qn(e,c,s,d);return}if(i.selector&&typeof i.selector=="string"){let c=i.selector,u=(c.startsWith("xpath="),e.locator(c));await qn(e,u,s,d);return}if(o){let c=r.map(m=>`"${m}"`).join(", "),u="";i.targetDescription?u=`Upload ${c} to ${i.targetDescription}`:u=`Upload ${c}`,h.info(`Using AI to handle file upload: ${u}`),await o(e,u,a)}else throw new Error("No selector provided and AI action execution is not available")}async function qn(e,t,i,n){let{useFileInput:o,timeout:a,mockShowOpenFilePicker:r}=n;if(r){h.info("Using mockShowOpenFilePicker approach");let s=i.map(l=>({path:l,buffer:new Uint8Array(Fl.default.readFileSync(l))}));await e.evaluate(l=>{window.__pw_showOpenFilePicker_mock_files=l},s),await t.click({timeout:a}),await e.waitForTimeout(3e3),await e.evaluate(()=>{delete window.__pw_showOpenFilePicker_mock_files})}else if(o)h.info("Using direct file input approach"),await t.setInputFiles(i,{timeout:a}),await e.waitForTimeout(3e3);else{h.info("Using file chooser approach");let s=e.waitForEvent("filechooser",{timeout:a});s.catch(()=>{}),await t.click({timeout:a}),await(await s).setFiles(i),await e.waitForTimeout(3e3)}h.info(`Successfully uploaded ${i.length} file(s)`)}var Fl,Hl,yi=f(()=>{"use strict";z();Fl=U(require("fs"),1),Hl=U(require("path"),1)});async function Qm(e,t,i={},n){return{...await G(t,e),action_description:n||"Upload file to element",action_data:{action_name:"upload_file",kwargs:{...i}}}}function Ul(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"upload_file",kwargs:t},feedback:"Element not found in DOM"}}function Bl(e,t){e.register({name:"upload_file",description:'Click on target element (usually contains hints like "Upload file" or "Choose file" etc.) to trigger the file upload dialog, and choose the files to upload',schema:ep,usesElementIndex:!0,async execute(i,n){let{element_index:o,paths:a}=i,{page:r,agentServices:s,actionDescription:l}=n;try{let d=await q(n,o);if(!d)return{success:!1,error:`File input element with index ${o} not found`,actionEntity:Ul(l||`Upload file to element ${o}`,{index:o,paths:a})};let c=await Qm(d,r,{paths:a},l);return await t.execute(r,c,s),{success:!0,actionEntity:c,message:`Uploaded file to element ${o}`}}catch(d){return{success:!1,error:d.message,actionEntity:Ul(l||`Upload file to element ${o}`,{index:o,paths:a})}}}})}var ae,Gl,ep,Qy,xi=f(()=>{"use strict";yi();Q();V();ae=require("zod");P();Gl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=[];if(n.kwargs.paths?o=Array.isArray(n.kwargs.paths)?n.kwargs.paths:[n.kwargs.paths]:n.kwargs.path&&(o=Array.isArray(n.kwargs.path)?n.kwargs.path:[n.kwargs.path]),o.length===0)throw new Error("No file paths provided for upload_file action");await i.downloadTestDataFiles(o);let a=o.map(d=>i.getTestDataFilePath(d)),r=H(e,t);if(!r)throw new Error("Missing locator for upload_file action");let s=n.kwargs.use_file_input||!1,l=i.getActionSettings().mock_show_open_file_picker??!1;await qn(e,r,a,{useFileInput:s,timeout:N(i,t.action_data?.kwargs?.timeout_ms),mockShowOpenFilePicker:l})}transpile(e){let t=e.action_data?.kwargs||{},i=[],n={};return t.paths?n.paths=t.paths:t.path&&(n.path=t.path),t.use_file_input&&(n.use_file_input=!0),i.push(`action_data: { kwargs: ${JSON.stringify(n)} }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...i.map(o=>` ${o},`),"});"]}};ep=ae.z.object({element_index:ae.z.number().int().describe("Index of the target element to trigger the file upload dialog"),paths:ae.z.union([ae.z.string(),ae.z.array(ae.z.string())]).describe('Path to a file, relative to the test project root (e.g. "fixtures/data.csv"), or an array of such paths.'),timeout_ms:ae.z.number().optional().describe("Per-action timeout in ms. Overrides the default 5s action timeout.")});Qy=ae.z.object({element_index:ae.z.number().int().describe("Index of the file input element"),paths:ae.z.union([ae.z.string(),ae.z.array(ae.z.string())]).describe('Path to a file, relative to the test project root (e.g. "fixtures/data.csv"), or an array of such paths.'),timeout_ms:ae.z.number().optional().describe("Per-action timeout in ms. Overrides the default 5s action timeout.")})});function Kl(e,t){e.register({name:"wait",description:"Wait for a specified number of seconds before continuing.",schema:tp,async execute(i,n){let{seconds:o}=i,{page:a,agentServices:r,actionDescription:s}=n;try{let l={action_description:s||`Wait ${o} seconds`,action_data:{action_name:"wait",kwargs:{seconds:o}}};return await t.execute(a,l,r),{success:!0,actionEntity:l,message:`Waited ${o} seconds`}}catch(l){return{success:!1,error:l.message,actionEntity:{action_description:(s||`Wait ${o} seconds`)+" (failed)",action_data:{action_name:"wait",kwargs:{seconds:o}},feedback:l.message}}}}})}var Ca,jl,tp,vi=f(()=>{"use strict";Ca=require("zod"),jl=class{async execute(e,t){let i=t.action_data;if(!i)throw new Error("Action data not found");let n=i.kwargs.seconds||1;await e.waitForTimeout(n*1e3)}transpile(e){return[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]}},tp=Ca.z.object({seconds:Ca.z.number().positive().describe("Number of seconds to wait")})});function Vl(e,t){e.register({name:"wait_for_download_complete",description:"Wait for an in-progress download to complete.",schema:ip,async execute(i,n){let{timeout_seconds:o=10}=i,{page:a,agentServices:r}=n;try{let s={action_description:`Wait for download to complete (timeout: ${o}s)`,action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}}};return await t.execute(a,s,r),{success:!0,actionEntity:s,message:"Download completed"}}catch(s){return{success:!1,error:s.message,actionEntity:{action_description:"Wait for download to complete (failed)",action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}},feedback:s.message}}}}})}var $a,zl,ip,_i=f(()=>{"use strict";$a=require("zod"),zl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.timeout_seconds||10;await i.waitForDownloadComplete(e,o)}transpile(e){return['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]}},ip=$a.z.object({timeout_seconds:$a.z.number().positive().optional().describe("Maximum time in seconds to wait for download to complete (default: 10)")})});function Qn(e,t){if(!e||typeof e!="string")return e;let i=t instanceof Map?Object.fromEntries(t):t,n=a=>{let r=a.startsWith("$")?a.slice(1):a,s=i[r]??i[`$${r}`];return s!=null?String(s):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o=o.replace(/\$\{([^}]+)\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o}var T,dx,bx,vx,kx,eo,np,to,op,ap,rp,sp,lp,cp,dp,up,lt,Dt,Yl,hp,Zn,Si,sx,lx,io,Jl,ql,Zl,Ql,ct,Ei,Pa,mp,Xl,pp,ki,gp,fp,wp,be,bp,yp,cx,xx,Tx,He=f(()=>{"use strict";Ee();T=require("zod"),dx=require("yaml"),bx=require("uuid"),vx=require("uuid"),kx=require("yaml");eo=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(eo||{}),np="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",to=112,op=1920,ap=1080,rp=1920,sp=1080-to,lp=1280,cp=720,dp=500,up=500,lt="Desktop Chrome",Dt=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Dt||{}),Yl={"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"}},hp={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"]},Zn=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),hp[e].map(n=>Yl[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Si=e=>Yl[e],sx={desktop:{label:"Desktop",type:"desktop",devices:Zn("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Zn("mobile")}},lx={desktop:{label:"Desktop",type:"desktop",devices:Zn("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Zn("mobile",!0)}},io=(e,t=!1)=>{let i={userAgent:np,viewport:{width:rp,height:sp},isMobile:!1,hasTouch:!1};if(!e||e===lt)return i;let n=Si(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(dp/o,1),s=Math.max(up/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},Jl=e=>{let t={width:op,height:ap};if(!e||e===lt)return t;let i=io(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+to}:t},ql=e=>{let t={width:lp,height:cp};if(!e||e===lt)return t;let i=io(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},Zl=e=>!e||e===lt?void 0:Si(e)?.channel,Ql=e=>!e||e===lt?"chromium":Si(e)?.defaultBrowserType??"chromium",ct=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(ct||{}),Ei=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(Ei||{}),Pa=class ec{constructor(){ha(this,"data",{}),ha(this,"sensitive",new Set)}get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new ec;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}},mp=T.z.enum(["JS_CODE","AI_MODE"]),Xl=T.z.object({type:mp,expression:T.z.string()}),pp=T.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),ki=T.z.object({uid:T.z.string(),type:pp,comment:T.z.string().optional()}),gp=T.z.object({action_data:T.z.object({action_name:T.z.string(),kwargs:T.z.record(T.z.any()).optional(),args:T.z.array(T.z.any()).optional()}),action_description:T.z.string().optional(),url:T.z.string().optional(),xpath:T.z.string().nullable().optional(),locator:T.z.string().nullable().optional(),css_selector:T.z.string().nullable().optional(),unique_selector:T.z.string().nullable().optional(),element_index:T.z.number().nullable().optional(),frame_path:T.z.array(T.z.any()).optional(),artifacts:T.z.record(T.z.any()).optional(),feedback:T.z.string().optional(),original_browser_use_action:T.z.any().optional()}).passthrough(),fp=ki.extend({type:T.z.literal("DRAFT"),description:T.z.string()}),wp=ki.extend({type:T.z.literal("ACTION"),description:T.z.string(),action_entity:gp.optional(),locator:T.z.string().optional(),use_pure_vision:T.z.boolean().optional()}),be=T.z.lazy(()=>T.z.union([fp,wp,ki.extend({type:T.z.literal("STEP"),description:T.z.string().optional().default(""),statements:T.z.array(be),reference_id:T.z.number().optional(),template_path:T.z.string().optional(),template_params:T.z.record(T.z.string()).optional()}),ki.extend({type:T.z.literal("IF_ELSE"),description:T.z.string().optional(),condition:Xl,then:T.z.array(be),else:T.z.array(be).optional()}),ki.extend({type:T.z.literal("WHILE_LOOP"),description:T.z.string().optional(),condition:Xl,body:T.z.array(be),timeout_ms:T.z.number().optional()})])),bp=T.z.object({name:T.z.string(),statements:T.z.array(be),teardown:T.z.array(be).optional(),skip:T.z.union([T.z.boolean(),T.z.string()]).optional(),timeout:T.z.number().optional(),fail:T.z.union([T.z.boolean(),T.z.string()]).optional(),only:T.z.boolean().optional(),slow:T.z.boolean().optional()}),yp=T.z.object({tests:T.z.array(bp).min(1),beforeAll:T.z.array(be).optional(),afterAll:T.z.array(be).optional(),beforeEach:T.z.array(be).optional(),afterEach:T.z.array(be).optional()}),cx=T.z.object({comment:T.z.string().optional(),version:T.z.string().optional(),goal:T.z.string().optional(),url:T.z.string().optional(),baseURL:T.z.string().optional(),final_feedback:T.z.string().optional(),completed:T.z.boolean().optional(),success:T.z.boolean().optional(),statements:T.z.array(be).optional(),teardown:T.z.array(be).optional(),last_modified_at:T.z.string().optional(),testGroup:yp.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"}),xx=1024*1024,Tx=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"])});var Xe,dt=f(()=>{"use strict";Xe=`
4100
+ `)(e,a)}transpile(e){let t=this.generateFunctionCallCode(e.action_data?.kwargs||{});return t?[t.endsWith(";")?t:`${t};`]:["// Skipping function: missing functionName"]}generateFunctionCallCode(e){let t=e.functionName;if(!t)return null;let i;if(Array.isArray(e.args))i=e.args.map(String);else if(Array.isArray(e.parameterNames)){let r=e.parameterValues||[];i=e.parameterNames.map((s,l)=>l<r.length?String(r[l]):"undefined")}else return`await ${t}()`;if(i.length===0)return`await ${t}()`;let n=["page","testContext","request","agent"],o=["undefined","null","true","false"],a=i.map(r=>n.includes(r)||o.includes(r)||/^-?\d+(\.\d+)?$/.test(r)?r:r.startsWith("$")?`agent.agentServices.readVariable('${r.substring(1)}')`:`"${r}"`);return`await ${t}(${a.join(", ")})`}}});var zn,Pl,Vn=f(()=>{"use strict";Mt();zn=require("crypto"),Pl=class{static convertDomElementToHistoryElement(e){let t=this.getParentBranchPath(e),i=this.generateCssSelector(e);return{tagName:e.tagName,xpath:e.xpath,highlightIndex:e.highlightIndex,entireParentBranchPath:t,attributes:e.attributes,shadowRoot:e.shadowRoot,cssSelector:i,pageCoordinates:e.pageCoordinates,viewportCoordinates:e.viewportCoordinates,viewportInfo:e.viewportInfo}}static findHistoryElementInTree(e,t){let i=this.hashDomHistoryElement(e),n=o=>{if(o.highlightIndex!==null){let a=this.hashDomElement(o);if(this.compareHashes(a,i))return o}for(let a of o.children)if(a instanceof Ce){let r=n(a);if(r!==null)return r}return null};return n(t)}static compareHistoryElementAndDomElement(e,t){let i=this.hashDomHistoryElement(e),n=this.hashDomElement(t);return this.compareHashes(i,n)}static hashDomHistoryElement(e){let t=this.parentBranchPathHash(e.entireParentBranchPath),i=this.attributesHash(e.attributes),n=this.xpathHash(e.xpath);return{branchPathHash:t,attributesHash:i,xpathHash:n}}static hashDomElement(e){let t=this.getParentBranchPath(e),i=this.parentBranchPathHash(t),n=this.attributesHash(e.attributes),o=this.xpathHash(e.xpath);return{branchPathHash:i,attributesHash:n,xpathHash:o}}static getParentBranchPath(e){let t=[],i=e;for(;i!==null&&i.parent!==null;)t.push(i),i=i.parent;return t.reverse(),t.map(n=>n.tagName)}static parentBranchPathHash(e){let t=e.join("/");return(0,zn.createHash)("sha256").update(t).digest("hex")}static attributesHash(e){let t=Object.entries(e).map(([i,n])=>`${i}=${n}`).join("");return(0,zn.createHash)("sha256").update(t).digest("hex")}static xpathHash(e){return(0,zn.createHash)("sha256").update(e).digest("hex")}static compareHashes(e,t){return e.branchPathHash===t.branchPathHash&&e.attributesHash===t.attributesHash&&e.xpathHash===t.xpathHash}static generateCssSelector(e){let t=e.attributes.id;if(t)return`#${t}`;let i=e.attributes.class;if(i){let n=i.split(/\s+/).filter(o=>o.trim());if(n.length>0)return`${e.tagName}.${n.join(".")}`}return e.tagName}}});var Ta,$t=f(()=>{"use strict";Ta=(e=>(e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.SILENT=4]="SILENT",e))(Ta||{})});var Pt={};tt(Pt,{evaluateStatement:()=>rt,executeAction:()=>fi,executeStep:()=>at,generateActionStep:()=>Lt,runTask:()=>st});var Ot=f(()=>{"use strict";wi();Ln();Pn();St();_n();Sn();kn();bt();Mn();Ke();Cn();si();ri();Fe();ai();Vn();ot();di();Mt();ui();hi();gi();de();Tt();Ie();ti();xt();ii();je();yt();Q();it();z();oe();$t();V();Ee()});var Aa,Ol,Ry,Xn=f(()=>{"use strict";Aa=require("zod"),Ol=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.statement;if(!o)throw new Error("Missing statement for ai_step");let{runTask:a}=await Promise.resolve().then(()=>(Ot(),Pt)),r=await a(o,e,i);if(r.status!=="success")throw new Error(r.error||"Task execution failed")}transpile(e,t){let i=e.action_data?.kwargs?.statement;return i?[`await agent.run(page, ${JSON.stringify(i)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]}},Ry=Aa.z.object({statement:Aa.z.string().describe('The complete step to execute (e.g., "fill in the login form and submit")')})});var Ll,Yn=f(()=>{"use strict";V();P();Ll=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");if(typeof n.kwargs.relative_x=="number"&&typeof n.kwargs.relative_y=="number"){let o=H(e,t);if(o){await o.waitFor({state:"attached",timeout:N(i,t.action_data?.kwargs?.timeout_ms)});let a=await o.boundingBox();if(a){let r=a.x+n.kwargs.relative_x+a.width/2,s=a.y+n.kwargs.relative_y+a.height/2;await e.mouse.move(r,s),await e.waitForTimeout(200),await e.mouse.click(r,s),await e.waitForTimeout(500)}}else throw new Error("Element-anchored coordinates provided but no locator found")}else if(typeof n.kwargs.x=="number"&&typeof n.kwargs.y=="number")await e.mouse.move(n.kwargs.x,n.kwargs.y),await e.waitForTimeout(200),await e.mouse.click(n.kwargs.x,n.kwargs.y),await e.waitForTimeout(500);else throw new Error("Missing or invalid coordinates")}transpile(e){let t=e.action_data?.kwargs||{},i=[];return typeof t.relative_x=="number"&&typeof t.relative_y=="number"?(i.push(`action_data: { kwargs: { relative_x: ${t.relative_x}, relative_y: ${t.relative_y} } }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`)):typeof t.x=="number"&&typeof t.y=="number"&&i.push(`action_data: { kwargs: { x: ${t.x}, y: ${t.y} } }`),['await agent.execAction("click_by_coordinates", page, {',...i.map(n=>` ${n},`),"});"]}}});var Ma,Dl,By,Jn=f(()=>{"use strict";Ma=require("zod"),Dl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.statement;if(!o)throw new Error("Missing statement for ai_action");let a=n.kwargs.use_pure_vision,{executeStep:r}=await Promise.resolve().then(()=>(Ot(),Pt)),s=await r(o,e,i,{usePureVision:a});if(s.status!=="success")throw new Error(s.error||"Action execution failed")}transpile(e,t){let i=e.action_data?.kwargs?.statement;if(!i)return["// Skipping ai_action: missing statement"];let n=JSON.stringify(i),o=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${n}, '${t||""}', ${o});`]}},By=Ma.z.object({statement:Ma.z.string().describe('The action to perform (e.g., "click the submit button")')})});function Rl(e,t){e.register({name:"switch_tab",description:"Switch to a different browser tab by index (0-based).",schema:Zm,async execute(i,n){let o=i.tab_index,{page:a,agentServices:r,actionDescription:s}=n;try{let l={action_description:s||`Switch to tab ${o}`,action_data:{action_name:"switch_tab",kwargs:{page_id:o}}};return await t.execute(a,l,r),{success:!0,actionEntity:l,message:`Switched to tab ${o}`}}catch(l){return{success:!1,error:l.message,actionEntity:{action_description:(s||`Switch to tab ${o}`)+" (failed)",action_data:{action_name:"switch_tab",kwargs:{page_id:o}},feedback:l.message}}}}})}var Ia,Nl,Zm,bi=f(()=>{"use strict";Ia=require("zod"),Nl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.page_id??n.kwargs.tab_index??0;if(typeof o=="number"){let a=e.context().pages(),r=o===-1?a.length-1:o;if(i){let s=await i.switchTab(r);await s.waitForLoadState("load",{timeout:15e3}).catch(()=>{}),await s.waitForTimeout(500)}}else throw new Error("Missing page_id for switch_tab action")}transpile(e){return['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??e.action_data?.kwargs?.tab_index??0} } },`,"});"]}},Zm=Ia.z.object({tab_index:Ia.z.number().int().nonnegative().describe("Index of the tab to switch to (0-based). Use 0 for first tab, 1 for second, etc.")})});async function Wl(e,t,i,n,o,a){let r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("No file paths provided for upload");let s=r.map(c=>{if(c.startsWith("/")||c.match(/^[A-Za-z]:\\/))return c;let u=n.testDataDir||process.cwd();return Hl.default.join(u,c)});h.info(`Uploading files: ${s.join(", ")}`);let l=i.timeout||2e4,d={useFileInput:i.useFileInput||!1,timeout:l};if(i.selector&&typeof i.selector!="string"){let c=i.selector;await qn(e,c,s,d);return}if(i.selector&&typeof i.selector=="string"){let c=i.selector,u=(c.startsWith("xpath="),e.locator(c));await qn(e,u,s,d);return}if(o){let c=r.map(m=>`"${m}"`).join(", "),u="";i.targetDescription?u=`Upload ${c} to ${i.targetDescription}`:u=`Upload ${c}`,h.info(`Using AI to handle file upload: ${u}`),await o(e,u,a)}else throw new Error("No selector provided and AI action execution is not available")}async function qn(e,t,i,n){let{useFileInput:o,timeout:a,mockShowOpenFilePicker:r}=n;if(r){h.info("Using mockShowOpenFilePicker approach");let s=i.map(l=>({path:l,buffer:new Uint8Array(Fl.default.readFileSync(l))}));await e.evaluate(l=>{window.__pw_showOpenFilePicker_mock_files=l},s),await t.click({timeout:a}),await e.waitForTimeout(3e3),await e.evaluate(()=>{delete window.__pw_showOpenFilePicker_mock_files})}else if(o)h.info("Using direct file input approach"),await t.setInputFiles(i,{timeout:a}),await e.waitForTimeout(3e3);else{h.info("Using file chooser approach");let s=e.waitForEvent("filechooser",{timeout:a});s.catch(()=>{}),await t.click({timeout:a}),await(await s).setFiles(i),await e.waitForTimeout(3e3)}h.info(`Successfully uploaded ${i.length} file(s)`)}var Fl,Hl,yi=f(()=>{"use strict";z();Fl=U(require("fs"),1),Hl=U(require("path"),1)});async function Qm(e,t,i={},n){return{...await G(t,e),action_description:n||"Upload file to element",action_data:{action_name:"upload_file",kwargs:{...i}}}}function Ul(e,t){return{action_description:`${e} (failed - element not found)`,action_data:{action_name:"upload_file",kwargs:t},feedback:"Element not found in DOM"}}function Bl(e,t){e.register({name:"upload_file",description:'Click on target element (usually contains hints like "Upload file" or "Choose file" etc.) to trigger the file upload dialog, and choose the files to upload',schema:ep,usesElementIndex:!0,async execute(i,n){let{element_index:o,paths:a}=i,{page:r,agentServices:s,actionDescription:l}=n;try{let d=await q(n,o);if(!d)return{success:!1,error:`File input element with index ${o} not found`,actionEntity:Ul(l||`Upload file to element ${o}`,{index:o,paths:a})};let c=await Qm(d,r,{paths:a},l);return await t.execute(r,c,s),{success:!0,actionEntity:c,message:`Uploaded file to element ${o}`}}catch(d){return{success:!1,error:d.message,actionEntity:Ul(l||`Upload file to element ${o}`,{index:o,paths:a})}}}})}var ae,Gl,ep,Qy,xi=f(()=>{"use strict";yi();Q();V();ae=require("zod");P();Gl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=[];if(n.kwargs.paths?o=Array.isArray(n.kwargs.paths)?n.kwargs.paths:[n.kwargs.paths]:n.kwargs.path&&(o=Array.isArray(n.kwargs.path)?n.kwargs.path:[n.kwargs.path]),o.length===0)throw new Error("No file paths provided for upload_file action");await i.downloadTestDataFiles(o);let a=o.map(d=>i.getTestDataFilePath(d)),r=H(e,t);if(!r)throw new Error("Missing locator for upload_file action");let s=n.kwargs.use_file_input||!1,l=i.getActionSettings().mock_show_open_file_picker??!1;await qn(e,r,a,{useFileInput:s,timeout:N(i,t.action_data?.kwargs?.timeout_ms),mockShowOpenFilePicker:l})}transpile(e){let t=e.action_data?.kwargs||{},i=[],n={};return t.paths?n.paths=t.paths:t.path&&(n.path=t.path),t.use_file_input&&(n.use_file_input=!0),i.push(`action_data: { kwargs: ${JSON.stringify(n)} }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...i.map(o=>` ${o},`),"});"]}};ep=ae.z.object({element_index:ae.z.number().int().describe("Index of the target element to trigger the file upload dialog"),paths:ae.z.union([ae.z.string(),ae.z.array(ae.z.string())]).describe('Path to a file, relative to the test project root (e.g. "fixtures/data.csv"), or an array of such paths.'),timeout_ms:ae.z.number().optional().describe("Per-action timeout in ms. Overrides the default 5s action timeout.")});Qy=ae.z.object({element_index:ae.z.number().int().describe("Index of the file input element"),paths:ae.z.union([ae.z.string(),ae.z.array(ae.z.string())]).describe('Path to a file, relative to the test project root (e.g. "fixtures/data.csv"), or an array of such paths.'),timeout_ms:ae.z.number().optional().describe("Per-action timeout in ms. Overrides the default 5s action timeout.")})});function Kl(e,t){e.register({name:"wait",description:"Wait for a specified number of seconds before continuing.",schema:tp,async execute(i,n){let{seconds:o}=i,{page:a,agentServices:r,actionDescription:s}=n;try{let l={action_description:s||`Wait ${o} seconds`,action_data:{action_name:"wait",kwargs:{seconds:o}}};return await t.execute(a,l,r),{success:!0,actionEntity:l,message:`Waited ${o} seconds`}}catch(l){return{success:!1,error:l.message,actionEntity:{action_description:(s||`Wait ${o} seconds`)+" (failed)",action_data:{action_name:"wait",kwargs:{seconds:o}},feedback:l.message}}}}})}var Ca,jl,tp,vi=f(()=>{"use strict";Ca=require("zod"),jl=class{async execute(e,t){let i=t.action_data;if(!i)throw new Error("Action data not found");let n=i.kwargs.seconds||1;await e.waitForTimeout(n*1e3)}transpile(e){return[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]}},tp=Ca.z.object({seconds:Ca.z.number().positive().describe("Number of seconds to wait")})});function Vl(e,t){e.register({name:"wait_for_download_complete",description:"Wait for an in-progress download to complete.",schema:ip,async execute(i,n){let{timeout_seconds:o=10}=i,{page:a,agentServices:r}=n;try{let s={action_description:`Wait for download to complete (timeout: ${o}s)`,action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}}};return await t.execute(a,s,r),{success:!0,actionEntity:s,message:"Download completed"}}catch(s){return{success:!1,error:s.message,actionEntity:{action_description:"Wait for download to complete (failed)",action_data:{action_name:"wait_for_download_complete",kwargs:{timeout_seconds:o}},feedback:s.message}}}}})}var $a,zl,ip,_i=f(()=>{"use strict";$a=require("zod"),zl=class{async execute(e,t,i){let n=t.action_data;if(!n)throw new Error("Action data not found");let o=n.kwargs.timeout_seconds||10;await i.waitForDownloadComplete(e,o)}transpile(e){return['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]}},ip=$a.z.object({timeout_seconds:$a.z.number().positive().optional().describe("Maximum time in seconds to wait for download to complete (default: 10)")})});function Qn(e,t){if(!e||typeof e!="string")return e;let i=t instanceof Map?Object.fromEntries(t):t,n=a=>{let r=a.startsWith("$")?a.slice(1):a,s=i[r]??i[`$${r}`];return s!=null?String(s):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o=o.replace(/\$\{([^}]+)\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o}var T,dx,bx,vx,kx,eo,lt,Si,np,to,op,ap,rp,sp,lp,cp,dp,up,ct,Dt,Yl,hp,Zn,Ei,sx,lx,io,Jl,ql,Zl,Ql,Pa,mp,Xl,pp,ki,gp,fp,wp,be,bp,yp,cx,xx,Tx,He=f(()=>{"use strict";Ee();T=require("zod"),dx=require("yaml"),bx=require("uuid"),vx=require("uuid"),kx=require("yaml");eo=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(eo||{}),lt=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(lt||{}),Si=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(Si||{}),np="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",to=112,op=1920,ap=1080,rp=1920,sp=1080-to,lp=1280,cp=720,dp=500,up=500,ct="Desktop Chrome",Dt=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Dt||{}),Yl={"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"}},hp={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"]},Zn=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),hp[e].map(n=>Yl[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Ei=e=>Yl[e],sx={desktop:{label:"Desktop",type:"desktop",devices:Zn("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Zn("mobile")}},lx={desktop:{label:"Desktop",type:"desktop",devices:Zn("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Zn("mobile",!0)}},io=(e,t=!1)=>{let i={userAgent:np,viewport:{width:rp,height:sp},isMobile:!1,hasTouch:!1};if(!e||e===ct)return i;let n=Ei(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(dp/o,1),s=Math.max(up/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},Jl=e=>{let t={width:op,height:ap};if(!e||e===ct)return t;let i=io(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+to}:t},ql=e=>{let t={width:lp,height:cp};if(!e||e===ct)return t;let i=io(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},Zl=e=>!e||e===ct?void 0:Ei(e)?.channel,Ql=e=>!e||e===ct?"chromium":Ei(e)?.defaultBrowserType??"chromium",Pa=class ec{constructor(){ha(this,"data",{}),ha(this,"sensitive",new Set)}get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new ec;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}},mp=T.z.enum(["JS_CODE","AI_MODE"]),Xl=T.z.object({type:mp,expression:T.z.string()}),pp=T.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),ki=T.z.object({uid:T.z.string(),type:pp,comment:T.z.string().optional()}),gp=T.z.object({action_data:T.z.object({action_name:T.z.string(),kwargs:T.z.record(T.z.any()).optional(),args:T.z.array(T.z.any()).optional()}),action_description:T.z.string().optional(),url:T.z.string().optional(),xpath:T.z.string().nullable().optional(),locator:T.z.string().nullable().optional(),css_selector:T.z.string().nullable().optional(),unique_selector:T.z.string().nullable().optional(),element_index:T.z.number().nullable().optional(),frame_path:T.z.array(T.z.any()).optional(),artifacts:T.z.record(T.z.any()).optional(),feedback:T.z.string().optional(),original_browser_use_action:T.z.any().optional()}).passthrough(),fp=ki.extend({type:T.z.literal("DRAFT"),description:T.z.string()}),wp=ki.extend({type:T.z.literal("ACTION"),description:T.z.string(),action_entity:gp.optional(),locator:T.z.string().optional(),use_pure_vision:T.z.boolean().optional()}),be=T.z.lazy(()=>T.z.union([fp,wp,ki.extend({type:T.z.literal("STEP"),description:T.z.string().optional().default(""),statements:T.z.array(be),reference_id:T.z.number().optional(),template_path:T.z.string().optional(),template_params:T.z.record(T.z.string()).optional()}),ki.extend({type:T.z.literal("IF_ELSE"),description:T.z.string().optional(),condition:Xl,then:T.z.array(be),else:T.z.array(be).optional()}),ki.extend({type:T.z.literal("WHILE_LOOP"),description:T.z.string().optional(),condition:Xl,body:T.z.array(be),timeout_ms:T.z.number().optional()})])),bp=T.z.object({name:T.z.string(),statements:T.z.array(be),teardown:T.z.array(be).optional(),skip:T.z.union([T.z.boolean(),T.z.string()]).optional(),timeout:T.z.number().optional(),fail:T.z.union([T.z.boolean(),T.z.string()]).optional(),only:T.z.boolean().optional(),slow:T.z.boolean().optional()}),yp=T.z.object({tests:T.z.array(bp).min(1),beforeAll:T.z.array(be).optional(),afterAll:T.z.array(be).optional(),beforeEach:T.z.array(be).optional(),afterEach:T.z.array(be).optional()}),cx=T.z.object({comment:T.z.string().optional(),version:T.z.string().optional(),goal:T.z.string().optional(),url:T.z.string().optional(),baseURL:T.z.string().optional(),final_feedback:T.z.string().optional(),completed:T.z.boolean().optional(),success:T.z.boolean().optional(),statements:T.z.array(be).optional(),teardown:T.z.array(be).optional(),last_modified_at:T.z.string().optional(),testGroup:yp.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"}),xx=1024*1024,Tx=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"])});var Xe,dt=f(()=>{"use strict";Xe=`
4101
4101
  // check to make sure we're not inside the PDF viewer
4102
4102
  window.isPdfViewer = !!document?.body?.querySelector('body > embed[type="application/pdf"][width="100%"]')
4103
4103
  if (!window.isPdfViewer) {
@@ -4429,7 +4429,7 @@ ${m.body}`,y=await _g(g,o,t.model);h.info(`Extracted content: ${y}`),y&&y!=="NOT
4429
4429
  `)}var Ao,er=f(()=>{"use strict";qa();Qa();bi();xi();vi();_i();Ti();Ai();Ii();Ci();$i();Oi();Di();Ni();Fi();Hi();Wi();Ui();Gi();Bi();ji();Ki();Vi();Xi();Yi();Ji();qi();Zi();Qi();Ao=null});async function xd(){await Eg}function vd(){return Y}function _d(e=!0){let t=new Et;return e&&(Mo(t),Io(t),Co(t),$o(t),Po(t),Oo(t),Lo(t),No(t),Do(t),Ro(t)),t}async function kd(){let e=new Et,t=await bd(e),i=yd(t);return{registry:e,capabilities:t,summary:i}}function Sd(){return["- Mouse: Click, hover, double-click, right-click or drag on elements","- Navigation: Navigate to URLs, go back, or reload the page","- Input: Type text into inputs, clear input fields, or press keyboard keys","- Scroll: Scroll the page or scroll to specific text/elements","- Tabs: Switch between browser tabs or close tabs","- Files: Upload files or wait for downloads to complete","- Forms: Get dropdown options or select dropdown values","- Utility: Wait for conditions, save variables, or complete tasks","- Auth: Generate 2FA codes or extract email/activation codes","- AI: Perform AI-powered verifications, extractions, or wait conditions"].join(`
4430
4430
  `)}var Sg,Eg,Ed=f(()=>{"use strict";er();Fe();Sg=[Mo(Y),Io(Y),Co(Y),$o(Y),Po(Y),Oo(Y),Lo(Y),Do(Y),Ro(Y),No(Y)],Eg=Promise.all(Sg)});function Ad(e){return e.getTools().map(t=>({name:t.name,description:t.description,inputSchema:Tn(t.schema)}))}var Td,Md=f(()=>{"use strict";ai();Td=class{constructor(e,t){this.registry=e,this.getContext=t}getToolDefinitions(){return this.registry.getTools().filter(e=>e.availability.mcp).map(e=>({name:e.name,description:e.description,inputSchema:Tn(e.schema)}))}getToolDefinitionsFiltered(e){let t=new Set(e);return this.registry.getTools().filter(i=>t.has(i.name)&&i.availability.mcp).map(i=>({name:i.name,description:i.description,inputSchema:Tn(i.schema)}))}async createServer(e="web-sdk-tools"){throw new Error("MCP server creation not yet implemented. Install and configure an MCP SDK like @modelcontextprotocol/sdk")}async executeTool(e,t){let i=await this.getContext(),n=await this.registry.execute(e,t,i);return{content:[{type:"text",text:n.success?n.message||"Tool executed successfully":n.error||"Tool execution failed"}]}}getToolCount(){return this.registry.size()}getToolNames(){return this.registry.getToolNames()}}});var Id=f(()=>{"use strict"});function tr(e){let t=e.toLowerCase();return t.includes("claude")||t.includes("anthropic")?"anthropic":t.includes("gemini")||t.includes("google")?"gemini":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")||t.startsWith("o4")||t.includes("openai")?"openai":"unknown"}function Tg(e){switch(e.actionType){case"execute":case"run":return"action";case"generate":return"draft";case"assert":return"verify_ai";case"evaluate":return e.conditionKind==="while"?"evaluate_while":e.conditionKind==="wait_until"?"evaluate_wait_until":"evaluate_if";default:return null}}function Cd(e,t){let i=e[t];return typeof i=="number"?i:0}function Ag(e,t,i,n){return`${e}\0${t}\0${i}\0${n}`}function $d(e,t={}){let i=t.routing??"proxy",n=t.providerOf??tr,o=new Map;for(let a of e??[]){let r=Tg(a);if(r)for(let s of a.tokenUsages??[]){let l=s.model??"unknown",d=n(l),c=Ag(r,d,l,i),u=o.get(c);u||(u={operation:r,provider:d,model:l,routing:i,calls:0,input_tokens:0,output_tokens:0,thinking_tokens:0,cache_read_tokens:0},o.set(c,u)),u.calls+=1,u.input_tokens+=s.prompt_tokens||0,u.output_tokens+=s.completion_tokens||0,u.thinking_tokens+=Cd(s,"thinking_tokens"),u.cache_read_tokens+=Cd(s,"cache_read_tokens")}}return{by_operation:Array.from(o.values()).sort((a,r)=>a.operation!==r.operation?a.operation.localeCompare(r.operation):a.provider!==r.provider?a.provider.localeCompare(r.provider):a.model.localeCompare(r.model))}}var Pd=f(()=>{"use strict"});function Od(){let e=process.env.OMNITERM_BROWSER_REGISTRY_URL;return e?e.replace(/\/$/,""):null}async function Ut(e){let t=Od();if(!t)return null;try{let i=await fetch(`${t}/browsers`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});return i.ok?(await i.json()).id??null:null}catch{return null}}async function Gt(e){if(!e)return;let t=Od();if(t)try{await fetch(`${t}/browsers/${encodeURIComponent(e)}`,{method:"DELETE"})}catch{}}var ir=f(()=>{"use strict"});async function Mg(e,t){let i=JSON.parse(Ye.default.readFileSync(t,"utf-8"));i.cookies?.length&&await e.addCookies(i.cookies)}var Ye,Ld,Bt,ut,Dd,Nd=f(()=>{"use strict";ir();He();$e();dt();z();Ye=U(require("fs"),1),Ld=U(require("os"),1),Bt=U(require("path"),1),ut=require("playwright");Dd=class{constructor(e={}){e.testDir&&(this.testDir=e.testDir,this.videoBasePath=Bt.default.join(e.testDir,"videos"),this.statesBasePath=Bt.default.join(e.testDir,"states"),this.downloadsBasePath=Bt.default.join(e.testDir,"downloads"),Ye.default.mkdirSync(this.videoBasePath,{recursive:!0}),Ye.default.mkdirSync(this.statesBasePath,{recursive:!0}),Ye.default.mkdirSync(this.downloadsBasePath,{recursive:!0})),this.terminationTimeout=e.terminationTimeout??null,this.defaultHeadless=e.headless??!1,this.additionalArgs=e.additionalArgs??[]}async launchBrowser(e={}){let t=e.debugPort,i=e.headless??this.defaultHeadless,n=Ql(e.deviceName),o=Zl(e.deviceName),a=n===Dt.Chromium,r=!!e.extensionPath;h.info(`[BrowserManager] Launching ${n} browser for device: ${e.deviceName||"default"}${t?` on port ${t}`:""}`);let s={headless:i};if(a){r&&i&&(h.warn("[BrowserManager] Extension requested in headless mode; forcing headed mode to load extension."),i=!1,s.headless=!1);let k=[];(e.enableCamera||e.enableMicrophone)&&(k.push("--use-fake-device-for-media-stream","--use-fake-ui-for-media-stream"),e.enableMicrophone&&e.fakeAudioCapturePath&&(k.push(`--use-file-for-fake-audio-capture=${e.fakeAudioCapturePath}`),h.info(`[BrowserManager] Using fake audio capture file: ${e.fakeAudioCapturePath}`)));let S=r&&e.extensionPath?[`--disable-extensions-except=${e.extensionPath}`,`--load-extension=${e.extensionPath}`]:[];s.args=[...tc(t,e.disableSecurity??!0,i),...k,...S,...this.additionalArgs],o&&(s.channel=o,h.debug(`[BrowserManager] Launching browser with channel: ${o}`))}let l=io(e.deviceName),d=ql(e.deviceName),c={acceptDownloads:!0,...l,timezoneId:e.timezoneId||"America/Los_Angeles",locale:e.locale||"en-US"};e.viewport&&(c.viewport=e.viewport,c.screen=e.viewport),e.isMobile!==void 0&&(c.isMobile=e.isMobile),e.hasTouch!==void 0&&(c.hasTouch=e.hasTouch),e.userAgent&&(c.userAgent=e.userAgent),e.colorScheme&&(c.colorScheme=e.colorScheme),e.geolocation&&(c.geolocation=e.geolocation,c.permissions=[...c.permissions||[],"geolocation"]);let u=r&&a?e.localStorageStatePath:void 0;e.localStorageStatePath&&!u&&(c.storageState=e.localStorageStatePath),e.recordVideo&&this.videoBasePath&&(c.recordVideo={dir:this.videoBasePath,size:{width:d.width,height:d.height}}),e.proxy&&(c.proxy=e.proxy),e.extraHTTPHeaders&&Object.keys(e.extraHTTPHeaders).length>0&&(c.extraHTTPHeaders=e.extraHTTPHeaders);let m,g,y,_=!1;if(a&&(r||e.userDataDir)){if(e.userDataDir)y=e.userDataDir;else{let S=this.testDir||Ye.default.mkdtempSync(Bt.default.join(Ld.default.tmpdir(),"shiplight-"));y=Bt.default.join(S,`ext-profile-${Date.now()}`),Ye.default.mkdirSync(y,{recursive:!0}),_=!0}let k={...s,...c};g=await ut.chromium.launchPersistentContext(y,k),u&&(await Mg(g,u),h.info(`[BrowserManager] Loaded storage state into persistent context from ${u}`)),m=g.browser(),h.info(`[BrowserManager] Launched persistent context${e.extensionPath?` for extension at ${e.extensionPath}`:` with profile at ${y}`}`)}else{switch(n){case Dt.Firefox:m=await ut.firefox.launch(s);break;case Dt.Webkit:m=await ut.webkit.launch(s);break;case Dt.Chromium:default:m=await ut.chromium.launch(s);break}g=await m.newContext(c)}if(g.addInitScript(Xe),a){let k=["clipboard-read","clipboard-write"];e.enableCamera&&k.push("camera"),e.enableMicrophone&&k.push("microphone");try{await g.grantPermissions(k),h.info(`[BrowserManager] Granted permissions: ${k.join(", ")}`)}catch(S){h.warn("[BrowserManager] Failed to grant permissions:",S)}}else(e.enableCamera||e.enableMicrophone)&&h.warn("[BrowserManager] Camera/microphone enabled but browser is not Chromium; ignoring.");if(e.cookies&&e.cookies.length>0){let k=(Date.now()+31536e6)/1e3,S=e.cookies.map(I=>({...I,expires:k}));await g.addCookies(S),h.info(`[BrowserManager] Added ${e.cookies.length} cookies to browser context with expires=${k}`)}let x=e.viewport,p=x?{width:x.width,height:x.height+to}:Jl(e.deviceName);if(h.info(`[BrowserManager] windowSize=${JSON.stringify(p)}`),a){let k=async S=>{try{await oo(S,p.width,p.height),x&&await S.setViewportSize(x)}catch(I){h.warn("[BrowserManager] Failed to set window bounds via CDP:",I)}};for(let S of g.pages())await k(S);g.on("page",k)}let b="";if(a&&t!==void 0)try{b=await no(t)}catch(k){h.warn("[BrowserManager] Failed to get CDP WebSocket URL:",k)}let E=null;b&&(E=await Ut({cdpUrl:b,label:`agent ${e.deviceName??n}`,pid:process.pid}),E&&h.info(`[BrowserManager] Registered browser with dev-box registry id=${E}`));let v={debugPort:t,browser:m,context:g,startTime:new Date,timeout:null,browserWsUrl:b,downloadsBasePath:this.downloadsBasePath,browserType:n,userDataDir:y,isTempUserDataDir:_,registryId:E};if(this.terminationTimeout!==null){let k=setTimeout(()=>{h.info(`[BrowserManager] Browser auto-terminated after ${this.terminationTimeout}ms`),this.terminateBrowser(v).catch(S=>h.error("[BrowserManager] Error terminating browser:",S))},this.terminationTimeout);v.timeout=k}return v}async terminateBrowser(e){if(e.timeout&&clearTimeout(e.timeout),await Gt(e.registryId??null),await e.context.close(),await e.browser.close(),e.isTempUserDataDir&&e.userDataDir)try{Ye.default.rmSync(e.userDataDir,{recursive:!0,force:!0})}catch(t){h.warn("[BrowserManager] Failed to clean up temp user data dir:",e.userDataDir,t)}}getVideoBasePath(){return this.videoBasePath}getStatesBasePath(){return this.statesBasePath}getDownloadsBasePath(){return this.downloadsBasePath}}});function Ig(){if(process.platform==="win32"){let i=(0,nr.execFileSync)("powershell.exe",["-NoProfile","-NonInteractive","-Command","Get-CimInstance Win32_Process | Select-Object ProcessId,ParentProcessId,CommandLine | ConvertTo-Json -Compress"],{encoding:"utf-8",timeout:1e4}),n=JSON.parse(i.trim());return(Array.isArray(n)?n:[n]).filter(o=>o!==null&&typeof o=="object").filter(o=>typeof o.ProcessId=="number").map(o=>({pid:o.ProcessId,ppid:typeof o.ParentProcessId=="number"?o.ParentProcessId:0,args:typeof o.CommandLine=="string"?o.CommandLine:""}))}let e=(0,nr.execFileSync)("ps",["-axo","pid=,ppid=,args="],{encoding:"utf-8"}),t=[];for(let i of e.split(`
4431
4431
  `)){let n=i.trimStart().match(/^(\d+)\s+(\d+)\s+(.*)$/);n&&t.push({pid:parseInt(n[1],10),ppid:parseInt(n[2],10),args:n[3]})}return t}function Cg(e){let t=Ig(),i=new Set([e]),n=!0;for(;n;){n=!1;for(let o of t)!i.has(o.pid)&&i.has(o.ppid)&&(i.add(o.pid),n=!0)}for(let o of t){if(o.pid===e||!i.has(o.pid)||!/chrome|chromium/i.test(o.args))continue;let a=o.args.match(/--user-data-dir=(?:"([^"]+)"|(\S+))/);if(a)return a[1]??a[2]}return null}async function $g(e,t){let i=Fd.join(e,"DevToolsActivePort"),n=Date.now()+t;for(;Date.now()<n;){try{let o=Rd.readFileSync(i,"utf-8").trim(),[a,r]=o.split(`
4432
- `),s=parseInt(a,10);if(Number.isFinite(s)&&s>0&&typeof r=="string"&&r.startsWith("/"))return{port:s,wsPath:r}}catch{}await new Promise(o=>setTimeout(o,100))}throw new Error(`Timed out waiting for ${i} \u2014 Chromium never exposed DevTools`)}async function Fo(e,t=3e4){let i=Cg(e);if(!i)throw new Error(`No Chromium descendant of pid ${e} with --user-data-dir found. Did you launch with --remote-debugging-port=0 and is the browser still running?`);let{port:n,wsPath:o}=await $g(i,t);return`ws://127.0.0.1:${n}${o}`}var nr,Rd,Fd,Hd=f(()=>{"use strict";nr=require("child_process"),Rd=U(require("fs"),1),Fd=U(require("path"),1)});var Wd,Ud=f(()=>{"use strict";He();Wd=e=>{if(!e||e===lt)return"desktop";let t=Si(e);return t&&t.isMobile?"mobile":"desktop"}});var Pg,Gd=f(()=>{"use strict";Pg=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(Pg||{})});var or,Ho,ar=f(()=>{"use strict";or=(e=>(e.Started="started",e.Action="action",e.Completion="completion",e.Error="error",e.Aborted="aborted",e.Keepalive="keepalive",e))(or||{}),Ho=class extends Error{constructor(e){super(e),this.name="AgentTaskFailedError",this.details=e}}});async function Bd(e,t){let i=Object.getPrototypeOf(async()=>{}).constructor,n=`
4432
+ `),s=parseInt(a,10);if(Number.isFinite(s)&&s>0&&typeof r=="string"&&r.startsWith("/"))return{port:s,wsPath:r}}catch{}await new Promise(o=>setTimeout(o,100))}throw new Error(`Timed out waiting for ${i} \u2014 Chromium never exposed DevTools`)}async function Fo(e,t=3e4){let i=Cg(e);if(!i)throw new Error(`No Chromium descendant of pid ${e} with --user-data-dir found. Did you launch with --remote-debugging-port=0 and is the browser still running?`);let{port:n,wsPath:o}=await $g(i,t);return`ws://127.0.0.1:${n}${o}`}var nr,Rd,Fd,Hd=f(()=>{"use strict";nr=require("child_process"),Rd=U(require("fs"),1),Fd=U(require("path"),1)});var Wd,Ud=f(()=>{"use strict";He();Wd=e=>{if(!e||e===ct)return"desktop";let t=Ei(e);return t&&t.isMobile?"mobile":"desktop"}});var Pg,Gd=f(()=>{"use strict";Pg=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(Pg||{})});var or,Ho,ar=f(()=>{"use strict";or=(e=>(e.Started="started",e.Action="action",e.Completion="completion",e.Error="error",e.Aborted="aborted",e.Keepalive="keepalive",e))(or||{}),Ho=class extends Error{constructor(e){super(e),this.name="AgentTaskFailedError",this.details=e}}});async function Bd(e,t){let i=Object.getPrototypeOf(async()=>{}).constructor,n=`
4433
4433
  return await (${t});
4434
4434
  `;return await new i("page",n)(e)}async function tn(e,t,i){let n=[],o=[];for(let a of t){let r=!1;try{let s=`page.${a}`;w.log(`Checking element existence: ${s}`),n.push(`Checking element existence: ${s}`);try{await Bd(e,`${s}.waitFor({ state: 'attached', timeout: ${Og} })`),w.log(`Element is attached: ${s}`),n.push(`Element is attached: ${s}`),r=!0}catch{await Bd(e,`${s}.count()`)>0?(w.log(`Element found (snapshot): ${s}`),n.push(`Element found (snapshot): ${s}`),r=!0):(w.log(`Element not found: ${s}`),n.push(`Element not found: ${s}`),r=!1)}}catch(s){w.log(`Error checking element: ${s.message}`),n.push(`Error checking element: ${s.message}`),r=!1}if(o.push(r),!r&&i)break}return{successResults:o,logs:n}}async function rr(e,t,i=!0){let{successResults:n,logs:o}=await tn(e,t,i);return{success:n.length===t.length&&n.every(a=>a),logs:o}}async function nn(e,t){if(!t||t.length===0)return w.log("No validation expressions provided, cannot validate login"),!1;w.log(`Validating login with ${t.length} expression(s)`);let{success:i,logs:n}=await rr(e,t,!0);return i?w.log("All validation expressions passed"):w.log(`Validation failed: ${n.join(", ")}`),i}async function sr(e,t){let i=e.context().browser();if(!i)throw new Error("Cannot create unsigned-in context: browser not available");let n=await i.newContext(),o=await n.newPage();return await o.goto(t),await We(o,Lg),{context:n,page:o,close:async()=>{await o.close(),await n.close()}}}async function lr(e,t,i,n,o,a){let r=`
4435
4435
  Based on the current page status, generate ${o} Playwright locators in JavaScript code that can
@@ -4491,7 +4491,7 @@ ${m.join(`
4491
4491
  ${e.trim()}`:this.context.agentNote=e.trim())}readVariable(e){let t=e.startsWith("$")?e.slice(1):e,i=this.context.variableStore.get(t);return h.debug(`Read variable: ${t} = ${JSON.stringify(i)}`),i}async generate2faCode(e){try{let t=(0,Go.generateSync)({secret:e,guardrails:Dg});return h.info(`Generated 2FA code: ${t}`),t}catch(t){throw h.error(`Failed to generate 2FA code: ${t.message}`),new Error(`Failed to generate 2FA code: ${t.message}`)}}async getDOMText(e){return await e.evaluate(()=>document.body.innerText)}async waitUntilStable(e,t){return We(e,t)}setPage(e){this.context.setPage?(h.info("[AgentServices] Calling setPage callback"),this.context.setPage(e)):h.debug("[AgentServices] setPage callback not configured")}getModel(){if(!this.context.model)throw new Error("No LLM model configured. An LLM model is required for AI-powered actions (login, verify, ai_extract, ai_wait_until, etc.). Set GOOGLE_API_KEY or ANTHROPIC_API_KEY in your MCP server configuration.");return this.context.model}getFallbackModels(){return this.context.fallbackModels??[]}getComputerUseModel(){return this.context.computer_use_model}getComputerUseFallbackModels(){return this.context.computer_use_fallback_models??[]}get variableStore(){return this.context.variableStore}getDownloadDir(){return this.context.downloadDir}getActionSettings(){return this.context.organizationSettings?.action_code_conversion_settings||{}}getInteractiveClassNames(){return this.context.organizationSettings?.agent_settings?.interactive_class_names||[]}getIframeFallbackDomains(){return this.context.organizationSettings?.agent_settings?.iframe_fallback_domains||[]}isUseCleanScreenshotForAssertion(){return this.context.organizationSettings?.use_clean_screenshot_for_assertion??!0}isKnowledgeImagesEnabled(){return this.context.organizationSettings?.agent_settings?.enable_knowledge_images||!1}isSlicedScreenshotsEnabled(){return this.context.organizationSettings?.agent_settings?.use_sliced_screenshots||!1}isResizeSlicedScreenshotsEnabled(){return this.context.organizationSettings?.agent_settings?.resize_sliced_screenshots||!1}isAccessibilityTreeEnabled(){return this.context.organizationSettings?.agent_settings?.use_accessibility_tree||!1}isActionIntentFilteringEnabled(){return this.context.organizationSettings?.agent_settings?.use_action_intent_filtering||!1}isDomTreeTsEnabled(){let e=process.env.USE_DOM_TREE_TS;return e!==void 0?e==="true"||e==="1":this.context.organizationSettings?.agent_settings?.use_dom_tree_ts||!1}setExtensionEnabled(e){this.extensionEnabled=e}getDomServiceOptions(){return{useDomTreeTs:this.isDomTreeTsEnabled(),domTreeRoot:this.extensionEnabled?"document":"body"}}setKnowledgeRetriever(e){this.knowledgeRetriever=e}hasKnowledgeRetriever(){return this.knowledgeRetriever!==void 0}async retrieveKnowledges(e,t,i,n){if(!this.knowledgeRetriever)return h.debug("[AgentServices] No knowledge retriever configured"),[];try{let o=await this.knowledgeRetriever(e,t,i,n);return h.debug(`[AgentServices] Retrieved ${o.length} knowledges for statement`),o}catch(o){return h.warn(`[AgentServices] Failed to retrieve knowledges: ${o.message}`),[]}}}});async function Ng(e){let t;try{t=await an.promises.stat(e)}catch{throw new Error(`agent.ai: file not found or unreadable: ${e}`)}if(!t.isFile())throw new Error(`agent.ai: not a file: ${e}`);if(t.size>Vd)throw new Error(`agent.ai: file exceeds the ${Math.floor(Vd/(1024*1024))}MB attachment limit (${t.size} bytes): ${e}`);let i=jo.extname(e).toLowerCase(),n=jo.basename(e);if(Xd[i])return{parts:[{type:"image",image:await an.promises.readFile(e)}],imageCount:1};if(Yd[i])return{parts:[{type:"file",data:await an.promises.readFile(e),mediaType:Yd[i],filename:n}],imageCount:0};if(Jd.has(i)){let o=await an.promises.readFile(e,"utf-8");return{parts:[{type:"text",text:`File: ${n}
4492
4492
  ---
4493
4493
  ${o}
4494
- ---`}],imageCount:0}}throw new Error(`agent.ai: ${i?`unsupported attachment type "${i}"`:"file has no extension, cannot determine attachment type"} (${e}). Supported: PDF, images (${Object.keys(Xd).join(", ")}), and text files (${[...Jd].join(", ")}). For other formats, parse the file in code and pass the extracted text in the prompt.`)}async function Zd(e,t,i){let n=[],o=0;for(let s of t){let{parts:l,imageCount:d}=await Ng(s);n.push(...l),o+=d}n.push({type:"text",text:e});let a=Me(i,void 0),r=await(0,qd.generateText)({model:ge(i),messages:[{role:"user",content:n}],...a!==void 0?{temperature:a}:{},providerOptions:fe(i,o)});return{text:r.text,tokenUsage:ze(r.usage,i)}}var an,jo,qd,Vd,Xd,Yd,Jd,ur=f(()=>{"use strict";Tt();Ie();an=U(require("fs"),1),jo=U(require("path"),1),qd=require("ai"),Vd=20*1024*1024,Xd={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"},Yd={".pdf":"application/pdf"},Jd=new Set([".txt",".csv",".tsv",".json",".md",".markdown",".html",".htm",".xml",".yaml",".yml",".log"])});var Qd={};tt(Qd,{LoginType:()=>ct,checkLocators:()=>tn,createUnsignedInContext:()=>sr,generateAndValidateLoginLocators:()=>Wo,generateValidationLocators:()=>lr,validateLogin:()=>nn,validateLoginLocators:()=>rr});var eu=f(()=>{"use strict";Uo();de();He();$e();dt();z();oe();$t();Ee()});function Fg(e){try{let t=e.toString(),i,n=t.indexOf("=>");if(n!==-1){let s=t.slice(n+2).trim();if(s.startsWith("{")){let l=s.lastIndexOf("}");i=s.slice(1,l)}else return s.trim()}else{let s=t.indexOf("{"),l=t.lastIndexOf("}");s!==-1&&l>s&&(i=t.slice(s+1,l))}if(!i)return;let o=i.split(`
4494
+ ---`}],imageCount:0}}throw new Error(`agent.ai: ${i?`unsupported attachment type "${i}"`:"file has no extension, cannot determine attachment type"} (${e}). Supported: PDF, images (${Object.keys(Xd).join(", ")}), and text files (${[...Jd].join(", ")}). For other formats, parse the file in code and pass the extracted text in the prompt.`)}async function Zd(e,t,i){let n=[],o=0;for(let s of t){let{parts:l,imageCount:d}=await Ng(s);n.push(...l),o+=d}n.push({type:"text",text:e});let a=Me(i,void 0),r=await(0,qd.generateText)({model:ge(i),messages:[{role:"user",content:n}],...a!==void 0?{temperature:a}:{},providerOptions:fe(i,o)});return{text:r.text,tokenUsage:ze(r.usage,i)}}var an,jo,qd,Vd,Xd,Yd,Jd,ur=f(()=>{"use strict";Tt();Ie();an=U(require("fs"),1),jo=U(require("path"),1),qd=require("ai"),Vd=20*1024*1024,Xd={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp",".gif":"image/gif"},Yd={".pdf":"application/pdf"},Jd=new Set([".txt",".csv",".tsv",".json",".md",".markdown",".html",".htm",".xml",".yaml",".yml",".log"])});var Qd={};tt(Qd,{LoginType:()=>lt,checkLocators:()=>tn,createUnsignedInContext:()=>sr,generateAndValidateLoginLocators:()=>Wo,generateValidationLocators:()=>lr,validateLogin:()=>nn,validateLoginLocators:()=>rr});var eu=f(()=>{"use strict";Uo();de();He();$e();dt();z();oe();$t();Ee()});function Fg(e){try{let t=e.toString(),i,n=t.indexOf("=>");if(n!==-1){let s=t.slice(n+2).trim();if(s.startsWith("{")){let l=s.lastIndexOf("}");i=s.slice(1,l)}else return s.trim()}else{let s=t.indexOf("{"),l=t.lastIndexOf("}");s!==-1&&l>s&&(i=t.slice(s+1,l))}if(!i)return;let o=i.split(`
4495
4495
  `),a=o.filter(s=>s.trim().length>0);if(a.length===0)return;let r=Math.min(...a.map(s=>s.match(/^(\s*)/)?.[1].length??0));return o.map(s=>s.slice(r)).join(`
4496
4496
  `).trim()}catch{return}}function jt(e,t){let i={};for(let[n,o]of Object.entries(e))i[n]=t.has(n)?"*****":o;return i}var ee,re,Rg,Hg,Wg,hr,tu=f(()=>{"use strict";ar();wi();ot();Uo();de();dr();ur();yi();He();Nt();z();ee=U(require("fs"),1),re=U(require("path"),1),Rg=1;Hg=3,Wg=40;hr=class{constructor(e){this.context=e,this._newActionEntities=new Map,this.agentServices=new Bo(e),this.agentServices.agent=this,this.context.tokenUsages||(this.context.tokenUsages=[])}getNewActionEntities(){return this._newActionEntities}getAgentNote(){return this.context.agentNote||void 0}async getActionHandler(){if(!this._actionHandler){let{default:e}=await Promise.resolve().then(()=>(Ht(),Ft));this._actionHandler=new e}return this._actionHandler}async execAction(e,t,i){let n=(await this.getActionHandler()).getAction(e);if(!n)throw new Error(`Unknown action: ${e}`);await n.execute(t,i,this.agentServices)}async dismissModalIfPresent(e,t){try{let i=await this.execute(e,`TASK: Check if there is an INTRUSIVE POPUP blocking the page, and dismiss it if present.
4497
4497
 
@@ -4527,7 +4527,7 @@ If the page is not signed in, sign in with the OAuth provider "${l.provider_name
4527
4527
  `}t.additional_prompt&&(s+=`
4528
4528
  Additional instructions: ${t.additional_prompt}
4529
4529
  `);try{w.log("Level 3: Attempting agent-based login"),w.log(`Login prompt:
4530
- ${s}`);let l=this.agentServices.knowledgeRetriever,d=!1;this.agentServices.hasKnowledgeRetriever()&&l&&(w.log("Setting up login knowledge retriever..."),this.agentServices.setKnowledgeRetriever(async(_,x,p,b)=>await l(_,x,p,"login")),d=!0,w.log("Login knowledge retriever configured"));let c;try{if(c=await this.run(e,s,"login"),!c.success)return w.log("Level 3 FAILED: Agent login failed"),h.info("Login: Failed"),{success:!1,page:e}}finally{d&&l&&(this.agentServices.setKnowledgeRetriever(l),w.log("Restored original knowledge retriever"))}let u=await e.context().storageState(),m;if(o)w.log("Skipping validation locator generation (AI verification mode enabled)");else if(t.num_verification_exprs!==0)try{w.log("Generating validation locators for future login verification...");let _=await Wo(e,t.site_url,{verification_hint:t.verification_hint,num_verification_exprs:t.num_verification_exprs},async(x,p)=>this.run(x,p),async x=>this.getDOMText(x));_?(m=_,w.log(`Generated ${m.length} validation locator(s): ${JSON.stringify(m)}`)):w.log("Failed to generate validation locators, login will still succeed")}catch(_){w.log(`Error generating validation locators: ${_.message}`)}else w.log("Skipping validation locator generation (num_verification_exprs=0)");w.log("Level 3 SUCCESS: Agent login succeeded"),h.info("Login: Agent login succeeded");let g=c.actions||[],y=g.length>0?g:i?.cached_actions;return{success:!0,page:e,storage_state:u,cached_actions:y,validation_exprs:m}}catch(l){return w.error(`Agent login failed: ${l.message}`),h.info("Login: Failed"),{success:!1,page:e}}}async executeCachedLogin(e,t,i){let n=(await Promise.resolve().then(()=>(Ht(),Ft))).default,o=new n;for(let a=0;a<t.length;a++){let r=t[a];w.log(`Executing cached action ${a+1}/${t.length}: ${r.action_description||r.action_data?.action_name}`);try{if(!r.action_data){w.log(`Action ${a+1} missing action_data, skipping`);continue}await o.execute(e,r,this.agentServices),await this.waitUntilStable(e,5e3)}catch(s){return w.error(`Cached action ${a+1} failed: ${s.message}`),{success:!1}}}return i?.aiVerificationStatement?(w.log("Verifying cached login result with AI verification statement"),await this.evaluate(e,i.aiVerificationStatement)?{success:!0}:{success:!1}):i?.validationExprs&&i.validationExprs.length>0?await nn(e,i.validationExprs)?{success:!0}:{success:!1}:(w.log("Cached login cannot be verified: missing AI verification statement and validation expressions"),{success:!1})}async login(e,t){let i={site_url:t.url,num_verification_exprs:0,account:{type:ct.PASSWORD,username:t.username,password:t.password,...t.totpSecret&&{two_factor_auth_config:{type:Ei.TOTP,data:t.totpSecret}}}};return(await this.loginPage(e,i)).success}getCompletedExecutionHistory(){if(!this.context.executionHistory||this.context.executionHistory.length===0)return[];let e=this.context.executionHistory[this.context.executionHistory.length-1];return!e[1]||e[1].trim()===""?this.context.executionHistory.slice(0,-1):this.context.executionHistory}addToExecutionHistory(e,t){this.context.executionHistory||(this.context.executionHistory=[]),this.context.executionHistory.push([e,t])}async createStepResult(e,t,i,n){if(this.context.stepTracking&&!this.context.stepTracking.results[t]){this.context.stepTracking.currentStepId=t,this.context.stepTracking.onStepChange&&this.context.stepTracking.onStepChange(t);try{e=this.agentServices.validatePage(e),await this.waitUntilStable(e);let o={description:i,startTime:Date.now(),artifacts:[],type:n,code:i};if(this.context.stepTracking.artifactsDir){let a=re.join(this.context.stepTracking.artifactsDir,t.replace(/\./g,"-"));ee.mkdirSync(a,{recursive:!0});let r=re.join(a,"screenshot.png");e=this.agentServices.validatePage(e),await e.screenshot({type:"png",path:r}),o.screenshot=r}o.contextBefore=this.snapshotVariables(),this.context.stepTracking.results[t]=o}catch(o){h.warn(`createStepResult failed for step ${t}: ${o}`),this.context.stepTracking.results[t]={description:i,startTime:Date.now(),artifacts:[],contextBefore:this.snapshotVariables()}}}}snapshotVariables(){return jt(this.context.variableStore.getAll(),this.context.variableStore.getAllSensitiveKeys())}saveDebugInfoToFiles(e,t,i,n=0){let o={};if(!this.context.stepTracking?.artifactsDir)return h.debug("[saveDebugInfoToFiles] No artifacts directory configured, skipping debug info save"),o;let a=re.join(this.context.stepTracking.artifactsDir,e.replace(/\./g,"-"));try{if(ee.mkdirSync(a,{recursive:!0}),t.systemPrompt){let r=re.join(a,`system_prompt_${n}.txt`);ee.writeFileSync(r,t.systemPrompt),o.system_prompt_path=r,h.debug(`[saveDebugInfoToFiles] Saved system prompt to: ${r}`)}if(t.userPrompt)if(typeof t.userPrompt=="string"){let r=re.join(a,`user_prompt_${n}.txt`);ee.writeFileSync(r,t.userPrompt),o.user_prompt_path=r,h.debug(`[saveDebugInfoToFiles] Saved user prompt to: ${r}`)}else{let r=t.userPrompt.map(d=>Array.isArray(d.content)?{...d,content:d.content.map(c=>c.type==="image"&&c.file?.startsWith("data:")?{...c,file:"[base64 image data stripped]"}:c)}:d),s=re.join(a,`messages_${n}.json`),l={system:t.systemPrompt,messages:r};ee.writeFileSync(s,JSON.stringify(l,null,2)),o.messages_path=s,h.debug(`[saveDebugInfoToFiles] Saved messages to: ${s}`)}if(t.rawLlmResponse){let r=i?i.replace(/[\/\\:]/g,"-"):"llm",s=re.join(a,`${r}_response_${n}.txt`);ee.writeFileSync(s,t.rawLlmResponse),o.response_path=s,h.debug(`[saveDebugInfoToFiles] Saved LLM response to: ${s}`)}if(t.screenshotWithSom){let r=re.join(a,`screenshot_${n}.png`);ee.writeFileSync(r,Buffer.from(t.screenshotWithSom,"base64")),o.screenshot_path=r,h.debug(`[saveDebugInfoToFiles] Saved SOM screenshot to: ${r}`)}if(t.reasoningContent){let r=re.join(a,`reasoning_${n}.txt`);ee.writeFileSync(r,t.reasoningContent),o.reasoning_path=r,h.debug(`[saveDebugInfoToFiles] Saved reasoning to: ${r}`)}h.debug(`[saveDebugInfoToFiles] Saved ${Object.keys(o).length} artifacts for step ${e}`)}catch(r){h.error(`[saveDebugInfoToFiles] Failed to save debug info for step ${e}:`,r)}return o}async updateStepResult(e,t,i,n,o){if(!this.context.stepTracking)return;let a=this.context.stepTracking.results[e];if(a){if(t&&(a.status=t,a.contextAfter=this.snapshotVariables(),this.context.stepTracking.currentStepId=void 0,this.context.stepTracking.onStepChange&&this.context.stepTracking.onStepChange(void 0)),i!==void 0&&(a.message=i),n&&a.artifacts.push(n),o){let r=o.tokenUsages?.[0]?.model,s=a.artifacts.length,l=this.saveDebugInfoToFiles(e,o,r,s);Object.keys(l).length>0&&a.artifacts.push(l)}a.duration=Date.now()-a.startTime,this.context.stepTracking.onStepComplete&&this.context.stepTracking.onStepComplete(e,a)}}async writeExecutionResults(e,t){try{if(await ee.promises.mkdir(e,{recursive:!0}),this.context.stepTracking?.results&&Object.keys(this.context.stepTracking.results).length>0){let i=re.join(e,"test-results.json");await ee.promises.writeFile(i,JSON.stringify(this.context.stepTracking.results,null,2)),h.debug(`Test results written to: ${i}`)}if(t?.tokenUsages&&this.context.tokenUsages&&this.context.tokenUsages.length>0){let i=re.join(e,"token-usages.json");await ee.promises.writeFile(i,JSON.stringify(this.context.tokenUsages,null,2)),h.debug(`Token usages written to: ${i}`)}if(this.context.aiActionDetails&&this.context.aiActionDetails.length>0){let i=re.join(e,"ai-actions.json");await ee.promises.writeFile(i,JSON.stringify(this.context.aiActionDetails,null,2)),h.debug(`AI action details written to: ${i}`)}}catch(i){throw h.error("Failed to write execution results:",i),i}}}});function Ug(){let e=new Date,t=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),i=t.find(p=>p.type==="year").value,n=t.find(p=>p.type==="month").value,o=t.find(p=>p.type==="day").value,a=t.find(p=>p.type==="hour").value,r=t.find(p=>p.type==="minute").value,s=t.find(p=>p.type==="second").value,l=String(e.getMilliseconds()).padStart(3,"0"),d=`${i}-${n}-${o}T${a}:${r}:${s}.${l}`,c=e.toISOString().slice(0,-1),u=Date.parse(d+"Z"),m=Date.parse(c+"Z"),g=Math.round((m-u)/(1e3*60)),y=String(Math.floor(Math.abs(g)/60)).padStart(2,"0"),_=String(Math.abs(g)%60).padStart(2,"0"),x=g<=0?"+":"-";return`${i}-${n}-${o}T${a}:${r}:${s}.${l}${x}${y}:${_}`}function mr(e){let t=e.variableStore;return t.has("currentTime")||t.set("currentTime",Ug()),{model:e.model,fallbackModels:e.fallbackModels,computer_use_model:e.computer_use_model,computer_use_fallback_models:e.computer_use_fallback_models,variableStore:t,organizationId:e.organizationId,organizationSettings:e.organizationSettings,executionHistory:e.executionHistory||[],testDataDir:e.testDataDir,downloadDir:e.downloadDir,useNativeGenerator:e.useNativeGenerator,autoDismissModal:e.autoDismissModal,tokenUsages:[],aiActionDetails:[]}}var iu=f(()=>{"use strict"});var nu={};tt(nu,{ActionHandler:()=>vo,ActionHelper:()=>en,Agent:()=>hr,AgentServices:()=>Bo,AgentStepEventTypes:()=>or,AgentTaskFailedError:()=>Ho,BrowserManager:()=>Dd,DEFAULT_EVENT_LISTENER_LIMIT:()=>Rn,DomService:()=>_e,EVENT_LISTENER_CANDIDATE_SELECTORS:()=>Nn,HistoryTreeProcessor:()=>Pl,INIT_SCRIPT:()=>Xe,INTERACTION_EVENT_TYPES:()=>It,INTERACTIVE_ROLES:()=>pi,LogLevel:()=>Ta,LoginType:()=>ct,MCPToolProvider:()=>Td,OpenAIToolProvider:()=>An,SDK_VERSION:()=>Bg,ToolRegistry:()=>Et,TwoFactorAuthType:()=>Ei,VariableStore:()=>Pa,WebAgent:()=>hr,buildRunUsageSummary:()=>$d,configureSdk:()=>ks,createAgent:()=>Gg,createAgentContext:()=>mr,createToolRegistry:()=>_d,createToolRegistryWithCapabilities:()=>kd,discoverChromiumCdpUrl:()=>Fo,ensureToolsRegistered:()=>xd,evaluateStatement:()=>rt,executeStep:()=>at,exportMCPTools:()=>Ad,filterInteractionListeners:()=>vl,generateActionStep:()=>Lt,getActionEntityLocatorInfo:()=>G,getBrowserCdpUrl:()=>no,getCapabilitySummary:()=>Sd,getFramePath:()=>_a,getModel:()=>ge,getPageInfo:()=>oc,getPageWsUrl:()=>nc,getPlatformFromDeviceName:()=>Wd,getProviderOptions:()=>fe,getSdkConfig:()=>J,getToolRegistry:()=>vd,inferProvider:()=>tr,injectUserFunction:()=>sa,isInteractionEventType:()=>xl,isInteractiveRole:()=>yl,loadKnowledgeMappings:()=>Is,loadKnowledges:()=>Ms,loadUserFunctions:()=>Ts,logger:()=>h,newBrowserContext:()=>ic,parseSSEStream:()=>vs,parseSdkLogLevelFromEnv:()=>Ss,pickBestLocator:()=>Zt,pickBestLocatorForElement:()=>wn,pickBestLocators:()=>Ls,registerBrowser:()=>Ut,replaceVariables:()=>Qn,runTask:()=>st,setWindowBounds:()=>oo,toolRegistry:()=>Y,unregisterBrowser:()=>Gt});function Gg(e){let t=new Pa,i=new Set(e.sensitiveKeys||[]);if(e.variables)for(let[o,a]of Object.entries(e.variables))t.set(o,a,i.has(o));let n=mr({model:e.model,variableStore:t,testDataDir:e.testDataDir,downloadDir:e.downloadDir});return new hr(n)}var Bg,pr=f(()=>{"use strict";_s();As();Cs();Ed();Md();Id();er();qa();Qa();Za();Pd();Nd();ir();Hd();Ud();Gd();tu();ar();wi();Ln();Pn();St();_n();Sn();kn();bt();Mn();Ke();Cn();si();ri();Fe();ai();Vn();ot();di();Mt();ui();hi();gi();Uo();de();dr();cr();ur();Tt();Ie();ti();xt();ii();je();yt();Xa();Fn();Hn();Wn();Un();Gn();Bn();jn();Kn();Xn();Yn();Jn();bi();xi();vi();_i();Ti();Ai();Ii();Ci();$i();Oi();Di();Ni();Fi();Hi();Wi();Ui();Gi();Bi();ji();Ki();Vi();Xi();Ct();Yi();Ji();qi();Zi();Qi();mo();yi();Q();it();He();Nt();$e();dt();z();oe();$t();xo();V();iu();Ee();Bg="1.0.0"});var ou,au=f(()=>{"use strict";ou=class{version;goal;url;constructor(e,t){this.version=e,this.goal=t.goal,this.url=t.url}generatePrelude(){let e=`// version ${this.version}
4530
+ ${s}`);let l=this.agentServices.knowledgeRetriever,d=!1;this.agentServices.hasKnowledgeRetriever()&&l&&(w.log("Setting up login knowledge retriever..."),this.agentServices.setKnowledgeRetriever(async(_,x,p,b)=>await l(_,x,p,"login")),d=!0,w.log("Login knowledge retriever configured"));let c;try{if(c=await this.run(e,s,"login"),!c.success)return w.log("Level 3 FAILED: Agent login failed"),h.info("Login: Failed"),{success:!1,page:e}}finally{d&&l&&(this.agentServices.setKnowledgeRetriever(l),w.log("Restored original knowledge retriever"))}let u=await e.context().storageState(),m;if(o)w.log("Skipping validation locator generation (AI verification mode enabled)");else if(t.num_verification_exprs!==0)try{w.log("Generating validation locators for future login verification...");let _=await Wo(e,t.site_url,{verification_hint:t.verification_hint,num_verification_exprs:t.num_verification_exprs},async(x,p)=>this.run(x,p),async x=>this.getDOMText(x));_?(m=_,w.log(`Generated ${m.length} validation locator(s): ${JSON.stringify(m)}`)):w.log("Failed to generate validation locators, login will still succeed")}catch(_){w.log(`Error generating validation locators: ${_.message}`)}else w.log("Skipping validation locator generation (num_verification_exprs=0)");w.log("Level 3 SUCCESS: Agent login succeeded"),h.info("Login: Agent login succeeded");let g=c.actions||[],y=g.length>0?g:i?.cached_actions;return{success:!0,page:e,storage_state:u,cached_actions:y,validation_exprs:m}}catch(l){return w.error(`Agent login failed: ${l.message}`),h.info("Login: Failed"),{success:!1,page:e}}}async executeCachedLogin(e,t,i){let n=(await Promise.resolve().then(()=>(Ht(),Ft))).default,o=new n;for(let a=0;a<t.length;a++){let r=t[a];w.log(`Executing cached action ${a+1}/${t.length}: ${r.action_description||r.action_data?.action_name}`);try{if(!r.action_data){w.log(`Action ${a+1} missing action_data, skipping`);continue}await o.execute(e,r,this.agentServices),await this.waitUntilStable(e,5e3)}catch(s){return w.error(`Cached action ${a+1} failed: ${s.message}`),{success:!1}}}return i?.aiVerificationStatement?(w.log("Verifying cached login result with AI verification statement"),await this.evaluate(e,i.aiVerificationStatement)?{success:!0}:{success:!1}):i?.validationExprs&&i.validationExprs.length>0?await nn(e,i.validationExprs)?{success:!0}:{success:!1}:(w.log("Cached login cannot be verified: missing AI verification statement and validation expressions"),{success:!1})}async login(e,t){let i={site_url:t.url,num_verification_exprs:0,account:{type:lt.PASSWORD,username:t.username,password:t.password,...t.totpSecret&&{two_factor_auth_config:{type:Si.TOTP,data:t.totpSecret}}}};return(await this.loginPage(e,i)).success}getCompletedExecutionHistory(){if(!this.context.executionHistory||this.context.executionHistory.length===0)return[];let e=this.context.executionHistory[this.context.executionHistory.length-1];return!e[1]||e[1].trim()===""?this.context.executionHistory.slice(0,-1):this.context.executionHistory}addToExecutionHistory(e,t){this.context.executionHistory||(this.context.executionHistory=[]),this.context.executionHistory.push([e,t])}async createStepResult(e,t,i,n){if(this.context.stepTracking&&!this.context.stepTracking.results[t]){this.context.stepTracking.currentStepId=t,this.context.stepTracking.onStepChange&&this.context.stepTracking.onStepChange(t);try{e=this.agentServices.validatePage(e),await this.waitUntilStable(e);let o={description:i,startTime:Date.now(),artifacts:[],type:n,code:i};if(this.context.stepTracking.artifactsDir){let a=re.join(this.context.stepTracking.artifactsDir,t.replace(/\./g,"-"));ee.mkdirSync(a,{recursive:!0});let r=re.join(a,"screenshot.png");e=this.agentServices.validatePage(e),await e.screenshot({type:"png",path:r}),o.screenshot=r}o.contextBefore=this.snapshotVariables(),this.context.stepTracking.results[t]=o}catch(o){h.warn(`createStepResult failed for step ${t}: ${o}`),this.context.stepTracking.results[t]={description:i,startTime:Date.now(),artifacts:[],contextBefore:this.snapshotVariables()}}}}snapshotVariables(){return jt(this.context.variableStore.getAll(),this.context.variableStore.getAllSensitiveKeys())}saveDebugInfoToFiles(e,t,i,n=0){let o={};if(!this.context.stepTracking?.artifactsDir)return h.debug("[saveDebugInfoToFiles] No artifacts directory configured, skipping debug info save"),o;let a=re.join(this.context.stepTracking.artifactsDir,e.replace(/\./g,"-"));try{if(ee.mkdirSync(a,{recursive:!0}),t.systemPrompt){let r=re.join(a,`system_prompt_${n}.txt`);ee.writeFileSync(r,t.systemPrompt),o.system_prompt_path=r,h.debug(`[saveDebugInfoToFiles] Saved system prompt to: ${r}`)}if(t.userPrompt)if(typeof t.userPrompt=="string"){let r=re.join(a,`user_prompt_${n}.txt`);ee.writeFileSync(r,t.userPrompt),o.user_prompt_path=r,h.debug(`[saveDebugInfoToFiles] Saved user prompt to: ${r}`)}else{let r=t.userPrompt.map(d=>Array.isArray(d.content)?{...d,content:d.content.map(c=>c.type==="image"&&c.file?.startsWith("data:")?{...c,file:"[base64 image data stripped]"}:c)}:d),s=re.join(a,`messages_${n}.json`),l={system:t.systemPrompt,messages:r};ee.writeFileSync(s,JSON.stringify(l,null,2)),o.messages_path=s,h.debug(`[saveDebugInfoToFiles] Saved messages to: ${s}`)}if(t.rawLlmResponse){let r=i?i.replace(/[\/\\:]/g,"-"):"llm",s=re.join(a,`${r}_response_${n}.txt`);ee.writeFileSync(s,t.rawLlmResponse),o.response_path=s,h.debug(`[saveDebugInfoToFiles] Saved LLM response to: ${s}`)}if(t.screenshotWithSom){let r=re.join(a,`screenshot_${n}.png`);ee.writeFileSync(r,Buffer.from(t.screenshotWithSom,"base64")),o.screenshot_path=r,h.debug(`[saveDebugInfoToFiles] Saved SOM screenshot to: ${r}`)}if(t.reasoningContent){let r=re.join(a,`reasoning_${n}.txt`);ee.writeFileSync(r,t.reasoningContent),o.reasoning_path=r,h.debug(`[saveDebugInfoToFiles] Saved reasoning to: ${r}`)}h.debug(`[saveDebugInfoToFiles] Saved ${Object.keys(o).length} artifacts for step ${e}`)}catch(r){h.error(`[saveDebugInfoToFiles] Failed to save debug info for step ${e}:`,r)}return o}async updateStepResult(e,t,i,n,o){if(!this.context.stepTracking)return;let a=this.context.stepTracking.results[e];if(a){if(t&&(a.status=t,a.contextAfter=this.snapshotVariables(),this.context.stepTracking.currentStepId=void 0,this.context.stepTracking.onStepChange&&this.context.stepTracking.onStepChange(void 0)),i!==void 0&&(a.message=i),n&&a.artifacts.push(n),o){let r=o.tokenUsages?.[0]?.model,s=a.artifacts.length,l=this.saveDebugInfoToFiles(e,o,r,s);Object.keys(l).length>0&&a.artifacts.push(l)}a.duration=Date.now()-a.startTime,this.context.stepTracking.onStepComplete&&this.context.stepTracking.onStepComplete(e,a)}}async writeExecutionResults(e,t){try{if(await ee.promises.mkdir(e,{recursive:!0}),this.context.stepTracking?.results&&Object.keys(this.context.stepTracking.results).length>0){let i=re.join(e,"test-results.json");await ee.promises.writeFile(i,JSON.stringify(this.context.stepTracking.results,null,2)),h.debug(`Test results written to: ${i}`)}if(t?.tokenUsages&&this.context.tokenUsages&&this.context.tokenUsages.length>0){let i=re.join(e,"token-usages.json");await ee.promises.writeFile(i,JSON.stringify(this.context.tokenUsages,null,2)),h.debug(`Token usages written to: ${i}`)}if(this.context.aiActionDetails&&this.context.aiActionDetails.length>0){let i=re.join(e,"ai-actions.json");await ee.promises.writeFile(i,JSON.stringify(this.context.aiActionDetails,null,2)),h.debug(`AI action details written to: ${i}`)}}catch(i){throw h.error("Failed to write execution results:",i),i}}}});function Ug(){let e=new Date,t=new Intl.DateTimeFormat("en-US",{timeZone:"America/Los_Angeles",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(e),i=t.find(p=>p.type==="year").value,n=t.find(p=>p.type==="month").value,o=t.find(p=>p.type==="day").value,a=t.find(p=>p.type==="hour").value,r=t.find(p=>p.type==="minute").value,s=t.find(p=>p.type==="second").value,l=String(e.getMilliseconds()).padStart(3,"0"),d=`${i}-${n}-${o}T${a}:${r}:${s}.${l}`,c=e.toISOString().slice(0,-1),u=Date.parse(d+"Z"),m=Date.parse(c+"Z"),g=Math.round((m-u)/(1e3*60)),y=String(Math.floor(Math.abs(g)/60)).padStart(2,"0"),_=String(Math.abs(g)%60).padStart(2,"0"),x=g<=0?"+":"-";return`${i}-${n}-${o}T${a}:${r}:${s}.${l}${x}${y}:${_}`}function mr(e){let t=e.variableStore;return t.has("currentTime")||t.set("currentTime",Ug()),{model:e.model,fallbackModels:e.fallbackModels,computer_use_model:e.computer_use_model,computer_use_fallback_models:e.computer_use_fallback_models,variableStore:t,organizationId:e.organizationId,organizationSettings:e.organizationSettings,executionHistory:e.executionHistory||[],testDataDir:e.testDataDir,downloadDir:e.downloadDir,useNativeGenerator:e.useNativeGenerator,autoDismissModal:e.autoDismissModal,tokenUsages:[],aiActionDetails:[]}}var iu=f(()=>{"use strict"});var nu={};tt(nu,{ActionHandler:()=>vo,ActionHelper:()=>en,Agent:()=>hr,AgentServices:()=>Bo,AgentStepEventTypes:()=>or,AgentTaskFailedError:()=>Ho,BrowserManager:()=>Dd,DEFAULT_EVENT_LISTENER_LIMIT:()=>Rn,DomService:()=>_e,EVENT_LISTENER_CANDIDATE_SELECTORS:()=>Nn,HistoryTreeProcessor:()=>Pl,INIT_SCRIPT:()=>Xe,INTERACTION_EVENT_TYPES:()=>It,INTERACTIVE_ROLES:()=>pi,LogLevel:()=>Ta,LoginType:()=>lt,MCPToolProvider:()=>Td,OpenAIToolProvider:()=>An,SDK_VERSION:()=>Bg,ToolRegistry:()=>Et,TwoFactorAuthType:()=>Si,VariableStore:()=>Pa,WebAgent:()=>hr,buildRunUsageSummary:()=>$d,configureSdk:()=>ks,createAgent:()=>Gg,createAgentContext:()=>mr,createToolRegistry:()=>_d,createToolRegistryWithCapabilities:()=>kd,discoverChromiumCdpUrl:()=>Fo,ensureToolsRegistered:()=>xd,evaluateStatement:()=>rt,executeStep:()=>at,exportMCPTools:()=>Ad,filterInteractionListeners:()=>vl,generateActionStep:()=>Lt,getActionEntityLocatorInfo:()=>G,getBrowserCdpUrl:()=>no,getCapabilitySummary:()=>Sd,getFramePath:()=>_a,getModel:()=>ge,getPageInfo:()=>oc,getPageWsUrl:()=>nc,getPlatformFromDeviceName:()=>Wd,getProviderOptions:()=>fe,getSdkConfig:()=>J,getToolRegistry:()=>vd,inferProvider:()=>tr,injectUserFunction:()=>sa,isInteractionEventType:()=>xl,isInteractiveRole:()=>yl,loadKnowledgeMappings:()=>Is,loadKnowledges:()=>Ms,loadUserFunctions:()=>Ts,logger:()=>h,newBrowserContext:()=>ic,parseSSEStream:()=>vs,parseSdkLogLevelFromEnv:()=>Ss,pickBestLocator:()=>Zt,pickBestLocatorForElement:()=>wn,pickBestLocators:()=>Ls,registerBrowser:()=>Ut,replaceVariables:()=>Qn,runTask:()=>st,setWindowBounds:()=>oo,toolRegistry:()=>Y,unregisterBrowser:()=>Gt});function Gg(e){let t=new Pa,i=new Set(e.sensitiveKeys||[]);if(e.variables)for(let[o,a]of Object.entries(e.variables))t.set(o,a,i.has(o));let n=mr({model:e.model,variableStore:t,testDataDir:e.testDataDir,downloadDir:e.downloadDir});return new hr(n)}var Bg,pr=f(()=>{"use strict";_s();As();Cs();Ed();Md();Id();er();qa();Qa();Za();Pd();Nd();ir();Hd();Ud();Gd();tu();ar();wi();Ln();Pn();St();_n();Sn();kn();bt();Mn();Ke();Cn();si();ri();Fe();ai();Vn();ot();di();Mt();ui();hi();gi();Uo();de();dr();cr();ur();Tt();Ie();ti();xt();ii();je();yt();Xa();Fn();Hn();Wn();Un();Gn();Bn();jn();Kn();Xn();Yn();Jn();bi();xi();vi();_i();Ti();Ai();Ii();Ci();$i();Oi();Di();Ni();Fi();Hi();Wi();Ui();Gi();Bi();ji();Ki();Vi();Xi();Ct();Yi();Ji();qi();Zi();Qi();mo();yi();Q();it();He();Nt();$e();dt();z();oe();$t();xo();V();iu();Ee();Bg="1.0.0"});var ou,au=f(()=>{"use strict";ou=class{version;goal;url;constructor(e,t){this.version=e,this.goal=t.goal,this.url=t.url}generatePrelude(){let e=`// version ${this.version}
4531
4531
  `,t=this.goal,i=this.url;e+=`// Navigate to the specified URL
4532
4532
  const targetUrl = process.env.PLAYWRIGHT_STARTING_URL || '${i}';
4533
4533
  if (targetUrl !== null) {
@@ -4544,4 +4544,4 @@ await page.waitForTimeout(2000);
4544
4544
  `;return e}generatePostlude(){return""}}});function ru(e){if(!e)return"desktop";for(let t of Vg)if(t.test(e))return"mobile";return"desktop"}var Vg,su=f(()=>{"use strict";Vg=[/iphone/i,/ipad/i,/android/i,/pixel/i,/galaxy/i,/mobile/i,/nexus/i,/blackberry/i,/kindle/i]});function lu(e,t){if(!e||typeof e!="string")return e;let i=t instanceof Map?Object.fromEntries(t):t,n=a=>{let r=a.startsWith("$")?a.slice(1):a,s=i[r]??i[`$${r}`];return s!=null?String(s):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o=o.replace(/\$\{([^}]+)\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o}var cu=f(()=>{"use strict"});function fr(e){for(let t of e){if(t.type==="STEP"){let n=t;if(n.reference_id||n.template_path)return!0}let i=Ue(t);for(let n of i)if(fr(n.statements))return!0}return!1}function hu(e){let t=new Set;function i(n){for(let o of n){if(o.type==="STEP"){let r=o;r.reference_id&&t.add(r.reference_id)}let a=Ue(o);for(let r of a)i(r.statements)}}return i(e),Array.from(t)}function gu(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return et(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&et(e.teardown,"teardown",t),t}function Je(e,t,i){let n=e+".",o=t.filter(([c])=>c===e||c.startsWith(n));if(o.length===0)return[];let a=[],r=new Set;for(let[c]of o){let u=c===e?"":c.slice(n.length);if(!u)continue;let m=u.split(".")[0];r.has(m)||r.add(m)}let s=Array.from(r);s.sort((c,u)=>{let m=/^\d+$/.test(c)?parseInt(c,10):-1,g=/^\d+$/.test(u)?parseInt(u,10):-1;return m>=0&&g>=0?m-g:c==="then"&&u==="else"?-1:c==="else"&&u==="then"||c==="body"?1:u==="body"?-1:c.localeCompare(u)});function l(c){return i[c]}function d(c){let u=c.match(/^(IF|WHILE)\s+([\s\S]+)$/);return{type:"AI_MODE",expression:(u?u[2].trim():c)||"true"}}for(let c of s){let u=e?`${e}.${c}`:c,m=l(u),g=m?.description??"",y=u;if(c==="then"){let v=`${e}.then`,k=`${e}.else`,S=Je(v,t,i),I=Je(k,t,i),O=l(e),C=O?d(O.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"IF_ELSE",condition:C,then:S,...I.length>0?{else:I}:{}});continue}if(c==="else")continue;if(c==="body"){let v=`${e}.body`,k=Je(v,t,i),S=l(e),I=S?d(S.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"WHILE_LOOP",condition:I,body:k});continue}let _=`${e}.${c}`,x=t.some(([v])=>v.startsWith(_+".then.")||v===_+".then"),p=t.some(([v])=>v.startsWith(_+".else.")||v===_+".else"),b=t.some(([v])=>v.startsWith(_+".body.")||v===_+".body"),E=t.filter(([v])=>{if(!v.startsWith(_+"."))return!1;let S=v.slice(_.length+1).split(".")[0];return/^\d+$/.test(S)&&S!=="then"&&S!=="else"&&S!=="body"});if(x||p){let v=_+".then",k=_+".else",S=Je(v,t,i),I=Je(k,t,i),O=m?d(g):{type:"JS_CODE",expression:"true"};a.push({uid:u,type:"IF_ELSE",condition:O,then:S,...I.length>0?{else:I}:{}})}else if(b){let v=_+".body",k=Je(v,t,i),S=m?d(g):{type:"JS_CODE",expression:"true"};a.push({uid:u,type:"WHILE_LOOP",condition:S,body:k})}else if(E.length>0){let v=Je(_,t,i);a.push({uid:u,type:"STEP",description:g||"Group",statements:v})}else a.push({uid:u,type:"ACTION",description:g||"Action",action_entity:m?.action_entity})}return a}function fu(e){let t=Object.entries(e),i=n=>{let o=n+".";return t.some(([r])=>r===n||r.startsWith(o))?Je(n,t,e):[]};return{before:i("before"),main:i("main"),teardown:i("teardown"),after:i("after")}}var Ue,me,qe,Ze,Qe,rn,du,uu,Xg,Yg,mu,pu,et,Ko=f(()=>{"use strict";Ue=e=>{let t=[];switch(e.type){case"STEP":e.statements&&t.push({key:"statements",statements:e.statements});break;case"IF_ELSE":e.then&&t.push({key:"then",statements:e.then}),e.else&&t.push({key:"else",statements:e.else});break;case"WHILE_LOOP":e.body&&t.push({key:"body",statements:e.body});break}return t},me=(e,t,i=void 0,n="root")=>{for(let o=0;o<e.length;o++){let a=e[o],r=a.uid;if(r===t)return{stableId:r,path:[o],statement:a,parent:i,containerKey:n,index:o};let s=Ue(a);for(let l of s){let d=me(l.statements,t,a,l.key);if(d)return{...d,path:[o,l.key,...d.path]}}}return null},qe=(e,t,i)=>{let n=me(e,t);if(!n)return null;let{statement:o,parent:a,containerKey:r,index:s}=n,l=null;switch(o.type){case"DRAFT":case"ACTION":l=Ze(e,n)||Qe(e,n);break;case"STEP":if(o.statements&&o.statements.length>0)return o.statements[0];l=Ze(e,n)||Qe(e,n);break;case"IF_ELSE":if(i===!0&&o.then&&o.then.length>0)return o.then[0];if(i===!1&&o.else&&o.else.length>0)return o.else[0];l=Ze(e,n)||Qe(e,n);break;case"WHILE_LOOP":if(i===!0&&o.body&&o.body.length>0)return o.body[0];l=Ze(e,n)||Qe(e,n);break;default:l=Ze(e,n)||Qe(e,n);break}if(a&&a.type==="WHILE_LOOP"&&r==="body"){if(!l)return a;let d=me(e,l.uid);if(!d||d.parent!==a)return a}return l},Ze=(e,t)=>{if(!t.parent)return e[t.index+1]||null;let n=Ue(t.parent).find(o=>o.key===t.containerKey);return n&&t.index+1<n.statements.length?n.statements[t.index+1]:null},Qe=(e,t)=>{if(!t.parent)return null;let i=t.parent.uid,n=me(e,i);return n?Ze(e,n)||Qe(e,n):null},rn=e=>{let t=[],i=n=>{for(let o of n){t.push(o);let a=Ue(o);for(let r of a)i(r.statements)}};return i(e),t},du=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}},uu=(e,t,i)=>{if(!me(e,t))return null;if(i===null){let s=[],l=t;for(;l!==null&&me(e,l);)if(s.push(l),l=qe(e,l)?.uid||null,s.length>1e3)return null;return s}if(!me(e,i))return null;if(t===i)return[];let a=[],r=t;for(;r&&r!==i;){let s=me(e,r);if(!s)break;if(a.push(r),s.statement.type==="IF_ELSE"){let l=Xg(s.statement,i);l?r=qe(e,r,l==="then")?.uid||null:r=qe(e,r)?.uid||null}else s.statement.type==="WHILE_LOOP"?Yg(s.statement,i)?r=qe(e,r,!0)?.uid||null:r=qe(e,r,!1)?.uid||null:r=qe(e,r)?.uid||null;if(a.length>1e3)return null}return r===i?a:null},Xg=(e,t)=>{if(e.type!=="IF_ELSE")return null;let i=e;return i.then&&me(i.then,t)?"then":i.else&&me(i.else,t)?"else":null},Yg=(e,t)=>{if(e.type!=="WHILE_LOOP")return!1;let i=e;return!!(i.body&&me(i.body,t))};mu=e=>e.startsWith("ai_")?!0:["js_code","function","assert","verify","wait_for_download_complete","extract_activation_code","extract_email_content"].includes(e),pu=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),et=(e,t,i)=>{e.forEach((n,o)=>{let a=`${t}.${o}`;n.type==="DRAFT"?i[a]={description:n.description||"Draft",action_entity:void 0}:n.type==="ACTION"?i[a]={description:n.description||"Action",action_entity:n.action_entity,locator:n.locator}:n.type==="STEP"&&n.statements?et(n.statements,a,i):n.type==="IF_ELSE"?(i[a]={description:"IF "+(n.condition?.expression||""),action_entity:void 0},n.then&&et(n.then,`${a}.then`,i),n.else&&et(n.else,`${a}.else`,i)):n.type==="WHILE_LOOP"&&(i[a]={description:"WHILE "+(n.condition?.expression||""),action_entity:void 0},n.body&&et(n.body,`${a}.body`,i))})}});var A,wr,zo,br,ht,yr,xr,vr,ue,_r,sn,Vo,kr=f(()=>{"use strict";A=require("zod"),wr=A.z.enum(["JS_CODE","AI_MODE"]),zo=A.z.object({type:wr,expression:A.z.string()}),br=A.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),ht=A.z.object({uid:A.z.string(),type:br,comment:A.z.string().optional()}),yr=A.z.object({action_data:A.z.object({action_name:A.z.string(),kwargs:A.z.record(A.z.any()).optional(),args:A.z.array(A.z.any()).optional()}),action_description:A.z.string().optional(),url:A.z.string().optional(),xpath:A.z.string().nullable().optional(),locator:A.z.string().nullable().optional(),css_selector:A.z.string().nullable().optional(),unique_selector:A.z.string().nullable().optional(),element_index:A.z.number().nullable().optional(),frame_path:A.z.array(A.z.any()).optional(),artifacts:A.z.record(A.z.any()).optional(),feedback:A.z.string().optional(),original_browser_use_action:A.z.any().optional()}).passthrough(),xr=ht.extend({type:A.z.literal("DRAFT"),description:A.z.string()}),vr=ht.extend({type:A.z.literal("ACTION"),description:A.z.string(),action_entity:yr.optional(),locator:A.z.string().optional(),use_pure_vision:A.z.boolean().optional()}),ue=A.z.lazy(()=>A.z.union([xr,vr,ht.extend({type:A.z.literal("STEP"),description:A.z.string().optional().default(""),statements:A.z.array(ue),reference_id:A.z.number().optional(),template_path:A.z.string().optional(),template_params:A.z.record(A.z.string()).optional()}),ht.extend({type:A.z.literal("IF_ELSE"),description:A.z.string().optional(),condition:zo,then:A.z.array(ue),else:A.z.array(ue).optional()}),ht.extend({type:A.z.literal("WHILE_LOOP"),description:A.z.string().optional(),condition:zo,body:A.z.array(ue),timeout_ms:A.z.number().optional()})])),_r=A.z.object({name:A.z.string(),statements:A.z.array(ue),teardown:A.z.array(ue).optional(),skip:A.z.union([A.z.boolean(),A.z.string()]).optional(),timeout:A.z.number().optional(),fail:A.z.union([A.z.boolean(),A.z.string()]).optional(),only:A.z.boolean().optional(),slow:A.z.boolean().optional()}),sn=A.z.object({tests:A.z.array(_r).min(1),beforeAll:A.z.array(ue).optional(),afterAll:A.z.array(ue).optional(),beforeEach:A.z.array(ue).optional(),afterEach:A.z.array(ue).optional()}),Vo=A.z.object({comment:A.z.string().optional(),version:A.z.string().optional(),goal:A.z.string().optional(),url:A.z.string().optional(),baseURL:A.z.string().optional(),final_feedback:A.z.string().optional(),completed:A.z.boolean().optional(),success:A.z.boolean().optional(),statements:A.z.array(ue).optional(),teardown:A.z.array(ue).optional(),last_modified_at:A.z.string().optional(),testGroup:sn.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"})});function Er(e,t){let i={...t?.test_case_id!==void 0?{test_case_id:t.test_case_id}:{},...t?.name?{name:t.name}:{},...t?.tags&&t.tags.length>0?{tags:t.tags}:{},...t?.skip!==void 0?{skip:t.skip}:{},...t?.fail!==void 0?{fail:t.fail}:{},...t?.only?{only:t.only}:{},...t?.slow?{slow:t.slow}:{},goal:e.goal??"",url:e.url,base_url:e.baseURL,...t?.timeout!==void 0?{timeout:t.timeout}:{},...t?.settings&&Object.keys(t.settings).length>0?{settings:t.settings}:{},...t?.use&&Object.keys(t.use).length>0?{use:t.use}:{},...t?.beforeEach&&t.beforeEach.length>0?{beforeEach:t.beforeEach}:{},...t?.afterEach&&t.afterEach.length>0?{afterEach:t.afterEach}:{},...t?.parameters&&t.parameters.length>0?{parameters:t.parameters}:{},statements:(e.statements??[]).map(xe)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(xe)),i}function xu(e,t){if(e.testGroup)return Tr(e,t);let i=Er(e,t),n=new D.Document(i),o=n.contents?.get("tags",!0);return(0,D.isSeq)(o)&&(o.flow=!0),e.comment&&(n.commentBefore=e.comment),wu(n,e.statements??[]),e.teardown&&wu(n,e.teardown,"teardown"),n.toString(zt)}function wu(e,t,i="statements"){let n=e.contents;if(!n||!(0,D.isMap)(n))return;let o=n.get(i,!0);(0,D.isSeq)(o)&&ln(o,t)}function ln(e,t){for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=t[i],o=e.items[i];if(i>0&&(o.spaceBefore=!0),n.comment&&(i===0?e.commentBefore=n.comment:o.commentBefore=n.comment),(0,D.isMap)(o)){let a=o;if(n.type==="STEP"){let r=a.get("statements",!0);(0,D.isSeq)(r)&&ln(r,n.statements)}else if(n.type==="IF_ELSE"){let r=a.get("THEN",!0);(0,D.isSeq)(r)&&ln(r,n.then);let s=a.get("ELSE",!0);(0,D.isSeq)(s)&&n.else&&ln(s,n.else)}else if(n.type==="WHILE_LOOP"){let r=a.get("DO",!0);(0,D.isSeq)(r)&&ln(r,n.body)}}}}function Tr(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let n={};t?.test_case_id!==void 0&&(n.test_case_id=t.test_case_id),t?.name&&(n.name=t.name),t?.tags&&t.tags.length>0&&(n.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(n.use=t.use),t?.settings&&Object.keys(t.settings).length>0&&(n.settings=t.settings);let o={};e.baseURL&&(o.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(o.beforeAll=i.beforeAll.map(xe)),i.beforeEach&&i.beforeEach.length>0&&(o.beforeEach=i.beforeEach.map(xe)),i.afterEach&&i.afterEach.length>0&&(o.afterEach=i.afterEach.map(xe)),i.afterAll&&i.afterAll.length>0&&(o.afterAll=i.afterAll.map(xe)),o.tests=i.tests.map(s=>{let l={name:s.name};return s.skip!==void 0&&(l.skip=s.skip),s.timeout!==void 0&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only!==void 0&&(l.only=s.only),s.slow!==void 0&&(l.slow=s.slow),l.statements=s.statements.map(xe),s.teardown&&s.teardown.length>0&&(l.teardown=s.teardown.map(xe)),l}),n.suite=o;let a=new D.Document(n),r=a.contents?.get("tags",!0);return(0,D.isSeq)(r)&&(r.flow=!0),a.toString(zt)}function vu(e){return e.map(t=>(0,D.stringify)(t,zt)).join(`---
4545
4545
  `)}function xe(e){switch(e.type){case"DRAFT":return Jg(e);case"ACTION":return _u(e);case"STEP":return Zg(e);case"IF_ELSE":return Qg(e);case"WHILE_LOOP":return ef(e)}}function Jg(e){return{intent:e.description}}function _u(e){let t=e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name,i=e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs;if(t==="verify"){let s=i?.statement;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l=i?.code;return typeof l=="string"&&l.trim()?{VERIFY:s,js:l}:{VERIFY:s}}}if(t==="go_to_url"){let s=i?.url;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l={URL:s};return i?.new_tab===!0&&(l.new_tab=!0),typeof i?.timeout_seconds=="number"&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="js_action"){let s=i?.code;if(typeof s=="string"&&s.trim()&&e.description)return{description:e.description,js:s}}if(t==="ai_wait_until"){let s=i?.condition;if(typeof s=="string"){let l=i?.condition_type==="JS_CODE"?"JS_CODE":"AI_MODE",d={WAIT_UNTIL:Ar({type:l,expression:s})};return typeof i?.timeout_seconds=="number"&&i.timeout_seconds!==60&&(d.timeout_seconds=i.timeout_seconds),d}}if(t==="wait"){let s=i?.seconds,d={WAIT:e.description||`Wait ${s}s`};return typeof s=="number"&&(d.seconds=s),d}if(t==="js_code"){let s=i?.code;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return{description:e.description||"Code block",js:s}}if(!e.action_entity)return{intent:e.description};let n=e.action_entity.action_data??e.action_entity.action;if(!n)return{intent:e.description};let o={intent:e.description,action:n.action_name},a=e.locator??e.action_entity.locator;a&&(o.locator=a);let r=e.action_entity.xpath;if(r&&(o.xpath=r),e.use_pure_vision&&(o.use_pure_vision=!0),n.kwargs&&Object.keys(n.kwargs).length>0)for(let[s,l]of Object.entries(n.kwargs))s!=="uid"&&(s==="statement"&&(t==="ai_action"||t==="ai_step")||(o[s]=l));return n.args&&n.args.length>0&&(o.args=n.args),o}function ku(e,t,i){let n={uid:"",type:"ACTION",description:t||e.action_description||"",action_entity:e,locator:i},o=_u(n);if(typeof o=="object"&&o!==null){let a={...o};return delete a.intent,delete a.description,delete a.VERIFY,delete a.WAIT_UNTIL,delete a.WAIT,delete a.statement,Object.keys(a).length>0?(0,D.stringify)(a,zt).trim():""}return(0,D.stringify)(o,zt).trim()}function Su(e){let t=(0,D.parse)(e);if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object");if("VERIFY"in t){let c=String(t.VERIFY),u=typeof t.js=="string"?t.js:void 0;return{description:c,actionEntity:{action_description:c,action_data:{action_name:"verify",kwargs:{statement:c,...u?{code:u}:{}}}}}}if("URL"in t){let c=String(t.URL),u={url:c};return t.new_tab===!0&&(u.new_tab=!0),typeof t.timeout_seconds=="number"&&(u.timeout_seconds=t.timeout_seconds),{description:`Navigate to ${c}`,actionEntity:{action_description:`Navigate to ${c}`,action_data:{action_name:"go_to_url",kwargs:u}}}}if("CODE"in t){let c=String(t.CODE);return{description:c,actionEntity:{action_description:c,action_data:{action_name:"js_code",kwargs:{code:c}}}}}if("js"in t&&typeof t.js=="string"&&!("VERIFY"in t)&&!("action"in t)){let c=typeof t.description=="string"?t.description:typeof t.intent=="string"?t.intent:"";return{description:c,actionEntity:{action_description:c,action_data:{action_name:"js_code",kwargs:{code:t.js}}}}}if("WAIT_UNTIL"in t){let c=Xo(String(t.WAIT_UNTIL)),u={condition:c.expression,condition_type:c.type};return typeof t.timeout_seconds=="number"&&(u.timeout_seconds=t.timeout_seconds),{description:`Wait until ${c.expression}`,actionEntity:{action_description:`Wait until ${c.expression}`,action_data:{action_name:"ai_wait_until",kwargs:u}}}}if("WAIT"in t){let c=String(t.WAIT),u={};return typeof t.seconds=="number"&&(u.seconds=t.seconds),{description:c,actionEntity:{action_description:c,action_data:{action_name:"wait",kwargs:u}}}}let i=typeof t.intent=="string"?t.intent:void 0,n=typeof t.action=="string"?t.action:void 0,o=typeof t.locator=="string"?t.locator:void 0,a=typeof t.xpath=="string"?t.xpath:void 0,r=Array.isArray(t.frame_path)?t.frame_path:void 0,s=Array.isArray(t.args)?t.args:void 0,l={};for(let[c,u]of Object.entries(t))qg.has(c)||(l[c]=u);return n?{actionEntity:{action_description:i||"",action_data:{action_name:n,kwargs:l,...s&&s.length>0?{args:s}:{}},...o?{locator:o}:{},...a?{xpath:a}:{},...r?{frame_path:r}:{}},description:i,locator:o}:{description:i,actionEntity:{action_description:i||""}}}function Zg(e){if(e.template_path){let i={template:e.template_path};return e.template_params&&Object.keys(e.template_params).length>0&&(i.params=e.template_params),i}let t={STEP:e.description,statements:e.statements.map(xe)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function Qg(e){let t={IF:Ar(e.condition),THEN:e.then.map(xe)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(xe)),t}function ef(e){let t={WHILE:Ar(e.condition),DO:e.body.map(xe)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function Ar(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function Eu(e){let t=(0,D.parseAllDocuments)(e),i;if(t.length>1||t.length===1&&!Array.isArray(t[0]?.toJSON()))i=t.map((n,o)=>n.errors.length>0?{__parseError:`Document ${o+1}: ${n.errors[0].message}`}:n.toJSON());else{let n;try{n=(0,D.parse)(e)}catch(o){throw new Error(`Invalid YAML: ${o instanceof Error?o.message:String(o)}`)}if(!Array.isArray(n))throw new Error("Expected a YAML array or multi-document YAML (separated by ---)");i=n}return i.map((n,o)=>{try{if(n&&typeof n=="object"&&"__parseError"in n)return{error:n.__parseError};if(!n||typeof n!="object")return{error:`Item ${o+1}: expected an object`};let a=n,r=typeof a.name=="string"&&a.name.trim()||void 0,s=typeof a.goal=="string"?a.goal.trim():"";if(!s)return{error:`Item ${o+1}: missing "goal" field`};if(Array.isArray(a.statements))try{let l=(0,D.stringify)(a,zt),d=mt(l);return{name:r,goal:d.goal??s,testFlow:d}}catch{}return{name:r,goal:s}}catch(a){return{error:`Item ${o+1}: ${a instanceof Error?a.message:String(a)}`}}})}function Tu(e){try{let t=(0,D.parse)(e);if(!t||typeof t!="object")return{};let i={};return typeof t.test_case_id=="number"&&Number.isFinite(t.test_case_id)&&(i.test_case_id=t.test_case_id),typeof t.template_id=="number"&&Number.isFinite(t.template_id)&&(i.template_id=t.template_id),typeof t.name=="string"&&t.name.trim()&&(i.name=t.name.trim()),typeof t.timeout=="number"&&Number.isFinite(t.timeout)&&(i.timeout=t.timeout),t.settings&&typeof t.settings=="object"&&!Array.isArray(t.settings)&&(i.settings=t.settings),t.use&&typeof t.use=="object"&&!Array.isArray(t.use)&&(i.use=t.use),Array.isArray(t.tags)&&t.tags.every(n=>typeof n=="string")&&(i.tags=t.tags),(typeof t.skip=="boolean"||typeof t.skip=="string")&&(i.skip=t.skip),(typeof t.fail=="boolean"||typeof t.fail=="string")&&(i.fail=t.fail),t.only===!0&&(i.only=!0),t.slow===!0&&(i.slow=!0),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(i.beforeEach=t.beforeEach),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(i.afterEach=t.afterEach),Array.isArray(t.parameters)&&t.parameters.length>0&&(i.parameters=t.parameters),i}catch{return{}}}function Sr(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Sr);let t=e,i=Object.keys(t);if(i.length===1){let o=i[0];if(o.startsWith("{ ")&&o.endsWith(" }")&&t[o]===null)return`{{${o.slice(2,-2)}}}`}let n={};for(let[o,a]of Object.entries(t))n[o]=Sr(a);return n}function mt(e){if(e.length>bu)throw new Error(`YAML input too large (${e.length} bytes, max ${bu})`);let t=Sr((0,D.parse)(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return tf(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:ve(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=ve(t.teardown));let n=Vo.safeParse(i);if(!n.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(n.error.errors)}`);let o=n.data;return Mr(e,o),o}function tf(e){let t=e.suite;if(!t||typeof t!="object")throw new Error("Invalid suite: expected an object");let i=t.tests;if(!Array.isArray(i)||i.length===0)throw new Error('Suite must have a non-empty "tests" array');let o={tests:i.map(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let l={name:s.name,statements:ve(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(l.teardown=ve(s.teardown)),s.skip!==void 0&&(l.skip=s.skip),typeof s.timeout=="number"&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only===!0&&(l.only=!0),s.slow===!0&&(l.slow=!0),l})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=ve(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=ve(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=ve(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=ve(t.afterEach));let a=sn.safeParse(o);if(!a.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(a.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:a.data}}function ve(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(nf)}function nf(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return of(t);if("WHILE"in t)return af(t);if("STEP"in t)return rf(t);if("VERIFY"in t){let i=t.VERIFY,n={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(n.code=t.js),{uid:(0,ye.v4)(),type:"ACTION",description:String(i),action_entity:{action_description:String(i),action_data:{action_name:"verify",kwargs:n}}}}if("URL"in t){let i=t.URL,n=t.new_tab===!0?!0:void 0,o=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,a={url:typeof i=="string"?i:String(i)};return n&&(a.new_tab=!0),o!==void 0&&(a.timeout_seconds=o),{uid:(0,ye.v4)(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:a}}}}if("WAIT_UNTIL"in t){let i=Xo(typeof t.WAIT_UNTIL=="string"?t.WAIT_UNTIL:String(t.WAIT_UNTIL)),n=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:(0,ye.v4)(),type:"ACTION",description:`Wait until: ${i.expression}`,action_entity:{action_description:`Wait until: ${i.expression}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:i.expression,condition_type:i.type,timeout_seconds:n}}}}}if("WAIT"in t){let i=t.WAIT,n=typeof t.seconds=="number"?t.seconds:3;return{uid:(0,ye.v4)(),type:"ACTION",description:typeof i=="string"?i:`Wait ${n}s`,action_entity:{action_description:typeof i=="string"?i:`Wait ${n}s`,action_data:{action_name:"wait",kwargs:{seconds:n}}}}}if("CODE"in t){let i=t.CODE;if(i==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');let n=typeof t.description=="string"?t.description:"Code block";return{uid:(0,ye.v4)(),type:"ACTION",description:n,action_entity:{action_description:n,action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("js"in t&&!("VERIFY"in t)&&!("action"in t)){if("intent"in t||"desc"in t)throw new Error("A `js:` statement uses `description:`, not `intent:`. Raw JS does not self-heal \u2014 use `description: + js:` for code, or express it as a structured action (`intent:` + `action:`/`locator:`) to keep self-healing.");let i=typeof t.description=="string"&&t.description.trim()!==""?t.description:"Code block",n=t.js;return{uid:(0,ye.v4)(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_code",kwargs:{code:typeof n=="string"?n:String(n)}}}}}if("call"in t&&typeof t.call=="string"){let{call:i,...n}=t;return yu({...n,action:"function",functionName:i})}if("action"in t)return yu(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:(0,ye.v4)(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function Xo(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 of(e){let t=Xo(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let n={uid:(0,ye.v4)(),type:"IF_ELSE",condition:t,then:ve(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(n.else=ve(e.ELSE)),n}function af(e){let t=Xo(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let n={uid:(0,ye.v4)(),type:"WHILE_LOOP",condition:t,body:ve(i)};return typeof e.timeout_ms=="number"&&(n.timeout_ms=e.timeout_ms),n}function rf(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let i={uid:(0,ye.v4)(),type:"STEP",description:t,statements:ve(e.statements)};if(typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),typeof e.template_path=="string"&&(i.template_path=e.template_path),e.template_params&&typeof e.template_params=="object"&&!Array.isArray(e.template_params)){let n=e.template_params,o={};for(let[a,r]of Object.entries(n))o[a]=String(r);i.template_params=o}return i}function yu(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",n=typeof e.locator=="string"?e.locator:void 0,o=typeof e.xpath=="string"?e.xpath:void 0,a=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,r={};for(let[d,c]of Object.entries(e))sf.has(d)||(r[d]=c);t==="verify"&&typeof r.js=="string"&&(r.code=r.js,delete r.js),(t==="ai_action"||t==="ai_step")&&(r.statement===void 0&&(r.statement=i),a&&(r.use_pure_vision=!0));let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(r).length>0?r:{}}};n&&(s.locator=n),o&&(s.xpath=o);let l={uid:(0,ye.v4)(),type:"ACTION",description:i,action_entity:s};return a&&(l.use_pure_vision=!0),l}function Mr(e,t){let i;try{i=(0,D.parseDocument)(e)}catch{return}let n=i.contents;if(!n||!(0,D.isMap)(n))return;if(i.commentBefore)t.comment=i.commentBefore;else{let l=n.items?.[0];l?.key&&l.key.commentBefore&&(t.comment=l.key.commentBefore)}let o=n,a=o.get("statements",!0);(0,D.isSeq)(a)&&t.statements&&Kt(a,t.statements);let r=o.get("teardown",!0);(0,D.isSeq)(r)&&t.teardown&&Kt(r,t.teardown)}function Kt(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=e.items[i];n.commentBefore&&!(i===0&&e.commentBefore)&&(t[i].comment=n.commentBefore);let o=t[i];if(o.type==="STEP"&&(0,D.isMap)(n)){let a=n.get("statements",!0);(0,D.isSeq)(a)&&Kt(a,o.statements)}else if(o.type==="IF_ELSE"&&(0,D.isMap)(n)){let a=n.get("THEN",!0);(0,D.isSeq)(a)&&Kt(a,o.then);let r=n.get("ELSE",!0);(0,D.isSeq)(r)&&o.else&&Kt(r,o.else)}else if(o.type==="WHILE_LOOP"&&(0,D.isMap)(n)){let a=n.get("DO",!0);(0,D.isSeq)(a)&&Kt(a,o.body)}}}var D,ye,zt,qg,bu,sf,Yo=f(()=>{"use strict";kr();D=require("yaml"),ye=require("uuid");zt={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};qg=new Set(["intent","description","action","locator","xpath","frame_path","args","js"]);bu=1024*1024;sf=new Set(["action","intent","desc","locator","xpath","use_pure_vision"])});function $r(e){let t=0,i=0;for(let n of e)if(n.type==="DRAFT")i++;else if(n.type==="ACTION"){let o=n.action_entity?.action_data?.action_name??"";Cr.has(o)||t++}return{action:t,draft:i}}function cf(e){try{return new Function(`return async function() { ${e} }`),null}catch(t){return t.message}}function Ir(e){try{return new Function(`return async function() { return (${e}) }`),null}catch(t){return t.message}}function df(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(a=>a.length>0&&!a.startsWith("//")),i=t.length,n=t.join(`
4546
4546
  `).match(/\bawait\b/g),o=n?n.length:0;return i<=Au&&o<=Mu?null:`${i} non-blank line(s), ${o} await(s) \u2014 limits are ${Au} lines and ${Mu} awaits. The VERIFY js: field is a cache for one natural-language assertion, not a place for multi-step logic. Break this into multiple statements \u2014 one VERIFY per assertion \u2014 so each step is visible in the debugger and self-healable. For freeform setup code (mocking, storage), use the description: + js: escape hatch, which has no complexity cap.`}function Iu(e,t){let i=t?.coverageThreshold??lf,n=[],o=[],a;try{a=mt(e)}catch(m){return{valid:!1,errors:[`Invalid YAML: ${m.message}`],warnings:[],stats:{total:0,action:0,draft:0,coverage:0}}}a.goal||n.push('Missing required field: "goal"'),a.statements?.length||n.push('Missing required field: "statements"');let r=[...rn(a.statements??[]),...a.teardown?rn(a.teardown):[]],{action:s,draft:l}=$r(r),d="Hint: in YAML double-quoted strings, backslashes are escape characters \u2014 use \\\\/ instead of \\/ for regex, or use single quotes.";for(let m of r){let g=m;if(g.reference_id!==void 0){let y=g.description||m.uid;n.push(`Unresolved cloud template reference on statement "${y}" (reference_id: ${g.reference_id}). Local YAML tests cannot use reference_id \u2014 inline the template statements or use the local "template:" key instead.`)}if(m.type==="ACTION"){let y=m,_=y.action_entity?.action_data?.action_name??"";if(_==="js_code"||_==="js_action"||_==="verify"||_==="ai_assert"){let x=y.action_entity?.action_data?.kwargs?.code;if(typeof x=="string"){let p=cf(x);if(p){let b=y.description||_;n.push(`Invalid JS in "${b}": ${p}. ${d}`)}else if(_==="verify"){let b=df(x);if(b){let E=y.description||_;n.push(`JS cache for "${E}" is too complex: ${b}`)}}}}if(_==="ai_wait_until"&&y.action_entity?.action_data?.kwargs?.condition_type==="JS_CODE"){let x=y.action_entity?.action_data?.kwargs?.condition;if(typeof x=="string"){let p=Ir(x);p&&n.push(`Invalid JS in WAIT_UNTIL condition "${x}": ${p}. ${d}`)}}}if(m.type==="IF_ELSE"){let y=m;if(y.condition.type==="JS_CODE"){let _=Ir(y.condition.expression);_&&n.push(`Invalid JS in IF condition "${y.condition.expression}": ${_}. ${d}`)}}if(m.type==="WHILE_LOOP"){let y=m;if(y.condition.type==="JS_CODE"){let _=Ir(y.condition.expression);_&&n.push(`Invalid JS in WHILE condition "${y.condition.expression}": ${_}. ${d}`)}}}let c=s+l,u=c>0?Math.round(s/c*100):0;return c>0&&u/100<i&&o.push(`Low action coverage: ${s}/${c} statements (${u}%) are enriched with action/js. ${l} draft statement(s) still need enrichment. Use MCP tools (act, get_locators) to convert drafts to actions.`),{valid:n.length===0,errors:n,warnings:o,stats:{total:c,action:s,draft:l,coverage:u}}}var lf,Au,Mu,Cr,Cu=f(()=>{"use strict";Ko();Yo();lf=.5,Au=5,Mu=3,Cr=new Set(["verify","ai_assert","done","go_to_url","ai_wait_until","wait","js_code"])});function $u(){return{version:"1.0",entries:{}}}function Pu(e,t){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:t}}}function Ou(e,t){let i=t?.entries[e.uid],n=i?.action_entity??e.action_entity;return e.locator&&n?{...n,locator:e.locator}:i?i.action_entity:e.action_entity?e.action_entity:null}function Lu(e,t,i,n){return e.entries[t]={action_entity:i,updated_at:new Date().toISOString(),updated_by:n},e}function Du(e,t){let i=e??{version:"1.0",entries:{}};for(let[n,o]of t)i.entries[n]=o;return i}function Nu(e){return e?Object.keys(e.entries).length===0:!0}function Ru(e){return e?Object.keys(e.entries).length:0}function Fu(e,t){if(!t||Object.keys(t.entries).length===0)return e;let i=Pr(e.statements??[],t),n=e.teardown?Pr(e.teardown,t):void 0;return{...e,statements:i,teardown:n}}function Pr(e,t){return e.map(i=>uf(i,t))}function uf(e,t){if(e.type==="ACTION"){let o=e,a=t.entries[o.uid];return a?{...o,action_entity:a.action_entity}:o}let i=Ue(e);if(i.length===0)return e;let n={};for(let o of i)n[o.key]=Pr(o.statements,t);return{...e,...n}}var Hu=f(()=>{"use strict";Ko()});function Lr(e){let t=e.match(/\.getByRole\(['"]([^'"]+)['"]/);if(t&&t[1]){let p=e.match(/\.filter\(\{\s*hasText:\s*['"]([^'"]*(?:\\.[^'"]*)*)['"]\s*\}\)/);if(p&&p[1]){let E=p[1].replace(/\\(.)/g,"$1");return`${t[1]} element with text "${E}"`}let b=e.match(/\.filter\(\{\s*hasText:\s*(\/.*?\/[gimuy]*)\s*\}\)/);if(b&&b[1]){let E=b[1].replace(/^\/|\/$/g,""),v=E.length>30?`${E.substring(0,27)}...`:E;return`${t[1]} element with text matching "${v}"`}return`${t[1]} element`}let i=e.match(/\.filter\(\{\s*hasText:\s*['"]([^'"]*(?:\\.[^'"]*)*)['"]\s*\}\)/);if(i&&i[1]){let p=Vt(e),b=i[1].replace(/\\(.)/g,"$1");return`${p} with text "${b}"`}let n=e.match(/\.filter\(\{\s*hasText:\s*(\/.*?\/[gimuy]*)\s*\}\)/);if(n&&n[1])return`${Vt(e)} with text matching ${n[1]}`;let o=e.match(/\.filter\(\{\s*has:\s*[^}]+getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(o&&o[1]){let p=Vt(e),b=o[1].replace(/\\(.)/g,"$1");return`${p} containing "${b}"`}let a=e.match(/\.filter\(\{\s*has:\s*[^}]+getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(a&&a[1]){let p=Vt(e),b=a[1].replace(/\\(.)/g,"$1");return`${p} containing "${b}"`}let r=e.match(/\.filter\(\{\s*hasNot:\s*[^}]+getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(r&&r[1]){let p=Vt(e),b=r[1].replace(/\\(.)/g,"$1");return`${p} not containing "${b}"`}let s=e.match(/\.filter\(\{\s*hasNot:\s*[^}]+getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(s&&s[1]){let p=Vt(e),b=s[1].replace(/\\(.)/g,"$1");return`${p} not containing "${b}"`}let l=e.match(/name:\s*'((?:[^'\\]|\\.)*)'/);if(l&&l[1])return`"${l[1].replace(/\\(.)/g,"$1")}"`;let d=e.match(/name:\s*"((?:[^"\\]|\\.)*)"/);if(d&&d[1])return`"${d[1].replace(/\\(.)/g,"$1")}"`;let c=e.match(/getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(c&&c[1])return`"${c[1].replace(/\\(.)/g,"$1")}"`;let u=e.match(/getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(u&&u[1])return`"${u[1].replace(/\\(.)/g,"$1")}"`;let m=e.match(/getByPlaceholder\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(m&&m[1])return`input with placeholder "${m[1].replace(/\\(.)/g,"$1")}"`;let g=e.match(/getByPlaceholder\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(g&&g[1])return`input with placeholder "${g[1].replace(/\\(.)/g,"$1")}"`;let y=e.match(/getByLabel\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(y&&y[1])return`"${y[1].replace(/\\(.)/g,"$1")}"`;let _=e.match(/getByLabel\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(_&&_[1])return`"${_[1].replace(/\\(.)/g,"$1")}"`;let x=e.match(/getByRole\(['"]([^'"]+)['"]/);return x&&x[1]?`${x[1]} element`:e.length>50?`${e.substring(0,47)}...`:e}function Dr(e,t){if(!e||!t)return null;let i=t.replace(/^ref=/,""),n=e.split(`
4547
- `);for(let o of n){if(!o.includes(`[ref=${i}]`))continue;let s=o.replace(/\s+\[[^\]]+\](?:\s*\[[^\]]+\])*.*$/,"").trim().replace(/^[-–—]\s*/,"").trim().replace(/\\"/g,'"');return s.length>0?s:null}return null}function Nr(e,t=""){let i=e.match(/page\d*\.(.+?)\.(click|fill|press|check|uncheck|hover|selectOption|dragTo|dblclick|screenshot|setInputFiles|locator|frameLocator)/);if(i&&i[1])return i[1].trim();let n=e.match(/page\d*\.locator\(([^)]+)\)/);if(n&&n[1])return`locator(${n[1]})`;let o=e.match(/page\d*\.frameLocator\(([^)]+)\)/);return o&&o[1]?`frameLocator(${o[1]})`:t}function Vt(e){let t=e.match(/^locator\(['"]([^'"]+)['"]\)/);if(t&&t[1]){let o=t[1],a=o.match(/^([a-zA-Z][\w-]*)/);return a?a[1]:o.length>20?`${o.substring(0,17)}...`:o}let i=e.match(/getByRole\(['"]([^'"]+)['"]/);if(i&&i[1])return i[1];let n=e.match(/getByTestId\(['"]([^'"]+)['"]/);return n&&n[1]?`element with testId "${n[1]}"`:"element"}function Or(e){let t=e.match(/\.fill\(['"]([^'"]*)['"]\)/);if(t&&t[1]!==void 0)return t[1];let i=e.match(/\.press\(['"]([^'"]+)['"]\)/);if(i&&i[1])return i[1];let n=e.match(/\.selectOption\(['"]([^'"]+)['"]\)/);return n&&n[1]?n[1]:""}function hf(e){let t=e.match(/button:\s*['"]([^'"]+)['"]/);return t?t[1]:void 0}function mf(e){let t=e.match(/modifiers:\s*\[([^\]]+)\]/);if(t&&t[1])return t[1].split(",").map(i=>i.trim().replace(/['"]/g,""))}function Gu(e,t){let i=e.name||"unknown",n=Nr(t,e.selector||""),o=e.ariaSnapshot??e.arIAaSnapshot??"",a=e.ref,r=/getByTestId\s*\(/.test(n),l=(a&&o&&r?Dr(o,a):null)??Lr(n),d,c,u={};switch(i){case"click":{let m=hf(t),g=mf(t);m==="right"?(d="right_click_on_element",c=`Right click on ${l}`):(d="click_element",c=`Click on ${l}`),u={index:0},m&&m!=="left"&&(u.button=m),g&&(u.modifiers=g);break}case"fill":{let m=e.text||e.value||Or(t)||"";d="fill",c=m?`Fill ${l} with '${m}'`:`Fill ${l}`,u={value:m,index:0};break}case"press":{let m=e.key||Or(t)||"";d="press",c=`Press '${m}' on ${l}`,u={keyComb:m,index:0};break}case"selectOption":{let m=e.options?.[0]||Or(t)||"";d="select_dropdown_option",c=`Select '${m}' from ${l}`,u={text:m,index:0};break}case"check":d="click_element",c=`Check ${l}`,u={index:0};break;case"uncheck":d="click_element",c=`Uncheck ${l}`,u={index:0};break;case"setInputFiles":{let m=e.files||[];d="upload_file",c=m.length>0?`Upload file(s) to ${l}`:`Upload file to ${l}`,u={paths:m,index:0};break}case"navigate":case"goto":d="go_to_url",c=`Navigate to ${e.url||"URL"}`,u={url:e.url||"",new_tab:!1};break;case"dblclick":d="double_click_on_element",c=`Double click on ${l}`,u={index:0};break;case"hover":d="hover",c=`Hover over ${l}`,u={index:0};break;case"wheel":case"scroll":d="scroll",c=`Scroll on ${l}`,u={x:e.deltaX||0,y:e.deltaY||0,index:e.selector?0:-1};break;case"dragTo":d="drag_drop",c=`Drag ${l} to target`,u={index:0};break;case"screenshot":d="wait",c="Take screenshot",u={seconds:.5};break;case"wait":d="wait",c=`Wait for ${e.timeout||1e3}ms`,u={seconds:(e.timeout||1e3)/1e3};break;default:d="click_element",c=`${i} on ${l}`,u={index:0};break}return{locator:n,xpath:e.xpath||"",css_selector:e.css_selector||"",unique_selector:e.selector||e.css_selector||"",frame_path:e.frame_path||[],action_data:{action_name:d,args:[],kwargs:u},action_description:c,url:"",feedback:""}}var Wu,Uu,Bu=f(()=>{"use strict";Wu=require("uuid"),Uu=()=>(0,Wu.v4)()});function Rr(e,t){let i=[];t.version!=="1.0"&&i.push(`Unsupported patch version: ${t.version}`),(!Array.isArray(t.operations)||t.operations.length===0)&&i.push("Patch must have at least one operation");for(let n=0;n<t.operations.length;n++){let o=t.operations[n],a=`operations[${n}]`;switch(o.reason||i.push(`${a}: missing reason`),o.op){case"remove":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`);break}case"modify":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}case"insert":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),o.position!=="before"&&o.position!=="after"&&i.push(`${a}: position must be 'before' or 'after'`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}default:i.push(`${a}: unknown operation type "${o.op}"`)}}return{valid:i.length===0,errors:i}}function Fr(e,t){let i=Rr(e,t);if(!i.valid)throw new Error(`Invalid patch: ${i.errors.join("; ")}`);let n=[...e],o=t.operations.map((s,l)=>({...s,originalOrder:l})),a={remove:0,modify:1,insert:2},r=[...o].sort((s,l)=>s.index!==l.index?l.index-s.index:a[s.op]-a[l.op]);for(let s of r)switch(s.op){case"remove":n.splice(s.index,1);break;case"modify":n[s.index]=s.statement;break;case"insert":s.position==="before"?n.splice(s.index,0,s.statement):n.splice(s.index+1,0,s.statement);break}return n}function ju(e,t){let i=(0,Jo.parse)(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let n=i.statements;if(!Array.isArray(n))throw new Error('YAML must have a "statements" array');let o=Fr(n,t);i.statements=o;let a=(0,Jo.stringify)(i,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"});return mt(a),{modifiedYaml:a,modifiedStatements:o}}var Jo,Ku=f(()=>{"use strict";Yo();Jo=require("yaml")});var Hr,Wr,zu,Vu=f(()=>{"use strict";Hr=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(Hr||{}),Wr=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(Wr||{}),zu=18e4});function Xu(e){return e?e.startsWith(ke)?"android":e.startsWith(Se)?"ios":"web":"web"}function Yu(e){return e?e.startsWith(ke)||e.startsWith(Se):!1}function Ju(e){return!!e&&e.startsWith(ke)}function qu(e){return!!e&&e.startsWith(Se)}function Zu(e){return e.startsWith(ke)?e.slice(ke.length):e.startsWith(Se)?e.slice(Se.length):e}function Qu(e){return`${ke}${e}`}function eh(e){return`${Se}${e}`}function qo(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function th(e){return e?!qo(e):!1}function Ur(e){return e?qo(e)?["web"]:["android","ios"]:["web","android","ios"]}function ih(e,t){if(!t)return!0;let i=Ur(t);return e==="desktop"||e==="mobile"?i.includes("web"):i.includes(e)}var ke,Se,Zo=f(()=>{"use strict";ke="android:",Se="ios:"});function nh(e){let t=e.trim();if(!t||t.startsWith("List of devices"))return null;let i=t.split(/\s+/);if(i.length<2)return null;let n=i[0],o=i[1],a="usb";return n.startsWith("emulator-")?a="emulator":n.includes(":")&&(a="wifi"),{id:n,state:o,connectionType:a}}function oh(e){return e.startsWith(ke)?e:`${ke}${e}`}function ah(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}var rh=f(()=>{"use strict";Zo()});function sh(e){return e.startsWith(Se)?e:`${Se}${e}`}function lh(e){let t=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${t} - Simulator`:`${e.name}${t}`}function ch(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var dh=f(()=>{"use strict";Zo()});var Gr,Qo,Br,jr,Kr,zr,Vr,Xr,Yr,Jr,pt,qr,cn,Zr,Qr,Xt,uh,dn,hh,mh,ea,ph,gh,fh,wh,bh=f(()=>{"use strict";Gr="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Qo=112,Br=1920,jr=1080,Kr=1920,zr=1080-Qo,Vr=1280,Xr=720,Yr=500,Jr=500,pt="Desktop Chrome",qr=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(qr||{}),cn={"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"}},Zr=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(Zr||{}),Qr={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"]},Xt=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),Qr[e].map(n=>cn[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},uh=()=>Object.keys(cn),dn=e=>cn[e],hh={desktop:{label:"Desktop",type:"desktop",devices:Xt("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Xt("mobile")}},mh={desktop:{label:"Desktop",type:"desktop",devices:Xt("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Xt("mobile",!0)}},ea=(e,t=!1)=>{let i={userAgent:Gr,viewport:{width:Kr,height:zr},isMobile:!1,hasTouch:!1};if(!e||e===pt)return i;let n=dn(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(Yr/o,1),s=Math.max(Jr/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},ph=e=>{let t={width:Br,height:jr};if(!e||e===pt)return t;let i=ea(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+Qo}:t},gh=e=>{let t={width:Vr,height:Xr};if(!e||e===pt)return t;let i=ea(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},fh=e=>!e||e===pt?void 0:dn(e)?.channel,wh=e=>!e||e===pt?"chromium":dn(e)?.defaultBrowserType??"chromium"});var es,ts,yh=f(()=>{"use strict";es=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(es||{}),ts=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(ts||{})});var xh,_h=f(()=>{"use strict";xh=class vh{data={};sensitive=new Set;get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new vh;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}}});function kh(e,t=pf()){return{copilot:e?.models?.copilot||t.COPILOT_MODEL||as,webagent:e?.models?.webagent||t.WEB_AGENT_MODEL||ta,computer_use:e?.models?.computer_use||t.COMPUTER_USE_MODEL||rs}}function Sh(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.GOOGLE_API_KEY||Eh(e))return un;if(e.ANTHROPIC_API_KEY)return is;if(e.OPENAI_API_KEY)return ns;if(e.SHIPLIGHT_API_TOKEN)return ta}}function Eh(e){let t=e.GOOGLE_GENAI_USE_VERTEXAI;return(t==="true"||t==="True")&&!!e.GOOGLE_CLOUD_PROJECT}function Th(e){let t=e?.WEB_AGENT_FALLBACK_MODELS;return t===void 0?[...ss]:t.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function Ah(e){if(e){if(e.COMPUTER_USE_MODEL)return e.COMPUTER_USE_MODEL;if(e.GOOGLE_API_KEY||Eh(e))return Yt;if(e.OPENAI_API_KEY)return os;if(e.SHIPLIGHT_API_TOKEN)return Yt}}var is,un,ns,Yt,os,as,ta,rs,pf,ss,Mh=f(()=>{"use strict";is="claude-haiku-4-5",un="gemini-3.5-flash",ns="gpt-5.4-mini",Yt="gemini-3-flash-preview",os="gpt-5.4",as="claude-sonnet-4-6",ta=un,rs=Yt,pf=()=>typeof process<"u"?process.env:{};ss=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"])});var ls,Ih=f(()=>{"use strict";ls=(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))(ls||{})});var cs={};tt(cs,{ADDRESS_BAR_HEIGHT:()=>Qo,ANDROID_DEVICE_PREFIX:()=>ke,ActionEntitySchema:()=>yr,ActionSchema:()=>vr,AgentStatus:()=>ls,BaseStatementSchema:()=>ht,BrowserType:()=>qr,ConditionSchema:()=>zo,ConditionType:()=>Wr,ConditionTypeSchema:()=>wr,DEFAULT_ANTHROPIC_MODEL:()=>is,DEFAULT_COMPUTER_USE_MODEL:()=>rs,DEFAULT_COPILOT_MODEL:()=>as,DEFAULT_DEVICE_NAME:()=>pt,DEFAULT_GEMINI_COMPUTER_USE_MODEL:()=>Yt,DEFAULT_GOOGLE_MODEL:()=>un,DEFAULT_OPENAI_COMPUTER_USE_MODEL:()=>os,DEFAULT_OPENAI_MODEL:()=>ns,DEFAULT_WEBAGENT_FALLBACK_MODELS:()=>ss,DEFAULT_WEBAGENT_MODEL:()=>ta,DEFAULT_WHILE_LOOP_TIMEOUT_MS:()=>zu,DEVICE_CATEGORIES:()=>Qr,DeviceType:()=>Zr,DraftSchema:()=>xr,IOS_DEVICE_PREFIX:()=>Se,LoginType:()=>es,MIN_WINDOW_HEIGHT:()=>Jr,MIN_WINDOW_WIDTH:()=>Yr,NON_INTENT_ACTIONS:()=>Cr,NodeJSCodeCommon:()=>ou,PLAYWRIGHT_DEVICES:()=>cn,RECORD_VIDEO_HEIGHT:()=>Xr,RECORD_VIDEO_WIDTH:()=>Vr,StatementSchema:()=>ue,StatementType:()=>Hr,StatementTypeSchema:()=>br,TestFlowSchema:()=>Vo,TestGroupEntrySchema:()=>_r,TestGroupSchema:()=>sn,TwoFactorAuthType:()=>ts,UI_DEVICE_CATEGORIES:()=>hh,UI_DEVICE_CATEGORIES_ELECTRON:()=>mh,USER_AGENT:()=>Gr,VIEWPORT_HEIGHT:()=>zr,VIEWPORT_WIDTH:()=>Kr,VariableStore:()=>xh,WINDOW_HEIGHT:()=>jr,WINDOW_WIDTH:()=>Br,actionEntityToYaml:()=>ku,actionStepsMapToTestFlowSections:()=>fu,allowPureVisionAction:()=>pu,applyPatchToYaml:()=>Fr,applyPatchToYamlString:()=>ju,collectActionSteps:()=>et,convertPlaywrightActionToEntity:()=>Gu,countIntentStatements:()=>$r,createAndroidDeviceName:()=>Qu,createEmptyStore:()=>$u,createIOSDeviceName:()=>eh,createRunnerStoreEntry:()=>Pu,extractActionStepsFromTestFlow:()=>gu,extractAndAttachComments:()=>Mr,extractDeviceIdentifier:()=>Zu,extractElementDescription:()=>Lr,extractElementDescriptionFromAriaSnapshot:()=>Dr,extractLocatorFromCode:()=>Nr,extractYamlMetadata:()=>Tu,findNextAfterContainer:()=>Qe,findNextSibling:()=>Ze,findNextStatement:()=>qe,findPathBetweenStatements:()=>uu,findStatementPathById:()=>me,generateUid:()=>Uu,getAllDeviceNames:()=>uh,getAllReferenceIds:()=>hu,getAllStatementsInOrder:()=>rn,getAndroidDeviceDisplayName:()=>ah,getBrowserWindowSize:()=>ph,getCompatiblePlatforms:()=>Ur,getDeviceBrowserType:()=>wh,getDeviceByName:()=>dn,getDeviceChannel:()=>fh,getDeviceOptions:()=>ea,getDevicesByCategory:()=>Xt,getIOSDeviceDisplayName:()=>lh,getLoginConfigPlatform:()=>ru,getRecordVideoSize:()=>gh,getStatementContainers:()=>Ue,getStoreSize:()=>Ru,getTestPlatformFromDeviceName:()=>Xu,hasReferenceIds:()=>fr,isAndroidDevice:()=>Ju,isAppPackage:()=>th,isDynamicAction:()=>mu,isExecutableStatement:()=>du,isIOSDevice:()=>qu,isNativeDevice:()=>Yu,isPhysicalDeviceUDID:()=>ch,isPlatformCompatibleWithUrl:()=>ih,isStoreEmpty:()=>Nu,isWebUrl:()=>qo,mergeActionEntitiesIntoTestFlow:()=>Fu,mergeStoreUpdates:()=>Du,parseAdbDeviceLine:()=>nh,parseYamlArrayItems:()=>Eu,replaceVariables:()=>lu,resolveActionEntity:()=>Ou,resolveComputerUseModelFromEnv:()=>Ah,resolveModels:()=>kh,resolveWebAgentFallbackModelsFromEnv:()=>Th,resolveWebAgentModelFromEnv:()=>Sh,suiteToYaml:()=>Tr,testFlowToYaml:()=>xu,testFlowToYamlObject:()=>Er,toAndroidDeviceName:()=>oh,toIOSDeviceName:()=>sh,updateStoreEntry:()=>Lu,validatePatch:()=>Rr,validateTestYaml:()=>Iu,yamlObjectsToString:()=>vu,yamlToActionEntity:()=>Su,yamlToTestFlow:()=>mt});var ds=f(()=>{"use strict";au();su();cu();Cu();Hu();Bu();Ko();Ku();Yo();Vu();kr();rh();dh();Zo();bh();yh();_h();Mh();Ih()});var bf={};tt(bf,{EXCLUDED_CONTEXT_OPTION_KEYS:()=>gf,HANDLED_CONTEXT_OPTION_KEYS:()=>Nh,SDK_ENV_ALLOWLIST:()=>jh,VIEWPORT_INCOMPATIBLE_OPTIONS:()=>Rh,applyVarsOverride:()=>Bh,buildSdkEnv:()=>Kh,createTestContext:()=>Wh,dropViewportIncompatibleOptions:()=>Fh,expect:()=>Jt.expect,isDeclaredSensitive:()=>Gh,mergeResolvedContextOptions:()=>hs,parseVarsOverrideEnv:()=>Uh,resolveAuthState:()=>Dh,resolveProjectRoot:()=>us,test:()=>wf});module.exports=qh(bf);var Ge=U(require("path"),1),Oh=U(require("fs"),1),Lh=require("url"),Jt=require("@playwright/test");var ce=U(require("fs"),1),ft=U(require("path"),1),oa=require("crypto"),aa=require("os");function bs(e){return[`--disable-extensions-except=${e}`,`--load-extension=${e}`,"--no-first-run","--disable-default-apps"]}function ys(e){if(!ce.existsSync(e))return console.warn(`[fixture] extensionStorageState file not found: ${e}`),null;let t;try{t=JSON.parse(ce.readFileSync(e,"utf-8"))}catch(a){throw new Error(`[fixture] Failed to parse extensionStorageState at ${e}: ${a}`)}let i=t;if(!Array.isArray(i.cookies))return null;let n=(Date.now()+365*24*60*60*1e3)/1e3,o=i.cookies.filter(a=>a&&typeof a=="object"&&typeof a.name=="string"&&typeof a.domain=="string");return o.length<i.cookies.length&&console.warn(`[fixture] Skipped ${i.cookies.length-o.length} malformed cookies (missing name or domain)`),o.map(a=>({...a,expires:n}))}function xs(e,t=process.cwd()){if(e){let n=ft.resolve(t,e),o=ft.join((0,aa.tmpdir)(),`ext-profile-${(0,oa.randomUUID)()}`);if(ce.existsSync(n)){try{ce.cpSync(n,o,{recursive:!0})}catch(r){try{ce.rmSync(o,{recursive:!0,force:!0})}catch(s){console.warn("[fixture] Failed to clean up partial profile copy:",o,s)}throw new Error(`[fixture] Failed to copy extension profile from ${n}: ${r}`)}let a=ft.join(o,"SingletonLock");ce.existsSync(a)&&ce.rmSync(a,{force:!0})}else ce.mkdirSync(o,{recursive:!0});return o}let i=ft.join((0,aa.tmpdir)(),`ext-profile-${(0,oa.randomUUID)()}`);return ce.mkdirSync(i,{recursive:!0}),i}pr();var jg=U(require("dotenv"),1),Kg="__shiplightDotenvCache__";function zg(){return globalThis[Kg]}function gr(){let e=zg();return e===void 0?process.env:e}function us(e){return e.config?.rootDir??process.cwd()}async function Dh(e,t,i,n=process.cwd()){let o=Ge.resolve(n,e.auth),a=await import((0,Lh.pathToFileURL)(o).href),r=a.login||a.default;if(typeof r!="function")throw new Error(`auth module "${e.auth}" must export a login(args, browser?) function that returns a storageState file path`);let s={...e.args};i&&!s.baseUrl&&(s.baseUrl=i);let l=await r(s,t);if(typeof l!="string")throw new Error(`auth module "${e.auth}" login() must return a storageState file path (got ${typeof l})`);return l}function Ch(e){return!(!e||e==="off")}var Nh=["acceptDownloads","baseURL","bypassCSP","colorScheme","deviceScaleFactor","extraHTTPHeaders","geolocation","hasTouch","httpCredentials","ignoreHTTPSErrors","isMobile","javaScriptEnabled","locale","offline","permissions","proxy","serviceWorkers","timezoneId","userAgent","viewport"],gf=["storageState","contextOptions","clientCertificates"],Rh=[{key:"deviceScaleFactor",conflicts:e=>e!==void 0},{key:"isMobile",conflicts:e=>!!e}];function Fh(e){if(e.viewport!==null)return[];let t=[];for(let{key:i,conflicts:n}of Rh)n(e[i])&&(delete e[i],t.push(i));return t}function hs(e,t){let i={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(i[o]=a);let n=Fh(i);return n.length>0&&console.warn(`[fixture] "viewport: null" (no fixed viewport) is incompatible with ${n.join(" and ")}; dropping ${n.length>1?"them":"it"} so the browser context can be created.`),i}function Hh(e,t){return!e||e==="off"?!1:e==="on"?!0:e==="retain-on-failure"?t.status!==t.expectedStatus:e==="on-first-retry"?t.retry>0:typeof e=="object"&&e!==null&&"mode"in e?Hh(e.mode,t):!0}async function $h(e,t,i){let n=Hh(t,i);for(let o of e)try{if(n){let a=await o.path();await i.attach("video",{path:a,contentType:"video/webm"})}else await o.delete()}catch(a){console.warn("[fixture] Failed to process video:",a)}}var ia;async function Ph(){return ia||(ia=await Promise.resolve().then(()=>(pr(),nu)),ia)}var ff=new Set(["get","set","getAll","has","__variableStore"]);function Wh(e){let t={__variableStore:e,get(i){return e.get(i)},set(i,n,o=!1){e.set(i,n,o)},getAll(){return e.getAll()}};return new Proxy(t,{get(i,n,o){if(n in i)return Reflect.get(i,n,o);if(typeof n=="string")return i.get(n)},set(i,n,o){return typeof n!="string"||ff.has(n)?Reflect.set(i,n,o):(i.set(n,o),!0)},has(i,n){return n in i?!0:typeof n=="string"?e.has?.(n)??!1:!1}})}function Uh(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch(n){throw new Error(`SHIPLIGHT_VARS_OVERRIDE is not valid JSON: ${n.message}`)}if(t===null||typeof t!="object"||Array.isArray(t))throw new Error("SHIPLIGHT_VARS_OVERRIDE must be a JSON object");let i={};for(let[n,o]of Object.entries(t)){if(typeof o!="string")throw new Error(`SHIPLIGHT_VARS_OVERRIDE key "${n}" must be a string`);i[n]=o}return i}function Gh(e,t,i){let n=r=>{if(!r||!(e in r))return null;let s=r[e];return s&&typeof s=="object"&&"value"in s?s.sensitive===!0:!1},o=n(i);if(o!==null)return o;let a=n(t);return a!==null?a:!1}function Bh(e,t,i,n=process.env.SHIPLIGHT_VARS_OVERRIDE){let o=Uh(n);if(o)for(let[a,r]of Object.entries(o)){let s=Gh(a,t,i);e.set(a,r,s)}}var jh=["GOOGLE_API_KEY","ANTHROPIC_API_KEY","OPENAI_API_KEY","OPENAI_BASE_URL","ANTHROPIC_MODELS_USE_VERTEXAI","GOOGLE_GENAI_USE_VERTEXAI","GOOGLE_CLOUD_PROJECT","GOOGLE_CLOUD_LOCATION","MAILGUN_API_KEY","MAILGUN_DOMAIN","SHIPLIGHT_API_TOKEN","SHIPLIGHT_API_URL","WEB_AGENT_LLM_TIMEOUT_MS"];function Kh(e=gr()){let t={};for(let i of jh)t[i]=e[i]??"";return t}var wf=Jt.test.extend({account:[void 0,{option:!0}],autoDismissModal:[!1,{option:!0}],variables:[void 0,{option:!0}],extensionDir:[void 0,{option:!0}],userDataDir:[void 0,{option:!0}],extensionStorageState:[void 0,{option:!0}],launchOptions:async({launchOptions:e},t)=>{if(!process.env.OMNITERM_BROWSER_REGISTRY_URL){await t(e);return}let i=e?.args??[],n={...e,args:[...i,"--remote-debugging-port=0"]};await t(n)},browser:async({browser:e},t)=>{let i=null;if(process.env.OMNITERM_BROWSER_REGISTRY_URL)try{let n=await Fo(process.pid),o=process.env.TEST_WORKER_INDEX??"?";i=await Ut({cdpUrl:n,label:`shiplight test w${o}`,pid:process.pid})}catch{}await t(e),await Gt(i)},context:async({browser:e,account:t,extensionDir:i,userDataDir:n,extensionStorageState:o,acceptDownloads:a,baseURL:r,bypassCSP:s,colorScheme:l,deviceScaleFactor:d,extraHTTPHeaders:c,geolocation:u,hasTouch:m,httpCredentials:g,ignoreHTTPSErrors:y,isMobile:_,javaScriptEnabled:x,locale:p,offline:b,permissions:E,proxy:v,serviceWorkers:k,timezoneId:S,userAgent:I,viewport:O},C,$)=>{let W=i||n,X=us($),F={acceptDownloads:a,baseURL:r,bypassCSP:s,colorScheme:l,deviceScaleFactor:d,extraHTTPHeaders:c,geolocation:u,hasTouch:m,httpCredentials:g,ignoreHTTPSErrors:y,isMobile:_,javaScriptEnabled:x,locale:p,offline:b,permissions:E,proxy:v,serviceWorkers:k,timezoneId:S,userAgent:I,viewport:O},K={};for(let B of Nh){if(!(B in F))throw new Error(`[fixture] HANDLED_CONTEXT_OPTION_KEYS lists "${B}" but the context fixture does not resolve it \u2014 add "${B}" to the fixture destructure and fixtureOptionValues so per-test use: overrides apply.`);K[B]=F[B]}if(W){if(t||$.project.use.auth)throw new Error('Cannot use both "extensionDir"/"userDataDir" and "auth" \u2014 persistent context tests manage their own context. Use extensionStorageState for authentication instead.');let B=$.project.use?.browserName;B&&B!=="chromium"&&console.warn(`[fixture] Persistent context requires Chromium but project is configured for "${B}". Forcing Chromium.`);let he=process.env.PLAYWRIGHT_HEADLESS==="true";i&&he&&console.warn("[fixture] PLAYWRIGHT_HEADLESS=true with extensionDir \u2014 Chrome extensions will not function in headless mode.");let te=xs(n,X),se=i?bs(Ge.resolve(X,i)):[],ie=hs($.project.use,K),{storageState:Le,account:R,extensionDir:Z,userDataDir:ne,extensionStorageState:De,autoDismissModal:na,video:L,...j}=ie,Ne=Ch(L)?{dir:$.outputDir}:void 0,le;try{if(le=await Jt.chromium.launchPersistentContext(te,{...j,headless:he,args:se,viewport:"viewport"in j?j.viewport:{width:1280,height:720},...Ne?{recordVideo:Ne}:{}}),o){let gt=Ge.resolve(X,o),pe=ys(gt);pe&&await le.addCookies(pe)}await C(le)}finally{let gt=le?.pages().map(pe=>pe.video()).filter(pe=>pe!==null)??[];if(await le?.close().catch(pe=>{console.warn("[fixture] Failed to close persistent context:",pe)}),await $h(gt,L,$),!n)try{Oh.rmSync(te,{recursive:!0,force:!0})}catch(pe){console.warn("[fixture] Failed to clean up temp profile dir:",te,pe)}}}else{let B=hs($.project.use,K),he=$.project.use,te=he.auth?{auth:he.auth,args:he.args}:t;if(te){if(!te.auth)throw new Error("Auth is declared but missing the script path. Provide auth in playwright.config.ts: use: { auth: './auth.login.ts' }");B.storageState=await Dh(te,e,r,X)}let se=B.video;Ch(se)&&!B.recordVideo&&(B.recordVideo={dir:$.outputDir});let ie=await e.newContext(B);ie.addInitScript(Xe);try{await C(ie)}finally{let Le=ie.pages().map(R=>R.video()).filter(R=>R!==null);await ie.close(),await $h(Le,se,$)}}},page:async({context:e},t)=>{let i=await e.newPage();await t(i)},testContext:async({variables:e},t,i)=>{let{VariableStore:n}=await Ph(),o=new n,a=l=>{if(l)for(let[d,c]of Object.entries(l))typeof c=="string"?o.set(d,c,!1):c&&typeof c=="object"&&"value"in c&&o.set(d,c.value,c.sensitive===!0)},r=i.project.use.variables;a(r),a(e),Bh(o,r,e);let s=Wh(o);global.testContext=s,global.$=s,global.ctx=s,await t(s),delete global.testContext,delete global.$,delete global.ctx},$:async({testContext:e},t)=>{await t(e)},ctx:async({testContext:e},t)=>{await t(e)},agent:async({page:e,testContext:t,autoDismissModal:i},n,o)=>{let{WebAgent:a,createAgentContext:r,configureSdk:s,parseSdkLogLevelFromEnv:l}=await Ph(),d=l();s({env:Kh(),...d!==void 0&&{logLevel:d}});let{resolveWebAgentModelFromEnv:c,resolveComputerUseModelFromEnv:u,resolveWebAgentFallbackModelsFromEnv:m}=await Promise.resolve().then(()=>(ds(),cs)),g=gr(),y=c(g);if(!y)throw new Error("No AI model configured. Set WEB_AGENT_MODEL, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, SHIPLIGHT_API_TOKEN, or Google Vertex via ADC (GOOGLE_GENAI_USE_VERTEXAI=true + GOOGLE_CLOUD_PROJECT) in your .env file (or in the runner environment for CI).");let _=u(g),x=m(g),p=t.__variableStore,b=r({model:y,fallbackModels:x,computer_use_model:_,variableStore:p,autoDismissModal:i,testDataDir:us(o),downloadDir:Ge.join(o.outputDir,"downloads")}),E=Ge.join(o.outputDir,"artifacts");b.stepTracking={results:{},artifactsDir:E};let v=new a(b),k=e.context();v.agentServices.setupPageTracking(k);for(let S of k.pages())v.setupDownloadTracking(S),v.setupDialogHandling(S);k.on("page",S=>{v.setupDownloadTracking(S),v.setupDialogHandling(S)}),global.agent=v,await n(v),delete global.agent;try{let S=o.outputDir;await v.writeExecutionResults(S);let I=Ge.join(S,"test-results.json");await(await import("fs/promises")).stat(I).catch(()=>null)&&await o.attach("shiplight-results",{path:I,contentType:"application/json"})}catch(S){console.error("[Shiplight] Failed to attach step results:",S)}try{let S=v.getNewActionEntities();if(S.size>0&&o.status==="passed"){let{createEmptyStore:I,createRunnerStoreEntry:O}=await Promise.resolve().then(()=>(ds(),cs)),C=await import("fs/promises"),$=I();for(let[X,F]of S)$.entries[X]=O(F,0);let W=Ge.join(o.outputDir,"new-action-entities.json");await C.writeFile(W,JSON.stringify($,null,2)),await o.attach("shiplight-new-action-entities",{path:W,contentType:"application/json"}),console.log(`[Shiplight] ${S.size} healed action entit${S.size===1?"y":"ies"} saved`)}}catch(S){console.warn("[Shiplight] Failed to persist new action entities:",S)}}});0&&(module.exports={EXCLUDED_CONTEXT_OPTION_KEYS,HANDLED_CONTEXT_OPTION_KEYS,SDK_ENV_ALLOWLIST,VIEWPORT_INCOMPATIBLE_OPTIONS,applyVarsOverride,buildSdkEnv,createTestContext,dropViewportIncompatibleOptions,expect,isDeclaredSensitive,mergeResolvedContextOptions,parseVarsOverrideEnv,resolveAuthState,resolveProjectRoot,test});
4547
+ `);for(let o of n){if(!o.includes(`[ref=${i}]`))continue;let s=o.replace(/\s+\[[^\]]+\](?:\s*\[[^\]]+\])*.*$/,"").trim().replace(/^[-–—]\s*/,"").trim().replace(/\\"/g,'"');return s.length>0?s:null}return null}function Nr(e,t=""){let i=e.match(/page\d*\.(.+?)\.(click|fill|press|check|uncheck|hover|selectOption|dragTo|dblclick|screenshot|setInputFiles|locator|frameLocator)/);if(i&&i[1])return i[1].trim();let n=e.match(/page\d*\.locator\(([^)]+)\)/);if(n&&n[1])return`locator(${n[1]})`;let o=e.match(/page\d*\.frameLocator\(([^)]+)\)/);return o&&o[1]?`frameLocator(${o[1]})`:t}function Vt(e){let t=e.match(/^locator\(['"]([^'"]+)['"]\)/);if(t&&t[1]){let o=t[1],a=o.match(/^([a-zA-Z][\w-]*)/);return a?a[1]:o.length>20?`${o.substring(0,17)}...`:o}let i=e.match(/getByRole\(['"]([^'"]+)['"]/);if(i&&i[1])return i[1];let n=e.match(/getByTestId\(['"]([^'"]+)['"]/);return n&&n[1]?`element with testId "${n[1]}"`:"element"}function Or(e){let t=e.match(/\.fill\(['"]([^'"]*)['"]\)/);if(t&&t[1]!==void 0)return t[1];let i=e.match(/\.press\(['"]([^'"]+)['"]\)/);if(i&&i[1])return i[1];let n=e.match(/\.selectOption\(['"]([^'"]+)['"]\)/);return n&&n[1]?n[1]:""}function hf(e){let t=e.match(/button:\s*['"]([^'"]+)['"]/);return t?t[1]:void 0}function mf(e){let t=e.match(/modifiers:\s*\[([^\]]+)\]/);if(t&&t[1])return t[1].split(",").map(i=>i.trim().replace(/['"]/g,""))}function Gu(e,t){let i=e.name||"unknown",n=Nr(t,e.selector||""),o=e.ariaSnapshot??e.arIAaSnapshot??"",a=e.ref,r=/getByTestId\s*\(/.test(n),l=(a&&o&&r?Dr(o,a):null)??Lr(n),d,c,u={};switch(i){case"click":{let m=hf(t),g=mf(t);m==="right"?(d="right_click_on_element",c=`Right click on ${l}`):(d="click_element",c=`Click on ${l}`),u={index:0},m&&m!=="left"&&(u.button=m),g&&(u.modifiers=g);break}case"fill":{let m=e.text||e.value||Or(t)||"";d="fill",c=m?`Fill ${l} with '${m}'`:`Fill ${l}`,u={value:m,index:0};break}case"press":{let m=e.key||Or(t)||"";d="press",c=`Press '${m}' on ${l}`,u={keyComb:m,index:0};break}case"selectOption":{let m=e.options?.[0]||Or(t)||"";d="select_dropdown_option",c=`Select '${m}' from ${l}`,u={text:m,index:0};break}case"check":d="click_element",c=`Check ${l}`,u={index:0};break;case"uncheck":d="click_element",c=`Uncheck ${l}`,u={index:0};break;case"setInputFiles":{let m=e.files||[];d="upload_file",c=m.length>0?`Upload file(s) to ${l}`:`Upload file to ${l}`,u={paths:m,index:0};break}case"navigate":case"goto":d="go_to_url",c=`Navigate to ${e.url||"URL"}`,u={url:e.url||"",new_tab:!1};break;case"dblclick":d="double_click_on_element",c=`Double click on ${l}`,u={index:0};break;case"hover":d="hover",c=`Hover over ${l}`,u={index:0};break;case"wheel":case"scroll":d="scroll",c=`Scroll on ${l}`,u={x:e.deltaX||0,y:e.deltaY||0,index:e.selector?0:-1};break;case"dragTo":d="drag_drop",c=`Drag ${l} to target`,u={index:0};break;case"screenshot":d="wait",c="Take screenshot",u={seconds:.5};break;case"wait":d="wait",c=`Wait for ${e.timeout||1e3}ms`,u={seconds:(e.timeout||1e3)/1e3};break;default:d="click_element",c=`${i} on ${l}`,u={index:0};break}return{locator:n,xpath:e.xpath||"",css_selector:e.css_selector||"",unique_selector:e.selector||e.css_selector||"",frame_path:e.frame_path||[],action_data:{action_name:d,args:[],kwargs:u},action_description:c,url:"",feedback:""}}var Wu,Uu,Bu=f(()=>{"use strict";Wu=require("uuid"),Uu=()=>(0,Wu.v4)()});function Rr(e,t){let i=[];t.version!=="1.0"&&i.push(`Unsupported patch version: ${t.version}`),(!Array.isArray(t.operations)||t.operations.length===0)&&i.push("Patch must have at least one operation");for(let n=0;n<t.operations.length;n++){let o=t.operations[n],a=`operations[${n}]`;switch(o.reason||i.push(`${a}: missing reason`),o.op){case"remove":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`);break}case"modify":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}case"insert":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),o.position!=="before"&&o.position!=="after"&&i.push(`${a}: position must be 'before' or 'after'`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}default:i.push(`${a}: unknown operation type "${o.op}"`)}}return{valid:i.length===0,errors:i}}function Fr(e,t){let i=Rr(e,t);if(!i.valid)throw new Error(`Invalid patch: ${i.errors.join("; ")}`);let n=[...e],o=t.operations.map((s,l)=>({...s,originalOrder:l})),a={remove:0,modify:1,insert:2},r=[...o].sort((s,l)=>s.index!==l.index?l.index-s.index:a[s.op]-a[l.op]);for(let s of r)switch(s.op){case"remove":n.splice(s.index,1);break;case"modify":n[s.index]=s.statement;break;case"insert":s.position==="before"?n.splice(s.index,0,s.statement):n.splice(s.index+1,0,s.statement);break}return n}function ju(e,t){let i=(0,Jo.parse)(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let n=i.statements;if(!Array.isArray(n))throw new Error('YAML must have a "statements" array');let o=Fr(n,t);i.statements=o;let a=(0,Jo.stringify)(i,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"});return mt(a),{modifiedYaml:a,modifiedStatements:o}}var Jo,Ku=f(()=>{"use strict";Yo();Jo=require("yaml")});var Hr,Wr,zu,Vu=f(()=>{"use strict";Hr=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(Hr||{}),Wr=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(Wr||{}),zu=18e4});var Ur,Gr,Xu=f(()=>{"use strict";Ur=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(Ur||{}),Gr=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(Gr||{})});function Yu(e){return e?e.startsWith(ke)?"android":e.startsWith(Se)?"ios":"web":"web"}function Ju(e){return e?e.startsWith(ke)||e.startsWith(Se):!1}function qu(e){return!!e&&e.startsWith(ke)}function Zu(e){return!!e&&e.startsWith(Se)}function Qu(e){return e.startsWith(ke)?e.slice(ke.length):e.startsWith(Se)?e.slice(Se.length):e}function eh(e){return`${ke}${e}`}function th(e){return`${Se}${e}`}function qo(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function ih(e){return e?!qo(e):!1}function Br(e){return e?qo(e)?["web"]:["android","ios"]:["web","android","ios"]}function nh(e,t){if(!t)return!0;let i=Br(t);return e==="desktop"||e==="mobile"?i.includes("web"):i.includes(e)}var ke,Se,Zo=f(()=>{"use strict";ke="android:",Se="ios:"});function oh(e){let t=e.trim();if(!t||t.startsWith("List of devices"))return null;let i=t.split(/\s+/);if(i.length<2)return null;let n=i[0],o=i[1],a="usb";return n.startsWith("emulator-")?a="emulator":n.includes(":")&&(a="wifi"),{id:n,state:o,connectionType:a}}function ah(e){return e.startsWith(ke)?e:`${ke}${e}`}function rh(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}var sh=f(()=>{"use strict";Zo()});function lh(e){return e.startsWith(Se)?e:`${Se}${e}`}function ch(e){let t=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${t} - Simulator`:`${e.name}${t}`}function dh(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var uh=f(()=>{"use strict";Zo()});var jr,Qo,Kr,zr,Vr,Xr,Yr,Jr,qr,Zr,pt,Qr,cn,es,ts,Xt,hh,dn,mh,ph,ea,gh,fh,wh,bh,yh=f(()=>{"use strict";jr="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Qo=112,Kr=1920,zr=1080,Vr=1920,Xr=1080-Qo,Yr=1280,Jr=720,qr=500,Zr=500,pt="Desktop Chrome",Qr=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Qr||{}),cn={"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"}},es=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(es||{}),ts={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"]},Xt=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),ts[e].map(n=>cn[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},hh=()=>Object.keys(cn),dn=e=>cn[e],mh={desktop:{label:"Desktop",type:"desktop",devices:Xt("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Xt("mobile")}},ph={desktop:{label:"Desktop",type:"desktop",devices:Xt("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Xt("mobile",!0)}},ea=(e,t=!1)=>{let i={userAgent:jr,viewport:{width:Vr,height:Xr},isMobile:!1,hasTouch:!1};if(!e||e===pt)return i;let n=dn(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(qr/o,1),s=Math.max(Zr/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},gh=e=>{let t={width:Kr,height:zr};if(!e||e===pt)return t;let i=ea(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+Qo}:t},fh=e=>{let t={width:Yr,height:Jr};if(!e||e===pt)return t;let i=ea(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},wh=e=>!e||e===pt?void 0:dn(e)?.channel,bh=e=>!e||e===pt?"chromium":dn(e)?.defaultBrowserType??"chromium"});var xh,_h=f(()=>{"use strict";xh=class vh{data={};sensitive=new Set;get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new vh;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}}});function kh(e,t=pf()){return{copilot:e?.models?.copilot||t.COPILOT_MODEL||as,webagent:e?.models?.webagent||t.WEB_AGENT_MODEL||ta,computer_use:e?.models?.computer_use||t.COMPUTER_USE_MODEL||rs}}function Sh(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.GOOGLE_API_KEY||Eh(e))return un;if(e.ANTHROPIC_API_KEY)return is;if(e.OPENAI_API_KEY)return ns;if(e.SHIPLIGHT_API_TOKEN)return ta}}function Eh(e){let t=e.GOOGLE_GENAI_USE_VERTEXAI;return(t==="true"||t==="True")&&!!e.GOOGLE_CLOUD_PROJECT}function Th(e){let t=e?.WEB_AGENT_FALLBACK_MODELS;return t===void 0?[...ss]:t.split(",").map(i=>i.trim()).filter(i=>i.length>0)}function Ah(e){if(e){if(e.COMPUTER_USE_MODEL)return e.COMPUTER_USE_MODEL;if(e.GOOGLE_API_KEY||Eh(e))return Yt;if(e.OPENAI_API_KEY)return os;if(e.SHIPLIGHT_API_TOKEN)return Yt}}var is,un,ns,Yt,os,as,ta,rs,pf,ss,Mh=f(()=>{"use strict";is="claude-haiku-4-5",un="gemini-3.5-flash",ns="gpt-5.4-mini",Yt="gemini-3-flash-preview",os="gpt-5.4",as="claude-sonnet-4-6",ta=un,rs=Yt,pf=()=>typeof process<"u"?process.env:{};ss=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"])});var ls,Ih=f(()=>{"use strict";ls=(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))(ls||{})});var cs={};tt(cs,{ADDRESS_BAR_HEIGHT:()=>Qo,ANDROID_DEVICE_PREFIX:()=>ke,ActionEntitySchema:()=>yr,ActionSchema:()=>vr,AgentStatus:()=>ls,BaseStatementSchema:()=>ht,BrowserType:()=>Qr,ConditionSchema:()=>zo,ConditionType:()=>Wr,ConditionTypeSchema:()=>wr,DEFAULT_ANTHROPIC_MODEL:()=>is,DEFAULT_COMPUTER_USE_MODEL:()=>rs,DEFAULT_COPILOT_MODEL:()=>as,DEFAULT_DEVICE_NAME:()=>pt,DEFAULT_GEMINI_COMPUTER_USE_MODEL:()=>Yt,DEFAULT_GOOGLE_MODEL:()=>un,DEFAULT_OPENAI_COMPUTER_USE_MODEL:()=>os,DEFAULT_OPENAI_MODEL:()=>ns,DEFAULT_WEBAGENT_FALLBACK_MODELS:()=>ss,DEFAULT_WEBAGENT_MODEL:()=>ta,DEFAULT_WHILE_LOOP_TIMEOUT_MS:()=>zu,DEVICE_CATEGORIES:()=>ts,DeviceType:()=>es,DraftSchema:()=>xr,IOS_DEVICE_PREFIX:()=>Se,LoginType:()=>Ur,MIN_WINDOW_HEIGHT:()=>Zr,MIN_WINDOW_WIDTH:()=>qr,NON_INTENT_ACTIONS:()=>Cr,NodeJSCodeCommon:()=>ou,PLAYWRIGHT_DEVICES:()=>cn,RECORD_VIDEO_HEIGHT:()=>Jr,RECORD_VIDEO_WIDTH:()=>Yr,StatementSchema:()=>ue,StatementType:()=>Hr,StatementTypeSchema:()=>br,TestFlowSchema:()=>Vo,TestGroupEntrySchema:()=>_r,TestGroupSchema:()=>sn,TwoFactorAuthType:()=>Gr,UI_DEVICE_CATEGORIES:()=>mh,UI_DEVICE_CATEGORIES_ELECTRON:()=>ph,USER_AGENT:()=>jr,VIEWPORT_HEIGHT:()=>Xr,VIEWPORT_WIDTH:()=>Vr,VariableStore:()=>xh,WINDOW_HEIGHT:()=>zr,WINDOW_WIDTH:()=>Kr,actionEntityToYaml:()=>ku,actionStepsMapToTestFlowSections:()=>fu,allowPureVisionAction:()=>pu,applyPatchToYaml:()=>Fr,applyPatchToYamlString:()=>ju,collectActionSteps:()=>et,convertPlaywrightActionToEntity:()=>Gu,countIntentStatements:()=>$r,createAndroidDeviceName:()=>eh,createEmptyStore:()=>$u,createIOSDeviceName:()=>th,createRunnerStoreEntry:()=>Pu,extractActionStepsFromTestFlow:()=>gu,extractAndAttachComments:()=>Mr,extractDeviceIdentifier:()=>Qu,extractElementDescription:()=>Lr,extractElementDescriptionFromAriaSnapshot:()=>Dr,extractLocatorFromCode:()=>Nr,extractYamlMetadata:()=>Tu,findNextAfterContainer:()=>Qe,findNextSibling:()=>Ze,findNextStatement:()=>qe,findPathBetweenStatements:()=>uu,findStatementPathById:()=>me,generateUid:()=>Uu,getAllDeviceNames:()=>hh,getAllReferenceIds:()=>hu,getAllStatementsInOrder:()=>rn,getAndroidDeviceDisplayName:()=>rh,getBrowserWindowSize:()=>gh,getCompatiblePlatforms:()=>Br,getDeviceBrowserType:()=>bh,getDeviceByName:()=>dn,getDeviceChannel:()=>wh,getDeviceOptions:()=>ea,getDevicesByCategory:()=>Xt,getIOSDeviceDisplayName:()=>ch,getLoginConfigPlatform:()=>ru,getRecordVideoSize:()=>fh,getStatementContainers:()=>Ue,getStoreSize:()=>Ru,getTestPlatformFromDeviceName:()=>Yu,hasReferenceIds:()=>fr,isAndroidDevice:()=>qu,isAppPackage:()=>ih,isDynamicAction:()=>mu,isExecutableStatement:()=>du,isIOSDevice:()=>Zu,isNativeDevice:()=>Ju,isPhysicalDeviceUDID:()=>dh,isPlatformCompatibleWithUrl:()=>nh,isStoreEmpty:()=>Nu,isWebUrl:()=>qo,mergeActionEntitiesIntoTestFlow:()=>Fu,mergeStoreUpdates:()=>Du,parseAdbDeviceLine:()=>oh,parseYamlArrayItems:()=>Eu,replaceVariables:()=>lu,resolveActionEntity:()=>Ou,resolveComputerUseModelFromEnv:()=>Ah,resolveModels:()=>kh,resolveWebAgentFallbackModelsFromEnv:()=>Th,resolveWebAgentModelFromEnv:()=>Sh,suiteToYaml:()=>Tr,testFlowToYaml:()=>xu,testFlowToYamlObject:()=>Er,toAndroidDeviceName:()=>ah,toIOSDeviceName:()=>lh,updateStoreEntry:()=>Lu,validatePatch:()=>Rr,validateTestYaml:()=>Iu,yamlObjectsToString:()=>vu,yamlToActionEntity:()=>Su,yamlToTestFlow:()=>mt});var ds=f(()=>{"use strict";au();su();cu();Cu();Hu();Bu();Ko();Ku();Yo();Vu();kr();Xu();sh();uh();Zo();yh();_h();Mh();Ih()});var bf={};tt(bf,{EXCLUDED_CONTEXT_OPTION_KEYS:()=>gf,HANDLED_CONTEXT_OPTION_KEYS:()=>Nh,SDK_ENV_ALLOWLIST:()=>jh,VIEWPORT_INCOMPATIBLE_OPTIONS:()=>Rh,applyVarsOverride:()=>Bh,buildSdkEnv:()=>Kh,createTestContext:()=>Wh,dropViewportIncompatibleOptions:()=>Fh,expect:()=>Jt.expect,isDeclaredSensitive:()=>Gh,mergeResolvedContextOptions:()=>hs,parseVarsOverrideEnv:()=>Uh,resolveAuthState:()=>Dh,resolveProjectRoot:()=>us,test:()=>wf});module.exports=qh(bf);var Ge=U(require("path"),1),Oh=U(require("fs"),1),Lh=require("url"),Jt=require("@playwright/test");var ce=U(require("fs"),1),ft=U(require("path"),1),oa=require("crypto"),aa=require("os");function bs(e){return[`--disable-extensions-except=${e}`,`--load-extension=${e}`,"--no-first-run","--disable-default-apps"]}function ys(e){if(!ce.existsSync(e))return console.warn(`[fixture] extensionStorageState file not found: ${e}`),null;let t;try{t=JSON.parse(ce.readFileSync(e,"utf-8"))}catch(a){throw new Error(`[fixture] Failed to parse extensionStorageState at ${e}: ${a}`)}let i=t;if(!Array.isArray(i.cookies))return null;let n=(Date.now()+365*24*60*60*1e3)/1e3,o=i.cookies.filter(a=>a&&typeof a=="object"&&typeof a.name=="string"&&typeof a.domain=="string");return o.length<i.cookies.length&&console.warn(`[fixture] Skipped ${i.cookies.length-o.length} malformed cookies (missing name or domain)`),o.map(a=>({...a,expires:n}))}function xs(e,t=process.cwd()){if(e){let n=ft.resolve(t,e),o=ft.join((0,aa.tmpdir)(),`ext-profile-${(0,oa.randomUUID)()}`);if(ce.existsSync(n)){try{ce.cpSync(n,o,{recursive:!0})}catch(r){try{ce.rmSync(o,{recursive:!0,force:!0})}catch(s){console.warn("[fixture] Failed to clean up partial profile copy:",o,s)}throw new Error(`[fixture] Failed to copy extension profile from ${n}: ${r}`)}let a=ft.join(o,"SingletonLock");ce.existsSync(a)&&ce.rmSync(a,{force:!0})}else ce.mkdirSync(o,{recursive:!0});return o}let i=ft.join((0,aa.tmpdir)(),`ext-profile-${(0,oa.randomUUID)()}`);return ce.mkdirSync(i,{recursive:!0}),i}pr();var jg=U(require("dotenv"),1),Kg="__shiplightDotenvCache__";function zg(){return globalThis[Kg]}function gr(){let e=zg();return e===void 0?process.env:e}function us(e){return e.config?.rootDir??process.cwd()}async function Dh(e,t,i,n=process.cwd()){let o=Ge.resolve(n,e.auth),a=await import((0,Lh.pathToFileURL)(o).href),r=a.login||a.default;if(typeof r!="function")throw new Error(`auth module "${e.auth}" must export a login(args, browser?) function that returns a storageState file path`);let s={...e.args};i&&!s.baseUrl&&(s.baseUrl=i);let l=await r(s,t);if(typeof l!="string")throw new Error(`auth module "${e.auth}" login() must return a storageState file path (got ${typeof l})`);return l}function Ch(e){return!(!e||e==="off")}var Nh=["acceptDownloads","baseURL","bypassCSP","colorScheme","deviceScaleFactor","extraHTTPHeaders","geolocation","hasTouch","httpCredentials","ignoreHTTPSErrors","isMobile","javaScriptEnabled","locale","offline","permissions","proxy","serviceWorkers","timezoneId","userAgent","viewport"],gf=["storageState","contextOptions","clientCertificates"],Rh=[{key:"deviceScaleFactor",conflicts:e=>e!==void 0},{key:"isMobile",conflicts:e=>!!e}];function Fh(e){if(e.viewport!==null)return[];let t=[];for(let{key:i,conflicts:n}of Rh)n(e[i])&&(delete e[i],t.push(i));return t}function hs(e,t){let i={...e};for(let[o,a]of Object.entries(t))a!==void 0&&(i[o]=a);let n=Fh(i);return n.length>0&&console.warn(`[fixture] "viewport: null" (no fixed viewport) is incompatible with ${n.join(" and ")}; dropping ${n.length>1?"them":"it"} so the browser context can be created.`),i}function Hh(e,t){return!e||e==="off"?!1:e==="on"?!0:e==="retain-on-failure"?t.status!==t.expectedStatus:e==="on-first-retry"?t.retry>0:typeof e=="object"&&e!==null&&"mode"in e?Hh(e.mode,t):!0}async function $h(e,t,i){let n=Hh(t,i);for(let o of e)try{if(n){let a=await o.path();await i.attach("video",{path:a,contentType:"video/webm"})}else await o.delete()}catch(a){console.warn("[fixture] Failed to process video:",a)}}var ia;async function Ph(){return ia||(ia=await Promise.resolve().then(()=>(pr(),nu)),ia)}var ff=new Set(["get","set","getAll","has","__variableStore"]);function Wh(e){let t={__variableStore:e,get(i){return e.get(i)},set(i,n,o=!1){e.set(i,n,o)},getAll(){return e.getAll()}};return new Proxy(t,{get(i,n,o){if(n in i)return Reflect.get(i,n,o);if(typeof n=="string")return i.get(n)},set(i,n,o){return typeof n!="string"||ff.has(n)?Reflect.set(i,n,o):(i.set(n,o),!0)},has(i,n){return n in i?!0:typeof n=="string"?e.has?.(n)??!1:!1}})}function Uh(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch(n){throw new Error(`SHIPLIGHT_VARS_OVERRIDE is not valid JSON: ${n.message}`)}if(t===null||typeof t!="object"||Array.isArray(t))throw new Error("SHIPLIGHT_VARS_OVERRIDE must be a JSON object");let i={};for(let[n,o]of Object.entries(t)){if(typeof o!="string")throw new Error(`SHIPLIGHT_VARS_OVERRIDE key "${n}" must be a string`);i[n]=o}return i}function Gh(e,t,i){let n=r=>{if(!r||!(e in r))return null;let s=r[e];return s&&typeof s=="object"&&"value"in s?s.sensitive===!0:!1},o=n(i);if(o!==null)return o;let a=n(t);return a!==null?a:!1}function Bh(e,t,i,n=process.env.SHIPLIGHT_VARS_OVERRIDE){let o=Uh(n);if(o)for(let[a,r]of Object.entries(o)){let s=Gh(a,t,i);e.set(a,r,s)}}var jh=["GOOGLE_API_KEY","ANTHROPIC_API_KEY","OPENAI_API_KEY","OPENAI_BASE_URL","ANTHROPIC_MODELS_USE_VERTEXAI","GOOGLE_GENAI_USE_VERTEXAI","GOOGLE_CLOUD_PROJECT","GOOGLE_CLOUD_LOCATION","MAILGUN_API_KEY","MAILGUN_DOMAIN","SHIPLIGHT_API_TOKEN","SHIPLIGHT_API_URL","WEB_AGENT_LLM_TIMEOUT_MS"];function Kh(e=gr()){let t={};for(let i of jh)t[i]=e[i]??"";return t}var wf=Jt.test.extend({account:[void 0,{option:!0}],autoDismissModal:[!1,{option:!0}],variables:[void 0,{option:!0}],extensionDir:[void 0,{option:!0}],userDataDir:[void 0,{option:!0}],extensionStorageState:[void 0,{option:!0}],launchOptions:async({launchOptions:e},t)=>{if(!process.env.OMNITERM_BROWSER_REGISTRY_URL){await t(e);return}let i=e?.args??[],n={...e,args:[...i,"--remote-debugging-port=0"]};await t(n)},browser:async({browser:e},t)=>{let i=null;if(process.env.OMNITERM_BROWSER_REGISTRY_URL)try{let n=await Fo(process.pid),o=process.env.TEST_WORKER_INDEX??"?";i=await Ut({cdpUrl:n,label:`shiplight test w${o}`,pid:process.pid})}catch{}await t(e),await Gt(i)},context:async({browser:e,account:t,extensionDir:i,userDataDir:n,extensionStorageState:o,acceptDownloads:a,baseURL:r,bypassCSP:s,colorScheme:l,deviceScaleFactor:d,extraHTTPHeaders:c,geolocation:u,hasTouch:m,httpCredentials:g,ignoreHTTPSErrors:y,isMobile:_,javaScriptEnabled:x,locale:p,offline:b,permissions:E,proxy:v,serviceWorkers:k,timezoneId:S,userAgent:I,viewport:O},C,$)=>{let W=i||n,X=us($),F={acceptDownloads:a,baseURL:r,bypassCSP:s,colorScheme:l,deviceScaleFactor:d,extraHTTPHeaders:c,geolocation:u,hasTouch:m,httpCredentials:g,ignoreHTTPSErrors:y,isMobile:_,javaScriptEnabled:x,locale:p,offline:b,permissions:E,proxy:v,serviceWorkers:k,timezoneId:S,userAgent:I,viewport:O},K={};for(let B of Nh){if(!(B in F))throw new Error(`[fixture] HANDLED_CONTEXT_OPTION_KEYS lists "${B}" but the context fixture does not resolve it \u2014 add "${B}" to the fixture destructure and fixtureOptionValues so per-test use: overrides apply.`);K[B]=F[B]}if(W){if(t||$.project.use.auth)throw new Error('Cannot use both "extensionDir"/"userDataDir" and "auth" \u2014 persistent context tests manage their own context. Use extensionStorageState for authentication instead.');let B=$.project.use?.browserName;B&&B!=="chromium"&&console.warn(`[fixture] Persistent context requires Chromium but project is configured for "${B}". Forcing Chromium.`);let he=process.env.PLAYWRIGHT_HEADLESS==="true";i&&he&&console.warn("[fixture] PLAYWRIGHT_HEADLESS=true with extensionDir \u2014 Chrome extensions will not function in headless mode.");let te=xs(n,X),se=i?bs(Ge.resolve(X,i)):[],ie=hs($.project.use,K),{storageState:Le,account:R,extensionDir:Z,userDataDir:ne,extensionStorageState:De,autoDismissModal:na,video:L,...j}=ie,Ne=Ch(L)?{dir:$.outputDir}:void 0,le;try{if(le=await Jt.chromium.launchPersistentContext(te,{...j,headless:he,args:se,viewport:"viewport"in j?j.viewport:{width:1280,height:720},...Ne?{recordVideo:Ne}:{}}),o){let gt=Ge.resolve(X,o),pe=ys(gt);pe&&await le.addCookies(pe)}await C(le)}finally{let gt=le?.pages().map(pe=>pe.video()).filter(pe=>pe!==null)??[];if(await le?.close().catch(pe=>{console.warn("[fixture] Failed to close persistent context:",pe)}),await $h(gt,L,$),!n)try{Oh.rmSync(te,{recursive:!0,force:!0})}catch(pe){console.warn("[fixture] Failed to clean up temp profile dir:",te,pe)}}}else{let B=hs($.project.use,K),he=$.project.use,te=he.auth?{auth:he.auth,args:he.args}:t;if(te){if(!te.auth)throw new Error("Auth is declared but missing the script path. Provide auth in playwright.config.ts: use: { auth: './auth.login.ts' }");B.storageState=await Dh(te,e,r,X)}let se=B.video;Ch(se)&&!B.recordVideo&&(B.recordVideo={dir:$.outputDir});let ie=await e.newContext(B);ie.addInitScript(Xe);try{await C(ie)}finally{let Le=ie.pages().map(R=>R.video()).filter(R=>R!==null);await ie.close(),await $h(Le,se,$)}}},page:async({context:e},t)=>{let i=await e.newPage();await t(i)},testContext:async({variables:e},t,i)=>{let{VariableStore:n}=await Ph(),o=new n,a=l=>{if(l)for(let[d,c]of Object.entries(l))typeof c=="string"?o.set(d,c,!1):c&&typeof c=="object"&&"value"in c&&o.set(d,c.value,c.sensitive===!0)},r=i.project.use.variables;a(r),a(e),Bh(o,r,e);let s=Wh(o);global.testContext=s,global.$=s,global.ctx=s,await t(s),delete global.testContext,delete global.$,delete global.ctx},$:async({testContext:e},t)=>{await t(e)},ctx:async({testContext:e},t)=>{await t(e)},agent:async({page:e,testContext:t,autoDismissModal:i},n,o)=>{let{WebAgent:a,createAgentContext:r,configureSdk:s,parseSdkLogLevelFromEnv:l}=await Ph(),d=l();s({env:Kh(),...d!==void 0&&{logLevel:d}});let{resolveWebAgentModelFromEnv:c,resolveComputerUseModelFromEnv:u,resolveWebAgentFallbackModelsFromEnv:m}=await Promise.resolve().then(()=>(ds(),cs)),g=gr(),y=c(g);if(!y)throw new Error("No AI model configured. Set WEB_AGENT_MODEL, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, SHIPLIGHT_API_TOKEN, or Google Vertex via ADC (GOOGLE_GENAI_USE_VERTEXAI=true + GOOGLE_CLOUD_PROJECT) in your .env file (or in the runner environment for CI).");let _=u(g),x=m(g),p=t.__variableStore,b=r({model:y,fallbackModels:x,computer_use_model:_,variableStore:p,autoDismissModal:i,testDataDir:us(o),downloadDir:Ge.join(o.outputDir,"downloads")}),E=Ge.join(o.outputDir,"artifacts");b.stepTracking={results:{},artifactsDir:E};let v=new a(b),k=e.context();v.agentServices.setupPageTracking(k);for(let S of k.pages())v.setupDownloadTracking(S),v.setupDialogHandling(S);k.on("page",S=>{v.setupDownloadTracking(S),v.setupDialogHandling(S)}),global.agent=v,await n(v),delete global.agent;try{let S=o.outputDir;await v.writeExecutionResults(S);let I=Ge.join(S,"test-results.json");await(await import("fs/promises")).stat(I).catch(()=>null)&&await o.attach("shiplight-results",{path:I,contentType:"application/json"})}catch(S){console.error("[Shiplight] Failed to attach step results:",S)}try{let S=v.getNewActionEntities();if(S.size>0&&o.status==="passed"){let{createEmptyStore:I,createRunnerStoreEntry:O}=await Promise.resolve().then(()=>(ds(),cs)),C=await import("fs/promises"),$=I();for(let[X,F]of S)$.entries[X]=O(F,0);let W=Ge.join(o.outputDir,"new-action-entities.json");await C.writeFile(W,JSON.stringify($,null,2)),await o.attach("shiplight-new-action-entities",{path:W,contentType:"application/json"}),console.log(`[Shiplight] ${S.size} healed action entit${S.size===1?"y":"ies"} saved`)}}catch(S){console.warn("[Shiplight] Failed to persist new action entities:",S)}}});0&&(module.exports={EXCLUDED_CONTEXT_OPTION_KEYS,HANDLED_CONTEXT_OPTION_KEYS,SDK_ENV_ALLOWLIST,VIEWPORT_INCOMPATIBLE_OPTIONS,applyVarsOverride,buildSdkEnv,createTestContext,dropViewportIncompatibleOptions,expect,isDeclaredSensitive,mergeResolvedContextOptions,parseVarsOverrideEnv,resolveAuthState,resolveProjectRoot,test});